[file-roller] removed unused actions and the menubar



commit 77a4f54e3015692da56c43213b6c48f401f2e209
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Dec 6 10:42:10 2012 +0100

    removed unused actions and the menubar

 data/org.gnome.FileRoller.gschema.xml.in |    5 --
 src/actions.c                            |   12 ----
 src/actions.h                            |    1 -
 src/fr-window.c                          |   41 +-------------
 src/fr-window.h                          |    2 -
 src/preferences.h                        |    1 -
 src/ui.h                                 |   10 ---
 src/ui/menus-toolbars.ui                 |   90 +++++++++++++++---------------
 8 files changed, 47 insertions(+), 115 deletions(-)
---
diff --git a/data/org.gnome.FileRoller.gschema.xml.in b/data/org.gnome.FileRoller.gschema.xml.in
index 6ddfd52..f02cf94 100644
--- a/data/org.gnome.FileRoller.gschema.xml.in
+++ b/data/org.gnome.FileRoller.gschema.xml.in
@@ -110,11 +110,6 @@
     <key name="sidebar-width" type="i">
       <default>200</default>
     </key>
-    <key name="view-toolbar" type="b">
-      <default>true</default>
-      <_summary>View toolbar</_summary>
-      <_description>Whether to display the toolbar.</_description>
-    </key>
     <key name="view-statusbar" type="b">
       <default>true</default>
       <_summary>View statusbar</_summary>
diff --git a/src/actions.c b/src/actions.c
index 0e9a19f..066ec72 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -386,18 +386,6 @@ activate_action_password (GtkAction *action,
 
 
 void
-activate_action_view_toolbar (GtkAction *action,
-			      gpointer   data)
-{
-	GSettings *settings;
-
-	settings = g_settings_new (FILE_ROLLER_SCHEMA_UI);
-	g_settings_set_boolean (settings, PREF_UI_VIEW_TOOLBAR, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)));
-	g_object_unref (settings);
-}
-
-
-void
 activate_action_view_statusbar (GtkAction *action,
 				gpointer   data)
 {
diff --git a/src/actions.h b/src/actions.h
index c782e07..0dbb644 100644
--- a/src/actions.h
+++ b/src/actions.h
@@ -57,7 +57,6 @@ void activate_action_open_folder (GtkAction *action, gpointer data);
 void activate_action_open_folder_from_sidebar (GtkAction *action, gpointer data);
 void activate_action_password (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_view_folders (GtkAction *action, gpointer data);
 void activate_action_stop (GtkAction *action, gpointer data);
diff --git a/src/fr-window.c b/src/fr-window.c
index fe0f990..84cb144 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -5011,7 +5011,6 @@ fr_window_show_cb (GtkWidget *widget,
 {
 	fr_window_update_current_location (window);
 
-	set_active (window, "ViewToolbar", g_settings_get_boolean (window->priv->settings_ui, PREF_UI_VIEW_TOOLBAR));
 	set_active (window, "ViewStatusbar", g_settings_get_boolean (window->priv->settings_ui, PREF_UI_VIEW_STATUSBAR));
 
 	window->priv->view_folders = g_settings_get_boolean (window->priv->settings_ui, PREF_UI_VIEW_FOLDERS);
@@ -5046,17 +5045,6 @@ pref_history_len_changed (GSettings  *settings,
 
 
 static void
-pref_view_toolbar_changed (GSettings  *settings,
-		  	   const char *key,
-		  	   gpointer    user_data)
-{
-	FrWindow *window = user_data;
-
-	fr_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)
@@ -5353,7 +5341,6 @@ set_action_important (GtkUIManager *ui,
 static void
 fr_window_construct (FrWindow *window)
 {
-	GtkWidget          *menubar;
 	GtkWidget          *toolbar;
 	GtkWidget          *list_scrolled_window;
 	GtkWidget          *location_box;
@@ -5752,10 +5739,6 @@ fr_window_construct (FrWindow *window)
 	g_object_set (other_actions_action, "menu", gtk_ui_manager_get_widget (ui, "/OtherActionsMenu"), NULL);
 	g_object_unref (other_actions_action);
 
-	menubar = gtk_ui_manager_get_widget (ui, "/MenuBar");
-	/* fr_window_attach (FR_WINDOW (window), menubar, FR_WINDOW_AREA_MENUBAR); FIXME */
-	gtk_widget_show (menubar);
-
 	window->priv->toolbar = toolbar = gtk_ui_manager_get_widget (ui, "/ToolBar");
 	gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), TRUE);
 	gtk_style_context_add_class (gtk_widget_get_style_context (toolbar), GTK_STYLE_CLASS_PRIMARY_TOOLBAR);
@@ -5814,10 +5797,7 @@ fr_window_construct (FrWindow *window)
 	/**/
 
 	fr_window_attach (FR_WINDOW (window), window->priv->toolbar, FR_WINDOW_AREA_TOOLBAR);
-	if (g_settings_get_boolean (window->priv->settings_ui, PREF_UI_VIEW_TOOLBAR))
-		gtk_widget_show (toolbar);
-	else
-		gtk_widget_hide (toolbar);
+	gtk_widget_show (toolbar);
 
 	window->priv->file_popup_menu = gtk_ui_manager_get_widget (ui, "/FilePopupMenu");
 	window->priv->folder_popup_menu = gtk_ui_manager_get_widget (ui, "/FolderPopupMenu");
@@ -5875,10 +5855,6 @@ fr_window_construct (FrWindow *window)
 			  G_CALLBACK (pref_history_len_changed),
 			  window);
 	g_signal_connect (window->priv->settings_ui,
-			  "changed::" PREF_UI_VIEW_TOOLBAR,
-			  G_CALLBACK (pref_view_toolbar_changed),
-			  window);
-	g_signal_connect (window->priv->settings_ui,
 			  "changed::" PREF_UI_VIEW_STATUSBAR,
 			  G_CALLBACK (pref_view_statusbar_changed),
 			  window);
@@ -9251,21 +9227,6 @@ fr_window_set_default_dir (FrWindow *window,
 
 
 void
-fr_window_set_toolbar_visibility (FrWindow *window,
-				  gboolean  visible)
-{
-	g_return_if_fail (window != NULL);
-
-	if (visible)
-		gtk_widget_show (window->priv->toolbar);
-	else
-		gtk_widget_hide (window->priv->toolbar);
-
-	set_active (window, "ViewToolbar", visible);
-}
-
-
-void
 fr_window_set_statusbar_visibility  (FrWindow *window,
 				     gboolean  visible)
 {
diff --git a/src/fr-window.h b/src/fr-window.h
index eced086..df85d67 100644
--- a/src/fr-window.h
+++ b/src/fr-window.h
@@ -263,8 +263,6 @@ void            fr_window_set_extract_default_dir      (FrWindow   *window,
 							GFile      *default_dir,
 						        gboolean    freeze);
 GFile *         fr_window_get_extract_default_dir      (FrWindow   *window);
-void            fr_window_set_toolbar_visibility       (FrWindow   *window,
-						        gboolean    value);
 void            fr_window_set_statusbar_visibility     (FrWindow   *window,
 						        gboolean    value);
 void            fr_window_set_folders_visibility       (FrWindow   *window,
diff --git a/src/preferences.h b/src/preferences.h
index c36ee8c..30080b8 100644
--- a/src/preferences.h
+++ b/src/preferences.h
@@ -49,7 +49,6 @@
 #define PREF_UI_WINDOW_HEIGHT             "window-height"
 #define PREF_UI_SIDEBAR_WIDTH             "sidebar-width"
 #define PREF_UI_HISTORY_LEN               "history-len"
-#define PREF_UI_VIEW_TOOLBAR              "view-toolbar"
 #define PREF_UI_VIEW_STATUSBAR            "view-statusbar"
 #define PREF_UI_VIEW_FOLDERS              "view-folders"
 
diff --git a/src/ui.h b/src/ui.h
index 988d5c1..33484a7 100644
--- a/src/ui.h
+++ b/src/ui.h
@@ -28,11 +28,6 @@
 
 
 static GtkActionEntry action_entries[] = {
-	{ "FileMenu", NULL, N_("_Archive") },
-	{ "EditMenu", NULL, N_("_Edit") },
-	{ "ViewMenu", NULL, N_("_View") },
-	{ "HelpMenu", NULL, N_("_Help") },
-	{ "ArrangeFilesMenu", NULL, N_("_Arrange Files") },
 	{ "OtherActionsMenu", NULL, NULL },
 
 	{ "About", GTK_STOCK_ABOUT,
@@ -193,11 +188,6 @@ static guint n_action_entries = G_N_ELEMENTS (action_entries);
 
 
 static GtkToggleActionEntry action_toggle_entries[] = {
-	{ "ViewToolbar", NULL,
-	  N_("_Toolbar"), NULL,
-	  N_("View the main toolbar"),
-	  G_CALLBACK (activate_action_view_toolbar),
-	  TRUE },
 	{ "ViewStatusbar", NULL,
 	  N_("Stat_usbar"), NULL,
 	  N_("View the statusbar"),
diff --git a/src/ui/menus-toolbars.ui b/src/ui/menus-toolbars.ui
index d5bcdd7..5f561ed 100644
--- a/src/ui/menus-toolbars.ui
+++ b/src/ui/menus-toolbars.ui
@@ -1,48 +1,42 @@
 <ui>
-  <menubar name="MenuBar">
-    <menu name="Archive" action="FileMenu">
-      <menuitem action="New"/>
-      <menuitem action="Open"/>
-      <menuitem action="OpenRecent"/>
-      <menuitem action="SaveAs"/>
-      <separator/>
-      <menuitem action="Extract"/>
-      <menuitem action="TestArchive"/>
-      <separator/>
-      <menuitem action="Properties"/>
-      <separator/>
-      <menuitem action="Close"/>
-    </menu>
-    <menu action="EditMenu">
-      <menuitem action="Cut"/>
-      <menuitem action="Copy"/>
-      <menuitem action="Paste"/>
-      <menuitem action="Rename"/>
-      <menuitem action="Delete"/>
-      <separator/>
-      <menuitem action="SelectAll"/>
-      <menuitem action="DeselectAll"/>
-      <separator/>
-      <menuitem action="Add"/>
-      <menuitem action="Find"/>
-      <separator/>
-      <menuitem action="Password"/>
-    </menu>
-    <menu action="ViewMenu">
-      <menuitem action="ViewToolbar"/>
-      <menuitem action="ViewStatusbar"/>
-      <menuitem action="ViewFolders"/>
-      <separator/>
-      <menuitem action="ViewAllFiles"/>
-      <menuitem action="ViewAsFolder"/>
-      <separator/>
-      <menuitem action="Reload"/>
-    </menu>
-    <menu action="HelpMenu">
-      <menuitem action="Contents"/>
-      <menuitem action="About"/>
-    </menu>
-  </menubar>
+
+  <!-- Accelerators: File -->
+
+  <accelerator action="New" />
+  <accelerator action="Open" />
+  <accelerator action="SaveAs" />
+  <accelerator action="Extract" />
+  <accelerator action="TestArchive" />
+  <accelerator action="Properties" />
+  <accelerator action="Close" />
+
+  <!-- Accelerators: Edit -->
+
+  <accelerator action="Cut" />
+  <accelerator action="Copy" />
+  <accelerator action="Paste" />
+  <accelerator action="Rename" />
+  <accelerator action="Delete" />
+  <accelerator action="SelectAll" />
+  <accelerator action="DeselectAll" />
+  <accelerator action="Add" />
+  <accelerator action="Find" />
+  <accelerator action="Password" />
+
+  <!-- Accelerators: View -->
+
+  <accelerator action="ViewFolders" />
+  <accelerator action="ViewAllFiles" />
+  <accelerator action="ViewAsFolder" />
+  <accelerator action="Reload" />
+
+  <!-- Accelerators: Help -->
+
+  <accelerator action="Contents" />
+  <accelerator action="About" />
+
+  <!-- Toolbars -->
+
   <toolbar name="ToolBar">
     <toolitem action="New"/>
     <toolitem action="OpenRecent_Toolbar"/>
@@ -54,12 +48,16 @@
     <separator expand="true"/>
     <toolitem action="OtherActions"/>
   </toolbar>
+
   <toolbar name="LocationBar">
     <toolitem action="GoBack"/>
     <toolitem action="GoForward"/>
     <toolitem action="GoUp"/>
     <toolitem action="GoHome"/>
   </toolbar>
+
+  <!-- Popup menus -->
+
   <popup name="FilePopupMenu">
     <menuitem action="ViewSelection"/>
     <menuitem action="OpenSelection"/>
@@ -72,6 +70,7 @@
     <menuitem action="Rename"/>
     <menuitem action="Delete"/>
   </popup>
+
   <popup name="FolderPopupMenu">
     <menuitem action="OpenFolder"/>
     <separator/>
@@ -83,9 +82,11 @@
     <menuitem action="Rename"/>
     <menuitem action="Delete"/>
   </popup>
+
   <popup name="AddMenu">
     <menuitem action="Add"/>
   </popup>
+
   <popup name="SidebarFolderPopupMenu">
     <menuitem action="OpenFolderFromSidebar"/>
     <separator/>
@@ -97,6 +98,7 @@
     <menuitem action="RenameFolderFromSidebar"/>
     <menuitem action="DeleteFolderFromSidebar"/>
   </popup>
+
   <popup action="OtherActionsMenu">
     <menuitem action="SaveAs"/>
     <menuitem action="Password"/>



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