as all boolean query boxes are confirmations for deleting/closing

2000-02-10  Michael Natterer  <mitch@gimp.org>

	* libgimp/gimpquerybox.[ch]: as all boolean query boxes are
	confirmations for deleting/closing something, I added the "eek"
	wilber (you can still disable the pixmap by passing FALSE to the
	constructor's "eek" parameter).

	* app/app_procs.c
	* app/gdisplay_ops.c
	* app/gradient.c
	* app/palette.c
	* plug-ins/gflare/gflare.c: pass eek==TRUE to the boolean query
	box constructor.
This commit is contained in:
Michael Natterer 2000-02-10 23:47:56 +00:00 committed by Michael Natterer
parent e32c1533e2
commit a90cc52db3
16 changed files with 147 additions and 74 deletions

View File

@ -1,3 +1,17 @@
2000-02-10 Michael Natterer <mitch@gimp.org>
* libgimp/gimpquerybox.[ch]: as all boolean query boxes are
confirmations for deleting/closing something, I added the "eek"
wilber (you can still disable the pixmap by passing FALSE to the
constructor's "eek" parameter).
* app/app_procs.c
* app/gdisplay_ops.c
* app/gradient.c
* app/palette.c
* plug-ins/gflare/gflare.c: pass eek==TRUE to the boolean query
box constructor.
Thu Feb 10 19:00:24 CET 2000 Sven Neumann <sven@gimp.org>
* plug-ins/common/pnm.c: Removed pbm from the list of extensions

View File

@ -97,8 +97,6 @@
#include "libgimp/gimplimits.h"
#include "libgimp/gimpintl.h"
#include "pixmaps/eek.xpm"
#define LOGO_WIDTH_MIN 300
#define LOGO_HEIGHT_MIN 110
#define AUTHORS "Spencer Kimball & Peter Mattis"
@ -120,7 +118,7 @@ static void toast_old_temp_files (void);
static gint is_app_exit_finish_done = FALSE;
int we_are_exiting = FALSE;
gint we_are_exiting = FALSE;
static GtkWidget *logo_area = NULL;
static GdkPixmap *logo_pixmap = NULL;
@ -708,70 +706,37 @@ app_exit (gboolean kill_it)
static void
really_quit_callback (GtkButton *button,
GtkWidget *dialog)
gboolean quit,
gpointer data)
{
gtk_widget_destroy (dialog);
app_exit_finish ();
}
static void
really_quit_cancel_callback (GtkWidget *widget,
GtkWidget *dialog)
{
menus_set_sensitive ("<Toolbox>/File/Quit", TRUE);
menus_set_sensitive ("<Image>/File/Quit", TRUE);
gtk_widget_destroy (dialog);
if (quit)
{
app_exit_finish ();
}
else
{
menus_set_sensitive ("<Toolbox>/File/Quit", TRUE);
menus_set_sensitive ("<Image>/File/Quit", TRUE);
}
}
static void
really_quit_dialog (void)
{
GtkWidget *dialog;
GtkWidget *hbox;
GtkWidget *pixmap_widget;
GdkPixmap *pixmap;
GdkBitmap *mask;
GtkStyle *style;
GtkWidget *label;
menus_set_sensitive ("<Toolbox>/File/Quit", FALSE);
menus_set_sensitive ("<Image>/File/Quit", FALSE);
dialog = gimp_dialog_new (_("Really Quit?"), "really_quit",
gimp_standard_help_func,
"dialogs/really_quit.html",
GTK_WIN_POS_MOUSE,
FALSE, FALSE, FALSE,
_("Quit"), really_quit_callback,
NULL, NULL, NULL, FALSE, FALSE,
_("Cancel"), really_quit_cancel_callback,
NULL, NULL, NULL, TRUE, TRUE,
NULL);
hbox = gtk_hbox_new (FALSE, 0);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 4);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox);
gtk_widget_show (hbox);
gtk_widget_realize (dialog);
style = gtk_widget_get_style (dialog);
pixmap = gdk_pixmap_create_from_xpm_d (dialog->window,
&mask,
&style->bg[GTK_STATE_NORMAL],
eek_xpm);
pixmap_widget = gtk_pixmap_new (pixmap, mask);
gtk_box_pack_start (GTK_BOX (hbox), pixmap_widget, FALSE, FALSE, 10);
gtk_widget_show (pixmap_widget);
gdk_pixmap_unref (pixmap);
label = gtk_label_new (_("Some files unsaved.\n\nQuit the GIMP?"));
gtk_misc_set_padding (GTK_MISC (label), 10, 10);
gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
gtk_widget_show (label);
dialog = gimp_query_boolean_box (_("Really Quit?"),
gimp_standard_help_func,
"dialogs/really_quit.html",
TRUE,
_("Some files unsaved.\n\nQuit the GIMP?"),
_("Quit"), _("Cancel"),
NULL, NULL,
really_quit_callback,
NULL);
gtk_widget_show (dialog);
}

View File

@ -349,6 +349,7 @@ gdisplay_close_warning_dialog (gchar *image_name,
gimp_query_boolean_box (image_name,
gimp_standard_help_func,
"dialogs/really_close.html",
TRUE,
warning_buf,
_("Close"), _("Cancel"),
NULL, NULL,

View File

@ -349,6 +349,7 @@ gdisplay_close_warning_dialog (gchar *image_name,
gimp_query_boolean_box (image_name,
gimp_standard_help_func,
"dialogs/really_close.html",
TRUE,
warning_buf,
_("Close"), _("Cancel"),
NULL, NULL,

View File

@ -1784,6 +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,
str,
_("Delete"), _("Cancel"),
NULL, NULL,

View File

@ -1784,6 +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,
str,
_("Delete"), _("Cancel"),
NULL, NULL,

View File

@ -1784,6 +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,
str,
_("Delete"), _("Cancel"),
NULL, NULL,

View File

@ -1839,6 +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,
str,
_("Delete"), _("Cancel"),
NULL, NULL,

View File

@ -1839,6 +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,
str,
_("Delete"), _("Cancel"),
NULL, NULL,

View File

@ -1784,6 +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,
str,
_("Delete"), _("Cancel"),
NULL, NULL,

View File

@ -1839,6 +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,
str,
_("Delete"), _("Cancel"),
NULL, NULL,

View File

@ -25,6 +25,8 @@
#include "libgimp-intl.h"
#include "pixmaps/eek.xpm"
/*
* String, integer, double and size query boxes
*/
@ -90,7 +92,7 @@ create_query_box (gchar *title,
{
QueryBox *query_box;
GtkWidget *qbox;
GtkWidget *vbox;
GtkWidget *vbox = NULL;
GtkWidget *label;
query_box = g_new (QueryBox, 1);
@ -115,14 +117,17 @@ create_query_box (gchar *title,
else
object = NULL;
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (qbox)->vbox), vbox);
gtk_widget_show (vbox);
if (message)
{
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (qbox)->vbox), vbox);
gtk_widget_show (vbox);
label = gtk_label_new (message);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
label = gtk_label_new (message);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
}
query_box->qbox = qbox;
query_box->vbox = vbox;
@ -295,6 +300,7 @@ GtkWidget *
gimp_query_boolean_box (gchar *title,
GimpHelpFunc help_func,
gchar *help_data,
gboolean eek,
gchar *message,
gchar *true_button,
gchar *false_button,
@ -304,15 +310,50 @@ gimp_query_boolean_box (gchar *title,
gpointer data)
{
QueryBox *query_box;
GtkWidget *hbox;
GtkWidget *pixmap_widget;
GtkWidget *label;
static GdkPixmap *eek_pixmap = NULL;
static GdkBitmap *eek_mask = NULL;
query_box = create_query_box (title, help_func, help_data,
boolean_query_box_true_callback,
boolean_query_box_false_callback,
message,
eek ? NULL : message,
true_button, false_button,
object, signal,
callback, data);
if (!eek)
return query_box->qbox;
hbox = gtk_hbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 10);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (query_box->qbox)->vbox), hbox);
gtk_widget_show (hbox);
if (!eek_pixmap)
{
GtkStyle *style;
gtk_widget_realize (query_box->qbox);
style = gtk_widget_get_style (query_box->qbox);
eek_pixmap = gdk_pixmap_create_from_xpm_d (query_box->qbox->window,
&eek_mask,
&style->bg[GTK_STATE_NORMAL],
eek_xpm);
}
pixmap_widget = gtk_pixmap_new (eek_pixmap, eek_mask);
gtk_box_pack_start (GTK_BOX (hbox), pixmap_widget, FALSE, FALSE, 0);
gtk_widget_show (pixmap_widget);
label = gtk_label_new (message);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
return query_box->qbox;
}

View File

@ -108,6 +108,7 @@ GtkWidget * gimp_query_size_box (gchar *title,
GtkWidget * gimp_query_boolean_box (gchar *title,
GimpHelpFunc help_func,
gchar *help_data,
gboolean eek,
gchar *message,
gchar *true_button,
gchar *false_button,

View File

@ -25,6 +25,8 @@
#include "libgimp-intl.h"
#include "pixmaps/eek.xpm"
/*
* String, integer, double and size query boxes
*/
@ -90,7 +92,7 @@ create_query_box (gchar *title,
{
QueryBox *query_box;
GtkWidget *qbox;
GtkWidget *vbox;
GtkWidget *vbox = NULL;
GtkWidget *label;
query_box = g_new (QueryBox, 1);
@ -115,14 +117,17 @@ create_query_box (gchar *title,
else
object = NULL;
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (qbox)->vbox), vbox);
gtk_widget_show (vbox);
if (message)
{
vbox = gtk_vbox_new (FALSE, 2);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (qbox)->vbox), vbox);
gtk_widget_show (vbox);
label = gtk_label_new (message);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
label = gtk_label_new (message);
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
}
query_box->qbox = qbox;
query_box->vbox = vbox;
@ -295,6 +300,7 @@ GtkWidget *
gimp_query_boolean_box (gchar *title,
GimpHelpFunc help_func,
gchar *help_data,
gboolean eek,
gchar *message,
gchar *true_button,
gchar *false_button,
@ -304,15 +310,50 @@ gimp_query_boolean_box (gchar *title,
gpointer data)
{
QueryBox *query_box;
GtkWidget *hbox;
GtkWidget *pixmap_widget;
GtkWidget *label;
static GdkPixmap *eek_pixmap = NULL;
static GdkBitmap *eek_mask = NULL;
query_box = create_query_box (title, help_func, help_data,
boolean_query_box_true_callback,
boolean_query_box_false_callback,
message,
eek ? NULL : message,
true_button, false_button,
object, signal,
callback, data);
if (!eek)
return query_box->qbox;
hbox = gtk_hbox_new (FALSE, 10);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 10);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (query_box->qbox)->vbox), hbox);
gtk_widget_show (hbox);
if (!eek_pixmap)
{
GtkStyle *style;
gtk_widget_realize (query_box->qbox);
style = gtk_widget_get_style (query_box->qbox);
eek_pixmap = gdk_pixmap_create_from_xpm_d (query_box->qbox->window,
&eek_mask,
&style->bg[GTK_STATE_NORMAL],
eek_xpm);
}
pixmap_widget = gtk_pixmap_new (eek_pixmap, eek_mask);
gtk_box_pack_start (GTK_BOX (hbox), pixmap_widget, FALSE, FALSE, 0);
gtk_widget_show (pixmap_widget);
label = gtk_label_new (message);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
return query_box->qbox;
}

View File

@ -108,6 +108,7 @@ GtkWidget * gimp_query_size_box (gchar *title,
GtkWidget * gimp_query_boolean_box (gchar *title,
GimpHelpFunc help_func,
gchar *help_data,
gboolean eek,
gchar *message,
gchar *true_button,
gchar *false_button,

View File

@ -3390,6 +3390,7 @@ dlg_selector_delete_callback (GtkWidget *widget,
dialog = gimp_query_boolean_box (_("Delete GFlare"),
gimp_plugin_help_func,
"filters/gflare.html",
TRUE,
str,
_("Delete"), _("Cancel"),
NULL, NULL,