2001-12-23 [alfons] 0.6.6claws13
+
+ * src/prefs_filter.c
+ * src/prefs_filtering.c
+ * src/matcher.c
+ * src/importmutt.c
+ clean up a little bit
* src/string_match.c
validate input strings a little bit more
gtk_table_set_row_spacings(GTK_TABLE(table), 8);
gtk_table_set_col_spacings(GTK_TABLE(table), 8 );
- // First row
+ /* First row */
top = 0;
label = gtk_label_new(_("Name"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
name_entry = gtk_entry_new();
gtk_table_attach(GTK_TABLE(table), name_entry, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
- // Second row
+ /* Second row */
top = 1;
label = gtk_label_new(_("File"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
file_btn = gtk_button_new_with_label( _(" ... "));
gtk_table_attach(GTK_TABLE(table), file_btn, 2, 3, top, (top + 1), GTK_FILL, 0, 3, 0);
- // Status line
+ /* Status line */
hsbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_end(GTK_BOX(vbox), hsbox, FALSE, FALSE, BORDER_WIDTH);
statusbar = gtk_statusbar_new();
gtk_box_pack_start(GTK_BOX(hsbox), statusbar, TRUE, TRUE, BORDER_WIDTH);
- // Button panel
+ /* Button panel */
gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
&cancel_btn, _("Cancel"), NULL, NULL);
gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
{MATCHACTION_BOUNCE, "bounce"}
};
-/*
- syntax for matcher
-
- header "x-mailing" match "toto" score -10
- subject match "regexp" & to regexp "regexp" score 50
- subject match "regexp" | to regexpcase "regexp" | age_sup 5 score 30
-
-*/
-
+/* get_matchparser_tab_str() - used by filtering.c to translate
+ * actions to debug strings */
gchar * get_matchparser_tab_str(gint id)
{
gint i;
/* **************** data structure allocation **************** */
-
+/* matcherprop_new() - allocates a structure for one condition
+ */
MatcherProp * matcherprop_new(gint criteria, gchar * header,
gint matchtype, gchar * expr,
int value)
return prop;
}
+/* matcherprop_free()
+ */
void matcherprop_free(MatcherProp * prop)
{
if (prop->expr)
/* ************** match ******************************/
-/* match the given string */
-
+/* matcherprop_string_match() - finds out if a string matches
+ * with a criterium */
static gboolean matcherprop_string_match(MatcherProp * prop, gchar * str)
{
gchar * str1;
MatcherProp * matcher = (MatcherProp *) l->data;
if (matcherprop_criteria_headers(matcher) ||
- matcherprop_criteria_body(matcher) ||
- matcherprop_criteria_message(matcher))
+ matcherprop_criteria_body(matcher) ||
+ matcherprop_criteria_message(matcher)) {
if (matcher->result) {
if (!matchers->bool_and) {
result = TRUE;
result = FALSE;
break;
}
- }
+ }
+ }
}
g_free(file);
return processed_cmd;
}
-
-/* ************************************************************ */
-/* ************************************************************ */
/* ************************************************************ */
-/* ************************************************************ */
-/* ************************************************************ */
-
static void prefs_scoring_write(FILE * fp, GSList * prefs_scoring)
{
}
}
-
-
-
-
-
/* ******************************************************************* */
void prefs_matcher_read_config(void)
NULL);
PACK_CHECK_BUTTON (dest_hbox, regex_chkbtn, _("Use regex"));
- //gtk_widget_set_sensitive(regex_chkbtn, FALSE);
gtk_signal_connect
(GTK_OBJECT (regex_chkbtn), "toggled",
GTK_SIGNAL_FUNC (prefs_filter_regex_check_button_toggled),
cond_entry = gtk_entry_new ();
gtk_widget_show (cond_entry);
-// gtk_widget_set_usize (cond_entry, 200, -1);
gtk_box_pack_start (GTK_BOX (hbox1), cond_entry, TRUE, TRUE, 0);
cond_btn = gtk_button_new_with_label (_("Define ..."));
action_combo = gtk_combo_new ();
gtk_widget_show (action_combo);
-// gtk_widget_set_usize (action_combo, 200, -1);
gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(action_combo)->entry),
FALSE);
dest_entry = gtk_entry_new ();
gtk_widget_show (dest_entry);
-// gtk_widget_set_usize (dest_entry, 200, -1);
gtk_box_pack_start (GTK_BOX (hbox1), dest_entry, TRUE, TRUE, 0);
color_optmenu = gtk_option_menu_new();
gtk_option_menu_set_menu(GTK_OPTION_MENU(color_optmenu),
colorlabel_create_color_menu());
-// gtk_widget_set_usize(color_optmenu, -1, -1);
gtk_box_pack_start(GTK_BOX(hbox1), color_optmenu, TRUE, TRUE, 0);
dest_btn = gtk_button_new_with_label (_("Select ..."));
GTK_SIGNAL_FUNC (prefs_matcher_exec_info),
NULL);
-// dummy = gtk_label_new("");
-// gtk_widget_show (dummy);
-// gtk_box_pack_start(GTK_BOX (hbox1), dummy, FALSE, FALSE, 0);
-
-
/* register / substitute / delete */
reg_hbox = gtk_hbox_new (FALSE, 4);