inital gtk2 patch
[claws.git] / src / prefs_matcher.c
index e6dcb05042ac7bd609abd97ba338d8af2eace357..570f36a45de2f4855338fea17accaee28ed38fc4 100644 (file)
@@ -357,7 +357,7 @@ static void prefs_matcher_create(void)
 
        debug_print("Creating matcher configuration window...\n");
 
-       window = gtk_window_new(GTK_WINDOW_DIALOG);
+       window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_container_set_border_width(GTK_CONTAINER(window), 8);
        gtk_window_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
        gtk_window_set_modal(GTK_WINDOW(window), TRUE);
@@ -1049,10 +1049,10 @@ static MatcherProp *prefs_matcher_dialog_to_matcher(void)
        gint value_criteria;
        gboolean use_regexp;
        gboolean case_sensitive;
-       gchar *header;
-       gchar *expr;
+       const gchar *header;
+       const gchar *expr;
        gint value;
-       gchar *value_str;
+       const gchar *value_str;
 
        value_criteria = get_sel_from_list(GTK_LIST(matcher.criteria_list));
 
@@ -1212,6 +1212,7 @@ static void prefs_matcher_substitute_cb(void)
        gint row;
        MatcherProp *matcherprop;
 
+       if (!clist->selection) return;
        row = GPOINTER_TO_INT(clist->selection->data);
        if (row == 0)
                return;
@@ -1243,7 +1244,9 @@ static void prefs_matcher_delete_cb(void)
                return;
 
        gtk_clist_remove(clist, row);
-       
+
+       prefs_matcher_reset_condition();
+
        prefs_matcher_update_hscrollbar();
 }
 
@@ -1371,6 +1374,7 @@ static void prefs_matcher_select(GtkCList *clist, gint row, gint column,
        case MATCHCRITERIA_HEADERS_PART:
        case MATCHCRITERIA_BODY_PART:
        case MATCHCRITERIA_MESSAGE:
+       case MATCHCRITERIA_EXECUTE:
                gtk_entry_set_text(GTK_ENTRY(matcher.value_entry), prop->expr);
                break;
 
@@ -1639,8 +1643,6 @@ static void prefs_matcher_ok(void)
        MatcherList *matchers;
        MatcherProp *matcherprop;
        AlertValue val;
-       gint criteria;
-       gint value_criteria;
        gchar *matcher_str;
        gchar *str;
        gint row = 1;
@@ -1657,14 +1659,15 @@ static void prefs_matcher_ok(void)
                                        if (strcmp(matcher_str, str) == 0) break;
                                        row++;
                                }
+
                                if (strcmp(matcher_str, str) != 0) {
-                                       val = alertpanel(_("Entry not saved"),
-                                                _("The entry was not saved\nHave you really finished?"),
-                                                _("Yes"), _("No"), NULL);
-                                       if (G_ALERTDEFAULT != val) {
+                                       val = alertpanel(_("Entry not saved"),
+                                                        _("The entry was not saved\nHave you really finished?"),
+                                                        _("Yes"), _("No"), NULL);
+                                       if (G_ALERTDEFAULT != val) {
                                                g_free(str);
-                                               return;
-                                       }
+                                               return;
+                                       }
                                }
                        }
                }