aboutsummaryrefslogtreecommitdiffstats
path: root/filter/filter-input.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-11-08 05:20:30 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-11-08 05:20:30 +0800
commitb0978f82a3a5f2869bab4cfb1b5036bc3cc8f3e0 (patch)
treee6975a4d32699cffbd2c5c2898b1609c1301c406 /filter/filter-input.c
parent19414d4335bf0b3e2a07435d967c4756540c8aaa (diff)
downloadgsoc2013-evolution-b0978f82a3a5f2869bab4cfb1b5036bc3cc8f3e0.tar.gz
gsoc2013-evolution-b0978f82a3a5f2869bab4cfb1b5036bc3cc8f3e0.tar.zst
gsoc2013-evolution-b0978f82a3a5f2869bab4cfb1b5036bc3cc8f3e0.zip
Use GtkDialog instead of GnomeDialog here.
2002-11-07 Jeffrey Stedfast <fejj@ximian.com> * 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=18635
Diffstat (limited to 'filter/filter-input.c')
-rw-r--r--filter/filter-input.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/filter/filter-input.c b/filter/filter-input.c
index fee658d2a7..7f9f0072f9 100644
--- a/filter/filter-input.c
+++ b/filter/filter-input.c
@@ -31,8 +31,6 @@
#include <gtk/gtk.h>
#include <libgnome/gnome-i18n.h>
-#include <libgnomeui/gnome-dialog.h>
-#include <libgnomeui/gnome-dialog-util.h>
#include "filter-input.h"
#include "e-util/e-sexp.h"
@@ -165,19 +163,17 @@ validate (FilterElement *fe)
{
FilterInput *fi = (FilterInput *)fe;
gboolean valid = TRUE;
+ GtkWidget *dialog;
if (fi->values && !strcmp (fi->type, "regex")) {
- regex_t regexpat; /* regex patern */
- int regerr;
- char *text;
+ const char *pattern;
+ regex_t regexpat;
- text = fi->values->data;
+ pattern = fi->values->data;
- regerr = regcomp (&regexpat, text, REG_EXTENDED | REG_NEWLINE | REG_ICASE);
- if (regerr) {
- GtkWidget *dialog;
- char *regmsg, *errmsg;
+ if (regcomp (&regexpat, pattern, REG_EXTENDED | REG_NEWLINE | REG_ICASE)) {
size_t reglen;
+ char *regmsg;
/* regerror gets called twice to get the full error string
length to do proper posix error reporting */
@@ -185,15 +181,18 @@ validate (FilterElement *fe)
regmsg = g_malloc0 (reglen + 1);
regerror (regerr, &regexpat, regmsg, reglen);
- errmsg = g_strdup_printf (_("Error in regular expression '%s':\n%s"),
- text, regmsg);
- g_free (regmsg);
-
- dialog = gnome_ok_dialog (errmsg);
+ /* FIXME: FilterElement should probably have a
+ GtkWidget member pointing to the value gotten with
+ ::get_widget() so that we can get the parent window
+ here. */
+ dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+ _("Error in regular expression '%s':\n%s"),
+ pattern, regmsg);
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ gtk_dialog_run ((GtkDialog *) dialog);
+ g_free (regmsg);
- g_free (errmsg);
valid = FALSE;
}