diff options
author | Benjamin Otte <otte@gnome.org> | 2008-01-14 12:06:20 +0100 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2008-01-14 12:06:20 +0100 |
commit | 64bb6ad07d42ddf251c8e76dfb48b92c91a032a6 (patch) | |
tree | 0171c7149a99c8407a63fe2cb556f472ef296df4 /player | |
parent | 02510bc26d732606029799c1c2b3d82286017807 (diff) |
add a simple recent files menu entry
Diffstat (limited to 'player')
-rw-r--r-- | player/swfdec-player.ui | 10 | ||||
-rw-r--r-- | player/swfdec-window-handlers.c | 9 |
2 files changed, 18 insertions, 1 deletions
diff --git a/player/swfdec-player.ui b/player/swfdec-player.ui index fbba9e9..f28ca07 100644 --- a/player/swfdec-player.ui +++ b/player/swfdec-player.ui @@ -21,6 +21,13 @@ <accelerator key="O" modifiers="GDK_CONTROL_MASK"/> </child> <child> + <object class="GtkRecentAction" id="recent"> + <property name="label" translatable="yes">Open _Recent</property> + <property name="tooltip" translatable="yes">Select a recently opened file</property> + <signal name="item-activated" handler="menu_file_recent"/> + </object> + </child> + <child> <object class="GtkToggleAction" id="play"> <property name="label" translatable="yes">Play / P_ause</property> <property name="stock-id">gtk-media-play</property> @@ -66,11 +73,12 @@ <menubar name="player-menubar"> <menu name="file" action="file-menu"> <menuitem name="open" action="open"/> - <placeholder name="recent-placeholder"/> + <menuitem name="recent" action="recent"/> <separator/> <menuitem name="play" action="play"/> <menuitem name="mute" action="mute"/> <separator/> + <placeholder name="recent-placeholder"/> <menuitem name="quit" action="quit"/> </menu> <menu name="help" action="help-menu"> diff --git a/player/swfdec-window-handlers.c b/player/swfdec-window-handlers.c index b169778..3171429 100644 --- a/player/swfdec-window-handlers.c +++ b/player/swfdec-window-handlers.c @@ -94,6 +94,15 @@ menu_file_close (GtkAction *action, SwfdecWindow *window) } void +menu_file_recent (GtkAction *action, SwfdecWindow *window) +{ + const char *url = gtk_recent_chooser_get_current_uri (GTK_RECENT_CHOOSER (action)); + + if (!swfdec_window_set_url (window, url)) + swfdec_window_new (url); +} + +void menu_help_about (GtkAction *action, SwfdecWindow *window) { static const char *authors[] = { |