/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws team
+ * Copyright (C) 1999-2006 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
typedef struct _FolderItemGeneralPage FolderItemGeneralPage;
typedef struct _FolderItemComposePage FolderItemComposePage;
+static gboolean can_save = TRUE;
struct _FolderItemGeneralPage
{
FolderItem *item;
GtkWidget *table;
+ GtkWidget *no_save_warning;
GtkWidget *folder_type;
GtkWidget *checkbtn_simplify_subject;
GtkWidget *entry_simplify_subject;
GtkWidget *window;
GtkWidget *table;
+ GtkWidget *no_save_warning;
GtkWidget *checkbtn_request_return_receipt;
GtkWidget *checkbtn_save_copy_to_folder;
GtkWidget *checkbtn_default_to;
GtkWidget *optmenu_default_account;
#if USE_ASPELL
GtkWidget *checkbtn_enable_default_dictionary;
+ GtkWidget *checkbtn_enable_default_alt_dictionary;
GtkWidget *optmenu_default_dictionary;
+ GtkWidget *optmenu_default_alt_dictionary;
#endif
/* apply to sub folders */
GtkWidget *default_account_rec_checkbtn;
#if USE_ASPELL
GtkWidget *default_dictionary_rec_checkbtn;
+ GtkWidget *default_alt_dictionary_rec_checkbtn;
#endif
};
GtkWidget *menuitem;
SpecialFolderItemType type;
+ GtkWidget *no_save_warning = NULL;
GtkWidget *checkbtn_simplify_subject;
GtkWidget *entry_simplify_subject;
GtkWidget *hbox_regexp;
page->item = item;
/* Table */
- table = gtk_table_new(6, 2, FALSE);
+ table = gtk_table_new(7, 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 = 0;
+ if (!can_save) {
+ no_save_warning = gtk_label_new(
+ _("<i>These preferences will not be saved as this folder "
+ "is a top-level one. However you can use them to set them "
+ "to the whole mailbox tree using \"Apply to subfolders\".</i>"));
+ 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,
+ 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);
page->table = table;
page->folder_type = folder_type;
+ page->no_save_warning = no_save_warning;
page->checkbtn_simplify_subject = checkbtn_simplify_subject;
page->entry_simplify_subject = entry_simplify_subject;
page->entry_regexp_test_string = entry_regexp_test_string;
GtkWidget *table;
GtkWidget *label;
+ GtkWidget *no_save_warning = NULL;
GtkWidget *checkbtn_request_return_receipt = NULL;
GtkWidget *checkbtn_save_copy_to_folder = NULL;
GtkWidget *checkbtn_default_to = NULL;
#if USE_ASPELL
GtkWidget *checkbtn_enable_default_dictionary = NULL;
GtkWidget *optmenu_default_dictionary = NULL;
+ GtkWidget *checkbtn_enable_default_alt_dictionary = NULL;
+ GtkWidget *optmenu_default_alt_dictionary = NULL;
#endif
GtkWidget *request_return_receipt_rec_checkbtn = NULL;
GtkWidget *save_copy_to_folder_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;
/* Table */
#if USE_ASPELL
-# define TABLEHEIGHT 6
+# define TABLEHEIGHT 7
#else
-# define TABLEHEIGHT 5
+# define TABLEHEIGHT 6
#endif
- table = gtk_table_new(TABLEHEIGHT, 2, FALSE);
+ table = gtk_table_new(TABLEHEIGHT, 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;
+ if (!can_save) {
+ no_save_warning = gtk_label_new(
+ _("<i>These preferences will not be saved as this folder "
+ "is a top-level one. However you can use them to set them "
+ "to the whole mailbox tree using \"Apply to subfolders\".</i>"));
+ 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, 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);
rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
rowcount++;
+
+ /* Default dictionary */
+ checkbtn_enable_default_alt_dictionary = gtk_check_button_new_with_label(_("Default alternate dictionary: "));
+ gtk_table_attach(GTK_TABLE(table), checkbtn_enable_default_alt_dictionary, 0, 1,
+ rowcount, rowcount + 1, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
+ 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,
+ 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));
+
+ SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_alt_dictionary, optmenu_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,
+ rowcount, rowcount + 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
+
+ rowcount++;
#endif
gtk_widget_show_all(table);
page->window = GTK_WIDGET(window);
page->table = table;
+ page->no_save_warning = no_save_warning;
page->checkbtn_request_return_receipt = checkbtn_request_return_receipt;
page->checkbtn_save_copy_to_folder = checkbtn_save_copy_to_folder;
page->checkbtn_default_to = checkbtn_default_to;
#ifdef USE_ASPELL
page->checkbtn_enable_default_dictionary = checkbtn_enable_default_dictionary;
page->optmenu_default_dictionary = optmenu_default_dictionary;
+ page->checkbtn_enable_default_alt_dictionary = checkbtn_enable_default_alt_dictionary;
+ page->optmenu_default_alt_dictionary = optmenu_default_alt_dictionary;
#endif
page->request_return_receipt_rec_checkbtn = request_return_receipt_rec_checkbtn;
page->default_account_rec_checkbtn = default_account_rec_checkbtn;
#if USE_ASPELL
page->default_dictionary_rec_checkbtn = default_dictionary_rec_checkbtn;
+ page->default_alt_dictionary_rec_checkbtn = default_alt_dictionary_rec_checkbtn;
#endif
address_completion_start(page->window);
ASSIGN_STRING(prefs->default_dictionary,
gtkaspell_get_dictionary_menu_active_item(menu));
}
+ 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));
+ }
#endif
folder_item_prefs_save_config(folder);
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_account_rec_checkbtn)) ||
#if USE_ASPELL
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_dictionary_rec_checkbtn)) ||
+ gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_alt_dictionary_rec_checkbtn)) ||
#endif
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_reply_to_rec_checkbtn))))
return TRUE;
-
- if ((node == page->item->node) &&
+ else if ((node == page->item->node) && item_protocol(item) == A_NNTP &&
!(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_account_rec_checkbtn))
#if USE_ASPELL
|| gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_dictionary_rec_checkbtn))
+ || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->default_alt_dictionary_rec_checkbtn))
#endif
))
return TRUE;
test_string = g_strdup(gtk_entry_get_text(GTK_ENTRY(page->entry_regexp_test_string)));
if (!regexp || !regexp[0]) {
+ gtk_widget_modify_base(page->entry_simplify_subject,
+ GTK_STATE_NORMAL, NULL);
if (test_string) {
gtk_entry_set_text(GTK_ENTRY(page->entry_regexp_test_result), test_string);
g_free(test_string);
void prefs_folder_item_open(FolderItem *item)
{
gchar *id, *title;
-
if (prefs_pages == NULL) {
register_general_page();
register_compose_page();
}
- if (item->path)
+ if (item->path) {
id = folder_item_get_identifier (item);
- else
+ can_save = TRUE;
+ } else {
id = g_strdup(item->name);
+ can_save = FALSE;
+ }
title = g_strdup_printf (_("Properties for folder %s"), id);
g_free (id);
prefswindow_open(title, prefs_pages, item,
&prefs_common.folderitemwin_width, &prefs_common.folderitemwin_height);
+
g_free (title);
}