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 /filter/rule-context.c | |
parent | 0783b601b0f6cc882ca6d4f22a6ac052d3658ba4 (diff) | |
download | gsoc2013-evolution-59ca4efdbb7dafa2c70ee3f8f9b5bcef0153d75a.tar gsoc2013-evolution-59ca4efdbb7dafa2c70ee3f8f9b5bcef0153d75a.tar.gz gsoc2013-evolution-59ca4efdbb7dafa2c70ee3f8f9b5bcef0153d75a.tar.bz2 gsoc2013-evolution-59ca4efdbb7dafa2c70ee3f8f9b5bcef0153d75a.tar.lz gsoc2013-evolution-59ca4efdbb7dafa2c70ee3f8f9b5bcef0153d75a.tar.xz 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
Diffstat (limited to 'filter/rule-context.c')
-rw-r--r-- | filter/rule-context.c | 38 |
1 files changed, 24 insertions, 14 deletions
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 |