[gimp] app: Merge "toplevel" and "dock" dialog factories



commit 8b458fb59150b94e55f209396868e2db7ac4dafa
Author: Martin Nordholts <martinn src gnome org>
Date:   Sat Feb 20 09:26:57 2010 +0100

    app: Merge "toplevel" and "dock" dialog factories
    
    Merge "toplevel" and "dock" dialog factories. The end goal is to have
    only one dialog factory.

 app/actions/context-commands.c        |    4 +-
 app/actions/data-commands.c           |    2 +-
 app/actions/dialogs-commands.c        |    2 +-
 app/actions/edit-commands.c           |    2 +-
 app/actions/select-commands.c         |    2 +-
 app/actions/view-commands.c           |    2 +-
 app/actions/windows-actions.c         |    8 ++--
 app/actions/windows-commands.c        |    6 ++--
 app/dialogs/dialogs.c                 |   65 +++++++++------------------------
 app/dialogs/dialogs.h                 |    1 -
 app/display/gimpdisplayshell-cursor.c |    4 +-
 app/gui/gimpuiconfigurer.c            |    8 ++--
 app/gui/gui-message.c                 |    4 +-
 app/gui/gui-vtable.c                  |    2 +-
 app/gui/gui.c                         |    2 +-
 app/gui/session.c                     |   15 ++++----
 app/menus/windows-menu.c              |    8 ++--
 app/tests/gimpdir/sessionrc-expected  |   10 +++---
 app/tests/test-ui.c                   |   12 +++---
 app/tests/test-window-management.c    |    4 +-
 app/tools/gimpcolortool.c             |    2 +-
 app/widgets/gimpdevicestatus.c        |    2 +-
 app/widgets/gimpdockable.c            |    2 +-
 app/widgets/gimpdockwindow.c          |    2 +-
 app/widgets/gimpviewablebox.c         |    4 +-
 25 files changed, 72 insertions(+), 103 deletions(-)
---
diff --git a/app/actions/context-commands.c b/app/actions/context-commands.c
index ac6f004..7813410 100644
--- a/app/actions/context-commands.c
+++ b/app/actions/context-commands.c
@@ -871,7 +871,7 @@ context_get_palette_editor (void)
   GimpDialogFactory *dialog_factory;
   GimpSessionInfo   *info;
 
-  dialog_factory = gimp_dialog_factory_from_name ("dock");
+  dialog_factory = gimp_dialog_factory_from_name ("toplevel");
 
   g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (dialog_factory), NULL);
 
@@ -889,7 +889,7 @@ context_get_colormap_editor (void)
   GimpDialogFactory *dialog_factory;
   GimpSessionInfo   *info;
 
-  dialog_factory = gimp_dialog_factory_from_name ("dock");
+  dialog_factory = gimp_dialog_factory_from_name ("toplevel");
 
   g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (dialog_factory), NULL);
 
diff --git a/app/actions/data-commands.c b/app/actions/data-commands.c
index 753b854..f6b3f39 100644
--- a/app/actions/data-commands.c
+++ b/app/actions/data-commands.c
@@ -302,7 +302,7 @@ data_edit_cmd_callback (GtkAction   *action,
       GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (view));
       GtkWidget *dockable;
 
-      dockable = gimp_dialog_factory_dialog_raise (global_dock_factory, screen,
+      dockable = gimp_dialog_factory_dialog_raise (global_dialog_factory, screen,
                                                    value, -1);
 
       gimp_data_editor_set_data (GIMP_DATA_EDITOR (gtk_bin_get_child (GTK_BIN (dockable))),
diff --git a/app/actions/dialogs-commands.c b/app/actions/dialogs-commands.c
index 54512d9..9b10b84 100644
--- a/app/actions/dialogs-commands.c
+++ b/app/actions/dialogs-commands.c
@@ -56,7 +56,7 @@ dialogs_create_dockable_cmd_callback (GtkAction   *action,
   return_if_no_widget (widget, data);
 
   if (value)
-    gimp_dialog_factory_dialog_raise (global_dock_factory,
+    gimp_dialog_factory_dialog_raise (global_dialog_factory,
                                       gtk_widget_get_screen (widget),
                                       value, -1);
 }
diff --git a/app/actions/edit-commands.c b/app/actions/edit-commands.c
index 55409e9..abfcb30 100644
--- a/app/actions/edit-commands.c
+++ b/app/actions/edit-commands.c
@@ -449,7 +449,7 @@ edit_named_paste_cmd_callback (GtkAction *action,
   GtkWidget *widget;
   return_if_no_widget (widget, data);
 
-  gimp_dialog_factory_dialog_raise (global_dock_factory,
+  gimp_dialog_factory_dialog_raise (global_dialog_factory,
                                     gtk_widget_get_screen (widget),
                                     "gimp-buffer-list|gimp-buffer-grid", -1);
 }
diff --git a/app/actions/select-commands.c b/app/actions/select-commands.c
index 7073564..df69d96 100644
--- a/app/actions/select-commands.c
+++ b/app/actions/select-commands.c
@@ -319,7 +319,7 @@ select_save_cmd_callback (GtkAction *action,
   gimp_selection_save (GIMP_SELECTION (gimp_image_get_mask (image)));
   gimp_image_flush (image);
 
-  gimp_dialog_factory_dialog_raise (global_dock_factory,
+  gimp_dialog_factory_dialog_raise (global_dialog_factory,
                                     gtk_widget_get_screen (widget),
                                     "gimp-channel-list", -1);
 }
diff --git a/app/actions/view-commands.c b/app/actions/view-commands.c
index a0b687a..0514321 100644
--- a/app/actions/view-commands.c
+++ b/app/actions/view-commands.c
@@ -338,7 +338,7 @@ view_navigation_window_cmd_callback (GtkAction *action,
 
   shell = gimp_display_get_shell (display);
 
-  gimp_dialog_factory_dialog_raise (global_dock_factory,
+  gimp_dialog_factory_dialog_raise (global_dialog_factory,
                                     gtk_widget_get_screen (GTK_WIDGET (shell)),
                                     "gimp-navigation-view", -1);
 }
diff --git a/app/actions/windows-actions.c b/app/actions/windows-actions.c
index 628d255..aea298f 100644
--- a/app/actions/windows-actions.c
+++ b/app/actions/windows-actions.c
@@ -137,21 +137,21 @@ windows_actions_setup (GimpActionGroup *group)
       windows_actions_display_add (group->gimp->displays, display, group);
     }
 
-  g_signal_connect_object (global_dock_factory, "dock-window-added",
+  g_signal_connect_object (global_dialog_factory, "dock-window-added",
                            G_CALLBACK (windows_actions_dock_window_added),
                            group, 0);
-  g_signal_connect_object (global_dock_factory, "dock-window-removed",
+  g_signal_connect_object (global_dialog_factory, "dock-window-removed",
                            G_CALLBACK (windows_actions_dock_window_removed),
                            group, 0);
 
-  for (list = gimp_dialog_factory_get_open_dialogs (global_dock_factory);
+  for (list = gimp_dialog_factory_get_open_dialogs (global_dialog_factory);
        list;
        list = g_list_next (list))
     {
       GimpDockWindow *dock_window = list->data;
 
       if (GIMP_IS_DOCK_WINDOW (dock_window))
-        windows_actions_dock_window_added (global_dock_factory,
+        windows_actions_dock_window_added (global_dialog_factory,
                                            dock_window,
                                            group);
     }
diff --git a/app/actions/windows-commands.c b/app/actions/windows-commands.c
index f9a4a12..b8c9979 100644
--- a/app/actions/windows-commands.c
+++ b/app/actions/windows-commands.c
@@ -91,9 +91,9 @@ windows_open_recent_cmd_callback (GtkAction *action,
   g_object_ref (info);
   gimp_container_remove (global_recent_docks, GIMP_OBJECT (info));
 
-  gimp_dialog_factory_add_session_info (global_dock_factory, info);
+  gimp_dialog_factory_add_session_info (global_dialog_factory, info);
 
-  gimp_session_info_restore (info, global_dock_factory);
+  gimp_session_info_restore (info, global_dialog_factory);
   gimp_session_info_clear_info (info);
 }
 
@@ -104,7 +104,7 @@ windows_show_toolbox (void)
 
   if (! dialogs_get_toolbox ())
     {
-      toolbox = gimp_dialog_factory_dock_with_window_new (global_dock_factory,
+      toolbox = gimp_dialog_factory_dock_with_window_new (global_dialog_factory,
                                                           gdk_screen_get_default (),
                                                           TRUE /*toolbox*/);
 
diff --git a/app/dialogs/dialogs.c b/app/dialogs/dialogs.c
index 84eafba..867086e 100644
--- a/app/dialogs/dialogs.c
+++ b/app/dialogs/dialogs.c
@@ -43,7 +43,6 @@
 
 
 GimpDialogFactory *global_dialog_factory  = NULL;
-GimpDialogFactory *global_dock_factory    = NULL;
 GimpDialogFactory *global_display_factory = NULL;
 
 GimpContainer     *global_recent_docks    = NULL;
@@ -160,7 +159,7 @@ GimpContainer     *global_recent_docks    = NULL;
     TRUE                          /* dockable         */}
 
 
-static const GimpDialogFactoryEntry toplevel_entries[] =
+static const GimpDialogFactoryEntry entries[] =
 {
   /*  foreign toplevels without constructor  */
   FOREIGN ("gimp-brightness-contrast-tool-dialog", TRUE,  FALSE),
@@ -222,11 +221,8 @@ static const GimpDialogFactoryEntry toplevel_entries[] =
   TOPLEVEL ("gimp-close-all-dialog",
             dialogs_close_all_get,          TRUE, FALSE, FALSE),
   TOPLEVEL ("gimp-quit-dialog",
-            dialogs_quit_get,               TRUE, FALSE, FALSE)
-};
+            dialogs_quit_get,               TRUE, FALSE, FALSE),
 
-static const GimpDialogFactoryEntry dock_entries[] =
-{
   /*  docks  */
   DOCK ("gimp-dock",
         dialogs_dock_new),
@@ -364,12 +360,6 @@ dialogs_init (Gimp            *gimp,
                                                    menu_factory,
                                                    TRUE);
 
-  /* Dock windows and docks */
-  global_dock_factory = gimp_dialog_factory_new ("dock",
-                                                 gimp_get_user_context (gimp),
-                                                 menu_factory,
-                                                 TRUE);
-
   /* Display */
   global_display_factory = gimp_dialog_factory_new ("display",
                                                     gimp_get_user_context (gimp),
@@ -377,35 +367,20 @@ dialogs_init (Gimp            *gimp,
                                                     FALSE);
 
 
-  for (i = 0; i < G_N_ELEMENTS (toplevel_entries); i++)
+  for (i = 0; i < G_N_ELEMENTS (entries); i++)
     gimp_dialog_factory_register_entry (global_dialog_factory,
-                                        toplevel_entries[i].identifier,
-                                        gettext (toplevel_entries[i].name),
-                                        gettext (toplevel_entries[i].blurb),
-                                        toplevel_entries[i].stock_id,
-                                        toplevel_entries[i].help_id,
-                                        toplevel_entries[i].new_func,
-                                        toplevel_entries[i].view_size,
-                                        toplevel_entries[i].singleton,
-                                        toplevel_entries[i].session_managed,
-                                        toplevel_entries[i].remember_size,
-                                        toplevel_entries[i].remember_if_open,
-                                        toplevel_entries[i].dockable);
-
-  for (i = 0; i < G_N_ELEMENTS (dock_entries); i++)
-    gimp_dialog_factory_register_entry (global_dock_factory,
-                                        dock_entries[i].identifier,
-                                        gettext (dock_entries[i].name),
-                                        gettext (dock_entries[i].blurb),
-                                        dock_entries[i].stock_id,
-                                        dock_entries[i].help_id,
-                                        dock_entries[i].new_func,
-                                        dock_entries[i].view_size,
-                                        dock_entries[i].singleton,
-                                        dock_entries[i].session_managed,
-                                        dock_entries[i].remember_size,
-                                        dock_entries[i].remember_if_open,
-                                        dock_entries[i].dockable);
+                                        entries[i].identifier,
+                                        gettext (entries[i].name),
+                                        gettext (entries[i].blurb),
+                                        entries[i].stock_id,
+                                        entries[i].help_id,
+                                        entries[i].new_func,
+                                        entries[i].view_size,
+                                        entries[i].singleton,
+                                        entries[i].session_managed,
+                                        entries[i].remember_size,
+                                        entries[i].remember_if_open,
+                                        entries[i].dockable);
 
   gimp_dialog_factory_register_entry (global_display_factory,
                                       "gimp-empty-image-window",
@@ -433,12 +408,6 @@ dialogs_exit (Gimp *gimp)
       global_dialog_factory = NULL;
     }
 
-  if (global_dock_factory)
-    {
-      g_object_unref (global_dock_factory);
-      global_dock_factory = NULL;
-    }
-
   if (global_display_factory)
     {
       g_object_unref (global_display_factory);
@@ -511,9 +480,9 @@ dialogs_get_toolbox (void)
 {
   GList *list;
 
-  g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (global_dock_factory), NULL);
+  g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (global_dialog_factory), NULL);
 
-  for (list = gimp_dialog_factory_get_open_dialogs (global_dock_factory);
+  for (list = gimp_dialog_factory_get_open_dialogs (global_dialog_factory);
        list;
        list = g_list_next (list))
     {
diff --git a/app/dialogs/dialogs.h b/app/dialogs/dialogs.h
index 6c592ee..3148c2e 100644
--- a/app/dialogs/dialogs.h
+++ b/app/dialogs/dialogs.h
@@ -20,7 +20,6 @@
 
 
 extern GimpDialogFactory *global_dialog_factory;
-extern GimpDialogFactory *global_dock_factory;
 extern GimpDialogFactory *global_display_factory;
 
 extern GimpContainer     *global_recent_docks;
diff --git a/app/display/gimpdisplayshell-cursor.c b/app/display/gimpdisplayshell-cursor.c
index 769db4a..7a1d1d6 100644
--- a/app/display/gimpdisplayshell-cursor.c
+++ b/app/display/gimpdisplayshell-cursor.c
@@ -165,7 +165,7 @@ gimp_display_shell_update_cursor (GimpDisplayShell    *shell,
 
   gimp_statusbar_update_cursor (statusbar, precision, image_x, image_y);
 
-  factory = gimp_dialog_factory_from_name ("dock");
+  factory = gimp_dialog_factory_from_name ("toplevel");
   session_info = gimp_dialog_factory_find_session_info (factory,
                                                         "gimp-cursor-view");
   if (session_info && gimp_session_info_get_widget (session_info))
@@ -204,7 +204,7 @@ gimp_display_shell_clear_cursor (GimpDisplayShell *shell)
 
   gimp_statusbar_clear_cursor (statusbar);
 
-  factory = gimp_dialog_factory_from_name ("dock");
+  factory = gimp_dialog_factory_from_name ("toplevel");
   session_info = gimp_dialog_factory_find_session_info (factory,
                                                         "gimp-cursor-view");
   if (session_info && gimp_session_info_get_widget (session_info))
diff --git a/app/gui/gimpuiconfigurer.c b/app/gui/gimpuiconfigurer.c
index 1e4a338..d2c2e17 100644
--- a/app/gui/gimpuiconfigurer.c
+++ b/app/gui/gimpuiconfigurer.c
@@ -161,7 +161,7 @@ gimp_ui_configurer_move_docks_to_columns (GimpUIConfigurer  *ui_configurer,
   GList *dialog_iter = NULL;
 
   dialogs =
-    g_list_copy (gimp_dialog_factory_get_open_dialogs (global_dock_factory));
+    g_list_copy (gimp_dialog_factory_get_open_dialogs (global_dialog_factory));
 
   for (dialog_iter = dialogs; dialog_iter; dialog_iter = dialog_iter->next)
     {
@@ -203,7 +203,7 @@ gimp_ui_configurer_move_docks_to_columns (GimpUIConfigurer  *ui_configurer,
       if (GTK_IS_WIDGET (dock_window) &&
           g_list_length (gimp_dock_window_get_docks (dock_window)) == 0)
         {
-          gimp_dialog_factory_remove_dialog (global_dock_factory,
+          gimp_dialog_factory_remove_dialog (global_dialog_factory,
                                              GTK_WIDGET (dock_window));
           gtk_widget_destroy (GTK_WIDGET (dock_window));
         }
@@ -283,7 +283,7 @@ gimp_ui_configurer_move_docks_to_window (GimpUIConfigurer *ui_configurer,
        * toolbox
        */
       dock_window =
-        gimp_dialog_factory_dialog_new (global_dock_factory,
+        gimp_dialog_factory_dialog_new (global_dialog_factory,
                                         screen,
                                         (GIMP_IS_TOOLBOX (dock) ?
                                          "gimp-toolbox-window" :
@@ -326,7 +326,7 @@ gimp_ui_configurer_separate_shells (GimpUIConfigurer *ui_configurer,
                                                 NULL,
                                                 global_menu_factory,
                                                 global_display_factory,
-                                                global_dock_factory);
+                                                global_dialog_factory);
       /* Move the shell there */
       shell = gimp_image_window_get_shell (source_image_window, 1);
 
diff --git a/app/gui/gui-message.c b/app/gui/gui-message.c
index 0763e3e..4ec2f9b 100644
--- a/app/gui/gui-message.c
+++ b/app/gui/gui-message.c
@@ -102,7 +102,7 @@ gui_message_error_console (GimpMessageSeverity  severity,
     {
       GimpSessionInfo *info;
 
-      info = gimp_dialog_factory_find_session_info (global_dock_factory,
+      info = gimp_dialog_factory_find_session_info (global_dialog_factory,
                                                     "gimp-error-console");
 
       if (info && GIMP_IS_DOCKABLE (gimp_session_info_get_widget (info)))
@@ -110,7 +110,7 @@ gui_message_error_console (GimpMessageSeverity  severity,
     }
 
   if (! dockable)
-    dockable = gimp_dialog_factory_dialog_raise (global_dock_factory,
+    dockable = gimp_dialog_factory_dialog_raise (global_dialog_factory,
                                                  gdk_screen_get_default (),
                                                  "gimp-error-console", -1);
 
diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c
index 0aded2b..020a519 100644
--- a/app/gui/gui-vtable.c
+++ b/app/gui/gui-vtable.c
@@ -352,7 +352,7 @@ gui_display_create (Gimp      *gimp,
                                   global_menu_factory,
                                   image_managers->data,
                                   global_display_factory,
-                                  global_dock_factory);
+                                  global_dialog_factory);
    }
 
   if (gimp_context_get_display (context) == display)
diff --git a/app/gui/gui.c b/app/gui/gui.c
index e765c99..ed120ce 100644
--- a/app/gui/gui.c
+++ b/app/gui/gui.c
@@ -704,7 +704,7 @@ gui_device_change_notify (Gimp *gimp)
 {
   GimpSessionInfo *session_info;
 
-  session_info = gimp_dialog_factory_find_session_info (global_dock_factory,
+  session_info = gimp_dialog_factory_find_session_info (global_dialog_factory,
                                                         "gimp-device-status");
 
   if (session_info && gimp_session_info_get_widget (session_info))
diff --git a/app/gui/session.c b/app/gui/session.c
index 2b7c30c..0752c89 100644
--- a/app/gui/session.c
+++ b/app/gui/session.c
@@ -138,14 +138,15 @@ session_init (Gimp *gimp)
               if (! gimp_scanner_parse_string (scanner, &factory_name))
                 break;
 
-              /* In versions <= GIMP 2.6 there was a "toolbox" and a
-               * "dock" factory. These are now merged so if the
-               * factory name is "toolbox", get the "dock" factory
-               * instead. We don't change factory_name because we need
-               * it below
+              /* In versions <= GIMP 2.6 there was a "toolbox", a
+               * "dock" and a "toplevel" factory. These are now merged
+               * so if the factory name is "toolbox" or "dock", get
+               * the "toplevel" factory instead. We don't change
+               * factory_name because we need it below
                */
-              factory = gimp_dialog_factory_from_name (strcmp ("toolbox", factory_name) == 0 ?
-                                                       "dock" :
+              factory = gimp_dialog_factory_from_name ((strcmp ("toolbox", factory_name) == 0 ||
+                                                        strcmp ("dock",    factory_name) == 0) ?
+                                                       "toplevel" :
                                                        factory_name);
 
               if (! factory)
diff --git a/app/menus/windows-menu.c b/app/menus/windows-menu.c
index 4fd3aa2..6b27cbb 100644
--- a/app/menus/windows-menu.c
+++ b/app/menus/windows-menu.c
@@ -104,21 +104,21 @@ windows_menu_setup (GimpUIManager *manager,
       windows_menu_display_add (manager->gimp->displays, display, manager);
     }
 
-  g_signal_connect_object (global_dock_factory, "dock-window-added",
+  g_signal_connect_object (global_dialog_factory, "dock-window-added",
                            G_CALLBACK (windows_menu_dock_window_added),
                            manager, 0);
-  g_signal_connect_object (global_dock_factory, "dock-window-removed",
+  g_signal_connect_object (global_dialog_factory, "dock-window-removed",
                            G_CALLBACK (windows_menu_dock_window_removed),
                            manager, 0);
 
-  for (list = gimp_dialog_factory_get_open_dialogs (global_dock_factory);
+  for (list = gimp_dialog_factory_get_open_dialogs (global_dialog_factory);
        list;
        list = g_list_next (list))
     {
       GimpDockWindow *dock_window = list->data;
 
       if (GIMP_IS_DOCK_WINDOW (dock_window))
-        windows_menu_dock_window_added (global_dock_factory,
+        windows_menu_dock_window_added (global_dialog_factory,
                                         dock_window,
                                         manager);
     }
diff --git a/app/tests/gimpdir/sessionrc-expected b/app/tests/gimpdir/sessionrc-expected
index 2b83a24..a44971a 100644
--- a/app/tests/gimpdir/sessionrc-expected
+++ b/app/tests/gimpdir/sessionrc-expected
@@ -5,7 +5,7 @@
 # of course you can do.  The sessionrc will be entirely rewritten every time
 # you quit GIMP.  If this file isn't found, defaults are used.
 
-(session-info "dock" "gimp-dock-window"
+(session-info "toplevel" "gimp-dock-window"
     (position 566 171)
     (size 210 535)
     (open-on-exit)
@@ -25,7 +25,7 @@
             (current-page 0)
             (dockable "gimp-brush-grid"
                 (tab-style preview)))))
-(session-info "dock" "gimp-dock-window"
+(session-info "toplevel" "gimp-dock-window"
     (position 141 291)
     (size 406 300)
     (open-on-exit)
@@ -42,7 +42,7 @@
             (current-page 0)
             (dockable "gimp-device-status"
                 (tab-style icon)))))
-(session-info "dock" "gimp-dock-window"
+(session-info "toplevel" "gimp-dock-window"
     (position 795 43)
     (size 200 265)
     (open-on-exit)
@@ -56,7 +56,7 @@
                 (tab-style preview))
             (dockable "gimp-gradient-list"
                 (tab-style preview)))))
-(session-info "dock" "gimp-dock-window"
+(session-info "toplevel" "gimp-dock-window"
     (position 803 344)
     (size 200 404)
     (open-on-exit)
@@ -78,7 +78,7 @@
                     (edit-active "true")
                     (current-data "Standard")
                     (zoom-factor "2.80"))))))
-(session-info "dock" "gimp-toolbox-window"
+(session-info "toplevel" "gimp-toolbox-window"
     (position 13 37)
     (size 96 620)
     (open-on-exit)
diff --git a/app/tests/test-ui.c b/app/tests/test-ui.c
index 59470bf..fb6b4ad 100644
--- a/app/tests/test-ui.c
+++ b/app/tests/test-ui.c
@@ -160,7 +160,7 @@ gimp_ui_tool_options_editor_updates (GimpTestFixture *fixture,
   GtkWidget             *toplevel     = gtk_widget_get_toplevel (GTK_WIDGET (shell));
   GimpImageWindow       *image_window = GIMP_IMAGE_WINDOW (toplevel);
   GimpUIManager         *ui_manager   = gimp_image_window_get_ui_manager (image_window);
-  GimpDialogFactory     *dock_factory = gimp_dialog_factory_from_name ("dock");
+  GimpDialogFactory     *dock_factory = gimp_dialog_factory_from_name ("toplevel");
   GtkWidget             *dockable     = gimp_dialog_factory_dialog_new (dock_factory,
                                                                         gtk_widget_get_screen (toplevel),
                                                                         "gimp-tool-options",
@@ -251,11 +251,11 @@ gimp_ui_restore_recently_closed_dock (GimpTestFixture *fixture,
   GList     *session_infos                 = NULL;
 
   /* Find a non-toolbox dock window */
-  dock_window = gimp_ui_find_non_toolbox_dock_window (global_dock_factory);
+  dock_window = gimp_ui_find_non_toolbox_dock_window (global_dialog_factory);
   g_assert (dock_window != NULL);
 
   /* Count number of docks */
-  session_infos = gimp_dialog_factory_get_session_infos (global_dock_factory);
+  session_infos = gimp_dialog_factory_get_session_infos (global_dialog_factory);
   n_session_infos_before_close = g_list_length (session_infos);
 
   /* Close one of the dock windows */
@@ -263,7 +263,7 @@ gimp_ui_restore_recently_closed_dock (GimpTestFixture *fixture,
   gimp_test_run_mainloop_until_idle ();
 
   /* Make sure the number of session infos went down */
-  session_infos = gimp_dialog_factory_get_session_infos (global_dock_factory);
+  session_infos = gimp_dialog_factory_get_session_infos (global_dialog_factory);
   n_session_infos_after_close = g_list_length (session_infos);
   g_assert_cmpint (n_session_infos_before_close,
                    >,
@@ -277,7 +277,7 @@ gimp_ui_restore_recently_closed_dock (GimpTestFixture *fixture,
                                    /* FIXME: This is severly hardcoded */
                                    "windows-recent-0003");
   gimp_test_run_mainloop_until_idle ();
-  session_infos = gimp_dialog_factory_get_session_infos (global_dock_factory);
+  session_infos = gimp_dialog_factory_get_session_infos (global_dialog_factory);
   n_session_infos_after_restore = g_list_length (session_infos);
   g_assert_cmpint (n_session_infos_after_close,
                    <,
@@ -308,7 +308,7 @@ gimp_ui_tab_toggle_dont_change_position (GimpTestFixture *fixture,
   gint       h_after_show  = -1;
 
   /* Find a non-toolbox dock window */
-  dock_window = gimp_ui_find_non_toolbox_dock_window (global_dock_factory);
+  dock_window = gimp_ui_find_non_toolbox_dock_window (global_dialog_factory);
   g_assert (dock_window != NULL);
   g_assert (gtk_widget_get_visible (dock_window));
 
diff --git a/app/tests/test-window-management.c b/app/tests/test-window-management.c
index 0bcd590..34eb281 100644
--- a/app/tests/test-window-management.c
+++ b/app/tests/test-window-management.c
@@ -98,10 +98,10 @@ gimp_test_window_roles (GimpTestFixture *fixture,
   GimpDockWindow *dock_window    = NULL;
   GimpDockWindow *toolbox_window = NULL;
 
-  dock           = gimp_dialog_factory_dock_with_window_new (global_dock_factory,
+  dock           = gimp_dialog_factory_dock_with_window_new (global_dialog_factory,
                                                              gdk_screen_get_default (),
                                                              FALSE /*toolbox*/);
-  toolbox        = gimp_dialog_factory_dock_with_window_new (global_dock_factory,
+  toolbox        = gimp_dialog_factory_dock_with_window_new (global_dialog_factory,
                                                              gdk_screen_get_default (),
                                                              TRUE /*toolbox*/);
   dock_window    = gimp_dock_window_from_dock (GIMP_DOCK (dock));
diff --git a/app/tools/gimpcolortool.c b/app/tools/gimpcolortool.c
index 4f1b15a..b83684d 100644
--- a/app/tools/gimpcolortool.c
+++ b/app/tools/gimpcolortool.c
@@ -638,7 +638,7 @@ gimp_color_tool_real_picked (GimpColorTool      *color_tool,
   /*  use this tool's own options here (NOT color_tool->options)  */
   context = GIMP_CONTEXT (gimp_tool_get_options (tool));
 
-  dialog_factory = gimp_dialog_factory_from_name ("dock");
+  dialog_factory = gimp_dialog_factory_from_name ("toplevel");
 
   if (color_tool->pick_mode == GIMP_COLOR_PICK_MODE_FOREGROUND ||
       color_tool->pick_mode == GIMP_COLOR_PICK_MODE_BACKGROUND)
diff --git a/app/widgets/gimpdevicestatus.c b/app/widgets/gimpdevicestatus.c
index 7c91c79..8aab61b 100644
--- a/app/widgets/gimpdevicestatus.c
+++ b/app/widgets/gimpdevicestatus.c
@@ -469,7 +469,7 @@ gimp_device_status_view_clicked (GtkWidget       *widget,
 {
   GimpDialogFactory *dialog_factory;
 
-  dialog_factory = gimp_dialog_factory_from_name ("dock");
+  dialog_factory = gimp_dialog_factory_from_name ("toplevel");
 
   gimp_dialog_factory_dialog_raise (dialog_factory,
                                     gtk_widget_get_screen (widget),
diff --git a/app/widgets/gimpdockable.c b/app/widgets/gimpdockable.c
index c6b849b..a7771cf 100644
--- a/app/widgets/gimpdockable.c
+++ b/app/widgets/gimpdockable.c
@@ -1205,7 +1205,7 @@ gimp_dockable_detach (GimpDockable *dockable)
   src_dock = gimp_dockbook_get_dock (dockable->p->dockbook);
   src_dock_window = gimp_dock_window_from_dock (src_dock);
 
-  dock = gimp_dialog_factory_dock_with_window_new (global_dock_factory,
+  dock = gimp_dialog_factory_dock_with_window_new (global_dialog_factory,
                                                    gtk_widget_get_screen (GTK_WIDGET (dockable)),
                                                    FALSE /*toolbox*/);
   dock_window = gimp_dock_window_from_dock (GIMP_DOCK (dock));
diff --git a/app/widgets/gimpdockwindow.c b/app/widgets/gimpdockwindow.c
index ad3c3d1..1e99244 100644
--- a/app/widgets/gimpdockwindow.c
+++ b/app/widgets/gimpdockwindow.c
@@ -637,7 +637,7 @@ gimp_dock_window_delete_event (GtkWidget   *widget,
   entry_name = (gimp_dock_window_has_toolbox (dock_window) ?
                 "gimp-toolbox-window" :
                 "gimp-dock-window");
-  entry = gimp_dialog_factory_find_entry (global_dock_factory, entry_name);
+  entry = gimp_dialog_factory_find_entry (global_dialog_factory, entry_name);
   gimp_session_info_set_factory_entry (info, entry);
 
   gimp_container_add (global_recent_docks, GIMP_OBJECT (info));
diff --git a/app/widgets/gimpviewablebox.c b/app/widgets/gimpviewablebox.c
index b43c43f..d57d25a 100644
--- a/app/widgets/gimpviewablebox.c
+++ b/app/widgets/gimpviewablebox.c
@@ -197,7 +197,7 @@ gradient_box_new (GimpContainer *container,
   button = gimp_viewable_button_new (container, context,
                                      view_type,
                                      GIMP_VIEW_SIZE_LARGE, view_size, 1,
-                                     gimp_dialog_factory_from_name ("dock"),
+                                     gimp_dialog_factory_from_name ("toplevel"),
                                      "gimp-gradient-list|gimp-gradient-grid",
                                      GIMP_STOCK_GRADIENT,
                                      _("Open the gradient selection dialog"));
@@ -423,7 +423,7 @@ gimp_viewable_box_new (GimpContainer *container,
 
   button = gimp_viewable_button_new (container, context,
                                      view_type, button_view_size, view_size, 1,
-                                     gimp_dialog_factory_from_name ("dock"),
+                                     gimp_dialog_factory_from_name ("toplevel"),
                                      dialog_identifier,
                                      dialog_stock_id,
                                      dialog_tooltip);



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