[gimp] app: clean up the new action search a bit



commit 36f87b5b2b126e03a831ec0be871600f49ad5040
Author: Michael Natterer <mitch gimp org>
Date:   Tue Feb 18 20:10:24 2014 +0100

    app: clean up the new action search a bit
    
    - order some stuff alphabetically and consistently
    - move action from help-actions to dialogs-actions
    - fix OS/X menu item fiddling (untested)

 app/actions/dialogs-actions.c      |    8 +++++++-
 app/actions/help-actions.c         |    8 +-------
 app/actions/help-commands.c        |   15 ---------------
 app/actions/help-commands.h        |   10 ++++------
 app/dialogs/Makefile.am            |    4 ++--
 app/dialogs/dialogs-constructors.c |   20 ++++++++++----------
 app/dialogs/dialogs-constructors.h |    8 ++++----
 app/dialogs/dialogs.c              |    4 ++--
 app/dialogs/preferences-dialog.c   |    3 ++-
 app/gui/gui.c                      |   21 ++++++++++-----------
 app/widgets/Makefile.am            |    4 ++--
 11 files changed, 44 insertions(+), 61 deletions(-)
---
diff --git a/app/actions/dialogs-actions.c b/app/actions/dialogs-actions.c
index c7686f8..4064600 100644
--- a/app/actions/dialogs-actions.c
+++ b/app/actions/dialogs-actions.c
@@ -267,7 +267,13 @@ static const GimpStringActionEntry dialogs_toplevel_actions[] =
     NULL,
     NC_("dialogs-action", "About GIMP"),
     "gimp-about-dialog",
-    GIMP_HELP_ABOUT_DIALOG }
+      GIMP_HELP_ABOUT_DIALOG },
+
+  { "help-action-search", GTK_STOCK_FIND,
+    NC_("help-action", "_Search and Run a Command"), "slash",
+    NC_("help-action", "Search commands by keyword, and run them"),
+    "gimp-action-search-dialog",
+    GIMP_HELP_ACTION_SEARCH_DIALOG }
 };
 
 
diff --git a/app/actions/help-actions.c b/app/actions/help-actions.c
index f76330d..fecce13 100644
--- a/app/actions/help-actions.c
+++ b/app/actions/help-actions.c
@@ -47,13 +47,7 @@ static const GimpActionEntry help_actions[] =
     NC_("help-action", "_Context Help"), "<shift>F1",
     NC_("help-action", "Show the help for a specific user interface item"),
     G_CALLBACK (help_context_help_cmd_callback),
-    GIMP_HELP_HELP_CONTEXT },
-
-  { "help-action-search", GTK_STOCK_FIND,
-    NC_("help-action", "_Search and Run a Command"), "slash",
-    NC_("help-action", "Search commands by keyword, and run them"),
-    G_CALLBACK (help_search_actions_cmd_callback),
-    GIMP_HELP_ACTION_SEARCH_DIALOG }
+    GIMP_HELP_HELP_CONTEXT }
 };
 
 
diff --git a/app/actions/help-commands.c b/app/actions/help-commands.c
index 1d4af8d..82d8a2f 100644
--- a/app/actions/help-commands.c
+++ b/app/actions/help-commands.c
@@ -26,7 +26,6 @@
 
 #include "core/gimpprogress.h"
 
-#include "widgets/gimpdialogfactory.h"
 #include "widgets/gimphelp.h"
 
 #include "actions.h"
@@ -54,17 +53,3 @@ help_context_help_cmd_callback (GtkAction *action,
 
   gimp_context_help (widget);
 }
-
-void
-help_search_actions_cmd_callback (GtkAction *action,
-                                  gpointer   data)
-{
-  Gimp        *gimp;
-  GtkWidget *widget;
-  return_if_no_widget (widget, data);
-
-  gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
-                                  gtk_widget_get_screen (widget),
-                                  NULL,
-                                  "gimp-action-search-dialog", -1, TRUE);
-}
diff --git a/app/actions/help-commands.h b/app/actions/help-commands.h
index c7507e1..7d94206 100644
--- a/app/actions/help-commands.h
+++ b/app/actions/help-commands.h
@@ -19,12 +19,10 @@
 #define __HELP_COMMANDS_H__
 
 
-void   help_help_cmd_callback           (GtkAction *action,
-                                         gpointer   data);
-void   help_context_help_cmd_callback   (GtkAction *action,
-                                         gpointer   data);
-void   help_search_actions_cmd_callback (GtkAction *action,
-                                         gpointer   data);
+void   help_help_cmd_callback         (GtkAction *action,
+                                       gpointer   data);
+void   help_context_help_cmd_callback (GtkAction *action,
+                                       gpointer   data);
 
 
 #endif /* __HELP_COMMANDS_H__ */
diff --git a/app/dialogs/Makefile.am b/app/dialogs/Makefile.am
index 69ec717..e177623 100644
--- a/app/dialogs/Makefile.am
+++ b/app/dialogs/Makefile.am
@@ -13,8 +13,6 @@ AM_CPPFLAGS = \
 noinst_LIBRARIES = libappdialogs.a
 
 libappdialogs_a_sources = \
-       action-search-dialog.c          \
-       action-search-dialog.h          \
        dialogs-types.h                 \
        dialogs.c                       \
        dialogs.h                       \
@@ -23,6 +21,8 @@ libappdialogs_a_sources = \
        \
        about-dialog.c                  \
        about-dialog.h                  \
+       action-search-dialog.c          \
+       action-search-dialog.h          \
        channel-options-dialog.c        \
        channel-options-dialog.h        \
        convert-precision-dialog.c      \
diff --git a/app/dialogs/dialogs-constructors.c b/app/dialogs/dialogs-constructors.c
index 706d638..267625f 100644
--- a/app/dialogs/dialogs-constructors.c
+++ b/app/dialogs/dialogs-constructors.c
@@ -65,6 +65,7 @@
 #include "display/gimpnavigationeditor.h"
 
 #include "about-dialog.h"
+#include "action-search-dialog.h"
 #include "dialogs.h"
 #include "dialogs-constructors.h"
 #include "file-open-dialog.h"
@@ -78,7 +79,6 @@
 #include "preferences-dialog.h"
 #include "quit-dialog.h"
 #include "tips-dialog.h"
-#include "action-search-dialog.h"
 
 #include "gimp-intl.h"
 
@@ -133,15 +133,6 @@ dialogs_file_export_new (GimpDialogFactory *factory,
 }
 
 GtkWidget *
-dialogs_action_search_get (GimpDialogFactory *factory,
-                           GimpContext       *context,
-                           GimpUIManager     *ui_manager,
-                           gint               view_size)
-{
-  return action_search_dialog_create (context->gimp);
-}
-
-GtkWidget *
 dialogs_preferences_get (GimpDialogFactory *factory,
                          GimpContext       *context,
                          GimpUIManager     *ui_manager,
@@ -205,6 +196,15 @@ dialogs_about_get (GimpDialogFactory *factory,
 }
 
 GtkWidget *
+dialogs_action_search_get (GimpDialogFactory *factory,
+                           GimpContext       *context,
+                           GimpUIManager     *ui_manager,
+                           gint               view_size)
+{
+  return action_search_dialog_create (context->gimp);
+}
+
+GtkWidget *
 dialogs_error_get (GimpDialogFactory *factory,
                    GimpContext       *context,
                    GimpUIManager     *ui_manager,
diff --git a/app/dialogs/dialogs-constructors.h b/app/dialogs/dialogs-constructors.h
index bb0a526..53b8d53 100644
--- a/app/dialogs/dialogs-constructors.h
+++ b/app/dialogs/dialogs-constructors.h
@@ -41,10 +41,6 @@ GtkWidget * dialogs_file_export_new        (GimpDialogFactory *factory,
                                             GimpContext       *context,
                                             GimpUIManager     *ui_manager,
                                             gint               view_size);
-GtkWidget * dialogs_action_search_get      (GimpDialogFactory *factory,
-                                            GimpContext       *context,
-                                            GimpUIManager     *ui_manager,
-                                            gint               view_size);
 GtkWidget * dialogs_preferences_get        (GimpDialogFactory *factory,
                                             GimpContext       *context,
                                             GimpUIManager     *ui_manager,
@@ -73,6 +69,10 @@ GtkWidget * dialogs_about_get              (GimpDialogFactory *factory,
                                             GimpContext       *context,
                                             GimpUIManager     *ui_manager,
                                             gint               view_size);
+GtkWidget * dialogs_action_search_get      (GimpDialogFactory *factory,
+                                            GimpContext       *context,
+                                            GimpUIManager     *ui_manager,
+                                            gint               view_size);
 GtkWidget * dialogs_error_get              (GimpDialogFactory *factory,
                                             GimpContext       *context,
                                             GimpUIManager     *ui_manager,
diff --git a/app/dialogs/dialogs.c b/app/dialogs/dialogs.c
index 42ec649..7624e06 100644
--- a/app/dialogs/dialogs.c
+++ b/app/dialogs/dialogs.c
@@ -264,8 +264,6 @@ static const GimpDialogFactoryEntry entries[] =
             dialogs_file_export_new,        FALSE, TRUE, TRUE),
 
   /*  singleton toplevels  */
-  TOPLEVEL ("gimp-action-search-dialog",
-            dialogs_action_search_get,      TRUE,  TRUE, TRUE),
   TOPLEVEL ("gimp-preferences-dialog",
             dialogs_preferences_get,        TRUE, TRUE,  FALSE),
   TOPLEVEL ("gimp-input-devices-dialog",
@@ -280,6 +278,8 @@ static const GimpDialogFactoryEntry entries[] =
             dialogs_tips_get,               TRUE, FALSE, FALSE),
   TOPLEVEL ("gimp-about-dialog",
             dialogs_about_get,              TRUE, FALSE, FALSE),
+  TOPLEVEL ("gimp-action-search-dialog",
+            dialogs_action_search_get,      TRUE, TRUE,  TRUE),
   TOPLEVEL ("gimp-error-dialog",
             dialogs_error_get,              TRUE, FALSE, FALSE),
   TOPLEVEL ("gimp-close-all-dialog",
diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c
index efb8624..845d000 100644
--- a/app/dialogs/preferences-dialog.c
+++ b/app/dialogs/preferences-dialog.c
@@ -35,6 +35,7 @@
 #include "core/gimplist.h"
 #include "core/gimptemplate.h"
 
+#include "widgets/gimpaction-history.h"
 #include "widgets/gimpcolorpanel.h"
 #include "widgets/gimpcontainercombobox.h"
 #include "widgets/gimpcontainerview.h"
@@ -53,7 +54,6 @@
 #include "widgets/gimptooleditor.h"
 #include "widgets/gimpwidgets-constructors.h"
 #include "widgets/gimpwidgets-utils.h"
-#include "widgets/gimpaction-history.h"
 
 #include "menus/menus.h"
 
@@ -1701,6 +1701,7 @@ prefs_dialog_new (Gimp       *gimp,
   g_object_unref (size_group);
   size_group = NULL;
 
+
   /******************/
   /*  Tool Options  */
   /******************/
diff --git a/app/gui/gui.c b/app/gui/gui.c
index 7eb3d44..d787b94 100644
--- a/app/gui/gui.c
+++ b/app/gui/gui.c
@@ -46,6 +46,7 @@
 
 #include "tools/gimp-tools.h"
 
+#include "widgets/gimpaction-history.h"
 #include "widgets/gimpclipboard.h"
 #include "widgets/gimpcolorselectorpalette.h"
 #include "widgets/gimpcontrollers.h"
@@ -61,7 +62,6 @@
 #include "widgets/gimpuimanager.h"
 #include "widgets/gimpwidgets-utils.h"
 #include "widgets/gimplanguagestore-parser.h"
-#include "widgets/gimpaction-history.h"
 
 #include "actions/actions.h"
 #include "actions/windows-commands.h"
@@ -513,31 +513,29 @@ gui_restore_after_callback (Gimp               *gimp,
 
     gui_add_to_app_menu (image_ui_manager, osx_app,
                          "/image-menubar/Help/dialogs-about", 0);
+    gui_add_to_app_menu (image_ui_manager, osx_app,
+                         "/image-menubar/Help/dialogs-search-action", 1);
 
 #define PREFERENCES "/image-menubar/Edit/Preferences/"
 
     gui_add_to_app_menu (image_ui_manager, osx_app,
-                         PREFERENCES "dialogs-preferences", 2);
+                         PREFERENCES "dialogs-preferences", 3);
     gui_add_to_app_menu (image_ui_manager, osx_app,
-                         PREFERENCES "dialogs-input-devices", 3);
+                         PREFERENCES "dialogs-input-devices", 4);
     gui_add_to_app_menu (image_ui_manager, osx_app,
-                         PREFERENCES "dialogs-keyboard-shortcuts", 4);
+                         PREFERENCES "dialogs-keyboard-shortcuts", 5);
     gui_add_to_app_menu (image_ui_manager, osx_app,
-                         PREFERENCES "dialogs-module-dialog", 5);
+                         PREFERENCES "dialogs-module-dialog", 6);
     gui_add_to_app_menu (image_ui_manager, osx_app,
-                         PREFERENCES "plug-in-unit-editor", 6);
+                         PREFERENCES "plug-in-unit-editor", 7);
 
 #undef PREFERENCES
 
-    gui_add_to_app_menu (image_ui_manager, group,
-                         "/dummy-menubar/image-popup/Help/dialogs-search-action",
-                         _("Search and Run a Command"));
-
     /*  the preferences group  */
     group = ige_mac_menu_add_app_menu_group ();
 
     item = gtk_separator_menu_item_new ();
-    gtkosx_application_insert_app_menu_item (osx_app, item, 7);
+    gtkosx_application_insert_app_menu_item (osx_app, item, 8);
 
     item = gtk_ui_manager_get_widget (GTK_UI_MANAGER (image_ui_manager),
                                       "/image-menubar/File/file-quit");
@@ -663,6 +661,7 @@ gui_exit_after_callback (Gimp     *gimp,
                                         gimp);
 
   gimp_action_history_exit (GIMP_GUI_CONFIG (gimp->config));
+
   g_object_unref (image_ui_manager);
   image_ui_manager = NULL;
 
diff --git a/app/widgets/Makefile.am b/app/widgets/Makefile.am
index 3948910..7f8a932 100644
--- a/app/widgets/Makefile.am
+++ b/app/widgets/Makefile.am
@@ -19,6 +19,8 @@ libappwidgets_a_sources = \
        widgets-types.h                 \
        gimpaction.c                    \
        gimpaction.h                    \
+       gimpaction-history.c            \
+       gimpaction-history.h            \
        gimpactioneditor.c              \
        gimpactioneditor.h              \
        gimpactionfactory.c             \
@@ -223,8 +225,6 @@ libappwidgets_a_sources = \
        gimplanguagestore.h             \
        gimplanguagestore-parser.c      \
        gimplanguagestore-parser.h      \
-       gimpaction-history.c    \
-       gimpaction-history.h    \
        gimplayertreeview.c             \
        gimplayertreeview.h             \
        gimpmenudock.c                  \


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