From 75060a1157897e8d233de20725c8e97e1645ee64 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ho=C3=A0=20Vi=C3=AAt=20Dinh?= Date: Mon, 20 Oct 2003 14:07:37 +0000 Subject: [PATCH] enable processing on startup / fixed C89 compatibility --- ChangeLog.claws | 13 +++++++++++++ configure.ac | 2 +- src/folder_item_prefs.c | 4 ++++ src/folder_item_prefs.h | 1 + src/main.c | 3 ++- src/messageview.c | 5 +++-- src/prefs_folder_item.c | 19 ++++++++++++++++++- 7 files changed, 42 insertions(+), 5 deletions(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index f592746fe..714c93129 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,16 @@ +2003-10-20 [hoa] 0.9.6claws34 + + * src/folder_item_prefs.[ch] + * src/prefs_folder_item.c + * src/main.c + Added a property per folder to choose whether we + want to apply processing on it on startup or if we + prefer to wait the folder selection to apply it. + + * src/messageview.c + fixed C89 compatibility (for old compilers, for + example gcc 2.95.x). + 2003-10-17 [christoph] 0.9.6claws33 * src/mimeview.c diff --git a/configure.ac b/configure.ac index 057e5a4d8..d0eb0c774 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=6 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=33 +EXTRA_VERSION=34 if test $EXTRA_VERSION -eq 0; then VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws else diff --git a/src/folder_item_prefs.c b/src/folder_item_prefs.c index 595887f77..e14caa47e 100644 --- a/src/folder_item_prefs.c +++ b/src/folder_item_prefs.c @@ -90,6 +90,8 @@ static PrefParam param[] = { NULL, NULL, NULL}, {"folder_color", "", &tmp_prefs.color, P_INT, NULL, NULL, NULL}, + {"enable processing at startup", "TRUE", &tmp_prefs.enable_processing, P_BOOL, + NULL, NULL, NULL}, {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL} }; @@ -183,6 +185,7 @@ static FolderItemPrefs *folder_item_prefs_clear(FolderItemPrefs *prefs) prefs->save_copy_to_folder = FALSE; prefs->color = 0; + prefs->enable_processing = TRUE; prefs->scoring = NULL; prefs->processing = NULL; return prefs; @@ -241,6 +244,7 @@ void folder_item_prefs_copy_prefs(FolderItem * src, FolderItem * dest) tmp_prefs.enable_thread = src->prefs->enable_thread; tmp_prefs.kill_score = src->prefs->kill_score; tmp_prefs.important_score = src->prefs->important_score; + tmp_prefs.enable_processing = src->prefs->enable_processing; prefs_matcher_read_config(); for (tmp = src->prefs->scoring; tmp != NULL && tmp->data != NULL;) { diff --git a/src/folder_item_prefs.h b/src/folder_item_prefs.h index 76ff911ae..dd8252c07 100644 --- a/src/folder_item_prefs.h +++ b/src/folder_item_prefs.h @@ -44,6 +44,7 @@ struct _FolderItemPrefs { gint kill_score; gint important_score; + int enable_processing; GSList * scoring; GSList * processing; diff --git a/src/main.c b/src/main.c index 272f0aaf9..123e2100b 100644 --- a/src/main.c +++ b/src/main.c @@ -519,7 +519,8 @@ static void initial_processing(FolderItem *item, gpointer data) main_window_cursor_wait(mainwin); - folder_item_apply_processing(item); + if (item->prefs->enable_processing) + folder_item_apply_processing(item); debug_print("done.\n"); STATUSBAR_POP(mainwin); diff --git a/src/messageview.c b/src/messageview.c index 44eb1d257..591756fda 100644 --- a/src/messageview.c +++ b/src/messageview.c @@ -439,6 +439,8 @@ static gint disposition_notification_send(MsgInfo *msginfo) FolderItem *queue, *outbox; gint num; gchar *path; + gchar *addr; + gchar *addrp; if ((!msginfo->returnreceiptto) && (!msginfo->dispositionnotificationto)) @@ -518,8 +520,7 @@ static gint disposition_notification_send(MsgInfo *msginfo) g_warning("can't change file mode\n"); } - gchar *addr = g_strdup(to); - gchar *addrp; + addr = g_strdup(to); extract_address(addr); addrp = addr; diff --git a/src/prefs_folder_item.c b/src/prefs_folder_item.c index de3de4cc1..de33df5e3 100644 --- a/src/prefs_folder_item.c +++ b/src/prefs_folder_item.c @@ -66,6 +66,7 @@ struct FolderItemGeneralPage GtkWidget *checkbtn_folder_chmod; GtkWidget *entry_folder_chmod; GtkWidget *folder_color_btn; + GtkWidget *checkbtn_enable_processing; gint folder_color; }; @@ -117,11 +118,12 @@ void prefs_folder_item_general_create_widget_func(PrefsPage * _page, GtkWidget *entry_folder_chmod; GtkWidget *folder_color; GtkWidget *folder_color_btn; + GtkWidget *checkbtn_enable_processing; page->item = item; /* Table */ - table = gtk_table_new(3, 2, FALSE); + table = gtk_table_new(4, 2, FALSE); gtk_widget_show(table); gtk_table_set_row_spacings(GTK_TABLE(table), -1); rowcount = 0; @@ -194,12 +196,24 @@ void prefs_folder_item_general_create_widget_func(PrefsPage * _page, rowcount++; + /* Enable processing at startup */ + checkbtn_enable_processing = gtk_check_button_new_with_label(_("Processing on startup: ")); + gtk_widget_show(checkbtn_enable_processing); + gtk_table_attach(GTK_TABLE(table), checkbtn_enable_processing, 0, 2, + rowcount, rowcount + 1, GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0); + + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_processing), + item->prefs->enable_processing); + + rowcount++; + page->table = table; page->checkbtn_simplify_subject = checkbtn_simplify_subject; page->entry_simplify_subject = entry_simplify_subject; page->checkbtn_folder_chmod = checkbtn_folder_chmod; page->entry_folder_chmod = entry_folder_chmod; page->folder_color_btn = folder_color_btn; + page->checkbtn_enable_processing = checkbtn_enable_processing; page->page.widget = table; } @@ -245,6 +259,9 @@ void prefs_folder_item_general_save_func(PrefsPage *_page) if (prefs->color > 0) folder_item_update(page->item, F_ITEM_UPDATE_MSGCNT); + prefs->enable_processing = + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_enable_processing)); + folder_item_prefs_save_config(page->item); } -- 2.25.1