[gthumb] removed the go and about menus



commit bf8a54b3a21d20795e44897a7da9bda4370a21e6
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Sat Oct 19 08:21:16 2013 +0200

    removed the go and about menus

 data/ui/location.ui                    |    6 +-
 extensions/search/actions.c            |   10 ++-
 extensions/search/actions.h            |    4 +-
 extensions/search/callbacks.c          |   66 ++++------------
 gthumb/Makefile.am                     |    3 -
 gthumb/gth-browser-actions-callbacks.c |  134 +++++++++++++++++++++++++++-----
 gthumb/gth-browser-actions-callbacks.h |   11 ++-
 gthumb/gth-browser-actions-entries.h   |   27 +------
 gthumb/gth-browser-ui.h                |   32 --------
 gthumb/gth-browser.c                   |  106 +-------------------------
 gthumb/gth-window-actions-callbacks.c  |   40 ----------
 gthumb/gth-window-actions-callbacks.h  |   32 --------
 gthumb/gth-window-actions-entries.h    |   41 ----------
 gthumb/main.c                          |   82 ++------------------
 gthumb/resources/app-menu.ui           |    6 +-
 gthumb/resources/gears-menu.ui         |    7 ++
 16 files changed, 166 insertions(+), 441 deletions(-)
---
diff --git a/data/ui/location.ui b/data/ui/location.ui
index 413fd10..335e0fd 100644
--- a/data/ui/location.ui
+++ b/data/ui/location.ui
@@ -1,9 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.16.0 on Fri Oct 18 21:34:45 2013 -->
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
   <object class="GtkDialog" id="location_dialog">
     <property name="can_focus">False</property>
     <property name="border_width">5</property>
+    <property name="title" translatable="yes">Open</property>
     <property name="modal">True</property>
     <property name="type_hint">dialog</property>
     <child internal-child="vbox">
@@ -22,7 +24,6 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -33,14 +34,13 @@
             </child>
             <child>
               <object class="GtkButton" id="ok_button">
-                <property name="label">gtk-jump-to</property>
+                <property name="label">gtk-open</property>
                 <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="can_default">True</property>
                 <property name="has_default">True</property>
                 <property name="receives_default">True</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
diff --git a/extensions/search/actions.c b/extensions/search/actions.c
index a3e1ee9..925b481 100644
--- a/extensions/search/actions.c
+++ b/extensions/search/actions.c
@@ -63,11 +63,13 @@ search_editor_dialog__response_cb (GtkDialog *dialog,
 
 
 void
-gth_browser_activate_action_edit_find (GtkAction  *action,
-                                      GthBrowser *browser)
+gth_browser_activate_find (GSimpleAction *action,
+                          GVariant      *parameter,
+                          gpointer       user_data)
 {
-       GthSearch *search;
-       GtkWidget *dialog;
+       GthBrowser *browser = GTH_BROWSER (user_data);
+       GthSearch  *search;
+       GtkWidget  *dialog;
 
        search = gth_search_new ();
        gth_search_set_folder (search, gth_browser_get_location (browser));
diff --git a/extensions/search/actions.h b/extensions/search/actions.h
index 4efc27c..da3bcd3 100644
--- a/extensions/search/actions.h
+++ b/extensions/search/actions.h
@@ -26,7 +26,7 @@
 
 #define DEFINE_ACTION(x) void x (GtkAction *action, gpointer data);
 
-DEFINE_ACTION(gth_browser_activate_action_edit_find)
-DEFINE_ACTION(gth_browser_activate_action_edit_search_update)
+DEF_ACTION_CALLBACK (gth_browser_activate_find)
+DEFINE_ACTION (gth_browser_activate_action_edit_search_update)
 
 #endif /* ACTIONS_H */
diff --git a/extensions/search/callbacks.c b/extensions/search/callbacks.c
index d93dd2b..fa51037 100644
--- a/extensions/search/callbacks.c
+++ b/extensions/search/callbacks.c
@@ -36,36 +36,13 @@
 #define _RESPONSE_REFRESH 2
 
 
-static const char *find_ui_info =
-"<ui>"
-"  <menubar name='MenuBar'>"
-"    <menu name='Edit' action='EditMenu'>"
-"      <placeholder name='Edit_Actions'>"
-"        <menuitem action='Edit_Find'/>"
-"      </placeholder>"
-"    </menu>"
-"  </menubar>"
-"  <toolbar name='ToolBar'>"
-"    <placeholder name='SourceCommands'>"
-"      <toolitem action='Edit_Find'/>"
-"    </placeholder>"
-"  </toolbar>"
-"</ui>";
-
-
-static GtkActionEntry find_action_entries[] = {
-       { "Edit_Find", GTK_STOCK_FIND,
-         NULL, NULL,
-         N_("Find files"),
-         G_CALLBACK (gth_browser_activate_action_edit_find) }
+static const GActionEntry actions[] = {
+       { "find", gth_browser_activate_find }
 };
-static guint find_action_entries_size = G_N_ELEMENTS (find_action_entries);
 
 
 typedef struct {
-       GtkActionGroup *find_action;
-       guint           find_merge_id;
-       GtkWidget      *refresh_button;
+       GtkWidget *refresh_button;
 } BrowserData;
 
 
@@ -80,36 +57,21 @@ void
 search__gth_browser_construct_cb (GthBrowser *browser)
 {
        BrowserData *data;
-       GError      *error = NULL;
 
        g_return_if_fail (GTH_IS_BROWSER (browser));
 
-       data = g_new0 (BrowserData, 1);
-
-       data->find_action = gtk_action_group_new ("Find Action");
-       gtk_action_group_set_translation_domain (data->find_action, NULL);
-       gtk_action_group_add_actions (data->find_action,
-                                     find_action_entries,
-                                     find_action_entries_size,
-                                     browser);
-       gtk_ui_manager_insert_action_group (gth_browser_get_ui_manager (browser), data->find_action, 0);
-
-       data->find_merge_id = gtk_ui_manager_add_ui_from_string (gth_browser_get_ui_manager (browser), 
find_ui_info, -1, &error);
-       if (data->find_merge_id == 0) {
-               g_warning ("building menus failed: %s", error->message);
-               g_error_free (error);
-       }
-
-       {
-               GtkWidget *button;
-
-               button = _gtk_image_button_new_for_header_bar ("edit-find-symbolic");
-               gtk_activatable_set_use_action_appearance (GTK_ACTIVATABLE (button), FALSE);
-               gtk_activatable_set_related_action (GTK_ACTIVATABLE (button), gtk_action_group_get_action 
(data->find_action, "Edit_Find"));
-               gtk_widget_show (button);
-               gtk_box_pack_start (GTK_BOX (gth_browser_get_headerbar_section (browser, 
GTH_BROWSER_HEADER_SECTION_BROWSER_COMMANDS)), button, FALSE, FALSE, 0);
-       }
+       g_action_map_add_action_entries (G_ACTION_MAP (browser),
+                                        actions,
+                                        G_N_ELEMENTS (actions),
+                                        browser);
+       gth_browser_add_header_bar_button (browser,
+                                          GTH_BROWSER_HEADER_SECTION_BROWSER_COMMANDS,
+                                          "edit-find-symbolic",
+                                          _("Find files"),
+                                          "win.find",
+                                          "<Control>F");
 
+       data = g_new0 (BrowserData, 1);
        g_object_set_data_full (G_OBJECT (browser), BROWSER_DATA_KEY, data, (GDestroyNotify) 
browser_data_free);
 }
 
diff --git a/gthumb/Makefile.am b/gthumb/Makefile.am
index e35c9e5..67d0265 100644
--- a/gthumb/Makefile.am
+++ b/gthumb/Makefile.am
@@ -141,8 +141,6 @@ PRIVATE_HEADER_FILES =                                      \
        dlg-personalize-filters.h                       \
        dlg-preferences.h                               \
        dlg-sort-order.h                                \
-       gth-window-actions-callbacks.h                  \
-       gth-window-actions-entries.h                    \
        main-migrate.h                                  \
        $(NULL)
 
@@ -264,7 +262,6 @@ gthumb_SOURCES =                                    \
        gth-user-dir.c                                  \
        gth-viewer-page.c                               \
        gth-window.c                                    \
-       gth-window-actions-callbacks.c                  \
        gtk-utils.c                                     \
        gvaluehash.c                                    \
        main.c                                          \
diff --git a/gthumb/gth-browser-actions-callbacks.c b/gthumb/gth-browser-actions-callbacks.c
index 5cc445a..2673f9c 100644
--- a/gthumb/gth-browser-actions-callbacks.c
+++ b/gthumb/gth-browser-actions-callbacks.c
@@ -35,6 +35,7 @@
 #include "gth-sidebar.h"
 #include "gtk-utils.h"
 #include "gth-viewer-page.h"
+#include "main.h"
 
 
 void
@@ -369,12 +370,108 @@ void
 gth_browser_activate_action_help_about (GtkAction *action,
                                        gpointer   data)
 {
-       GthWindow  *window = GTH_WINDOW (data);
-       const char *authors[] = {
+
+}
+
+
+void
+gth_browser_activate_action_help_help (GtkAction *action,
+                                      gpointer   data)
+{
+       show_help_dialog (GTK_WINDOW (data), NULL);
+}
+
+
+void
+gth_browser_activate_action_help_shortcuts (GtkAction *action,
+                                           gpointer   data)
+{
+       show_help_dialog (GTK_WINDOW (data), "gthumb-shortcuts");
+}
+
+
+/* -- GAction callbacks -- */
+
+
+GtkWidget *
+_gth_application_get_current_window (GApplication *application)
+{
+        GList *windows;
+
+        windows = gtk_application_get_windows (GTK_APPLICATION (application));
+        if (windows == NULL)
+               return NULL;
+
+        return GTK_WIDGET (windows->data);
+}
+
+
+void
+gth_application_activate_new_window (GSimpleAction *action,
+                                    GVariant      *parameter,
+                                    gpointer       user_data)
+{
+        GApplication *application = user_data;
+        GtkWidget    *browser;
+        GtkWidget    *window;
+
+        browser = _gth_application_get_current_window (application);
+        window = gth_browser_new (gth_browser_get_location (GTH_BROWSER (browser)), NULL);
+        gtk_window_present (GTK_WINDOW (window));
+}
+
+
+void
+gth_application_activate_preferences (GSimpleAction *action,
+                                     GVariant      *parameter,
+                                     gpointer       user_data)
+{
+        GApplication *application = user_data;
+        GtkWidget    *browser;
+
+        browser = _gth_application_get_current_window (application);
+        dlg_preferences (GTH_BROWSER (browser));
+}
+
+
+void
+gth_application_activate_show_help (GSimpleAction *action,
+                                   GVariant      *parameter,
+                                   gpointer       user_data)
+{
+        GApplication *application = user_data;
+        GtkWidget    *browser;
+
+        browser = _gth_application_get_current_window (application);
+        show_help_dialog (GTK_WINDOW (browser), NULL);
+}
+
+
+void
+gth_application_activate_show_shortcuts (GSimpleAction *action,
+                                        GVariant      *parameter,
+                                        gpointer       user_data)
+{
+        GApplication *application = user_data;
+        GtkWidget    *browser;
+
+        browser = _gth_application_get_current_window (application);
+        show_help_dialog (GTK_WINDOW (browser), "gthumb-shortcuts");
+}
+
+
+void
+gth_application_activate_about (GSimpleAction *action,
+                               GVariant      *parameter,
+                               gpointer       user_data)
+{
+        GApplication *application = user_data;
+       GthWindow    *window;
+       const char   *authors[] = {
 #include "AUTHORS.tab"
                NULL
        };
-       const char *documenters [] = {
+       const char   *documenters [] = {
                "Paolo Bacchilega",
                "Alexander Kirillov",
                NULL
@@ -394,6 +491,7 @@ gth_browser_activate_action_help_about (GtkAction *action,
        };
        GdkPixbuf *logo;
 
+       window = (GthWindow *) _gth_application_get_current_window (application);
        license_text = g_strconcat (_(license[0]), "\n\n",
                                    _(license[1]), "\n\n",
                                    _(license[2]),
@@ -424,24 +522,19 @@ gth_browser_activate_action_help_about (GtkAction *action,
 
 
 void
-gth_browser_activate_action_help_help (GtkAction *action,
-                                      gpointer   data)
+gth_application_activate_quit (GSimpleAction *action,
+                              GVariant      *parameter,
+                              gpointer       user_data)
 {
-       show_help_dialog (GTK_WINDOW (data), NULL);
-}
+        GApplication *application = user_data;
+        GList        *windows;
 
-
-void
-gth_browser_activate_action_help_shortcuts (GtkAction *action,
-                                           gpointer   data)
-{
-       show_help_dialog (GTK_WINDOW (data), "gthumb-shortcuts");
+        windows = gtk_application_get_windows (GTK_APPLICATION (application));
+        if (windows != NULL)
+               gth_quit (FALSE);
 }
 
 
-/* -- GAction callbacks -- */
-
-
 void
 gth_browser_activate_browser_mode (GSimpleAction *action,
                                   GVariant      *parameter,
@@ -533,12 +626,11 @@ gth_browser_activate_go_up (GSimpleAction *action,
 
 
 void
-gth_browser_activate_quit (GSimpleAction *action,
-                          GVariant      *parameter,
-                          gpointer       user_data)
+gth_browser_activate_open_location (GSimpleAction *action,
+                                   GVariant      *parameter,
+                                   gpointer       user_data)
 {
-       /* FIXME */
-
+       dlg_location (GTH_BROWSER (user_data));
 }
 
 
diff --git a/gthumb/gth-browser-actions-callbacks.h b/gthumb/gth-browser-actions-callbacks.h
index 24a06e6..fc56f1a 100644
--- a/gthumb/gth-browser-actions-callbacks.h
+++ b/gthumb/gth-browser-actions-callbacks.h
@@ -43,9 +43,6 @@ DEFINE_ACTION(gth_browser_activate_action_go_up)
 DEFINE_ACTION(gth_browser_activate_action_go_location)
 DEFINE_ACTION(gth_browser_activate_action_go_clear_history)
 DEFINE_ACTION(gth_browser_activate_action_go_home)
-DEFINE_ACTION(gth_browser_activate_action_help_help)
-DEFINE_ACTION(gth_browser_activate_action_help_shortcuts)
-DEFINE_ACTION(gth_browser_activate_action_help_about)
 DEFINE_ACTION(gth_browser_activate_action_view_sort_by)
 DEFINE_ACTION(gth_browser_activate_action_view_filter)
 DEFINE_ACTION(gth_browser_activate_action_view_filterbar)
@@ -65,6 +62,12 @@ DEFINE_ACTION(gth_browser_activate_action_browser_tools)
 DEFINE_ACTION(gth_browser_activate_action_viewer_tools)
 DEFINE_ACTION(gth_browser_activate_action_view_shrink_wrap)
 
+DEF_ACTION_CALLBACK (gth_application_activate_new_window)
+DEF_ACTION_CALLBACK (gth_application_activate_preferences)
+DEF_ACTION_CALLBACK (gth_application_activate_show_shortcuts)
+DEF_ACTION_CALLBACK (gth_application_activate_show_help)
+DEF_ACTION_CALLBACK (gth_application_activate_about)
+DEF_ACTION_CALLBACK (gth_application_activate_quit)
 DEF_ACTION_CALLBACK (gth_browser_activate_browser_mode)
 DEF_ACTION_CALLBACK (gth_browser_activate_clear_history)
 DEF_ACTION_CALLBACK (gth_browser_activate_close)
@@ -74,7 +77,7 @@ DEF_ACTION_CALLBACK (gth_browser_activate_go_forward)
 DEF_ACTION_CALLBACK (gth_browser_activate_go_to_history_pos)
 DEF_ACTION_CALLBACK (gth_browser_activate_go_home)
 DEF_ACTION_CALLBACK (gth_browser_activate_go_up)
-DEF_ACTION_CALLBACK (gth_browser_activate_quit)
+DEF_ACTION_CALLBACK (gth_browser_activate_open_location)
 DEF_ACTION_CALLBACK (gth_browser_activate_revert_to_saved)
 DEF_ACTION_CALLBACK (gth_browser_activate_save)
 DEF_ACTION_CALLBACK (gth_browser_activate_save_as)
diff --git a/gthumb/gth-browser-actions-entries.h b/gthumb/gth-browser-actions-entries.h
index d1bc844..28510a1 100644
--- a/gthumb/gth-browser-actions-entries.h
+++ b/gthumb/gth-browser-actions-entries.h
@@ -37,7 +37,7 @@ static const GActionEntry gth_browser_actions[] = {
        { "go-home", gth_browser_activate_go_home },
        { "go-to-history-position", gth_browser_activate_go_to_history_pos, "s", "''", NULL },
        { "go-up", gth_browser_activate_go_up },
-       { "quit", gth_browser_activate_quit },
+       { "open-location", gth_browser_activate_open_location },
        { "revert-to-saved", gth_browser_activate_revert_to_saved },
        { "save", gth_browser_activate_save },
        { "save-as", gth_browser_activate_save_as },
@@ -49,7 +49,6 @@ static GthActionEntryExt gth_browser_action_entries[] = {
        { "FileMenu", NULL, N_("_File") },
        { "EditMenu", NULL, N_("_Edit") },
        { "ViewMenu", NULL, N_("_View") },
-       { "GoMenu", NULL, N_("_Go") },
        { "HelpMenu", NULL, N_("_Help") },
        { "OpenWithMenu", NULL, N_("Open _With") },
        { "ImportMenu", NULL, N_("I_mport From") },
@@ -151,12 +150,6 @@ static GthActionEntryExt gth_browser_action_entries[] = {
          GTH_ACTION_FLAG_NONE,
          G_CALLBACK (gth_browser_activate_action_view_fullscreen) },
 
-       { "Go_Up", GTK_STOCK_GO_UP,
-         NULL, "<alt>Up",
-         N_("Go up one level"),
-         GTH_ACTION_FLAG_NONE,
-         G_CALLBACK (gth_browser_activate_action_go_up) },
-
        { "Go_Location", NULL,
          N_("_Location..."), "<control>L",
          N_("Specify a location to open"),
@@ -175,24 +168,6 @@ static GthActionEntryExt gth_browser_action_entries[] = {
          GTH_ACTION_FLAG_NONE,
          G_CALLBACK (gth_browser_activate_action_go_clear_history) },
 
-       { "Help_About", GTK_STOCK_ABOUT,
-         NULL, NULL,
-         N_("Show information about gthumb"),
-         GTH_ACTION_FLAG_NONE,
-         G_CALLBACK (gth_browser_activate_action_help_about) },
-
-       { "Help_Help", GTK_STOCK_HELP,
-         N_("Contents"), "F1",
-         N_("Display the gthumb Manual"),
-         GTH_ACTION_FLAG_NONE,
-         G_CALLBACK (gth_browser_activate_action_help_help) },
-
-       { "Help_Shortcuts", NULL,
-         N_("_Keyboard Shortcuts"), NULL,
-         " ",
-         GTH_ACTION_FLAG_NONE,
-         G_CALLBACK (gth_browser_activate_action_help_shortcuts) },
-
        { "Browser_Tools", "palette",
          N_("Edit"), NULL,
          N_("Edit file"),
diff --git a/gthumb/gth-browser-ui.h b/gthumb/gth-browser-ui.h
index 7015fa6..d056efa 100644
--- a/gthumb/gth-browser-ui.h
+++ b/gthumb/gth-browser-ui.h
@@ -49,9 +49,6 @@ static const char *fixed_ui_info =
 "        <placeholder name='Misc_Actions'/>"
 "      </menu>"
 "      <placeholder name='Misc_Actions'/>"
-"      <separator/>"
-"      <menuitem action='File_Quit'/>"
-"      <menuitem action='File_CloseWindow'/>"
 "    </menu>"
 "    <menu name='Edit' action='EditMenu'>"
 "      <placeholder name='File_Actions_1'/>"
@@ -85,28 +82,10 @@ static const char *fixed_ui_info =
 "      <separator/>"
 "      <placeholder name='Folder_Actions'/>"
 "    </menu>"
-"    <menu name='Go' action='GoMenu'>"
-"      <menuitem action='Go_Up'/>"
-"      <menuitem action='Go_Location'/>"
-"      <separator name='BeforeEntryPointList'/>"
-"      <placeholder name='EntryPointList'/>"
-"      <separator name='EntryPointListSeparator'/>"
-"      <menuitem action='Go_Clear_History'/>"
-"      <separator name='BeforeHistoryList'/>"
-"    </menu>"
 "    <placeholder name='OtherMenus'/>"
-"    <menu name='Help' action='HelpMenu'>"
-"      <menuitem action='Help_Help'/>"
-"      <menuitem action='Help_Shortcuts'/>"
-"      <separator/>"
-"      <menuitem name='About' action='Help_About'/>"
-"    </menu>"
 "  </menubar>"
 
 "  <toolbar name='ToolBar'>"
-"    <toolitem action='Toolbar_Go_Up'/>"
-"    <toolitem action='View_Stop'/>"
-"    <separator/>"
 "    <placeholder name='Export_Actions'/>"
 "    <placeholder name='SourceCommands'/>"
 "    <separator/>"
@@ -151,15 +130,6 @@ static const char *fixed_ui_info =
 "    <toolitem action='Viewer_Properties'/>"
 "  </toolbar>"
 
-"  <popup name='GoBackHistoryPopup'>"
-"  </popup>"
-
-"  <popup name='GoForwardHistoryPopup'>"
-"  </popup>"
-
-"  <popup name='GoParentPopup'>"
-"  </popup>"
-
 "  <popup name='FileListPopup'>"
 "    <placeholder name='Screen_Actions'/>"
 "    <separator/>"
@@ -202,8 +172,6 @@ static const char *fixed_ui_info =
 "    <placeholder name='SourceCommands'/>"
 "  </popup>"
 
-"  <accelerator action=\"Go_Home\" />"
-
 "</ui>";
 
 
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index eac52cf..11693e2 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -59,8 +59,6 @@
 #include "gth-user-dir.h"
 #include "gth-viewer-page.h"
 #include "gth-window.h"
-#include "gth-window-actions-callbacks.h"
-#include "gth-window-actions-entries.h"
 #include "main.h"
 
 #define GTH_BROWSER_CALLBACK(f) ((GthBrowserCallback) (f))
@@ -213,7 +211,6 @@ struct _GthBrowserPrivate {
 
        GList             *history;
        GList             *history_current;
-       GtkWidget         *go_parent_menu;
        GMenu             *history_menu;
 };
 
@@ -520,40 +517,6 @@ _gth_browser_add_file_menu_item (GthBrowser *browser,
 }
 
 
-static void
-_gth_browser_update_parent_list (GthBrowser *browser)
-{
-       GtkWidget *menu;
-       int        i;
-       GFile     *parent;
-
-       menu = browser->priv->go_parent_menu;
-       _gtk_container_remove_children (GTK_CONTAINER (menu), NULL, NULL);
-
-       if (browser->priv->location == NULL)
-               return;
-
-       /* Update the parent list menu. */
-
-       i = 0;
-       parent = g_file_get_parent (browser->priv->location->file);
-       while (parent != NULL) {
-               GFile *parent_parent;
-
-               _gth_browser_add_file_menu_item (browser,
-                                                menu,
-                                                parent,
-                                                NULL,
-                                                GTH_ACTION_GO_UP,
-                                                ++i);
-
-               parent_parent = g_file_get_parent (parent);
-               g_object_unref (parent);
-               parent = parent_parent;
-       }
-}
-
-
 void
 gth_browser_update_title (GthBrowser *browser)
 {
@@ -634,8 +597,6 @@ gth_browser_update_sensitivity (GthBrowser *browser)
        _gth_browser_set_action_sensitive (browser, "File_Save", viewer_can_save && modified);
        _gth_browser_set_action_sensitive (browser, "File_SaveAs", viewer_can_save);
        _gth_browser_set_action_sensitive (browser, "File_Revert", viewer_can_save && modified);
-       _gth_browser_set_action_sensitive (browser, "Go_Up", parent_available);
-       _gth_browser_set_action_sensitive (browser, "Toolbar_Go_Up", parent_available);
        _gth_browser_set_action_sensitive (browser, "View_Stop", browser->priv->fullscreen || 
(browser->priv->activity_ref > 0));
        _gth_browser_set_action_sensitive (browser, "View_Prev", current_file_pos > 0);
        _gth_browser_set_action_sensitive (browser, "View_Next", (current_file_pos != -1) && 
(current_file_pos < n_files - 1));
@@ -681,7 +642,6 @@ _gth_browser_set_location (GthBrowser  *browser,
        browser->priv->location = gth_file_data_dup (location);
 
        gth_browser_update_title (browser);
-       _gth_browser_update_parent_list (browser);
        gth_browser_update_sensitivity (browser);
 
        location_chooser = gth_embedded_dialog_get_chooser (GTH_EMBEDDED_DIALOG 
(browser->priv->list_extra_widget));
@@ -911,39 +871,10 @@ _gth_browser_monitor_entry_points (GthBrowser *browser)
 static void
 _gth_browser_update_entry_point_list (GthBrowser *browser)
 {
-       GtkWidget *separator1;
-       GtkWidget *separator2;
-       GtkWidget *menu;
-       GList     *entry_points;
-       GList     *scan;
-       int        position;
-       GFile     *root;
-
-       separator1 = gtk_ui_manager_get_widget (browser->priv->ui, "/MenuBar/Go/BeforeEntryPointList");
-       separator2 = gtk_ui_manager_get_widget (browser->priv->ui, "/MenuBar/Go/EntryPointList");
-       menu = gtk_widget_get_parent (separator1);
-       _gtk_container_remove_children (GTK_CONTAINER (menu), separator1, separator2);
+       GList *entry_points;
+       GFile *root;
 
-       separator1 = separator2;
-       separator2 = gtk_ui_manager_get_widget (browser->priv->ui, "/MenuBar/Go/EntryPointListSeparator");
-       _gtk_container_remove_children (GTK_CONTAINER (menu), separator1, separator2);
-
-       position = 6;
        entry_points = gth_main_get_all_entry_points ();
-       for (scan = entry_points; scan; scan = scan->next) {
-               GthFileData *file_data = scan->data;
-
-               g_file_info_set_attribute_boolean (file_data->info, "gthumb::entry-point", TRUE);
-               g_file_info_set_sort_order (file_data->info, position);
-               _gth_browser_add_file_menu_item_full (browser,
-                                                     menu,
-                                                     file_data->file,
-                                                     g_file_info_get_icon (file_data->info),
-                                                     g_file_info_get_display_name (file_data->info),
-                                                     GTH_ACTION_GO_TO,
-                                                     0,
-                                                     position++);
-       }
        root = g_file_new_for_uri ("gthumb-vfs:///");
        gth_folder_tree_set_children (GTH_FOLDER_TREE (browser->priv->folder_tree), root, entry_points);
 
@@ -2687,7 +2618,6 @@ gth_browser_finalize (GObject *object)
        g_hash_table_unref (browser->priv->named_dialogs);
        g_free (browser->priv->list_attributes);
        _g_object_unref (browser->priv->folder_popup_file_data);
-       _g_object_unref (browser->priv->go_parent_menu);
        _g_object_unref (browser->priv->history_menu);
 
        G_OBJECT_CLASS (gth_browser_parent_class)->finalize (object);
@@ -3811,32 +3741,6 @@ gth_file_list_key_press_cb (GtkWidget   *widget,
 }
 
 
-static void
-_gth_browser_add_custom_actions (GthBrowser     *browser,
-                                GtkActionGroup *actions)
-{
-       GtkAction *action;
-
-       /* Go Up */
-
-       browser->priv->go_parent_menu = gtk_menu_new ();
-       action = g_object_new (GTH_TYPE_MENU_ACTION,
-                              "name", "Toolbar_Go_Up",
-                              "stock-id", GTK_STOCK_GO_UP,
-                              "button-tooltip", _("Go up one level"),
-                              "arrow-tooltip", _("View the list of upper locations"),
-                              "is-important", FALSE,
-                              "menu", browser->priv->go_parent_menu,
-                              NULL);
-       g_signal_connect (action,
-                         "activate",
-                         G_CALLBACK (gth_browser_activate_action_go_up),
-                         browser);
-       gtk_action_group_add_action (actions, action);
-       g_object_unref (action);
-}
-
-
 typedef struct {
        GthBrowser *browser;
        GFile      *location;
@@ -4303,7 +4207,6 @@ gth_browser_init (GthBrowser *browser)
        browser->priv->last_mouse_y = 0.0;
        browser->priv->history = NULL;
        browser->priv->history_current = NULL;
-       browser->priv->go_parent_menu = NULL;
        browser->priv->shrink_wrap_viewer = FALSE;
        browser->priv->browser_settings = g_settings_new (GTHUMB_BROWSER_SCHEMA);
        browser->priv->messages_settings = g_settings_new (GTHUMB_MESSAGES_SCHEMA);
@@ -4368,10 +4271,6 @@ gth_browser_init (GthBrowser *browser)
 
        browser->priv->actions = gtk_action_group_new ("Actions");
        gtk_action_group_set_translation_domain (browser->priv->actions, NULL);
-       gtk_action_group_add_actions (browser->priv->actions,
-                                     gth_window_action_entries,
-                                     G_N_ELEMENTS (gth_window_action_entries),
-                                     browser);
        _gtk_action_group_add_actions_with_flags (browser->priv->actions,
                                                  gth_browser_action_entries,
                                                  G_N_ELEMENTS (gth_browser_action_entries),
@@ -4380,7 +4279,6 @@ gth_browser_init (GthBrowser *browser)
                                             gth_browser_action_toggle_entries,
                                             G_N_ELEMENTS (gth_browser_action_toggle_entries),
                                             browser);
-       _gth_browser_add_custom_actions (browser, browser->priv->actions);
 
        browser->priv->ui = gtk_ui_manager_new ();
        g_signal_connect (browser->priv->ui,
diff --git a/gthumb/main.c b/gthumb/main.c
index aac1134..287c809 100644
--- a/gthumb/main.c
+++ b/gthumb/main.c
@@ -41,7 +41,6 @@
 #include "gth-file-source-vfs.h"
 #include "gth-main.h"
 #include "gth-preferences.h"
-#include "gth-window-actions-callbacks.h"
 #include "gtk-utils.h"
 #include "main-migrate.h"
 
@@ -320,82 +319,13 @@ gth_application_init (GthApplication *app)
 }
 
 
-static void
-activate_new_window (GSimpleAction *action,
-                    GVariant      *parameter,
-                    gpointer       user_data)
-{
-        GApplication *application = user_data;
-        GList        *windows;
-
-        windows = gtk_application_get_windows (GTK_APPLICATION (application));
-        if (windows != NULL)
-               gth_browser_activate_action_file_new_window (NULL, windows->data);
-}
-
-
-static void
-activate_preferences (GSimpleAction *action,
-                     GVariant      *parameter,
-                     gpointer       user_data)
-{
-        GApplication *application = user_data;
-        GList        *windows;
-
-        windows = gtk_application_get_windows (GTK_APPLICATION (application));
-        if (windows != NULL)
-               gth_browser_activate_action_edit_preferences (NULL, windows->data);
-}
-
-
-static void
-activate_help (GSimpleAction *action,
-               GVariant      *parameter,
-               gpointer       user_data)
-{
-        GApplication *application = user_data;
-        GList        *windows;
-
-        windows = gtk_application_get_windows (GTK_APPLICATION (application));
-        if (windows != NULL)
-               gth_browser_activate_action_help_help (NULL, windows->data);
-}
-
-
-static void
-activate_about (GSimpleAction *action,
-               GVariant      *parameter,
-               gpointer       user_data)
-{
-        GApplication *application = user_data;
-        GList        *windows;
-
-        windows = gtk_application_get_windows (GTK_APPLICATION (application));
-        if (windows != NULL)
-               gth_browser_activate_action_help_about (NULL, windows->data);
-}
-
-
-static void
-activate_quit (GSimpleAction *action,
-               GVariant      *parameter,
-               gpointer       user_data)
-{
-        GApplication *application = user_data;
-        GList        *windows;
-
-        windows = gtk_application_get_windows (GTK_APPLICATION (application));
-        if (windows != NULL)
-               gth_window_activate_action_file_quit_application (NULL, windows->data);
-}
-
-
 static const GActionEntry app_menu_entries[] = {
-       { "new-window",  activate_new_window },
-       { "preferences",  activate_preferences },
-       { "help",  activate_help },
-       { "about", activate_about },
-       { "quit",  activate_quit }
+       { "new-window", gth_application_activate_new_window },
+       { "preferences", gth_application_activate_preferences },
+       { "shortcuts", gth_application_activate_show_shortcuts },
+       { "help", gth_application_activate_show_help },
+       { "about", gth_application_activate_about },
+       { "quit", gth_application_activate_quit }
 };
 
 
diff --git a/gthumb/resources/app-menu.ui b/gthumb/resources/app-menu.ui
index 1c9b6cb..00dc460 100644
--- a/gthumb/resources/app-menu.ui
+++ b/gthumb/resources/app-menu.ui
@@ -16,11 +16,15 @@
     </section>
     <section>
       <item>
+        <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
+        <attribute name="action">app.shortcuts</attribute>
+      </item>
+      <item>
         <attribute name="label" translatable="yes">_Help</attribute>
         <attribute name="action">app.help</attribute>
       </item>
       <item>
-        <attribute name="label" translatable="yes">_About gThumb</attribute>
+        <attribute name="label" translatable="yes">_About</attribute>
         <attribute name="action">app.about</attribute>
       </item>
       <item>
diff --git a/gthumb/resources/gears-menu.ui b/gthumb/resources/gears-menu.ui
index 943a281..eff1b3c 100644
--- a/gthumb/resources/gears-menu.ui
+++ b/gthumb/resources/gears-menu.ui
@@ -4,6 +4,13 @@
   <menu id="menu">
     <section>
       <item>
+        <attribute name="label" translatable="yes">_Open…</attribute>
+        <attribute name="action">win.open-location</attribute>
+        <attribute name="accel"><![CDATA[<Ctrl>O]]></attribute>
+      </item>
+    </section>
+    <section>
+      <item>
         <attribute name="label" translatable="yes">_Save</attribute>
         <attribute name="action">win.save</attribute>
         <attribute name="accel"><![CDATA[<Ctrl>S]]></attribute>


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