[Xfce4-commits] <parole:master> Make Parole remember whether the playlist was shown/hidden

Simon Steinbeiss noreply at xfce.org
Mon Jul 23 01:24:39 CEST 2012


Updating branch refs/heads/master
         to 6e2c241aae2fc7c5903738afd0db4fa961ee8060 (commit)
       from 8aedf5a1ce74dc0a00089f3675e62f2bb44b57a1 (commit)

commit 6e2c241aae2fc7c5903738afd0db4fa961ee8060
Author: Simon Steinbeiss <ochosi at xfce.org>
Date:   Sat Jul 14 16:29:38 2012 +0200

    Make Parole remember whether the playlist was shown/hidden

 src/parole-conf.c   |    8 ++++++++
 src/parole-player.c |   19 ++++++++++++++++++-
 2 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/src/parole-conf.c b/src/parole-conf.c
index c75d387..498423f 100644
--- a/src/parole-conf.c
+++ b/src/parole-conf.c
@@ -68,6 +68,7 @@ enum
     PROP_MINIMIZED,
     PROP_MULTIMEDIA_KEYS,
     /*Playlist*/
+    PROP_SHOWHIDE_PLAYLIST,
     PROP_REPLACE_PLAYLIST,
     PROP_SCAN_FOLDER_RECURSIVELY,
     PROP_START_PLAYING_OPENED_FILES,
@@ -348,6 +349,13 @@ parole_conf_class_init (ParoleConfClass *klass)
      *Playlist options
      **/
     g_object_class_install_property (object_class,
+                                     PROP_SHOWHIDE_PLAYLIST,
+                                     g_param_spec_boolean ("showhide-playlist",
+                                                           NULL, NULL,
+                                                           FALSE,
+                                                           G_PARAM_READWRITE));
+
+    g_object_class_install_property (object_class,
                                      PROP_REPLACE_PLAYLIST,
                                      g_param_spec_boolean ("replace-playlist",
                                                            NULL, NULL,
diff --git a/src/parole-player.c b/src/parole-player.c
index 1db5296..c79d24f 100644
--- a/src/parole-player.c
+++ b/src/parole-player.c
@@ -352,11 +352,17 @@ void parole_player_show_hide_playlist (GtkMenuItem *widget, ParolePlayer *player
     {
 	gtk_widget_show_all (player->priv->playlist_nt);
 	gtk_menu_item_set_label (GTK_MENU_ITEM (player->priv->show_hide_playlist), _("Hide playlist"));
+	g_object_set (G_OBJECT (player->priv->conf),	
+		  "showhide-playlist", FALSE,
+		  NULL);
     }
     else
     {		      
 	gtk_widget_hide_all (player->priv->playlist_nt);
 	gtk_menu_item_set_label (GTK_MENU_ITEM (player->priv->show_hide_playlist), _("Show playlist"));
+	g_object_set (G_OBJECT (player->priv->conf),	
+		  "showhide-playlist", TRUE,
+		  NULL);
     }
 }
 
@@ -1894,6 +1900,7 @@ parole_player_init (ParolePlayer *player)
     GtkBuilder *builder;
     GdkScreen *screen;
     gint w, h;
+    gboolean showhide;
     
     gboolean repeat, shuffle;
     
@@ -2009,7 +2016,7 @@ parole_player_init (ParolePlayer *player)
     gtk_notebook_append_page (GTK_NOTEBOOK (player->priv->playlist_nt), 
 			      GTK_WIDGET (player->priv->list),
 			      gtk_label_new (_("Playlist")));
-			      
+
     g_object_get (G_OBJECT (player->priv->conf),
 		  "window-width", &w,
 		  "window-height", &h,
@@ -2018,6 +2025,16 @@ parole_player_init (ParolePlayer *player)
     gtk_window_set_default_size (GTK_WINDOW (player->priv->window), w, h);
     
     gtk_widget_show_all (player->priv->window);
+
+    g_object_get (G_OBJECT (player->priv->conf),
+		  "showhide-playlist", &showhide,
+		  NULL);
+    if ( showhide ) {
+	gtk_widget_hide_all (player->priv->playlist_nt);
+    }
+    else {
+	gtk_widget_show_all (player->priv->playlist_nt);
+    }
     
     parole_player_set_wm_opacity_hint (player->priv->window);
     


More information about the Xfce4-commits mailing list