[gimp] app: Make tooltips in the toolbox work again



commit d7dc2dc1ab509c078d5584ddb9dddb790d0d0441
Author: Martin Nordholts <martinn src gnome org>
Date:   Sun May 16 12:19:18 2010 +0200

    app: Make tooltips in the toolbox work again
    
    We need to be able to pass a GimpUIManager to
    gimp_dialog_factory_dialog_new(), so make that possible. Also make
    sure to set ui_manager in gimp_dialog_factory_dialog_new_internal()
    when we create both a dock window and a dock, so tooltips works in
    toolboxes created from scratch.

 app/actions/dialogs-commands.c     |    1 +
 app/actions/file-commands.c        |    4 ++++
 app/actions/image-commands.c       |    1 +
 app/actions/palettes-commands.c    |    1 +
 app/gui/gimpuiconfigurer.c         |    1 +
 app/gui/gui-message.c              |    1 +
 app/tests/test-ui.c                |    1 +
 app/widgets/gimpdialogfactory.c    |   10 +++++++++-
 app/widgets/gimpdialogfactory.h    |    1 +
 app/widgets/gimpsessioninfo-dock.c |    1 +
 app/widgets/gimpsessioninfo.c      |    1 +
 app/widgets/gimpwidgets-utils.c    |    2 ++
 12 files changed, 24 insertions(+), 1 deletions(-)
---
diff --git a/app/actions/dialogs-commands.c b/app/actions/dialogs-commands.c
index f576bda..e572ae4 100644
--- a/app/actions/dialogs-commands.c
+++ b/app/actions/dialogs-commands.c
@@ -42,6 +42,7 @@ dialogs_create_toplevel_cmd_callback (GtkAction   *action,
   if (value)
     gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
                                     gtk_widget_get_screen (widget),
+                                    NULL /*ui_manager*/,
                                     value, -1, TRUE);
 }
 
diff --git a/app/actions/file-commands.c b/app/actions/file-commands.c
index 5060d69..c9e6545 100644
--- a/app/actions/file-commands.c
+++ b/app/actions/file-commands.c
@@ -143,6 +143,7 @@ file_open_location_cmd_callback (GtkAction *action,
 
   gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
                                   gtk_widget_get_screen (widget),
+                                  NULL /*ui_manager*/,
                                   "gimp-file-open-location-dialog", -1, TRUE);
 }
 
@@ -490,6 +491,7 @@ file_open_dialog_show (Gimp        *gimp,
 
   dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
                                            gtk_widget_get_screen (parent),
+                                           NULL /*ui_manager*/,
                                            "gimp-file-open-dialog", -1, FALSE);
 
   if (dialog)
@@ -532,6 +534,7 @@ file_save_dialog_show (Gimp        *gimp,
     {
       dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
                                                gtk_widget_get_screen (parent),
+                                               NULL /*ui_manager*/,
                                                "gimp-file-save-dialog",
                                                -1, FALSE);
 
@@ -582,6 +585,7 @@ file_export_dialog_show (Gimp      *gimp,
     {
       dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
                                                gtk_widget_get_screen (parent),
+                                               NULL /*ui_manager*/,
                                                "gimp-file-export-dialog",
                                                -1, FALSE);
 
diff --git a/app/actions/image-commands.c b/app/actions/image-commands.c
index d1f0740..f826b93 100644
--- a/app/actions/image-commands.c
+++ b/app/actions/image-commands.c
@@ -128,6 +128,7 @@ image_new_cmd_callback (GtkAction *action,
 
   dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
                                            gtk_widget_get_screen (widget),
+                                           NULL /*ui_manager*/,
                                            "gimp-image-new-dialog", -1, FALSE);
 
   if (dialog)
diff --git a/app/actions/palettes-commands.c b/app/actions/palettes-commands.c
index 6bd2efb..beafd8e 100644
--- a/app/actions/palettes-commands.c
+++ b/app/actions/palettes-commands.c
@@ -58,6 +58,7 @@ palettes_import_cmd_callback (GtkAction *action,
 
   gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
                                   gtk_widget_get_screen (widget),
+                                  NULL /*ui_manager*/,
                                   "gimp-palette-import-dialog", -1, TRUE);
 }
 
diff --git a/app/gui/gimpuiconfigurer.c b/app/gui/gimpuiconfigurer.c
index 7537384..a061607 100644
--- a/app/gui/gimpuiconfigurer.c
+++ b/app/gui/gimpuiconfigurer.c
@@ -283,6 +283,7 @@ gimp_ui_configurer_move_docks_to_window (GimpUIConfigurer *ui_configurer,
       dock_window =
         gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
                                         screen,
+                                        NULL /*ui_manager*/,
                                         (GIMP_IS_TOOLBOX (dock) ?
                                          "gimp-toolbox-window" :
                                          "gimp-dock-window"),
diff --git a/app/gui/gui-message.c b/app/gui/gui-message.c
index 38523c3..863b1ca 100644
--- a/app/gui/gui-message.c
+++ b/app/gui/gui-message.c
@@ -175,6 +175,7 @@ global_error_dialog (void)
 {
   return gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
                                          gdk_screen_get_default (),
+                                         NULL /*ui_manager*/,
                                          "gimp-error-dialog", -1,
                                          FALSE);
 }
diff --git a/app/tests/test-ui.c b/app/tests/test-ui.c
index 435395b..fa222dd 100644
--- a/app/tests/test-ui.c
+++ b/app/tests/test-ui.c
@@ -188,6 +188,7 @@ gimp_ui_tool_options_editor_updates (GimpTestFixture *fixture,
   GimpUIManager         *ui_manager   = gimp_image_window_get_ui_manager (image_window);
   GtkWidget             *dockable     = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
                                                                         gtk_widget_get_screen (toplevel),
+                                                                        NULL /*ui_manager*/,
                                                                         "gimp-tool-options",
                                                                         -1 /*view_size*/,
                                                                         FALSE /*present*/);
diff --git a/app/widgets/gimpdialogfactory.c b/app/widgets/gimpdialogfactory.c
index 209525c..612e6f5 100644
--- a/app/widgets/gimpdialogfactory.c
+++ b/app/widgets/gimpdialogfactory.c
@@ -458,9 +458,15 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
             {
               dock_window = gimp_dialog_factory_dialog_new (factory,
                                                             screen,
+                                                            NULL /*ui_manager*/,
                                                             "gimp-toolbox-window",
                                                             -1 /*view_size*/,
                                                             FALSE /*present*/);
+
+              /* When we get a dock window, we also get a UI
+               * manager
+               */
+              ui_manager = gimp_dock_window_get_ui_manager (GIMP_DOCK_WINDOW (dock_window));
             }
         }
 
@@ -605,6 +611,7 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
  * gimp_dialog_factory_dialog_new:
  * @factory:      a #GimpDialogFactory
  * @screen:       the #GdkScreen the dialog should appear on
+ * @ui_manager:   A #GimpUIManager, if applicable.
  * @identifier:   the identifier of the dialog as registered with
  *                gimp_dialog_factory_register_entry()
  * @view_size:    the initial preview size
@@ -619,6 +626,7 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
 GtkWidget *
 gimp_dialog_factory_dialog_new (GimpDialogFactory *factory,
                                 GdkScreen         *screen,
+                                GimpUIManager     *ui_manager,
                                 const gchar       *identifier,
                                 gint               view_size,
                                 gboolean           present)
@@ -630,7 +638,7 @@ gimp_dialog_factory_dialog_new (GimpDialogFactory *factory,
   return gimp_dialog_factory_dialog_new_internal (factory,
                                                   screen,
                                                   factory->p->context,
-                                                  NULL,
+                                                  ui_manager,
                                                   identifier,
                                                   view_size,
                                                   FALSE,
diff --git a/app/widgets/gimpdialogfactory.h b/app/widgets/gimpdialogfactory.h
index 3e493b0..2c0d323 100644
--- a/app/widgets/gimpdialogfactory.h
+++ b/app/widgets/gimpdialogfactory.h
@@ -131,6 +131,7 @@ GimpSessionInfo *   gimp_dialog_factory_find_session_info    (GimpDialogFactory
                                                               const gchar             *identifier);
 GtkWidget *         gimp_dialog_factory_dialog_new           (GimpDialogFactory       *factory,
                                                               GdkScreen               *screen,
+                                                              GimpUIManager           *ui_manager,
                                                               const gchar             *identifier,
                                                               gint                     view_size,
                                                               gboolean                 present);
diff --git a/app/widgets/gimpsessioninfo-dock.c b/app/widgets/gimpsessioninfo-dock.c
index a620c5b..2920de8 100644
--- a/app/widgets/gimpsessioninfo-dock.c
+++ b/app/widgets/gimpsessioninfo-dock.c
@@ -231,6 +231,7 @@ gimp_session_info_dock_restore (GimpSessionInfoDock *dock_info,
   ui_manager = gimp_dock_window_get_ui_manager (GIMP_DOCK_WINDOW (dock_window));
   dock       = gimp_dialog_factory_dialog_new (factory,
                                                screen,
+                                               ui_manager,
                                                dock_info->identifier,
                                                -1 /*view_size*/,
                                                FALSE /*present*/);
diff --git a/app/widgets/gimpsessioninfo.c b/app/widgets/gimpsessioninfo.c
index c584a4b..1c2d91f 100644
--- a/app/widgets/gimpsessioninfo.c
+++ b/app/widgets/gimpsessioninfo.c
@@ -461,6 +461,7 @@ gimp_session_info_restore (GimpSessionInfo   *info,
 
       dialog =
         gimp_dialog_factory_dialog_new (factory, screen,
+                                        NULL /*ui_manager*/,
                                         info->p->factory_entry->identifier,
                                         info->p->factory_entry->view_size,
                                         ! GIMP_GUI_CONFIG (config)->hide_docks);
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index 9c995d0..09a6ca1 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -1083,6 +1083,7 @@ gimp_dock_with_window_new (GimpDialogFactory *factory,
   dock_window =
     gimp_dialog_factory_dialog_new (factory,
                                     screen,
+                                    NULL /*ui_manager*/,
                                     (toolbox ?
                                      "gimp-toolbox-window" :
                                      "gimp-dock-window"),
@@ -1093,6 +1094,7 @@ gimp_dock_with_window_new (GimpDialogFactory *factory,
   ui_manager = gimp_dock_window_get_ui_manager (GIMP_DOCK_WINDOW (dock_window));
   dock       = gimp_dialog_factory_dialog_new (factory,
                                                screen,
+                                               ui_manager,
                                                (toolbox ?
                                                 "gimp-toolbox" :
                                                 "gimp-dock"),



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