/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2009 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#ifndef G_OS_WIN32
GtkWidget *checkbtn_simplify_subject;
GtkWidget *entry_simplify_subject;
- GtkWidget *hbox_regexp;
GtkWidget *label_regexp_test;
GtkWidget *entry_regexp_test_string;
- GtkWidget *left_arrow;
+ GtkWidget *label_regexp_result;
GtkWidget *entry_regexp_test_result;
#endif
GtkWidget *checkbtn_folder_chmod;
GtkWidget *enable_processing_when_opening_rec_checkbtn;
GtkWidget *newmailcheck_rec_checkbtn;
GtkWidget *offlinesync_rec_checkbtn;
- CLAWS_TIP_DECL();
page->item = item;
/* Table */
- table = gtk_table_new(11, 4, FALSE);
+ table = gtk_table_new(12, 3, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), VBOX_BORDER);
gtk_table_set_row_spacings(GTK_TABLE(table), 4);
gtk_table_set_col_spacings(GTK_TABLE(table), 4);
gtk_label_set_use_markup(GTK_LABEL(no_save_warning), TRUE);
gtk_label_set_line_wrap(GTK_LABEL(no_save_warning), TRUE);
gtk_misc_set_alignment(GTK_MISC(no_save_warning), 0.0, 0.5);
- gtk_table_attach(GTK_TABLE(table), no_save_warning, 0, 4,
+ gtk_table_attach(GTK_TABLE(table), no_save_warning, 0, 3,
rowcount, rowcount + 1, GTK_FILL, 0, 0, 0);
rowcount++;
}
/* Apply to subfolders */
label = gtk_label_new(_("Apply to\nsubfolders"));
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
- gtk_table_attach(GTK_TABLE(table), label, 3, 4,
+ gtk_table_attach(GTK_TABLE(table), label, 2, 3,
rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
rowcount++;
rowcount, rowcount + 1, GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0);
gtk_table_attach(GTK_TABLE(table), folder_type, 1, 2,
rowcount, rowcount + 1, GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0);
- gtk_table_attach(GTK_TABLE(table), dummy_checkbtn, 3, 4,
+ gtk_table_attach(GTK_TABLE(table), dummy_checkbtn, 2, 3,
rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
rowcount++;
G_CALLBACK(folder_regexp_set_subject_example_cb), page);
entry_simplify_subject = gtk_entry_new();
- gtk_table_attach(GTK_TABLE(table), entry_simplify_subject, 1, 3,
+ gtk_table_attach(GTK_TABLE(table), entry_simplify_subject, 1, 2,
rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
SET_TOGGLE_SENSITIVITY(checkbtn_simplify_subject, entry_simplify_subject);
gtk_entry_set_text(GTK_ENTRY(entry_simplify_subject),
G_CALLBACK(folder_regexp_test_cb), page);
simplify_subject_rec_checkbtn = gtk_check_button_new();
- gtk_table_attach(GTK_TABLE(table), simplify_subject_rec_checkbtn, 3, 4,
+ gtk_table_attach(GTK_TABLE(table), simplify_subject_rec_checkbtn, 2, 3,
rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
rowcount++;
- /* Test RegExp */
- label_regexp_test = gtk_label_new(_("Test RegExp"));
- gtk_misc_set_alignment(GTK_MISC(label_regexp_test), 0, 0.5);
+ /* Test string */
+ label_regexp_test = gtk_label_new(_("Test string:"));
+ gtk_misc_set_alignment(GTK_MISC(label_regexp_test), 1, 0.5);
gtk_table_attach(GTK_TABLE(table), label_regexp_test, 0, 1,
rowcount, rowcount + 1, GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0);
SET_TOGGLE_SENSITIVITY(checkbtn_simplify_subject, label_regexp_test);
g_signal_connect(G_OBJECT(entry_regexp_test_string), "changed",
G_CALLBACK(folder_regexp_test_cb), page);
- hbox_regexp = gtk_hbox_new (FALSE, 4);
- gtk_widget_show (hbox_regexp);
- gtk_table_attach(GTK_TABLE(table), hbox_regexp, 2, 3,
- rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
-
- left_arrow = gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_OUT);
- gtk_widget_show(left_arrow);
- gtk_box_pack_start (GTK_BOX(hbox_regexp), left_arrow, FALSE, FALSE, 0);
- SET_TOGGLE_SENSITIVITY(checkbtn_simplify_subject, left_arrow);
+ rowcount++;
+
+ /* Test result */
+ label_regexp_result = gtk_label_new(_("Result:"));
+ gtk_misc_set_alignment(GTK_MISC(label_regexp_result), 1, 0.5);
+ gtk_table_attach(GTK_TABLE(table), label_regexp_result, 0, 1,
+ rowcount, rowcount + 1, GTK_SHRINK | GTK_FILL, GTK_FILL, 0, 0);
+ SET_TOGGLE_SENSITIVITY(checkbtn_simplify_subject, label_regexp_result);
entry_regexp_test_result = gtk_entry_new();
- gtk_box_pack_end (GTK_BOX(hbox_regexp), entry_regexp_test_result, TRUE, TRUE, 0);
+ gtk_table_attach(GTK_TABLE(table), entry_regexp_test_result, 1, 2,
+ rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
SET_TOGGLE_SENSITIVITY(checkbtn_simplify_subject, entry_regexp_test_result);
gtk_editable_set_editable(GTK_EDITABLE(entry_regexp_test_result), FALSE);
}
folder_chmod_rec_checkbtn = gtk_check_button_new();
- gtk_table_attach(GTK_TABLE(table), folder_chmod_rec_checkbtn, 3, 4,
+ gtk_table_attach(GTK_TABLE(table), folder_chmod_rec_checkbtn, 2, 3,
rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
rowcount++;
gtkut_set_widget_bgcolor_rgb(folder_color_btn, item->prefs->color);
folder_color_rec_checkbtn = gtk_check_button_new();
- gtk_table_attach(GTK_TABLE(table), folder_color_rec_checkbtn, 3, 4,
+ gtk_table_attach(GTK_TABLE(table), folder_color_rec_checkbtn, 2, 3,
rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
rowcount++;
item->prefs->enable_processing);
enable_processing_rec_checkbtn = gtk_check_button_new();
- gtk_table_attach(GTK_TABLE(table), enable_processing_rec_checkbtn, 3, 4,
+ gtk_table_attach(GTK_TABLE(table), enable_processing_rec_checkbtn, 2, 3,
rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
rowcount++;
item->prefs->enable_processing_when_opening);
enable_processing_when_opening_rec_checkbtn = gtk_check_button_new();
- gtk_table_attach(GTK_TABLE(table), enable_processing_when_opening_rec_checkbtn, 3, 4,
+ gtk_table_attach(GTK_TABLE(table), enable_processing_when_opening_rec_checkbtn, 2, 3,
rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
rowcount++;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_newmailcheck),
item->prefs->newmailcheck);
newmailcheck_rec_checkbtn = gtk_check_button_new();
- gtk_table_attach(GTK_TABLE(table), newmailcheck_rec_checkbtn, 3, 4,
+ gtk_table_attach(GTK_TABLE(table), newmailcheck_rec_checkbtn, 2, 3,
rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
rowcount++;
rowcount, rowcount+1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
offlinesync_rec_checkbtn = gtk_check_button_new();
- gtk_table_attach(GTK_TABLE(table), offlinesync_rec_checkbtn, 3, 4,
+ gtk_table_attach(GTK_TABLE(table), offlinesync_rec_checkbtn, 2, 3,
rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
rowcount++;
hbox = gtk_hbox_new (FALSE, 8);
gtk_widget_show (hbox);
- gtk_table_attach(GTK_TABLE(table), hbox, 0, 4,
+ gtk_table_attach(GTK_TABLE(table), hbox, 0, 3,
rowcount, rowcount+1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
rowcount++;
hbox2 = gtk_hbox_new (FALSE, 8);
gtk_widget_show (hbox2);
- gtk_table_attach(GTK_TABLE(table), hbox2, 0, 4,
+ gtk_table_attach(GTK_TABLE(table), hbox2, 0, 3,
rowcount, rowcount+1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
rowcount++;
{
FolderItemPrefs *prefs = folder->prefs;
gchar *buf;
- gboolean all = FALSE;
+ gboolean all = FALSE, summary_update_needed = FALSE;
SpecialFolderItemType type = F_NORMAL;
+ FolderView *folderview = mainwindow_get_mainwindow()->folderview;
if (folder->path == NULL)
return;
type = combobox_get_active_data(GTK_COMBO_BOX(page->folder_type));
if (all && folder->stype != type && page->item->parent_stype == F_NORMAL) {
folder_item_change_type(folder, type);
+ summary_update_needed = TRUE;
}
#ifndef G_OS_WIN32
if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->simplify_subject_rec_checkbtn))) {
+ gboolean old_simplify_subject = prefs->enable_simplify_subject;
+ int regexp_diffs = strcmp2(prefs->simplify_subject_regexp, gtk_editable_get_chars(
+ GTK_EDITABLE(page->entry_simplify_subject), 0, -1));
prefs->enable_simplify_subject =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_simplify_subject));
ASSIGN_STRING(prefs->simplify_subject_regexp,
gtk_editable_get_chars(GTK_EDITABLE(page->entry_simplify_subject), 0, -1));
+ if (old_simplify_subject != prefs->enable_simplify_subject || regexp_diffs != 0)
+ summary_update_needed = TRUE;
}
#endif
if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->folder_chmod_rec_checkbtn))) {
}
folder_item_prefs_save_config(folder);
+
+ if (folder->opened && summary_update_needed) {
+ summary_set_prefs_from_folderitem(folderview->summaryview, folder);
+ summary_show(folderview->summaryview, folder);
+ }
}
static gboolean general_save_recurse_func(GNode *node, gpointer data)
GtkWidget *new_msg_format_rec_checkbtn;
GtkWidget *reply_format_rec_checkbtn;
GtkWidget *forward_format_rec_checkbtn;
-
+ GtkWidget *hbox;
+ GtkWidget *vbox_format;
+
page->item = item;
page_vbox = gtk_vbox_new (FALSE, 0);
FALSE, FALSE);
address_completion_register_entry(GTK_ENTRY(page->compose_override_from_format),
TRUE);
+
+ vbox_format = gtk_widget_get_parent(
+ gtk_widget_get_parent(page->compose_body_format));
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_end (GTK_BOX(vbox_format), hbox, FALSE, FALSE, 0);
+ quotefmt_add_info_button(window, hbox);
+
new_msg_format_rec_checkbtn = gtk_check_button_new_with_label(
_("Apply to subfolders"));
- gtk_box_pack_end (GTK_BOX(vbox), new_msg_format_rec_checkbtn, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX(hbox), new_msg_format_rec_checkbtn, FALSE, FALSE, 0);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, gtk_label_new(_("Compose")));
/* reply format */
address_completion_register_entry(GTK_ENTRY(page->reply_override_from_format),
TRUE);
+ vbox_format = gtk_widget_get_parent(
+ gtk_widget_get_parent(page->reply_body_format));
+
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_end (GTK_BOX(vbox_format), hbox, FALSE, FALSE, 0);
+ quotefmt_add_info_button(window, hbox);
+
reply_format_rec_checkbtn = gtk_check_button_new_with_label(
_("Apply to subfolders"));
- gtk_box_pack_end (GTK_BOX(vbox), reply_format_rec_checkbtn, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX(hbox), reply_format_rec_checkbtn, FALSE, FALSE, 0);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, gtk_label_new(_("Reply")));
/* forward format */
address_completion_register_entry(GTK_ENTRY(page->forward_override_from_format),
TRUE);
+ vbox_format = gtk_widget_get_parent(
+ gtk_widget_get_parent(page->forward_body_format));
+
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_end (GTK_BOX(vbox_format), hbox, FALSE, FALSE, 0);
+ quotefmt_add_info_button(window, hbox);
+
forward_format_rec_checkbtn = gtk_check_button_new_with_label(
_("Apply to subfolders"));
- gtk_box_pack_end (GTK_BOX(vbox), forward_format_rec_checkbtn, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX(hbox), forward_format_rec_checkbtn, FALSE, FALSE, 0);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, gtk_label_new(_("Forward")));
- /* information button */
- quotefmt_add_info_button(window, page_vbox);
-
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(page->checkbtn_compose_with_format),
item->prefs->compose_with_format);
pref_set_entry_from_pref(GTK_ENTRY(page->compose_override_from_format),
static void folder_regexp_test_cb(GtkWidget *widget, gpointer data)
{
+#if !GTK_CHECK_VERSION(3, 0, 0)
static GdkColor red;
static gboolean colors_initialised = FALSE;
+#else
+ static GdkColor red = { (guint32)0, (guint16)0xff, (guint16)0x70, (guint16)0x70 };
+#endif
static gchar buf[BUFFSIZE];
FolderItemGeneralPage *page = (FolderItemGeneralPage *)data;
gchar *test_string, *regexp;
return;
}
+#if !GTK_CHECK_VERSION(3, 0, 0)
if (!colors_initialised) {
gdk_color_parse("#ff7070", &red);
colors_initialised = gdk_colormap_alloc_color(
gdk_colormap_get_system(), &red, FALSE, TRUE);
}
+#endif
preg = summary_compile_simplify_regexp(regexp);
- if (colors_initialised) {
+#if !GTK_CHECK_VERSION(3, 0, 0)
+ if (colors_initialised)
gtk_widget_modify_base(page->entry_simplify_subject,
GTK_STATE_NORMAL, preg ? NULL : &red);
- }
+#endif
if (preg != NULL) {
string_remove_match(buf, BUFFSIZE, test_string, preg);