[goobox] removed options to change toolbar and satusbar visibility



commit 299b0756a70a5a4cac196dc3378cce23d2ce4338
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sun Jun 3 16:14:16 2012 +0200

    removed options to change toolbar and satusbar visibility
    
    those options are useless now because the toolbar must be always visible,
    and the statusbar has been removed

 data/org.gnome.Goobox.gschema.xml.in |   19 ----
 src/actions.c                        |   26 -----
 src/actions.h                        |    2 -
 src/goo-window.c                     |  175 +---------------------------------
 src/goo-window.h                     |    4 -
 src/preferences.h                    |    2 -
 6 files changed, 2 insertions(+), 226 deletions(-)
---
diff --git a/data/org.gnome.Goobox.gschema.xml.in b/data/org.gnome.Goobox.gschema.xml.in
index 3eea184..0cdc19a 100644
--- a/data/org.gnome.Goobox.gschema.xml.in
+++ b/data/org.gnome.Goobox.gschema.xml.in
@@ -19,13 +19,6 @@
 -->
 <schemalist>
 
-  <enum id="org.gnome.Goobox.ToolbarStyle">
-    <value nick="system" value="0"/>
-    <value nick="text-below" value="1"/>
-    <value nick="text-beside" value="2"/>
-    <value nick="icons-only" value="3"/>
-  </enum>
-
   <enum id="org.gnome.Goobox.SortMethod">
     <value nick="number" value="0"/>
     <value nick="time" value="1"/>
@@ -77,10 +70,6 @@
   </schema>
 
   <schema id="org.gnome.Goobox.UI" path="/org/gnome/goobox/ui/">
-    <key name="toolbar-style" enum="org.gnome.Goobox.ToolbarStyle">
-      <default>'system'</default>
-      <_summary>Toolbar style</_summary>
-    </key>
     <key name="window-width" type="i">
       <default>200</default>
       <_summary>Window width</_summary>
@@ -89,14 +78,6 @@
       <default>400</default>
       <_summary>Window height</_summary>
     </key>
-    <key name="toolbar-visible" type="b">
-      <default>true</default>
-      <_summary>Toolbar visibility</_summary>
-    </key>
-    <key name="statusbar-visible" type="b">
-      <default>false</default>
-      <_summary>Statusbar visibility</_summary>
-    </key>
     <key name="playlist-visible" type="b">
       <default>true</default>
       <_summary>Playlist visibility</_summary>
diff --git a/src/actions.c b/src/actions.c
index 85f52a0..5ca1311 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -189,32 +189,6 @@ activate_action_quit (GtkAction *action,
 
 
 void
-activate_action_view_toolbar (GtkAction *action,
-			      gpointer   data)
-{
-	GSettings *settings;
-
-	settings = g_settings_new (GOOBOX_SCHEMA_UI);
-	g_settings_set_boolean (settings, PREF_UI_TOOLBAR, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
-
-	g_object_unref (settings);
-}
-
-
-void
-activate_action_view_statusbar (GtkAction *action,
-				gpointer   data)
-{
-	GSettings *settings;
-
-	settings = g_settings_new (GOOBOX_SCHEMA_UI);
-	g_settings_set_boolean (settings, PREF_UI_STATUSBAR, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
-
-	g_object_unref (settings);
-}
-
-
-void
 activate_action_play_all (GtkAction *action,
 			  gpointer   data)
 {
diff --git a/src/actions.h b/src/actions.h
index fb639f1..5151e89 100644
--- a/src/actions.h
+++ b/src/actions.h
@@ -39,8 +39,6 @@ void activate_action_shortcuts (GtkAction *action, gpointer data);
 void activate_action_about (GtkAction *action, gpointer data);
 void activate_action_close (GtkAction *action, gpointer data);
 void activate_action_quit (GtkAction *action, gpointer data);
-void activate_action_view_toolbar (GtkAction *action, gpointer data);
-void activate_action_view_statusbar (GtkAction *action, gpointer data);
 void activate_action_play_all (GtkAction *action, gpointer data);
 void activate_action_repeat (GtkAction *action, gpointer data);
 void activate_action_shuffle (GtkAction *action, gpointer data);
diff --git a/src/goo-window.c b/src/goo-window.c
index 54fa256..c61d5d7 100644
--- a/src/goo-window.c
+++ b/src/goo-window.c
@@ -74,17 +74,15 @@ struct _GooWindowPrivate {
 	WindowSortMethod   sort_method;
 	GtkSortType        sort_type;
 
-	GtkWidget         *statusbar;
 	GtkWidget         *file_popup_menu;
 	GtkWidget         *cover_popup_menu;
 	GtkWidget         *status_icon_popup_menu;
+	GtkStatusIcon     *status_icon;
+	GtkWidget         *status_tooltip_content;
 
 	GtkWidget         *info;
 	GtkWidget         *volume_button;
 
-	GtkStatusIcon     *status_icon;
-	GtkWidget         *status_tooltip_content;
-
 	guint              help_message_cid;
 	guint              list_info_cid;
 	guint              progress_cid;
@@ -160,38 +158,6 @@ set_sensitive (GooWindow  *window,
 
 
 static void
-window_update_statusbar_list_info (GooWindow *window)
-{
-	if (window == NULL)
-		return;
-
-	gtk_statusbar_pop (GTK_STATUSBAR (window->priv->statusbar), window->priv->list_info_cid);
-
-	if (window->priv->album->n_tracks != 0) {
-		char    *time_text;
-		char    *tracks_s = NULL;
-		GString *status;
-
-		tracks_s = g_strdup_printf (ngettext ("%d track", "%d tracks", window->priv->album->n_tracks), window->priv->album->n_tracks);
-		time_text = _g_format_duration_for_display (window->priv->album->total_length * 1000);
-
-		status = g_string_new (NULL);
-		g_string_append (status, tracks_s);
-		g_string_append (status, ", ");
-		g_string_append (status, time_text);
-
-		gtk_statusbar_push (GTK_STATUSBAR (window->priv->statusbar),
-				    window->priv->list_info_cid,
-				    status->str);
-
-		g_string_free (status, TRUE);
-		g_free (time_text);
-		g_free (tracks_s);
-	}
-}
-
-
-static void
 window_update_sensitivity (GooWindow *window)
 {
 	int            n_selected;
@@ -438,7 +404,6 @@ goo_window_update_list (GooWindow *window)
 	}
 
 	window_update_sensitivity (window);
-	window_update_statusbar_list_info (window);
 	window_update_size (window);
 
 	g_object_unref (icon);
@@ -668,88 +633,6 @@ add_columns (GooWindow   *window,
 
 
 static void
-menu_item_select_cb (GtkMenuItem *proxy,
-                     GooWindow   *window)
-{
-        GtkAction *action;
-        char      *message;
-
-        action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (proxy));
-        g_return_if_fail (action != NULL);
-
-        g_object_get (G_OBJECT (action), "tooltip", &message, NULL);
-        if (message) {
-		gtk_statusbar_push (GTK_STATUSBAR (window->priv->statusbar),
-				    window->priv->help_message_cid, message);
-		g_free (message);
-        }
-}
-
-
-static void
-menu_item_deselect_cb (GtkMenuItem *proxy,
-		       GooWindow   *window)
-{
-	gtk_statusbar_pop (GTK_STATUSBAR (window->priv->statusbar),
-			   window->priv->help_message_cid);
-}
-
-
-static void
-disconnect_proxy_cb (GtkUIManager *manager,
-                     GtkAction    *action,
-                     GtkWidget    *proxy,
-                     GooWindow    *window)
-{
-        if (GTK_IS_MENU_ITEM (proxy)) {
-                g_signal_handlers_disconnect_by_func
-                        (proxy, G_CALLBACK (menu_item_select_cb), window);
-                g_signal_handlers_disconnect_by_func
-                        (proxy, G_CALLBACK (menu_item_deselect_cb), window);
-        }
-}
-
-
-static void
-connect_proxy_cb (GtkUIManager *manager,
-		  GtkAction    *action,
-		  GtkWidget    *proxy,
-		  GooWindow    *window)
-{
-        if (GTK_IS_MENU_ITEM (proxy)) {
-		g_signal_connect (proxy, "select",
-				  G_CALLBACK (menu_item_select_cb), window);
-		g_signal_connect (proxy, "deselect",
-				  G_CALLBACK (menu_item_deselect_cb), window);
-	}
-}
-
-
-static void
-pref_view_toolbar_changed (GSettings  *settings,
-			   const char *key,
-			   gpointer    user_data)
-{
-	GooWindow *window = user_data;
-
-	g_return_if_fail (window != NULL);
-	goo_window_set_toolbar_visibility (window, g_settings_get_boolean (settings, key));
-}
-
-
-static void
-pref_view_statusbar_changed (GSettings  *settings,
-			     const char *key,
-			     gpointer    user_data)
-{
-	GooWindow *window = user_data;
-
-	g_return_if_fail (window != NULL);
-	goo_window_set_statusbar_visibility (window, g_settings_get_boolean (settings, key));
-}
-
-
-static void
 pref_view_playlist_changed (GSettings  *settings,
 			    const char *key,
 			    gpointer    user_data)
@@ -1022,12 +905,6 @@ goo_window_show (GtkWidget *widget)
 	else
 		arg_toggle_visibility = FALSE;
 
-	view_foobar = g_settings_get_boolean (window->priv->settings_ui, PREF_UI_TOOLBAR);
-	goo_window_set_toolbar_visibility (window, view_foobar);
-
-	view_foobar = g_settings_get_boolean (window->priv->settings_ui, PREF_UI_STATUSBAR);
-	goo_window_set_statusbar_visibility (window, view_foobar);
-
 	if (window->priv->first_time_event == 0)
 		window->priv->first_time_event = g_timeout_add (IDLE_TIMEOUT, first_time_idle, window);
 }
@@ -1716,7 +1593,6 @@ player_done_cb (GooPlayer       *player,
 		goo_window_update_album (window);
 		goo_window_update_titles (window);
 		window_update_title (window);
-		window_update_statusbar_list_info (window);
 		auto_fetch_cover_image (window);
 		break;
 
@@ -2395,9 +2271,6 @@ goo_window_construct (GooWindow    *window,
 
 	window->priv->ui = ui = gtk_ui_manager_new ();
 
-	g_signal_connect (ui, "connect_proxy", G_CALLBACK (connect_proxy_cb), window);
-	g_signal_connect (ui, "disconnect_proxy", G_CALLBACK (disconnect_proxy_cb), window);
-
 	gtk_ui_manager_insert_action_group (ui, actions, 0);
 	gtk_window_add_accel_group (GTK_WINDOW (window),
 				    gtk_ui_manager_get_accel_group (ui));
@@ -2504,16 +2377,6 @@ goo_window_construct (GooWindow    *window,
 			    GTK_TOOL_ITEM (window->priv->volume_button),
 			    VOLUME_BUTTON_POSITION + 1);
 
-	/* Create the statusbar. */
-
-	window->priv->statusbar = gtk_statusbar_new ();
-	gtk_window_set_has_resize_grip (GTK_WINDOW (window), TRUE);
-	window->priv->help_message_cid = gtk_statusbar_get_context_id (GTK_STATUSBAR (window->priv->statusbar), "help_message");
-	window->priv->list_info_cid = gtk_statusbar_get_context_id (GTK_STATUSBAR (window->priv->statusbar), "list_info");
-	window->priv->progress_cid = gtk_statusbar_get_context_id (GTK_STATUSBAR (window->priv->statusbar), "progress");
-	gth_window_attach (GTH_WINDOW (window), window->priv->statusbar, GTH_WINDOW_STATUSBAR);
-	gtk_window_set_has_resize_grip (GTK_WINDOW (window), TRUE);
-
 	/**/
 
 	vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
@@ -2596,14 +2459,6 @@ goo_window_construct (GooWindow    *window,
 	/* Add notification callbacks. */
 
 	g_signal_connect (window->priv->settings_ui,
-			  "changed::" PREF_UI_TOOLBAR,
-			  G_CALLBACK (pref_view_toolbar_changed),
-			  window);
-	g_signal_connect (window->priv->settings_ui,
-			  "changed::" PREF_UI_STATUSBAR,
-			  G_CALLBACK (pref_view_statusbar_changed),
-			  window);
-	g_signal_connect (window->priv->settings_ui,
 			  "changed::" PREF_UI_PLAYLIST,
 			  G_CALLBACK (pref_view_playlist_changed),
 			  window);
@@ -2662,32 +2517,6 @@ goo_window_close (GooWindow *window)
 
 
 void
-goo_window_set_toolbar_visibility (GooWindow *window,
-				   gboolean   visible)
-{
-	g_return_if_fail (window != NULL);
-
-	if (visible)
-		gtk_widget_show (gtk_widget_get_parent (window->priv->toolbar));
-	else
-		gtk_widget_hide (gtk_widget_get_parent (window->priv->toolbar));
-}
-
-
-void
-goo_window_set_statusbar_visibility (GooWindow *window,
-				     gboolean   visible)
-{
-	g_return_if_fail (window != NULL);
-
-	if (visible)
-		gtk_widget_show (window->priv->statusbar);
-	else
-		gtk_widget_hide (window->priv->statusbar);
-}
-
-
-void
 goo_window_play (GooWindow *window)
 {
 	if (window->priv->hibernate)
diff --git a/src/goo-window.h b/src/goo-window.h
index 86d7ac0..a5d0ad7 100644
--- a/src/goo-window.h
+++ b/src/goo-window.h
@@ -60,10 +60,6 @@ struct _GooWindowClass
 GType       goo_window_get_type                  (void);
 GtkWidget * goo_window_new                       (BraseroDrive *drive);
 void        goo_window_close                     (GooWindow    *window);
-void        goo_window_set_toolbar_visibility    (GooWindow    *window,
-						  gboolean      visible);
-void        goo_window_set_statusbar_visibility  (GooWindow    *window,
-						  gboolean      visible);
 void        goo_window_update                    (GooWindow    *window);
 void        goo_window_play                      (GooWindow    *window);
 void        goo_window_play_selected             (GooWindow    *window);
diff --git a/src/preferences.h b/src/preferences.h
index d443dd9..5de9892 100644
--- a/src/preferences.h
+++ b/src/preferences.h
@@ -38,8 +38,6 @@
 #define PREF_GENERAL_USE_SJ           "use-sound-juicer"
 #define PREF_GENERAL_AUTOPLAY         "autoplay"
 
-#define PREF_UI_TOOLBAR               "toolbar-visible"
-#define PREF_UI_STATUSBAR             "statusbar-visible"
 #define PREF_UI_PLAYLIST              "playlist-visible"
 #define PREF_UI_WINDOW_WIDTH          "window-width"
 #define PREF_UI_WINDOW_HEIGHT         "window-height"



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]