[Xfce4-commits] <parole:bluesabre/gtk3> Merge branch 'bluesabre/gtk3' of ssh://git.xfce.org/apps/parole into bluesabre/gtk3

Sean Davis noreply at xfce.org
Sun Sep 22 13:02:02 CEST 2013


Updating branch refs/heads/bluesabre/gtk3
         to ea95a43cd4edb449cdd662a67ae252f99be44aaa (commit)
       from f6c28682248152abf58a88f7a5c269285c7ae7e4 (commit)

commit ea95a43cd4edb449cdd662a67ae252f99be44aaa
Merge: f6c2868 8cb12d4
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Sun Sep 22 06:55:14 2013 -0400

    Merge branch 'bluesabre/gtk3' of ssh://git.xfce.org/apps/parole into bluesabre/gtk3

commit 8cb12d45f65f64ee68991b23907114e9d9372db7
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Sat Sep 21 09:57:12 2013 +0200

    Remove/clear auto-saved-playlist file upon using the clear-playlist button

commit 071acfe9893612c7a498029993e311fa358b61c5
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Sat Sep 21 01:54:54 2013 +0200

    Add a dummy-test to see whether plugin-loading fails

commit 01bf90e358e4580553d6a0d6cd03cc825c291e60
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Wed Sep 18 12:18:42 2013 +0200

    Add a menu accelerator to make the keyboard-shortcut more discoverable

commit 497cd7e12e737e214b8acbffe601589949d73ee1
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Wed Sep 18 10:25:50 2013 +0200

    Add keyboard-shortcut (Control+m) to hide menubar

commit d7594d0c7bd9cf706e36b8beb9055ded57e020a0
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Mon Sep 16 22:24:28 2013 +0200

    Add option to hide the menubar to the context-menu

 src/parole-medialist.c       |    8 ++++++++
 src/parole-player.c          |   27 ++++++++++++++++++++++++++-
 src/parole-plugins-manager.c |   10 ++++++++--
 3 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/src/parole-medialist.c b/src/parole-medialist.c
index bd7a512..73ac2a6 100644
--- a/src/parole-medialist.c
+++ b/src/parole-medialist.c
@@ -572,7 +572,15 @@ parole_media_list_add_clicked_cb (GtkButton *button, ParoleMediaList *list)
 void 
 parole_media_list_clear_clicked_cb (GtkButton *button, ParoleMediaList *list)
 {
+    gchar *playlist_filename;
+    GFile *playlist_file;
     parole_media_list_clear_list (list);
+    playlist_filename = xfce_resource_save_location (XFCE_RESOURCE_DATA, 
+                                                         PAROLE_AUTO_SAVED_PLAYLIST, 
+                                                         FALSE);
+    playlist_file = g_file_new_for_path(playlist_filename);
+    g_file_delete(playlist_file, NULL, NULL);
+    g_free(playlist_filename);
 }
 
 /**
diff --git a/src/parole-player.c b/src/parole-player.c
index d6f70bc..a7b5be9 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -153,7 +153,7 @@ void        parole_player_toggle_playlist_action_cb (GtkAction *action,
                                                      
 void        parole_player_fullscreen_action_cb      (GtkAction *action, 
                                                      ParolePlayer *player);
-                             
+
 void        parole_player_seekf_cb                  (GtkWidget *widget, 
                                                      ParolePlayer *player, 
                                                      gdouble seek);
@@ -2003,10 +2003,18 @@ void parole_player_fullscreen_action_cb (GtkAction *action, ParolePlayer *player
     parole_player_full_screen (player, !player->priv->full_screen);
 }
 
+void parole_player_hide_menubar_cb (GtkWidget *widget, ParolePlayer *player)
+{
+    gtk_widget_set_visible(player->priv->menu_bar, !gtk_widget_get_visible(player->priv->menu_bar));
+}
+
 static void
 parole_player_show_menu (ParolePlayer *player, guint button, guint activate_time)
 {
     GtkWidget *menu, *mi;
+    GtkAccelGroup *accels = gtk_accel_group_new();
+
+    gtk_window_add_accel_group(GTK_WINDOW(player->priv->window), accels);
     
     player->priv->current_media_type = parole_gst_get_current_stream_type (PAROLE_GST (player->priv->gst));
     
@@ -2035,6 +2043,18 @@ parole_player_show_menu (ParolePlayer *player, guint button, guint activate_time
     mi = gtk_action_create_menu_item(player->priv->media_fullscreen_action);
     gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
 
+    /*
+     * Un/Hide menubar
+     */
+    mi = gtk_check_menu_item_new_with_label(gtk_widget_get_visible(player->priv->menu_bar) ? _("Hide menubar") : _("Show menubar"));
+    g_signal_connect (mi, "activate",
+        G_CALLBACK (parole_player_hide_menubar_cb), player);
+    gtk_widget_add_accelerator(mi, "activate", accels,
+                           GDK_KEY_m, GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
+    gtk_widget_show (mi);
+    gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
+
+
     g_signal_connect_swapped (menu, "selection-done",
                               G_CALLBACK (gtk_widget_destroy), menu);
     
@@ -2472,6 +2492,11 @@ parole_player_handle_key_press (GdkEventKey *ev, ParolePlayer *player)
         case GDK_KEY_Escape:
             parole_player_full_screen (player, FALSE);
             break;
+        case GDK_KEY_m:
+            if (ev->state & GDK_CONTROL_MASK)
+                parole_player_hide_menubar_cb(NULL, player);
+            ret_val = TRUE;
+            break;
 #ifdef HAVE_XF86_KEYSYM
         case XF86XK_OpenURL:
             parole_player_full_screen (player, FALSE);
diff --git a/src/parole-plugins-manager.c b/src/parole-plugins-manager.c
index ee4a6c0..bef4b80 100644
--- a/src/parole-plugins-manager.c
+++ b/src/parole-plugins-manager.c
@@ -269,8 +269,14 @@ parole_plugins_manager_cell_toggled_cb (GtkCellRendererToggle *cell_renderer,
         {
             if ( active )
             {
-                g_type_module_use (G_TYPE_MODULE (module));
-                parole_provider_module_new_plugin (module);
+                if (g_type_module_use (G_TYPE_MODULE (module)))
+                    parole_provider_module_new_plugin (module);
+                else
+                {
+                    g_warning("Failed to load plugin.");
+                    parole_provider_module_free_plugin (module);
+                    g_type_module_unuse (G_TYPE_MODULE (module));
+                }
             }
             else
             {


More information about the Xfce4-commits mailing list