#include <glib.h>
#include <glib/gi18n.h>
#include "folder.h"
+#include "alertpanel.h"
#include "prefs_folder_item.h"
#include "folderview.h"
#include "folder.h"
#include "gtk/colorsel.h"
#include "string_match.h"
#include "quote_fmt.h"
+#include "combobox.h"
#if USE_ASPELL
#include "gtkaspell.h"
string = (value); \
}
+static void prefs_folder_item_register_page (PrefsPage *page);
+static void prefs_folder_item_unregister_page (PrefsPage *page);
+
typedef struct _FolderItemGeneralPage FolderItemGeneralPage;
typedef struct _FolderItemComposePage FolderItemComposePage;
typedef struct _FolderItemTemplatesPage FolderItemTemplatesPage;
GtkWidget *checkbtn_enable_processing;
GtkWidget *checkbtn_newmailcheck;
GtkWidget *checkbtn_offlinesync;
-
+ GtkWidget *label_offlinesync;
+ GtkWidget *entry_offlinesync;
+ GtkWidget *label_end_offlinesync;
+ GtkWidget *checkbtn_remove_old_offlinesync;
+
/* apply to sub folders */
GtkWidget *simplify_subject_rec_checkbtn;
GtkWidget *folder_chmod_rec_checkbtn;
#if USE_ASPELL
GtkWidget *checkbtn_enable_default_dictionary;
GtkWidget *checkbtn_enable_default_alt_dictionary;
- GtkWidget *optmenu_default_dictionary;
- GtkWidget *optmenu_default_alt_dictionary;
+ GtkWidget *combo_default_dictionary;
+ GtkWidget *combo_default_alt_dictionary;
#endif
/* apply to sub folders */
static gint prefs_folder_item_chmod_mode (gchar *folder_chmod);
static void folder_color_set_dialog(GtkWidget *widget, gpointer data);
+static void clean_cache_cb(GtkWidget *widget, gpointer data);
static void folder_regexp_test_cb(GtkWidget *widget, gpointer data);
static void folder_regexp_set_subject_example_cb(GtkWidget *widget, gpointer data);
guint rowcount;
GtkWidget *table;
- GtkWidget *hbox;
+ GtkWidget *hbox, *hbox2, *hbox_spc;
GtkWidget *label;
- GtkWidget *folder_type_menu;
+ GtkListStore *folder_type_menu;
GtkWidget *folder_type;
- GtkWidget *dummy_checkbtn;
- GtkWidget *menuitem;
+ GtkTreeIter iter;
+ GtkWidget *dummy_checkbtn, *clean_cache_btn;
SpecialFolderItemType type;
GtkWidget *no_save_warning = NULL;
GtkWidget *checkbtn_enable_processing;
GtkWidget *checkbtn_newmailcheck;
GtkWidget *checkbtn_offlinesync;
+ GtkWidget *label_offlinesync;
+ GtkWidget *entry_offlinesync;
+ GtkWidget *label_end_offlinesync;
+ GtkWidget *checkbtn_remove_old_offlinesync;
GtkWidget *simplify_subject_rec_checkbtn;
GtkWidget *folder_chmod_rec_checkbtn;
GtkWidget *offlinesync_rec_checkbtn;
GtkTooltips *tooltips;
+ tooltips = gtk_tooltips_new();
page->item = item;
/* Table */
- table = gtk_table_new(7, 4, FALSE);
+ table = gtk_table_new(10, 4, 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);
rowcount++;
/* folder_type */
- folder_type = gtk_option_menu_new ();
+ folder_type = gtkut_sc_combobox_create(NULL, FALSE);
gtk_widget_show (folder_type);
type = F_NORMAL;
else if (folder_has_parent_of_type(item, F_TRASH))
type = F_TRASH;
- folder_type_menu = gtk_menu_new ();
+ folder_type_menu = GTK_LIST_STORE(gtk_combo_box_get_model(
+ GTK_COMBO_BOX(folder_type)));
- MENUITEM_ADD (folder_type_menu, menuitem, _("Normal"), F_NORMAL);
- MENUITEM_ADD (folder_type_menu, menuitem, _("Inbox"), F_INBOX);
- MENUITEM_ADD (folder_type_menu, menuitem, _("Outbox"), F_OUTBOX);
- MENUITEM_ADD (folder_type_menu, menuitem, _("Drafts"), F_DRAFT);
- MENUITEM_ADD (folder_type_menu, menuitem, _("Queue"), F_QUEUE);
- MENUITEM_ADD (folder_type_menu, menuitem, _("Trash"), F_TRASH);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (folder_type), folder_type_menu);
+ COMBOBOX_ADD (folder_type_menu, _("Normal"), F_NORMAL);
+ COMBOBOX_ADD (folder_type_menu, _("Inbox"), F_INBOX);
+ COMBOBOX_ADD (folder_type_menu, _("Outbox"), F_OUTBOX);
+ COMBOBOX_ADD (folder_type_menu, _("Drafts"), F_DRAFT);
+ COMBOBOX_ADD (folder_type_menu, _("Queue"), F_QUEUE);
+ COMBOBOX_ADD (folder_type_menu, _("Trash"), F_TRASH);
- gtk_option_menu_set_history(GTK_OPTION_MENU(folder_type), type);
+ combobox_select_by_data(GTK_COMBO_BOX(folder_type), type);
dummy_checkbtn = gtk_check_button_new();
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dummy_checkbtn), type != F_INBOX);
folder_color_btn = gtk_button_new_with_label("");
gtk_widget_set_size_request(folder_color_btn, 36, 26);
gtk_box_pack_start (GTK_BOX(hbox), folder_color_btn, FALSE, FALSE, 0);
- tooltips = gtk_tooltips_new();
gtk_tooltips_set_tip(tooltips, folder_color_btn,
_("Pick color for folder"), NULL);
/* Check folder for new mail */
checkbtn_newmailcheck = gtk_check_button_new_with_label(_("Scan for new mail"));
+ gtk_tooltips_set_tip(tooltips, checkbtn_newmailcheck,
+ _("Turn this option on if mail is delivered directly "
+ "to this folder by server side filtering on IMAP or "
+ "by an external application"), NULL);
gtk_table_attach(GTK_TABLE(table), checkbtn_newmailcheck, 0, 2,
rowcount, rowcount+1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
gtk_table_attach(GTK_TABLE(table), offlinesync_rec_checkbtn, 3, 4,
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,
+ rowcount, rowcount+1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
+ rowcount++;
+
+ hbox_spc = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox_spc);
+ gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
+ gtk_widget_set_size_request (hbox_spc, 12, -1);
+
+ label_offlinesync = gtk_label_new(_("Fetch message bodies from the last"));
+ gtk_widget_show (label_offlinesync);
+ gtk_box_pack_start (GTK_BOX (hbox), label_offlinesync, FALSE, FALSE, 0);
+
+ entry_offlinesync = gtk_entry_new();
+ gtk_widget_set_size_request (entry_offlinesync, 64, -1);
+ gtk_widget_show (entry_offlinesync);
+ gtk_tooltips_set_tip(tooltips, entry_offlinesync, _("0: all bodies"), NULL);
+ gtk_box_pack_start (GTK_BOX (hbox), entry_offlinesync, FALSE, FALSE, 0);
+
+ label_end_offlinesync = gtk_label_new(_("days"));
+ gtk_widget_show (label_end_offlinesync);
+ gtk_box_pack_start (GTK_BOX (hbox), label_end_offlinesync, FALSE, FALSE, 0);
+
+ checkbtn_remove_old_offlinesync = gtk_check_button_new_with_label(
+ _("Remove older messages bodies"));
+
+ hbox2 = gtk_hbox_new (FALSE, 8);
+ gtk_widget_show (hbox2);
+ gtk_table_attach(GTK_TABLE(table), hbox2, 0, 4,
+ rowcount, rowcount+1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
+ rowcount++;
+
+ hbox_spc = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (hbox_spc);
+ gtk_box_pack_start (GTK_BOX (hbox2), hbox_spc, FALSE, FALSE, 0);
+ gtk_widget_set_size_request (hbox_spc, 12, -1);
+ gtk_box_pack_start (GTK_BOX (hbox2), checkbtn_remove_old_offlinesync, FALSE, FALSE, 0);
+
+ SET_TOGGLE_SENSITIVITY (checkbtn_offlinesync, hbox);
+ SET_TOGGLE_SENSITIVITY (checkbtn_offlinesync, hbox2);
+
+ clean_cache_btn = gtk_button_new_with_label(_("Discard folder cache"));
+ gtk_widget_show (clean_cache_btn);
+ gtk_table_attach(GTK_TABLE(table), clean_cache_btn, 0, 1,
+ rowcount, rowcount+1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
+ g_signal_connect(G_OBJECT(clean_cache_btn), "clicked",
+ G_CALLBACK(clean_cache_cb),
+ page);
+
+ gtk_widget_show_all(table);
+
if (item->folder && (item->folder->klass->type != F_IMAP &&
item->folder->klass->type != F_NEWS)) {
- item->prefs->offlinesync = TRUE;
+ item->prefs->offlinesync = TRUE;
+ item->prefs->offlinesync_days = 0;
+ item->prefs->remove_old_bodies = FALSE;
+
gtk_widget_set_sensitive(GTK_WIDGET(checkbtn_offlinesync),
FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(offlinesync_rec_checkbtn),
FALSE);
+ gtk_widget_hide(GTK_WIDGET(checkbtn_offlinesync));
+ gtk_widget_hide(GTK_WIDGET(hbox));
+ gtk_widget_hide(GTK_WIDGET(hbox2));
+ gtk_widget_hide(GTK_WIDGET(offlinesync_rec_checkbtn));
+ gtk_widget_hide(GTK_WIDGET(clean_cache_btn));
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_offlinesync),
item->prefs->offlinesync);
- rowcount++;
-
- gtk_widget_show_all(table);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_remove_old_offlinesync),
+ item->prefs->remove_old_bodies);
+ gtk_entry_set_text(GTK_ENTRY(entry_offlinesync), itos(item->prefs->offlinesync_days));
page->table = table;
page->folder_type = folder_type;
page->checkbtn_enable_processing = checkbtn_enable_processing;
page->checkbtn_newmailcheck = checkbtn_newmailcheck;
page->checkbtn_offlinesync = checkbtn_offlinesync;
+ page->label_offlinesync = label_offlinesync;
+ page->entry_offlinesync = entry_offlinesync;
+ page->label_end_offlinesync = label_end_offlinesync;
+ page->checkbtn_remove_old_offlinesync = checkbtn_remove_old_offlinesync;
page->simplify_subject_rec_checkbtn = simplify_subject_rec_checkbtn;
page->folder_chmod_rec_checkbtn = folder_chmod_rec_checkbtn;
gchar *buf;
gboolean all = FALSE;
SpecialFolderItemType type = F_NORMAL;
- GtkWidget *menu;
- GtkWidget *menuitem;
if (folder->path == NULL)
return;
if (page->item == folder)
all = TRUE;
- menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->folder_type));
- menuitem = gtk_menu_get_active(GTK_MENU(menu));
- type = GPOINTER_TO_INT
- (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
+ type = combobox_get_active_data(GTK_COMBO_BOX(page->folder_type));
if (all && folder->stype != type) {
folder_item_change_type(folder, type);
}
if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->offlinesync_rec_checkbtn))) {
prefs->offlinesync =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_offlinesync));
+ prefs->offlinesync_days =
+ atoi(gtk_entry_get_text(GTK_ENTRY(page->entry_offlinesync)));
+ prefs->remove_old_bodies =
+ gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_remove_old_offlinesync));
}
folder_item_prefs_save_config(folder);
GtkWidget *entry_default_reply_to = NULL;
GtkWidget *checkbtn_enable_default_account = NULL;
GtkWidget *optmenu_default_account = NULL;
- GtkWidget *optmenu_default_account_menu = NULL;
- GtkWidget *optmenu_default_account_menuitem = NULL;
+ GtkListStore *optmenu_default_account_menu = NULL;
+ GtkTreeIter iter;
#if USE_ASPELL
GtkWidget *checkbtn_enable_default_dictionary = NULL;
- GtkWidget *optmenu_default_dictionary = NULL;
+ GtkWidget *combo_default_dictionary = NULL;
GtkWidget *checkbtn_enable_default_alt_dictionary = NULL;
- GtkWidget *optmenu_default_alt_dictionary = NULL;
+ GtkWidget *combo_default_alt_dictionary = NULL;
+ GtkWidget *default_dictionary_rec_checkbtn = NULL;
+ GtkWidget *default_alt_dictionary_rec_checkbtn = NULL;
+ gchar *dictionary;
#endif
GtkWidget *request_return_receipt_rec_checkbtn = NULL;
GtkWidget *save_copy_to_folder_rec_checkbtn = NULL;
GtkWidget *default_to_rec_checkbtn = NULL;
GtkWidget *default_reply_to_rec_checkbtn = NULL;
GtkWidget *default_account_rec_checkbtn = NULL;
-#if USE_ASPELL
- GtkWidget *default_dictionary_rec_checkbtn = NULL;
- GtkWidget *default_alt_dictionary_rec_checkbtn = NULL;
-#endif
GList *cur_ac;
GList *account_list;
-#if USE_ASPELL
- gchar *dictionary;
-#endif
PrefsAccount *ac_prefs;
- GtkOptionMenu *optmenu;
- GtkWidget *menu;
- GtkWidget *menuitem;
- gint account_index, index;
+ gboolean default_account_set = FALSE;
page->item = item;
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_default_account),
item->prefs->enable_default_account);
- optmenu_default_account = gtk_option_menu_new ();
+ optmenu_default_account = gtkut_sc_combobox_create(NULL, FALSE);
gtk_table_attach(GTK_TABLE(table), optmenu_default_account, 1, 2,
rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
- optmenu_default_account_menu = gtk_menu_new ();
+ optmenu_default_account_menu = GTK_LIST_STORE(
+ gtk_combo_box_get_model(GTK_COMBO_BOX(optmenu_default_account)));
account_list = account_get_list();
- account_index = 0;
- index = 0;
for (cur_ac = account_list; cur_ac != NULL; cur_ac = cur_ac->next) {
ac_prefs = (PrefsAccount *)cur_ac->data;
if (item->folder->account &&
if (item->folder->klass->type != F_NEWS && ac_prefs->protocol == A_NNTP)
continue;
- MENUITEM_ADD (optmenu_default_account_menu, optmenu_default_account_menuitem,
+ COMBOBOX_ADD (optmenu_default_account_menu,
ac_prefs->account_name?ac_prefs->account_name : _("Untitled"),
ac_prefs->account_id);
- /* get the index for menu's set_history (sad method?) */
- if (ac_prefs->account_id == item->prefs->default_account)
- account_index = index;
- index++;
- }
-
- optmenu = GTK_OPTION_MENU(optmenu_default_account);
- gtk_option_menu_set_menu(optmenu, optmenu_default_account_menu);
- gtk_option_menu_set_history(optmenu, account_index);
+ /* Set combobox to current default account id */
+ if (ac_prefs->account_id == item->prefs->default_account) {
+ combobox_select_by_data(GTK_COMBO_BOX(optmenu_default_account),
+ ac_prefs->account_id);
+ default_account_set = TRUE;
+ }
+ }
- menu = gtk_option_menu_get_menu(optmenu);
- menuitem = gtk_menu_get_active(GTK_MENU(menu));
- gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
+ /* If nothing has been set (folder doesn't have a default account set),
+ * pre-select global default account, since that's what actually used
+ * anyway. We don't want nothing selected in combobox. */
+ if( !default_account_set )
+ combobox_select_by_data(GTK_COMBO_BOX(optmenu_default_account),
+ account_get_default()->account_id);
SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_account, optmenu_default_account);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_default_dictionary),
item->prefs->enable_default_dictionary);
- optmenu_default_dictionary = gtk_option_menu_new();
- gtk_table_attach(GTK_TABLE(table), optmenu_default_dictionary, 1, 2,
+ combo_default_dictionary = gtkaspell_dictionary_combo_new(
+ prefs_common.aspell_path, TRUE);
+ gtk_table_attach(GTK_TABLE(table), combo_default_dictionary, 1, 2,
rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
- gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_default_dictionary),
- gtkaspell_dictionary_option_menu_new(
- prefs_common.aspell_path));
-
dictionary = item->prefs->default_dictionary;
-
- optmenu = GTK_OPTION_MENU(optmenu_default_dictionary);
-
- menu = gtk_option_menu_get_menu(optmenu);
if (dictionary)
- gtkaspell_set_dictionary_menu_active_item(optmenu_default_dictionary, dictionary);
- menuitem = gtk_menu_get_active(GTK_MENU(menu));
- gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
+ gtkaspell_set_dictionary_menu_active_item(
+ GTK_COMBO_BOX(combo_default_dictionary), dictionary);
- SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_dictionary, optmenu_default_dictionary);
+ SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_dictionary, combo_default_dictionary);
default_dictionary_rec_checkbtn = gtk_check_button_new();
gtk_table_attach(GTK_TABLE(table), default_dictionary_rec_checkbtn, 2, 3,
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_default_alt_dictionary),
item->prefs->enable_default_alt_dictionary);
- optmenu_default_alt_dictionary = gtk_option_menu_new();
- gtk_table_attach(GTK_TABLE(table), optmenu_default_alt_dictionary, 1, 2,
+ combo_default_alt_dictionary = gtkaspell_dictionary_combo_new(
+ prefs_common.aspell_path, FALSE);
+ gtk_table_attach(GTK_TABLE(table), combo_default_alt_dictionary, 1, 2,
rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
- gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_default_alt_dictionary),
- gtkaspell_dictionary_option_menu_new_with_refresh(
- prefs_common.aspell_path, FALSE));
-
dictionary = item->prefs->default_alt_dictionary;
-
- optmenu = GTK_OPTION_MENU(optmenu_default_alt_dictionary);
-
- menu = gtk_option_menu_get_menu(optmenu);
if (dictionary)
- gtkaspell_set_dictionary_menu_active_item(optmenu_default_alt_dictionary, dictionary);
- menuitem = gtk_menu_get_active(GTK_MENU(menu));
- gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
+ gtkaspell_set_dictionary_menu_active_item(
+ GTK_COMBO_BOX(combo_default_alt_dictionary), dictionary);
- SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_alt_dictionary, optmenu_default_alt_dictionary);
+ SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_alt_dictionary, combo_default_alt_dictionary);
default_alt_dictionary_rec_checkbtn = gtk_check_button_new();
gtk_table_attach(GTK_TABLE(table), default_alt_dictionary_rec_checkbtn, 2, 3,
page->optmenu_default_account = optmenu_default_account;
#ifdef USE_ASPELL
page->checkbtn_enable_default_dictionary = checkbtn_enable_default_dictionary;
- page->optmenu_default_dictionary = optmenu_default_dictionary;
+ page->combo_default_dictionary = combo_default_dictionary;
page->checkbtn_enable_default_alt_dictionary = checkbtn_enable_default_alt_dictionary;
- page->optmenu_default_alt_dictionary = optmenu_default_alt_dictionary;
+ page->combo_default_alt_dictionary = combo_default_alt_dictionary;
#endif
page->request_return_receipt_rec_checkbtn = request_return_receipt_rec_checkbtn;
static void compose_save_folder_prefs(FolderItem *folder, FolderItemComposePage *page)
{
FolderItemPrefs *prefs = folder->prefs;
- GtkWidget *menu;
- GtkWidget *menuitem;
+
gboolean all = FALSE;
if (folder->path == NULL)
prefs->enable_default_to = FALSE;
prefs->enable_default_reply_to = FALSE;
}
- if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_account_rec_checkbtn))) {
+
+ if (all || gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(page->default_account_rec_checkbtn))) {
prefs->enable_default_account =
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_enable_default_account));
- menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->optmenu_default_account));
- menuitem = gtk_menu_get_active(GTK_MENU(menu));
- prefs->default_account = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
+ gtk_toggle_button_get_active(
+ GTK_TOGGLE_BUTTON(page->checkbtn_enable_default_account));
+ prefs->default_account = combobox_get_active_data(
+ GTK_COMBO_BOX(page->optmenu_default_account));
}
#if USE_ASPELL
if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_dictionary_rec_checkbtn))) {
prefs->enable_default_dictionary =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_enable_default_dictionary));
- menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->optmenu_default_dictionary));
ASSIGN_STRING(prefs->default_dictionary,
- gtkaspell_get_dictionary_menu_active_item(menu));
+ gtkaspell_get_dictionary_menu_active_item(
+ GTK_COMBO_BOX(page->combo_default_dictionary)));
}
if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_alt_dictionary_rec_checkbtn))) {
prefs->enable_default_alt_dictionary =
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_enable_default_alt_dictionary));
- menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->optmenu_default_alt_dictionary));
ASSIGN_STRING(prefs->default_alt_dictionary,
- gtkaspell_get_dictionary_menu_active_item(menu));
+ gtkaspell_get_dictionary_menu_active_item(
+ GTK_COMBO_BOX(page->combo_default_alt_dictionary)));
}
#endif
FolderItemTemplatesPage *page = (FolderItemTemplatesPage *) page_;
FolderItem *item = (FolderItem *) data;
- GtkWidget *table;
- GtkWidget *label;
- guint rowcount;
+ GtkWidget *notebook;
GtkWidget *vbox;
- GtkWidget *alignment;
+ GtkWidget *page_vbox;
GtkWidget *new_msg_format_rec_checkbtn;
GtkWidget *reply_format_rec_checkbtn;
GtkWidget *forward_format_rec_checkbtn;
- page->item = item;
+ page->item = item;
- /* Table */
- table = gtk_table_new(5, 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);
- rowcount = 0;
-
- /* 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, 2, 3,
- rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
- rowcount++;
+ page_vbox = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (page_vbox);
+
+ /* Notebook */
+ notebook = gtk_notebook_new();
+ gtk_widget_show(notebook);
+ gtk_notebook_set_homogeneous_tabs(GTK_NOTEBOOK(notebook), TRUE);
+ gtk_box_pack_start(GTK_BOX(page_vbox), notebook, TRUE, TRUE, 0);
/* compose format */
vbox = gtk_vbox_new (FALSE, VSPACING);
gtk_widget_show (vbox);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
- gtk_table_attach(GTK_TABLE(table), vbox, 1, 2,
- rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), VBOX_BORDER);
quotefmt_create_new_msg_fmt_widgets(
window,
vbox,
&page->checkbtn_compose_with_format,
- _("Use a specific format for new messages"),
&page->compose_subject_format,
&page->compose_body_format,
FALSE);
- vbox = gtk_vbox_new (FALSE, VSPACING);
- gtk_widget_show (vbox);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
- gtk_table_attach(GTK_TABLE(table), vbox, 2, 3,
- rowcount, rowcount + 1, GTK_SHRINK, GTK_FILL, 0, 0);
-
- new_msg_format_rec_checkbtn = gtk_check_button_new();
- gtk_box_pack_start (GTK_BOX(vbox), new_msg_format_rec_checkbtn, FALSE, FALSE, 0);
- alignment = gtk_alignment_new(0, 1, 0, 0);
- gtk_box_pack_start (GTK_BOX(vbox), alignment, FALSE, FALSE, 0);
-
- rowcount++;
+ 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_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, gtk_label_new(_("Compose")));
/* reply format */
vbox = gtk_vbox_new (FALSE, VSPACING);
gtk_widget_show (vbox);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
- gtk_table_attach(GTK_TABLE(table), vbox, 1, 2,
- rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), VBOX_BORDER);
quotefmt_create_reply_fmt_widgets(
window,
vbox,
&page->checkbtn_reply_with_format,
- _("Use a specific reply quote format"),
&page->reply_quotemark,
&page->reply_body_format,
FALSE);
- vbox = gtk_vbox_new (FALSE, VSPACING);
- gtk_widget_show (vbox);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
- gtk_table_attach(GTK_TABLE(table), vbox, 2, 3,
- rowcount, rowcount + 1, GTK_SHRINK, GTK_FILL, 0, 0);
-
- reply_format_rec_checkbtn = gtk_check_button_new();
- gtk_box_pack_start (GTK_BOX(vbox), reply_format_rec_checkbtn, FALSE, FALSE, 0);
- alignment = gtk_alignment_new(0, 1, 0, 0);
- gtk_box_pack_start (GTK_BOX(vbox), alignment, FALSE, FALSE, 0);
-
- rowcount++;
+ 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_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, gtk_label_new(_("Reply")));
/* forward format */
vbox = gtk_vbox_new (FALSE, VSPACING);
gtk_widget_show (vbox);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
- gtk_table_attach(GTK_TABLE(table), vbox, 1, 2,
- rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), VBOX_BORDER);
quotefmt_create_forward_fmt_widgets(
window,
vbox,
&page->checkbtn_forward_with_format,
- _("Use a specific forward quote format"),
&page->forward_quotemark,
&page->forward_body_format,
FALSE);
- vbox = gtk_vbox_new (FALSE, VSPACING);
- gtk_widget_show (vbox);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
- gtk_table_attach(GTK_TABLE(table), vbox, 2, 3,
- rowcount, rowcount + 1, GTK_SHRINK, GTK_FILL, 0, 0);
-
- forward_format_rec_checkbtn = gtk_check_button_new();
- gtk_box_pack_start (GTK_BOX(vbox), forward_format_rec_checkbtn, FALSE, FALSE, 0);
- alignment = gtk_alignment_new(0, 1, 0, 0);
- gtk_box_pack_start (GTK_BOX(vbox), alignment, FALSE, FALSE, 0);
-
- rowcount++;
+ 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_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, gtk_label_new(_("Forward")));
/* information button */
- vbox = gtk_vbox_new (FALSE, VSPACING);
- gtk_widget_show (vbox);
- gtk_container_set_border_width (GTK_CONTAINER (vbox), 0);
- gtk_table_attach(GTK_TABLE(table), vbox, 1, 2,
- rowcount, rowcount + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
- rowcount++;
- quotefmt_add_info_button(window, vbox);
-
+ 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_textview_from_pref(GTK_TEXT_VIEW(page->forward_body_format),
item->prefs->forward_body_format);
- gtk_widget_show_all(table);
+ gtk_widget_show_all(page_vbox);
page->window = GTK_WIDGET(window);
- page->table = table;
page->new_msg_format_rec_checkbtn = new_msg_format_rec_checkbtn;
page->reply_format_rec_checkbtn = reply_format_rec_checkbtn;
page->forward_format_rec_checkbtn = forward_format_rec_checkbtn;
- page->page.widget = table;
+ page->page.widget = page_vbox;
}
static void prefs_folder_item_templates_destroy_widget_func(PrefsPage *page_)
page->folder_color = rgbcolor;
}
+static void clean_cache_cb(GtkWidget *widget, gpointer data)
+{
+ FolderItemGeneralPage *page = (FolderItemGeneralPage *) data;
+ FolderItem *item = page->item;
+ gboolean was_open = FALSE;
+ FolderView *folderview = NULL;
+
+ if (alertpanel_full(_("Discard cache"),
+ _("Do you really want to discard the local cached "
+ "data for this folder?"),
+ GTK_STOCK_CANCEL, _("+Discard"), NULL, FALSE,
+ NULL, ALERT_WARNING, G_ALERTDEFAULT)
+ != G_ALERTALTERNATE)
+ return;
+
+ if (mainwindow_get_mainwindow())
+ folderview = mainwindow_get_mainwindow()->folderview;
+
+ if (folderview && item->opened) {
+ folderview_close_opened(folderview);
+ was_open = TRUE;
+ }
+ folder_item_discard_cache(item);
+ if (was_open)
+ folderview_select(folderview,item);
+}
+
static regex_t *summary_compile_simplify_regexp(gchar *simplify_subject_regexp)
{
int err;
static void register_general_page()
{
- static gchar *pfi_general_path[2];
+ static gchar *pfi_general_path[3];
static FolderItemGeneralPage folder_item_general_page;
- pfi_general_path[0] = _("General");
- pfi_general_path[1] = NULL;
+ pfi_general_path[0] = _("Folder");
+ pfi_general_path[1] = _("General");
+ pfi_general_path[2] = NULL;
folder_item_general_page.page.path = pfi_general_path;
folder_item_general_page.page.create_widget = prefs_folder_item_general_create_widget_func;
static void register_compose_page(void)
{
- static gchar *pfi_compose_path[2];
+ static gchar *pfi_compose_path[3];
static FolderItemComposePage folder_item_compose_page;
- pfi_compose_path[0] = _("Compose");
- pfi_compose_path[1] = NULL;
+ pfi_compose_path[0] = _("Folder");
+ pfi_compose_path[1] = _("Compose");
+ pfi_compose_path[2] = NULL;
folder_item_compose_page.page.path = pfi_compose_path;
folder_item_compose_page.page.create_widget = prefs_folder_item_compose_create_widget_func;
static void register_templates_page(void)
{
- static gchar *pfi_templates_path[2];
+ static gchar *pfi_templates_path[3];
static FolderItemTemplatesPage folder_item_templates_page;
- pfi_templates_path[0] = _("Templates");
- pfi_templates_path[1] = NULL;
+ pfi_templates_path[0] = _("Folder");
+ pfi_templates_path[1] = _("Templates");
+ pfi_templates_path[2] = NULL;
folder_item_templates_page.page.path = pfi_templates_path;
folder_item_templates_page.page.create_widget = prefs_folder_item_templates_create_widget_func;
g_free (title);
}
-void prefs_folder_item_register_page(PrefsPage *page)
+static void prefs_folder_item_register_page(PrefsPage *page)
{
prefs_pages = g_slist_append(prefs_pages, page);
}
-void prefs_folder_item_unregister_page(PrefsPage *page)
+static void prefs_folder_item_unregister_page(PrefsPage *page)
{
prefs_pages = g_slist_remove(prefs_pages, page);
}