Commit 5f6783a4 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

removed the call to gtk_widget_get_toplevel() again. Implement the

2004-02-28  Sven Neumann  <sven@gimp.org>

	* libgimpwidgets/gimpdialog.c: removed the call to
	gtk_widget_get_toplevel() again.
	Implement the GTK_DIALOG_DESTROY_WITH_PARENT behaviour in a way
	that works for GimpDialog.

	* app/gui/resolution-calibrate-dialog.c: pass the toplevel window
	to gimp_dialog_new ().
parent 80fbb0f1
2004-02-28 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpdialog.c: removed the call to
gtk_widget_get_toplevel() again.
Implement the GTK_DIALOG_DESTROY_WITH_PARENT behaviour in a way
that works for GimpDialog.
* app/gui/resolution-calibrate-dialog.c: pass the toplevel window
to gimp_dialog_new ().
2004-02-28 Michael Natterer <mitch@gimp.org> 2004-02-28 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpcellrendererviewable.c: some general cleanup. * app/widgets/gimpcellrendererviewable.c: some general cleanup.
...@@ -84,7 +84,7 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry, ...@@ -84,7 +84,7 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry,
dialog = gimp_dialog_new (_("Calibrate Monitor Resolution"), dialog = gimp_dialog_new (_("Calibrate Monitor Resolution"),
"calibrate_resolution", "calibrate_resolution",
resolution_entry, gtk_widget_get_toplevel (resolution_entry),
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_DIALOG_DESTROY_WITH_PARENT,
NULL, NULL, NULL, NULL,
...@@ -112,6 +112,7 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry, ...@@ -112,6 +112,7 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry,
if (pixbuf) if (pixbuf)
{ {
GtkWidget *image = gtk_image_new_from_pixbuf (pixbuf); GtkWidget *image = gtk_image_new_from_pixbuf (pixbuf);
gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 1, gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 1,
GTK_SHRINK, GTK_SHRINK, 4, 4); GTK_SHRINK, GTK_SHRINK, 4, 4);
gtk_widget_show (image); gtk_widget_show (image);
...@@ -261,8 +262,9 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry, ...@@ -261,8 +262,9 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry,
chain_button = GIMP_COORDINATES_CHAINBUTTON (resolution_entry); chain_button = GIMP_COORDINATES_CHAINBUTTON (resolution_entry);
if (ABS (x -y) > GIMP_MIN_RESOLUTION) if (ABS (x - y) > GIMP_MIN_RESOLUTION)
gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chain_button), FALSE); gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chain_button),
FALSE);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (resolution_entry), gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (resolution_entry),
0, calibrate_xres); 0, calibrate_xres);
......
...@@ -84,7 +84,7 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry, ...@@ -84,7 +84,7 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry,
dialog = gimp_dialog_new (_("Calibrate Monitor Resolution"), dialog = gimp_dialog_new (_("Calibrate Monitor Resolution"),
"calibrate_resolution", "calibrate_resolution",
resolution_entry, gtk_widget_get_toplevel (resolution_entry),
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_DIALOG_DESTROY_WITH_PARENT,
NULL, NULL, NULL, NULL,
...@@ -112,6 +112,7 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry, ...@@ -112,6 +112,7 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry,
if (pixbuf) if (pixbuf)
{ {
GtkWidget *image = gtk_image_new_from_pixbuf (pixbuf); GtkWidget *image = gtk_image_new_from_pixbuf (pixbuf);
gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 1, gtk_table_attach (GTK_TABLE (table), image, 0, 1, 0, 1,
GTK_SHRINK, GTK_SHRINK, 4, 4); GTK_SHRINK, GTK_SHRINK, 4, 4);
gtk_widget_show (image); gtk_widget_show (image);
...@@ -261,8 +262,9 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry, ...@@ -261,8 +262,9 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry,
chain_button = GIMP_COORDINATES_CHAINBUTTON (resolution_entry); chain_button = GIMP_COORDINATES_CHAINBUTTON (resolution_entry);
if (ABS (x -y) > GIMP_MIN_RESOLUTION) if (ABS (x - y) > GIMP_MIN_RESOLUTION)
gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chain_button), FALSE); gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chain_button),
FALSE);
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (resolution_entry), gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (resolution_entry),
0, calibrate_xres); 0, calibrate_xres);
......
...@@ -179,6 +179,7 @@ gimp_dialog_close (GtkDialog *dialog) ...@@ -179,6 +179,7 @@ gimp_dialog_close (GtkDialog *dialog)
} }
} }
/** /**
* gimp_dialog_new: * gimp_dialog_new:
* @title: The dialog's title which will be set with * @title: The dialog's title which will be set with
...@@ -242,9 +243,8 @@ gimp_dialog_new (const gchar *title, ...@@ -242,9 +243,8 @@ gimp_dialog_new (const gchar *title,
* @help_id: The help_id which will be passed to @help_func. * @help_id: The help_id which will be passed to @help_func.
* @args: A @va_list destribing the action_area buttons. * @args: A @va_list destribing the action_area buttons.
* *
* Creates a new @GimpDialog widget. If a @parent widget is specified, * Creates a new @GimpDialog widget. If a GtkWindow is specified as
* the dialog will be made transient for the window this widget lives in * @parent then the dialog will be made transient for this window.
* (or or to the @parent widget itself if it is already a #GtkWindow).
* *
* For a description of the format of the @va_list describing the * For a description of the format of the @va_list describing the
* action_area buttons see gtk_dialog_new_with_buttons(). * action_area buttons see gtk_dialog_new_with_buttons().
...@@ -269,13 +269,11 @@ gimp_dialog_new_valist (const gchar *title, ...@@ -269,13 +269,11 @@ gimp_dialog_new_valist (const gchar *title,
dialog = g_object_new (GIMP_TYPE_DIALOG, dialog = g_object_new (GIMP_TYPE_DIALOG,
"title", title, "title", title,
"role", role, "role", role,
"modal", (flags & GTK_DIALOG_MODAL),
NULL); NULL);
if (parent) if (parent)
{ {
if (! GTK_IS_WINDOW (parent))
parent = gtk_widget_get_toplevel (parent);
if (GTK_IS_WINDOW (parent)) if (GTK_IS_WINDOW (parent))
{ {
gtk_window_set_transient_for (GTK_WINDOW (dialog), gtk_window_set_transient_for (GTK_WINDOW (dialog),
...@@ -286,13 +284,12 @@ gimp_dialog_new_valist (const gchar *title, ...@@ -286,13 +284,12 @@ gimp_dialog_new_valist (const gchar *title,
gtk_window_set_screen (GTK_WINDOW (dialog), gtk_window_set_screen (GTK_WINDOW (dialog),
gtk_widget_get_screen (parent)); gtk_widget_get_screen (parent));
} }
}
if (flags & GTK_DIALOG_MODAL) if (flags & GTK_DIALOG_DESTROY_WITH_PARENT)
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); g_signal_connect_object (parent, "destroy",
G_CALLBACK (gimp_dialog_close),
if (flags & GTK_DIALOG_DESTROY_WITH_PARENT) dialog, G_CONNECT_SWAPPED);
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE); }
if (help_func) if (help_func)
gimp_help_connect (dialog, help_func, help_id, dialog); gimp_help_connect (dialog, help_func, help_id, dialog);
......
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