diff options
author | Bastien Nocera <hadess@hadess.net> | 2006-09-04 17:50:18 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2006-09-04 17:50:18 +0000 |
commit | 5501c248d977dd0349dde16e1c61b3ccd7aca8c1 (patch) | |
tree | f08f7ba53ecb3af89c052ea2aec304520ac37995 | |
parent | beb2f8f2fb745ef718d229aacd468f91f938c37c (diff) |
add totem_skipto_set_current() set the range as soon as we create the
2006-09-04 Bastien Nocera <hadess@hadess.net>
* src/totem-skipto.c: (totem_skipto_set_current):
* src/totem-skipto.h: add totem_skipto_set_current()
* src/totem.c: (on_skip_to1_activate): set the range as soon as
we create the "Skip to..." dialogue, as well as setting the
current time as the default (Closes: #335649)
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/totem-skipto.c | 9 | ||||
-rw-r--r-- | src/totem-skipto.h | 1 | ||||
-rw-r--r-- | src/totem.c | 6 |
4 files changed, 24 insertions, 0 deletions
@@ -1,5 +1,13 @@ 2006-09-04 Bastien Nocera <hadess@hadess.net> + * src/totem-skipto.c: (totem_skipto_set_current): + * src/totem-skipto.h: add totem_skipto_set_current() + * src/totem.c: (on_skip_to1_activate): set the range as soon as + we create the "Skip to..." dialogue, as well as setting the + current time as the default (Closes: #335649) + +2006-09-04 Bastien Nocera <hadess@hadess.net> + * src/totem-mozilla-viewer.c: (totem_embedded_add_children): Hide the preferences menu item as it doesn't do anything yet (Closes: #353405) diff --git a/src/totem-skipto.c b/src/totem-skipto.c index d96068bf..b3baa481 100644 --- a/src/totem-skipto.c +++ b/src/totem-skipto.c @@ -112,6 +112,15 @@ totem_skipto_set_seekable (TotemSkipto *skipto, gboolean seekable) GTK_RESPONSE_OK, seekable); } +void +totem_skipto_set_current (TotemSkipto *skipto, gint64 time) +{ + g_return_if_fail (TOTEM_IS_SKIPTO (skipto)); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (skipto->_priv->spinbutton), + (gdouble) (time / 1000)); +} + static void spin_button_activate_cb (GtkEntry *entry, TotemSkipto *skipto) { diff --git a/src/totem-skipto.h b/src/totem-skipto.h index 5e272c63..bff3bbc2 100644 --- a/src/totem-skipto.h +++ b/src/totem-skipto.h @@ -51,6 +51,7 @@ GtkWidget *totem_skipto_new (const char *glade_filename); gint64 totem_skipto_get_range (TotemSkipto *skipto); void totem_skipto_update_range (TotemSkipto *skipto, gint64 time); void totem_skipto_set_seekable (TotemSkipto *skipto, gboolean seekable); +void totem_skipto_set_current (TotemSkipto *skipto, gint64 time); G_END_DECLS diff --git a/src/totem.c b/src/totem.c index 06fd8548..65f85ad5 100644 --- a/src/totem.c +++ b/src/totem.c @@ -2145,6 +2145,7 @@ static void on_skip_to1_activate (GtkButton *button, Totem *totem) { char *filename; + gint64 time; if (totem->seekable == FALSE) return; @@ -2159,6 +2160,11 @@ on_skip_to1_activate (GtkButton *button, Totem *totem) totem->skipto = TOTEM_SKIPTO (totem_skipto_new (filename)); g_free (filename); + time = bacon_video_widget_get_stream_length (totem->bvw); + totem_skipto_update_range (TOTEM_SKIPTO (totem->skipto), time); + time = bacon_video_widget_get_current_time (totem->bvw); + totem_skipto_set_current (TOTEM_SKIPTO (totem->skipto), time); + g_signal_connect (G_OBJECT (totem->skipto), "delete-event", G_CALLBACK (gtk_widget_destroy), NULL); g_signal_connect (G_OBJECT (totem->skipto), "response", |