diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-11-08 07:09:45 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-11-08 07:09:45 +0800 |
commit | 59ca4efdbb7dafa2c70ee3f8f9b5bcef0153d75a (patch) | |
tree | 722db509bf8b725208a18c548293be703abaaad3 | |
parent | 0783b601b0f6cc882ca6d4f22a6ac052d3658ba4 (diff) | |
download | gsoc2013-evolution-59ca4efdbb7dafa2c70ee3f8f9b5bcef0153d75a.tar.gz gsoc2013-evolution-59ca4efdbb7dafa2c70ee3f8f9b5bcef0153d75a.tar.zst gsoc2013-evolution-59ca4efdbb7dafa2c70ee3f8f9b5bcef0153d75a.zip |
Use a GtkDialog instead of a GnomeDialog for reporting errors.
2002-11-07 Jeffrey Stedfast <fejj@ximian.com>
* vfolder-rule.c (validate): Use a GtkDialog instead of a
GnomeDialog for reporting errors.
* rule-editor.c (rule_add): Use a GtkDialog instead of
GnomeDialog.
(rule_edit): Same.
(add_editor_response): Use a GtkMessageDialog for the error
reporting instead of a GnomeDialog.
(edit_editor_response): Same.
* rule-context.c (rule_context_add_rule_gui): Use a GtkDialog
instead of a GnomeDialog.
* filter-rule.c (validate): Use GtkDialog instead of GnomeDialog
here.
* filter-input.c (validate): Use GtkDialog instead of GnomeDialog
here.
* filter-folder.c (validate): Use GtkDialog instead of GnomeDialog
here.
* filter-file.c (validate): Use GtkDialog instead of GnomeDialog
here.
* rule-editor.c: Subclass GtkDialog instead of GnomeDialog.
* filter-datespec.c (validate): Use GtkDialog instead of
GnomeDialog.
(button_clicked): Same.
svn path=/trunk/; revision=18651
-rw-r--r-- | filter/ChangeLog | 13 | ||||
-rw-r--r-- | filter/filter-datespec.c | 16 | ||||
-rw-r--r-- | filter/filter-file.c | 2 | ||||
-rw-r--r-- | filter/filter-folder.c | 2 | ||||
-rw-r--r-- | filter/filter-input.c | 4 | ||||
-rw-r--r-- | filter/filter-label.c | 4 | ||||
-rw-r--r-- | filter/filter-part.c | 1 | ||||
-rw-r--r-- | filter/filter-rule.c | 1 | ||||
-rw-r--r-- | filter/filter-source.c | 17 | ||||
-rw-r--r-- | filter/rule-context.c | 38 | ||||
-rw-r--r-- | filter/rule-editor.c | 138 | ||||
-rw-r--r-- | filter/vfolder-rule.c | 22 |
12 files changed, 137 insertions, 121 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog index e8dc82fc0c..b8d74956ab 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,5 +1,18 @@ 2002-11-07 Jeffrey Stedfast <fejj@ximian.com> + * vfolder-rule.c (validate): Use a GtkDialog instead of a + GnomeDialog for reporting errors. + + * rule-editor.c (rule_add): Use a GtkDialog instead of + GnomeDialog. + (rule_edit): Same. + (add_editor_response): Use a GtkMessageDialog for the error + reporting instead of a GnomeDialog. + (edit_editor_response): Same. + + * rule-context.c (rule_context_add_rule_gui): Use a GtkDialog + instead of a GnomeDialog. + * filter-rule.c (validate): Use GtkDialog instead of GnomeDialog here. diff --git a/filter/filter-datespec.c b/filter/filter-datespec.c index 197140218d..fb5013ca4b 100644 --- a/filter/filter-datespec.c +++ b/filter/filter-datespec.c @@ -176,6 +176,7 @@ validate (FilterElement *fe) "%s", _("You must choose a date.")); gtk_dialog_run ((GtkDialog *) dialog); + gtk_widget_destroy (dialog); } return valid; @@ -391,14 +392,14 @@ set_option_relative (GtkMenu *menu, FilterDatespec *fds) } static void -dialog_response (GtkDialog *dialog, int button, FilterDatespec *fds) +dialog_response (GtkWidget *dialog, int button, FilterDatespec *fds) { - /* FIXME: this may have changed with GtkDialog??? */ - if (button != 0) - return; + if (button == GTK_RESPONSE_ACCEPT) { + get_values (fds); + set_button (fds); + } - get_values (fds); - set_button (fds); + gtk_widget_destroy (dialog); } static void @@ -414,7 +415,8 @@ button_clicked (GtkButton *button, FilterDatespec *fds) dialog = (GtkDialog *) gtk_dialog_new (); gtk_window_set_title ((GtkWindow *) dialog, _("Select a time to compare against")); - gtk_dialog_add_buttons (dialog, GTK_BUTTONS_OK, GTK_BUTTONS_CANCEL, NULL); + gtk_dialog_add_buttons (dialog, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, + GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL); p->notebook_type = glade_xml_get_widget (gui, "notebook_type"); p->option_type = glade_xml_get_widget (gui, "option_type"); diff --git a/filter/filter-file.c b/filter/filter-file.c index aca2485a37..0ef87f646b 100644 --- a/filter/filter-file.c +++ b/filter/filter-file.c @@ -166,6 +166,7 @@ validate (FilterElement *fe) "%s", _("You must specify a file name.")); gtk_dialog_run ((GtkDialog *) dialog); + gtk_widget_destroy (dialog); return FALSE; } @@ -184,6 +185,7 @@ validate (FilterElement *fe) file->path); gtk_dialog_run ((GtkDialog *) dialog); + gtk_widget_destroy (dialog); return FALSE; } diff --git a/filter/filter-folder.c b/filter/filter-folder.c index a0f43e83d6..13f6cf24d6 100644 --- a/filter/filter-folder.c +++ b/filter/filter-folder.c @@ -25,6 +25,7 @@ #include <config.h> #endif +#include <gtk/gtk.h> #include <libgnome/gnome-i18n.h> #include "filter-folder.h" @@ -152,6 +153,7 @@ validate (FilterElement *fe) "%s", _("You must specify a folder.")); gtk_dialog_run ((GtkDialog *) dialog); + gtk_widget_destroy (dialog); return FALSE; } diff --git a/filter/filter-input.c b/filter/filter-input.c index 7f9f0072f9..4846aeefe5 100644 --- a/filter/filter-input.c +++ b/filter/filter-input.c @@ -168,10 +168,11 @@ validate (FilterElement *fe) if (fi->values && !strcmp (fi->type, "regex")) { const char *pattern; regex_t regexpat; + int regerr; pattern = fi->values->data; - if (regcomp (®expat, pattern, REG_EXTENDED | REG_NEWLINE | REG_ICASE)) { + if ((regerr = regcomp (®expat, pattern, REG_EXTENDED | REG_NEWLINE | REG_ICASE))) { size_t reglen; char *regmsg; @@ -191,6 +192,7 @@ validate (FilterElement *fe) pattern, regmsg); gtk_dialog_run ((GtkDialog *) dialog); + gtk_widget_destroy (dialog); g_free (regmsg); valid = FALSE; diff --git a/filter/filter-label.c b/filter/filter-label.c index 4e04bb8d18..a249a8adf3 100644 --- a/filter/filter-label.c +++ b/filter/filter-label.c @@ -117,12 +117,8 @@ static void xml_create (FilterElement *fe, xmlNodePtr node) { FilterOption *fo = (FilterOption *) fe; - GConfClient *gconf; - GSList *labels, *l; FILTER_ELEMENT_CLASS (parent_class)->xml_create (fe, node); - gconf = gconf_client_get_default (); - /* FIXME: probably use gconf_client_get_list() here? */ } diff --git a/filter/filter-part.c b/filter/filter-part.c index 062cc02e0c..abe06b462c 100644 --- a/filter/filter-part.c +++ b/filter/filter-part.c @@ -533,6 +533,7 @@ int main(int argc, char **argv) gtk_box_pack_start ((GtkBox *) dialog->vbox, w, TRUE, TRUE, 0); gtk_dialog_run ((GtkDialog *) dialog); + gtk_widget_destroy (dialog); code = g_string_new (""); filter_part_build_code (ff, code); diff --git a/filter/filter-rule.c b/filter/filter-rule.c index cb4959d2fc..de7a7de64c 100644 --- a/filter/filter-rule.c +++ b/filter/filter-rule.c @@ -218,6 +218,7 @@ validate (FilterRule *fr) "%s", _("You must name this filter.")); gtk_dialog_run ((GtkDialog *) dialog); + gtk_widget_destroy (dialog); return FALSE; } diff --git a/filter/filter-source.c b/filter/filter-source.c index 2264af49dc..ff63eb0920 100644 --- a/filter/filter-source.c +++ b/filter/filter-source.c @@ -29,15 +29,8 @@ #include "filter-source.h" #include <gtk/gtk.h> -#include <gnome.h> #include <e-util/e-url.h> #include <e-util/e-sexp.h> -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-context.h> -#include <bonobo/bonobo-moniker-util.h> -#include <bonobo/bonobo-exception.h> -#include <bonobo-conf/bonobo-config-database.h> #include <camel/camel-url.h> @@ -232,9 +225,9 @@ clone (FilterElement *fe) } static void -source_changed (GtkWidget *w, FilterSource *fs) +source_changed (GtkWidget *item, FilterSource *fs) { - SourceInfo *info = (SourceInfo *) g_object_get_data (w, "source"); + SourceInfo *info = (SourceInfo *) g_object_get_data ((GObject *) item, "source"); g_free (fs->priv->current_url); fs->priv->current_url = g_strdup (info->url); @@ -276,8 +269,8 @@ get_widget (FilterElement *fe) item = gtk_menu_item_new_with_label (label); g_free (label); - g_object_set_data (item, "source", info); - g_signal_connect (item, "activate", source_changed, fs); + g_object_set_data ((GObject *) item, "source", info); + g_signal_connect (item, "activate", GTK_SIGNAL_FUNC (source_changed), fs); gtk_menu_append (GTK_MENU (menu), item); gtk_widget_show (item); @@ -344,6 +337,7 @@ filter_source_add_source (FilterSource *fs, const char *account_name, const char static void filter_source_get_sources (FilterSource *fs) { +#if 0 Bonobo_ConfigDatabase db; CORBA_Environment ev; int i, len; @@ -398,4 +392,5 @@ filter_source_get_sources (FilterSource *fs) g_free (addr); g_free (uri); } +#endif } diff --git a/filter/rule-context.c b/filter/rule-context.c index feae6702b1..aefc20b935 100644 --- a/filter/rule-context.c +++ b/filter/rule-context.c @@ -32,7 +32,7 @@ #include <fcntl.h> #include <errno.h> -#include <libgnomeui/gnome-dialog.h> +#include <gtk/gtk.h> #include <gal/util/e-xml-utils.h> @@ -125,6 +125,8 @@ rule_context_class_init (RuleContextClass *klass) RULE_TYPE_CONTEXT, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RuleContextClass, rule_removed), + NULL, + NULL, gtk_marshal_NONE__POINTER, G_TYPE_NONE, 1, G_TYPE_POINTER); @@ -133,6 +135,8 @@ rule_context_class_init (RuleContextClass *klass) RULE_TYPE_CONTEXT, G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (RuleContextClass, changed), + NULL, + NULL, gtk_marshal_NONE__NONE, G_TYPE_NONE, 0); } @@ -636,9 +640,9 @@ rule_context_add_rule (RuleContext *rc, FilterRule *new) } static void -new_rule_clicked (GtkWidget *dialog, int button, RuleContext *context) +new_rule_response (GtkWidget *dialog, int button, RuleContext *context) { - if (button == 0) { + if (button == GTK_RESPONSE_ACCEPT) { FilterRule *rule = g_object_get_data ((GObject *) dialog, "rule"); char *user = g_object_get_data ((GObject *) dialog, "path"); @@ -653,39 +657,45 @@ new_rule_clicked (GtkWidget *dialog, int button, RuleContext *context) rule_context_save (context, user); } - if (button != -1) - gnome_dialog_close (GNOME_DIALOG (dialog)); + gtk_widget_destroy (dialog); } /* add a rule, with a gui, asking for confirmation first ... optionally save to path */ void rule_context_add_rule_gui (RuleContext *rc, FilterRule *rule, const char *title, const char *path) { - GtkWidget *dialog, *w; + GtkDialog *dialog; + GtkWidget *widget; d(printf("add rule gui '%s'\n", rule->name)); g_assert (rc); g_assert (rule); - w = filter_rule_get_widget (rule, rc); - dialog = gnome_dialog_new (title, GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL); - gtk_window_set_policy (GTK_WINDOW (dialog), FALSE, TRUE, FALSE); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), w, TRUE, TRUE, 0); - gtk_window_set_default_size (GTK_WINDOW (dialog), 600, 400); - gtk_widget_show (w); + widget = filter_rule_get_widget (rule, rc); + gtk_widget_show (widget); + + dialog = (GtkDialog *) gtk_dialog_new (); + gtk_dialog_add_buttons (dialog, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, + GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL); + + gtk_window_set_title ((GtkWindow *) dialog, title); + gtk_window_set_default_size ((GtkWindow *) dialog, 600, 400); + gtk_window_set_policy ((GtkWindow *) dialog, FALSE, TRUE, FALSE); + + gtk_box_pack_start ((GtkBox *) dialog->vbox, widget, TRUE, TRUE, 0); g_object_set_data_full ((GObject *) dialog, "rule", rule, g_object_unref); if (path) g_object_set_data_full ((GObject *) dialog, "path", g_strdup (path), g_free); - g_signal_connect (dialog, "clicked", GTK_SIGNAL_FUNC (new_rule_clicked), rc); + g_signal_connect (dialog, "response", GTK_SIGNAL_FUNC (new_rule_response), rc); g_object_ref (rc); g_object_set_data_full ((GObject *) dialog, "context", rc, g_object_unref); - gtk_widget_show (dialog); + gtk_widget_show ((GtkWidget *) dialog); } void diff --git a/filter/rule-editor.c b/filter/rule-editor.c index 16985a811f..d2298fca82 100644 --- a/filter/rule-editor.c +++ b/filter/rule-editor.c @@ -208,26 +208,39 @@ create_rule (RuleEditor *re) } static void -add_editor_clicked (GtkWidget *dialog, int button, RuleEditor *re) +editor_destroy (GtkWidget *dialog, RuleEditor *re) +{ + if (re->edit) { + g_object_unref (re->edit); + re->edit = NULL; + } + + re->dialog = NULL; + + gtk_widget_set_sensitive (GTK_WIDGET (re), TRUE); + rule_editor_set_sensitive (re); +} + +static void +add_editor_response (GtkWidget *dialog, int button, RuleEditor *re) { GtkWidget *item; GList *l = NULL; - switch (button) { - case 0: + if (button == GTK_RESPONSE_ACCEPT) { if (!filter_rule_validate (re->edit)) { /* no need to popup a dialog because the validate code does that. */ return; } if (rule_context_find_rule (re->context, re->edit->name, re->edit->source)) { - GtkWidget *dialog; - char *what; + dialog = gtk_message_dialog_new ((GtkWindow *) dialog, GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, + _("Rule name '%s' is not unique, choose another."), + re->edit->name); - what = g_strdup_printf(_("Rule name '%s' is not unique, choose another"), re->edit->name); - dialog = gnome_ok_dialog (what); - g_free (what); - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + gtk_dialog_run ((GtkDialog *) dialog); + gtk_widget_destroy (dialog); return; } @@ -249,26 +262,9 @@ add_editor_clicked (GtkWidget *dialog, int button, RuleEditor *re) g_object_ref (re->current); rule_editor_add_undo (re, RULE_EDITOR_LOG_ADD, re->current, rule_context_get_rank_rule (re->context, re->current, re->current->source), 0); - case 1: - default: - gnome_dialog_close (GNOME_DIALOG (dialog)); - case -1: - if (re->edit) { - g_object_unref (re->edit); - re->edit = NULL; - } - - re->dialog = NULL; - - gtk_widget_set_sensitive (GTK_WIDGET (re), TRUE); - rule_editor_set_sensitive (re); } -} - -static void -add_editor_destroyed (GtkWidget *w, RuleEditor *re) -{ - add_editor_clicked (w, -1, re); + + gtk_widget_destroy (dialog); } static void @@ -283,31 +279,33 @@ rule_add (GtkWidget *widget, RuleEditor *re) filter_rule_set_source (re->edit, re->source); rules = filter_rule_get_widget (re->edit, re->context); - re->dialog = gnome_dialog_new (_("Add Rule"), - GNOME_STOCK_BUTTON_OK, - GNOME_STOCK_BUTTON_CANCEL, - NULL); + re->dialog = gtk_dialog_new (); + gtk_dialog_add_buttons ((GtkDialog *) re->dialog, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, + GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL); + gtk_window_set_title ((GtkWindow *) re->dialog, _("Add Rule")); gtk_window_set_default_size (GTK_WINDOW (re->dialog), 650, 400); gtk_window_set_policy (GTK_WINDOW (re->dialog), FALSE, TRUE, FALSE); gtk_widget_set_parent_window (GTK_WIDGET (re->dialog), GTK_WIDGET (re)->window); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 0); - g_signal_connect (re->dialog, "clicked", GTK_SIGNAL_FUNC (add_editor_clicked), re); - g_signal_connect (re->dialog, "destroy", GTK_SIGNAL_FUNC (add_editor_destroyed), re); + + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 0); + + g_signal_connect (re->dialog, "response", GTK_SIGNAL_FUNC (add_editor_response), re); + g_signal_connect (re->dialog, "destroy", GTK_SIGNAL_FUNC (editor_destroy), re); + gtk_widget_set_sensitive (GTK_WIDGET (re), FALSE); gtk_widget_show (re->dialog); } static void -edit_editor_clicked (GtkWidget *dialog, int button, RuleEditor *re) +edit_editor_response (GtkWidget *dialog, int button, RuleEditor *re) { FilterRule *rule; GtkWidget *item; int pos; - switch (button) { - case 0: + if (button == GTK_RESPONSE_ACCEPT) { if (!filter_rule_validate (re->edit)) { /* no need to popup a dialog because the validate code does that. */ return; @@ -315,13 +313,13 @@ edit_editor_clicked (GtkWidget *dialog, int button, RuleEditor *re) rule = rule_context_find_rule (re->context, re->edit->name, re->edit->source); if (rule != NULL && rule != re->current) { - GtkWidget *dialog; - char *what; + dialog = gtk_message_dialog_new ((GtkWindow *) dialog, GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, + _("Rule name '%s' is not unique, choose another."), + re->edit->name); - what = g_strdup_printf (_("Rule name '%s' is not unique, choose another"), re->edit->name); - dialog = gnome_ok_dialog (what); - g_free (what); - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + gtk_dialog_run ((GtkDialog *) dialog); + gtk_widget_destroy (dialog); return; } @@ -336,26 +334,9 @@ edit_editor_clicked (GtkWidget *dialog, int button, RuleEditor *re) /* replace the old rule with the new rule */ filter_rule_copy (re->current, re->edit); } - case 1: - default: - gnome_dialog_close (GNOME_DIALOG (dialog)); - case -1: - if (re->edit) { - g_object_unref (re->edit); - re->edit = NULL; - } - - re->dialog = NULL; - - gtk_widget_set_sensitive (GTK_WIDGET (re), TRUE); - rule_editor_set_sensitive (re); } -} - -static void -edit_editor_destroyed (GtkWidget *w, RuleEditor *re) -{ - edit_editor_clicked (w, -1, re); + + gtk_widget_destroy (dialog); } static void @@ -369,17 +350,20 @@ rule_edit (GtkWidget *widget, RuleEditor *re) re->edit = filter_rule_clone (re->current); rules = filter_rule_get_widget (re->edit, re->context); - re->dialog = gnome_dialog_new (_("Edit Rule"), - GNOME_STOCK_BUTTON_OK, - GNOME_STOCK_BUTTON_CANCEL, - NULL); - gnome_dialog_set_parent (GNOME_DIALOG (re->dialog), GTK_WINDOW (re)); - gtk_window_set_default_size (GTK_WINDOW (re->dialog), 600, 400); + re->dialog = gtk_dialog_new (); + gtk_dialog_add_buttons ((GtkDialog *) re->dialog, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, + GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL); + + gtk_window_set_title ((GtkWindow *) re->dialog, _("Edit Rule")); + gtk_window_set_default_size (GTK_WINDOW (re->dialog), 650, 400); gtk_window_set_policy (GTK_WINDOW (re->dialog), FALSE, TRUE, FALSE); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 0); - g_signal_connect (re->dialog, "clicked", GTK_SIGNAL_FUNC (edit_editor_clicked), re); - g_signal_connect (re->dialog, "destroy", GTK_SIGNAL_FUNC (edit_editor_destroyed), re); + gtk_widget_set_parent_window (GTK_WIDGET (re->dialog), GTK_WIDGET (re)->window); + + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (re->dialog)->vbox), rules, TRUE, TRUE, 0); + + g_signal_connect (re->dialog, "clicked", GTK_SIGNAL_FUNC (edit_editor_response), re); + g_signal_connect (re->dialog, "destroy", GTK_SIGNAL_FUNC (editor_destroy), re); gtk_widget_set_sensitive (GTK_WIDGET (re), FALSE); @@ -644,14 +628,14 @@ rule_editor_construct (RuleEditor *re, RuleContext *context, GladeXML *gui, cons gtk_window_set_policy (GTK_WINDOW (re), FALSE, TRUE, FALSE); w = glade_xml_get_widget (gui, "rule_editor"); - gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (re)->vbox), w, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (re)->vbox), w, TRUE, TRUE, 0); for (i = 0; i < BUTTON_LAST; i++) { re->priv->buttons[i] = (GtkButton *) w = glade_xml_get_widget (gui, edit_buttons[i].name); g_signal_connect (w, "clicked", edit_buttons[i].func, re); } - re->list = (GtkList *) w = glade_xml_get_widget(gui, "rule_list"); + re->list = (GtkList *) w = glade_xml_get_widget (gui, "rule_list"); g_signal_connect (w, "select_child", GTK_SIGNAL_FUNC (select_rule), re); g_signal_connect (w, "button_press_event", GTK_SIGNAL_FUNC (double_click), re); @@ -659,8 +643,8 @@ rule_editor_construct (RuleEditor *re, RuleContext *context, GladeXML *gui, cons rule_editor_set_source (re, source); if (enable_undo) { - gtk_dialog_add_buttons ((GtkDialog *) re, GTK_BUTTONS_OK, - GTK_BUTTONS_CANCEL, NULL); + gtk_dialog_add_buttons ((GtkDialog *) re, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, + GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, NULL); } else - gtk_dialog_add_buttons ((GtkDialog *) re, GTK_BUTTONS_OK, NULL); + gtk_dialog_add_buttons ((GtkDialog *) re, GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, NULL); } diff --git a/filter/vfolder-rule.c b/filter/vfolder-rule.c index d0bb04ee2c..19de3074f7 100644 --- a/filter/vfolder-rule.c +++ b/filter/vfolder-rule.c @@ -28,8 +28,6 @@ #include <gtk/gtk.h> #include <glade/glade.h> #include <libgnome/gnome-i18n.h> -#include <libgnomeui/gnome-dialog.h> -#include <libgnomeui/gnome-dialog-util.h> #include "vfolder-context.h" #include "vfolder-rule.h" @@ -202,8 +200,13 @@ validate (FilterRule *fr) g_return_val_if_fail (fr != NULL, FALSE); if (!fr->name || !*fr->name) { - dialog = gnome_ok_dialog (_("You must name this vfolder.")); - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + /* FIXME: set a aprent window? */ + dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, + "%s", _("You must name this vfolder.")); + + gtk_dialog_run ((GtkDialog *) dialog); + gtk_widget_destroy (dialog); return 0; } @@ -211,8 +214,13 @@ validate (FilterRule *fr) /* We have to have at least one source set in the "specific" case. Do not translate this string! */ if (fr->source && !strcmp (fr->source, "specific") && VFOLDER_RULE (fr)->sources == NULL) { - dialog = gnome_ok_dialog (_("You need to to specify at least one folder as a source.")); - gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + /* FIXME: set a parent window? */ + dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, + "%s", _("You need to to specify at least one folder as a source.")); + + gtk_dialog_run ((GtkDialog *) dialog); + gtk_widget_destroy (dialog); return 0; } @@ -372,7 +380,7 @@ select_source_with (GtkWidget *widget, struct _source_data *data) } static void -source_add(GtkWidget *widget, struct _source_data *data) +source_add (GtkWidget *widget, struct _source_data *data) { static const char *allowed_types[] = { "mail/*", NULL }; GNOME_Evolution_Folder *folder; |