Commit 11b1300b authored by Martin Nordholts's avatar Martin Nordholts

app: Introduce gimp_dialog_factory_get_singleton()

Instead of including dialogs/dialogs.h everywhere, introduce
gimp_dialog_factory_get_singleton(). The dialog factory singleton is
still initialized by dialogs.c though.

Right now the assumption is that we never will have another dialog
factory instance around. There were so many problems before when we
had four of them, so let's just keep one of them around.
parent 82c52974
......@@ -33,8 +33,6 @@
#include "widgets/gimpcolormapeditor.h"
#include "widgets/gimpdialogfactory.h"
#include "dialogs/dialogs.h"
#include "actions.h"
#include "colormap-commands.h"
......@@ -83,7 +81,7 @@ colormap_edit_color_cmd_callback (GtkAction *action,
GIMP_STOCK_COLORMAP,
desc,
GTK_WIDGET (editor),
global_dialog_factory,
gimp_dialog_factory_get_singleton (),
"gimp-colormap-editor-color-dialog",
(const GimpRGB *) &color,
FALSE, FALSE);
......
......@@ -41,8 +41,6 @@
#include "widgets/gimppaletteeditor.h"
#include "widgets/gimpcolormapeditor.h"
#include "dialogs/dialogs.h"
#include "actions.h"
#include "context-commands.h"
......@@ -872,9 +870,9 @@ context_get_palette_editor (void)
{
GimpSessionInfo *info = NULL;
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (global_dialog_factory), NULL);
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (gimp_dialog_factory_get_singleton ()), NULL);
info = gimp_dialog_factory_find_session_info (global_dialog_factory,
info = gimp_dialog_factory_find_session_info (gimp_dialog_factory_get_singleton (),
"gimp-palette-editor");
if (info && gimp_session_info_get_widget (info))
return GIMP_PALETTE_EDITOR (gtk_bin_get_child (GTK_BIN (gimp_session_info_get_widget (info))));
......@@ -887,9 +885,9 @@ context_get_colormap_editor (void)
{
GimpSessionInfo *info = NULL;
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (global_dialog_factory), NULL);
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (gimp_dialog_factory_get_singleton ()), NULL);
info = gimp_dialog_factory_find_session_info (global_dialog_factory,
info = gimp_dialog_factory_find_session_info (gimp_dialog_factory_get_singleton (),
"gimp-indexed-palette");
if (info && gimp_session_info_get_widget (info))
return GIMP_COLORMAP_EDITOR (gtk_bin_get_child (GTK_BIN (gimp_session_info_get_widget (info))));
......
......@@ -41,8 +41,6 @@
#include "widgets/gimpmessagebox.h"
#include "widgets/gimpmessagedialog.h"
#include "dialogs/dialogs.h"
#include "actions.h"
#include "data-commands.h"
......@@ -302,7 +300,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_dialog_factory, screen,
dockable = gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (), screen,
value, -1);
gimp_data_editor_set_data (GIMP_DATA_EDITOR (gtk_bin_get_child (GTK_BIN (dockable))),
......
......@@ -25,8 +25,6 @@
#include "widgets/gimpdialogfactory.h"
#include "dialogs/dialogs.h"
#include "actions.h"
#include "dialogs-commands.h"
......@@ -42,7 +40,7 @@ dialogs_create_toplevel_cmd_callback (GtkAction *action,
return_if_no_widget (widget, data);
if (value)
gimp_dialog_factory_dialog_new (global_dialog_factory,
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
value, -1, TRUE);
}
......@@ -56,7 +54,7 @@ dialogs_create_dockable_cmd_callback (GtkAction *action,
return_if_no_widget (widget, data);
if (value)
gimp_dialog_factory_dialog_raise (global_dialog_factory,
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
value, -1);
}
......@@ -34,8 +34,6 @@
#include "widgets/gimpdocked.h"
#include "widgets/gimpsessioninfo.h"
#include "dialogs/dialogs.h"
#include "dockable-commands.h"
......
......@@ -49,7 +49,6 @@
#include "display/gimpdisplayshell.h"
#include "display/gimpdisplayshell-transform.h"
#include "dialogs/dialogs.h"
#include "dialogs/fade-dialog.h"
#include "actions.h"
......@@ -449,7 +448,7 @@ edit_named_paste_cmd_callback (GtkAction *action,
GtkWidget *widget;
return_if_no_widget (widget, data);
gimp_dialog_factory_dialog_raise (global_dialog_factory,
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
"gimp-buffer-list|gimp-buffer-grid", -1);
}
......
......@@ -52,7 +52,6 @@
#include "display/gimpdisplay.h"
#include "display/gimpdisplay-foreach.h"
#include "dialogs/dialogs.h"
#include "dialogs/file-save-dialog.h"
#include "actions.h"
......@@ -142,7 +141,7 @@ file_open_location_cmd_callback (GtkAction *action,
GtkWidget *widget;
return_if_no_widget (widget, data);
gimp_dialog_factory_dialog_new (global_dialog_factory,
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
"gimp-file-open-location-dialog", -1, TRUE);
}
......@@ -450,7 +449,7 @@ file_close_all_cmd_callback (GtkAction *action,
GtkWidget *widget;
return_if_no_widget (widget, data);
gimp_dialog_factory_dialog_raise (global_dialog_factory,
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
"gimp-close-all-dialog", -1);
}
......@@ -489,7 +488,7 @@ file_open_dialog_show (Gimp *gimp,
{
GtkWidget *dialog;
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (parent),
"gimp-file-open-dialog", -1, FALSE);
......@@ -531,7 +530,7 @@ file_save_dialog_show (Gimp *gimp,
if (! dialog)
{
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (parent),
"gimp-file-save-dialog",
-1, FALSE);
......@@ -581,7 +580,7 @@ file_export_dialog_show (Gimp *gimp,
if (! dialog)
{
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (parent),
"gimp-file-export-dialog",
-1, FALSE);
......
......@@ -29,13 +29,12 @@
#include "core/gimpgradient.h"
#include "widgets/gimpcolordialog.h"
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpgradienteditor.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpuimanager.h"
#include "widgets/gimpviewabledialog.h"
#include "dialogs/dialogs.h"
#include "gradient-editor-commands.h"
#include "gimp-intl.h"
......@@ -86,7 +85,7 @@ gradient_editor_left_color_cmd_callback (GtkAction *action,
GIMP_STOCK_GRADIENT,
_("Gradient Segment's Left Endpoint Color"),
GTK_WIDGET (editor),
global_dialog_factory,
gimp_dialog_factory_get_singleton (),
"gimp-gradient-editor-color-dialog",
&editor->control_sel_l->left_color,
editor->instant_update, TRUE);
......@@ -237,7 +236,7 @@ gradient_editor_right_color_cmd_callback (GtkAction *action,
GIMP_STOCK_GRADIENT,
_("Gradient Segment's Right Endpoint Color"),
GTK_WIDGET (editor),
global_dialog_factory,
gimp_dialog_factory_get_singleton (),
"gimp-gradient-editor-color-dialog",
&editor->control_sel_l->right_color,
editor->instant_update, TRUE);
......
......@@ -50,7 +50,6 @@
#include "display/gimpdisplayshell.h"
#include "dialogs/convert-dialog.h"
#include "dialogs/dialogs.h"
#include "dialogs/grid-dialog.h"
#include "dialogs/image-merge-layers-dialog.h"
#include "dialogs/image-new-dialog.h"
......@@ -127,7 +126,7 @@ image_new_cmd_callback (GtkAction *action,
GtkWidget *dialog;
return_if_no_widget (widget, data);
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
dialog = gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
"gimp-image-new-dialog", -1, FALSE);
......
......@@ -32,8 +32,6 @@
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimppaletteeditor.h"
#include "dialogs/dialogs.h"
#include "palette-editor-commands.h"
#include "gimp-intl.h"
......@@ -71,7 +69,7 @@ palette_editor_edit_color_cmd_callback (GtkAction *action,
GIMP_STOCK_PALETTE,
_("Edit Color Palette Entry"),
GTK_WIDGET (editor),
global_dialog_factory,
gimp_dialog_factory_get_singleton (),
"gimp-palette-editor-color-dialog",
&editor->color->color,
FALSE, FALSE);
......
......@@ -34,8 +34,6 @@
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpview.h"
#include "dialogs/dialogs.h"
#include "actions.h"
#include "palettes-commands.h"
......@@ -58,7 +56,7 @@ palettes_import_cmd_callback (GtkAction *action,
GtkWidget *widget;
return_if_no_widget (widget, data);
gimp_dialog_factory_dialog_new (global_dialog_factory,
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
"gimp-palette-import-dialog", -1, TRUE);
}
......
......@@ -38,7 +38,6 @@
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "dialogs/dialogs.h"
#include "dialogs/stroke-dialog.h"
#include "actions.h"
......@@ -319,7 +318,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_dialog_factory,
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
"gimp-channel-list", -1);
}
......
......@@ -41,7 +41,6 @@
#include "widgets/gimptemplateeditor.h"
#include "widgets/gimptemplateview.h"
#include "dialogs/dialogs.h"
#include "dialogs/template-options-dialog.h"
#include "actions.h"
......
......@@ -50,8 +50,6 @@
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpuimanager.h"
#include "dialogs/dialogs.h"
#include "actions.h"
#include "view-commands.h"
......@@ -320,7 +318,7 @@ view_navigation_window_cmd_callback (GtkAction *action,
GimpDisplayShell *shell;
return_if_no_shell (shell, data);
gimp_dialog_factory_dialog_raise (global_dialog_factory,
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (GTK_WIDGET (shell)),
"gimp-navigation-view", -1);
}
......
......@@ -151,21 +151,21 @@ windows_actions_setup (GimpActionGroup *group)
windows_actions_display_add (group->gimp->displays, display, group);
}
g_signal_connect_object (global_dialog_factory, "dock-window-added",
g_signal_connect_object (gimp_dialog_factory_get_singleton (), "dock-window-added",
G_CALLBACK (windows_actions_dock_window_added),
group, 0);
g_signal_connect_object (global_dialog_factory, "dock-window-removed",
g_signal_connect_object (gimp_dialog_factory_get_singleton (), "dock-window-removed",
G_CALLBACK (windows_actions_dock_window_removed),
group, 0);
for (list = gimp_dialog_factory_get_open_dialogs (global_dialog_factory);
for (list = gimp_dialog_factory_get_open_dialogs (gimp_dialog_factory_get_singleton ());
list;
list = g_list_next (list))
{
GimpDockWindow *dock_window = list->data;
if (GIMP_IS_DOCK_WINDOW (dock_window))
windows_actions_dock_window_added (global_dialog_factory,
windows_actions_dock_window_added (gimp_dialog_factory_get_singleton (),
dock_window,
group);
}
......
......@@ -54,7 +54,7 @@ windows_hide_docks_cmd_callback (GtkAction *action,
gpointer data)
{
gboolean active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
GimpDialogsState state = gimp_dialog_factory_get_state (global_dialog_factory);
GimpDialogsState state = gimp_dialog_factory_get_state (gimp_dialog_factory_get_singleton ());
GimpDialogsState new_state = state;
Gimp *gimp = NULL;
return_if_no_gimp (gimp, data);
......@@ -69,7 +69,7 @@ windows_hide_docks_cmd_callback (GtkAction *action,
new_state = GIMP_DIALOGS_SHOWN;
if (state != new_state)
gimp_dialog_factory_set_state (global_dialog_factory, new_state);
gimp_dialog_factory_set_state (gimp_dialog_factory_get_singleton (), new_state);
g_object_set (gimp->config,
"hide-docks", active,
......@@ -119,9 +119,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_dialog_factory, info);
gimp_dialog_factory_add_session_info (gimp_dialog_factory_get_singleton (), info);
gimp_session_info_restore (info, global_dialog_factory);
gimp_session_info_restore (info, gimp_dialog_factory_get_singleton ());
gimp_session_info_clear_info (info);
}
......@@ -132,7 +132,7 @@ windows_show_toolbox (void)
if (! dialogs_get_toolbox ())
{
toolbox = gimp_dock_with_window_new (global_dialog_factory,
toolbox = gimp_dock_with_window_new (gimp_dialog_factory_get_singleton (),
gdk_screen_get_default (),
TRUE /*toolbox*/);
......
......@@ -45,8 +45,7 @@
#include "gimp-intl.h"
GimpDialogFactory *global_dialog_factory = NULL;
GimpContainer *global_recent_docks = NULL;
GimpContainer *global_recent_docks = NULL;
#define FOREIGN(id, singleton, remember_size) \
......@@ -377,17 +376,19 @@ void
dialogs_init (Gimp *gimp,
GimpMenuFactory *menu_factory)
{
gint i;
GimpDialogFactory *factory = NULL;
gint i = 0;
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (GIMP_IS_MENU_FACTORY (menu_factory));
global_dialog_factory = gimp_dialog_factory_new ("toplevel",
gimp_get_user_context (gimp),
menu_factory);
factory = gimp_dialog_factory_new ("toplevel",
gimp_get_user_context (gimp),
menu_factory);
gimp_dialog_factory_set_singleton (factory);
for (i = 0; i < G_N_ELEMENTS (entries); i++)
gimp_dialog_factory_register_entry (global_dialog_factory,
gimp_dialog_factory_register_entry (gimp_dialog_factory_get_singleton (),
entries[i].identifier,
gettext (entries[i].name),
gettext (entries[i].blurb),
......@@ -410,10 +411,10 @@ dialogs_exit (Gimp *gimp)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
if (global_dialog_factory)
if (gimp_dialog_factory_get_singleton ())
{
g_object_unref (global_dialog_factory);
global_dialog_factory = NULL;
g_object_unref (gimp_dialog_factory_get_singleton ());
gimp_dialog_factory_set_singleton (NULL);
}
if (global_recent_docks)
......@@ -433,7 +434,7 @@ dialogs_ensure_factory_entry_on_recent_dock (GimpSessionInfo *info)
/* The recent docks container only contains session infos for
* dock windows
*/
entry = gimp_dialog_factory_find_entry (global_dialog_factory,
entry = gimp_dialog_factory_find_entry (gimp_dialog_factory_get_singleton (),
"gimp-dock-window");
gimp_session_info_set_factory_entry (info, entry);
......@@ -506,9 +507,9 @@ dialogs_get_toolbox (void)
{
GList *list;
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (global_dialog_factory), NULL);
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (gimp_dialog_factory_get_singleton ()), NULL);
for (list = gimp_dialog_factory_get_open_dialogs (global_dialog_factory);
for (list = gimp_dialog_factory_get_open_dialogs (gimp_dialog_factory_get_singleton ());
list;
list = g_list_next (list))
{
......
......@@ -59,8 +59,6 @@
#include "gui/session.h"
#include "gui/themes.h"
#include "dialogs/dialogs.h"
#include "preferences-dialog.h"
#include "resolution-calibrate-dialog.h"
......@@ -493,7 +491,7 @@ static void
prefs_input_devices_dialog (GtkWidget *widget,
Gimp *gimp)
{
gimp_dialog_factory_dialog_raise (global_dialog_factory,
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
"gimp-input-devices-dialog", 0);
}
......@@ -502,7 +500,7 @@ static void
prefs_keyboard_shortcuts_dialog (GtkWidget *widget,
Gimp *gimp)
{
gimp_dialog_factory_dialog_raise (global_dialog_factory,
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
gtk_widget_get_screen (widget),
"gimp-keyboard-shortcuts-dialog", 0);
}
......
......@@ -31,8 +31,6 @@
#include "widgets/gimpdialogfactory.h"
#include "widgets/gimpsessioninfo.h"
#include "dialogs/dialogs.h"
#include "gimpdisplay.h"
#include "gimpcursorview.h"
#include "gimpdisplayshell.h"
......@@ -166,7 +164,7 @@ gimp_display_shell_update_cursor (GimpDisplayShell *shell,
gimp_statusbar_update_cursor (statusbar, precision, image_x, image_y);
session_info = gimp_dialog_factory_find_session_info (global_dialog_factory,
session_info = gimp_dialog_factory_find_session_info (gimp_dialog_factory_get_singleton (),
"gimp-cursor-view");
if (session_info && gimp_session_info_get_widget (session_info))
{
......@@ -203,7 +201,7 @@ gimp_display_shell_clear_cursor (GimpDisplayShell *shell)
gimp_statusbar_clear_cursor (statusbar);
session_info = gimp_dialog_factory_find_session_info (global_dialog_factory,
session_info = gimp_dialog_factory_find_session_info (gimp_dialog_factory_get_singleton (),
"gimp-cursor-view");
if (session_info && gimp_session_info_get_widget (session_info))
{
......
......@@ -37,8 +37,6 @@
#include "display/gimpdisplayshell.h"
#include "display/gimpimagewindow.h"
#include "dialogs/dialogs.h"
#include "menus/menus.h"
#include "gimpuiconfigurer.h"
......@@ -161,7 +159,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_dialog_factory));
g_list_copy (gimp_dialog_factory_get_open_dialogs (gimp_dialog_factory_get_singleton ()));
for (dialog_iter = dialogs; dialog_iter; dialog_iter = dialog_iter->next)
{
......@@ -203,7 +201,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_dialog_factory,
gimp_dialog_factory_remove_dialog (gimp_dialog_factory_get_singleton (),
GTK_WIDGET (dock_window));
gtk_widget_destroy (GTK_WIDGET (dock_window));
}
......@@ -283,7 +281,7 @@ gimp_ui_configurer_move_docks_to_window (GimpUIConfigurer *ui_configurer,
* toolbox
*/
dock_window =
gimp_dialog_factory_dialog_new (global_dialog_factory,
gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
screen,
(GIMP_IS_TOOLBOX (dock) ?
"gimp-toolbox-window" :
......@@ -325,7 +323,7 @@ gimp_ui_configurer_separate_shells (GimpUIConfigurer *ui_configurer,
new_image_window = gimp_image_window_new (ui_configurer->p->gimp,
NULL,
global_menu_factory,
global_dialog_factory);
gimp_dialog_factory_get_singleton ());
/* Move the shell there */
shell = gimp_image_window_get_shell (source_image_window, 1);
......
......@@ -41,8 +41,6 @@
#include "widgets/gimpsessioninfo.h"
#include "widgets/gimpwidgets-utils.h"
#include "dialogs/dialogs.h"
#include "gui-message.h"
#include "gimp-intl.h"
......@@ -102,7 +100,7 @@ gui_message_error_console (GimpMessageSeverity severity,
{
GimpSessionInfo *info;
info = gimp_dialog_factory_find_session_info (global_dialog_factory,
info = gimp_dialog_factory_find_session_info (gimp_dialog_factory_get_singleton (),
"gimp-error-console");
if (info && GIMP_IS_DOCKABLE (gimp_session_info_get_widget (info)))
......@@ -110,7 +108,7 @@ gui_message_error_console (GimpMessageSeverity severity,
}
if (! dockable)
dockable = gimp_dialog_factory_dialog_raise (global_dialog_factory,
dockable = gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
gdk_screen_get_default (),
"gimp-error-console", -1);
......@@ -175,7 +173,7 @@ progress_error_dialog (GimpProgress *progress)
static GtkWidget *
global_error_dialog (void)
{
return gimp_dialog_factory_dialog_new (global_dialog_factory,
return gimp_dialog_factory_dialog_new (gimp_dialog_factory_get_singleton (),
gdk_screen_get_default (),
"gimp-error-dialog", -1,
FALSE);
......
......@@ -70,8 +70,6 @@
#include "menus/menus.h"
#include "dialogs/dialogs.h"
#include "gui-message.h"
#include "gui-vtable.h"
#include "themes.h"
......@@ -199,7 +197,7 @@ static void
gui_set_busy (Gimp *gimp)
{
gimp_displays_set_busy (gimp);
gimp_dialog_factory_set_busy (global_dialog_factory);
gimp_dialog_factory_set_busy (gimp_dialog_factory_get_singleton ());
gdk_flush ();
}
......@@ -208,7 +206,7 @@ static void
gui_unset_busy (Gimp *gimp)
{
gimp_displays_unset_busy (gimp);
gimp_dialog_factory_unset_busy (global_dialog_factory);
gimp_dialog_factory_unset_busy (gimp_dialog_factory_get_singleton ());
gdk_flush ();
}
......@@ -351,7 +349,7 @@ gui_display_create (Gimp *gimp,
display = gimp_display_new (gimp, image, unit, scale,
global_menu_factory,
image_managers->data,
global_dialog_factory);
gimp_dialog_factory_get_singleton ());
}
if (gimp_context_get_display (context) == display)
......
......@@ -560,7 +560,7 @@ gui_exit_callback (Gimp *gimp,
if (! force && gimp_displays_dirty (gimp))
{
gimp_dialog_factory_dialog_raise (global_dialog_factory,
gimp_dialog_factory_dialog_raise (gimp_dialog_factory_get_singleton (),
gdk_screen_get_default (),
"gimp-quit-dialog", -1);
......@@ -697,7 +697,7 @@ gui_device_change_notify (Gimp *gimp)
{
GimpSessionInfo *session_info;
session_info = gimp_dialog_factory_find_session_info (global_dialog_factory,
session_info = gimp_dialog_factory_find_session_info (gimp_dialog_factory_get_singleton (),
"gimp-device-status");
if (session_info && gimp_session_info_get_widget (session_info))
......
......@@ -139,10 +139,10 @@ session_init (Gimp *gimp)
/* In versions <= GIMP 2.6 there was a "toolbox", a
* "dock", a "display" and a "toplevel" factory. These
* are now merged to a single global_dialog_factory. We
* are now merged to a single gimp_dialog_factory_get_singleton (). We
* need the legacy name though, so keep it around.
*/
factory = global_dialog_factory;
factory = gimp_dialog_factory_get_singleton ();
info = gimp_session_info_new ();
......@@ -268,7 +268,7 @@ session_restore (Gimp *gimp)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
gimp_dialog_factory_restore (global_dialog_factory);
gimp_dialog_factory_restore (gimp_dialog_factory_get_singleton ());
}
void
......@@ -307,7 +307,7 @@ session_save (Gimp *gimp,
if (!writer)
return;
gimp_dialog_factory_save (global_dialog_factory, writer);
gimp_dialog_factory_save (gimp_dialog_factory_get_singleton (), writer);
gimp_config_writer_linefeed (writer);