From 9f92453c56755b4d02fbf7d8bda5c7d939bd6531 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sat, 12 Feb 2000 13:07:59 +0000 Subject: [PATCH] app/gdisplay_ops.c app/gradient.c app/palette.c removed the "eek" wilber 2000-02-12 Michael Natterer * app/gdisplay_ops.c * app/gradient.c * app/palette.c * plug-ins/gflare/gflare.c: removed the "eek" wilber from all query boxes except the "Quit the GIMP?" warning. * libgimp/gimpfileselection.c * libgimp/gimpunitmenu.c: be a bit more clever with widget signals (destroy, unmap) which affect the widget's sub-dialogs. * libgimp/gimphelpui.c: pass a GtkWindow, not a GtkWidget to gimp_dialog_set_icon(). * libgimp/gimpquerybox.[ch]: added documentation. --- ChangeLog | 17 ++ app/display/gimpdisplay-ops.c | 2 +- app/gdisplay_ops.c | 2 +- app/gradient.c | 2 +- app/gradient_editor.c | 2 +- app/gui/gradient-editor.c | 2 +- app/gui/palette-editor.c | 2 +- app/palette.c | 2 +- app/widgets/gimpgradienteditor.c | 2 +- app/widgets/gimppaletteeditor.c | 2 +- devel-docs/ChangeLog | 9 ++ devel-docs/libgimp/Makefile.am | 1 + devel-docs/libgimp/libgimp-decl.txt | 99 +++++++++--- devel-docs/libgimp/libgimp-docs.sgml | 2 + devel-docs/libgimp/libgimp-sections.txt | 14 ++ devel-docs/libgimp/tmpl/gimpquerybox.sgml | 179 ++++++++++++++++++++++ libgimp/gimpfileselection.c | 45 ++---- libgimp/gimphelpui.c | 2 +- libgimp/gimpquerybox.c | 91 +++++++++++ libgimp/gimpquerybox.h | 8 +- libgimp/gimpunitmenu.c | 14 +- libgimpwidgets/gimpfileentry.c | 45 ++---- libgimpwidgets/gimpfileselection.c | 45 ++---- libgimpwidgets/gimphelpui.c | 2 +- libgimpwidgets/gimpquerybox.c | 91 +++++++++++ libgimpwidgets/gimpquerybox.h | 8 +- libgimpwidgets/gimpunitmenu.c | 14 +- plug-ins/gflare/gflare.c | 2 +- 28 files changed, 554 insertions(+), 152 deletions(-) create mode 100644 devel-docs/libgimp/tmpl/gimpquerybox.sgml diff --git a/ChangeLog b/ChangeLog index d2a6672851..96733ff815 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2000-02-12 Michael Natterer + + * app/gdisplay_ops.c + * app/gradient.c + * app/palette.c + * plug-ins/gflare/gflare.c: removed the "eek" wilber from all + query boxes except the "Quit the GIMP?" warning. + + * libgimp/gimpfileselection.c + * libgimp/gimpunitmenu.c: be a bit more clever with widget signals + (destroy, unmap) which affect the widget's sub-dialogs. + + * libgimp/gimphelpui.c: pass a GtkWindow, not a GtkWidget to + gimp_dialog_set_icon(). + + * libgimp/gimpquerybox.[ch]: added documentation. + 2000-02-12 Shirasaki Yasuhiro * plug-ins/maze/maze.c diff --git a/app/display/gimpdisplay-ops.c b/app/display/gimpdisplay-ops.c index c95e0f7427..7a0f539e5b 100644 --- a/app/display/gimpdisplay-ops.c +++ b/app/display/gimpdisplay-ops.c @@ -349,7 +349,7 @@ gdisplay_close_warning_dialog (gchar *image_name, gimp_query_boolean_box (image_name, gimp_standard_help_func, "dialogs/really_close.html", - TRUE, + FALSE, warning_buf, _("Close"), _("Cancel"), NULL, NULL, diff --git a/app/gdisplay_ops.c b/app/gdisplay_ops.c index c95e0f7427..7a0f539e5b 100644 --- a/app/gdisplay_ops.c +++ b/app/gdisplay_ops.c @@ -349,7 +349,7 @@ gdisplay_close_warning_dialog (gchar *image_name, gimp_query_boolean_box (image_name, gimp_standard_help_func, "dialogs/really_close.html", - TRUE, + FALSE, warning_buf, _("Close"), _("Cancel"), NULL, NULL, diff --git a/app/gradient.c b/app/gradient.c index 0bf9799e08..bb6e819288 100644 --- a/app/gradient.c +++ b/app/gradient.c @@ -1784,7 +1784,7 @@ ed_delete_gradient_callback (GtkWidget *widget, gimp_query_boolean_box (_("Delete Gradient"), gimp_standard_help_func, "dialogs/gradient_editor/delete_gradient.html", - TRUE, + FALSE, str, _("Delete"), _("Cancel"), NULL, NULL, diff --git a/app/gradient_editor.c b/app/gradient_editor.c index 0bf9799e08..bb6e819288 100644 --- a/app/gradient_editor.c +++ b/app/gradient_editor.c @@ -1784,7 +1784,7 @@ ed_delete_gradient_callback (GtkWidget *widget, gimp_query_boolean_box (_("Delete Gradient"), gimp_standard_help_func, "dialogs/gradient_editor/delete_gradient.html", - TRUE, + FALSE, str, _("Delete"), _("Cancel"), NULL, NULL, diff --git a/app/gui/gradient-editor.c b/app/gui/gradient-editor.c index 0bf9799e08..bb6e819288 100644 --- a/app/gui/gradient-editor.c +++ b/app/gui/gradient-editor.c @@ -1784,7 +1784,7 @@ ed_delete_gradient_callback (GtkWidget *widget, gimp_query_boolean_box (_("Delete Gradient"), gimp_standard_help_func, "dialogs/gradient_editor/delete_gradient.html", - TRUE, + FALSE, str, _("Delete"), _("Cancel"), NULL, NULL, diff --git a/app/gui/palette-editor.c b/app/gui/palette-editor.c index a6b095a03a..fafc3322bf 100644 --- a/app/gui/palette-editor.c +++ b/app/gui/palette-editor.c @@ -1839,7 +1839,7 @@ palette_dialog_delete_callback (GtkWidget *widget, dialog = gimp_query_boolean_box (_("Delete Palette"), gimp_standard_help_func, "dialogs/palette_editor/delete_palette.html", - TRUE, + FALSE, str, _("Delete"), _("Cancel"), NULL, NULL, diff --git a/app/palette.c b/app/palette.c index a6b095a03a..fafc3322bf 100644 --- a/app/palette.c +++ b/app/palette.c @@ -1839,7 +1839,7 @@ palette_dialog_delete_callback (GtkWidget *widget, dialog = gimp_query_boolean_box (_("Delete Palette"), gimp_standard_help_func, "dialogs/palette_editor/delete_palette.html", - TRUE, + FALSE, str, _("Delete"), _("Cancel"), NULL, NULL, diff --git a/app/widgets/gimpgradienteditor.c b/app/widgets/gimpgradienteditor.c index 0bf9799e08..bb6e819288 100644 --- a/app/widgets/gimpgradienteditor.c +++ b/app/widgets/gimpgradienteditor.c @@ -1784,7 +1784,7 @@ ed_delete_gradient_callback (GtkWidget *widget, gimp_query_boolean_box (_("Delete Gradient"), gimp_standard_help_func, "dialogs/gradient_editor/delete_gradient.html", - TRUE, + FALSE, str, _("Delete"), _("Cancel"), NULL, NULL, diff --git a/app/widgets/gimppaletteeditor.c b/app/widgets/gimppaletteeditor.c index a6b095a03a..fafc3322bf 100644 --- a/app/widgets/gimppaletteeditor.c +++ b/app/widgets/gimppaletteeditor.c @@ -1839,7 +1839,7 @@ palette_dialog_delete_callback (GtkWidget *widget, dialog = gimp_query_boolean_box (_("Delete Palette"), gimp_standard_help_func, "dialogs/palette_editor/delete_palette.html", - TRUE, + FALSE, str, _("Delete"), _("Cancel"), NULL, NULL, diff --git a/devel-docs/ChangeLog b/devel-docs/ChangeLog index b49c16f4ba..c3a358d9df 100644 --- a/devel-docs/ChangeLog +++ b/devel-docs/ChangeLog @@ -1,3 +1,12 @@ +2000-02-12 Michael Natterer + + * libgimp/Makefile.am + * libgimp/tmpl/gimpquerybox.sgml: new file. + + * libgimp/libgimp-decl.txt + * libgimp/libgimp-docs.sgml + * libgimp/libgimp-sections.txt: updated from the libgimp sources. + Sat Feb 12 03:14:38 CET 2000 Sven Neumann * devel-docs/libgimp/tmpl/gimpchainbutton.sgml: documented diff --git a/devel-docs/libgimp/Makefile.am b/devel-docs/libgimp/Makefile.am index c39c67e17f..4e50ce6475 100644 --- a/devel-docs/libgimp/Makefile.am +++ b/devel-docs/libgimp/Makefile.am @@ -36,6 +36,7 @@ tmpl_sources = \ tmpl/gimpmodule.sgml \ tmpl/gimppatheditor.sgml \ tmpl/gimpprotocol.sgml \ + tmpl/gimpquerybox.sgml \ tmpl/gimpsizeentry.sgml \ tmpl/gimpui.sgml \ tmpl/gimpunit.sgml \ diff --git a/devel-docs/libgimp/libgimp-decl.txt b/devel-docs/libgimp/libgimp-decl.txt index cbb4bac87f..0dad82e769 100644 --- a/devel-docs/libgimp/libgimp-decl.txt +++ b/devel-docs/libgimp/libgimp-decl.txt @@ -2272,7 +2272,7 @@ gint32 *image_ID,gint32 *drawable_ID,gchar GimpFileSelection struct GimpFileSelection { - GtkVBox hbox; + GtkHBox hbox; GtkWidget *file_exists; GtkWidget *entry; @@ -3478,43 +3478,43 @@ GSerialDescription *d, void *output, void *serial parasite_new -Parasite * -const char *name, guint32 flags,guint32 size, const void *data +Parasite * +const gchar *name,guint32 flags,guint32 size,const gpointer data parasite_free void -Parasite *parasite +Parasite *parasite parasite_copy -Parasite * +Parasite * const Parasite *parasite parasite_compare -int -const Parasite *a, const Parasite *b +gboolean +const Parasite *a,const Parasite *b parasite_is_type -int -const Parasite *parasite,const char *name +gboolean +const Parasite *parasite,const gchar *name parasite_is_persistent -int +gboolean const Parasite *p parasite_is_undoable -int +gboolean const Parasite *p parasite_has_flag -int -const Parasite *p, gulong flag +gboolean +const Parasite *p,gulong flag parasite_flags @@ -3523,17 +3523,17 @@ const Parasite *p parasite_name -const char * +const gchar * const Parasite *p parasite_data -void * +void * const Parasite *p parasite_data_size -long +glong const Parasite *p @@ -3596,11 +3596,11 @@ PixPipeParams *params GIMP_MICRO_VERSION -#define GIMP_MICRO_VERSION (16) +#define GIMP_MICRO_VERSION (17) GIMP_VERSION -#define GIMP_VERSION "1.1.16" +#define GIMP_VERSION "1.1.17" GIMP_CHECK_VERSION @@ -3884,7 +3884,7 @@ const gchar *title,const gchar *wmclass_name,GimpHelpFunc h gimp_dialog_set_icon void -GtkWidget *dialog +GtkWindow *dialog gimp_dialog_create_action_area @@ -3976,3 +3976,64 @@ GtkWidget *widget,gpointer data void GtkTable *table,gint column,gint row,gchar *label_text,gfloat xalign,gfloat yalign,GtkWidget *widget,gint colspan,gboolean left_align + +GimpQueryStringCallback +void +GtkWidget *query_box, + gchar *string, + gpointer data + + +GimpQueryIntCallback +void +GtkWidget *query_box, + gint value, + gpointer data + + +GimpQueryDoubleCallback +void +GtkWidget *query_box, + gdouble value, + gpointer data + + +GimpQuerySizeCallback +void +GtkWidget *query_box, + gdouble size, + GimpUnit unit, + gpointer data + + +GimpQueryBooleanCallback +void +GtkWidget *query_box, + gboolean value, + gpointer data + + +gimp_query_string_box +GtkWidget * +gchar *title,GimpHelpFunc help_func,gchar *help_data,gchar *message,gchar *initial,GtkObject *object,gchar *signal,GimpQueryStringCallback callback,gpointer data + + +gimp_query_int_box +GtkWidget * +gchar *title,GimpHelpFunc help_func,gchar *help_data,char *message,gint initial,gint lower,gint upper,GtkObject *object,gchar *signal,GimpQueryIntCallback callback,gpointer data + + +gimp_query_double_box +GtkWidget * +gchar *title,GimpHelpFunc help_func,gchar *help_data,gchar *message,gdouble initial,gdouble lower,gdouble upper,gint digits,GtkObject *object,gchar *signal,GimpQueryDoubleCallback callback,gpointer data + + +gimp_query_size_box +GtkWidget * +gchar *title,GimpHelpFunc help_func,gchar *help_data,gchar *message,gdouble initial,gdouble lower,gdouble upper,gint digits,GimpUnit unit,gdouble resolution,gboolean dot_for_dot,GtkObject *object,gchar *signal,GimpQuerySizeCallback callback,gpointer data + + +gimp_query_boolean_box +GtkWidget * +gchar *title,GimpHelpFunc help_func,gchar *help_data,gboolean eek,gchar *message,gchar *true_button,gchar *false_button,GtkObject *object,gchar *signal,GimpQueryBooleanCallback callback,gpointer data + diff --git a/devel-docs/libgimp/libgimp-docs.sgml b/devel-docs/libgimp/libgimp-docs.sgml index bd7f52bd5f..3f838578cb 100644 --- a/devel-docs/libgimp/libgimp-docs.sgml +++ b/devel-docs/libgimp/libgimp-docs.sgml @@ -28,6 +28,7 @@ + ]> @@ -72,6 +73,7 @@ &libgimp-gimpexport; &libgimp-gimphelpui; &libgimp-gimpmenu; + &libgimp-gimpquerybox; &libgimp-gimpunit; &libgimp-gimpwidgets; diff --git a/devel-docs/libgimp/libgimp-sections.txt b/devel-docs/libgimp/libgimp-sections.txt index 3cfc58f83e..52af105ecd 100644 --- a/devel-docs/libgimp/libgimp-sections.txt +++ b/devel-docs/libgimp/libgimp-sections.txt @@ -690,6 +690,20 @@ GIMP_PATH_EDITOR_CLASS GIMP_IS_PATH_EDITOR_CLASS +
+gimpquerybox +GimpQueryStringCallback +GimpQueryIntCallback +GimpQueryDoubleCallback +GimpQuerySizeCallback +GimpQueryBooleanCallback +gimp_query_string_box +gimp_query_int_box +gimp_query_double_box +gimp_query_size_box +gimp_query_boolean_box +
+
gimpsizeentry GimpSizeEntry diff --git a/devel-docs/libgimp/tmpl/gimpquerybox.sgml b/devel-docs/libgimp/tmpl/gimpquerybox.sgml new file mode 100644 index 0000000000..ceb0f4a2e2 --- /dev/null +++ b/devel-docs/libgimp/tmpl/gimpquerybox.sgml @@ -0,0 +1,179 @@ + +gimpquerybox + + +Some simple dialogs to enter a single int, double, string or boolean value. + + + +These functions provide simple dialogs for entering a single string, +integer, double, boolean or pixel size value. + + +They return a pointer to a #GtkDialog which has to be shown with +gtk_widget_show() by the caller. + + +The dialogs contain an entry widget for the kind of value they ask for +and "OK" and "Cancel" buttons. On "Cancel", all query boxes except the +boolean one silently destroy themselves. On "OK" the user defined +callback function is called and returns the entered value. + + + + +GimpSizeEntry + + +GimpUnitMenu + + + + +Note that you have to g_free() the returned string. + + +@query_box: The query box. +@string: The entered string. +@data: The user data. + + + + + + + +@query_box: The query box. +@value: The entered integer value. +@data: The user data. + + + + + + + +@query_box: The query box. +@value: The entered double value. +@data: The user data. + + + + + + + +@query_box: The query box. +@size: The entered size in pixels. +@unit: The selected unit from the #GimpUnitMenu. +@data: The user data. + + + + + + + +@query_box: The query box. +@value: The entered boolean value. +@data: The user data. + + + + + + + +@title: +@help_func: +@help_data: +@message: +@initial: +@object: +@signal: +@callback: +@data: +@Returns: + + + + + + + +@title: +@help_func: +@help_data: +@message: +@initial: +@lower: +@upper: +@object: +@signal: +@callback: +@data: +@Returns: + + + + + + + +@title: +@help_func: +@help_data: +@message: +@initial: +@lower: +@upper: +@digits: +@object: +@signal: +@callback: +@data: +@Returns: + + + + + + + +@title: +@help_func: +@help_data: +@message: +@initial: +@lower: +@upper: +@digits: +@unit: +@resolution: +@dot_for_dot: +@object: +@signal: +@callback: +@data: +@Returns: + + + + + + + +@title: +@help_func: +@help_data: +@eek: +@message: +@true_button: +@false_button: +@object: +@signal: +@callback: +@data: +@Returns: + + diff --git a/libgimp/gimpfileselection.c b/libgimp/gimpfileselection.c index 3649c0529c..53f0ad3a89 100644 --- a/libgimp/gimpfileselection.c +++ b/libgimp/gimpfileselection.c @@ -348,23 +348,6 @@ gimp_file_selection_filesel_ok_callback (GtkWidget *widget, gimp_file_selection_entry_callback (gfs->entry, data); } -static void -gimp_file_selection_filesel_cancel_callback (GtkWidget *widget, - gpointer data) -{ - gtk_widget_hide (GIMP_FILE_SELECTION (data)->file_selection); -} - -static int -gimp_file_selection_filesel_delete_callback (GtkWidget *widget, - GdkEvent *event, - gpointer data) -{ - gimp_file_selection_filesel_cancel_callback (NULL, data); - - return TRUE; -} - static void gimp_file_selection_browse_callback (GtkWidget *widget, gpointer data) @@ -404,7 +387,7 @@ gimp_file_selection_browse_callback (GtkWidget *widget, gtk_label_set_text (GTK_LABEL (GTK_BIN (GTK_FILE_SELECTION (gfs->file_selection)->ok_button)->child), _("Select")); gtk_label_set_text (GTK_LABEL (GTK_BIN (GTK_FILE_SELECTION (gfs->file_selection)->cancel_button)->child), _("Close")); - gtk_signal_connect + gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (gfs->file_selection)->ok_button), "clicked", GTK_SIGNAL_FUNC (gimp_file_selection_filesel_ok_callback), @@ -414,23 +397,23 @@ gimp_file_selection_browse_callback (GtkWidget *widget, "activate", GTK_SIGNAL_FUNC (gimp_file_selection_filesel_ok_callback), gfs); - gtk_signal_connect - (GTK_OBJECT (GTK_FILE_SELECTION (gfs->file_selection)->cancel_button), - "clicked", - GTK_SIGNAL_FUNC (gimp_file_selection_filesel_cancel_callback), - gfs); - gtk_signal_connect - (GTK_OBJECT (gfs), "unmap", - GTK_SIGNAL_FUNC (gimp_file_selection_filesel_cancel_callback), - gfs); - gtk_signal_connect - (GTK_OBJECT (gfs->file_selection), "delete_event", - GTK_SIGNAL_FUNC (gimp_file_selection_filesel_delete_callback), - gfs); + + gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (gfs->file_selection)->cancel_button), + "clicked", + GTK_SIGNAL_FUNC (gtk_widget_hide), + GTK_OBJECT (gfs->file_selection)); + gtk_signal_connect_object (GTK_OBJECT (gfs), "unmap", + GTK_SIGNAL_FUNC (gtk_widget_hide), + GTK_OBJECT (gfs->file_selection)); + gtk_signal_connect_object (GTK_OBJECT (gfs->file_selection), + "delete_event", + GTK_SIGNAL_FUNC (gtk_widget_hide), + GTK_OBJECT (gfs->file_selection)); } gtk_file_selection_set_filename (GTK_FILE_SELECTION (gfs->file_selection), filename); + if (! GTK_WIDGET_VISIBLE (gfs->file_selection)) gtk_widget_show (gfs->file_selection); else diff --git a/libgimp/gimphelpui.c b/libgimp/gimphelpui.c index 62511b5f81..485088d5dc 100644 --- a/libgimp/gimphelpui.c +++ b/libgimp/gimphelpui.c @@ -89,7 +89,7 @@ gimp_help_connect_help_accel (GtkWidget *widget, * this function is called for almost all gimp windows */ if (GTK_IS_WINDOW (widget)) - gimp_dialog_set_icon (widget); + gimp_dialog_set_icon (GTK_WINDOW (widget)); /* set up the help signals and tips query widget */ if (!tips_query) diff --git a/libgimp/gimpquerybox.c b/libgimp/gimpquerybox.c index 8cfb1a801a..55dbd60c32 100644 --- a/libgimp/gimpquerybox.c +++ b/libgimp/gimpquerybox.c @@ -139,6 +139,21 @@ create_query_box (gchar *title, return query_box; } +/** + * gimp_query_string_box: + * @title: The query box dialog's title. + * @help_func: The help function to show this dialog's help page. + * @help_data: A string pointing to this dialog's html help page. + * @message: A string which will be shown above the dialog's entry widget. + * @initial: The initial value. + * @object: The object this query box is associated with. + * @signal: The object's signal which will cause the query box to be closed. + * @callback: The function which will be called when the user selects "OK". + * @data: The callback's user data. + * + * Returns: A pointer to the new #GtkDialog. + * + */ GtkWidget * gimp_query_string_box (gchar *title, GimpHelpFunc help_func, @@ -173,6 +188,23 @@ gimp_query_string_box (gchar *title, return query_box->qbox; } +/** + * gimp_query_int_box: + * @title: The query box dialog's title. + * @help_func: The help function to show this dialog's help page. + * @help_data: A string pointing to this dialog's html help page. + * @message: A string which will be shown above the dialog's entry widget. + * @initial: The initial value. + * @lower: The lower boundary of the range of possible values. + * @upper: The upper boundray of the range of possible values. + * @object: The object this query box is associated with. + * @signal: The object's signal which will cause the query box to be closed. + * @callback: The function which will be called when the user selects "OK". + * @data: The callback's user data. + * + * Returns: A pointer to the new #GtkDialog. + * + */ GtkWidget * gimp_query_int_box (gchar *title, GimpHelpFunc help_func, @@ -210,6 +242,24 @@ gimp_query_int_box (gchar *title, return query_box->qbox; } +/** + * gimp_query_double_box: + * @title: The query box dialog's title. + * @help_func: The help function to show this dialog's help page. + * @help_data: A string pointing to this dialog's html help page. + * @message: A string which will be shown above the dialog's entry widget. + * @initial: The initial value. + * @lower: The lower boundary of the range of possible values. + * @upper: The upper boundray of the range of possible values. + * @digits: The number of decimal digits the #GtkSpinButton will provide. + * @object: The object this query box is associated with. + * @signal: The object's signal which will cause the query box to be closed. + * @callback: The function which will be called when the user selects "OK". + * @data: The callback's user data. + * + * Returns: A pointer to the new #GtkDialog. + * + */ GtkWidget * gimp_query_double_box (gchar *title, GimpHelpFunc help_func, @@ -248,6 +298,29 @@ gimp_query_double_box (gchar *title, return query_box->qbox; } +/** + * gimp_query_size_box: + * @title: The query box dialog's title. + * @help_func: The help function to show this dialog's help page. + * @help_data: A string pointing to this dialog's html help page. + * @message: A string which will be shown above the dialog's entry widget. + * @initial: The initial value. + * @lower: The lower boundary of the range of possible values. + * @upper: The upper boundray of the range of possible values. + * @digits: The number of decimal digits the #GimpSizeEntry provide in + * "pixel" mode. + * @unit: The unit initially shown by the #GimpUnitMenu. + * @resolution: The resolution (in dpi) which will be used for pixel/unit + * calculations. + * @dot_for_dot: #TRUE if the #GimpUnitMenu's initial unit should be "pixels". + * @object: The object this query box is associated with. + * @signal: The object's signal which will cause the query box to be closed. + * @callback: The function which will be called when the user selects "OK". + * @data: The callback's user data. + * + * Returns: A pointer to the new #GtkDialog. + * + */ GtkWidget * gimp_query_size_box (gchar *title, GimpHelpFunc help_func, @@ -296,6 +369,24 @@ gimp_query_size_box (gchar *title, return query_box->qbox; } +/** + * gimp_query_boolean_box: + * @title: The query box dialog's title. + * @help_func: The help function to show this dialog's help page. + * @help_data: A string pointing to this dialog's html help page. + * @eek: #TRUE if you want the "Eek" wilber to appear left of the dialog's + * message. + * @message: A string which will be shown in the query box. + * @true_button: The string to be shown in the dialog's left button. + * @false_button: The string to be shown in the dialog's right button. + * @object: The object this query box is associated with. + * @signal: The object's signal which will cause the query box to be closed. + * @callback: The function which will be called when the user selects "OK". + * @data: The callback's user data. + * + * Returns: A pointer to the new #GtkDialog. + * + */ GtkWidget * gimp_query_boolean_box (gchar *title, GimpHelpFunc help_func, diff --git a/libgimp/gimpquerybox.h b/libgimp/gimpquerybox.h index 64442f081c..0f80b3d664 100644 --- a/libgimp/gimpquerybox.h +++ b/libgimp/gimpquerybox.h @@ -47,13 +47,7 @@ typedef void (* GimpQueryBooleanCallback) (GtkWidget *query_box, gboolean value, gpointer data); -/* some simple query dialogs - * if object != NULL then the query boxes will connect their cancel callback - * to the provided signal of this object - * - * it's the caller's job to show the returned widgets - */ - +/* some simple query dialogs */ GtkWidget * gimp_query_string_box (gchar *title, GimpHelpFunc help_func, gchar *help_data, diff --git a/libgimp/gimpunitmenu.c b/libgimp/gimpunitmenu.c index 4e24c05de6..d18ca32af6 100644 --- a/libgimp/gimpunitmenu.c +++ b/libgimp/gimpunitmenu.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-1999 Peter Mattis and Spencer Kimball * * gimpunitmenu.c - * Copyright (C) 1999 Michael Natterer + * Copyright (C) 1999 Michael Natterer * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -492,12 +492,12 @@ gimp_unit_menu_create_selection (GimpUnitMenu *gum) GTK_SIGNAL_FUNC (gtk_widget_destroyed), &gum->selection); - gtk_signal_connect_object (GTK_OBJECT (gum), "destroy", - GTK_SIGNAL_FUNC (gtk_widget_destroy), - GTK_OBJECT (gum->selection)); - gtk_signal_connect_object (GTK_OBJECT (gum), "unmap", - GTK_SIGNAL_FUNC (gtk_widget_destroy), - GTK_OBJECT (gum->selection)); + gtk_signal_connect_object_while_alive (GTK_OBJECT (gum), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), + GTK_OBJECT (gum->selection)); + gtk_signal_connect_object_while_alive (GTK_OBJECT (gum), "unmap", + GTK_SIGNAL_FUNC (gtk_widget_destroy), + GTK_OBJECT (gum->selection)); /* the main vbox */ vbox = gtk_vbox_new (FALSE, 0); diff --git a/libgimpwidgets/gimpfileentry.c b/libgimpwidgets/gimpfileentry.c index 3649c0529c..53f0ad3a89 100644 --- a/libgimpwidgets/gimpfileentry.c +++ b/libgimpwidgets/gimpfileentry.c @@ -348,23 +348,6 @@ gimp_file_selection_filesel_ok_callback (GtkWidget *widget, gimp_file_selection_entry_callback (gfs->entry, data); } -static void -gimp_file_selection_filesel_cancel_callback (GtkWidget *widget, - gpointer data) -{ - gtk_widget_hide (GIMP_FILE_SELECTION (data)->file_selection); -} - -static int -gimp_file_selection_filesel_delete_callback (GtkWidget *widget, - GdkEvent *event, - gpointer data) -{ - gimp_file_selection_filesel_cancel_callback (NULL, data); - - return TRUE; -} - static void gimp_file_selection_browse_callback (GtkWidget *widget, gpointer data) @@ -404,7 +387,7 @@ gimp_file_selection_browse_callback (GtkWidget *widget, gtk_label_set_text (GTK_LABEL (GTK_BIN (GTK_FILE_SELECTION (gfs->file_selection)->ok_button)->child), _("Select")); gtk_label_set_text (GTK_LABEL (GTK_BIN (GTK_FILE_SELECTION (gfs->file_selection)->cancel_button)->child), _("Close")); - gtk_signal_connect + gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (gfs->file_selection)->ok_button), "clicked", GTK_SIGNAL_FUNC (gimp_file_selection_filesel_ok_callback), @@ -414,23 +397,23 @@ gimp_file_selection_browse_callback (GtkWidget *widget, "activate", GTK_SIGNAL_FUNC (gimp_file_selection_filesel_ok_callback), gfs); - gtk_signal_connect - (GTK_OBJECT (GTK_FILE_SELECTION (gfs->file_selection)->cancel_button), - "clicked", - GTK_SIGNAL_FUNC (gimp_file_selection_filesel_cancel_callback), - gfs); - gtk_signal_connect - (GTK_OBJECT (gfs), "unmap", - GTK_SIGNAL_FUNC (gimp_file_selection_filesel_cancel_callback), - gfs); - gtk_signal_connect - (GTK_OBJECT (gfs->file_selection), "delete_event", - GTK_SIGNAL_FUNC (gimp_file_selection_filesel_delete_callback), - gfs); + + gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (gfs->file_selection)->cancel_button), + "clicked", + GTK_SIGNAL_FUNC (gtk_widget_hide), + GTK_OBJECT (gfs->file_selection)); + gtk_signal_connect_object (GTK_OBJECT (gfs), "unmap", + GTK_SIGNAL_FUNC (gtk_widget_hide), + GTK_OBJECT (gfs->file_selection)); + gtk_signal_connect_object (GTK_OBJECT (gfs->file_selection), + "delete_event", + GTK_SIGNAL_FUNC (gtk_widget_hide), + GTK_OBJECT (gfs->file_selection)); } gtk_file_selection_set_filename (GTK_FILE_SELECTION (gfs->file_selection), filename); + if (! GTK_WIDGET_VISIBLE (gfs->file_selection)) gtk_widget_show (gfs->file_selection); else diff --git a/libgimpwidgets/gimpfileselection.c b/libgimpwidgets/gimpfileselection.c index 3649c0529c..53f0ad3a89 100644 --- a/libgimpwidgets/gimpfileselection.c +++ b/libgimpwidgets/gimpfileselection.c @@ -348,23 +348,6 @@ gimp_file_selection_filesel_ok_callback (GtkWidget *widget, gimp_file_selection_entry_callback (gfs->entry, data); } -static void -gimp_file_selection_filesel_cancel_callback (GtkWidget *widget, - gpointer data) -{ - gtk_widget_hide (GIMP_FILE_SELECTION (data)->file_selection); -} - -static int -gimp_file_selection_filesel_delete_callback (GtkWidget *widget, - GdkEvent *event, - gpointer data) -{ - gimp_file_selection_filesel_cancel_callback (NULL, data); - - return TRUE; -} - static void gimp_file_selection_browse_callback (GtkWidget *widget, gpointer data) @@ -404,7 +387,7 @@ gimp_file_selection_browse_callback (GtkWidget *widget, gtk_label_set_text (GTK_LABEL (GTK_BIN (GTK_FILE_SELECTION (gfs->file_selection)->ok_button)->child), _("Select")); gtk_label_set_text (GTK_LABEL (GTK_BIN (GTK_FILE_SELECTION (gfs->file_selection)->cancel_button)->child), _("Close")); - gtk_signal_connect + gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (gfs->file_selection)->ok_button), "clicked", GTK_SIGNAL_FUNC (gimp_file_selection_filesel_ok_callback), @@ -414,23 +397,23 @@ gimp_file_selection_browse_callback (GtkWidget *widget, "activate", GTK_SIGNAL_FUNC (gimp_file_selection_filesel_ok_callback), gfs); - gtk_signal_connect - (GTK_OBJECT (GTK_FILE_SELECTION (gfs->file_selection)->cancel_button), - "clicked", - GTK_SIGNAL_FUNC (gimp_file_selection_filesel_cancel_callback), - gfs); - gtk_signal_connect - (GTK_OBJECT (gfs), "unmap", - GTK_SIGNAL_FUNC (gimp_file_selection_filesel_cancel_callback), - gfs); - gtk_signal_connect - (GTK_OBJECT (gfs->file_selection), "delete_event", - GTK_SIGNAL_FUNC (gimp_file_selection_filesel_delete_callback), - gfs); + + gtk_signal_connect_object (GTK_OBJECT (GTK_FILE_SELECTION (gfs->file_selection)->cancel_button), + "clicked", + GTK_SIGNAL_FUNC (gtk_widget_hide), + GTK_OBJECT (gfs->file_selection)); + gtk_signal_connect_object (GTK_OBJECT (gfs), "unmap", + GTK_SIGNAL_FUNC (gtk_widget_hide), + GTK_OBJECT (gfs->file_selection)); + gtk_signal_connect_object (GTK_OBJECT (gfs->file_selection), + "delete_event", + GTK_SIGNAL_FUNC (gtk_widget_hide), + GTK_OBJECT (gfs->file_selection)); } gtk_file_selection_set_filename (GTK_FILE_SELECTION (gfs->file_selection), filename); + if (! GTK_WIDGET_VISIBLE (gfs->file_selection)) gtk_widget_show (gfs->file_selection); else diff --git a/libgimpwidgets/gimphelpui.c b/libgimpwidgets/gimphelpui.c index 62511b5f81..485088d5dc 100644 --- a/libgimpwidgets/gimphelpui.c +++ b/libgimpwidgets/gimphelpui.c @@ -89,7 +89,7 @@ gimp_help_connect_help_accel (GtkWidget *widget, * this function is called for almost all gimp windows */ if (GTK_IS_WINDOW (widget)) - gimp_dialog_set_icon (widget); + gimp_dialog_set_icon (GTK_WINDOW (widget)); /* set up the help signals and tips query widget */ if (!tips_query) diff --git a/libgimpwidgets/gimpquerybox.c b/libgimpwidgets/gimpquerybox.c index 8cfb1a801a..55dbd60c32 100644 --- a/libgimpwidgets/gimpquerybox.c +++ b/libgimpwidgets/gimpquerybox.c @@ -139,6 +139,21 @@ create_query_box (gchar *title, return query_box; } +/** + * gimp_query_string_box: + * @title: The query box dialog's title. + * @help_func: The help function to show this dialog's help page. + * @help_data: A string pointing to this dialog's html help page. + * @message: A string which will be shown above the dialog's entry widget. + * @initial: The initial value. + * @object: The object this query box is associated with. + * @signal: The object's signal which will cause the query box to be closed. + * @callback: The function which will be called when the user selects "OK". + * @data: The callback's user data. + * + * Returns: A pointer to the new #GtkDialog. + * + */ GtkWidget * gimp_query_string_box (gchar *title, GimpHelpFunc help_func, @@ -173,6 +188,23 @@ gimp_query_string_box (gchar *title, return query_box->qbox; } +/** + * gimp_query_int_box: + * @title: The query box dialog's title. + * @help_func: The help function to show this dialog's help page. + * @help_data: A string pointing to this dialog's html help page. + * @message: A string which will be shown above the dialog's entry widget. + * @initial: The initial value. + * @lower: The lower boundary of the range of possible values. + * @upper: The upper boundray of the range of possible values. + * @object: The object this query box is associated with. + * @signal: The object's signal which will cause the query box to be closed. + * @callback: The function which will be called when the user selects "OK". + * @data: The callback's user data. + * + * Returns: A pointer to the new #GtkDialog. + * + */ GtkWidget * gimp_query_int_box (gchar *title, GimpHelpFunc help_func, @@ -210,6 +242,24 @@ gimp_query_int_box (gchar *title, return query_box->qbox; } +/** + * gimp_query_double_box: + * @title: The query box dialog's title. + * @help_func: The help function to show this dialog's help page. + * @help_data: A string pointing to this dialog's html help page. + * @message: A string which will be shown above the dialog's entry widget. + * @initial: The initial value. + * @lower: The lower boundary of the range of possible values. + * @upper: The upper boundray of the range of possible values. + * @digits: The number of decimal digits the #GtkSpinButton will provide. + * @object: The object this query box is associated with. + * @signal: The object's signal which will cause the query box to be closed. + * @callback: The function which will be called when the user selects "OK". + * @data: The callback's user data. + * + * Returns: A pointer to the new #GtkDialog. + * + */ GtkWidget * gimp_query_double_box (gchar *title, GimpHelpFunc help_func, @@ -248,6 +298,29 @@ gimp_query_double_box (gchar *title, return query_box->qbox; } +/** + * gimp_query_size_box: + * @title: The query box dialog's title. + * @help_func: The help function to show this dialog's help page. + * @help_data: A string pointing to this dialog's html help page. + * @message: A string which will be shown above the dialog's entry widget. + * @initial: The initial value. + * @lower: The lower boundary of the range of possible values. + * @upper: The upper boundray of the range of possible values. + * @digits: The number of decimal digits the #GimpSizeEntry provide in + * "pixel" mode. + * @unit: The unit initially shown by the #GimpUnitMenu. + * @resolution: The resolution (in dpi) which will be used for pixel/unit + * calculations. + * @dot_for_dot: #TRUE if the #GimpUnitMenu's initial unit should be "pixels". + * @object: The object this query box is associated with. + * @signal: The object's signal which will cause the query box to be closed. + * @callback: The function which will be called when the user selects "OK". + * @data: The callback's user data. + * + * Returns: A pointer to the new #GtkDialog. + * + */ GtkWidget * gimp_query_size_box (gchar *title, GimpHelpFunc help_func, @@ -296,6 +369,24 @@ gimp_query_size_box (gchar *title, return query_box->qbox; } +/** + * gimp_query_boolean_box: + * @title: The query box dialog's title. + * @help_func: The help function to show this dialog's help page. + * @help_data: A string pointing to this dialog's html help page. + * @eek: #TRUE if you want the "Eek" wilber to appear left of the dialog's + * message. + * @message: A string which will be shown in the query box. + * @true_button: The string to be shown in the dialog's left button. + * @false_button: The string to be shown in the dialog's right button. + * @object: The object this query box is associated with. + * @signal: The object's signal which will cause the query box to be closed. + * @callback: The function which will be called when the user selects "OK". + * @data: The callback's user data. + * + * Returns: A pointer to the new #GtkDialog. + * + */ GtkWidget * gimp_query_boolean_box (gchar *title, GimpHelpFunc help_func, diff --git a/libgimpwidgets/gimpquerybox.h b/libgimpwidgets/gimpquerybox.h index 64442f081c..0f80b3d664 100644 --- a/libgimpwidgets/gimpquerybox.h +++ b/libgimpwidgets/gimpquerybox.h @@ -47,13 +47,7 @@ typedef void (* GimpQueryBooleanCallback) (GtkWidget *query_box, gboolean value, gpointer data); -/* some simple query dialogs - * if object != NULL then the query boxes will connect their cancel callback - * to the provided signal of this object - * - * it's the caller's job to show the returned widgets - */ - +/* some simple query dialogs */ GtkWidget * gimp_query_string_box (gchar *title, GimpHelpFunc help_func, gchar *help_data, diff --git a/libgimpwidgets/gimpunitmenu.c b/libgimpwidgets/gimpunitmenu.c index 4e24c05de6..d18ca32af6 100644 --- a/libgimpwidgets/gimpunitmenu.c +++ b/libgimpwidgets/gimpunitmenu.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-1999 Peter Mattis and Spencer Kimball * * gimpunitmenu.c - * Copyright (C) 1999 Michael Natterer + * Copyright (C) 1999 Michael Natterer * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -492,12 +492,12 @@ gimp_unit_menu_create_selection (GimpUnitMenu *gum) GTK_SIGNAL_FUNC (gtk_widget_destroyed), &gum->selection); - gtk_signal_connect_object (GTK_OBJECT (gum), "destroy", - GTK_SIGNAL_FUNC (gtk_widget_destroy), - GTK_OBJECT (gum->selection)); - gtk_signal_connect_object (GTK_OBJECT (gum), "unmap", - GTK_SIGNAL_FUNC (gtk_widget_destroy), - GTK_OBJECT (gum->selection)); + gtk_signal_connect_object_while_alive (GTK_OBJECT (gum), "destroy", + GTK_SIGNAL_FUNC (gtk_widget_destroy), + GTK_OBJECT (gum->selection)); + gtk_signal_connect_object_while_alive (GTK_OBJECT (gum), "unmap", + GTK_SIGNAL_FUNC (gtk_widget_destroy), + GTK_OBJECT (gum->selection)); /* the main vbox */ vbox = gtk_vbox_new (FALSE, 0); diff --git a/plug-ins/gflare/gflare.c b/plug-ins/gflare/gflare.c index 918af97eb5..242d4c9eae 100644 --- a/plug-ins/gflare/gflare.c +++ b/plug-ins/gflare/gflare.c @@ -3390,7 +3390,7 @@ dlg_selector_delete_callback (GtkWidget *widget, dialog = gimp_query_boolean_box (_("Delete GFlare"), gimp_plugin_help_func, "filters/gflare.html", - TRUE, + FALSE, str, _("Delete"), _("Cancel"), NULL, NULL,