Commit ce1370bb authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

added a boolean parameter to gimp_dialog_factory_dialog_new() to let the

2004-09-01  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpdialogfactory.[ch]: added a boolean parameter to
	gimp_dialog_factory_dialog_new() to let the caller decide whether
	the window should be presented or not.

	* app/actions/dialogs-commands.c
	* app/actions/image-commands.c
	* app/actions/templates-commands.c
	* app/gui/gui-vtable.c
	* app/gui/gui.c
	* app/widgets/gimpsessioninfo.c: changed accordingly. Do not let
	gimp_dialog_factory_dialog_new() present the dialog if we need to
	change it after creation. This avoids annoying resizes, noticeable
	especially with the error dialog.
parent cd4154e1
2004-09-01 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdialogfactory.[ch]: added a boolean parameter to
gimp_dialog_factory_dialog_new() to let the caller decide whether
the window should be presented or not.
* app/actions/dialogs-commands.c
* app/actions/image-commands.c
* app/actions/templates-commands.c
* app/gui/gui-vtable.c
* app/gui/gui.c
* app/widgets/gimpsessioninfo.c: changed accordingly. Do not let
gimp_dialog_factory_dialog_new() present the dialog if we need to
change it after creation. This avoids annoying resizes, noticeable
especially with the error dialog.
2004-08-31 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdockable.c
......
......@@ -67,7 +67,7 @@ dialogs_create_toplevel_cmd_callback (GtkAction *action,
if (value)
gimp_dialog_factory_dialog_new (global_dialog_factory,
gtk_widget_get_screen (widget),
value, -1);
value, -1, TRUE);
}
void
......@@ -197,7 +197,7 @@ dialogs_create_dock (GdkScreen *screen,
{
dockable = gimp_dialog_factory_dialog_new (global_dock_factory,
screen,
tabs[i], -1);
tabs[i], -1, TRUE);
if (dockable && ! GIMP_DOCKABLE (dockable)->dockbook)
gimp_dock_add (GIMP_DOCK (dock), GIMP_DOCKABLE (dockable), -1, -1);
......
......@@ -117,9 +117,14 @@ image_new_cmd_callback (GtkAction *action,
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
gtk_widget_get_screen (widget),
"gimp-file-new-dialog", -1);
"gimp-file-new-dialog", -1, FALSE);
if (dialog)
file_new_dialog_set (dialog, NULL, NULL);
{
file_new_dialog_set (dialog, NULL, NULL);
gtk_window_present (GTK_WINDOW (dialog));
}
}
void
......@@ -132,7 +137,7 @@ image_new_from_image_cmd_callback (GtkAction *action,
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
gtk_widget_get_screen (widget),
"gimp-file-new-dialog", -1);
"gimp-file-new-dialog", -1, FALSE);
if (dialog)
{
......@@ -140,6 +145,8 @@ image_new_from_image_cmd_callback (GtkAction *action,
if (gimage)
file_new_dialog_set (dialog, gimage, NULL);
gtk_window_present (GTK_WINDOW (dialog));
}
}
......
......@@ -367,8 +367,12 @@ templates_file_new_dialog (Gimp *gimp,
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
gtk_widget_get_screen (parent),
"gimp-file-new-dialog", -1);
"gimp-file-new-dialog", -1, FALSE);
if (dialog)
file_new_dialog_set (dialog, NULL, template);
{
file_new_dialog_set (dialog, NULL, template);
gtk_window_present (GTK_WINDOW (dialog));
}
}
......@@ -229,14 +229,18 @@ gui_message (Gimp *gimp,
{
GtkWidget *dialog;
dialog = gimp_dialog_factory_dialog_raise (global_dialog_factory,
gdk_screen_get_default (),
"gimp-error-dialog", -1);
dialog = gimp_dialog_factory_dialog_new (global_dialog_factory,
gdk_screen_get_default (),
"gimp-error-dialog", -1,
FALSE);
if (dialog)
{
gimp_error_dialog_add (GIMP_ERROR_DIALOG (dialog),
GIMP_STOCK_WARNING, domain, message);
gtk_window_present (GTK_WINDOW (dialog));
return;
}
......
......@@ -234,7 +234,7 @@ gui_post_init (Gimp *gimp)
if (GIMP_GUI_CONFIG (gimp->config)->show_tips)
gimp_dialog_factory_dialog_new (global_dialog_factory,
gdk_screen_get_default (),
"gimp-tips-dialog", -1);
"gimp-tips-dialog", -1, TRUE);
if (gimp_check_glib_version (2, 4, 4) == NULL &&
gimp_check_glib_version (2, 4, 5) != NULL)
......
......@@ -395,7 +395,6 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
return NULL;
}
/* a singleton dialog is always only raised if it already exisits */
if (raise_if_found || entry->singleton)
{
GimpSessionInfo *info;
......@@ -504,7 +503,9 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
if (GTK_WIDGET_TOPLEVEL (dialog))
{
gtk_window_set_screen (GTK_WINDOW (dialog), screen);
gtk_window_present (GTK_WINDOW (dialog));
if (raise_if_found)
gtk_window_present (GTK_WINDOW (dialog));
}
else if (GIMP_IS_DOCKABLE (dialog))
{
......@@ -544,12 +545,11 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
* @identifier: the identifier of the dialog as registered with
* gimp_dialog_factory_register_entry()
* @preview_size:
* @present: whether gtk_window_present() should be called
*
* Creates a new toplevel dialog or a #GimpDockable, depending on whether
* %factory is a toplevel of dockable factory.
*
* Implicitly raises singleton dialogs.
*
* Return value: the newly created dialog or an already existing singleton
* dialog.
**/
......@@ -557,7 +557,8 @@ GtkWidget *
gimp_dialog_factory_dialog_new (GimpDialogFactory *factory,
GdkScreen *screen,
const gchar *identifier,
gint preview_size)
gint preview_size,
gboolean present)
{
g_return_val_if_fail (GIMP_IS_DIALOG_FACTORY (factory), NULL);
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
......@@ -568,7 +569,7 @@ gimp_dialog_factory_dialog_new (GimpDialogFactory *factory,
factory->context,
identifier,
preview_size,
FALSE);
present);
}
/**
......
......@@ -115,7 +115,8 @@ GimpSessionInfo * gimp_dialog_factory_find_session_info
GtkWidget * gimp_dialog_factory_dialog_new (GimpDialogFactory *factory,
GdkScreen *screen,
const gchar *identifier,
gint preview_size);
gint preview_size,
gboolean present);
GtkWidget * gimp_dialog_factory_dialog_raise (GimpDialogFactory *factory,
GdkScreen *screen,
const gchar *identifiers,
......
......@@ -732,7 +732,8 @@ gimp_session_info_restore (GimpSessionInfo *info,
dialog =
gimp_dialog_factory_dialog_new (factory, screen,
info->toplevel_entry->identifier,
info->toplevel_entry->preview_size);
info->toplevel_entry->preview_size,
TRUE);
if (dialog && info->aux_info)
session_info_set_aux_info (dialog, info->aux_info);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment