/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws team
+ * Copyright (C) 1999-2007 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
GtkWidget *combobox;
GtkWidget *label;
GtkWidget *descrlabel;
+ GtkWidget *no_imap_warn_icon;
+ GtkWidget *no_imap_warn_label;
};
static struct Basic {
GtkWidget *imap_auth_type_optmenu;
GtkWidget *imapdir_label;
GtkWidget *imapdir_entry;
+ GtkWidget *subsonly_chkbtn;
GtkWidget *frame_maxarticle;
GtkWidget *maxarticle_label;
GtkWidget *autobcc_entry;
GtkWidget *autoreplyto_chkbtn;
GtkWidget *autoreplyto_entry;
+#ifdef USE_ASPELL
+ GtkWidget *checkbtn_enable_default_dictionary;
+ GtkWidget *optmenu_default_dictionary;
+ GtkWidget *checkbtn_enable_default_alt_dictionary;
+ GtkWidget *optmenu_default_alt_dictionary;
+#endif
} compose;
static struct Privacy {
static void prefs_account_mailcmd_toggled(GtkToggleButton *button,
gpointer user_data);
+#if USE_ASPELL
+static void prefs_account_compose_default_dictionary_set_string_from_optmenu
+ (PrefParam *pparam);
+static void prefs_account_compose_default_dictionary_set_optmenu_from_string
+ (PrefParam *pparam);
+#endif
+
static gchar *privacy_prefs;
static PrefParam param[] = {
&compose.autoreplyto_entry,
prefs_set_data_from_entry, prefs_set_entry},
+#if USE_ASPELL
+ {"enable_default_dictionary", "", &tmp_ac_prefs.enable_default_dictionary, P_BOOL,
+ &compose.checkbtn_enable_default_dictionary,
+ prefs_set_data_from_toggle, prefs_set_toggle},
+
+ {"default_dictionary", NULL, &tmp_ac_prefs.default_dictionary, P_STRING,
+ &compose.optmenu_default_dictionary,
+ prefs_account_compose_default_dictionary_set_string_from_optmenu,
+ prefs_account_compose_default_dictionary_set_optmenu_from_string},
+
+ {"enable_default_alt_dictionary", "", &tmp_ac_prefs.enable_default_alt_dictionary, P_BOOL,
+ &compose.checkbtn_enable_default_alt_dictionary,
+ prefs_set_data_from_toggle, prefs_set_toggle},
+
+ {"default_alt_dictionary", NULL, &tmp_ac_prefs.default_alt_dictionary, P_STRING,
+ &compose.optmenu_default_alt_dictionary,
+ prefs_account_compose_default_dictionary_set_string_from_optmenu,
+ prefs_account_compose_default_dictionary_set_optmenu_from_string},
+#endif
+
/* Privacy */
{"default_privacy_system", "", &tmp_ac_prefs.default_privacy_system, P_STRING,
&privacy.default_privacy_system,
{"imap_directory", NULL, &tmp_ac_prefs.imap_dir, P_STRING,
&receive.imapdir_entry, prefs_set_data_from_entry, prefs_set_entry},
+ {"imap_subsonly", "TRUE", &tmp_ac_prefs.imap_subsonly, P_BOOL,
+ &receive.subsonly_chkbtn,
+ prefs_set_data_from_toggle, prefs_set_toggle},
+
{"set_sent_folder", "FALSE", &tmp_ac_prefs.set_sent_folder, P_BOOL,
&advanced.sent_folder_chkbtn,
prefs_set_data_from_toggle, prefs_set_toggle},
privacy_enabled = strcmp(system_id, "");
+ if (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_DATA) == NULL ||
+ GPOINTER_TO_INT(g_object_get_data(G_OBJECT(menuitem), MENU_VAL_DATA)) == FALSE)
+ privacy_enabled = FALSE;
+
gtk_widget_set_sensitive (privacy.default_encrypt_chkbtn, privacy_enabled);
gtk_widget_set_sensitive (privacy.default_encrypt_reply_chkbtn, privacy_enabled);
gtk_widget_set_sensitive (privacy.default_sign_chkbtn, privacy_enabled);
menuitem = gtk_menu_item_new_with_label(_("None"));
gtk_widget_show(menuitem);
g_object_set_data(G_OBJECT(menuitem), MENU_VAL_ID, "");
+ g_object_set_data(G_OBJECT(menuitem), MENU_VAL_DATA, GINT_TO_POINTER(FALSE));
gtk_menu_append(GTK_MENU(menu), menuitem);
g_signal_connect(G_OBJECT(menuitem), "activate",
menuitem = gtk_menu_item_new_with_label(name);
gtk_widget_show(menuitem);
g_object_set_data_full(G_OBJECT(menuitem), MENU_VAL_ID, id, g_free);
+ g_object_set_data(G_OBJECT(menuitem), MENU_VAL_DATA, GINT_TO_POINTER(TRUE));
+
gtk_menu_append(GTK_MENU(menu), menuitem);
g_signal_connect(G_OBJECT(menuitem), "activate",
if (notebook == NULL)
prefs_account_create();
+ else {
+#ifdef USE_ASPELL
+ /* reset gtkaspell menus */
+ gtk_option_menu_remove_menu(GTK_OPTION_MENU(compose.optmenu_default_dictionary));
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(compose.optmenu_default_dictionary),
+ gtkaspell_dictionary_option_menu_new(
+ prefs_common.aspell_path));
+ gtk_option_menu_remove_menu(GTK_OPTION_MENU(compose.optmenu_default_alt_dictionary));
+ gtk_option_menu_set_menu(GTK_OPTION_MENU(compose.optmenu_default_alt_dictionary),
+ gtkaspell_dictionary_option_menu_new_with_refresh(
+ prefs_common.aspell_path, FALSE));
+#endif
+ }
gtk_box_pack_start (GTK_BOX (vbox), notebook, TRUE, TRUE, 0);
gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), 0);
static gchar *path[2];
path[0] = _("Account");
- path[2] = NULL;
+ path[1] = NULL;
account_page.page.path = path;
account_page.page.weight = 1000.0;
void destroy_dialog(gpointer data)
{
PrefsAccount *ac_prefs = (PrefsAccount *) data;
- if (!cancelled)
+ if (!cancelled) {
+ gboolean update_fld_list = FALSE;
+ if (ac_prefs->protocol == A_IMAP4 && !new_account) {
+ if ((&tmp_ac_prefs)->imap_subsonly != ac_prefs->imap_subsonly) {
+ update_fld_list = TRUE;
+ }
+ }
*ac_prefs = tmp_ac_prefs;
- else /* the customhdr_list may have changed, update it anyway */
+ if (update_fld_list)
+ folderview_rescan_tree(ac_prefs->folder, FALSE);
+ } else /* the customhdr_list may have changed, update it anyway */
ac_prefs->customhdr_list = (&tmp_ac_prefs)->customhdr_list;
+
+
gtk_main_quit();
}
GtkWidget *optmenubox;
GtkWidget *optmenu;
GtkWidget *optlabel;
+ GtkWidget *no_imap_warn_icon;
+ GtkWidget *no_imap_warn_label;
GtkWidget *serv_table;
GtkWidget *recvserv_label;
GtkWidget *smtpserv_label;
default_chkbtn = gtk_check_button_new_with_label (_("Set as default"));
gtk_widget_show (default_chkbtn);
- gtk_box_pack_end (GTK_BOX (hbox), default_chkbtn, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (hbox), default_chkbtn, TRUE, FALSE, 0);
PACK_FRAME (vbox1, frame1, _("Personal information"));
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
- PACK_FRAME (vbox1, serv_frame, _("Server information"));
-
- vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
- gtk_widget_show (vbox2);
- gtk_container_add (GTK_CONTAINER (serv_frame), vbox2);
- gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
+ vbox2 = gtkut_get_options_frame(vbox1, &serv_frame, _("Server information"));
hbox = gtk_hbox_new (FALSE, 8);
gtk_widget_show (hbox);
menu = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(optmenu)));
for( i = 0; i < NUM_RECV_PROTOCOLS; i++ )
if( protocol_names[i] != NULL )
- COMBOBOX_ADD (menu, protocol_names[i], i);
+ COMBOBOX_ADD (menu, _(protocol_names[i]), i);
g_signal_connect(G_OBJECT(optmenu), "changed",
G_CALLBACK(prefs_account_protocol_changed), NULL);
gtk_label_set_justify(GTK_LABEL(optlabel), GTK_JUSTIFY_CENTER);
gtk_box_pack_start(GTK_BOX (optmenubox), optlabel, FALSE, FALSE, 0);
+ no_imap_warn_icon = gtk_image_new_from_stock
+ (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_SMALL_TOOLBAR);
+ no_imap_warn_label = gtk_label_new(_("<span weight=\"bold\">Warning: this version of Claws Mail\n"
+ "has been built without IMAP support.</span>"));
+ gtk_label_set_use_markup(GTK_LABEL(no_imap_warn_label), TRUE);
+
+ gtk_box_pack_start(GTK_BOX (optmenubox), no_imap_warn_icon, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX (optmenubox), no_imap_warn_label, FALSE, FALSE, 0);
/* Set up a struct to store pointers to necessary widgets */
protocol_optmenu = g_new(struct BasicProtocol, 1);
protocol_optmenu->combobox = optmenu;
protocol_optmenu->label = optlabel;
protocol_optmenu->descrlabel = label;
+ protocol_optmenu->no_imap_warn_icon = no_imap_warn_icon;
+ protocol_optmenu->no_imap_warn_label = no_imap_warn_label;
serv_table = gtk_table_new (6, 4, FALSE);
gtk_widget_show (serv_table);
GtkWidget *imap_frame;
GtkWidget *imapdir_label;
GtkWidget *imapdir_entry;
+ GtkWidget *subsonly_chkbtn;
GtkWidget *local_frame;
GtkWidget *local_vbox;
GtkWidget *local_hbox;
gtk_container_add (GTK_CONTAINER (notebook), vbox1);
gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
- PACK_FRAME (vbox1, local_frame, _("Local"));
-
- local_vbox = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (local_vbox);
- gtk_container_add (GTK_CONTAINER (local_frame), local_vbox);
- gtk_container_set_border_width (GTK_CONTAINER (local_vbox), VBOX_BORDER);
+ local_vbox = gtkut_get_options_frame(vbox1, &local_frame, _("Local"));
local_hbox = gtk_hbox_new (FALSE, 8);
gtk_widget_show (local_hbox);
G_CALLBACK (prefs_account_select_folder_cb),
local_inbox_entry);
- PACK_FRAME (vbox1, frame1, _("POP3"));
-
- vbox2 = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox2);
- gtk_container_add (GTK_CONTAINER (frame1), vbox2);
- gtk_container_set_border_width (GTK_CONTAINER (vbox2), VBOX_BORDER);
-
+ vbox2 = gtkut_get_options_frame(vbox1, &frame1, _("POP3"));
PACK_CHECK_BUTTON (vbox2, use_apop_chkbtn,
_("Use secure authentication (APOP)"));
G_CALLBACK (prefs_account_select_folder_cb),
inbox_entry);
- PACK_FRAME(vbox1, frame2, _("NNTP"));
-
- vbox2 = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox2);
- gtk_container_add (GTK_CONTAINER (frame2), vbox2);
- gtk_container_set_border_width (GTK_CONTAINER (vbox2), VBOX_BORDER);
+ vbox2 = gtkut_get_options_frame(vbox1, &frame2, _("NNTP"));
hbox2 = gtk_hbox_new (FALSE, 8);
gtk_widget_show (hbox2);
gtk_spin_button_set_numeric
(GTK_SPIN_BUTTON (maxarticle_spinbtn), TRUE);
- PACK_FRAME (vbox1, imap_frame, _("IMAP4"));
-
- vbox2 = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox2);
- gtk_container_add (GTK_CONTAINER (imap_frame), vbox2);
- gtk_container_set_border_width (GTK_CONTAINER (vbox2), VBOX_BORDER);
+ vbox2 = gtkut_get_options_frame(vbox1, &imap_frame, _("IMAP4"));
hbox1 = gtk_hbox_new (FALSE, 8);
gtk_widget_show (hbox1);
MENUITEM_ADD (optmenu_menu, menuitem, "LOGIN", IMAP_AUTH_LOGIN);
MENUITEM_ADD (optmenu_menu, menuitem, "CRAM-MD5", IMAP_AUTH_CRAM_MD5);
MENUITEM_ADD (optmenu_menu, menuitem, "ANONYMOUS", IMAP_AUTH_ANON);
+ MENUITEM_ADD (optmenu_menu, menuitem, "GSSAPI", IMAP_AUTH_GSSAPI);
gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
gtk_widget_show (imapdir_entry);
gtk_box_pack_start (GTK_BOX (hbox1), imapdir_entry, FALSE, FALSE, 0);
+ hbox1 = gtk_hbox_new (FALSE, 8);
+ gtk_widget_show (hbox1);
+ gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 4);
+
+ PACK_CHECK_BUTTON (hbox1, subsonly_chkbtn,
+ _("Show only subscribed folders"));
+
PACK_CHECK_BUTTON (vbox1, filter_on_recv_chkbtn,
_("Filter messages on receiving"));
receive.imapdir_label = imapdir_label;
receive.imapdir_entry = imapdir_entry;
-
+ receive.subsonly_chkbtn = subsonly_chkbtn;
receive.local_frame = local_frame;
receive.local_inbox_label = local_inbox_label;
receive.local_inbox_entry = local_inbox_entry;
gtk_container_add (GTK_CONTAINER (notebook), vbox1);
gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
- PACK_FRAME (vbox1, frame, _("Header"));
-
- vbox2 = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox2);
- gtk_container_add (GTK_CONTAINER (frame), vbox2);
- gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
+ vbox2 = gtkut_get_options_frame(vbox1, &frame, _("Header"));
PACK_CHECK_BUTTON (vbox2, msgid_chkbtn, _("Generate Message-ID"));
PACK_CHECK_BUTTON (hbox, customhdr_chkbtn,
_("Add user-defined header"));
- customhdr_edit_btn = gtk_button_new_with_label (_(" Edit... "));
+ customhdr_edit_btn = gtk_button_new_from_stock (GTK_STOCK_EDIT);
gtk_widget_show (customhdr_edit_btn);
gtk_box_pack_start (GTK_BOX (hbox), customhdr_edit_btn,
FALSE, FALSE, 0);
SET_TOGGLE_SENSITIVITY (customhdr_chkbtn, customhdr_edit_btn);
- PACK_FRAME (vbox1, frame, _("Authentication"));
-
- vbox3 = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox3);
- gtk_container_add (GTK_CONTAINER (frame), vbox3);
- gtk_container_set_border_width (GTK_CONTAINER (vbox3), 8);
+ vbox3 = gtkut_get_options_frame(vbox1, &frame, _("Authentication"));
PACK_CHECK_BUTTON (vbox3, smtp_auth_chkbtn,
_("SMTP Authentication (SMTP AUTH)"));
GtkWidget *autobcc_entry;
GtkWidget *autoreplyto_chkbtn;
GtkWidget *autoreplyto_entry;
+#if USE_ASPELL
+ GtkWidget *frame_dict;
+ GtkWidget *table_dict;
+ 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
vbox1 = gtk_vbox_new (FALSE, VSPACING);
gtk_widget_show (vbox1);
gtk_container_add (GTK_CONTAINER (notebook), vbox1);
gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
- PACK_FRAME(vbox1, frame_sig, _("Signature"));
-
- vbox_sig = gtk_vbox_new (FALSE, VSPACING_NARROW);
- gtk_widget_show (vbox_sig);
- gtk_container_add (GTK_CONTAINER (frame_sig), vbox_sig);
- gtk_container_set_border_width (GTK_CONTAINER (vbox_sig), 8);
+ vbox_sig = gtkut_get_options_frame(vbox1, &frame_sig, _("Signature"));
PACK_CHECK_BUTTON (vbox_sig, checkbtn_autosig,
_("Insert signature automatically"));
g_signal_connect(G_OBJECT(signature_browse_button), "clicked",
G_CALLBACK(prefs_account_signature_browse_cb), NULL);
- #if GTK_CHECK_VERSION(2, 6, 0)
signature_edit_button = gtk_button_new_from_stock (GTK_STOCK_EDIT);
- #else
- signature_edit_button = gtk_button_new_with_label (_(" Edit... "));
- #endif
gtk_widget_show (signature_edit_button);
gtk_box_pack_start (GTK_BOX (hbox2), signature_edit_button, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(signature_edit_button), "clicked",
SET_TOGGLE_SENSITIVITY (autoreplyto_chkbtn, autoreplyto_entry);
+#if USE_ASPELL
+ PACK_FRAME (vbox1, frame_dict, _("Spell check dictionaries"));
+
+ table_dict = gtk_table_new (2, 2, FALSE);
+ gtk_widget_show (table_dict);
+ gtk_container_add (GTK_CONTAINER (frame_dict), table_dict);
+ gtk_container_set_border_width (GTK_CONTAINER (table_dict), 8);
+ gtk_table_set_row_spacings (GTK_TABLE (table_dict), VSPACING_NARROW_2);
+ gtk_table_set_col_spacings (GTK_TABLE (table_dict), 8);
+
+ /* Default dictionary */
+ checkbtn_enable_default_dictionary = gtk_check_button_new_with_label(_("Default dictionary: "));
+ gtk_table_attach(GTK_TABLE(table_dict), checkbtn_enable_default_dictionary, 0, 1,
+ 0, 1, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_default_dictionary),
+ tmp_ac_prefs.enable_default_dictionary);
+
+ optmenu_default_dictionary = gtk_option_menu_new();
+ gtk_table_attach(GTK_TABLE(table_dict), optmenu_default_dictionary, 1, 2,
+ 0, 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));
+
+ SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_dictionary, optmenu_default_dictionary);
+
+ /* Default dictionary */
+ checkbtn_enable_default_alt_dictionary = gtk_check_button_new_with_label(_("Default alternate dictionary: "));
+ gtk_table_attach(GTK_TABLE(table_dict), checkbtn_enable_default_alt_dictionary, 0, 1,
+ 1, 2, GTK_SHRINK | GTK_FILL, GTK_SHRINK, 0, 0);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_enable_default_alt_dictionary),
+ tmp_ac_prefs.enable_default_alt_dictionary);
+
+ optmenu_default_alt_dictionary = gtk_option_menu_new();
+ gtk_table_attach(GTK_TABLE(table_dict), optmenu_default_alt_dictionary, 1, 2,
+ 1, 2, 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));
+
+ SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_alt_dictionary, optmenu_default_alt_dictionary);
+
+ gtk_widget_show_all(table_dict);
+#endif
+
compose.sigfile_radiobtn = sigfile_radiobtn;
compose.entry_sigpath = entry_sigpath;
compose.checkbtn_autosig = checkbtn_autosig;
compose.autobcc_entry = autobcc_entry;
compose.autoreplyto_chkbtn = autoreplyto_chkbtn;
compose.autoreplyto_entry = autoreplyto_entry;
+#ifdef USE_ASPELL
+ compose.checkbtn_enable_default_dictionary = checkbtn_enable_default_dictionary;
+ compose.optmenu_default_dictionary = optmenu_default_dictionary;
+ compose.checkbtn_enable_default_alt_dictionary = checkbtn_enable_default_alt_dictionary;
+ compose.optmenu_default_alt_dictionary = optmenu_default_alt_dictionary;
+#endif
}
static void prefs_account_privacy_create(void)
gtk_container_add (GTK_CONTAINER (notebook), vbox1);
gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
- PACK_FRAME (vbox1, pop_frame, _("POP3"));
- vbox2 = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox2);
- gtk_container_add (GTK_CONTAINER (pop_frame), vbox2);
- gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
+ vbox2 = gtkut_get_options_frame(vbox1, &pop_frame, _("POP3"));
CREATE_RADIO_BUTTONS(vbox2,
pop_nossl_radiobtn,
_("Use STARTTLS command to start SSL session"),
SSL_STARTTLS);
- PACK_FRAME (vbox1, imap_frame, _("IMAP4"));
- vbox3 = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox3);
- gtk_container_add (GTK_CONTAINER (imap_frame), vbox3);
- gtk_container_set_border_width (GTK_CONTAINER (vbox3), 8);
+ vbox3 = gtkut_get_options_frame(vbox1, &imap_frame, _("IMAP4"));
CREATE_RADIO_BUTTONS(vbox3,
imap_nossl_radiobtn,
_("Use STARTTLS command to start SSL session"),
SSL_STARTTLS);
- PACK_FRAME (vbox1, nntp_frame, _("NNTP"));
- vbox4 = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox4);
- gtk_container_add (GTK_CONTAINER (nntp_frame), vbox4);
- gtk_container_set_border_width (GTK_CONTAINER (vbox4), 8);
+ vbox4 = gtkut_get_options_frame(vbox1, &nntp_frame, _("NNTP"));
nntp_nossl_radiobtn =
gtk_radio_button_new_with_label (NULL, _("Don't use SSL"));
CREATE_RADIO_BUTTON(vbox4, nntp_ssltunnel_radiobtn, nntp_nossl_radiobtn,
_("Use SSL for NNTP connection"), SSL_TUNNEL);
- PACK_FRAME (vbox1, send_frame, _("Send (SMTP)"));
- vbox5 = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox5);
- gtk_container_add (GTK_CONTAINER (send_frame), vbox5);
- gtk_container_set_border_width (GTK_CONTAINER (vbox5), 8);
+ vbox5 = gtkut_get_options_frame(vbox1, &send_frame, _("Send (SMTP)"));
CREATE_RADIO_BUTTONS(vbox5,
smtp_nossl_radiobtn,
/* special folder setting (maybe these options are redundant) */
- PACK_FRAME (vbox1, folder_frame, _("Folder"));
-
- vbox3 = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox3);
- gtk_container_add (GTK_CONTAINER (folder_frame), vbox3);
- gtk_container_set_border_width (GTK_CONTAINER (vbox3), 8);
+ vbox3 = gtkut_get_options_frame(vbox1, &folder_frame, _("Folder"));
table = gtk_table_new (4, 3, FALSE);
gtk_widget_show (table);
RecvProtocol protocol;
gchar *old_id = NULL;
gchar *new_id = NULL;
-
- protocol = combobox_get_active_data(GTK_COMBO_BOX(basic.protocol_optmenu));
+ struct BasicProtocol *protocol_optmenu = (struct BasicProtocol *) basic.protocol_optmenu;
+ GtkWidget *optmenu = protocol_optmenu->combobox;
+
+ protocol = combobox_get_active_data(GTK_COMBO_BOX(optmenu));
if (*gtk_entry_get_text(GTK_ENTRY(basic.acname_entry)) == '\0') {
alertpanel_error(_("Account name is not entered."));
alertpanel_error(_("POP3 server is not entered."));
return -1;
}
+ if (protocol == A_POP3 || protocol == A_LOCAL) {
+ const gchar *mailbox = gtk_entry_get_text(GTK_ENTRY(receive.inbox_entry));
+ FolderItem *inbox = folder_find_item_from_identifier(mailbox);
+ if (inbox == NULL) {
+ alertpanel_error(_("The default inbox folder doesn't exist."));
+ return -1;
+ }
+ }
if (protocol == A_IMAP4 &&
*gtk_entry_get_text(GTK_ENTRY(basic.recvserv_entry)) == '\0') {
alertpanel_error(_("IMAP4 server is not entered."));
g_free(old_id);
g_free(new_id);
}
+
return 0;
}
g_free(label);
gtk_widget_hide(optmenu);
gtk_widget_show(optlabel);
+#ifndef HAVE_LIBETPAN
+ if (protocol == A_IMAP4) {
+ gtk_widget_show(protocol_optmenu->no_imap_warn_icon);
+ gtk_widget_show(protocol_optmenu->no_imap_warn_label);
+ } else {
+ gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
+ gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
+ }
+#endif
}
}
case IMAP_AUTH_ANON:
gtk_option_menu_set_history(optmenu, 3);
break;
+ case IMAP_AUTH_GSSAPI:
+ gtk_option_menu_set_history(optmenu, 4);
+ break;
case 0:
default:
gtk_option_menu_set_history(optmenu, 0);
if (id != NULL && strcmp(id, prefsid) == 0) {
found = TRUE;
gtk_option_menu_set_history(GTK_OPTION_MENU(optionmenu), i);
+ privacy_system_activated(GTK_MENU_ITEM(item));
}
i++;
}
gchar *name;
GtkWidget *menuitem;
- name = g_strdup_printf(_("Unsupported (%s)"), prefsid);
+ name = g_strdup_printf(_("%s (plugin not loaded)"), prefsid);
menuitem = gtk_menu_item_new_with_label(name);
gtk_widget_show(menuitem);
- g_object_set_data_full(G_OBJECT(menuitem), MENU_VAL_ID, g_strdup(prefsid), g_free);
+ g_object_set_data(G_OBJECT(menuitem), MENU_VAL_ID, prefsid);
+ g_object_set_data(G_OBJECT(menuitem), MENU_VAL_DATA, GINT_TO_POINTER(FALSE));
gtk_menu_append(GTK_MENU(menu), menuitem);
g_free(name);
gtk_option_menu_set_history(GTK_OPTION_MENU(optionmenu), i);
+ privacy_system_activated(GTK_MENU_ITEM(menuitem));
+ g_signal_connect(G_OBJECT(menuitem), "activate",
+ G_CALLBACK(privacy_system_activated),
+ NULL);
}
g_list_free(children);
static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
{
RecvProtocol protocol;
+ struct BasicProtocol *protocol_optmenu = (struct BasicProtocol *)basic.protocol_optmenu;
protocol = combobox_get_active_data(combobox);
+ gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
+ gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
switch(protocol) {
case A_NNTP:
+ gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
+ gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
gtk_widget_show(basic.nntpserv_label);
gtk_widget_show(basic.nntpserv_entry);
gtk_table_set_row_spacing (GTK_TABLE (basic.serv_table),
gtk_widget_hide(advanced.tunnelcmd_entry);
gtk_widget_hide(receive.imapdir_label);
gtk_widget_hide(receive.imapdir_entry);
+ gtk_widget_hide(receive.subsonly_chkbtn);
break;
case A_LOCAL:
+ gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
+ gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
gtk_widget_hide(basic.nntpserv_label);
gtk_widget_hide(basic.nntpserv_entry);
gtk_table_set_row_spacing (GTK_TABLE (basic.serv_table),
gtk_widget_hide(advanced.tunnelcmd_entry);
gtk_widget_hide(receive.imapdir_label);
gtk_widget_hide(receive.imapdir_entry);
+ gtk_widget_hide(receive.subsonly_chkbtn);
break;
case A_IMAP4:
+#ifndef HAVE_LIBETPAN
+ gtk_widget_show(protocol_optmenu->no_imap_warn_icon);
+ gtk_widget_show(protocol_optmenu->no_imap_warn_label);
+#endif
gtk_widget_hide(basic.nntpserv_label);
gtk_widget_hide(basic.nntpserv_entry);
gtk_table_set_row_spacing (GTK_TABLE (basic.serv_table),
gtk_widget_show(advanced.tunnelcmd_entry);
gtk_widget_show(receive.imapdir_label);
gtk_widget_show(receive.imapdir_entry);
+ gtk_widget_show(receive.subsonly_chkbtn);
break;
case A_NONE:
+ gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
+ gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
gtk_widget_hide(basic.nntpserv_label);
gtk_widget_hide(basic.nntpserv_entry);
gtk_table_set_row_spacing (GTK_TABLE (basic.serv_table),
gtk_widget_hide(advanced.tunnelcmd_entry);
gtk_widget_hide(receive.imapdir_label);
gtk_widget_hide(receive.imapdir_entry);
+ gtk_widget_hide(receive.subsonly_chkbtn);
break;
case A_POP3:
default:
+ gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
+ gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
gtk_widget_hide(basic.nntpserv_label);
gtk_widget_hide(basic.nntpserv_entry);
gtk_table_set_row_spacing (GTK_TABLE (basic.serv_table),
gtk_widget_hide(advanced.tunnelcmd_entry);
gtk_widget_hide(receive.imapdir_label);
gtk_widget_hide(receive.imapdir_entry);
+ gtk_widget_hide(receive.subsonly_chkbtn);
break;
}
gtk_widget_set_sensitive(basic.pass_entry, !use_mailcmd);
}
+#if USE_ASPELL
+static void prefs_account_compose_default_dictionary_set_string_from_optmenu
+ (PrefParam *pparam)
+{
+ GtkWidget *menu;
+ GtkWidget *menuitem;
+ gchar **str;
+
+ g_return_if_fail(*pparam->widget != NULL);
+
+ menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
+ menuitem = gtk_menu_get_active(GTK_MENU(menu));
+ if (menuitem == NULL)
+ return;
+
+ str = (gchar **) pparam->data;
+ g_free(*str);
+ *str = gtkaspell_get_dictionary_menu_active_item(menu);
+}
+
+static void prefs_account_compose_default_dictionary_set_optmenu_from_string
+ (PrefParam *pparam)
+{
+ GtkWidget *optionmenu;
+ GtkWidget *menu;
+ GtkWidget *menuitem;
+ gchar *dictionary;
+
+ g_return_if_fail(*pparam->widget != NULL);
+
+ dictionary = *((gchar **) pparam->data);
+ if (dictionary == NULL)
+ return;
+
+ optionmenu = *pparam->widget;
+ menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(optionmenu));
+ if (dictionary)
+ gtkaspell_set_dictionary_menu_active_item(optionmenu, dictionary);
+ menuitem = gtk_menu_get_active(GTK_MENU(menu));
+ gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
+}
+#endif
+
void prefs_account_register_page(PrefsPage *page)
{
prefs_pages = g_slist_append(prefs_pages, page);