2001-04-19 14:21:46 +02:00
|
|
|
/*
|
|
|
|
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
|
2012-05-27 19:31:10 +02:00
|
|
|
* Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
|
2001-04-19 14:21:46 +02:00
|
|
|
*
|
|
|
|
* 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
|
2007-07-11 18:38:12 +02:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-04-19 14:21:46 +02:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2007-07-11 18:38:12 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
2001-04-19 14:21:46 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
2012-07-07 09:09:39 +02:00
|
|
|
#include "claws-features.h"
|
2001-04-19 14:21:46 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "defs.h"
|
|
|
|
|
2005-02-10 13:06:07 +01:00
|
|
|
#include <glib.h>
|
|
|
|
#include <glib/gi18n.h>
|
2001-04-19 14:21:46 +02:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <gdk/gdkkeysyms.h>
|
2005-10-13 16:54:20 +02:00
|
|
|
#include <gtk/filesel.h>
|
2001-04-19 14:21:46 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <ctype.h>
|
2011-10-07 11:40:16 +02:00
|
|
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
2008-08-05 08:37:13 +02:00
|
|
|
#include "gtkcmoptionmenu.h"
|
2011-10-07 11:40:16 +02:00
|
|
|
#endif
|
2001-04-19 14:21:46 +02:00
|
|
|
#include "main.h"
|
2002-12-25 14:46:41 +01:00
|
|
|
#include "prefs_gtk.h"
|
2001-04-19 14:21:46 +02:00
|
|
|
#include "prefs_account.h"
|
2005-10-17 17:00:48 +02:00
|
|
|
#include "prefs_common.h"
|
2001-05-13 15:03:37 +02:00
|
|
|
#include "prefs_customheader.h"
|
2001-04-19 14:21:46 +02:00
|
|
|
#include "account.h"
|
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "manage_window.h"
|
2012-09-08 22:23:12 +02:00
|
|
|
#include "folder.h"
|
2001-10-30 11:25:49 +01:00
|
|
|
#include "foldersel.h"
|
2001-05-06 22:06:56 +02:00
|
|
|
#include "inc.h"
|
2001-04-19 14:21:46 +02:00
|
|
|
#include "menu.h"
|
|
|
|
#include "gtkutils.h"
|
|
|
|
#include "utils.h"
|
|
|
|
#include "alertpanel.h"
|
2002-03-17 10:50:46 +01:00
|
|
|
#include "colorlabel.h"
|
2003-07-16 12:48:31 +02:00
|
|
|
#include "smtp.h"
|
|
|
|
#include "imap.h"
|
2004-01-12 22:28:31 +01:00
|
|
|
#include "remotefolder.h"
|
2004-11-23 16:57:07 +01:00
|
|
|
#include "base64.h"
|
2006-06-27 14:46:42 +02:00
|
|
|
#include "combobox.h"
|
2007-04-01 13:27:30 +02:00
|
|
|
#include "setup.h"
|
2007-05-31 00:35:52 +02:00
|
|
|
#include "quote_fmt.h"
|
2008-07-03 22:31:33 +02:00
|
|
|
#include "hooks.h"
|
2012-09-08 22:23:12 +02:00
|
|
|
#include "privacy.h"
|
2008-07-03 22:31:33 +02:00
|
|
|
#include "inputdialog.h"
|
|
|
|
#include "ssl_certificate.h"
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
static gboolean cancelled;
|
2004-11-23 16:57:07 +01:00
|
|
|
static gboolean new_account;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
static PrefsAccount tmp_ac_prefs;
|
|
|
|
|
2005-10-13 16:54:20 +02:00
|
|
|
static GtkWidget *sigfile_radiobtn;
|
|
|
|
static GtkWidget *sigcmd_radiobtn;
|
|
|
|
static GtkWidget *entry_sigpath;
|
|
|
|
static GtkWidget *signature_browse_button;
|
2006-02-01 18:52:48 +01:00
|
|
|
static GtkWidget *signature_edit_button;
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2008-07-03 22:31:33 +02:00
|
|
|
static GtkWidget *entry_in_cert_file;
|
|
|
|
static GtkWidget *entry_out_cert_file;
|
|
|
|
static GtkWidget *in_ssl_cert_browse_button;
|
|
|
|
static GtkWidget *out_ssl_cert_browse_button;
|
|
|
|
#endif
|
|
|
|
|
2004-11-23 16:57:07 +01:00
|
|
|
static GSList *prefs_pages = NULL;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
typedef struct BasicPage
|
2007-05-31 00:35:52 +02:00
|
|
|
{
|
|
|
|
PrefsPage page;
|
|
|
|
|
|
|
|
GtkWidget *vbox;
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkWidget *acname_entry;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *default_checkbtn;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
GtkWidget *name_entry;
|
|
|
|
GtkWidget *addr_entry;
|
|
|
|
GtkWidget *org_entry;
|
|
|
|
|
|
|
|
GtkWidget *serv_frame;
|
|
|
|
GtkWidget *serv_table;
|
2006-07-01 17:16:31 +02:00
|
|
|
gpointer *protocol_optmenu;
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkWidget *recvserv_label;
|
|
|
|
GtkWidget *smtpserv_label;
|
|
|
|
GtkWidget *nntpserv_label;
|
2001-04-28 12:21:21 +02:00
|
|
|
GtkWidget *localmbox_label;
|
|
|
|
GtkWidget *mailcmd_label;
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkWidget *recvserv_entry;
|
|
|
|
GtkWidget *smtpserv_entry;
|
|
|
|
GtkWidget *nntpserv_entry;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *nntpauth_checkbtn;
|
|
|
|
GtkWidget *nntpauth_onconnect_checkbtn;
|
2001-04-28 12:21:21 +02:00
|
|
|
GtkWidget *localmbox_entry;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *mailcmd_checkbtn;
|
2001-04-28 12:21:21 +02:00
|
|
|
GtkWidget *mailcmd_entry;
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkWidget *uid_label;
|
|
|
|
GtkWidget *pass_label;
|
|
|
|
GtkWidget *uid_entry;
|
|
|
|
GtkWidget *pass_entry;
|
2007-06-03 21:32:41 +02:00
|
|
|
} BasicPage;
|
|
|
|
|
|
|
|
typedef struct ReceivePage
|
|
|
|
{
|
|
|
|
PrefsPage page;
|
|
|
|
|
|
|
|
GtkWidget *vbox;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
GtkWidget *pop3_frame;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *use_apop_checkbtn;
|
|
|
|
GtkWidget *rmmail_checkbtn;
|
2007-12-19 08:40:02 +01:00
|
|
|
GtkWidget *leave_time_spinbtn;
|
2008-08-28 22:17:05 +02:00
|
|
|
GtkWidget *leave_hour_spinbtn;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *size_limit_checkbtn;
|
2007-12-19 08:40:02 +01:00
|
|
|
GtkWidget *size_limit_spinbtn;
|
2001-10-30 11:25:49 +01:00
|
|
|
GtkWidget *inbox_label;
|
|
|
|
GtkWidget *inbox_entry;
|
|
|
|
GtkWidget *inbox_btn;
|
2001-06-27 10:07:04 +02:00
|
|
|
|
2005-12-04 18:34:44 +01:00
|
|
|
GtkWidget *local_frame;
|
|
|
|
GtkWidget *local_inbox_label;
|
|
|
|
GtkWidget *local_inbox_entry;
|
|
|
|
GtkWidget *local_inbox_btn;
|
|
|
|
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *filter_on_recv_checkbtn;
|
2007-06-04 15:28:06 +02:00
|
|
|
GtkWidget *filterhook_on_recv_checkbtn;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *recvatgetall_checkbtn;
|
2003-07-16 12:48:31 +02:00
|
|
|
|
|
|
|
GtkWidget *imap_frame;
|
|
|
|
GtkWidget *imap_auth_type_optmenu;
|
2005-10-03 19:11:47 +02:00
|
|
|
GtkWidget *imapdir_label;
|
|
|
|
GtkWidget *imapdir_entry;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *subsonly_checkbtn;
|
2007-04-27 19:12:06 +02:00
|
|
|
GtkWidget *low_bandwidth_checkbtn;
|
2003-02-19 16:58:09 +01:00
|
|
|
|
|
|
|
GtkWidget *frame_maxarticle;
|
2005-12-05 12:03:59 +01:00
|
|
|
GtkWidget *maxarticle_label;
|
|
|
|
GtkWidget *maxarticle_spinbtn;
|
2011-10-07 11:40:16 +02:00
|
|
|
GtkAdjustment *maxarticle_spinbtn_adj;
|
2007-06-03 21:32:41 +02:00
|
|
|
} ReceivePage;
|
|
|
|
|
|
|
|
typedef struct SendPage
|
|
|
|
{
|
|
|
|
PrefsPage page;
|
|
|
|
|
|
|
|
GtkWidget *vbox;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-11-08 10:13:16 +01:00
|
|
|
GtkWidget *msgid_checkbtn;
|
2011-08-29 15:00:44 +02:00
|
|
|
GtkWidget *xmailer_checkbtn;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *customhdr_checkbtn;
|
2011-02-10 17:28:26 +01:00
|
|
|
GtkWidget *msgid_with_addr_checkbtn;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *smtp_auth_checkbtn;
|
2002-06-28 10:08:36 +02:00
|
|
|
GtkWidget *smtp_auth_type_optmenu;
|
2002-02-28 11:06:43 +01:00
|
|
|
GtkWidget *smtp_uid_entry;
|
|
|
|
GtkWidget *smtp_pass_entry;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *pop_bfr_smtp_checkbtn;
|
2007-12-19 11:48:43 +01:00
|
|
|
GtkWidget *pop_bfr_smtp_tm_spinbtn;
|
2006-02-15 14:45:28 +01:00
|
|
|
GtkWidget *pop_auth_timeout_lbl;
|
|
|
|
GtkWidget *pop_auth_minutes_lbl;
|
2007-06-03 21:32:41 +02:00
|
|
|
} SendPage;
|
|
|
|
|
|
|
|
typedef struct ComposePage
|
|
|
|
{
|
|
|
|
PrefsPage page;
|
|
|
|
|
|
|
|
GtkWidget *vbox;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2003-02-28 17:05:49 +01:00
|
|
|
GtkWidget *sigfile_radiobtn;
|
2003-02-14 17:45:54 +01:00
|
|
|
GtkWidget *entry_sigpath;
|
|
|
|
GtkWidget *checkbtn_autosig;
|
|
|
|
GtkWidget *entry_sigsep;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *autocc_checkbtn;
|
2001-10-30 11:25:49 +01:00
|
|
|
GtkWidget *autocc_entry;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *autobcc_checkbtn;
|
2001-10-30 11:25:49 +01:00
|
|
|
GtkWidget *autobcc_entry;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *autoreplyto_checkbtn;
|
2001-10-30 11:25:49 +01:00
|
|
|
GtkWidget *autoreplyto_entry;
|
2008-09-12 18:11:51 +02:00
|
|
|
#if USE_ENCHANT
|
2007-01-11 12:16:38 +01:00
|
|
|
GtkWidget *checkbtn_enable_default_dictionary;
|
2007-10-30 09:04:20 +01:00
|
|
|
GtkWidget *combo_default_dictionary;
|
2007-01-11 12:16:38 +01:00
|
|
|
GtkWidget *checkbtn_enable_default_alt_dictionary;
|
2007-10-30 09:04:20 +01:00
|
|
|
GtkWidget *combo_default_alt_dictionary;
|
2007-06-04 17:38:58 +02:00
|
|
|
#endif
|
2007-06-03 21:32:41 +02:00
|
|
|
} ComposePage;
|
|
|
|
|
|
|
|
typedef struct TemplatesPage
|
|
|
|
{
|
|
|
|
PrefsPage page;
|
|
|
|
|
|
|
|
GtkWidget *vbox;
|
|
|
|
|
|
|
|
GtkWidget *checkbtn_compose_with_format;
|
|
|
|
GtkWidget *compose_subject_format;
|
|
|
|
GtkWidget *compose_body_format;
|
|
|
|
GtkWidget *checkbtn_reply_with_format;
|
|
|
|
GtkWidget *reply_quotemark;
|
|
|
|
GtkWidget *reply_body_format;
|
|
|
|
GtkWidget *checkbtn_forward_with_format;
|
|
|
|
GtkWidget *forward_quotemark;
|
|
|
|
GtkWidget *forward_body_format;
|
|
|
|
} TemplatesPage;
|
|
|
|
|
|
|
|
typedef struct PrivacyPage
|
|
|
|
{
|
|
|
|
PrefsPage page;
|
|
|
|
|
|
|
|
GtkWidget *vbox;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2004-11-09 16:26:36 +01:00
|
|
|
GtkWidget *default_privacy_system;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *default_encrypt_checkbtn;
|
|
|
|
GtkWidget *default_encrypt_reply_checkbtn;
|
|
|
|
GtkWidget *default_sign_checkbtn;
|
2008-08-28 15:09:09 +02:00
|
|
|
GtkWidget *default_sign_reply_checkbtn;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *save_clear_text_checkbtn;
|
|
|
|
GtkWidget *encrypt_to_self_checkbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
} PrivacyPage;
|
|
|
|
|
|
|
|
typedef struct SSLPage
|
|
|
|
{
|
|
|
|
PrefsPage page;
|
|
|
|
|
|
|
|
GtkWidget *vbox;
|
2001-04-21 15:18:13 +02:00
|
|
|
|
2002-05-29 10:28:56 +02:00
|
|
|
GtkWidget *pop_frame;
|
|
|
|
GtkWidget *pop_nossl_radiobtn;
|
|
|
|
GtkWidget *pop_ssltunnel_radiobtn;
|
|
|
|
GtkWidget *pop_starttls_radiobtn;
|
|
|
|
|
|
|
|
GtkWidget *imap_frame;
|
|
|
|
GtkWidget *imap_nossl_radiobtn;
|
|
|
|
GtkWidget *imap_ssltunnel_radiobtn;
|
|
|
|
GtkWidget *imap_starttls_radiobtn;
|
2001-08-06 21:30:28 +02:00
|
|
|
|
2002-05-31 09:06:28 +02:00
|
|
|
GtkWidget *nntp_frame;
|
|
|
|
GtkWidget *nntp_nossl_radiobtn;
|
|
|
|
GtkWidget *nntp_ssltunnel_radiobtn;
|
|
|
|
|
2001-08-27 13:07:43 +02:00
|
|
|
GtkWidget *send_frame;
|
2001-08-06 21:30:28 +02:00
|
|
|
GtkWidget *smtp_nossl_radiobtn;
|
|
|
|
GtkWidget *smtp_ssltunnel_radiobtn;
|
2002-05-29 10:28:56 +02:00
|
|
|
GtkWidget *smtp_starttls_radiobtn;
|
2003-07-16 13:53:42 +02:00
|
|
|
|
2008-07-03 22:31:33 +02:00
|
|
|
GtkWidget *entry_in_cert_file;
|
|
|
|
GtkWidget *entry_in_cert_pass;
|
|
|
|
GtkWidget *entry_out_cert_file;
|
|
|
|
GtkWidget *entry_out_cert_pass;
|
|
|
|
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *use_nonblocking_ssl_checkbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
} SSLPage;
|
|
|
|
|
|
|
|
typedef struct AdvancedPage
|
|
|
|
{
|
|
|
|
PrefsPage page;
|
|
|
|
|
|
|
|
GtkWidget *vbox;
|
2001-08-06 21:30:28 +02:00
|
|
|
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *smtpport_checkbtn;
|
2007-12-19 08:40:02 +01:00
|
|
|
GtkWidget *smtpport_spinbtn;
|
2001-07-04 12:14:20 +02:00
|
|
|
GtkWidget *popport_hbox;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *popport_checkbtn;
|
2007-12-19 08:40:02 +01:00
|
|
|
GtkWidget *popport_spinbtn;
|
2001-07-04 12:14:20 +02:00
|
|
|
GtkWidget *imapport_hbox;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *imapport_checkbtn;
|
2007-12-19 08:40:02 +01:00
|
|
|
GtkWidget *imapport_spinbtn;
|
2001-07-04 12:14:20 +02:00
|
|
|
GtkWidget *nntpport_hbox;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *nntpport_checkbtn;
|
2007-12-19 08:40:02 +01:00
|
|
|
GtkWidget *nntpport_spinbtn;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *domain_checkbtn;
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkWidget *domain_entry;
|
2011-10-07 11:40:16 +02:00
|
|
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *crosspost_checkbtn;
|
2002-03-17 10:50:46 +01:00
|
|
|
GtkWidget *crosspost_colormenu;
|
2011-10-07 11:40:16 +02:00
|
|
|
#endif
|
2002-03-17 10:50:46 +01:00
|
|
|
|
2007-12-06 18:10:12 +01:00
|
|
|
#ifndef G_OS_WIN32
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *tunnelcmd_checkbtn;
|
2003-03-20 12:26:00 +01:00
|
|
|
GtkWidget *tunnelcmd_entry;
|
2007-12-06 18:10:12 +01:00
|
|
|
#endif
|
2002-04-21 00:57:52 +02:00
|
|
|
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *sent_folder_checkbtn;
|
2002-04-21 00:57:52 +02:00
|
|
|
GtkWidget *sent_folder_entry;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *queue_folder_checkbtn;
|
2005-04-08 19:28:07 +02:00
|
|
|
GtkWidget *queue_folder_entry;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *draft_folder_checkbtn;
|
2002-04-21 00:57:52 +02:00
|
|
|
GtkWidget *draft_folder_entry;
|
2007-02-09 12:54:39 +01:00
|
|
|
GtkWidget *trash_folder_checkbtn;
|
2002-04-21 00:57:52 +02:00
|
|
|
GtkWidget *trash_folder_entry;
|
2011-02-10 17:02:44 +01:00
|
|
|
GtkWidget *imap_use_trash_checkbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
} AdvancedPage;
|
|
|
|
|
|
|
|
static BasicPage basic_page;
|
|
|
|
static ReceivePage receive_page;
|
|
|
|
static SendPage send_page;
|
|
|
|
static ComposePage compose_page;
|
|
|
|
static TemplatesPage templates_page;
|
|
|
|
static PrivacyPage privacy_page;
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2007-06-03 21:32:41 +02:00
|
|
|
static SSLPage ssl_page;
|
|
|
|
#endif
|
|
|
|
static AdvancedPage advanced_page;
|
|
|
|
|
|
|
|
struct BasicProtocol {
|
|
|
|
GtkWidget *combobox;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *descrlabel;
|
|
|
|
GtkWidget *no_imap_warn_icon;
|
|
|
|
GtkWidget *no_imap_warn_label;
|
|
|
|
};
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2006-07-01 17:16:31 +02:00
|
|
|
static char *protocol_names[] = {
|
|
|
|
N_("POP3"),
|
|
|
|
NULL, /* APOP, deprecated */
|
|
|
|
NULL, /* RPOP, deprecated */
|
|
|
|
N_("IMAP4"),
|
|
|
|
N_("News (NNTP)"),
|
|
|
|
N_("Local mbox file"),
|
|
|
|
N_("None (SMTP only)")
|
|
|
|
};
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
static void prefs_account_protocol_set_data_from_optmenu(PrefParam *pparam);
|
|
|
|
static void prefs_account_protocol_set_optmenu (PrefParam *pparam);
|
2006-07-01 17:16:31 +02:00
|
|
|
static void prefs_account_protocol_changed (GtkComboBox *combobox,
|
2006-06-27 14:46:42 +02:00
|
|
|
gpointer data);
|
2002-06-28 10:08:36 +02:00
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
static void prefs_account_set_string_from_combobox (PrefParam *pparam);
|
|
|
|
static void prefs_account_set_privacy_combobox_from_string (PrefParam *pparam);
|
2004-11-09 16:26:36 +01:00
|
|
|
|
2003-07-16 12:48:31 +02:00
|
|
|
static void prefs_account_imap_auth_type_set_data_from_optmenu
|
|
|
|
(PrefParam *pparam);
|
|
|
|
static void prefs_account_imap_auth_type_set_optmenu (PrefParam *pparam);
|
2002-06-28 10:08:36 +02:00
|
|
|
static void prefs_account_smtp_auth_type_set_data_from_optmenu
|
|
|
|
(PrefParam *pparam);
|
|
|
|
static void prefs_account_smtp_auth_type_set_optmenu (PrefParam *pparam);
|
|
|
|
|
2001-09-09 16:00:28 +02:00
|
|
|
static void prefs_account_enum_set_data_from_radiobtn (PrefParam *pparam);
|
|
|
|
static void prefs_account_enum_set_radiobtn (PrefParam *pparam);
|
2002-08-06 10:38:29 +02:00
|
|
|
|
2011-10-07 11:40:16 +02:00
|
|
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
2007-06-03 21:32:41 +02:00
|
|
|
static void crosspost_color_toggled(void);
|
2002-03-17 10:50:46 +01:00
|
|
|
static void prefs_account_crosspost_set_data_from_colormenu(PrefParam *pparam);
|
|
|
|
static void prefs_account_crosspost_set_colormenu(PrefParam *pparam);
|
2011-10-07 11:40:16 +02:00
|
|
|
#endif
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2001-05-01 19:29:01 +02:00
|
|
|
static void prefs_account_nntpauth_toggled(GtkToggleButton *button,
|
|
|
|
gpointer user_data);
|
2001-05-02 05:43:13 +02:00
|
|
|
static void prefs_account_mailcmd_toggled(GtkToggleButton *button,
|
|
|
|
gpointer user_data);
|
2007-06-04 15:28:06 +02:00
|
|
|
static void prefs_account_filter_on_recv_toggled(GtkToggleButton *button,
|
|
|
|
gpointer user_data);
|
2001-05-01 19:29:01 +02:00
|
|
|
|
2008-09-12 18:11:51 +02:00
|
|
|
#if USE_ENCHANT
|
2007-01-11 12:16:38 +01:00
|
|
|
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
|
|
|
|
|
2004-11-23 16:57:07 +01:00
|
|
|
static gchar *privacy_prefs;
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static PrefParam basic_param[] = {
|
2001-04-19 14:21:46 +02:00
|
|
|
{"account_name", NULL, &tmp_ac_prefs.account_name, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.acname_entry, prefs_set_data_from_entry, prefs_set_entry},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
{"is_default", "FALSE", &tmp_ac_prefs.is_default, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.default_checkbtn,
|
2001-04-19 14:21:46 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"name", NULL, &tmp_ac_prefs.name, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.name_entry, prefs_set_data_from_entry, prefs_set_entry},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
{"address", NULL, &tmp_ac_prefs.address, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.addr_entry, prefs_set_data_from_entry, prefs_set_entry},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
{"organization", NULL, &tmp_ac_prefs.organization, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.org_entry, prefs_set_data_from_entry, prefs_set_entry},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
{"protocol", NULL, &tmp_ac_prefs.protocol, P_ENUM,
|
2007-06-03 21:32:41 +02:00
|
|
|
(GtkWidget **)&basic_page.protocol_optmenu,
|
2001-04-19 14:21:46 +02:00
|
|
|
prefs_account_protocol_set_data_from_optmenu,
|
|
|
|
prefs_account_protocol_set_optmenu},
|
|
|
|
|
|
|
|
{"receive_server", NULL, &tmp_ac_prefs.recv_server, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.recvserv_entry, prefs_set_data_from_entry, prefs_set_entry},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
{"smtp_server", NULL, &tmp_ac_prefs.smtp_server, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.smtpserv_entry, prefs_set_data_from_entry, prefs_set_entry},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
{"nntp_server", NULL, &tmp_ac_prefs.nntp_server, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.nntpserv_entry, prefs_set_data_from_entry, prefs_set_entry},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2004-01-12 22:28:31 +01:00
|
|
|
{"local_mbox", "/var/mail", &tmp_ac_prefs.local_mbox, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.localmbox_entry, prefs_set_data_from_entry, prefs_set_entry},
|
2001-04-28 12:21:21 +02:00
|
|
|
|
2001-05-02 05:43:13 +02:00
|
|
|
{"use_mail_command", "FALSE", &tmp_ac_prefs.use_mail_command, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.mailcmd_checkbtn, prefs_set_data_from_toggle, prefs_set_toggle},
|
2001-05-02 05:43:13 +02:00
|
|
|
|
2004-01-12 22:28:31 +01:00
|
|
|
{"mail_command", DEFAULT_SENDMAIL_CMD, &tmp_ac_prefs.mail_command, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.mailcmd_entry, prefs_set_data_from_entry, prefs_set_entry},
|
2001-04-28 12:21:21 +02:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
{"use_nntp_auth", "FALSE", &tmp_ac_prefs.use_nntp_auth, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.nntpauth_checkbtn,
|
2001-05-01 19:29:01 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
2003-01-27 11:33:19 +01:00
|
|
|
|
|
|
|
{"use_nntp_auth_onconnect", "FALSE", &tmp_ac_prefs.use_nntp_auth_onconnect, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.nntpauth_onconnect_checkbtn,
|
2003-01-27 11:33:19 +01:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
{"user_id", "ENV_USER", &tmp_ac_prefs.userid, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.uid_entry, prefs_set_data_from_entry, prefs_set_entry},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2003-03-02 17:29:07 +01:00
|
|
|
{"password", NULL, &tmp_ac_prefs.passwd, P_PASSWORD,
|
2007-06-03 21:32:41 +02:00
|
|
|
&basic_page.pass_entry, prefs_set_data_from_entry, prefs_set_entry},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
|
|
|
|
};
|
2005-12-04 18:34:44 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static PrefParam receive_param[] = {
|
2004-11-12 07:41:50 +01:00
|
|
|
{"use_apop_auth", "FALSE", &tmp_ac_prefs.use_apop_auth, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&receive_page.use_apop_checkbtn,
|
2004-11-12 07:41:50 +01:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
{"remove_mail", "TRUE", &tmp_ac_prefs.rmmail, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&receive_page.rmmail_checkbtn,
|
2001-04-19 14:21:46 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
2002-06-17 12:02:21 +02:00
|
|
|
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2006-04-17 18:14:03 +02:00
|
|
|
{"message_leave_time", "7", &tmp_ac_prefs.msg_leave_time, P_INT,
|
2007-12-19 08:40:02 +01:00
|
|
|
&receive_page.leave_time_spinbtn,
|
|
|
|
prefs_set_data_from_spinbtn, prefs_set_spinbtn},
|
2007-03-21 18:44:45 +01:00
|
|
|
#else
|
|
|
|
{"message_leave_time", "30", &tmp_ac_prefs.msg_leave_time, P_INT,
|
2007-12-19 08:40:02 +01:00
|
|
|
&receive_page.leave_time_spinbtn,
|
|
|
|
prefs_set_data_from_spinbtn, prefs_set_spinbtn},
|
2007-03-21 18:44:45 +01:00
|
|
|
#endif
|
2008-08-28 22:17:05 +02:00
|
|
|
{"message_leave_hour", "0", &tmp_ac_prefs.msg_leave_hour, P_INT,
|
|
|
|
&receive_page.leave_hour_spinbtn,
|
|
|
|
prefs_set_data_from_spinbtn, prefs_set_spinbtn},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2002-02-21 15:56:09 +01:00
|
|
|
{"enable_size_limit", "FALSE", &tmp_ac_prefs.enable_size_limit, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&receive_page.size_limit_checkbtn,
|
2001-04-19 14:21:46 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
2002-02-21 15:56:09 +01:00
|
|
|
{"size_limit", "1024", &tmp_ac_prefs.size_limit, P_INT,
|
2007-12-19 08:40:02 +01:00
|
|
|
&receive_page.size_limit_spinbtn,
|
|
|
|
prefs_set_data_from_spinbtn, prefs_set_spinbtn},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
{"filter_on_receive", "TRUE", &tmp_ac_prefs.filter_on_recv, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&receive_page.filter_on_recv_checkbtn,
|
2001-04-19 14:21:46 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
2007-06-04 15:28:06 +02:00
|
|
|
{"filterhook_on_receive", "TRUE", &tmp_ac_prefs.filterhook_on_recv, P_BOOL,
|
|
|
|
&receive_page.filterhook_on_recv_checkbtn,
|
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
2003-07-16 12:48:31 +02:00
|
|
|
{"imap_auth_method", "0", &tmp_ac_prefs.imap_auth_type, P_ENUM,
|
2007-06-03 21:32:41 +02:00
|
|
|
&receive_page.imap_auth_type_optmenu,
|
2003-07-16 12:48:31 +02:00
|
|
|
prefs_account_imap_auth_type_set_data_from_optmenu,
|
|
|
|
prefs_account_imap_auth_type_set_optmenu},
|
|
|
|
|
2002-02-21 15:56:09 +01:00
|
|
|
{"receive_at_get_all", "TRUE", &tmp_ac_prefs.recv_at_getall, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&receive_page.recvatgetall_checkbtn,
|
2002-02-21 15:56:09 +01:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
2003-02-19 16:58:09 +01:00
|
|
|
{"max_news_articles", "300", &tmp_ac_prefs.max_articles, P_INT,
|
2007-06-03 21:32:41 +02:00
|
|
|
&receive_page.maxarticle_spinbtn,
|
2003-02-19 16:58:09 +01:00
|
|
|
prefs_set_data_from_spinbtn, prefs_set_spinbtn},
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
{"inbox", "#mh/Mailbox/inbox", &tmp_ac_prefs.inbox, P_STRING,
|
|
|
|
&receive_page.inbox_entry, prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
|
|
|
{"local_inbox", "#mh/Mailbox/inbox", &tmp_ac_prefs.local_inbox, P_STRING,
|
|
|
|
&receive_page.local_inbox_entry, prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
|
|
|
{"imap_directory", NULL, &tmp_ac_prefs.imap_dir, P_STRING,
|
|
|
|
&receive_page.imapdir_entry, prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
|
|
|
{"imap_subsonly", "TRUE", &tmp_ac_prefs.imap_subsonly, P_BOOL,
|
|
|
|
&receive_page.subsonly_checkbtn,
|
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
2007-11-27 20:10:20 +01:00
|
|
|
{"low_bandwidth", "FALSE", &tmp_ac_prefs.low_bandwidth, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&receive_page.low_bandwidth_checkbtn,
|
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static PrefParam send_param[] = {
|
2007-11-08 10:13:16 +01:00
|
|
|
{"generate_msgid", "TRUE", &tmp_ac_prefs.gen_msgid, P_BOOL,
|
|
|
|
&send_page.msgid_checkbtn,
|
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
2011-08-29 15:00:44 +02:00
|
|
|
{"generate_xmailer", "TRUE", &tmp_ac_prefs.gen_xmailer, P_BOOL,
|
|
|
|
&send_page.xmailer_checkbtn,
|
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
{"add_custom_header", "FALSE", &tmp_ac_prefs.add_customhdr, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&send_page.customhdr_checkbtn,
|
2001-04-19 14:21:46 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
2011-02-10 17:28:26 +01:00
|
|
|
{"msgid_with_addr", "FALSE", &tmp_ac_prefs.msgid_with_addr, P_BOOL,
|
|
|
|
&send_page.msgid_with_addr_checkbtn,
|
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"use_smtp_auth", "FALSE", &tmp_ac_prefs.use_smtp_auth, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&send_page.smtp_auth_checkbtn,
|
2001-04-19 14:21:46 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
2002-06-28 10:08:36 +02:00
|
|
|
{"smtp_auth_method", "0", &tmp_ac_prefs.smtp_auth_type, P_ENUM,
|
2007-06-03 21:32:41 +02:00
|
|
|
&send_page.smtp_auth_type_optmenu,
|
2002-06-28 10:08:36 +02:00
|
|
|
prefs_account_smtp_auth_type_set_data_from_optmenu,
|
|
|
|
prefs_account_smtp_auth_type_set_optmenu},
|
|
|
|
|
2002-01-11 16:01:47 +01:00
|
|
|
{"smtp_user_id", NULL, &tmp_ac_prefs.smtp_userid, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&send_page.smtp_uid_entry, prefs_set_data_from_entry, prefs_set_entry},
|
2003-03-02 17:29:07 +01:00
|
|
|
{"smtp_password", NULL, &tmp_ac_prefs.smtp_passwd, P_PASSWORD,
|
2007-06-03 21:32:41 +02:00
|
|
|
&send_page.smtp_pass_entry, prefs_set_data_from_entry, prefs_set_entry},
|
2001-10-13 19:00:28 +02:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
{"pop_before_smtp", "FALSE", &tmp_ac_prefs.pop_before_smtp, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&send_page.pop_bfr_smtp_checkbtn,
|
2001-04-19 14:21:46 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
2002-09-22 18:30:27 +02:00
|
|
|
{"pop_before_smtp_timeout", "5", &tmp_ac_prefs.pop_before_smtp_timeout, P_INT,
|
2007-12-19 11:48:43 +01:00
|
|
|
&send_page.pop_bfr_smtp_tm_spinbtn,
|
|
|
|
prefs_set_data_from_spinbtn, prefs_set_spinbtn},
|
2002-09-22 18:30:27 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static PrefParam compose_param[] = {
|
2003-02-28 17:05:49 +01:00
|
|
|
{"signature_type", "0", &tmp_ac_prefs.sig_type, P_ENUM,
|
2007-06-03 21:32:41 +02:00
|
|
|
&compose_page.sigfile_radiobtn,
|
2003-02-28 17:05:49 +01:00
|
|
|
prefs_account_enum_set_data_from_radiobtn,
|
|
|
|
prefs_account_enum_set_radiobtn},
|
2005-08-03 10:31:53 +02:00
|
|
|
{"signature_path", "~" G_DIR_SEPARATOR_S DEFAULT_SIGNATURE,
|
2007-06-03 21:32:41 +02:00
|
|
|
&tmp_ac_prefs.sig_path, P_STRING, &compose_page.entry_sigpath,
|
2003-02-14 17:45:54 +01:00
|
|
|
prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
|
|
|
{"auto_signature", "TRUE", &tmp_ac_prefs.auto_sig, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&compose_page.checkbtn_autosig,
|
2003-02-14 17:45:54 +01:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"signature_separator", "-- ", &tmp_ac_prefs.sig_sep, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&compose_page.entry_sigsep,
|
2001-04-19 14:21:46 +02:00
|
|
|
prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
2001-10-30 11:25:49 +01:00
|
|
|
{"set_autocc", "FALSE", &tmp_ac_prefs.set_autocc, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&compose_page.autocc_checkbtn,
|
2001-10-30 11:25:49 +01:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"auto_cc", NULL, &tmp_ac_prefs.auto_cc, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&compose_page.autocc_entry,
|
2001-10-30 11:25:49 +01:00
|
|
|
prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
|
|
|
{"set_autobcc", "FALSE", &tmp_ac_prefs.set_autobcc, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&compose_page.autobcc_checkbtn,
|
2001-10-30 11:25:49 +01:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"auto_bcc", NULL, &tmp_ac_prefs.auto_bcc, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&compose_page.autobcc_entry,
|
2001-10-30 11:25:49 +01:00
|
|
|
prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
|
|
|
{"set_autoreplyto", "FALSE", &tmp_ac_prefs.set_autoreplyto, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&compose_page.autoreplyto_checkbtn,
|
2001-10-30 11:25:49 +01:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"auto_replyto", NULL, &tmp_ac_prefs.auto_replyto, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&compose_page.autoreplyto_entry,
|
2001-10-30 11:25:49 +01:00
|
|
|
prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
2008-09-12 18:11:51 +02:00
|
|
|
#if USE_ENCHANT
|
2007-01-11 12:16:38 +01:00
|
|
|
{"enable_default_dictionary", "", &tmp_ac_prefs.enable_default_dictionary, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&compose_page.checkbtn_enable_default_dictionary,
|
2007-01-11 12:16:38 +01:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"default_dictionary", NULL, &tmp_ac_prefs.default_dictionary, P_STRING,
|
2007-10-30 09:04:20 +01:00
|
|
|
&compose_page.combo_default_dictionary,
|
2007-01-11 12:16:38 +01:00
|
|
|
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,
|
2007-06-03 21:32:41 +02:00
|
|
|
&compose_page.checkbtn_enable_default_alt_dictionary,
|
2007-01-11 12:16:38 +01:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"default_alt_dictionary", NULL, &tmp_ac_prefs.default_alt_dictionary, P_STRING,
|
2007-10-30 09:04:20 +01:00
|
|
|
&compose_page.combo_default_alt_dictionary,
|
2007-01-11 12:16:38 +01:00
|
|
|
prefs_account_compose_default_dictionary_set_string_from_optmenu,
|
|
|
|
prefs_account_compose_default_dictionary_set_optmenu_from_string},
|
2007-06-03 21:32:41 +02:00
|
|
|
#else
|
|
|
|
{"enable_default_dictionary", "", &tmp_ac_prefs.enable_default_dictionary, P_BOOL,
|
|
|
|
NULL, NULL, NULL},
|
|
|
|
|
|
|
|
{"default_dictionary", NULL, &tmp_ac_prefs.default_dictionary, P_STRING,
|
|
|
|
NULL, NULL, NULL},
|
|
|
|
|
|
|
|
{"enable_default_alt_dictionary", "", &tmp_ac_prefs.enable_default_alt_dictionary, P_BOOL,
|
|
|
|
NULL, NULL, NULL},
|
|
|
|
|
|
|
|
{"default_alt_dictionary", NULL, &tmp_ac_prefs.default_alt_dictionary, P_STRING,
|
|
|
|
NULL, NULL, NULL},
|
2007-01-11 12:16:38 +01:00
|
|
|
#endif
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static PrefParam templates_param[] = {
|
|
|
|
{"compose_with_format", "FALSE", &tmp_ac_prefs.compose_with_format, P_BOOL,
|
|
|
|
&templates_page.checkbtn_compose_with_format,
|
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"compose_subject_format", NULL, &tmp_ac_prefs.compose_subject_format, P_STRING,
|
|
|
|
&templates_page.compose_subject_format,
|
|
|
|
prefs_set_escaped_data_from_entry, prefs_set_entry_from_escaped},
|
|
|
|
|
|
|
|
{"compose_body_format", NULL, &tmp_ac_prefs.compose_body_format, P_STRING,
|
|
|
|
&templates_page.compose_body_format,
|
|
|
|
prefs_set_escaped_data_from_text, prefs_set_text_from_escaped},
|
|
|
|
|
|
|
|
{"reply_with_format", "FALSE", &tmp_ac_prefs.reply_with_format, P_BOOL,
|
|
|
|
&templates_page.checkbtn_reply_with_format,
|
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"reply_quotemark", NULL, &tmp_ac_prefs.reply_quotemark, P_STRING,
|
|
|
|
&templates_page.reply_quotemark,
|
|
|
|
prefs_set_data_from_entry, prefs_set_entry_from_escaped},
|
|
|
|
|
|
|
|
{"reply_body_format", NULL, &tmp_ac_prefs.reply_body_format, P_STRING,
|
|
|
|
&templates_page.reply_body_format,
|
|
|
|
prefs_set_escaped_data_from_text, prefs_set_text_from_escaped},
|
|
|
|
|
|
|
|
{"forward_with_format", "FALSE", &tmp_ac_prefs.forward_with_format, P_BOOL,
|
|
|
|
&templates_page.checkbtn_forward_with_format,
|
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"forward_quotemark", NULL, &tmp_ac_prefs.forward_quotemark, P_STRING,
|
|
|
|
&templates_page.forward_quotemark,
|
|
|
|
prefs_set_data_from_entry, prefs_set_entry_from_escaped},
|
|
|
|
|
|
|
|
{"forward_body_format", NULL, &tmp_ac_prefs.forward_body_format, P_STRING,
|
|
|
|
&templates_page.forward_body_format,
|
|
|
|
prefs_set_escaped_data_from_text, prefs_set_text_from_escaped},
|
|
|
|
|
|
|
|
{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static PrefParam privacy_param[] = {
|
2004-11-09 16:26:36 +01:00
|
|
|
{"default_privacy_system", "", &tmp_ac_prefs.default_privacy_system, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&privacy_page.default_privacy_system,
|
2007-08-06 16:54:28 +02:00
|
|
|
prefs_account_set_string_from_combobox,
|
|
|
|
prefs_account_set_privacy_combobox_from_string},
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2002-01-08 20:50:20 +01:00
|
|
|
{"default_encrypt", "FALSE", &tmp_ac_prefs.default_encrypt, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&privacy_page.default_encrypt_checkbtn,
|
2002-01-08 20:50:20 +01:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2005-06-25 13:14:48 +02:00
|
|
|
{"default_encrypt_reply", "TRUE", &tmp_ac_prefs.default_encrypt_reply, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&privacy_page.default_encrypt_reply_checkbtn,
|
2005-06-25 13:14:48 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2002-01-08 20:50:20 +01:00
|
|
|
{"default_sign", "FALSE", &tmp_ac_prefs.default_sign, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&privacy_page.default_sign_checkbtn,
|
2002-08-06 10:38:29 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
2011-02-22 07:49:35 +01:00
|
|
|
#ifdef G_OS_UNIX
|
2008-08-28 15:09:09 +02:00
|
|
|
{"default_sign_reply", "TRUE", &tmp_ac_prefs.default_sign_reply, P_BOOL,
|
|
|
|
&privacy_page.default_sign_reply_checkbtn,
|
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
2011-02-22 07:49:35 +01:00
|
|
|
#else
|
|
|
|
/* Bug 2367: disturbing for Win32 users with no keypair */
|
|
|
|
{"default_sign_reply", "FALSE", &tmp_ac_prefs.default_sign_reply, P_BOOL,
|
|
|
|
&privacy_page.default_sign_reply_checkbtn,
|
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
#endif
|
2004-11-17 15:16:23 +01:00
|
|
|
{"save_clear_text", "FALSE", &tmp_ac_prefs.save_encrypted_as_clear_text, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&privacy_page.save_clear_text_checkbtn,
|
2004-11-17 15:16:23 +01:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2006-04-18 18:21:10 +02:00
|
|
|
{"encrypt_to_self", "FALSE", &tmp_ac_prefs.encrypt_to_self, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&privacy_page.encrypt_to_self_checkbtn,
|
2006-04-18 18:21:10 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2004-11-23 16:57:07 +01:00
|
|
|
{"privacy_prefs", "", &privacy_prefs, P_STRING,
|
|
|
|
NULL, NULL, NULL},
|
2007-06-03 21:32:41 +02:00
|
|
|
|
|
|
|
{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static PrefParam ssl_param[] = {
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2002-05-29 10:28:56 +02:00
|
|
|
{"ssl_pop", "0", &tmp_ac_prefs.ssl_pop, P_ENUM,
|
2007-06-03 21:32:41 +02:00
|
|
|
&ssl_page.pop_nossl_radiobtn,
|
2002-05-29 10:28:56 +02:00
|
|
|
prefs_account_enum_set_data_from_radiobtn,
|
|
|
|
prefs_account_enum_set_radiobtn},
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2002-05-29 10:28:56 +02:00
|
|
|
{"ssl_imap", "0", &tmp_ac_prefs.ssl_imap, P_ENUM,
|
2007-06-03 21:32:41 +02:00
|
|
|
&ssl_page.imap_nossl_radiobtn,
|
2002-05-29 10:28:56 +02:00
|
|
|
prefs_account_enum_set_data_from_radiobtn,
|
|
|
|
prefs_account_enum_set_radiobtn},
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2002-05-31 09:06:28 +02:00
|
|
|
{"ssl_nntp", "0", &tmp_ac_prefs.ssl_nntp, P_ENUM,
|
2007-06-03 21:32:41 +02:00
|
|
|
&ssl_page.nntp_nossl_radiobtn,
|
2002-05-31 09:06:28 +02:00
|
|
|
prefs_account_enum_set_data_from_radiobtn,
|
|
|
|
prefs_account_enum_set_radiobtn},
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2001-08-27 13:07:43 +02:00
|
|
|
{"ssl_smtp", "0", &tmp_ac_prefs.ssl_smtp, P_ENUM,
|
2007-06-03 21:32:41 +02:00
|
|
|
&ssl_page.smtp_nossl_radiobtn,
|
2001-08-06 21:30:28 +02:00
|
|
|
prefs_account_enum_set_data_from_radiobtn,
|
|
|
|
prefs_account_enum_set_radiobtn},
|
2003-07-16 13:53:42 +02:00
|
|
|
|
|
|
|
{"use_nonblocking_ssl", "1", &tmp_ac_prefs.use_nonblocking_ssl, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&ssl_page.use_nonblocking_ssl_checkbtn,
|
2003-07-16 13:53:42 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
2008-07-03 22:31:33 +02:00
|
|
|
|
|
|
|
{"in_ssl_client_cert_file", "", &tmp_ac_prefs.in_ssl_client_cert_file, P_STRING,
|
|
|
|
&ssl_page.entry_in_cert_file, prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
|
|
|
{"in_ssl_client_cert_pass", "", &tmp_ac_prefs.in_ssl_client_cert_pass, P_PASSWORD,
|
|
|
|
&ssl_page.entry_in_cert_pass, prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
|
|
|
{"out_ssl_client_cert_file", "", &tmp_ac_prefs.out_ssl_client_cert_file, P_STRING,
|
|
|
|
&ssl_page.entry_out_cert_file, prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
|
|
|
{"out_ssl_client_cert_pass", "", &tmp_ac_prefs.out_ssl_client_cert_pass, P_PASSWORD,
|
|
|
|
&ssl_page.entry_out_cert_pass, prefs_set_data_from_entry, prefs_set_entry},
|
2005-09-19 19:53:13 +02:00
|
|
|
#else
|
|
|
|
{"ssl_pop", "0", &tmp_ac_prefs.ssl_pop, P_ENUM,
|
|
|
|
NULL, NULL, NULL},
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2005-09-19 19:53:13 +02:00
|
|
|
{"ssl_imap", "0", &tmp_ac_prefs.ssl_imap, P_ENUM,
|
|
|
|
NULL, NULL, NULL},
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2005-09-19 19:53:13 +02:00
|
|
|
{"ssl_nntp", "0", &tmp_ac_prefs.ssl_nntp, P_ENUM,
|
|
|
|
NULL, NULL, NULL},
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2005-09-19 19:53:13 +02:00
|
|
|
{"ssl_smtp", "0", &tmp_ac_prefs.ssl_smtp, P_ENUM,
|
|
|
|
NULL, NULL, NULL},
|
|
|
|
|
2008-07-03 22:31:33 +02:00
|
|
|
{"in_ssl_client_cert_file", "", &tmp_ac_prefs.in_ssl_client_cert_file, P_STRING,
|
|
|
|
NULL, NULL, NULL},
|
|
|
|
|
|
|
|
{"in_ssl_client_cert_pass", "", &tmp_ac_prefs.in_ssl_client_cert_pass, P_PASSWORD,
|
|
|
|
NULL, NULL, NULL},
|
|
|
|
|
|
|
|
{"out_ssl_client_cert_file", "", &tmp_ac_prefs.out_ssl_client_cert_file, P_STRING,
|
|
|
|
NULL, NULL, NULL},
|
|
|
|
|
|
|
|
{"out_ssl_client_cert_pass", "", &tmp_ac_prefs.out_ssl_client_cert_pass, P_PASSWORD,
|
|
|
|
NULL, NULL, NULL},
|
|
|
|
|
2005-09-19 19:53:13 +02:00
|
|
|
{"use_nonblocking_ssl", "1", &tmp_ac_prefs.use_nonblocking_ssl, P_BOOL,
|
|
|
|
NULL, NULL, NULL},
|
2008-10-11 16:23:27 +02:00
|
|
|
#endif /* USE_GNUTLS */
|
2001-08-06 21:30:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
static PrefParam advanced_param[] = {
|
2001-04-19 14:21:46 +02:00
|
|
|
{"set_smtpport", "FALSE", &tmp_ac_prefs.set_smtpport, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.smtpport_checkbtn,
|
2001-04-19 14:21:46 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"smtp_port", "25", &tmp_ac_prefs.smtpport, P_USHORT,
|
2007-12-19 08:40:02 +01:00
|
|
|
&advanced_page.smtpport_spinbtn,
|
|
|
|
prefs_set_data_from_spinbtn, prefs_set_spinbtn},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
{"set_popport", "FALSE", &tmp_ac_prefs.set_popport, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.popport_checkbtn,
|
2001-04-19 14:21:46 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"pop_port", "110", &tmp_ac_prefs.popport, P_USHORT,
|
2007-12-19 08:40:02 +01:00
|
|
|
&advanced_page.popport_spinbtn,
|
|
|
|
prefs_set_data_from_spinbtn, prefs_set_spinbtn},
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2001-07-04 12:14:20 +02:00
|
|
|
{"set_imapport", "FALSE", &tmp_ac_prefs.set_imapport, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.imapport_checkbtn,
|
2001-07-04 12:14:20 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"imap_port", "143", &tmp_ac_prefs.imapport, P_USHORT,
|
2007-12-19 08:40:02 +01:00
|
|
|
&advanced_page.imapport_spinbtn,
|
|
|
|
prefs_set_data_from_spinbtn, prefs_set_spinbtn},
|
2001-07-04 12:14:20 +02:00
|
|
|
|
|
|
|
{"set_nntpport", "FALSE", &tmp_ac_prefs.set_nntpport, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.nntpport_checkbtn,
|
2001-07-04 12:14:20 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"nntp_port", "119", &tmp_ac_prefs.nntpport, P_USHORT,
|
2007-12-19 08:40:02 +01:00
|
|
|
&advanced_page.nntpport_spinbtn,
|
|
|
|
prefs_set_data_from_spinbtn, prefs_set_spinbtn},
|
2001-07-04 12:14:20 +02:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
{"set_domain", "FALSE", &tmp_ac_prefs.set_domain, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.domain_checkbtn,
|
2001-04-19 14:21:46 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"domain", NULL, &tmp_ac_prefs.domain, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.domain_entry,
|
2001-04-19 14:21:46 +02:00
|
|
|
prefs_set_data_from_entry, prefs_set_entry},
|
2009-06-12 12:02:11 +02:00
|
|
|
|
2007-12-06 18:10:12 +01:00
|
|
|
#ifndef G_OS_WIN32
|
2001-12-22 12:22:38 +01:00
|
|
|
{"set_tunnelcmd", "FALSE", &tmp_ac_prefs.set_tunnelcmd, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.tunnelcmd_checkbtn,
|
2001-12-22 12:22:38 +01:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"tunnelcmd", NULL, &tmp_ac_prefs.tunnelcmd, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.tunnelcmd_entry,
|
2001-12-22 12:22:38 +01:00
|
|
|
prefs_set_data_from_entry, prefs_set_entry},
|
2007-12-06 18:10:12 +01:00
|
|
|
#endif
|
2011-10-07 11:40:16 +02:00
|
|
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
2002-03-17 10:50:46 +01:00
|
|
|
{"mark_crosspost_read", "FALSE", &tmp_ac_prefs.mark_crosspost_read, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.crosspost_checkbtn,
|
2002-03-17 10:50:46 +01:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
|
|
|
{"crosspost_color", NULL, &tmp_ac_prefs.crosspost_col, P_ENUM,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.crosspost_colormenu,
|
2002-03-17 10:50:46 +01:00
|
|
|
prefs_account_crosspost_set_data_from_colormenu,
|
|
|
|
prefs_account_crosspost_set_colormenu},
|
2011-10-07 11:40:16 +02:00
|
|
|
#endif
|
2002-03-17 10:50:46 +01:00
|
|
|
|
2002-04-21 00:57:52 +02:00
|
|
|
{"set_sent_folder", "FALSE", &tmp_ac_prefs.set_sent_folder, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.sent_folder_checkbtn,
|
2002-04-21 00:57:52 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
{"sent_folder", NULL, &tmp_ac_prefs.sent_folder, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.sent_folder_entry,
|
2002-04-21 00:57:52 +02:00
|
|
|
prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
2005-04-08 19:28:07 +02:00
|
|
|
{"set_queue_folder", "FALSE", &tmp_ac_prefs.set_queue_folder, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.queue_folder_checkbtn,
|
2005-04-08 19:28:07 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
{"queue_folder", NULL, &tmp_ac_prefs.queue_folder, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.queue_folder_entry,
|
2005-04-08 19:28:07 +02:00
|
|
|
prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
2002-04-21 00:57:52 +02:00
|
|
|
{"set_draft_folder", "FALSE", &tmp_ac_prefs.set_draft_folder, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.draft_folder_checkbtn,
|
2002-04-21 00:57:52 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
{"draft_folder", NULL, &tmp_ac_prefs.draft_folder, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.draft_folder_entry,
|
2002-04-21 00:57:52 +02:00
|
|
|
prefs_set_data_from_entry, prefs_set_entry},
|
|
|
|
|
|
|
|
{"set_trash_folder", "FALSE", &tmp_ac_prefs.set_trash_folder, P_BOOL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.trash_folder_checkbtn,
|
2002-04-21 00:57:52 +02:00
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
{"trash_folder", NULL, &tmp_ac_prefs.trash_folder, P_STRING,
|
2007-06-03 21:32:41 +02:00
|
|
|
&advanced_page.trash_folder_entry,
|
2002-04-21 00:57:52 +02:00
|
|
|
prefs_set_data_from_entry, prefs_set_entry},
|
2011-02-10 17:02:44 +01:00
|
|
|
|
|
|
|
{"imap_use_trash", "TRUE", &tmp_ac_prefs.imap_use_trash, P_BOOL,
|
|
|
|
&advanced_page.imap_use_trash_checkbtn,
|
|
|
|
prefs_set_data_from_toggle, prefs_set_toggle},
|
|
|
|
|
2002-03-17 10:50:46 +01:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
{NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
|
|
|
|
};
|
|
|
|
|
2002-09-26 09:32:06 +02:00
|
|
|
static gint prefs_account_get_new_id (void);
|
|
|
|
|
2002-04-21 00:57:52 +02:00
|
|
|
static void prefs_account_select_folder_cb (GtkWidget *widget,
|
|
|
|
gpointer data);
|
2002-09-22 18:30:27 +02:00
|
|
|
|
2005-10-13 16:54:20 +02:00
|
|
|
static void prefs_account_sigfile_radiobtn_cb (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void prefs_account_sigcmd_radiobtn_cb (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void prefs_account_signature_browse_cb (GtkWidget *widget,
|
|
|
|
gpointer data);
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2008-07-03 22:31:33 +02:00
|
|
|
static void prefs_account_in_cert_browse_cb (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
|
|
|
|
static void prefs_account_out_cert_browse_cb (GtkWidget *widget,
|
|
|
|
gpointer data);
|
2008-07-05 11:14:43 +02:00
|
|
|
#endif
|
2006-02-01 18:52:48 +01:00
|
|
|
static void prefs_account_signature_edit_cb (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
|
2002-09-22 18:30:27 +02:00
|
|
|
static void pop_bfr_smtp_tm_set_sens (GtkWidget *widget,
|
|
|
|
gpointer data);
|
|
|
|
|
2001-05-13 15:03:37 +02:00
|
|
|
static void prefs_account_edit_custom_header (void);
|
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
|
|
|
|
#define COMBOBOX_PRIVACY_PLUGIN_ID 3
|
|
|
|
|
|
|
|
/* Enable/disable necessary preference widgets based on current privacy
|
|
|
|
* system choice. */
|
|
|
|
static void privacy_system_activated(GtkWidget *combobox)
|
2005-04-10 17:21:27 +02:00
|
|
|
{
|
2007-08-06 16:54:28 +02:00
|
|
|
const gchar *system_id;
|
|
|
|
gint privacy_enabled_int;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
GtkListStore *menu = GTK_LIST_STORE(gtk_combo_box_get_model(
|
|
|
|
GTK_COMBO_BOX(combobox)));
|
|
|
|
|
|
|
|
gtk_combo_box_get_active_iter(GTK_COMBO_BOX(combobox), &iter);
|
|
|
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(menu), &iter,
|
|
|
|
COMBOBOX_PRIVACY_PLUGIN_ID, &system_id,
|
|
|
|
COMBOBOX_DATA, &privacy_enabled_int,
|
|
|
|
-1);
|
2005-04-10 17:21:27 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive (privacy_page.save_clear_text_checkbtn,
|
2009-03-31 08:41:45 +02:00
|
|
|
!gtk_toggle_button_get_active(
|
|
|
|
GTK_TOGGLE_BUTTON(privacy_page.encrypt_to_self_checkbtn)));
|
2005-04-10 17:21:27 +02:00
|
|
|
}
|
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
/* Populate the privacy system choice combobox with valid choices */
|
2007-01-20 20:54:05 +01:00
|
|
|
static void update_privacy_system_menu() {
|
2007-08-06 16:54:28 +02:00
|
|
|
GtkListStore *menu;
|
|
|
|
GtkTreeIter iter;
|
2004-11-23 16:57:07 +01:00
|
|
|
GSList *system_ids, *cur;
|
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
menu = GTK_LIST_STORE(gtk_combo_box_get_model(
|
|
|
|
GTK_COMBO_BOX(privacy_page.default_privacy_system)));
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
/* First add "None", as that one is always available. :) */
|
|
|
|
gtk_list_store_append(menu, &iter);
|
|
|
|
gtk_list_store_set(menu, &iter,
|
|
|
|
COMBOBOX_TEXT, _("None"),
|
|
|
|
COMBOBOX_DATA, 0,
|
|
|
|
COMBOBOX_SENS, TRUE,
|
|
|
|
COMBOBOX_PRIVACY_PLUGIN_ID, "",
|
|
|
|
-1);
|
2005-04-10 17:21:27 +02:00
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
/* Now go through list of available privacy systems and add an entry
|
|
|
|
* for each. */
|
2004-11-23 16:57:07 +01:00
|
|
|
system_ids = privacy_get_system_ids();
|
|
|
|
for (cur = system_ids; cur != NULL; cur = g_slist_next(cur)) {
|
|
|
|
gchar *id = (gchar *) cur->data;
|
|
|
|
const gchar *name;
|
|
|
|
|
|
|
|
name = privacy_system_get_name(id);
|
2007-08-06 16:54:28 +02:00
|
|
|
gtk_list_store_append(menu, &iter);
|
|
|
|
gtk_list_store_set(menu, &iter,
|
|
|
|
COMBOBOX_TEXT, name,
|
|
|
|
COMBOBOX_DATA, 1,
|
|
|
|
COMBOBOX_SENS, TRUE,
|
|
|
|
COMBOBOX_PRIVACY_PLUGIN_ID, id,
|
|
|
|
-1);
|
2004-11-23 16:57:07 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
#define TABLE_YPAD 2
|
|
|
|
|
|
|
|
static void basic_create_widget_func(PrefsPage * _page,
|
2004-11-23 16:57:07 +01:00
|
|
|
GtkWindow * window,
|
|
|
|
gpointer data)
|
|
|
|
{
|
2007-06-03 21:32:41 +02:00
|
|
|
BasicPage *page = (BasicPage *) _page;
|
2004-11-23 16:57:07 +01:00
|
|
|
PrefsAccount *ac_prefs = (PrefsAccount *) data;
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *vbox1;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *acname_entry;
|
|
|
|
GtkWidget *default_checkbtn;
|
|
|
|
GtkWidget *frame1;
|
|
|
|
GtkWidget *table1;
|
|
|
|
GtkWidget *name_entry;
|
|
|
|
GtkWidget *addr_entry;
|
|
|
|
GtkWidget *org_entry;
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *serv_frame;
|
|
|
|
GtkWidget *vbox2;
|
|
|
|
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;
|
|
|
|
GtkWidget *nntpserv_label;
|
|
|
|
GtkWidget *localmbox_label;
|
|
|
|
GtkWidget *mailcmd_label;
|
|
|
|
GtkWidget *recvserv_entry;
|
|
|
|
GtkWidget *smtpserv_entry;
|
|
|
|
GtkWidget *nntpserv_entry;
|
|
|
|
GtkWidget *nntpauth_checkbtn;
|
|
|
|
GtkWidget *nntpauth_onconnect_checkbtn;
|
|
|
|
GtkWidget *localmbox_entry;
|
|
|
|
GtkWidget *mailcmd_checkbtn;
|
|
|
|
GtkWidget *mailcmd_entry;
|
|
|
|
GtkWidget *uid_label;
|
|
|
|
GtkWidget *pass_label;
|
|
|
|
GtkWidget *uid_entry;
|
|
|
|
GtkWidget *pass_entry;
|
|
|
|
GtkListStore *menu;
|
|
|
|
GtkTreeIter iter;
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
struct BasicProtocol *protocol_optmenu;
|
|
|
|
gint i;
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox1 = gtk_vbox_new (FALSE, VSPACING);
|
|
|
|
gtk_widget_show (vbox1);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox1), hbox, FALSE, FALSE, 0);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
label = gtk_label_new (_("Name of account"));
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
acname_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (acname_entry);
|
|
|
|
gtk_widget_set_size_request (acname_entry, DEFAULT_ENTRY_WIDTH, -1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), acname_entry, TRUE, TRUE, 0);
|
|
|
|
|
|
|
|
default_checkbtn = gtk_check_button_new_with_label (_("Set as default"));
|
|
|
|
gtk_widget_show (default_checkbtn);
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_box_pack_end (GTK_BOX (hbox), default_checkbtn, TRUE, FALSE, 0);
|
|
|
|
#else
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox1), default_checkbtn, FALSE, FALSE, 0);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
#endif
|
|
|
|
PACK_FRAME (vbox1, frame1, _("Personal information"));
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
table1 = gtk_table_new (3, 2, FALSE);
|
|
|
|
gtk_widget_show (table1);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame1), table1);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table1), 8);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table1), VSPACING_NARROW);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
label = gtk_label_new (_("Full name"));
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_table_attach (GTK_TABLE (table1), label, 0, 1, 0, 1,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
label = gtk_label_new (_("Mail address"));
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_table_attach (GTK_TABLE (table1), label, 0, 1, 1, 2,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
label = gtk_label_new (_("Organization"));
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_table_attach (GTK_TABLE (table1), label, 0, 1, 2, 3,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
name_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (name_entry);
|
|
|
|
gtk_table_attach (GTK_TABLE (table1), name_entry, 1, 2, 0, 1,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
addr_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (addr_entry);
|
|
|
|
gtk_table_attach (GTK_TABLE (table1), addr_entry, 1, 2, 1, 2,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
2005-02-25 11:21:53 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
org_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (org_entry);
|
|
|
|
gtk_table_attach (GTK_TABLE (table1), org_entry, 1, 2, 2, 3,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox2 = gtkut_get_options_frame(vbox1, &serv_frame, _("Server information"));
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
label = gtk_label_new (_("Protocol"));
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
/* Create GtkHBox for protocol combobox and label */
|
|
|
|
optmenubox = gtk_hbox_new(FALSE, 20);
|
|
|
|
gtk_widget_show(optmenubox);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), optmenubox, FALSE, FALSE, 0);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
/* Create and populate the combobox */
|
|
|
|
optmenu = gtkut_sc_combobox_create(NULL, FALSE);
|
|
|
|
gtk_box_pack_start(GTK_BOX (optmenubox), optmenu, FALSE, FALSE, 0);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
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);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
g_signal_connect(G_OBJECT(optmenu), "changed",
|
|
|
|
G_CALLBACK(prefs_account_protocol_changed), NULL);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
/* Create protocol label, empty for now */
|
|
|
|
optlabel = gtk_label_new("");
|
|
|
|
gtk_label_set_use_markup(GTK_LABEL(optlabel), TRUE);
|
|
|
|
gtk_label_set_justify(GTK_LABEL(optlabel), GTK_JUSTIFY_CENTER);
|
|
|
|
gtk_box_pack_start(GTK_BOX (optmenubox), optlabel, FALSE, FALSE, 0);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
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"
|
2007-10-18 09:13:06 +02:00
|
|
|
"has been built without IMAP and News support.</span>"));
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_label_set_use_markup(GTK_LABEL(no_imap_warn_label), TRUE);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
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;
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
serv_table = gtk_table_new (6, 4, FALSE);
|
|
|
|
gtk_widget_show (serv_table);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), serv_table, FALSE, FALSE, 0);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (serv_table), VSPACING_NARROW);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (serv_table), 3, 0);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (serv_table), 8);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
nntpserv_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (nntpserv_entry);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), nntpserv_entry, 1, 4, 0, 1,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
/* gtk_table_set_row_spacing (GTK_TABLE (serv_table), 0, 0); */
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
nntpauth_checkbtn = gtk_check_button_new_with_label
|
|
|
|
(_("This server requires authentication"));
|
|
|
|
gtk_widget_show (nntpauth_checkbtn);
|
|
|
|
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), nntpauth_checkbtn, 0, 2, 6, 7,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
nntpauth_onconnect_checkbtn = gtk_check_button_new_with_label
|
|
|
|
(_("Authenticate on connect"));
|
|
|
|
gtk_widget_show (nntpauth_onconnect_checkbtn);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), nntpauth_onconnect_checkbtn, 2, 4, 6, 7,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
recvserv_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (recvserv_entry);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), recvserv_entry, 1, 4, 2, 3,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
localmbox_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (localmbox_entry);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), localmbox_entry, 1, 4, 3, 4,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
smtpserv_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (smtpserv_entry);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), smtpserv_entry, 1, 4, 4, 5,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
mailcmd_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (mailcmd_entry);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), mailcmd_entry, 1, 4, 6, 7,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
2007-05-31 00:35:52 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
uid_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (uid_entry);
|
|
|
|
gtk_widget_set_size_request (uid_entry, DEFAULT_ENTRY_WIDTH, -1);
|
|
|
|
pass_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (pass_entry);
|
|
|
|
gtk_widget_set_size_request (pass_entry, DEFAULT_ENTRY_WIDTH, -1);
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), uid_entry, 1, 2, 7, 8,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
2002-09-26 09:32:06 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), pass_entry, 3, 4, 7, 8,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
#else
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), uid_entry, 1, 4, 7, 8,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), pass_entry, 1, 4, 8, 9,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
#endif
|
|
|
|
gtk_entry_set_visibility (GTK_ENTRY (pass_entry), FALSE);
|
2008-01-10 18:45:25 +01:00
|
|
|
#ifdef MAEMO
|
|
|
|
hildon_gtk_entry_set_input_mode(GTK_ENTRY(pass_entry),
|
|
|
|
HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE);
|
|
|
|
#endif
|
2002-09-26 09:32:06 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
nntpserv_label = gtk_label_new (_("News server"));
|
|
|
|
gtk_widget_show (nntpserv_label);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), nntpserv_label, 0, 1, 0, 1,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (nntpserv_label), 1, 0.5);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
recvserv_label = gtk_label_new (_("Server for receiving"));
|
|
|
|
gtk_widget_show (recvserv_label);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), recvserv_label, 0, 1, 2, 3,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (recvserv_label), 1, 0.5);
|
2002-09-26 09:32:06 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
localmbox_label = gtk_label_new (_("Local mailbox"));
|
|
|
|
gtk_widget_show (localmbox_label);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), localmbox_label, 0, 1, 3, 4,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (localmbox_label), 1, 0.5);
|
|
|
|
/* gtk_table_set_row_spacing (GTK_TABLE (serv_table), 2, 0); */
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
smtpserv_label = gtk_label_new (_("SMTP server (send)"));
|
|
|
|
gtk_widget_show (smtpserv_label);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), smtpserv_label, 0, 1, 4, 5,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (smtpserv_label), 1, 0.5);
|
|
|
|
/* gtk_table_set_row_spacing (GTK_TABLE (serv_table), 2, 0); */
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
mailcmd_checkbtn = gtk_check_button_new_with_label
|
|
|
|
(_("Use mail command rather than SMTP server"));
|
|
|
|
gtk_widget_show (mailcmd_checkbtn);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), mailcmd_checkbtn, 0, 4, 5, 6,
|
|
|
|
GTK_EXPAND | GTK_FILL,
|
|
|
|
0, 0, TABLE_YPAD);
|
|
|
|
g_signal_connect(G_OBJECT(mailcmd_checkbtn), "toggled",
|
|
|
|
G_CALLBACK(prefs_account_mailcmd_toggled),
|
|
|
|
NULL);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
mailcmd_label = gtk_label_new (_("command to send mails"));
|
|
|
|
gtk_widget_show (mailcmd_label);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), mailcmd_label, 0, 1, 6, 7,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (mailcmd_label), 1, 0.5);
|
|
|
|
/* gtk_table_set_row_spacing (GTK_TABLE (serv_table), 2, 0); */
|
2005-02-01 09:58:33 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
uid_label = gtk_label_new (_("User ID"));
|
|
|
|
gtk_widget_show (uid_label);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), uid_label, 0, 1, 7, 8,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (uid_label), 1, 0.5);
|
2001-04-24 17:44:45 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
pass_label = gtk_label_new (_("Password"));
|
|
|
|
gtk_widget_show (pass_label);
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifndef GENERIC_UMPC
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), pass_label, 2, 3, 7, 8,
|
|
|
|
0, 0, 0, 0);
|
|
|
|
#else
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (pass_label), 1, 0.5);
|
|
|
|
gtk_table_attach (GTK_TABLE (serv_table), pass_label, 0, 1, 8, 9,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
#endif
|
|
|
|
SET_TOGGLE_SENSITIVITY (nntpauth_checkbtn, uid_label);
|
|
|
|
SET_TOGGLE_SENSITIVITY (nntpauth_checkbtn, pass_label);
|
|
|
|
SET_TOGGLE_SENSITIVITY (nntpauth_checkbtn, uid_entry);
|
|
|
|
SET_TOGGLE_SENSITIVITY (nntpauth_checkbtn, pass_entry);
|
|
|
|
SET_TOGGLE_SENSITIVITY (nntpauth_checkbtn, nntpauth_onconnect_checkbtn);
|
2004-11-12 07:41:50 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->acname_entry = acname_entry;
|
|
|
|
page->default_checkbtn = default_checkbtn;
|
|
|
|
|
|
|
|
page->name_entry = name_entry;
|
|
|
|
page->addr_entry = addr_entry;
|
|
|
|
page->org_entry = org_entry;
|
|
|
|
|
|
|
|
page->serv_frame = serv_frame;
|
|
|
|
page->serv_table = serv_table;
|
|
|
|
page->protocol_optmenu = (gpointer)protocol_optmenu;
|
|
|
|
page->recvserv_label = recvserv_label;
|
|
|
|
page->recvserv_entry = recvserv_entry;
|
|
|
|
page->smtpserv_label = smtpserv_label;
|
|
|
|
page->smtpserv_entry = smtpserv_entry;
|
|
|
|
page->nntpserv_label = nntpserv_label;
|
|
|
|
page->nntpserv_entry = nntpserv_entry;
|
|
|
|
page->nntpauth_checkbtn = nntpauth_checkbtn;
|
|
|
|
page->nntpauth_onconnect_checkbtn = nntpauth_onconnect_checkbtn;
|
|
|
|
page->localmbox_label = localmbox_label;
|
|
|
|
page->localmbox_entry = localmbox_entry;
|
|
|
|
page->mailcmd_checkbtn = mailcmd_checkbtn;
|
|
|
|
page->mailcmd_label = mailcmd_label;
|
|
|
|
page->mailcmd_entry = mailcmd_entry;
|
|
|
|
page->uid_label = uid_label;
|
|
|
|
page->pass_label = pass_label;
|
|
|
|
page->uid_entry = uid_entry;
|
|
|
|
page->pass_entry = pass_entry;
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (new_account) {
|
|
|
|
PrefsAccount *def_ac;
|
|
|
|
gchar *buf;
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
prefs_set_dialog_to_default(basic_param);
|
|
|
|
buf = g_strdup_printf(_("Account%d"), ac_prefs->account_id);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(basic_page.acname_entry), buf);
|
|
|
|
g_free(buf);
|
|
|
|
def_ac = account_get_default();
|
|
|
|
if (def_ac) {
|
|
|
|
FolderItem *item = folder_get_default_inbox_for_class(F_MH);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(basic_page.name_entry),
|
|
|
|
def_ac->name ? def_ac->name : "");
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(basic_page.addr_entry),
|
|
|
|
def_ac->address ? def_ac->address : "");
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(basic_page.org_entry),
|
|
|
|
def_ac->organization ? def_ac->organization : "");
|
|
|
|
if (!item) {
|
|
|
|
item = folder_get_default_inbox();
|
|
|
|
}
|
|
|
|
if (item) {
|
|
|
|
gchar *id = folder_item_get_identifier(item);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(receive_page.inbox_entry),
|
|
|
|
id);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(receive_page.local_inbox_entry),
|
|
|
|
id);
|
|
|
|
g_free(id);
|
|
|
|
}
|
2004-11-23 16:57:07 +01:00
|
|
|
}
|
2007-06-03 21:32:41 +02:00
|
|
|
} else
|
|
|
|
prefs_set_dialog(basic_param);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->vbox = vbox1;
|
|
|
|
|
|
|
|
page->page.widget = vbox1;
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void receive_create_widget_func(PrefsPage * _page,
|
|
|
|
GtkWindow * window,
|
|
|
|
gpointer data)
|
2004-11-23 16:57:07 +01:00
|
|
|
{
|
2007-06-03 21:32:41 +02:00
|
|
|
ReceivePage *page = (ReceivePage *) _page;
|
|
|
|
PrefsAccount *ac_prefs = (PrefsAccount *) data;
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *vbox1;
|
|
|
|
GtkWidget *frame1;
|
|
|
|
GtkWidget *vbox2;
|
|
|
|
GtkWidget *use_apop_checkbtn;
|
|
|
|
GtkWidget *rmmail_checkbtn;
|
|
|
|
GtkWidget *hbox_spc;
|
|
|
|
GtkWidget *leave_time_label;
|
2007-12-19 08:40:02 +01:00
|
|
|
GtkWidget *leave_time_spinbtn;
|
2008-08-28 22:17:05 +02:00
|
|
|
GtkWidget *leave_hour_label;
|
|
|
|
GtkWidget *leave_hour_spinbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *hbox1;
|
|
|
|
GtkWidget *size_limit_checkbtn;
|
2007-12-19 08:40:02 +01:00
|
|
|
GtkWidget *size_limit_spinbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *filter_on_recv_checkbtn;
|
2007-06-04 15:28:06 +02:00
|
|
|
GtkWidget *filterhook_on_recv_checkbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *vbox3;
|
|
|
|
GtkWidget *inbox_label;
|
|
|
|
GtkWidget *inbox_entry;
|
|
|
|
GtkWidget *inbox_btn;
|
|
|
|
GtkWidget *imap_frame;
|
|
|
|
GtkWidget *imapdir_label;
|
|
|
|
GtkWidget *imapdir_entry;
|
|
|
|
GtkWidget *subsonly_checkbtn;
|
|
|
|
GtkWidget *low_bandwidth_checkbtn;
|
|
|
|
GtkWidget *local_frame;
|
|
|
|
GtkWidget *local_vbox;
|
|
|
|
GtkWidget *local_hbox;
|
|
|
|
GtkWidget *local_inbox_label;
|
|
|
|
GtkWidget *local_inbox_entry;
|
|
|
|
GtkWidget *local_inbox_btn;
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *optmenu;
|
2007-07-30 08:19:32 +02:00
|
|
|
GtkListStore *menu;
|
|
|
|
GtkTreeIter iter;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *recvatgetall_checkbtn;
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *hbox2;
|
|
|
|
GtkWidget *frame2;
|
|
|
|
GtkWidget *maxarticle_label;
|
|
|
|
GtkWidget *maxarticle_spinbtn;
|
2011-10-07 11:40:16 +02:00
|
|
|
GtkAdjustment *maxarticle_spinbtn_adj;
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox1 = gtk_vbox_new (FALSE, VSPACING);
|
|
|
|
gtk_widget_show (vbox1);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
local_vbox = gtkut_get_options_frame(vbox1, &local_frame, _("Local"));
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
local_hbox = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (local_hbox);
|
|
|
|
gtk_box_pack_start (GTK_BOX (local_vbox), local_hbox, FALSE, FALSE, 0);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-10-18 11:50:59 +02:00
|
|
|
local_inbox_label = gtk_label_new (_("Default Inbox"));
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show (local_inbox_label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (local_hbox), local_inbox_label, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
local_inbox_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (local_inbox_entry);
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(local_inbox_entry,
|
|
|
|
_("Unfiltered messages will be stored in this folder"));
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_size_request (local_inbox_entry, DEFAULT_ENTRY_WIDTH, -1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (local_hbox), local_inbox_entry, TRUE, TRUE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
local_inbox_btn = gtkut_get_browse_file_btn(_("Bro_wse"));
|
|
|
|
gtk_widget_show (local_inbox_btn);
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(local_inbox_btn,
|
|
|
|
_("Unfiltered messages will be stored in this folder"));
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_box_pack_start (GTK_BOX (local_hbox), local_inbox_btn, FALSE, FALSE, 0);
|
|
|
|
g_signal_connect (G_OBJECT (local_inbox_btn), "clicked",
|
|
|
|
G_CALLBACK (prefs_account_select_folder_cb),
|
|
|
|
local_inbox_entry);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox2 = gtkut_get_options_frame(vbox1, &frame1, _("POP3"));
|
|
|
|
PACK_CHECK_BUTTON (vbox2, use_apop_checkbtn,
|
|
|
|
_("Use secure authentication (APOP)"));
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_CHECK_BUTTON (vbox2, rmmail_checkbtn,
|
|
|
|
_("Remove messages on server when received"));
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox1 = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox_spc = gtk_hbox_new (FALSE, 0);
|
|
|
|
gtk_widget_show (hbox_spc);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_set_size_request (hbox_spc, 12, -1);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
leave_time_label = gtk_label_new (_("Remove after"));
|
|
|
|
gtk_widget_show (leave_time_label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), leave_time_label, FALSE, FALSE, 0);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-12-19 08:40:02 +01:00
|
|
|
leave_time_spinbtn = gtk_spin_button_new_with_range(0, 365, 1);
|
|
|
|
gtk_widget_show (leave_time_spinbtn);
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(leave_time_spinbtn,
|
2008-08-28 22:17:05 +02:00
|
|
|
_("0 days and 0 hours : remove immediately"));
|
2007-12-19 08:40:02 +01:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), leave_time_spinbtn, FALSE, FALSE, 0);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
leave_time_label = gtk_label_new (_("days"));
|
|
|
|
gtk_widget_show (leave_time_label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), leave_time_label, FALSE, FALSE, 0);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2008-08-28 22:17:05 +02:00
|
|
|
leave_hour_spinbtn = gtk_spin_button_new_with_range(0, 23, 1);
|
|
|
|
gtk_widget_show (leave_hour_spinbtn);
|
|
|
|
CLAWS_SET_TIP(leave_hour_spinbtn,
|
|
|
|
_("0 days and 0 hours : remove immediately"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), leave_hour_spinbtn, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
leave_hour_label = gtk_label_new (_("hours"));
|
|
|
|
gtk_widget_show (leave_hour_label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), leave_hour_label, FALSE, FALSE, 0);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
SET_TOGGLE_SENSITIVITY (rmmail_checkbtn, hbox1);
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox1 = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_CHECK_BUTTON (hbox1, size_limit_checkbtn, _("Receive size limit"));
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(size_limit_checkbtn,
|
2007-06-03 21:32:41 +02:00
|
|
|
_("Messages over this limit will be partially retrieved. "
|
|
|
|
"When selecting them you will be able to download them fully "
|
2008-07-19 16:02:31 +02:00
|
|
|
"or delete them."));
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-12-19 08:40:02 +01:00
|
|
|
size_limit_spinbtn = gtk_spin_button_new_with_range(0, 100000, 1);
|
|
|
|
gtk_widget_show (size_limit_spinbtn);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), size_limit_spinbtn, FALSE, FALSE, 0);
|
2007-01-16 21:41:20 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
label = gtk_label_new (_("KB"));
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
|
2004-11-09 16:26:36 +01:00
|
|
|
|
2007-12-19 08:40:02 +01:00
|
|
|
SET_TOGGLE_SENSITIVITY (size_limit_checkbtn, size_limit_spinbtn);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
|
2001-06-06 00:56:48 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox1 = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-10-18 11:50:59 +02:00
|
|
|
inbox_label = gtk_label_new (_("Default Inbox"));
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show (inbox_label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), inbox_label, FALSE, FALSE, 0);
|
2001-05-06 22:06:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
inbox_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (inbox_entry);
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(inbox_entry,
|
|
|
|
_("Unfiltered messages will be stored in this folder"));
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_size_request (inbox_entry, DEFAULT_ENTRY_WIDTH, -1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), inbox_entry, TRUE, TRUE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
inbox_btn = gtkut_get_browse_file_btn(_("Bro_wse"));
|
|
|
|
gtk_widget_show (inbox_btn);
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(inbox_btn,
|
|
|
|
_("Unfiltered messages will be stored in this folder"));
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), inbox_btn, FALSE, FALSE, 0);
|
|
|
|
g_signal_connect (G_OBJECT (inbox_btn), "clicked",
|
|
|
|
G_CALLBACK (prefs_account_select_folder_cb),
|
|
|
|
inbox_entry);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox2 = gtkut_get_options_frame(vbox1, &frame2, _("NNTP"));
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox2 = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
maxarticle_label = gtk_label_new
|
|
|
|
(_("Maximum number of articles to download"));
|
|
|
|
gtk_widget_show (maxarticle_label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox2), maxarticle_label, FALSE, FALSE, 0);
|
2001-05-06 22:06:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
maxarticle_spinbtn_adj =
|
2012-09-19 16:48:46 +02:00
|
|
|
GTK_ADJUSTMENT(gtk_adjustment_new (300, 0, 10000, 10, 100, 0));
|
2007-06-03 21:32:41 +02:00
|
|
|
maxarticle_spinbtn = gtk_spin_button_new
|
|
|
|
(GTK_ADJUSTMENT (maxarticle_spinbtn_adj), 10, 0);
|
|
|
|
gtk_widget_show (maxarticle_spinbtn);
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(maxarticle_spinbtn,
|
|
|
|
_("unlimited if 0 is specified"));
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox2), maxarticle_spinbtn,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_set_size_request (maxarticle_spinbtn, 64, -1);
|
|
|
|
gtk_spin_button_set_numeric
|
|
|
|
(GTK_SPIN_BUTTON (maxarticle_spinbtn), TRUE);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox2 = gtkut_get_options_frame(vbox1, &imap_frame, _("IMAP4"));
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox1 = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
label = gtk_label_new (_("Authentication method"));
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
|
|
|
|
|
2007-07-30 08:19:32 +02:00
|
|
|
|
|
|
|
optmenu = gtkut_sc_combobox_create(NULL, FALSE);
|
|
|
|
menu = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(optmenu)));
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show (optmenu);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), optmenu, FALSE, FALSE, 0);
|
|
|
|
|
2007-07-30 08:19:32 +02:00
|
|
|
COMBOBOX_ADD (menu, _("Automatic"), 0);
|
2010-01-22 22:36:56 +01:00
|
|
|
COMBOBOX_ADD (menu, NULL, 0);
|
2007-07-30 08:19:32 +02:00
|
|
|
COMBOBOX_ADD (menu, "LOGIN", IMAP_AUTH_LOGIN);
|
|
|
|
COMBOBOX_ADD (menu, "CRAM-MD5", IMAP_AUTH_CRAM_MD5);
|
|
|
|
COMBOBOX_ADD (menu, "ANONYMOUS", IMAP_AUTH_ANON);
|
|
|
|
COMBOBOX_ADD (menu, "GSSAPI", IMAP_AUTH_GSSAPI);
|
2007-12-20 09:28:29 +01:00
|
|
|
COMBOBOX_ADD (menu, "DIGEST-MD5", IMAP_AUTH_DIGEST_MD5);
|
2007-06-03 21:32:41 +02:00
|
|
|
|
|
|
|
hbox1 = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 4);
|
|
|
|
|
|
|
|
imapdir_label = gtk_label_new (_("IMAP server directory"));
|
|
|
|
gtk_widget_show (imapdir_label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), imapdir_label, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
imapdir_label = gtk_label_new(_("(usually empty)"));
|
|
|
|
gtk_widget_show (imapdir_label);
|
|
|
|
gtkut_widget_set_small_font_size (imapdir_label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), imapdir_label, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
imapdir_entry = gtk_entry_new();
|
|
|
|
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_checkbtn,
|
|
|
|
_("Show subscribed folders only"));
|
|
|
|
|
|
|
|
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, low_bandwidth_checkbtn,
|
2007-11-27 20:10:20 +01:00
|
|
|
_("Bandwidth-efficient mode (prevents retrieving remote tags)"));
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(low_bandwidth_checkbtn,
|
|
|
|
_("This mode uses less bandwidth, but can be slower with some servers."));
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2009-03-30 19:20:02 +02:00
|
|
|
hbox1 = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 4);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_CHECK_BUTTON (vbox1, filter_on_recv_checkbtn,
|
|
|
|
_("Filter messages on receiving"));
|
|
|
|
|
2007-06-04 15:28:06 +02:00
|
|
|
g_signal_connect(G_OBJECT(filter_on_recv_checkbtn), "toggled",
|
|
|
|
G_CALLBACK(prefs_account_filter_on_recv_toggled),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
PACK_CHECK_BUTTON (vbox1, filterhook_on_recv_checkbtn,
|
2007-08-09 08:39:13 +02:00
|
|
|
_("Allow filtering using plugins on receiving"));
|
2007-06-04 15:28:06 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_CHECK_BUTTON
|
|
|
|
(vbox1, recvatgetall_checkbtn,
|
|
|
|
_("'Get Mail' checks for new messages on this account"));
|
|
|
|
|
|
|
|
page->pop3_frame = frame1;
|
|
|
|
page->use_apop_checkbtn = use_apop_checkbtn;
|
|
|
|
page->rmmail_checkbtn = rmmail_checkbtn;
|
2007-12-19 08:40:02 +01:00
|
|
|
page->leave_time_spinbtn = leave_time_spinbtn;
|
2008-08-28 22:17:05 +02:00
|
|
|
page->leave_hour_spinbtn = leave_hour_spinbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
page->size_limit_checkbtn = size_limit_checkbtn;
|
2007-12-19 08:40:02 +01:00
|
|
|
page->size_limit_spinbtn = size_limit_spinbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
page->filter_on_recv_checkbtn = filter_on_recv_checkbtn;
|
2007-06-04 15:28:06 +02:00
|
|
|
page->filterhook_on_recv_checkbtn = filterhook_on_recv_checkbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
page->inbox_label = inbox_label;
|
|
|
|
page->inbox_entry = inbox_entry;
|
|
|
|
page->inbox_btn = inbox_btn;
|
|
|
|
|
|
|
|
page->imap_frame = imap_frame;
|
|
|
|
page->imap_auth_type_optmenu = optmenu;
|
|
|
|
|
|
|
|
page->imapdir_label = imapdir_label;
|
2009-03-30 19:20:02 +02:00
|
|
|
page->imapdir_entry = imapdir_entry;
|
2007-06-03 21:32:41 +02:00
|
|
|
page->subsonly_checkbtn = subsonly_checkbtn;
|
2009-03-30 19:20:02 +02:00
|
|
|
page->low_bandwidth_checkbtn = low_bandwidth_checkbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
page->local_frame = local_frame;
|
|
|
|
page->local_inbox_label = local_inbox_label;
|
|
|
|
page->local_inbox_entry = local_inbox_entry;
|
|
|
|
page->local_inbox_btn = local_inbox_btn;
|
|
|
|
|
|
|
|
page->recvatgetall_checkbtn = recvatgetall_checkbtn;
|
|
|
|
|
|
|
|
page->frame_maxarticle = frame2;
|
|
|
|
page->maxarticle_spinbtn = maxarticle_spinbtn;
|
|
|
|
page->maxarticle_spinbtn_adj = maxarticle_spinbtn_adj;
|
|
|
|
|
|
|
|
tmp_ac_prefs = *ac_prefs;
|
|
|
|
|
|
|
|
if (new_account) {
|
|
|
|
prefs_set_dialog_to_default(receive_param);
|
|
|
|
} else
|
|
|
|
prefs_set_dialog(receive_param);
|
|
|
|
|
|
|
|
page->vbox = vbox1;
|
|
|
|
|
|
|
|
page->page.widget = vbox1;
|
|
|
|
}
|
2001-05-02 11:50:59 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void send_create_widget_func(PrefsPage * _page,
|
|
|
|
GtkWindow * window,
|
|
|
|
gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2007-06-03 21:32:41 +02:00
|
|
|
SendPage *page = (SendPage *) _page;
|
|
|
|
PrefsAccount *ac_prefs = (PrefsAccount *) data;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *vbox1;
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkWidget *vbox2;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *frame;
|
2007-11-08 10:13:16 +01:00
|
|
|
GtkWidget *msgid_checkbtn;
|
2011-08-29 15:00:44 +02:00
|
|
|
GtkWidget *xmailer_checkbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *customhdr_checkbtn;
|
|
|
|
GtkWidget *customhdr_edit_btn;
|
2011-02-10 17:28:26 +01:00
|
|
|
GtkWidget *checkbtn_msgid_with_addr;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *vbox3;
|
|
|
|
GtkWidget *smtp_auth_checkbtn;
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkWidget *optmenu;
|
2007-08-03 21:45:49 +02:00
|
|
|
GtkListStore *menu;
|
|
|
|
GtkTreeIter iter;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *vbox4;
|
|
|
|
GtkWidget *hbox_spc;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *smtp_uid_entry;
|
|
|
|
GtkWidget *smtp_pass_entry;
|
|
|
|
GtkWidget *vbox_spc;
|
|
|
|
GtkWidget *pop_bfr_smtp_checkbtn;
|
2007-12-19 11:48:43 +01:00
|
|
|
GtkWidget *pop_bfr_smtp_tm_spinbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *pop_auth_timeout_lbl;
|
|
|
|
GtkWidget *pop_auth_minutes_lbl;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
vbox1 = gtk_vbox_new (FALSE, VSPACING);
|
|
|
|
gtk_widget_show (vbox1);
|
2001-09-09 16:00:28 +02:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox2 = gtkut_get_options_frame(vbox1, &frame, _("Header"));
|
|
|
|
|
2007-11-08 10:13:16 +01:00
|
|
|
PACK_CHECK_BUTTON (vbox2, msgid_checkbtn, _("Generate Message-ID"));
|
|
|
|
|
2011-02-10 17:28:26 +01:00
|
|
|
PACK_CHECK_BUTTON (vbox2, checkbtn_msgid_with_addr,
|
|
|
|
_("Send account mail address in Message-ID"));
|
|
|
|
|
2011-08-29 15:00:44 +02:00
|
|
|
PACK_CHECK_BUTTON (vbox2, xmailer_checkbtn,
|
|
|
|
_("Generate X-Mailer header"));
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox = gtk_hbox_new (FALSE, 12);
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_widget_show (hbox);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_CHECK_BUTTON (hbox, customhdr_checkbtn,
|
|
|
|
_("Add user-defined header"));
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
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);
|
|
|
|
g_signal_connect (G_OBJECT (customhdr_edit_btn), "clicked",
|
|
|
|
G_CALLBACK (prefs_account_edit_custom_header),
|
|
|
|
NULL);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
SET_TOGGLE_SENSITIVITY (customhdr_checkbtn, customhdr_edit_btn);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox3 = gtkut_get_options_frame(vbox1, &frame, _("Authentication"));
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_CHECK_BUTTON (vbox3, smtp_auth_checkbtn,
|
|
|
|
_("SMTP Authentication (SMTP AUTH)"));
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox4 = gtk_vbox_new (FALSE, 0);
|
|
|
|
gtk_widget_show (vbox4);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox3), vbox4, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox4), hbox, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
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 = gtk_label_new (_("Authentication method"));
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_widget_show (label);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-08-03 21:45:49 +02:00
|
|
|
optmenu = gtkut_sc_combobox_create(NULL, FALSE);
|
|
|
|
menu = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(optmenu)));
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show (optmenu);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), optmenu, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-08-03 21:45:49 +02:00
|
|
|
COMBOBOX_ADD (menu, _("Automatic"), 0);
|
2010-01-22 22:36:56 +01:00
|
|
|
COMBOBOX_ADD (menu, NULL, 0);
|
2007-08-03 21:45:49 +02:00
|
|
|
COMBOBOX_ADD (menu, "PLAIN", SMTPAUTH_PLAIN);
|
|
|
|
COMBOBOX_ADD (menu, "LOGIN", SMTPAUTH_LOGIN);
|
|
|
|
COMBOBOX_ADD (menu, "CRAM-MD5", SMTPAUTH_CRAM_MD5);
|
|
|
|
COMBOBOX_ADD (menu, "DIGEST-MD5", SMTPAUTH_DIGEST_MD5);
|
|
|
|
gtk_list_store_set(menu, &iter, COMBOBOX_SENS, FALSE, -1);
|
2007-06-03 21:32:41 +02:00
|
|
|
|
|
|
|
PACK_VSPACER(vbox4, vbox_spc, VSPACING_NARROW_2);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
hbox = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox4), hbox, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
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 = gtk_label_new (_("User ID"));
|
2001-04-19 14:21:46 +02:00
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
smtp_uid_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (smtp_uid_entry);
|
|
|
|
gtk_widget_set_size_request (smtp_uid_entry, DEFAULT_ENTRY_WIDTH, -1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), smtp_uid_entry, TRUE, TRUE, 0);
|
2006-07-01 17:16:31 +02:00
|
|
|
|
2008-05-07 10:18:24 +02:00
|
|
|
#ifdef GENERIC_UMPC
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_VSPACER(vbox4, vbox_spc, VSPACING_NARROW_2);
|
|
|
|
hbox = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox4), hbox, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
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);
|
|
|
|
#endif
|
|
|
|
label = gtk_label_new (_("Password"));
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
smtp_pass_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (smtp_pass_entry);
|
|
|
|
gtk_widget_set_size_request (smtp_pass_entry, DEFAULT_ENTRY_WIDTH, -1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), smtp_pass_entry, TRUE, TRUE, 0);
|
2006-07-01 17:16:31 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_entry_set_visibility (GTK_ENTRY (smtp_pass_entry), FALSE);
|
2008-01-10 18:45:25 +01:00
|
|
|
#ifdef MAEMO
|
|
|
|
hildon_gtk_entry_set_input_mode(GTK_ENTRY(smtp_pass_entry),
|
|
|
|
HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE);
|
|
|
|
#endif
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_VSPACER(vbox4, vbox_spc, VSPACING_NARROW_2);
|
2006-07-01 17:16:31 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox4), hbox, FALSE, FALSE, 0);
|
2006-10-07 18:03:36 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
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);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
label = gtk_label_new
|
|
|
|
(_("If you leave these entries empty, the same "
|
|
|
|
"user ID and password as receiving will be used."));
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
|
|
|
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
|
|
|
|
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
|
|
|
|
gtkut_widget_set_small_font_size (label);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
SET_TOGGLE_SENSITIVITY (smtp_auth_checkbtn, vbox4);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_CHECK_BUTTON (vbox3, pop_bfr_smtp_checkbtn,
|
|
|
|
_("Authenticate with POP3 before sending"));
|
2003-01-27 11:33:19 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
g_signal_connect (G_OBJECT (pop_bfr_smtp_checkbtn), "clicked",
|
|
|
|
G_CALLBACK (pop_bfr_smtp_tm_set_sens),
|
|
|
|
NULL);
|
2003-01-27 11:33:19 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox3), hbox, FALSE, FALSE, 0);
|
2003-01-27 11:33:19 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
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);
|
2001-06-13 11:38:24 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
pop_auth_timeout_lbl = gtk_label_new(_("POP authentication timeout: "));
|
|
|
|
gtk_widget_show (pop_auth_timeout_lbl);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), pop_auth_timeout_lbl, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-12-19 11:48:43 +01:00
|
|
|
pop_bfr_smtp_tm_spinbtn = gtk_spin_button_new_with_range(0, 1440, 1);
|
|
|
|
gtk_widget_show (pop_bfr_smtp_tm_spinbtn);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), pop_bfr_smtp_tm_spinbtn, FALSE, FALSE, 0);
|
2001-05-02 11:50:59 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
pop_auth_minutes_lbl = gtk_label_new(_("minutes"));
|
|
|
|
gtk_widget_show (pop_auth_minutes_lbl);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), pop_auth_minutes_lbl, FALSE, FALSE, 0);
|
|
|
|
|
2007-11-08 10:13:16 +01:00
|
|
|
page->msgid_checkbtn = msgid_checkbtn;
|
2011-08-29 15:00:44 +02:00
|
|
|
page->xmailer_checkbtn = xmailer_checkbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
page->customhdr_checkbtn = customhdr_checkbtn;
|
2011-02-10 17:28:26 +01:00
|
|
|
page->msgid_with_addr_checkbtn = checkbtn_msgid_with_addr;
|
2007-06-03 21:32:41 +02:00
|
|
|
|
|
|
|
page->smtp_auth_checkbtn = smtp_auth_checkbtn;
|
|
|
|
page->smtp_auth_type_optmenu = optmenu;
|
|
|
|
page->smtp_uid_entry = smtp_uid_entry;
|
|
|
|
page->smtp_pass_entry = smtp_pass_entry;
|
|
|
|
page->pop_bfr_smtp_checkbtn = pop_bfr_smtp_checkbtn;
|
2007-12-19 11:48:43 +01:00
|
|
|
page->pop_bfr_smtp_tm_spinbtn = pop_bfr_smtp_tm_spinbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
page->pop_auth_timeout_lbl = pop_auth_timeout_lbl;
|
|
|
|
page->pop_auth_minutes_lbl = pop_auth_minutes_lbl;
|
2001-04-28 12:21:21 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
tmp_ac_prefs = *ac_prefs;
|
2001-05-01 19:29:01 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (new_account) {
|
|
|
|
prefs_set_dialog_to_default(send_param);
|
|
|
|
} else
|
|
|
|
prefs_set_dialog(send_param);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
pop_bfr_smtp_tm_set_sens (NULL, NULL);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->vbox = vbox1;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->page.widget = vbox1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void compose_create_widget_func(PrefsPage * _page,
|
|
|
|
GtkWindow * window,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
ComposePage *page = (ComposePage *) _page;
|
|
|
|
PrefsAccount *ac_prefs = (PrefsAccount *) data;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *vbox1;
|
|
|
|
GtkWidget *sig_hbox;
|
|
|
|
GtkWidget *hbox1;
|
|
|
|
GtkWidget *hbox2;
|
|
|
|
GtkWidget *frame_sig;
|
|
|
|
GtkWidget *vbox_sig;
|
|
|
|
GtkWidget *label_sigpath;
|
|
|
|
GtkWidget *checkbtn_autosig;
|
|
|
|
GtkWidget *label_sigsep;
|
|
|
|
GtkWidget *entry_sigsep;
|
|
|
|
GtkWidget *frame;
|
|
|
|
GtkWidget *table;
|
|
|
|
GtkWidget *autocc_checkbtn;
|
|
|
|
GtkWidget *autocc_entry;
|
|
|
|
GtkWidget *autobcc_checkbtn;
|
|
|
|
GtkWidget *autobcc_entry;
|
|
|
|
GtkWidget *autoreplyto_checkbtn;
|
|
|
|
GtkWidget *autoreplyto_entry;
|
2008-09-12 18:11:51 +02:00
|
|
|
#if USE_ENCHANT
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *frame_dict;
|
|
|
|
GtkWidget *table_dict;
|
|
|
|
GtkWidget *checkbtn_enable_default_dictionary = NULL;
|
2007-10-30 09:04:20 +01:00
|
|
|
GtkWidget *combo_default_dictionary = NULL;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *checkbtn_enable_default_alt_dictionary = NULL;
|
2007-10-30 09:04:20 +01:00
|
|
|
GtkWidget *combo_default_alt_dictionary = NULL;
|
2007-06-03 21:32:41 +02:00
|
|
|
#endif
|
2001-05-02 11:50:59 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox1 = gtk_vbox_new (FALSE, VSPACING);
|
|
|
|
gtk_widget_show (vbox1);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
|
2001-04-28 12:21:21 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox_sig = gtkut_get_options_frame(vbox1, &frame_sig, _("Signature"));
|
2001-05-02 05:43:13 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_CHECK_BUTTON (vbox_sig, checkbtn_autosig,
|
2009-10-17 06:10:33 +02:00
|
|
|
_("Automatically insert signature"));
|
2001-04-28 12:21:21 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox1 = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox1);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox_sig), hbox1, TRUE, TRUE, 0);
|
|
|
|
label_sigsep = gtk_label_new (_("Signature separator"));
|
|
|
|
gtk_widget_show (label_sigsep);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), label_sigsep, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
entry_sigsep = gtk_entry_new ();
|
|
|
|
gtk_widget_show (entry_sigsep);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), entry_sigsep, FALSE, FALSE, 0);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_size_request (entry_sigsep, 64, -1);
|
|
|
|
|
|
|
|
sig_hbox = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (sig_hbox);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox_sig), sig_hbox, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
sigfile_radiobtn = gtk_radio_button_new_with_label (NULL, _("File"));
|
|
|
|
gtk_widget_show (sigfile_radiobtn);
|
|
|
|
gtk_box_pack_start (GTK_BOX (sig_hbox), sigfile_radiobtn,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
g_object_set_data (G_OBJECT (sigfile_radiobtn),
|
|
|
|
MENU_VAL_ID,
|
|
|
|
GINT_TO_POINTER (SIG_FILE));
|
|
|
|
g_signal_connect(G_OBJECT(sigfile_radiobtn), "clicked",
|
|
|
|
G_CALLBACK(prefs_account_sigfile_radiobtn_cb), NULL);
|
|
|
|
|
|
|
|
sigcmd_radiobtn = gtk_radio_button_new_with_label_from_widget
|
|
|
|
(GTK_RADIO_BUTTON(sigfile_radiobtn), _("Command output"));
|
|
|
|
gtk_widget_show (sigcmd_radiobtn);
|
|
|
|
gtk_box_pack_start (GTK_BOX (sig_hbox), sigcmd_radiobtn,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
g_object_set_data (G_OBJECT (sigcmd_radiobtn),
|
|
|
|
MENU_VAL_ID,
|
|
|
|
GINT_TO_POINTER (SIG_COMMAND));
|
|
|
|
g_signal_connect(G_OBJECT(sigcmd_radiobtn), "clicked",
|
|
|
|
G_CALLBACK(prefs_account_sigcmd_radiobtn_cb), NULL);
|
|
|
|
|
|
|
|
hbox2 = gtk_hbox_new (FALSE, 8);
|
|
|
|
gtk_widget_show (hbox2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox_sig), hbox2, TRUE, TRUE, 0);
|
|
|
|
label_sigpath = gtk_label_new (_("Signature"));
|
|
|
|
gtk_widget_show (label_sigpath);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox2), label_sigpath, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
entry_sigpath = gtk_entry_new ();
|
|
|
|
gtk_widget_show (entry_sigpath);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox2), entry_sigpath, TRUE, TRUE, 0);
|
|
|
|
|
|
|
|
signature_browse_button = gtkut_get_browse_file_btn(_("Bro_wse"));
|
|
|
|
gtk_widget_show (signature_browse_button);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox2), signature_browse_button, FALSE, FALSE, 0);
|
|
|
|
g_signal_connect(G_OBJECT(signature_browse_button), "clicked",
|
|
|
|
G_CALLBACK(prefs_account_signature_browse_cb), NULL);
|
|
|
|
|
|
|
|
signature_edit_button = gtk_button_new_from_stock (GTK_STOCK_EDIT);
|
|
|
|
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",
|
|
|
|
G_CALLBACK(prefs_account_signature_edit_cb), entry_sigpath);
|
|
|
|
|
|
|
|
PACK_FRAME (vbox1, frame, _("Automatically set the following addresses"));
|
|
|
|
|
|
|
|
table = gtk_table_new (3, 2, FALSE);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
gtk_container_add (GTK_CONTAINER (frame), table);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (table), 8);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), VSPACING_NARROW_2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 8);
|
|
|
|
|
2010-02-09 22:55:04 +01:00
|
|
|
autocc_checkbtn = gtk_check_button_new_with_label (
|
|
|
|
prefs_common_translated_header_name("Cc"));
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show (autocc_checkbtn);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), autocc_checkbtn, 0, 1, 0, 1,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
|
|
|
|
autocc_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (autocc_entry);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), autocc_entry, 1, 2, 0, 1,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
SET_TOGGLE_SENSITIVITY (autocc_checkbtn, autocc_entry);
|
|
|
|
|
2010-02-09 22:55:04 +01:00
|
|
|
autobcc_checkbtn = gtk_check_button_new_with_label (
|
|
|
|
prefs_common_translated_header_name("Bcc"));
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show (autobcc_checkbtn);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), autobcc_checkbtn, 0, 1, 1, 2,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
|
|
|
|
autobcc_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (autobcc_entry);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), autobcc_entry, 1, 2, 1, 2,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
SET_TOGGLE_SENSITIVITY (autobcc_checkbtn, autobcc_entry);
|
|
|
|
|
2010-02-09 22:55:04 +01:00
|
|
|
autoreplyto_checkbtn = gtk_check_button_new_with_label (
|
|
|
|
prefs_common_translated_header_name("Reply-To"));
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show (autoreplyto_checkbtn);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), autoreplyto_checkbtn, 0, 1, 2, 3,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
|
|
|
|
autoreplyto_entry = gtk_entry_new ();
|
|
|
|
gtk_widget_show (autoreplyto_entry);
|
|
|
|
gtk_table_attach (GTK_TABLE (table), autoreplyto_entry, 1, 2, 2, 3,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL,
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0);
|
|
|
|
|
|
|
|
SET_TOGGLE_SENSITIVITY (autoreplyto_checkbtn, autoreplyto_entry);
|
|
|
|
|
2008-09-12 18:11:51 +02:00
|
|
|
#if USE_ENCHANT
|
2007-06-03 21:32:41 +02:00
|
|
|
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);
|
|
|
|
|
2008-09-12 18:11:51 +02:00
|
|
|
combo_default_dictionary = gtkaspell_dictionary_combo_new(TRUE);
|
2007-10-30 09:04:20 +01:00
|
|
|
gtk_table_attach(GTK_TABLE(table_dict), combo_default_dictionary, 1, 2,
|
2007-06-03 21:32:41 +02:00
|
|
|
0, 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
|
|
|
|
|
2007-10-30 09:04:20 +01:00
|
|
|
SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_dictionary, combo_default_dictionary);
|
2007-06-03 21:32:41 +02:00
|
|
|
|
|
|
|
/* 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);
|
|
|
|
|
2008-09-12 18:11:51 +02:00
|
|
|
combo_default_alt_dictionary = gtkaspell_dictionary_combo_new(FALSE);
|
2007-10-30 09:04:20 +01:00
|
|
|
gtk_table_attach(GTK_TABLE(table_dict), combo_default_alt_dictionary, 1, 2,
|
2007-06-03 21:32:41 +02:00
|
|
|
1, 2, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
|
|
|
|
|
2007-10-30 09:04:20 +01:00
|
|
|
SET_TOGGLE_SENSITIVITY(checkbtn_enable_default_alt_dictionary, combo_default_alt_dictionary);
|
2007-06-03 21:32:41 +02:00
|
|
|
|
|
|
|
gtk_widget_show_all(table_dict);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
page->sigfile_radiobtn = sigfile_radiobtn;
|
|
|
|
page->entry_sigpath = entry_sigpath;
|
|
|
|
page->checkbtn_autosig = checkbtn_autosig;
|
|
|
|
page->entry_sigsep = entry_sigsep;
|
|
|
|
|
|
|
|
page->autocc_checkbtn = autocc_checkbtn;
|
|
|
|
page->autocc_entry = autocc_entry;
|
|
|
|
page->autobcc_checkbtn = autobcc_checkbtn;
|
|
|
|
page->autobcc_entry = autobcc_entry;
|
|
|
|
page->autoreplyto_checkbtn = autoreplyto_checkbtn;
|
|
|
|
page->autoreplyto_entry = autoreplyto_entry;
|
2008-09-12 18:11:51 +02:00
|
|
|
#ifdef USE_ENCHANT
|
2007-06-03 21:32:41 +02:00
|
|
|
page->checkbtn_enable_default_dictionary = checkbtn_enable_default_dictionary;
|
2007-10-30 09:04:20 +01:00
|
|
|
page->combo_default_dictionary = combo_default_dictionary;
|
2007-06-03 21:32:41 +02:00
|
|
|
page->checkbtn_enable_default_alt_dictionary = checkbtn_enable_default_alt_dictionary;
|
2007-10-30 09:04:20 +01:00
|
|
|
page->combo_default_alt_dictionary = combo_default_alt_dictionary;
|
2007-06-03 21:32:41 +02:00
|
|
|
#endif
|
|
|
|
|
2008-09-12 18:11:51 +02:00
|
|
|
#ifdef USE_ENCHANT
|
2007-06-03 21:32:41 +02:00
|
|
|
/* reset gtkaspell menus */
|
2007-10-30 09:04:20 +01:00
|
|
|
if (compose_page.combo_default_dictionary != NULL) {
|
|
|
|
gtk_combo_box_set_model(GTK_COMBO_BOX(compose_page.combo_default_dictionary),
|
2008-09-12 18:11:51 +02:00
|
|
|
gtkaspell_dictionary_store_new());
|
2007-10-30 09:04:20 +01:00
|
|
|
gtk_combo_box_set_model(GTK_COMBO_BOX(compose_page.combo_default_alt_dictionary),
|
|
|
|
gtkaspell_dictionary_store_new_with_refresh(
|
2008-09-12 18:11:51 +02:00
|
|
|
FALSE));
|
2007-06-03 21:32:41 +02:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
tmp_ac_prefs = *ac_prefs;
|
|
|
|
|
|
|
|
if (new_account) {
|
|
|
|
prefs_set_dialog_to_default(compose_param);
|
|
|
|
} else
|
|
|
|
prefs_set_dialog(compose_param);
|
|
|
|
|
|
|
|
page->vbox = vbox1;
|
|
|
|
|
|
|
|
page->page.widget = vbox1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void templates_create_widget_func(PrefsPage * _page,
|
|
|
|
GtkWindow * window,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
TemplatesPage *page = (TemplatesPage *) _page;
|
|
|
|
PrefsAccount *ac_prefs = (PrefsAccount *) data;
|
|
|
|
GtkWidget *vbox;
|
2007-09-21 11:41:43 +02:00
|
|
|
GtkWidget *vbox2;
|
|
|
|
GtkWidget *notebook;
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2007-09-21 11:41:43 +02:00
|
|
|
vbox = gtk_vbox_new(FALSE, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(vbox);
|
2007-09-21 11:41:43 +02:00
|
|
|
|
|
|
|
notebook = gtk_notebook_new();
|
|
|
|
gtk_widget_show(notebook);
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), notebook, TRUE, TRUE, 0);
|
|
|
|
|
|
|
|
/* compose format */
|
|
|
|
vbox2 = gtk_vbox_new (FALSE, VSPACING);
|
|
|
|
gtk_widget_show (vbox2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox2), VBOX_BORDER);
|
2007-06-03 21:32:41 +02:00
|
|
|
|
|
|
|
quotefmt_create_new_msg_fmt_widgets(
|
|
|
|
window,
|
2007-09-21 11:41:43 +02:00
|
|
|
vbox2,
|
2007-06-03 21:32:41 +02:00
|
|
|
&page->checkbtn_compose_with_format,
|
2008-03-06 13:56:39 +01:00
|
|
|
NULL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&page->compose_subject_format,
|
|
|
|
&page->compose_body_format,
|
2011-01-06 22:50:00 +01:00
|
|
|
TRUE, NULL);
|
2007-09-21 11:41:43 +02:00
|
|
|
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox2, gtk_label_new(_("Compose")));
|
|
|
|
|
|
|
|
/* reply format */
|
|
|
|
vbox2 = gtk_vbox_new (FALSE, VSPACING);
|
|
|
|
gtk_widget_show (vbox2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox2), VBOX_BORDER);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
quotefmt_create_reply_fmt_widgets(
|
|
|
|
window,
|
2007-09-21 11:41:43 +02:00
|
|
|
vbox2,
|
2007-06-03 21:32:41 +02:00
|
|
|
&page->checkbtn_reply_with_format,
|
2008-03-06 13:56:39 +01:00
|
|
|
NULL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&page->reply_quotemark,
|
|
|
|
&page->reply_body_format,
|
2011-01-06 22:50:00 +01:00
|
|
|
TRUE, NULL);
|
2007-09-21 11:41:43 +02:00
|
|
|
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox2, gtk_label_new(_("Reply")));
|
|
|
|
|
|
|
|
/* forward format */
|
|
|
|
vbox2 = gtk_vbox_new (FALSE, VSPACING);
|
|
|
|
gtk_widget_show (vbox2);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox2), VBOX_BORDER);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
quotefmt_create_forward_fmt_widgets(
|
|
|
|
window,
|
2007-09-21 11:41:43 +02:00
|
|
|
vbox2,
|
2007-06-03 21:32:41 +02:00
|
|
|
&page->checkbtn_forward_with_format,
|
2008-03-06 13:56:39 +01:00
|
|
|
NULL,
|
2007-06-03 21:32:41 +02:00
|
|
|
&page->forward_quotemark,
|
|
|
|
&page->forward_body_format,
|
2011-01-06 22:50:00 +01:00
|
|
|
TRUE, NULL);
|
2007-09-21 11:41:43 +02:00
|
|
|
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox2, gtk_label_new(_("Forward")));
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
tmp_ac_prefs = *ac_prefs;
|
|
|
|
|
|
|
|
if (new_account) {
|
|
|
|
prefs_set_dialog_to_default(templates_param);
|
|
|
|
} else
|
|
|
|
prefs_set_dialog(templates_param);
|
|
|
|
|
|
|
|
page->vbox = vbox;
|
|
|
|
|
|
|
|
page->page.widget = vbox;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void privacy_create_widget_func(PrefsPage * _page,
|
|
|
|
GtkWindow * window,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
PrivacyPage *page = (PrivacyPage *) _page;
|
|
|
|
PrefsAccount *ac_prefs = (PrefsAccount *) data;
|
|
|
|
|
|
|
|
GtkWidget *vbox1;
|
|
|
|
GtkWidget *vbox2;
|
2002-02-21 15:56:09 +01:00
|
|
|
GtkWidget *hbox1;
|
|
|
|
GtkWidget *label;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *default_privacy_system;
|
2007-08-06 16:54:28 +02:00
|
|
|
GtkListStore *menu;
|
|
|
|
GtkCellRenderer *rend;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *default_encrypt_checkbtn;
|
|
|
|
GtkWidget *default_encrypt_reply_checkbtn;
|
|
|
|
GtkWidget *default_sign_checkbtn;
|
2008-08-28 15:09:09 +02:00
|
|
|
GtkWidget *default_sign_reply_checkbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *save_clear_text_checkbtn;
|
|
|
|
GtkWidget *encrypt_to_self_checkbtn;
|
|
|
|
|
|
|
|
vbox1 = gtk_vbox_new (FALSE, VSPACING);
|
|
|
|
gtk_widget_show (vbox1);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
|
|
|
|
|
|
|
|
vbox2 = gtk_vbox_new (FALSE, 0);
|
|
|
|
gtk_widget_show (vbox2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
hbox1 = gtk_hbox_new(FALSE, 8);
|
|
|
|
gtk_widget_show (hbox1);
|
|
|
|
gtk_container_add (GTK_CONTAINER(vbox2), hbox1);
|
|
|
|
|
|
|
|
label = gtk_label_new(_("Default privacy system"));
|
|
|
|
gtk_widget_show(label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
|
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
/* Can't use gtkut_sc_combobox_create() here, because model for this
|
|
|
|
* combobox needs an extra string column to store privacy plugin id. */
|
|
|
|
menu = gtk_list_store_new(4,
|
|
|
|
G_TYPE_STRING,
|
|
|
|
G_TYPE_INT,
|
|
|
|
G_TYPE_BOOLEAN,
|
|
|
|
G_TYPE_STRING); /* This is where we store the privacy plugin id. */
|
|
|
|
default_privacy_system = gtk_combo_box_new_with_model(GTK_TREE_MODEL(menu));
|
|
|
|
|
|
|
|
rend = gtk_cell_renderer_text_new();
|
|
|
|
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(default_privacy_system), rend, TRUE);
|
|
|
|
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(default_privacy_system), rend,
|
|
|
|
"text", COMBOBOX_TEXT,
|
|
|
|
"sensitive", COMBOBOX_SENS,
|
|
|
|
NULL);
|
|
|
|
gtk_combo_box_set_focus_on_click(GTK_COMBO_BOX(default_privacy_system), FALSE);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show (default_privacy_system);
|
|
|
|
gtk_box_pack_start (GTK_BOX(hbox1), default_privacy_system, FALSE, TRUE, 0);
|
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
g_signal_connect(G_OBJECT(default_privacy_system), "changed",
|
|
|
|
G_CALLBACK(privacy_system_activated),
|
|
|
|
NULL);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_CHECK_BUTTON (vbox2, default_sign_checkbtn,
|
|
|
|
_("Always sign messages"));
|
|
|
|
PACK_CHECK_BUTTON (vbox2, default_encrypt_checkbtn,
|
|
|
|
_("Always encrypt messages"));
|
2008-08-28 15:09:09 +02:00
|
|
|
PACK_CHECK_BUTTON (vbox2, default_sign_reply_checkbtn,
|
|
|
|
_("Always sign messages when replying to a "
|
|
|
|
"signed message"));
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_CHECK_BUTTON (vbox2, default_encrypt_reply_checkbtn,
|
|
|
|
_("Always encrypt messages when replying to an "
|
|
|
|
"encrypted message"));
|
|
|
|
PACK_CHECK_BUTTON (vbox2, encrypt_to_self_checkbtn,
|
|
|
|
_("Encrypt sent messages with your own key in addition to recipient's"));
|
|
|
|
PACK_CHECK_BUTTON (vbox2, save_clear_text_checkbtn,
|
|
|
|
_("Save sent encrypted messages as clear text"));
|
|
|
|
|
|
|
|
SET_TOGGLE_SENSITIVITY_REVERSE(encrypt_to_self_checkbtn, save_clear_text_checkbtn);
|
|
|
|
SET_TOGGLE_SENSITIVITY_REVERSE(save_clear_text_checkbtn, encrypt_to_self_checkbtn);
|
|
|
|
|
|
|
|
page->default_privacy_system = default_privacy_system;
|
|
|
|
page->default_encrypt_checkbtn = default_encrypt_checkbtn;
|
|
|
|
page->default_encrypt_reply_checkbtn = default_encrypt_reply_checkbtn;
|
2008-08-28 15:09:09 +02:00
|
|
|
page->default_sign_reply_checkbtn = default_sign_reply_checkbtn;
|
2007-06-03 21:32:41 +02:00
|
|
|
page->default_sign_checkbtn = default_sign_checkbtn;
|
|
|
|
page->save_clear_text_checkbtn = save_clear_text_checkbtn;
|
|
|
|
page->encrypt_to_self_checkbtn = encrypt_to_self_checkbtn;
|
|
|
|
|
|
|
|
update_privacy_system_menu();
|
|
|
|
|
|
|
|
tmp_ac_prefs = *ac_prefs;
|
|
|
|
|
|
|
|
if (new_account) {
|
|
|
|
prefs_set_dialog_to_default(privacy_param);
|
|
|
|
} else
|
|
|
|
prefs_set_dialog(privacy_param);
|
|
|
|
|
|
|
|
page->vbox = vbox1;
|
|
|
|
|
|
|
|
page->page.widget = vbox1;
|
|
|
|
}
|
|
|
|
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2007-06-03 21:32:41 +02:00
|
|
|
|
|
|
|
#define CREATE_RADIO_BUTTON(box, btn, btn_p, label, data) \
|
|
|
|
{ \
|
|
|
|
btn = gtk_radio_button_new_with_label_from_widget \
|
|
|
|
(GTK_RADIO_BUTTON (btn_p), label); \
|
|
|
|
gtk_widget_show (btn); \
|
|
|
|
gtk_box_pack_start (GTK_BOX (box), btn, FALSE, FALSE, 0); \
|
|
|
|
g_object_set_data (G_OBJECT (btn), \
|
|
|
|
MENU_VAL_ID, \
|
|
|
|
GINT_TO_POINTER (data)); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define CREATE_RADIO_BUTTONS(box, \
|
|
|
|
btn1, btn1_label, btn1_data, \
|
|
|
|
btn2, btn2_label, btn2_data, \
|
|
|
|
btn3, btn3_label, btn3_data) \
|
|
|
|
{ \
|
|
|
|
btn1 = gtk_radio_button_new_with_label(NULL, btn1_label); \
|
|
|
|
gtk_widget_show (btn1); \
|
|
|
|
gtk_box_pack_start (GTK_BOX (box), btn1, FALSE, FALSE, 0); \
|
|
|
|
g_object_set_data (G_OBJECT (btn1), \
|
|
|
|
MENU_VAL_ID, \
|
|
|
|
GINT_TO_POINTER (btn1_data)); \
|
|
|
|
\
|
|
|
|
CREATE_RADIO_BUTTON(box, btn2, btn1, btn2_label, btn2_data); \
|
|
|
|
CREATE_RADIO_BUTTON(box, btn3, btn1, btn3_label, btn3_data); \
|
|
|
|
}
|
|
|
|
|
2010-04-15 23:13:50 +02:00
|
|
|
static void pop_ssltunnel_toggled(GtkToggleButton *button,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gboolean active = gtk_toggle_button_get_active(button);
|
|
|
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
|
|
|
|
advanced_page.popport_checkbtn)) == TRUE)
|
|
|
|
return;
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(advanced_page.popport_spinbtn),
|
|
|
|
active ? 995 : 110);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void imap_ssltunnel_toggled(GtkToggleButton *button,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gboolean active = gtk_toggle_button_get_active(button);
|
|
|
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
|
|
|
|
advanced_page.imapport_checkbtn)) == TRUE)
|
|
|
|
return;
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(advanced_page.imapport_spinbtn),
|
|
|
|
active ? 993 : 143);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void nntp_ssltunnel_toggled(GtkToggleButton *button,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gboolean active = gtk_toggle_button_get_active(button);
|
|
|
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
|
|
|
|
advanced_page.nntpport_checkbtn)) == TRUE)
|
|
|
|
return;
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(advanced_page.nntpport_spinbtn),
|
|
|
|
active ? 563 : 119);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void smtp_ssltunnel_toggled(GtkToggleButton *button,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gboolean active = gtk_toggle_button_get_active(button);
|
|
|
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
|
|
|
|
advanced_page.smtpport_checkbtn)) == TRUE)
|
|
|
|
return;
|
|
|
|
gtk_spin_button_set_value(GTK_SPIN_BUTTON(advanced_page.smtpport_spinbtn),
|
|
|
|
active ? 465 : 25);
|
|
|
|
}
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void ssl_create_widget_func(PrefsPage * _page,
|
|
|
|
GtkWindow * window,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
SSLPage *page = (SSLPage *) _page;
|
|
|
|
PrefsAccount *ac_prefs = (PrefsAccount *) data;
|
|
|
|
|
|
|
|
GtkWidget *vbox1;
|
|
|
|
|
|
|
|
GtkWidget *pop_frame;
|
|
|
|
GtkWidget *vbox2;
|
|
|
|
GtkWidget *pop_nossl_radiobtn;
|
|
|
|
GtkWidget *pop_ssltunnel_radiobtn;
|
|
|
|
GtkWidget *pop_starttls_radiobtn;
|
|
|
|
|
2003-07-16 12:48:31 +02:00
|
|
|
GtkWidget *imap_frame;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *vbox3;
|
|
|
|
GtkWidget *imap_nossl_radiobtn;
|
|
|
|
GtkWidget *imap_ssltunnel_radiobtn;
|
|
|
|
GtkWidget *imap_starttls_radiobtn;
|
|
|
|
|
|
|
|
GtkWidget *nntp_frame;
|
|
|
|
GtkWidget *vbox4;
|
|
|
|
GtkWidget *nntp_nossl_radiobtn;
|
|
|
|
GtkWidget *nntp_ssltunnel_radiobtn;
|
|
|
|
|
|
|
|
GtkWidget *send_frame;
|
|
|
|
GtkWidget *vbox5;
|
|
|
|
GtkWidget *smtp_nossl_radiobtn;
|
|
|
|
GtkWidget *smtp_ssltunnel_radiobtn;
|
|
|
|
GtkWidget *smtp_starttls_radiobtn;
|
|
|
|
|
2008-07-03 22:31:33 +02:00
|
|
|
GtkWidget *cert_frame;
|
|
|
|
GtkWidget *cert_table;
|
|
|
|
GtkWidget *entry_in_cert_pass;
|
|
|
|
GtkWidget *entry_out_cert_pass;
|
|
|
|
|
|
|
|
GtkWidget *vbox7;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *use_nonblocking_ssl_checkbtn;
|
|
|
|
GtkWidget *hbox;
|
|
|
|
GtkWidget *hbox_spc;
|
|
|
|
GtkWidget *label;
|
|
|
|
|
|
|
|
vbox1 = gtk_vbox_new (FALSE, VSPACING);
|
|
|
|
gtk_widget_show (vbox1);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
|
|
|
|
|
|
|
|
vbox2 = gtkut_get_options_frame(vbox1, &pop_frame, _("POP3"));
|
|
|
|
|
|
|
|
CREATE_RADIO_BUTTONS(vbox2,
|
|
|
|
pop_nossl_radiobtn,
|
|
|
|
_("Don't use SSL"),
|
|
|
|
SSL_NONE,
|
|
|
|
pop_ssltunnel_radiobtn,
|
|
|
|
_("Use SSL for POP3 connection"),
|
|
|
|
SSL_TUNNEL,
|
|
|
|
pop_starttls_radiobtn,
|
|
|
|
_("Use STARTTLS command to start SSL session"),
|
|
|
|
SSL_STARTTLS);
|
2010-04-15 23:13:50 +02:00
|
|
|
g_signal_connect(G_OBJECT(pop_ssltunnel_radiobtn), "toggled",
|
|
|
|
G_CALLBACK(pop_ssltunnel_toggled), NULL);
|
2008-07-03 22:31:33 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox3 = gtkut_get_options_frame(vbox1, &imap_frame, _("IMAP4"));
|
|
|
|
|
|
|
|
CREATE_RADIO_BUTTONS(vbox3,
|
|
|
|
imap_nossl_radiobtn,
|
|
|
|
_("Don't use SSL"),
|
|
|
|
SSL_NONE,
|
|
|
|
imap_ssltunnel_radiobtn,
|
|
|
|
_("Use SSL for IMAP4 connection"),
|
|
|
|
SSL_TUNNEL,
|
|
|
|
imap_starttls_radiobtn,
|
|
|
|
_("Use STARTTLS command to start SSL session"),
|
|
|
|
SSL_STARTTLS);
|
2010-04-15 23:13:50 +02:00
|
|
|
g_signal_connect(G_OBJECT(imap_ssltunnel_radiobtn), "toggled",
|
|
|
|
G_CALLBACK(imap_ssltunnel_toggled), NULL);
|
2005-10-03 19:11:47 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox4 = gtkut_get_options_frame(vbox1, &nntp_frame, _("NNTP"));
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
nntp_nossl_radiobtn =
|
|
|
|
gtk_radio_button_new_with_label (NULL, _("Don't use SSL"));
|
|
|
|
gtk_widget_show (nntp_nossl_radiobtn);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox4), nntp_nossl_radiobtn,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
g_object_set_data (G_OBJECT (nntp_nossl_radiobtn),
|
|
|
|
MENU_VAL_ID,
|
|
|
|
GINT_TO_POINTER (SSL_NONE));
|
2005-12-05 12:03:59 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
CREATE_RADIO_BUTTON(vbox4, nntp_ssltunnel_radiobtn, nntp_nossl_radiobtn,
|
|
|
|
_("Use SSL for NNTP connection"), SSL_TUNNEL);
|
2010-04-15 23:13:50 +02:00
|
|
|
g_signal_connect(G_OBJECT(nntp_ssltunnel_radiobtn), "toggled",
|
|
|
|
G_CALLBACK(nntp_ssltunnel_toggled), NULL);
|
2003-02-19 16:58:09 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox5 = gtkut_get_options_frame(vbox1, &send_frame, _("Send (SMTP)"));
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
CREATE_RADIO_BUTTONS(vbox5,
|
|
|
|
smtp_nossl_radiobtn,
|
|
|
|
_("Don't use SSL (but, if necessary, use STARTTLS)"),
|
|
|
|
SSL_NONE,
|
|
|
|
smtp_ssltunnel_radiobtn,
|
|
|
|
_("Use SSL for SMTP connection"),
|
|
|
|
SSL_TUNNEL,
|
|
|
|
smtp_starttls_radiobtn,
|
|
|
|
_("Use STARTTLS command to start SSL session"),
|
|
|
|
SSL_STARTTLS);
|
2010-04-15 23:13:50 +02:00
|
|
|
g_signal_connect(G_OBJECT(smtp_ssltunnel_radiobtn), "toggled",
|
|
|
|
G_CALLBACK(smtp_ssltunnel_toggled), NULL);
|
2005-12-04 18:34:44 +01:00
|
|
|
|
2008-07-04 10:16:50 +02:00
|
|
|
PACK_FRAME(vbox1, cert_frame, _("Client certificates"));
|
|
|
|
|
2008-07-03 22:31:33 +02:00
|
|
|
cert_table = gtk_table_new(4,3, FALSE);
|
2008-07-04 10:16:50 +02:00
|
|
|
gtk_container_add(GTK_CONTAINER(cert_frame), cert_table);
|
|
|
|
gtk_container_set_border_width(GTK_CONTAINER(cert_table), 8);
|
|
|
|
gtk_table_set_row_spacings(GTK_TABLE(cert_table), VSPACING_NARROW_2);
|
|
|
|
gtk_table_set_col_spacings(GTK_TABLE(cert_table), 8);
|
2008-07-03 22:31:33 +02:00
|
|
|
|
2008-07-04 10:16:50 +02:00
|
|
|
label = gtk_label_new(_("Certificate for receiving"));
|
2008-07-03 22:31:33 +02:00
|
|
|
gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
|
|
|
|
entry_in_cert_file = gtk_entry_new();
|
|
|
|
in_ssl_cert_browse_button = gtkut_get_browse_file_btn(_("Browse"));
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(label,
|
|
|
|
_("Client certificate file as a PKCS12 or PEM file"));
|
|
|
|
CLAWS_SET_TIP(entry_in_cert_file,
|
|
|
|
_("Client certificate file as a PKCS12 or PEM file"));
|
2008-07-04 10:16:50 +02:00
|
|
|
gtk_table_attach(GTK_TABLE(cert_table), label, 0, 1, 0, 1, GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_table_attach(GTK_TABLE(cert_table), entry_in_cert_file, 1, 2, 0, 1,
|
|
|
|
GTK_EXPAND|GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_table_attach(GTK_TABLE(cert_table), in_ssl_cert_browse_button, 2, 3, 0, 1,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
|
|
|
|
label = gtk_label_new(_("Password"));
|
2008-07-03 22:31:33 +02:00
|
|
|
gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
|
|
|
|
entry_in_cert_pass = gtk_entry_new();
|
|
|
|
gtk_entry_set_visibility(GTK_ENTRY(entry_in_cert_pass), FALSE);
|
2008-07-04 10:16:50 +02:00
|
|
|
gtk_table_attach(GTK_TABLE(cert_table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_table_attach(GTK_TABLE(cert_table), entry_in_cert_pass, 1, 2, 1, 2,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
2008-07-03 22:31:33 +02:00
|
|
|
|
2008-07-04 10:16:50 +02:00
|
|
|
label = gtk_label_new(_("Certificate for sending"));
|
2008-07-03 22:31:33 +02:00
|
|
|
gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
|
|
|
|
entry_out_cert_file = gtk_entry_new();
|
|
|
|
out_ssl_cert_browse_button = gtkut_get_browse_file_btn(_("Browse"));
|
2008-07-19 16:02:31 +02:00
|
|
|
CLAWS_SET_TIP(label,
|
|
|
|
_("Client certificate file as a PKCS12 or PEM file"));
|
|
|
|
CLAWS_SET_TIP(entry_out_cert_file,
|
|
|
|
_("Client certificate file as a PKCS12 or PEM file"));
|
2008-07-04 10:16:50 +02:00
|
|
|
gtk_table_attach(GTK_TABLE(cert_table), label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_table_attach(GTK_TABLE(cert_table), entry_out_cert_file, 1, 2, 2, 3,
|
|
|
|
GTK_EXPAND|GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_table_attach(GTK_TABLE(cert_table), out_ssl_cert_browse_button, 2, 3, 2, 3,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
|
|
|
|
label = gtk_label_new(_("Password"));
|
2008-07-03 22:31:33 +02:00
|
|
|
gtk_misc_set_alignment(GTK_MISC(label), 1, 0.5);
|
|
|
|
entry_out_cert_pass = gtk_entry_new();
|
|
|
|
gtk_entry_set_visibility(GTK_ENTRY(entry_out_cert_pass), FALSE);
|
2008-07-04 10:16:50 +02:00
|
|
|
gtk_table_attach(GTK_TABLE(cert_table), label, 0, 1, 3, 4, GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_table_attach(GTK_TABLE(cert_table), entry_out_cert_pass, 1, 2, 3, 4,
|
|
|
|
GTK_FILL, 0, 0, 0);
|
|
|
|
gtk_widget_show_all(cert_table);
|
2008-07-03 22:31:33 +02:00
|
|
|
|
|
|
|
g_signal_connect(G_OBJECT(in_ssl_cert_browse_button), "clicked",
|
|
|
|
G_CALLBACK(prefs_account_in_cert_browse_cb), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(out_ssl_cert_browse_button), "clicked",
|
|
|
|
G_CALLBACK(prefs_account_out_cert_browse_cb), NULL);
|
|
|
|
|
|
|
|
vbox7 = gtk_vbox_new (FALSE, 0);
|
|
|
|
gtk_widget_show (vbox7);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox1), vbox7, FALSE, FALSE, 0);
|
2005-12-04 18:34:44 +01:00
|
|
|
|
2008-07-03 22:31:33 +02:00
|
|
|
PACK_CHECK_BUTTON(vbox7, use_nonblocking_ssl_checkbtn,
|
2007-06-03 21:32:41 +02:00
|
|
|
_("Use non-blocking SSL"));
|
2005-12-04 18:34:44 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
hbox = gtk_hbox_new (FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
2008-07-03 22:31:33 +02:00
|
|
|
gtk_box_pack_start (GTK_BOX (vbox7), hbox, FALSE, FALSE, 0);
|
2005-12-04 18:34:44 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
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, 16, -1);
|
2005-12-04 18:34:44 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
label = gtk_label_new
|
|
|
|
(_("Turn this off if you have SSL connection problems"));
|
|
|
|
gtk_widget_show (label);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
|
|
|
gtkut_widget_set_small_font_size (label);
|
2004-11-12 07:41:50 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->pop_frame = pop_frame;
|
|
|
|
page->pop_nossl_radiobtn = pop_nossl_radiobtn;
|
|
|
|
page->pop_ssltunnel_radiobtn = pop_ssltunnel_radiobtn;
|
|
|
|
page->pop_starttls_radiobtn = pop_starttls_radiobtn;
|
2002-06-17 12:02:21 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->imap_frame = imap_frame;
|
|
|
|
page->imap_nossl_radiobtn = imap_nossl_radiobtn;
|
|
|
|
page->imap_ssltunnel_radiobtn = imap_ssltunnel_radiobtn;
|
|
|
|
page->imap_starttls_radiobtn = imap_starttls_radiobtn;
|
2002-06-17 12:02:21 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->nntp_frame = nntp_frame;
|
|
|
|
page->nntp_nossl_radiobtn = nntp_nossl_radiobtn;
|
|
|
|
page->nntp_ssltunnel_radiobtn = nntp_ssltunnel_radiobtn;
|
2002-06-17 12:02:21 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->send_frame = send_frame;
|
|
|
|
page->smtp_nossl_radiobtn = smtp_nossl_radiobtn;
|
|
|
|
page->smtp_ssltunnel_radiobtn = smtp_ssltunnel_radiobtn;
|
|
|
|
page->smtp_starttls_radiobtn = smtp_starttls_radiobtn;
|
2002-03-19 18:13:22 +01:00
|
|
|
|
2008-07-03 22:31:33 +02:00
|
|
|
page->entry_in_cert_file = entry_in_cert_file;
|
|
|
|
page->entry_in_cert_pass = entry_in_cert_pass;
|
|
|
|
page->entry_out_cert_file = entry_out_cert_file;
|
|
|
|
page->entry_out_cert_pass = entry_out_cert_pass;
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->use_nonblocking_ssl_checkbtn = use_nonblocking_ssl_checkbtn;
|
2005-12-05 12:03:59 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
tmp_ac_prefs = *ac_prefs;
|
2002-06-17 12:02:21 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (new_account) {
|
|
|
|
prefs_set_dialog_to_default(ssl_param);
|
|
|
|
} else
|
|
|
|
prefs_set_dialog(ssl_param);
|
2002-06-17 12:02:21 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->vbox = vbox1;
|
2002-06-17 12:02:21 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->page.widget = vbox1;
|
|
|
|
}
|
2002-02-21 15:56:09 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
#undef CREATE_RADIO_BUTTONS
|
|
|
|
#undef CREATE_RADIO_BUTTON
|
2008-10-11 16:23:27 +02:00
|
|
|
#endif /* USE_GNUTLS */
|
2007-06-03 21:32:41 +02:00
|
|
|
|
|
|
|
static void advanced_create_widget_func(PrefsPage * _page,
|
|
|
|
GtkWindow * window,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
AdvancedPage *page = (AdvancedPage *) _page;
|
|
|
|
PrefsAccount *ac_prefs = (PrefsAccount *) data;
|
2002-02-21 15:56:09 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *vbox1;
|
|
|
|
GtkWidget *vbox2;
|
|
|
|
GtkWidget *hbox1;
|
|
|
|
GtkWidget *checkbtn_smtpport;
|
2007-12-19 08:40:02 +01:00
|
|
|
GtkWidget *spinbtn_smtpport;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *hbox_popport;
|
|
|
|
GtkWidget *checkbtn_popport;
|
2007-12-19 08:40:02 +01:00
|
|
|
GtkWidget *spinbtn_popport;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *hbox_imapport;
|
|
|
|
GtkWidget *checkbtn_imapport;
|
2007-12-19 08:40:02 +01:00
|
|
|
GtkWidget *spinbtn_imapport;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *hbox_nntpport;
|
|
|
|
GtkWidget *checkbtn_nntpport;
|
2007-12-19 08:40:02 +01:00
|
|
|
GtkWidget *spinbtn_nntpport;
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *checkbtn_domain;
|
|
|
|
GtkWidget *entry_domain;
|
2009-10-17 06:10:33 +02:00
|
|
|
gchar *tip_domain;
|
2011-10-07 11:40:16 +02:00
|
|
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *checkbtn_crosspost;
|
|
|
|
GtkWidget *colormenu_crosspost;
|
|
|
|
GtkWidget *menu;
|
2011-10-07 11:40:16 +02:00
|
|
|
#endif
|
2007-12-06 18:10:12 +01:00
|
|
|
#ifndef G_OS_WIN32
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *checkbtn_tunnelcmd;
|
|
|
|
GtkWidget *entry_tunnelcmd;
|
2007-12-06 18:10:12 +01:00
|
|
|
#endif
|
2007-06-03 21:32:41 +02:00
|
|
|
GtkWidget *folder_frame;
|
|
|
|
GtkWidget *vbox3;
|
|
|
|
GtkWidget *table;
|
|
|
|
GtkWidget *sent_folder_checkbtn;
|
|
|
|
GtkWidget *sent_folder_entry;
|
|
|
|
GtkWidget *queue_folder_checkbtn;
|
|
|
|
GtkWidget *queue_folder_entry;
|
|
|
|
GtkWidget *draft_folder_checkbtn;
|
|
|
|
GtkWidget *draft_folder_entry;
|
|
|
|
GtkWidget *trash_folder_checkbtn;
|
|
|
|
GtkWidget *trash_folder_entry;
|
2011-02-10 17:02:44 +01:00
|
|
|
GtkWidget *imap_use_trash_checkbtn;
|
2008-05-19 18:40:06 +02:00
|
|
|
GtkSizeGroup *size_group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
|
2007-06-03 21:32:41 +02:00
|
|
|
#define PACK_HBOX(hbox) \
|
|
|
|
{ \
|
|
|
|
hbox = gtk_hbox_new (FALSE, 8); \
|
|
|
|
gtk_widget_show (hbox); \
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0); \
|
|
|
|
}
|
2002-02-21 15:56:09 +01:00
|
|
|
|
2007-12-19 08:40:02 +01:00
|
|
|
#define PACK_PORT_SPINBTN(box, spinbtn) \
|
2007-06-03 21:32:41 +02:00
|
|
|
{ \
|
2007-12-19 08:40:02 +01:00
|
|
|
spinbtn = gtk_spin_button_new_with_range(0, 65535, 1); \
|
|
|
|
gtk_widget_show (spinbtn); \
|
|
|
|
gtk_box_pack_start (GTK_BOX (box), spinbtn, FALSE, FALSE, 0); \
|
2007-06-03 21:32:41 +02:00
|
|
|
}
|
2002-02-21 15:56:09 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox1 = gtk_vbox_new (FALSE, VSPACING);
|
|
|
|
gtk_widget_show (vbox1);
|
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
|
2002-02-21 15:56:09 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW_2);
|
|
|
|
gtk_widget_show (vbox2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_HBOX (hbox1);
|
|
|
|
PACK_CHECK_BUTTON (hbox1, checkbtn_smtpport, _("SMTP port"));
|
2007-12-19 08:40:02 +01:00
|
|
|
PACK_PORT_SPINBTN (hbox1, spinbtn_smtpport);
|
|
|
|
SET_TOGGLE_SENSITIVITY (checkbtn_smtpport, spinbtn_smtpport);
|
2008-05-19 18:40:06 +02:00
|
|
|
gtk_size_group_add_widget(size_group, checkbtn_smtpport);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_HBOX (hbox_popport);
|
|
|
|
PACK_CHECK_BUTTON (hbox_popport, checkbtn_popport,
|
|
|
|
_("POP3 port"));
|
2007-12-19 08:40:02 +01:00
|
|
|
PACK_PORT_SPINBTN (hbox_popport, spinbtn_popport);
|
|
|
|
SET_TOGGLE_SENSITIVITY (checkbtn_popport, spinbtn_popport);
|
2008-05-19 18:40:06 +02:00
|
|
|
gtk_size_group_add_widget(size_group, checkbtn_popport);
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_HBOX (hbox_imapport);
|
|
|
|
PACK_CHECK_BUTTON (hbox_imapport, checkbtn_imapport,
|
|
|
|
_("IMAP4 port"));
|
2007-12-19 08:40:02 +01:00
|
|
|
PACK_PORT_SPINBTN (hbox_imapport, spinbtn_imapport);
|
|
|
|
SET_TOGGLE_SENSITIVITY (checkbtn_imapport, spinbtn_imapport);
|
2008-05-19 18:40:06 +02:00
|
|
|
gtk_size_group_add_widget(size_group, checkbtn_imapport);
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_HBOX (hbox_nntpport);
|
|
|
|
PACK_CHECK_BUTTON (hbox_nntpport, checkbtn_nntpport,
|
|
|
|
_("NNTP port"));
|
2007-12-19 08:40:02 +01:00
|
|
|
PACK_PORT_SPINBTN (hbox_nntpport, spinbtn_nntpport);
|
|
|
|
SET_TOGGLE_SENSITIVITY (checkbtn_nntpport, spinbtn_nntpport);
|
2008-05-19 18:40:06 +02:00
|
|
|
gtk_size_group_add_widget(size_group, checkbtn_nntpport);
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_HBOX (hbox1);
|
|
|
|
PACK_CHECK_BUTTON (hbox1, checkbtn_domain, _("Domain name"));
|
2008-05-19 18:40:06 +02:00
|
|
|
gtk_size_group_add_widget(size_group, checkbtn_domain);
|
|
|
|
|
2009-10-17 06:10:33 +02:00
|
|
|
tip_domain = _("The domain name will be used in the generated "
|
|
|
|
"Message-ID, and when connecting to SMTP servers.");
|
|
|
|
|
|
|
|
CLAWS_SET_TIP(checkbtn_domain, tip_domain);
|
2007-06-03 21:32:41 +02:00
|
|
|
|
|
|
|
entry_domain = gtk_entry_new ();
|
|
|
|
gtk_widget_show (entry_domain);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), entry_domain, TRUE, TRUE, 0);
|
|
|
|
SET_TOGGLE_SENSITIVITY (checkbtn_domain, entry_domain);
|
2009-10-17 06:10:33 +02:00
|
|
|
CLAWS_SET_TIP(entry_domain, tip_domain);
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2007-12-06 18:10:12 +01:00
|
|
|
#ifndef G_OS_WIN32
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_HBOX (hbox1);
|
|
|
|
PACK_CHECK_BUTTON (hbox1, checkbtn_tunnelcmd,
|
|
|
|
_("Use command to communicate with server"));
|
|
|
|
entry_tunnelcmd = gtk_entry_new ();
|
|
|
|
gtk_widget_show (entry_tunnelcmd);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), entry_tunnelcmd, TRUE, TRUE, 0);
|
|
|
|
SET_TOGGLE_SENSITIVITY (checkbtn_tunnelcmd, entry_tunnelcmd);
|
2007-12-06 18:10:12 +01:00
|
|
|
#endif
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_HBOX (hbox1);
|
2011-02-10 17:02:44 +01:00
|
|
|
PACK_CHECK_BUTTON (hbox1, imap_use_trash_checkbtn,
|
|
|
|
_("Move deleted mails to trash and expunge immediately"));
|
|
|
|
CLAWS_SET_TIP(imap_use_trash_checkbtn,
|
|
|
|
_("Moves deleted mails to trash instead of using the \\Deleted flag without expunging."));
|
|
|
|
|
2011-10-07 11:40:16 +02:00
|
|
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_CHECK_BUTTON (hbox1, checkbtn_crosspost,
|
|
|
|
_("Mark cross-posted messages as read and color:"));
|
|
|
|
g_signal_connect (G_OBJECT (checkbtn_crosspost), "toggled",
|
|
|
|
G_CALLBACK (crosspost_color_toggled),
|
|
|
|
NULL);
|
|
|
|
|
2008-08-05 08:37:13 +02:00
|
|
|
colormenu_crosspost = gtk_cmoption_menu_new();
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show (colormenu_crosspost);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox1), colormenu_crosspost, FALSE, FALSE, 0);
|
|
|
|
|
|
|
|
menu = colorlabel_create_color_menu();
|
2008-08-05 08:37:13 +02:00
|
|
|
gtk_cmoption_menu_set_menu (GTK_CMOPTION_MENU(colormenu_crosspost), menu);
|
2007-06-03 21:32:41 +02:00
|
|
|
SET_TOGGLE_SENSITIVITY(checkbtn_crosspost, colormenu_crosspost);
|
2011-10-07 11:40:16 +02:00
|
|
|
#endif
|
2003-02-19 16:58:09 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PACK_HBOX (hbox1);
|
|
|
|
#undef PACK_HBOX
|
2007-12-19 08:40:02 +01:00
|
|
|
#undef PACK_PORT_SPINBTN
|
2005-12-05 12:03:59 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
/* special folder setting (maybe these options are redundant) */
|
2005-12-05 12:03:59 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
vbox3 = gtkut_get_options_frame(vbox1, &folder_frame, _("Folder"));
|
2003-02-19 16:58:09 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
table = gtk_table_new (4, 3, FALSE);
|
|
|
|
gtk_widget_show (table);
|
|
|
|
gtk_container_add (GTK_CONTAINER (vbox3), table);
|
|
|
|
gtk_table_set_row_spacings (GTK_TABLE (table), VSPACING_NARROW_2);
|
|
|
|
gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
2003-02-19 16:58:09 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
#define SET_CHECK_BTN_AND_ENTRY(label, checkbtn, entry, n) \
|
|
|
|
{ \
|
|
|
|
GtkWidget *button; \
|
|
|
|
\
|
|
|
|
checkbtn = gtk_check_button_new_with_label (label); \
|
|
|
|
gtk_widget_show (checkbtn); \
|
|
|
|
gtk_table_attach (GTK_TABLE (table), checkbtn, \
|
|
|
|
0, 1, n, n + 1, GTK_FILL, 0, 0, 0); \
|
|
|
|
\
|
|
|
|
entry = gtk_entry_new (); \
|
|
|
|
gtk_widget_show (entry); \
|
|
|
|
gtk_table_attach (GTK_TABLE (table), entry, 1, 2, n, n + 1, \
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, \
|
|
|
|
GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); \
|
|
|
|
\
|
|
|
|
button = gtkut_get_browse_file_btn(_("Browse")); \
|
|
|
|
gtk_widget_show (button); \
|
|
|
|
gtk_table_attach (GTK_TABLE (table), button, \
|
|
|
|
2, 3, n, n + 1, GTK_FILL, 0, 0, 0); \
|
|
|
|
g_signal_connect \
|
|
|
|
(G_OBJECT (button), "clicked", \
|
|
|
|
G_CALLBACK (prefs_account_select_folder_cb), \
|
|
|
|
entry); \
|
|
|
|
\
|
|
|
|
SET_TOGGLE_SENSITIVITY (checkbtn, entry); \
|
|
|
|
SET_TOGGLE_SENSITIVITY (checkbtn, button); \
|
|
|
|
}
|
2003-07-16 12:48:31 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
SET_CHECK_BTN_AND_ENTRY(_("Put sent messages in"),
|
|
|
|
sent_folder_checkbtn, sent_folder_entry, 0);
|
|
|
|
SET_CHECK_BTN_AND_ENTRY(_("Put queued messages in"),
|
|
|
|
queue_folder_checkbtn, queue_folder_entry, 1);
|
|
|
|
SET_CHECK_BTN_AND_ENTRY(_("Put draft messages in"),
|
|
|
|
draft_folder_checkbtn, draft_folder_entry, 2);
|
|
|
|
SET_CHECK_BTN_AND_ENTRY(_("Put deleted messages in"),
|
|
|
|
trash_folder_checkbtn, trash_folder_entry, 3);
|
2003-07-16 12:48:31 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->smtpport_checkbtn = checkbtn_smtpport;
|
2007-12-19 08:40:02 +01:00
|
|
|
page->smtpport_spinbtn = spinbtn_smtpport;
|
2007-06-03 21:32:41 +02:00
|
|
|
page->popport_hbox = hbox_popport;
|
|
|
|
page->popport_checkbtn = checkbtn_popport;
|
2007-12-19 08:40:02 +01:00
|
|
|
page->popport_spinbtn = spinbtn_popport;
|
2007-06-03 21:32:41 +02:00
|
|
|
page->imapport_hbox = hbox_imapport;
|
|
|
|
page->imapport_checkbtn = checkbtn_imapport;
|
2007-12-19 08:40:02 +01:00
|
|
|
page->imapport_spinbtn = spinbtn_imapport;
|
2007-06-03 21:32:41 +02:00
|
|
|
page->nntpport_hbox = hbox_nntpport;
|
|
|
|
page->nntpport_checkbtn = checkbtn_nntpport;
|
2007-12-19 08:40:02 +01:00
|
|
|
page->nntpport_spinbtn = spinbtn_nntpport;
|
2007-06-03 21:32:41 +02:00
|
|
|
page->domain_checkbtn = checkbtn_domain;
|
|
|
|
page->domain_entry = entry_domain;
|
2011-10-07 11:40:16 +02:00
|
|
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
2007-06-03 21:32:41 +02:00
|
|
|
page->crosspost_checkbtn = checkbtn_crosspost;
|
|
|
|
page->crosspost_colormenu = colormenu_crosspost;
|
2011-10-07 11:40:16 +02:00
|
|
|
#endif
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2007-12-06 18:10:12 +01:00
|
|
|
#ifndef G_OS_WIN32
|
2007-06-03 21:32:41 +02:00
|
|
|
page->tunnelcmd_checkbtn = checkbtn_tunnelcmd;
|
|
|
|
page->tunnelcmd_entry = entry_tunnelcmd;
|
2007-12-06 18:10:12 +01:00
|
|
|
#endif
|
2007-06-03 21:32:41 +02:00
|
|
|
page->sent_folder_checkbtn = sent_folder_checkbtn;
|
|
|
|
page->sent_folder_entry = sent_folder_entry;
|
|
|
|
page->queue_folder_checkbtn = queue_folder_checkbtn;
|
|
|
|
page->queue_folder_entry = queue_folder_entry;
|
|
|
|
page->draft_folder_checkbtn = draft_folder_checkbtn;
|
|
|
|
page->draft_folder_entry = draft_folder_entry;
|
|
|
|
page->trash_folder_checkbtn = trash_folder_checkbtn;
|
|
|
|
page->trash_folder_entry = trash_folder_entry;
|
2011-02-10 17:02:44 +01:00
|
|
|
page->imap_use_trash_checkbtn = imap_use_trash_checkbtn;
|
2003-07-16 12:48:31 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
tmp_ac_prefs = *ac_prefs;
|
2003-07-16 12:48:31 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (new_account) {
|
|
|
|
prefs_set_dialog_to_default(advanced_param);
|
|
|
|
} else
|
|
|
|
prefs_set_dialog(advanced_param);
|
2003-07-16 12:48:31 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->vbox = vbox1;
|
2003-07-16 12:48:31 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
page->page.widget = vbox1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint prefs_basic_apply(void)
|
|
|
|
{
|
|
|
|
RecvProtocol protocol;
|
|
|
|
gchar *old_id = NULL;
|
|
|
|
gchar *new_id = NULL;
|
|
|
|
struct BasicProtocol *protocol_optmenu = (struct BasicProtocol *) basic_page.protocol_optmenu;
|
|
|
|
GtkWidget *optmenu = protocol_optmenu->combobox;
|
2003-07-16 12:48:31 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
protocol = combobox_get_active_data(GTK_COMBO_BOX(optmenu));
|
2005-10-03 19:11:47 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (*gtk_entry_get_text(GTK_ENTRY(basic_page.acname_entry)) == '\0') {
|
|
|
|
alertpanel_error(_("Account name is not entered."));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (*gtk_entry_get_text(GTK_ENTRY(basic_page.addr_entry)) == '\0') {
|
|
|
|
alertpanel_error(_("Mail address is not entered."));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (((protocol == A_POP3) ||
|
|
|
|
(protocol == A_LOCAL && !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(basic_page.mailcmd_checkbtn))) ||
|
|
|
|
(protocol == A_NONE)) &&
|
|
|
|
*gtk_entry_get_text(GTK_ENTRY(basic_page.smtpserv_entry)) == '\0') {
|
|
|
|
alertpanel_error(_("SMTP server is not entered."));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if ((protocol == A_POP3 || protocol == A_IMAP4) &&
|
|
|
|
*gtk_entry_get_text(GTK_ENTRY(basic_page.uid_entry)) == '\0') {
|
|
|
|
alertpanel_error(_("User ID is not entered."));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (protocol == A_POP3 &&
|
|
|
|
*gtk_entry_get_text(GTK_ENTRY(basic_page.recvserv_entry)) == '\0') {
|
|
|
|
alertpanel_error(_("POP3 server is not entered."));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (protocol == A_POP3 || protocol == A_LOCAL) {
|
|
|
|
GtkWidget *inbox_entry = (protocol == A_POP3 ? receive_page.inbox_entry : receive_page.local_inbox_entry );
|
|
|
|
const gchar *mailbox = gtk_entry_get_text(GTK_ENTRY(inbox_entry));
|
|
|
|
FolderItem *inbox = folder_find_item_from_identifier(mailbox);
|
2008-03-24 09:40:25 +01:00
|
|
|
if (!inbox) {
|
2007-06-03 21:32:41 +02:00
|
|
|
gchar *id = NULL;
|
|
|
|
setup_write_mailbox_path(mainwindow_get_mainwindow(), "Mail");
|
|
|
|
id = folder_item_get_identifier(folder_get_default_inbox_for_class(F_MH));
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(receive_page.inbox_entry),
|
|
|
|
id);
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(receive_page.local_inbox_entry),
|
|
|
|
id);
|
|
|
|
g_free(id);
|
|
|
|
mailbox = gtk_entry_get_text(GTK_ENTRY(inbox_entry));
|
|
|
|
inbox = folder_find_item_from_identifier(mailbox);
|
|
|
|
}
|
|
|
|
if (inbox == NULL) {
|
2007-10-18 11:50:59 +02:00
|
|
|
alertpanel_error(_("The default Inbox folder doesn't exist."));
|
2007-06-03 21:32:41 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (protocol == A_IMAP4 &&
|
|
|
|
*gtk_entry_get_text(GTK_ENTRY(basic_page.recvserv_entry)) == '\0') {
|
|
|
|
alertpanel_error(_("IMAP4 server is not entered."));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (protocol == A_NNTP &&
|
|
|
|
*gtk_entry_get_text(GTK_ENTRY(basic_page.nntpserv_entry)) == '\0') {
|
|
|
|
alertpanel_error(_("NNTP server is not entered."));
|
|
|
|
return -1;
|
|
|
|
}
|
2005-12-05 12:03:59 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (protocol == A_LOCAL &&
|
|
|
|
*gtk_entry_get_text(GTK_ENTRY(basic_page.localmbox_entry)) == '\0') {
|
|
|
|
alertpanel_error(_("local mailbox filename is not entered."));
|
|
|
|
return -1;
|
|
|
|
}
|
2005-10-03 19:11:47 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (protocol == A_LOCAL &&
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(basic_page.mailcmd_checkbtn)) && *gtk_entry_get_text(GTK_ENTRY(basic_page.mailcmd_entry)) == '\0') {
|
|
|
|
alertpanel_error(_("mail command is not entered."));
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (protocol == A_IMAP4 || protocol == A_NNTP)
|
|
|
|
old_id = g_strdup_printf("#%s/%s",
|
2011-04-08 18:55:53 +02:00
|
|
|
protocol == A_IMAP4 ? "imap":"news",
|
2007-06-03 21:32:41 +02:00
|
|
|
tmp_ac_prefs.account_name ? tmp_ac_prefs.account_name : "(null)");
|
|
|
|
|
|
|
|
prefs_set_data_from_dialog(basic_param);
|
|
|
|
|
|
|
|
if (protocol == A_IMAP4 || protocol == A_NNTP) {
|
|
|
|
new_id = g_strdup_printf("#%s/%s",
|
2011-04-08 18:55:53 +02:00
|
|
|
protocol == A_IMAP4 ? "imap":"news",
|
2007-06-03 21:32:41 +02:00
|
|
|
tmp_ac_prefs.account_name);
|
|
|
|
if (old_id != NULL && new_id != NULL)
|
|
|
|
prefs_filtering_rename_path(old_id, new_id);
|
|
|
|
g_free(old_id);
|
|
|
|
g_free(new_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2005-10-03 19:11:47 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gint prefs_receive_apply(void)
|
|
|
|
{
|
|
|
|
prefs_set_data_from_dialog(receive_param);
|
|
|
|
return 0;
|
|
|
|
}
|
2007-01-16 21:41:20 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gint prefs_send_apply(void)
|
|
|
|
{
|
|
|
|
prefs_set_data_from_dialog(send_param);
|
|
|
|
return 0;
|
|
|
|
}
|
2007-01-16 21:41:20 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gint prefs_compose_apply(void)
|
|
|
|
{
|
|
|
|
prefs_set_data_from_dialog(compose_param);
|
|
|
|
return 0;
|
|
|
|
}
|
2007-04-27 19:12:06 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gint prefs_templates_apply(void)
|
|
|
|
{
|
|
|
|
prefs_set_data_from_dialog(templates_param);
|
|
|
|
return 0;
|
|
|
|
}
|
2007-04-27 19:12:06 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gint prefs_privacy_apply(void)
|
|
|
|
{
|
|
|
|
prefs_set_data_from_dialog(privacy_param);
|
|
|
|
return 0;
|
|
|
|
}
|
2003-02-19 16:58:09 +01:00
|
|
|
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2007-06-03 21:32:41 +02:00
|
|
|
static gint prefs_ssl_apply(void)
|
|
|
|
{
|
|
|
|
prefs_set_data_from_dialog(ssl_param);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
2002-02-21 15:56:09 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gint prefs_advanced_apply(void)
|
|
|
|
{
|
|
|
|
prefs_set_data_from_dialog(advanced_param);
|
|
|
|
return 0;
|
|
|
|
}
|
2002-06-10 23:55:17 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void basic_destroy_widget_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
/* BasicPage *page = (BasicPage *) _page; */
|
|
|
|
}
|
2003-07-16 12:48:31 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void receive_destroy_widget_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
/* ReceivePage *page = (ReceivePage *) _page; */
|
|
|
|
}
|
2005-12-04 18:34:44 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void send_destroy_widget_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
/* SendPage *page = (SendPage *) _page; */
|
|
|
|
}
|
2003-02-19 16:58:09 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void compose_destroy_widget_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
/* ComposePage *page = (ComposePage *) _page; */
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void templates_destroy_widget_func(PrefsPage *_page)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2007-06-03 21:32:41 +02:00
|
|
|
/* TemplatesPage *page = (TemplatesPage *) _page; */
|
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void privacy_destroy_widget_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
/* PrivacyPage *page = (PrivacyPage *) _page; */
|
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2007-06-03 21:32:41 +02:00
|
|
|
static void ssl_destroy_widget_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
/* SSLPage *page = (SSLPage *) _page; */
|
|
|
|
}
|
|
|
|
#endif
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void advanced_destroy_widget_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
/* AdvancedPage *page = (AdvancedPage *) _page; */
|
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gboolean basic_can_close_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
BasicPage *page = (BasicPage *) _page;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return TRUE;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
return prefs_basic_apply() >= 0;
|
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gboolean receive_can_close_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
ReceivePage *page = (ReceivePage *) _page;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return TRUE;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
return prefs_receive_apply() >= 0;
|
|
|
|
}
|
2001-11-01 21:00:42 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gboolean send_can_close_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
SendPage *page = (SendPage *) _page;
|
2002-01-11 16:01:47 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return TRUE;
|
2002-01-11 16:01:47 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
return prefs_send_apply() >= 0;
|
|
|
|
}
|
2002-02-28 11:06:43 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gboolean compose_can_close_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
ComposePage *page = (ComposePage *) _page;
|
2002-06-28 10:08:36 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return TRUE;
|
2002-06-28 10:08:36 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
return prefs_compose_apply() >= 0;
|
|
|
|
}
|
2002-06-28 10:08:36 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gboolean templates_can_close_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
TemplatesPage *page = (TemplatesPage *) _page;
|
2002-06-28 10:08:36 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return TRUE;
|
2002-06-28 10:08:36 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
return prefs_templates_apply() >= 0;
|
|
|
|
}
|
2002-06-28 10:08:36 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gboolean privacy_can_close_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
PrivacyPage *page = (PrivacyPage *) _page;
|
2002-06-28 10:08:36 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return TRUE;
|
2002-06-28 10:08:36 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
return prefs_privacy_apply() >= 0;
|
|
|
|
}
|
2002-01-11 16:01:47 +01:00
|
|
|
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2007-06-03 21:32:41 +02:00
|
|
|
static gboolean ssl_can_close_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
SSLPage *page = (SSLPage *) _page;
|
2001-11-01 21:00:42 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return TRUE;
|
2007-03-31 17:08:05 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
return prefs_ssl_apply() >= 0;
|
|
|
|
}
|
2007-03-31 17:08:05 +02:00
|
|
|
#endif
|
2001-10-13 19:00:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gboolean advanced_can_close_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
AdvancedPage *page = (AdvancedPage *) _page;
|
2001-10-13 19:00:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return TRUE;
|
2001-10-13 19:00:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
return prefs_advanced_apply() >= 0;
|
|
|
|
}
|
2002-02-28 11:06:43 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void basic_save_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
BasicPage *page = (BasicPage *) _page;
|
2001-10-13 19:00:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return;
|
2002-01-11 16:01:47 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (prefs_basic_apply() >= 0)
|
|
|
|
cancelled = FALSE;
|
|
|
|
}
|
2001-10-13 19:00:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void receive_save_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
ReceivePage *page = (ReceivePage *) _page;
|
2002-09-22 18:30:27 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return;
|
2002-09-22 18:30:27 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (prefs_receive_apply() >= 0)
|
|
|
|
cancelled = FALSE;
|
|
|
|
}
|
2002-09-22 18:30:27 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void send_save_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
SendPage *page = (SendPage *) _page;
|
2002-09-22 18:30:27 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return;
|
2002-09-22 18:30:27 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (prefs_send_apply() >= 0)
|
|
|
|
cancelled = FALSE;
|
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void compose_save_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
ComposePage *page = (ComposePage *) _page;
|
2002-09-22 18:30:27 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (prefs_compose_apply() >= 0)
|
|
|
|
cancelled = FALSE;
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void templates_save_func(PrefsPage *_page)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
2007-06-03 21:32:41 +02:00
|
|
|
TemplatesPage *page = (TemplatesPage *) _page;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
quotefmt_check_new_msg_formats(tmp_ac_prefs.compose_with_format,
|
2008-03-06 13:56:39 +01:00
|
|
|
NULL,
|
2007-06-03 21:32:41 +02:00
|
|
|
tmp_ac_prefs.compose_subject_format,
|
|
|
|
tmp_ac_prefs.compose_body_format);
|
|
|
|
quotefmt_check_reply_formats(tmp_ac_prefs.reply_with_format,
|
2008-03-06 13:56:39 +01:00
|
|
|
NULL,
|
2007-06-05 19:28:28 +02:00
|
|
|
tmp_ac_prefs.reply_quotemark,
|
2007-06-03 21:32:41 +02:00
|
|
|
tmp_ac_prefs.reply_body_format);
|
|
|
|
quotefmt_check_forward_formats(tmp_ac_prefs.forward_with_format,
|
2008-03-06 13:56:39 +01:00
|
|
|
NULL,
|
2007-06-05 19:28:28 +02:00
|
|
|
tmp_ac_prefs.forward_quotemark,
|
2007-06-03 21:32:41 +02:00
|
|
|
tmp_ac_prefs.forward_body_format);
|
|
|
|
if (prefs_templates_apply() >= 0)
|
|
|
|
cancelled = FALSE;
|
|
|
|
}
|
2003-02-14 17:45:54 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void privacy_save_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
PrivacyPage *page = (PrivacyPage *) _page;
|
2003-02-28 18:58:42 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!page->page.page_open)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (prefs_privacy_apply() >= 0)
|
|
|
|
cancelled = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2007-06-03 21:32:41 +02:00
|
|
|
static void ssl_save_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
SSLPage *page = (SSLPage *) _page;
|
|
|
|
|
|
|
|
if (!page->page.page_open)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (prefs_ssl_apply() >= 0)
|
|
|
|
cancelled = FALSE;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static void advanced_save_func(PrefsPage *_page)
|
|
|
|
{
|
|
|
|
AdvancedPage *page = (AdvancedPage *) _page;
|
|
|
|
|
|
|
|
if (!page->page.page_open)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (prefs_advanced_apply() >= 0)
|
|
|
|
cancelled = FALSE;
|
|
|
|
}
|
2003-02-28 18:58:42 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void register_basic_page(void)
|
|
|
|
{
|
|
|
|
static gchar *path[3];
|
2003-02-28 18:58:42 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
path[0] = _("Account");
|
|
|
|
path[1] = _("Basic");
|
|
|
|
path[2] = NULL;
|
|
|
|
|
|
|
|
basic_page.page.path = path;
|
|
|
|
basic_page.page.weight = 1000.0;
|
|
|
|
basic_page.page.create_widget = basic_create_widget_func;
|
|
|
|
basic_page.page.destroy_widget = basic_destroy_widget_func;
|
|
|
|
basic_page.page.save_page = basic_save_func;
|
|
|
|
basic_page.page.can_close = basic_can_close_func;
|
|
|
|
|
|
|
|
prefs_account_register_page((PrefsPage *) &basic_page);
|
|
|
|
}
|
2003-02-28 18:58:42 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void register_receive_page(void)
|
|
|
|
{
|
|
|
|
static gchar *path[3];
|
2003-02-28 17:05:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
path[0] = _("Account");
|
|
|
|
path[1] = _("Receive");
|
|
|
|
path[2] = NULL;
|
|
|
|
|
|
|
|
receive_page.page.path = path;
|
|
|
|
receive_page.page.weight = 1000.0;
|
|
|
|
receive_page.page.create_widget = receive_create_widget_func;
|
|
|
|
receive_page.page.destroy_widget = receive_destroy_widget_func;
|
|
|
|
receive_page.page.save_page = receive_save_func;
|
|
|
|
receive_page.page.can_close = receive_can_close_func;
|
|
|
|
|
|
|
|
prefs_account_register_page((PrefsPage *) &receive_page);
|
|
|
|
}
|
2003-02-28 17:05:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void register_send_page(void)
|
|
|
|
{
|
|
|
|
static gchar *path[3];
|
2003-02-28 17:05:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
path[0] = _("Account");
|
|
|
|
path[1] = _("Send");
|
|
|
|
path[2] = NULL;
|
|
|
|
|
|
|
|
send_page.page.path = path;
|
|
|
|
send_page.page.weight = 1000.0;
|
|
|
|
send_page.page.create_widget = send_create_widget_func;
|
|
|
|
send_page.page.destroy_widget = send_destroy_widget_func;
|
|
|
|
send_page.page.save_page = send_save_func;
|
|
|
|
send_page.page.can_close = send_can_close_func;
|
|
|
|
|
|
|
|
prefs_account_register_page((PrefsPage *) &send_page);
|
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void register_compose_page(void)
|
|
|
|
{
|
|
|
|
static gchar *path[3];
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
path[0] = _("Account");
|
|
|
|
path[1] = _("Compose");
|
|
|
|
path[2] = NULL;
|
|
|
|
|
|
|
|
compose_page.page.path = path;
|
|
|
|
compose_page.page.weight = 1000.0;
|
|
|
|
compose_page.page.create_widget = compose_create_widget_func;
|
|
|
|
compose_page.page.destroy_widget = compose_destroy_widget_func;
|
|
|
|
compose_page.page.save_page = compose_save_func;
|
|
|
|
compose_page.page.can_close = compose_can_close_func;
|
|
|
|
|
|
|
|
prefs_account_register_page((PrefsPage *) &compose_page);
|
|
|
|
}
|
2005-10-13 16:54:20 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void register_templates_page(void)
|
|
|
|
{
|
|
|
|
static gchar *path[3];
|
2006-02-01 18:52:48 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
path[0] = _("Account");
|
|
|
|
path[1] = _("Templates");
|
|
|
|
path[2] = NULL;
|
|
|
|
|
|
|
|
templates_page.page.path = path;
|
|
|
|
templates_page.page.weight = 1000.0;
|
|
|
|
templates_page.page.create_widget = templates_create_widget_func;
|
|
|
|
templates_page.page.destroy_widget = templates_destroy_widget_func;
|
|
|
|
templates_page.page.save_page = templates_save_func;
|
|
|
|
templates_page.page.can_close = templates_can_close_func;
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
prefs_account_register_page((PrefsPage *) &templates_page);
|
|
|
|
}
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void register_privacy_page(void)
|
|
|
|
{
|
|
|
|
static gchar *path[3];
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
path[0] = _("Account");
|
|
|
|
path[1] = _("Privacy");
|
|
|
|
path[2] = NULL;
|
|
|
|
|
|
|
|
privacy_page.page.path = path;
|
|
|
|
privacy_page.page.weight = 1000.0;
|
|
|
|
privacy_page.page.create_widget = privacy_create_widget_func;
|
|
|
|
privacy_page.page.destroy_widget = privacy_destroy_widget_func;
|
|
|
|
privacy_page.page.save_page = privacy_save_func;
|
|
|
|
privacy_page.page.can_close = privacy_can_close_func;
|
|
|
|
|
|
|
|
prefs_account_register_page((PrefsPage *) &privacy_page);
|
|
|
|
}
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2007-06-03 21:32:41 +02:00
|
|
|
static void register_ssl_page(void)
|
|
|
|
{
|
|
|
|
static gchar *path[3];
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
path[0] = _("Account");
|
|
|
|
path[1] = _("SSL");
|
|
|
|
path[2] = NULL;
|
|
|
|
|
|
|
|
ssl_page.page.path = path;
|
|
|
|
ssl_page.page.weight = 1000.0;
|
|
|
|
ssl_page.page.create_widget = ssl_create_widget_func;
|
|
|
|
ssl_page.page.destroy_widget = ssl_destroy_widget_func;
|
|
|
|
ssl_page.page.save_page = ssl_save_func;
|
|
|
|
ssl_page.page.can_close = ssl_can_close_func;
|
|
|
|
|
|
|
|
prefs_account_register_page((PrefsPage *) &ssl_page);
|
|
|
|
}
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2008-07-03 22:31:33 +02:00
|
|
|
static gboolean sslcert_get_client_cert_hook(gpointer source, gpointer data)
|
|
|
|
{
|
|
|
|
SSLClientCertHookData *hookdata = (SSLClientCertHookData *)source;
|
|
|
|
PrefsAccount *account = (PrefsAccount *)hookdata->account;
|
|
|
|
|
|
|
|
hookdata->cert_path = NULL;
|
|
|
|
hookdata->password = NULL;
|
|
|
|
|
|
|
|
if (!g_list_find(account_get_list(), account)) {
|
|
|
|
g_warning("can't find sock account\n");
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hookdata->is_smtp) {
|
|
|
|
if (account->out_ssl_client_cert_file && *account->out_ssl_client_cert_file)
|
|
|
|
hookdata->cert_path = account->out_ssl_client_cert_file;
|
|
|
|
if (account->out_ssl_client_cert_pass && *account->out_ssl_client_cert_pass)
|
|
|
|
hookdata->password = account->out_ssl_client_cert_pass;
|
|
|
|
} else {
|
|
|
|
if (account->in_ssl_client_cert_file && *account->in_ssl_client_cert_file)
|
|
|
|
hookdata->cert_path = account->in_ssl_client_cert_file;
|
|
|
|
if (account->in_ssl_client_cert_pass && *account->in_ssl_client_cert_pass)
|
|
|
|
hookdata->password = account->in_ssl_client_cert_pass;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct GetPassData {
|
|
|
|
GCond *cond;
|
|
|
|
GMutex* mutex;
|
|
|
|
gchar **pass;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static gboolean do_get_pass(gpointer data)
|
|
|
|
{
|
|
|
|
struct GetPassData *pass_data = (struct GetPassData *)data;
|
|
|
|
g_mutex_lock(pass_data->mutex);
|
|
|
|
*(pass_data->pass) = input_dialog_query_password("the PKCS12 client certificate", NULL);
|
|
|
|
g_cond_signal(pass_data->cond);
|
|
|
|
g_mutex_unlock(pass_data->mutex);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
static gboolean sslcert_get_password(gpointer source, gpointer data)
|
|
|
|
{
|
|
|
|
struct GetPassData pass_data;
|
|
|
|
/* do complicated stuff to be able to call GTK from the mainloop */
|
|
|
|
pass_data.cond = g_cond_new();
|
|
|
|
pass_data.mutex = g_mutex_new();
|
|
|
|
pass_data.pass = (gchar **)source;
|
|
|
|
|
|
|
|
g_mutex_lock(pass_data.mutex);
|
|
|
|
|
|
|
|
g_idle_add(do_get_pass, &pass_data);
|
|
|
|
|
|
|
|
g_cond_wait(pass_data.cond, pass_data.mutex);
|
|
|
|
g_cond_free(pass_data.cond);
|
|
|
|
g_mutex_unlock(pass_data.mutex);
|
|
|
|
g_mutex_free(pass_data.mutex);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2008-07-05 09:49:32 +02:00
|
|
|
#endif
|
2008-07-03 22:31:33 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void register_advanced_page(void)
|
|
|
|
{
|
|
|
|
static gchar *path[3];
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
path[0] = _("Account");
|
|
|
|
path[1] = _("Advanced");
|
|
|
|
path[2] = NULL;
|
|
|
|
|
|
|
|
advanced_page.page.path = path;
|
|
|
|
advanced_page.page.weight = 1000.0;
|
|
|
|
advanced_page.page.create_widget = advanced_create_widget_func;
|
|
|
|
advanced_page.page.destroy_widget = advanced_destroy_widget_func;
|
|
|
|
advanced_page.page.save_page = advanced_save_func;
|
|
|
|
advanced_page.page.can_close = advanced_can_close_func;
|
|
|
|
|
|
|
|
prefs_account_register_page((PrefsPage *) &advanced_page);
|
|
|
|
}
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
void prefs_account_init()
|
|
|
|
{
|
|
|
|
register_basic_page();
|
|
|
|
register_receive_page();
|
|
|
|
register_send_page();
|
|
|
|
register_compose_page();
|
|
|
|
register_templates_page();
|
|
|
|
register_privacy_page();
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2007-06-03 21:32:41 +02:00
|
|
|
register_ssl_page();
|
2008-07-03 22:31:33 +02:00
|
|
|
hooks_register_hook(SSLCERT_GET_CLIENT_CERT_HOOKLIST, sslcert_get_client_cert_hook, NULL);
|
|
|
|
hooks_register_hook(SSL_CERT_GET_PASSWORD, sslcert_get_password, NULL);
|
2007-06-03 21:32:41 +02:00
|
|
|
#endif
|
|
|
|
register_advanced_page();
|
|
|
|
}
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PrefsAccount *prefs_account_new(void)
|
|
|
|
{
|
|
|
|
PrefsAccount *ac_prefs;
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
ac_prefs = g_new0(PrefsAccount, 1);
|
|
|
|
memset(&tmp_ac_prefs, 0, sizeof(PrefsAccount));
|
|
|
|
prefs_set_default(basic_param);
|
|
|
|
prefs_set_default(receive_param);
|
|
|
|
prefs_set_default(send_param);
|
|
|
|
prefs_set_default(compose_param);
|
|
|
|
prefs_set_default(templates_param);
|
|
|
|
prefs_set_default(privacy_param);
|
|
|
|
prefs_set_default(ssl_param);
|
|
|
|
prefs_set_default(advanced_param);
|
|
|
|
*ac_prefs = tmp_ac_prefs;
|
|
|
|
ac_prefs->account_id = prefs_account_get_new_id();
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
ac_prefs->privacy_prefs = g_hash_table_new(g_str_hash, g_str_equal);
|
2007-01-11 12:16:38 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
return ac_prefs;
|
|
|
|
}
|
2007-01-11 12:16:38 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
void prefs_account_read_config(PrefsAccount *ac_prefs, const gchar *label)
|
|
|
|
{
|
|
|
|
const gchar *p = label;
|
|
|
|
gchar *rcpath;
|
|
|
|
gint id;
|
|
|
|
gchar **strv, **cur;
|
2007-01-11 12:16:38 +01:00
|
|
|
|
2009-02-23 17:55:51 +01:00
|
|
|
cm_return_if_fail(ac_prefs != NULL);
|
|
|
|
cm_return_if_fail(label != NULL);
|
2007-01-11 12:16:38 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
memset(&tmp_ac_prefs, 0, sizeof(PrefsAccount));
|
|
|
|
tmp_ac_prefs.privacy_prefs = ac_prefs->privacy_prefs;
|
2007-01-11 12:16:38 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ACCOUNT_RC, NULL);
|
|
|
|
prefs_read_config(basic_param, label, rcpath, NULL);
|
|
|
|
prefs_read_config(receive_param, label, rcpath, NULL);
|
|
|
|
prefs_read_config(send_param, label, rcpath, NULL);
|
|
|
|
prefs_read_config(compose_param, label, rcpath, NULL);
|
|
|
|
prefs_read_config(templates_param, label, rcpath, NULL);
|
|
|
|
prefs_read_config(privacy_param, label, rcpath, NULL);
|
|
|
|
prefs_read_config(ssl_param, label, rcpath, NULL);
|
|
|
|
prefs_read_config(advanced_param, label, rcpath, NULL);
|
|
|
|
g_free(rcpath);
|
2007-01-11 12:16:38 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
*ac_prefs = tmp_ac_prefs;
|
|
|
|
while (*p && !g_ascii_isdigit(*p)) p++;
|
|
|
|
id = atoi(p);
|
|
|
|
if (id < 0) g_warning("wrong account id: %d\n", id);
|
|
|
|
ac_prefs->account_id = id;
|
2007-01-11 12:16:38 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (ac_prefs->protocol == A_APOP) {
|
|
|
|
debug_print("converting protocol A_APOP to new prefs.\n");
|
|
|
|
ac_prefs->protocol = A_POP3;
|
|
|
|
ac_prefs->use_apop_auth = TRUE;
|
|
|
|
}
|
2007-01-11 12:16:38 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (privacy_prefs != NULL) {
|
|
|
|
strv = g_strsplit(privacy_prefs, ",", 0);
|
|
|
|
for (cur = strv; *cur != NULL; cur++) {
|
|
|
|
gchar *encvalue, *value;
|
2007-01-11 12:16:38 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
encvalue = strchr(*cur, '=');
|
|
|
|
if (encvalue == NULL)
|
|
|
|
continue;
|
|
|
|
encvalue[0] = '\0';
|
|
|
|
encvalue++;
|
2007-01-11 12:16:38 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
value = g_malloc0(strlen(encvalue));
|
|
|
|
if (base64_decode(value, encvalue, strlen(encvalue)) > 0)
|
|
|
|
g_hash_table_insert(ac_prefs->privacy_prefs, g_strdup(*cur), g_strdup(value));
|
|
|
|
g_free(value);
|
|
|
|
}
|
|
|
|
g_strfreev(strv);
|
|
|
|
g_free(privacy_prefs);
|
|
|
|
privacy_prefs = NULL;
|
|
|
|
}
|
2007-01-11 12:16:38 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
prefs_custom_header_read_config(ac_prefs);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void create_privacy_prefs(gpointer key, gpointer _value, gpointer user_data)
|
2001-04-21 15:18:13 +02:00
|
|
|
{
|
2007-06-03 21:32:41 +02:00
|
|
|
GString *str = (GString *) user_data;
|
|
|
|
gchar *encvalue;
|
|
|
|
gchar *value = (gchar *) _value;
|
2001-04-21 15:18:13 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (str->len > 0)
|
|
|
|
g_string_append_c(str, ',');
|
2001-04-21 15:18:13 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
encvalue = g_malloc0(B64LEN(strlen(value)) + 1);
|
|
|
|
base64_encode(encvalue, (gchar *) value, strlen(value));
|
|
|
|
g_string_append_printf(str, "%s=%s", (gchar *) key, encvalue);
|
|
|
|
g_free(encvalue);
|
|
|
|
}
|
2001-04-21 15:18:13 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
#define WRITE_PARAM(PARAM_TABLE) \
|
|
|
|
if (prefs_write_param(PARAM_TABLE, pfile->fp) < 0) { \
|
|
|
|
g_warning("failed to write configuration to file\n"); \
|
|
|
|
prefs_file_close_revert(pfile); \
|
|
|
|
g_free(privacy_prefs); \
|
|
|
|
privacy_prefs = NULL; \
|
|
|
|
return; \
|
|
|
|
}
|
|
|
|
|
|
|
|
void prefs_account_write_config_all(GList *account_list)
|
|
|
|
{
|
|
|
|
GList *cur;
|
|
|
|
gchar *rcpath;
|
|
|
|
PrefFile *pfile;
|
2004-11-09 16:26:36 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
rcpath = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, ACCOUNT_RC, NULL);
|
|
|
|
if ((pfile = prefs_write_open(rcpath)) == NULL) {
|
|
|
|
g_free(rcpath);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
g_free(rcpath);
|
2004-11-09 16:26:36 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
for (cur = account_list; cur != NULL; cur = cur->next) {
|
|
|
|
GString *str;
|
2004-11-09 16:26:36 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
tmp_ac_prefs = *(PrefsAccount *)cur->data;
|
|
|
|
if (fprintf(pfile->fp, "[Account: %d]\n",
|
|
|
|
tmp_ac_prefs.account_id) <= 0)
|
|
|
|
return;
|
2004-11-17 15:16:23 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
str = g_string_sized_new(32);
|
|
|
|
g_hash_table_foreach(tmp_ac_prefs.privacy_prefs, create_privacy_prefs, str);
|
|
|
|
privacy_prefs = str->str;
|
|
|
|
g_string_free(str, FALSE);
|
2006-04-18 18:21:10 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
WRITE_PARAM(basic_param)
|
|
|
|
WRITE_PARAM(receive_param)
|
|
|
|
WRITE_PARAM(send_param)
|
|
|
|
WRITE_PARAM(compose_param)
|
|
|
|
WRITE_PARAM(templates_param)
|
|
|
|
WRITE_PARAM(privacy_param)
|
|
|
|
WRITE_PARAM(ssl_param)
|
|
|
|
WRITE_PARAM(advanced_param)
|
2001-04-21 15:18:13 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
g_free(privacy_prefs);
|
|
|
|
privacy_prefs = NULL;
|
2002-05-29 10:28:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (cur->next) {
|
|
|
|
if (fputc('\n', pfile->fp) == EOF) {
|
|
|
|
FILE_OP_ERROR(rcpath, "fputc");
|
|
|
|
prefs_file_close_revert(pfile);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-05-31 09:06:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (prefs_file_close(pfile) < 0)
|
|
|
|
g_warning("failed to write configuration to file\n");
|
2002-05-29 10:28:56 +02:00
|
|
|
}
|
2007-06-03 21:32:41 +02:00
|
|
|
#undef WRITE_PARAM
|
2002-05-29 10:28:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gboolean free_privacy_prefs(gpointer key, gpointer value, gpointer user_data)
|
2001-08-06 21:30:28 +02:00
|
|
|
{
|
2007-06-03 21:32:41 +02:00
|
|
|
g_free(key);
|
|
|
|
g_free(value);
|
2001-08-06 21:30:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
2002-05-29 10:28:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
void prefs_account_free(PrefsAccount *ac_prefs)
|
|
|
|
{
|
|
|
|
if (!ac_prefs) return;
|
2002-05-29 10:28:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
g_hash_table_foreach_remove(ac_prefs->privacy_prefs, free_privacy_prefs, NULL);
|
2001-08-06 21:30:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
tmp_ac_prefs = *ac_prefs;
|
|
|
|
prefs_free(basic_param);
|
|
|
|
prefs_free(receive_param);
|
|
|
|
prefs_free(send_param);
|
|
|
|
prefs_free(compose_param);
|
|
|
|
prefs_free(templates_param);
|
|
|
|
prefs_free(privacy_param);
|
|
|
|
prefs_free(ssl_param);
|
|
|
|
prefs_free(advanced_param);
|
|
|
|
}
|
2003-07-16 13:53:42 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
const gchar *prefs_account_get_privacy_prefs(PrefsAccount *account, gchar *id)
|
|
|
|
{
|
|
|
|
return g_hash_table_lookup(account->privacy_prefs, id);
|
|
|
|
}
|
2001-08-06 21:30:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
void prefs_account_set_privacy_prefs(PrefsAccount *account, gchar *id, gchar *new_value)
|
|
|
|
{
|
|
|
|
gchar *orig_key = NULL, *value;
|
2001-08-06 21:30:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (g_hash_table_lookup_extended(account->privacy_prefs, id, (gpointer *)(gchar *) &orig_key, (gpointer *)(gchar *) &value)) {
|
|
|
|
g_hash_table_remove(account->privacy_prefs, id);
|
2001-08-06 21:30:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
g_free(orig_key);
|
|
|
|
g_free(value);
|
|
|
|
}
|
2001-08-06 21:30:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (new_value != NULL)
|
|
|
|
g_hash_table_insert(account->privacy_prefs, g_strdup(id), g_strdup(new_value));
|
|
|
|
}
|
2002-05-29 10:28:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static gint prefs_account_get_new_id(void)
|
|
|
|
{
|
|
|
|
GList *ac_list;
|
|
|
|
PrefsAccount *ac;
|
|
|
|
static gint last_id = 0;
|
2002-05-29 10:28:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
for (ac_list = account_get_list(); ac_list != NULL;
|
|
|
|
ac_list = ac_list->next) {
|
|
|
|
ac = (PrefsAccount *)ac_list->data;
|
|
|
|
if (last_id < ac->account_id)
|
|
|
|
last_id = ac->account_id;
|
|
|
|
}
|
2002-05-31 09:06:28 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
return last_id + 1;
|
|
|
|
}
|
2002-05-29 10:28:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
static void destroy_dialog(gpointer data)
|
|
|
|
{
|
|
|
|
PrefsAccount *ac_prefs = (PrefsAccount *) data;
|
|
|
|
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;
|
|
|
|
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;
|
2002-05-29 10:28:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
|
|
|
|
gtk_main_quit();
|
|
|
|
}
|
2002-05-29 10:28:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
PrefsAccount *prefs_account_open(PrefsAccount *ac_prefs, gboolean *dirty)
|
|
|
|
{
|
|
|
|
gchar *title;
|
2003-07-16 13:53:42 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (prefs_rc_is_readonly(ACCOUNT_RC))
|
|
|
|
return ac_prefs;
|
2003-07-16 13:53:42 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
debug_print("Opening account preferences window...\n");
|
2003-07-16 13:53:42 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
inc_lock();
|
2003-07-16 13:53:42 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
cancelled = TRUE;
|
2003-07-16 13:53:42 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!ac_prefs) {
|
|
|
|
ac_prefs = prefs_account_new();
|
|
|
|
new_account = TRUE;
|
|
|
|
} else
|
|
|
|
new_account = FALSE;
|
2002-05-29 10:28:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (new_account)
|
|
|
|
title = g_strdup (_("Preferences for new account"));
|
|
|
|
else
|
|
|
|
title = g_strdup_printf (_("%s - Account preferences"),
|
|
|
|
ac_prefs->account_name);
|
2002-05-29 10:28:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
prefswindow_open_full(title, prefs_pages, ac_prefs, destroy_dialog,
|
|
|
|
&prefs_common.editaccountwin_width, &prefs_common.editaccountwin_height,
|
2008-12-07 06:02:04 +01:00
|
|
|
TRUE, NULL, NULL);
|
2007-06-03 21:32:41 +02:00
|
|
|
g_free(title);
|
|
|
|
gtk_main();
|
2002-05-29 10:28:56 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
inc_unlock();
|
2003-07-16 13:53:42 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
if (!cancelled && dirty != NULL)
|
|
|
|
*dirty = TRUE;
|
|
|
|
if (cancelled && new_account) {
|
|
|
|
prefs_account_free(ac_prefs);
|
|
|
|
return NULL;
|
2011-11-21 23:58:21 +01:00
|
|
|
} else {
|
|
|
|
if (ac_prefs->recv_server)
|
|
|
|
g_strstrip(ac_prefs->recv_server);
|
|
|
|
if (ac_prefs->smtp_server)
|
|
|
|
g_strstrip(ac_prefs->smtp_server);
|
|
|
|
if (ac_prefs->nntp_server)
|
|
|
|
g_strstrip(ac_prefs->nntp_server);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
return ac_prefs;
|
2011-11-21 23:58:21 +01:00
|
|
|
}
|
2001-08-06 21:30:28 +02:00
|
|
|
}
|
2002-05-29 10:28:56 +02:00
|
|
|
|
2011-10-07 11:40:16 +02:00
|
|
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
2002-03-17 10:50:46 +01:00
|
|
|
static void crosspost_color_toggled(void)
|
|
|
|
{
|
|
|
|
gboolean is_active;
|
|
|
|
|
|
|
|
is_active = gtk_toggle_button_get_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(advanced_page.crosspost_checkbtn));
|
|
|
|
gtk_widget_set_sensitive(advanced_page.crosspost_colormenu, is_active);
|
2002-03-17 10:50:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void prefs_account_crosspost_set_data_from_colormenu(PrefParam *pparam)
|
|
|
|
{
|
|
|
|
GtkWidget *menu;
|
|
|
|
GtkWidget *menuitem;
|
|
|
|
|
2008-08-05 08:37:13 +02:00
|
|
|
menu = gtk_cmoption_menu_get_menu(GTK_CMOPTION_MENU(advanced_page.crosspost_colormenu));
|
2002-03-17 10:50:46 +01:00
|
|
|
menuitem = gtk_menu_get_active(GTK_MENU(menu));
|
|
|
|
*((gint *)pparam->data) = GPOINTER_TO_INT
|
2004-05-25 10:39:41 +02:00
|
|
|
(g_object_get_data(G_OBJECT(menuitem), "color"));
|
2002-03-17 10:50:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void prefs_account_crosspost_set_colormenu(PrefParam *pparam)
|
|
|
|
{
|
|
|
|
gint colorlabel = *((gint *)pparam->data);
|
2008-08-05 08:37:13 +02:00
|
|
|
GtkCMOptionMenu *colormenu = GTK_CMOPTION_MENU(*pparam->widget);
|
2002-03-17 10:50:46 +01:00
|
|
|
GtkWidget *menu;
|
|
|
|
GtkWidget *menuitem;
|
|
|
|
|
2010-09-30 09:27:03 +02:00
|
|
|
gtk_cmoption_menu_set_history(colormenu, colorlabel + 1);
|
2008-08-05 08:37:13 +02:00
|
|
|
menu = gtk_cmoption_menu_get_menu(colormenu);
|
2002-03-17 10:50:46 +01:00
|
|
|
menuitem = gtk_menu_get_active(GTK_MENU(menu));
|
|
|
|
gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
|
|
|
|
}
|
2011-10-07 11:40:16 +02:00
|
|
|
#endif
|
2002-03-17 10:50:46 +01:00
|
|
|
|
2002-09-22 18:30:27 +02:00
|
|
|
static void pop_bfr_smtp_tm_set_sens(GtkWidget *widget, gpointer data)
|
|
|
|
{
|
2007-12-19 11:48:43 +01:00
|
|
|
gtk_widget_set_sensitive(send_page.pop_bfr_smtp_tm_spinbtn,
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(send_page.pop_bfr_smtp_checkbtn)));
|
|
|
|
gtk_widget_set_sensitive(send_page.pop_auth_timeout_lbl,
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(send_page.pop_bfr_smtp_checkbtn)));
|
|
|
|
gtk_widget_set_sensitive(send_page.pop_auth_minutes_lbl,
|
|
|
|
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(send_page.pop_bfr_smtp_checkbtn)));
|
2002-09-22 18:30:27 +02:00
|
|
|
}
|
|
|
|
|
2002-04-21 00:57:52 +02:00
|
|
|
static void prefs_account_select_folder_cb(GtkWidget *widget, gpointer data)
|
2001-10-30 11:25:49 +01:00
|
|
|
{
|
|
|
|
FolderItem *item;
|
2002-04-21 00:57:52 +02:00
|
|
|
gchar *id;
|
2001-10-30 11:25:49 +01:00
|
|
|
|
2008-02-12 11:44:26 +01:00
|
|
|
item = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL, FALSE);
|
2002-04-21 00:57:52 +02:00
|
|
|
if (item && item->path) {
|
|
|
|
id = folder_item_get_identifier(item);
|
|
|
|
if (id) {
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(data), id);
|
|
|
|
g_free(id);
|
|
|
|
}
|
|
|
|
}
|
2001-10-30 11:25:49 +01:00
|
|
|
}
|
|
|
|
|
2005-10-13 16:54:20 +02:00
|
|
|
static void prefs_account_sigfile_radiobtn_cb(GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(signature_browse_button), TRUE);
|
2006-02-01 18:52:48 +01:00
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(signature_edit_button), TRUE);
|
2005-10-13 16:54:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void prefs_account_sigcmd_radiobtn_cb(GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(signature_browse_button), FALSE);
|
2006-02-01 18:52:48 +01:00
|
|
|
gtk_widget_set_sensitive(GTK_WIDGET(signature_edit_button), FALSE);
|
2005-10-13 16:54:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void prefs_account_signature_browse_cb(GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
gchar *filename;
|
|
|
|
gchar *utf8_filename;
|
|
|
|
|
|
|
|
filename = filesel_select_file_open(_("Select signature file"), NULL);
|
|
|
|
if (!filename) return;
|
|
|
|
|
|
|
|
utf8_filename = g_filename_to_utf8(filename, -1, NULL, NULL, NULL);
|
|
|
|
if (!utf8_filename) {
|
|
|
|
g_warning("prefs_account_signature_browse_cb(): failed to convert character set.");
|
|
|
|
utf8_filename = g_strdup(filename);
|
|
|
|
}
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(entry_sigpath), utf8_filename);
|
|
|
|
g_free(utf8_filename);
|
|
|
|
}
|
|
|
|
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2008-07-03 22:31:33 +02:00
|
|
|
static void prefs_account_in_cert_browse_cb(GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
gchar *filename;
|
|
|
|
gchar *utf8_filename;
|
|
|
|
|
|
|
|
filename = filesel_select_file_open(_("Select certificate file"), NULL);
|
|
|
|
if (!filename) return;
|
|
|
|
|
|
|
|
utf8_filename = g_filename_to_utf8(filename, -1, NULL, NULL, NULL);
|
|
|
|
if (!utf8_filename) {
|
|
|
|
g_warning("prefs_account_cert_browse_cb(): failed to convert character set.");
|
|
|
|
utf8_filename = g_strdup(filename);
|
|
|
|
}
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(entry_in_cert_file), utf8_filename);
|
|
|
|
g_free(utf8_filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void prefs_account_out_cert_browse_cb(GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
gchar *filename;
|
|
|
|
gchar *utf8_filename;
|
|
|
|
|
|
|
|
filename = filesel_select_file_open(_("Select certificate file"), NULL);
|
|
|
|
if (!filename) return;
|
|
|
|
|
|
|
|
utf8_filename = g_filename_to_utf8(filename, -1, NULL, NULL, NULL);
|
|
|
|
if (!utf8_filename) {
|
|
|
|
g_warning("prefs_account_cert_browse_cb(): failed to convert character set.");
|
|
|
|
utf8_filename = g_strdup(filename);
|
|
|
|
}
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(entry_out_cert_file), utf8_filename);
|
|
|
|
g_free(utf8_filename);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-02-01 18:52:48 +01:00
|
|
|
static void prefs_account_signature_edit_cb(GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
const gchar *sigpath = gtk_entry_get_text(GTK_ENTRY(data));
|
2007-03-31 17:45:12 +02:00
|
|
|
if (!is_file_exist(sigpath))
|
|
|
|
str_write_to_file(sigpath, "");
|
2007-11-21 19:58:18 +01:00
|
|
|
open_txt_editor(sigpath, prefs_common_get_ext_editor_cmd());
|
2006-02-01 18:52:48 +01:00
|
|
|
}
|
|
|
|
|
2001-05-13 15:03:37 +02:00
|
|
|
static void prefs_account_edit_custom_header(void)
|
2001-04-24 17:44:45 +02:00
|
|
|
{
|
2001-05-13 15:53:50 +02:00
|
|
|
prefs_custom_header_open(&tmp_ac_prefs);
|
2001-04-24 17:44:45 +02:00
|
|
|
}
|
|
|
|
|
2001-08-06 21:30:28 +02:00
|
|
|
static void prefs_account_enum_set_data_from_radiobtn(PrefParam *pparam)
|
2001-04-21 15:18:13 +02:00
|
|
|
{
|
|
|
|
GtkRadioButton *radiobtn;
|
|
|
|
GSList *group;
|
|
|
|
|
|
|
|
radiobtn = GTK_RADIO_BUTTON (*pparam->widget);
|
2003-10-05 12:10:30 +02:00
|
|
|
group = gtk_radio_button_get_group (radiobtn);
|
2001-04-21 15:18:13 +02:00
|
|
|
while (group != NULL) {
|
|
|
|
GtkToggleButton *btn = GTK_TOGGLE_BUTTON (group->data);
|
|
|
|
if (gtk_toggle_button_get_active (btn)) {
|
2001-08-06 21:30:28 +02:00
|
|
|
*((gint *)pparam->data) = GPOINTER_TO_INT
|
2003-10-05 12:10:30 +02:00
|
|
|
(g_object_get_data (G_OBJECT (btn), MENU_VAL_ID));
|
2001-04-21 15:18:13 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
group = group->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-08-06 21:30:28 +02:00
|
|
|
static void prefs_account_enum_set_radiobtn(PrefParam *pparam)
|
2001-04-21 15:18:13 +02:00
|
|
|
{
|
|
|
|
GtkRadioButton *radiobtn;
|
|
|
|
GSList *group;
|
|
|
|
gpointer data;
|
|
|
|
|
2001-08-06 21:30:28 +02:00
|
|
|
data = GINT_TO_POINTER (*((gint *)pparam->data));
|
2001-04-21 15:18:13 +02:00
|
|
|
radiobtn = GTK_RADIO_BUTTON (*pparam->widget);
|
2003-10-05 12:10:30 +02:00
|
|
|
group = gtk_radio_button_get_group (radiobtn);
|
2001-04-21 15:18:13 +02:00
|
|
|
while (group != NULL) {
|
|
|
|
GtkToggleButton *btn = GTK_TOGGLE_BUTTON (group->data);
|
2003-10-05 12:10:30 +02:00
|
|
|
gpointer data1 = g_object_get_data (G_OBJECT (btn), MENU_VAL_ID);
|
2001-04-21 15:18:13 +02:00
|
|
|
if (data1 == data) {
|
|
|
|
gtk_toggle_button_set_active (btn, TRUE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
group = group->next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
static void prefs_account_protocol_set_data_from_optmenu(PrefParam *pparam)
|
|
|
|
{
|
2006-07-01 17:16:31 +02:00
|
|
|
struct BasicProtocol *protocol_optmenu =
|
|
|
|
(struct BasicProtocol *)*pparam->widget;
|
|
|
|
GtkWidget *optmenu = protocol_optmenu->combobox;
|
|
|
|
|
|
|
|
*((RecvProtocol *)pparam->data) =
|
|
|
|
combobox_get_active_data(GTK_COMBO_BOX(optmenu));
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void prefs_account_protocol_set_optmenu(PrefParam *pparam)
|
|
|
|
{
|
|
|
|
RecvProtocol protocol;
|
2006-07-01 17:16:31 +02:00
|
|
|
struct BasicProtocol *protocol_optmenu =
|
|
|
|
(struct BasicProtocol *)*pparam->widget;
|
|
|
|
GtkWidget *optmenu = protocol_optmenu->combobox;
|
|
|
|
GtkWidget *optlabel = protocol_optmenu->label;
|
|
|
|
GtkWidget *descrlabel = protocol_optmenu->descrlabel;
|
2006-07-01 17:22:44 +02:00
|
|
|
gchar *label = NULL;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
protocol = *((RecvProtocol *)pparam->data);
|
2006-06-27 14:46:42 +02:00
|
|
|
|
2006-07-01 17:16:31 +02:00
|
|
|
/* Set combobox to correct value even if it will be hidden, so
|
|
|
|
* we won't break existing accounts when saving. */
|
2006-06-27 14:46:42 +02:00
|
|
|
combobox_select_by_data(GTK_COMBO_BOX(optmenu), protocol);
|
|
|
|
|
2006-07-01 17:16:31 +02:00
|
|
|
/* Set up widgets accordingly */
|
|
|
|
if( new_account ) {
|
|
|
|
gtk_label_set_text(GTK_LABEL(descrlabel), _("Protocol"));
|
|
|
|
gtk_widget_hide(optlabel);
|
|
|
|
gtk_widget_show(optmenu);
|
|
|
|
} else {
|
2006-07-01 22:29:48 +02:00
|
|
|
gtk_label_set_text(GTK_LABEL(descrlabel), _("Protocol:"));
|
2006-07-01 17:16:31 +02:00
|
|
|
label = g_markup_printf_escaped("<b>%s</b>", protocol_names[protocol]);
|
|
|
|
gtk_label_set_markup(GTK_LABEL(optlabel), label);
|
|
|
|
g_free(label);
|
|
|
|
gtk_widget_hide(optmenu);
|
|
|
|
gtk_widget_show(optlabel);
|
2006-10-07 18:03:36 +02:00
|
|
|
#ifndef HAVE_LIBETPAN
|
2007-10-18 09:13:06 +02:00
|
|
|
if (protocol == A_IMAP4 || protocol == A_NNTP) {
|
2006-10-07 18:03:36 +02:00
|
|
|
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
|
2007-11-08 10:13:16 +01:00
|
|
|
if (protocol == A_IMAP4) {
|
|
|
|
if (new_account)
|
|
|
|
gtk_toggle_button_set_active(
|
|
|
|
GTK_TOGGLE_BUTTON(send_page.msgid_checkbtn),
|
|
|
|
TRUE);
|
|
|
|
gtk_widget_hide(send_page.msgid_checkbtn);
|
2011-08-29 17:42:13 +02:00
|
|
|
} else
|
2007-11-08 10:13:16 +01:00
|
|
|
gtk_widget_show(send_page.msgid_checkbtn);
|
2011-08-29 17:42:13 +02:00
|
|
|
|
|
|
|
gtk_widget_show(send_page.xmailer_checkbtn);
|
2006-07-01 17:16:31 +02:00
|
|
|
}
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
|
|
|
|
2003-07-16 12:48:31 +02:00
|
|
|
static void prefs_account_imap_auth_type_set_data_from_optmenu(PrefParam *pparam)
|
|
|
|
{
|
2007-07-30 08:19:32 +02:00
|
|
|
*((RecvProtocol *)pparam->data) =
|
|
|
|
combobox_get_active_data(GTK_COMBO_BOX(*pparam->widget));
|
2003-07-16 12:48:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void prefs_account_imap_auth_type_set_optmenu(PrefParam *pparam)
|
|
|
|
{
|
|
|
|
IMAPAuthType type = *((IMAPAuthType *)pparam->data);
|
2007-07-30 08:19:32 +02:00
|
|
|
GtkComboBox *optmenu = GTK_COMBO_BOX(*pparam->widget);
|
2003-07-16 12:48:31 +02:00
|
|
|
|
2007-07-30 08:19:32 +02:00
|
|
|
combobox_select_by_data(optmenu, type);
|
2003-07-16 12:48:31 +02:00
|
|
|
}
|
|
|
|
|
2002-06-28 10:08:36 +02:00
|
|
|
static void prefs_account_smtp_auth_type_set_data_from_optmenu(PrefParam *pparam)
|
|
|
|
{
|
2007-08-03 21:45:49 +02:00
|
|
|
*((RecvProtocol *)pparam->data) =
|
|
|
|
combobox_get_active_data(GTK_COMBO_BOX(*pparam->widget));
|
2002-06-28 10:08:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void prefs_account_smtp_auth_type_set_optmenu(PrefParam *pparam)
|
|
|
|
{
|
|
|
|
SMTPAuthType type = *((SMTPAuthType *)pparam->data);
|
2007-08-03 21:45:49 +02:00
|
|
|
GtkComboBox *optmenu = GTK_COMBO_BOX(*pparam->widget);
|
2002-06-28 10:08:36 +02:00
|
|
|
|
2007-08-03 21:45:49 +02:00
|
|
|
combobox_select_by_data(optmenu, type);
|
2002-06-28 10:08:36 +02:00
|
|
|
}
|
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
static void prefs_account_set_string_from_combobox(PrefParam *pparam)
|
2004-11-09 16:26:36 +01:00
|
|
|
{
|
2007-08-06 16:54:28 +02:00
|
|
|
GtkWidget *combobox;
|
|
|
|
GtkListStore *menu;
|
|
|
|
GtkTreeIter iter;
|
2004-11-09 16:26:36 +01:00
|
|
|
gchar **str;
|
|
|
|
|
2009-02-23 17:55:51 +01:00
|
|
|
cm_return_if_fail(*pparam->widget != NULL);
|
2004-11-09 16:26:36 +01:00
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
combobox = *pparam->widget;
|
2009-02-23 17:55:51 +01:00
|
|
|
cm_return_if_fail(gtk_combo_box_get_active_iter(
|
2007-08-21 16:29:58 +02:00
|
|
|
GTK_COMBO_BOX(combobox), &iter));
|
2007-08-06 16:54:28 +02:00
|
|
|
|
|
|
|
str = (gchar **)pparam->data;
|
|
|
|
g_free(*str);
|
|
|
|
menu = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(combobox)));
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(menu), &iter,
|
|
|
|
COMBOBOX_PRIVACY_PLUGIN_ID, &(*str),
|
|
|
|
-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Context struct and internal function called by gtk_tree_model_foreach().
|
|
|
|
* This is used in prefs_account_set_privacy_combobox_from_string() to find
|
|
|
|
* correct combobox entry to activate when account preferences are displayed
|
|
|
|
* and their values are set according to preferences. */
|
|
|
|
typedef struct _privacy_system_set_ctx {
|
|
|
|
GtkWidget *combobox;
|
|
|
|
gchar *prefsid;
|
|
|
|
gboolean found;
|
|
|
|
} PrivacySystemSetCtx;
|
|
|
|
|
|
|
|
static gboolean _privacy_system_set_func(GtkTreeModel *model, GtkTreePath *path,
|
|
|
|
GtkTreeIter *iter, PrivacySystemSetCtx *ctx)
|
|
|
|
{
|
|
|
|
GtkWidget *combobox = ctx->combobox;
|
|
|
|
gchar *prefsid = ctx->prefsid;
|
|
|
|
gchar *curid;
|
|
|
|
|
|
|
|
/* We're searching for correct privacy plugin ID. */
|
|
|
|
gtk_tree_model_get(model, iter, COMBOBOX_PRIVACY_PLUGIN_ID, &curid, -1);
|
|
|
|
if( strcmp(prefsid, curid) == 0 ) {
|
|
|
|
gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combobox), iter);
|
|
|
|
g_free(curid);
|
|
|
|
ctx->found = TRUE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
2004-11-09 16:26:36 +01:00
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
g_free(curid);
|
|
|
|
return FALSE;
|
2004-11-09 16:26:36 +01:00
|
|
|
}
|
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
static void prefs_account_set_privacy_combobox_from_string(PrefParam *pparam)
|
2004-11-09 16:26:36 +01:00
|
|
|
{
|
|
|
|
GtkWidget *optionmenu;
|
2007-08-06 16:54:28 +02:00
|
|
|
GtkListStore *menu;
|
|
|
|
GtkTreeIter iter;
|
2004-11-09 16:26:36 +01:00
|
|
|
gboolean found = FALSE;
|
|
|
|
gchar *prefsid;
|
2007-08-06 16:54:28 +02:00
|
|
|
PrivacySystemSetCtx *ctx = NULL;
|
2004-11-09 16:26:36 +01:00
|
|
|
|
2009-02-23 17:55:51 +01:00
|
|
|
cm_return_if_fail(*pparam->widget != NULL);
|
2004-11-09 16:26:36 +01:00
|
|
|
|
|
|
|
prefsid = *((gchar **) pparam->data);
|
|
|
|
if (prefsid == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
optionmenu = *pparam->widget;
|
2007-08-06 16:54:28 +02:00
|
|
|
menu = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(optionmenu)));
|
|
|
|
|
|
|
|
ctx = g_new(PrivacySystemSetCtx, sizeof(PrivacySystemSetCtx));
|
|
|
|
ctx->combobox = optionmenu;
|
|
|
|
ctx->prefsid = prefsid;
|
|
|
|
ctx->found = FALSE;
|
2004-11-09 16:26:36 +01:00
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
gtk_tree_model_foreach(GTK_TREE_MODEL(menu),
|
|
|
|
(GtkTreeModelForeachFunc)_privacy_system_set_func, ctx);
|
|
|
|
found = ctx->found;
|
|
|
|
g_free(ctx);
|
|
|
|
|
|
|
|
/* If chosen privacy system is not available, add a dummy entry with
|
|
|
|
* "not loaded" note and make it active. */
|
2004-11-09 16:26:36 +01:00
|
|
|
if (!found) {
|
|
|
|
gchar *name;
|
|
|
|
|
2006-12-12 10:47:24 +01:00
|
|
|
name = g_strdup_printf(_("%s (plugin not loaded)"), prefsid);
|
2007-08-06 16:54:28 +02:00
|
|
|
gtk_list_store_append(menu, &iter);
|
|
|
|
gtk_list_store_set(menu, &iter,
|
|
|
|
COMBOBOX_TEXT, name,
|
|
|
|
COMBOBOX_DATA, 0,
|
|
|
|
COMBOBOX_SENS, TRUE,
|
|
|
|
COMBOBOX_PRIVACY_PLUGIN_ID, prefsid,
|
|
|
|
-1);
|
2004-11-09 16:26:36 +01:00
|
|
|
g_free(name);
|
|
|
|
|
2007-08-06 16:54:28 +02:00
|
|
|
gtk_combo_box_set_active_iter(GTK_COMBO_BOX(optionmenu), &iter);
|
2004-11-09 16:26:36 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-07-01 17:16:31 +02:00
|
|
|
static void prefs_account_protocol_changed(GtkComboBox *combobox, gpointer data)
|
2001-04-19 14:21:46 +02:00
|
|
|
{
|
|
|
|
RecvProtocol protocol;
|
2007-06-03 21:32:41 +02:00
|
|
|
struct BasicProtocol *protocol_optmenu = (struct BasicProtocol *)basic_page.protocol_optmenu;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2006-06-27 14:46:42 +02:00
|
|
|
protocol = combobox_get_active_data(combobox);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2006-10-07 18:03:36 +02:00
|
|
|
gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
|
|
|
|
gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
|
2001-04-19 14:21:46 +02:00
|
|
|
switch(protocol) {
|
|
|
|
case A_NNTP:
|
2007-10-18 09:13:06 +02:00
|
|
|
#ifndef HAVE_LIBETPAN
|
|
|
|
gtk_widget_show(protocol_optmenu->no_imap_warn_icon);
|
|
|
|
gtk_widget_show(protocol_optmenu->no_imap_warn_label);
|
|
|
|
#else
|
2006-10-07 18:03:36 +02:00
|
|
|
gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
|
|
|
|
gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
|
2007-10-18 09:13:06 +02:00
|
|
|
#endif
|
2007-11-08 10:13:16 +01:00
|
|
|
gtk_widget_show(send_page.msgid_checkbtn);
|
2011-08-29 15:00:44 +02:00
|
|
|
gtk_widget_show(send_page.xmailer_checkbtn);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(basic_page.nntpserv_label);
|
|
|
|
gtk_widget_show(basic_page.nntpserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
0, VSPACING_NARROW);
|
2003-01-27 11:33:19 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.nntpauth_checkbtn, TRUE);
|
|
|
|
gtk_widget_show(basic_page.nntpauth_checkbtn);
|
2003-01-27 11:33:19 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.nntpauth_onconnect_checkbtn, TRUE);
|
|
|
|
gtk_widget_show(basic_page.nntpauth_onconnect_checkbtn);
|
2003-01-27 11:33:19 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
1, VSPACING_NARROW);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.recvserv_label);
|
|
|
|
gtk_widget_hide(basic_page.recvserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
2, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(basic_page.smtpserv_label);
|
|
|
|
gtk_widget_show(basic_page.smtpserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
4, VSPACING_NARROW);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.localmbox_label);
|
|
|
|
gtk_widget_hide(basic_page.localmbox_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
3, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.mailcmd_label);
|
|
|
|
gtk_widget_hide(basic_page.mailcmd_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
6, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.mailcmd_checkbtn);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
5, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(basic_page.uid_label);
|
|
|
|
gtk_widget_show(basic_page.pass_label);
|
|
|
|
gtk_widget_show(basic_page.uid_entry);
|
|
|
|
gtk_widget_show(basic_page.pass_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
7, VSPACING_NARROW);
|
2001-06-13 11:38:24 +02:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.uid_label, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.pass_label, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.uid_entry, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.pass_entry, TRUE);
|
2001-06-13 11:38:24 +02:00
|
|
|
|
2001-05-01 19:29:01 +02:00
|
|
|
/* update userid/passwd sensitive state */
|
2003-01-27 11:33:19 +01:00
|
|
|
|
2001-05-01 19:29:01 +02:00
|
|
|
prefs_account_nntpauth_toggled
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(basic_page.nntpauth_checkbtn), NULL);
|
|
|
|
gtk_widget_hide(receive_page.pop3_frame);
|
|
|
|
gtk_widget_hide(receive_page.imap_frame);
|
|
|
|
gtk_widget_hide(receive_page.local_frame);
|
|
|
|
gtk_widget_show(receive_page.frame_maxarticle);
|
|
|
|
gtk_widget_set_sensitive(receive_page.filter_on_recv_checkbtn, TRUE);
|
2007-06-04 15:28:06 +02:00
|
|
|
prefs_account_filter_on_recv_toggled
|
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filter_on_recv_checkbtn), NULL);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(receive_page.recvatgetall_checkbtn, TRUE);
|
2002-09-15 13:05:51 +02:00
|
|
|
/* update pop_before_smtp sensitivity */
|
2002-09-15 15:37:38 +02:00
|
|
|
gtk_toggle_button_set_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(send_page.pop_bfr_smtp_checkbtn), FALSE);
|
|
|
|
gtk_widget_set_sensitive(send_page.pop_bfr_smtp_checkbtn, FALSE);
|
2007-12-19 11:48:43 +01:00
|
|
|
gtk_widget_set_sensitive(send_page.pop_bfr_smtp_tm_spinbtn, FALSE);
|
2002-09-15 13:05:51 +02:00
|
|
|
|
2002-05-12 08:56:28 +02:00
|
|
|
if (!tmp_ac_prefs.account_name) {
|
2005-09-14 13:31:01 +02:00
|
|
|
gtk_toggle_button_set_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filter_on_recv_checkbtn),
|
2005-09-14 13:31:01 +02:00
|
|
|
TRUE);
|
2007-06-04 15:28:06 +02:00
|
|
|
gtk_toggle_button_set_active
|
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filterhook_on_recv_checkbtn),
|
|
|
|
TRUE);
|
2002-05-12 08:56:28 +02:00
|
|
|
gtk_toggle_button_set_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.recvatgetall_checkbtn),
|
2002-05-12 08:56:28 +02:00
|
|
|
FALSE);
|
|
|
|
}
|
|
|
|
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(ssl_page.pop_frame);
|
|
|
|
gtk_widget_hide(ssl_page.imap_frame);
|
|
|
|
gtk_widget_show(ssl_page.nntp_frame);
|
|
|
|
gtk_widget_show(ssl_page.send_frame);
|
2001-07-27 19:24:14 +02:00
|
|
|
#endif
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(advanced_page.popport_hbox);
|
|
|
|
gtk_widget_hide(advanced_page.imapport_hbox);
|
|
|
|
gtk_widget_show(advanced_page.nntpport_hbox);
|
2011-10-07 11:40:16 +02:00
|
|
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(advanced_page.crosspost_checkbtn);
|
|
|
|
gtk_widget_show(advanced_page.crosspost_colormenu);
|
2011-10-07 11:40:16 +02:00
|
|
|
#endif
|
2007-12-06 18:10:12 +01:00
|
|
|
#ifndef G_OS_WIN32
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(advanced_page.tunnelcmd_checkbtn);
|
|
|
|
gtk_widget_hide(advanced_page.tunnelcmd_entry);
|
2007-12-06 18:10:12 +01:00
|
|
|
#endif
|
2011-02-10 17:02:44 +01:00
|
|
|
gtk_widget_hide(advanced_page.imap_use_trash_checkbtn);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(receive_page.imapdir_label);
|
|
|
|
gtk_widget_hide(receive_page.imapdir_entry);
|
|
|
|
gtk_widget_hide(receive_page.subsonly_checkbtn);
|
|
|
|
gtk_widget_hide(receive_page.low_bandwidth_checkbtn);
|
2001-04-19 14:21:46 +02:00
|
|
|
break;
|
|
|
|
case A_LOCAL:
|
2007-11-08 10:13:16 +01:00
|
|
|
gtk_widget_show(send_page.msgid_checkbtn);
|
2011-08-29 15:00:44 +02:00
|
|
|
gtk_widget_show(send_page.xmailer_checkbtn);
|
2006-10-07 18:03:36 +02:00
|
|
|
gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
|
|
|
|
gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.nntpserv_label);
|
|
|
|
gtk_widget_hide(basic_page.nntpserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
0, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.nntpauth_checkbtn, FALSE);
|
|
|
|
gtk_widget_hide(basic_page.nntpauth_checkbtn);
|
2003-01-27 11:33:19 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.nntpauth_onconnect_checkbtn, FALSE);
|
|
|
|
gtk_widget_hide(basic_page.nntpauth_onconnect_checkbtn);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
1, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.recvserv_label);
|
|
|
|
gtk_widget_hide(basic_page.recvserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
2, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(basic_page.smtpserv_label);
|
|
|
|
gtk_widget_show(basic_page.smtpserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
4, VSPACING_NARROW);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(basic_page.localmbox_label);
|
|
|
|
gtk_widget_show(basic_page.localmbox_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
3, VSPACING_NARROW);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(basic_page.mailcmd_label);
|
|
|
|
gtk_widget_show(basic_page.mailcmd_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
6, VSPACING_NARROW);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(basic_page.mailcmd_checkbtn);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
5, VSPACING_NARROW);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.uid_label);
|
|
|
|
gtk_widget_hide(basic_page.pass_label);
|
|
|
|
gtk_widget_hide(basic_page.uid_entry);
|
|
|
|
gtk_widget_hide(basic_page.pass_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
7, 0);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.uid_label, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.pass_label, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.uid_entry, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.pass_entry, TRUE);
|
|
|
|
gtk_widget_hide(receive_page.pop3_frame);
|
|
|
|
gtk_widget_hide(receive_page.imap_frame);
|
|
|
|
gtk_widget_show(receive_page.local_frame);
|
|
|
|
gtk_widget_hide(receive_page.frame_maxarticle);
|
|
|
|
gtk_widget_set_sensitive(receive_page.filter_on_recv_checkbtn, TRUE);
|
2007-06-04 15:28:06 +02:00
|
|
|
prefs_account_filter_on_recv_toggled
|
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filter_on_recv_checkbtn), NULL);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(receive_page.recvatgetall_checkbtn, TRUE);
|
2001-05-02 05:43:13 +02:00
|
|
|
prefs_account_mailcmd_toggled
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(basic_page.mailcmd_checkbtn), NULL);
|
2001-07-27 19:24:14 +02:00
|
|
|
|
2002-09-15 13:05:51 +02:00
|
|
|
/* update pop_before_smtp sensitivity */
|
2002-09-15 15:37:38 +02:00
|
|
|
gtk_toggle_button_set_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(send_page.pop_bfr_smtp_checkbtn), FALSE);
|
|
|
|
gtk_widget_set_sensitive(send_page.pop_bfr_smtp_checkbtn, FALSE);
|
2007-12-19 11:48:43 +01:00
|
|
|
gtk_widget_set_sensitive(send_page.pop_bfr_smtp_tm_spinbtn, FALSE);
|
2002-09-15 13:05:51 +02:00
|
|
|
|
2002-05-12 08:56:28 +02:00
|
|
|
if (!tmp_ac_prefs.account_name) {
|
2005-09-14 13:31:01 +02:00
|
|
|
gtk_toggle_button_set_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filter_on_recv_checkbtn),
|
2005-09-14 13:31:01 +02:00
|
|
|
TRUE);
|
2007-06-04 15:28:06 +02:00
|
|
|
gtk_toggle_button_set_active
|
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filterhook_on_recv_checkbtn),
|
|
|
|
TRUE);
|
2002-05-12 08:56:28 +02:00
|
|
|
gtk_toggle_button_set_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.recvatgetall_checkbtn),
|
2002-05-12 08:56:28 +02:00
|
|
|
TRUE);
|
|
|
|
}
|
|
|
|
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(ssl_page.pop_frame);
|
|
|
|
gtk_widget_hide(ssl_page.imap_frame);
|
|
|
|
gtk_widget_hide(ssl_page.nntp_frame);
|
|
|
|
gtk_widget_show(ssl_page.send_frame);
|
2001-07-27 19:24:14 +02:00
|
|
|
#endif
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(advanced_page.popport_hbox);
|
|
|
|
gtk_widget_hide(advanced_page.imapport_hbox);
|
|
|
|
gtk_widget_hide(advanced_page.nntpport_hbox);
|
2011-10-07 11:40:16 +02:00
|
|
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(advanced_page.crosspost_checkbtn);
|
|
|
|
gtk_widget_hide(advanced_page.crosspost_colormenu);
|
2011-10-07 11:40:16 +02:00
|
|
|
#endif
|
2007-12-06 18:10:12 +01:00
|
|
|
#ifndef G_OS_WIN32
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(advanced_page.tunnelcmd_checkbtn);
|
|
|
|
gtk_widget_hide(advanced_page.tunnelcmd_entry);
|
2007-12-06 18:10:12 +01:00
|
|
|
#endif
|
2011-02-10 17:02:44 +01:00
|
|
|
gtk_widget_hide(advanced_page.imap_use_trash_checkbtn);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(receive_page.imapdir_label);
|
|
|
|
gtk_widget_hide(receive_page.imapdir_entry);
|
|
|
|
gtk_widget_hide(receive_page.subsonly_checkbtn);
|
|
|
|
gtk_widget_hide(receive_page.low_bandwidth_checkbtn);
|
2001-04-28 12:21:21 +02:00
|
|
|
break;
|
2001-04-19 14:21:46 +02:00
|
|
|
case A_IMAP4:
|
2006-10-07 18:03:36 +02:00
|
|
|
#ifndef HAVE_LIBETPAN
|
|
|
|
gtk_widget_show(protocol_optmenu->no_imap_warn_icon);
|
|
|
|
gtk_widget_show(protocol_optmenu->no_imap_warn_label);
|
|
|
|
#endif
|
2007-11-08 10:13:16 +01:00
|
|
|
if (new_account)
|
|
|
|
gtk_toggle_button_set_active(
|
|
|
|
GTK_TOGGLE_BUTTON(send_page.msgid_checkbtn),
|
|
|
|
TRUE);
|
|
|
|
gtk_widget_hide(send_page.msgid_checkbtn);
|
2011-12-28 20:33:05 +01:00
|
|
|
gtk_widget_show(send_page.xmailer_checkbtn);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.nntpserv_label);
|
|
|
|
gtk_widget_hide(basic_page.nntpserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
0, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.nntpauth_checkbtn, FALSE);
|
|
|
|
gtk_widget_hide(basic_page.nntpauth_checkbtn);
|
2003-01-27 11:33:19 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.nntpauth_onconnect_checkbtn, FALSE);
|
|
|
|
gtk_widget_hide(basic_page.nntpauth_onconnect_checkbtn);
|
2003-01-27 11:33:19 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
1, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.recvserv_label, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.recvserv_entry, TRUE);
|
|
|
|
gtk_widget_show(basic_page.recvserv_label);
|
|
|
|
gtk_widget_show(basic_page.recvserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
2, VSPACING_NARROW);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(basic_page.smtpserv_label);
|
|
|
|
gtk_widget_show(basic_page.smtpserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
4, VSPACING_NARROW);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.localmbox_label);
|
|
|
|
gtk_widget_hide(basic_page.localmbox_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
3, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.mailcmd_label);
|
|
|
|
gtk_widget_hide(basic_page.mailcmd_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
6, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.mailcmd_checkbtn);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
5, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(basic_page.uid_label);
|
|
|
|
gtk_widget_show(basic_page.pass_label);
|
|
|
|
gtk_widget_show(basic_page.uid_entry);
|
|
|
|
gtk_widget_show(basic_page.pass_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
7, VSPACING_NARROW);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.uid_label, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.pass_label, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.uid_entry, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.pass_entry, TRUE);
|
|
|
|
gtk_widget_hide(receive_page.pop3_frame);
|
|
|
|
gtk_widget_show(receive_page.imap_frame);
|
|
|
|
gtk_widget_hide(receive_page.local_frame);
|
|
|
|
gtk_widget_hide(receive_page.frame_maxarticle);
|
|
|
|
gtk_widget_set_sensitive(receive_page.filter_on_recv_checkbtn, TRUE);
|
2007-06-04 15:28:06 +02:00
|
|
|
prefs_account_filter_on_recv_toggled
|
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filter_on_recv_checkbtn), NULL);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(receive_page.recvatgetall_checkbtn, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.smtpserv_entry, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.smtpserv_label, TRUE);
|
2001-07-27 19:24:14 +02:00
|
|
|
|
2002-09-15 13:05:51 +02:00
|
|
|
/* update pop_before_smtp sensitivity */
|
2002-09-15 15:37:38 +02:00
|
|
|
gtk_toggle_button_set_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(send_page.pop_bfr_smtp_checkbtn), FALSE);
|
|
|
|
gtk_widget_set_sensitive(send_page.pop_bfr_smtp_checkbtn, FALSE);
|
2007-12-19 11:48:43 +01:00
|
|
|
gtk_widget_set_sensitive(send_page.pop_bfr_smtp_tm_spinbtn, FALSE);
|
2002-09-22 18:30:27 +02:00
|
|
|
|
2002-05-12 08:56:28 +02:00
|
|
|
if (!tmp_ac_prefs.account_name) {
|
2005-09-14 13:31:01 +02:00
|
|
|
gtk_toggle_button_set_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filter_on_recv_checkbtn),
|
2005-09-14 13:31:01 +02:00
|
|
|
TRUE);
|
2007-06-04 15:28:06 +02:00
|
|
|
gtk_toggle_button_set_active
|
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filterhook_on_recv_checkbtn),
|
|
|
|
TRUE);
|
2002-05-12 08:56:28 +02:00
|
|
|
gtk_toggle_button_set_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.recvatgetall_checkbtn),
|
2002-05-12 08:56:28 +02:00
|
|
|
FALSE);
|
|
|
|
}
|
|
|
|
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(ssl_page.pop_frame);
|
|
|
|
gtk_widget_show(ssl_page.imap_frame);
|
|
|
|
gtk_widget_hide(ssl_page.nntp_frame);
|
|
|
|
gtk_widget_show(ssl_page.send_frame);
|
2001-07-27 19:24:14 +02:00
|
|
|
#endif
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(advanced_page.popport_hbox);
|
|
|
|
gtk_widget_show(advanced_page.imapport_hbox);
|
|
|
|
gtk_widget_hide(advanced_page.nntpport_hbox);
|
2011-10-07 11:40:16 +02:00
|
|
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(advanced_page.crosspost_checkbtn);
|
|
|
|
gtk_widget_hide(advanced_page.crosspost_colormenu);
|
2011-10-07 11:40:16 +02:00
|
|
|
#endif
|
2007-12-06 18:10:12 +01:00
|
|
|
#ifndef G_OS_WIN32
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(advanced_page.tunnelcmd_checkbtn);
|
|
|
|
gtk_widget_show(advanced_page.tunnelcmd_entry);
|
2007-12-06 18:10:12 +01:00
|
|
|
#endif
|
2011-02-10 17:02:44 +01:00
|
|
|
gtk_widget_show(advanced_page.imap_use_trash_checkbtn);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(receive_page.imapdir_label);
|
|
|
|
gtk_widget_show(receive_page.imapdir_entry);
|
|
|
|
gtk_widget_show(receive_page.subsonly_checkbtn);
|
|
|
|
gtk_widget_show(receive_page.low_bandwidth_checkbtn);
|
2001-04-19 14:21:46 +02:00
|
|
|
break;
|
2004-02-21 12:01:01 +01:00
|
|
|
case A_NONE:
|
2007-11-08 10:13:16 +01:00
|
|
|
gtk_widget_show(send_page.msgid_checkbtn);
|
2011-08-29 15:00:44 +02:00
|
|
|
gtk_widget_show(send_page.xmailer_checkbtn);
|
2006-10-07 18:03:36 +02:00
|
|
|
gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
|
|
|
|
gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.nntpserv_label);
|
|
|
|
gtk_widget_hide(basic_page.nntpserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2004-02-21 12:01:01 +01:00
|
|
|
0, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.nntpauth_checkbtn, FALSE);
|
|
|
|
gtk_widget_hide(basic_page.nntpauth_checkbtn);
|
2004-02-21 12:01:01 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.nntpauth_onconnect_checkbtn, FALSE);
|
|
|
|
gtk_widget_hide(basic_page.nntpauth_onconnect_checkbtn);
|
2004-02-21 12:01:01 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2004-02-21 12:01:01 +01:00
|
|
|
1, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.recvserv_label, FALSE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.recvserv_entry, FALSE);
|
|
|
|
gtk_widget_hide(basic_page.recvserv_label);
|
|
|
|
gtk_widget_hide(basic_page.recvserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2004-02-21 12:01:01 +01:00
|
|
|
2, VSPACING_NARROW);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(basic_page.smtpserv_label);
|
|
|
|
gtk_widget_show(basic_page.smtpserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2004-02-21 12:01:01 +01:00
|
|
|
4, VSPACING_NARROW);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.localmbox_label);
|
|
|
|
gtk_widget_hide(basic_page.localmbox_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2004-02-21 12:01:01 +01:00
|
|
|
3, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.mailcmd_label);
|
|
|
|
gtk_widget_hide(basic_page.mailcmd_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2004-02-21 12:01:01 +01:00
|
|
|
6, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.mailcmd_checkbtn);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2004-02-21 12:01:01 +01:00
|
|
|
5, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.uid_label);
|
|
|
|
gtk_widget_hide(basic_page.pass_label);
|
|
|
|
gtk_widget_hide(basic_page.uid_entry);
|
|
|
|
gtk_widget_hide(basic_page.pass_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2004-02-21 12:01:01 +01:00
|
|
|
7, VSPACING_NARROW);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.uid_label, FALSE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.pass_label, FALSE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.uid_entry, FALSE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.pass_entry, FALSE);
|
|
|
|
gtk_widget_set_sensitive(receive_page.pop3_frame, FALSE);
|
|
|
|
gtk_widget_hide(receive_page.pop3_frame);
|
|
|
|
gtk_widget_hide(receive_page.imap_frame);
|
|
|
|
gtk_widget_hide(receive_page.local_frame);
|
|
|
|
gtk_widget_hide(receive_page.frame_maxarticle);
|
|
|
|
gtk_widget_set_sensitive(receive_page.filter_on_recv_checkbtn, FALSE);
|
2007-06-04 15:28:06 +02:00
|
|
|
prefs_account_filter_on_recv_toggled
|
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filter_on_recv_checkbtn), NULL);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(receive_page.recvatgetall_checkbtn, FALSE);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(basic_page.smtpserv_entry, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.smtpserv_label, TRUE);
|
2004-02-21 12:01:01 +01:00
|
|
|
|
|
|
|
/* update pop_before_smtp sensitivity */
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(send_page.pop_bfr_smtp_checkbtn, FALSE);
|
2004-02-21 12:01:01 +01:00
|
|
|
pop_bfr_smtp_tm_set_sens(NULL, NULL);
|
2005-09-14 13:31:01 +02:00
|
|
|
|
|
|
|
gtk_toggle_button_set_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filter_on_recv_checkbtn), FALSE);
|
2007-06-04 15:28:06 +02:00
|
|
|
gtk_toggle_button_set_active
|
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filterhook_on_recv_checkbtn), FALSE);
|
2004-02-21 12:01:01 +01:00
|
|
|
gtk_toggle_button_set_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.recvatgetall_checkbtn), FALSE);
|
2004-02-21 12:01:01 +01:00
|
|
|
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(ssl_page.pop_frame);
|
|
|
|
gtk_widget_hide(ssl_page.imap_frame);
|
|
|
|
gtk_widget_hide(ssl_page.nntp_frame);
|
|
|
|
gtk_widget_show(ssl_page.send_frame);
|
2004-02-21 12:01:01 +01:00
|
|
|
#endif
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(advanced_page.popport_hbox);
|
|
|
|
gtk_widget_hide(advanced_page.imapport_hbox);
|
|
|
|
gtk_widget_hide(advanced_page.nntpport_hbox);
|
2011-10-07 11:40:16 +02:00
|
|
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(advanced_page.crosspost_checkbtn);
|
|
|
|
gtk_widget_hide(advanced_page.crosspost_colormenu);
|
2011-10-07 11:40:16 +02:00
|
|
|
#endif
|
2007-12-06 18:10:12 +01:00
|
|
|
#ifndef G_OS_WIN32
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(advanced_page.tunnelcmd_checkbtn);
|
|
|
|
gtk_widget_hide(advanced_page.tunnelcmd_entry);
|
2007-12-06 18:10:12 +01:00
|
|
|
#endif
|
2011-02-10 17:02:44 +01:00
|
|
|
gtk_widget_hide(advanced_page.imap_use_trash_checkbtn);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(receive_page.imapdir_label);
|
|
|
|
gtk_widget_hide(receive_page.imapdir_entry);
|
|
|
|
gtk_widget_hide(receive_page.subsonly_checkbtn);
|
|
|
|
gtk_widget_hide(receive_page.low_bandwidth_checkbtn);
|
2004-02-21 12:01:01 +01:00
|
|
|
break;
|
2001-05-28 20:38:15 +02:00
|
|
|
case A_POP3:
|
|
|
|
default:
|
2007-11-08 10:13:16 +01:00
|
|
|
gtk_widget_show(send_page.msgid_checkbtn);
|
2011-08-29 15:00:44 +02:00
|
|
|
gtk_widget_show(send_page.xmailer_checkbtn);
|
2006-10-07 18:03:36 +02:00
|
|
|
gtk_widget_hide(protocol_optmenu->no_imap_warn_icon);
|
|
|
|
gtk_widget_hide(protocol_optmenu->no_imap_warn_label);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.nntpserv_label);
|
|
|
|
gtk_widget_hide(basic_page.nntpserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
0, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.nntpauth_checkbtn, FALSE);
|
|
|
|
gtk_widget_hide(basic_page.nntpauth_checkbtn);
|
2003-01-27 11:33:19 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.nntpauth_onconnect_checkbtn, FALSE);
|
|
|
|
gtk_widget_hide(basic_page.nntpauth_onconnect_checkbtn);
|
2003-01-27 11:33:19 +01:00
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
1, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.recvserv_label, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.recvserv_entry, TRUE);
|
|
|
|
gtk_widget_show(basic_page.recvserv_label);
|
|
|
|
gtk_widget_show(basic_page.recvserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
2, VSPACING_NARROW);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(basic_page.smtpserv_label);
|
|
|
|
gtk_widget_show(basic_page.smtpserv_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
4, VSPACING_NARROW);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.localmbox_label);
|
|
|
|
gtk_widget_hide(basic_page.localmbox_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
3, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.mailcmd_label);
|
|
|
|
gtk_widget_hide(basic_page.mailcmd_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
6, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(basic_page.mailcmd_checkbtn);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
5, 0);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(basic_page.uid_label);
|
|
|
|
gtk_widget_show(basic_page.pass_label);
|
|
|
|
gtk_widget_show(basic_page.uid_entry);
|
|
|
|
gtk_widget_show(basic_page.pass_entry);
|
|
|
|
gtk_table_set_row_spacing (GTK_TABLE (basic_page.serv_table),
|
2001-06-17 04:43:41 +02:00
|
|
|
7, VSPACING_NARROW);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.uid_label, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.pass_label, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.uid_entry, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.pass_entry, TRUE);
|
|
|
|
gtk_widget_set_sensitive(receive_page.pop3_frame, TRUE);
|
|
|
|
gtk_widget_show(receive_page.pop3_frame);
|
|
|
|
gtk_widget_hide(receive_page.imap_frame);
|
|
|
|
gtk_widget_hide(receive_page.local_frame);
|
|
|
|
gtk_widget_hide(receive_page.frame_maxarticle);
|
|
|
|
gtk_widget_set_sensitive(receive_page.filter_on_recv_checkbtn, TRUE);
|
2007-06-04 15:28:06 +02:00
|
|
|
prefs_account_filter_on_recv_toggled
|
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filter_on_recv_checkbtn), NULL);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(receive_page.recvatgetall_checkbtn, TRUE);
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive(basic_page.smtpserv_entry, TRUE);
|
|
|
|
gtk_widget_set_sensitive(basic_page.smtpserv_label, TRUE);
|
2001-07-27 19:24:14 +02:00
|
|
|
|
2002-09-15 13:05:51 +02:00
|
|
|
/* update pop_before_smtp sensitivity */
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(send_page.pop_bfr_smtp_checkbtn, TRUE);
|
2002-09-22 18:46:38 +02:00
|
|
|
pop_bfr_smtp_tm_set_sens(NULL, NULL);
|
2002-09-15 13:05:51 +02:00
|
|
|
|
2002-05-12 08:56:28 +02:00
|
|
|
if (!tmp_ac_prefs.account_name) {
|
2005-09-14 13:31:01 +02:00
|
|
|
gtk_toggle_button_set_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filter_on_recv_checkbtn),
|
2005-09-14 13:31:01 +02:00
|
|
|
TRUE);
|
2007-06-04 15:28:06 +02:00
|
|
|
gtk_toggle_button_set_active
|
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.filterhook_on_recv_checkbtn),
|
|
|
|
TRUE);
|
2002-05-12 08:56:28 +02:00
|
|
|
gtk_toggle_button_set_active
|
2007-06-03 21:32:41 +02:00
|
|
|
(GTK_TOGGLE_BUTTON(receive_page.recvatgetall_checkbtn),
|
2002-05-12 08:56:28 +02:00
|
|
|
TRUE);
|
|
|
|
}
|
|
|
|
|
2008-10-11 16:23:27 +02:00
|
|
|
#ifdef USE_GNUTLS
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(ssl_page.pop_frame);
|
|
|
|
gtk_widget_hide(ssl_page.imap_frame);
|
|
|
|
gtk_widget_hide(ssl_page.nntp_frame);
|
|
|
|
gtk_widget_show(ssl_page.send_frame);
|
2001-07-27 19:24:14 +02:00
|
|
|
#endif
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_show(advanced_page.popport_hbox);
|
|
|
|
gtk_widget_hide(advanced_page.imapport_hbox);
|
|
|
|
gtk_widget_hide(advanced_page.nntpport_hbox);
|
2011-10-07 11:40:16 +02:00
|
|
|
#if !GTK_CHECK_VERSION(3, 0, 0)
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(advanced_page.crosspost_checkbtn);
|
|
|
|
gtk_widget_hide(advanced_page.crosspost_colormenu);
|
2011-10-07 11:40:16 +02:00
|
|
|
#endif
|
2007-12-06 18:10:12 +01:00
|
|
|
#ifndef G_OS_WIN32
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(advanced_page.tunnelcmd_checkbtn);
|
|
|
|
gtk_widget_hide(advanced_page.tunnelcmd_entry);
|
2007-12-06 18:10:12 +01:00
|
|
|
#endif
|
2011-02-10 17:02:44 +01:00
|
|
|
gtk_widget_hide(advanced_page.imap_use_trash_checkbtn);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_hide(receive_page.imapdir_label);
|
|
|
|
gtk_widget_hide(receive_page.imapdir_entry);
|
|
|
|
gtk_widget_hide(receive_page.subsonly_checkbtn);
|
|
|
|
gtk_widget_hide(receive_page.low_bandwidth_checkbtn);
|
2001-04-19 14:21:46 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_queue_resize(basic_page.serv_frame);
|
2001-04-19 14:21:46 +02:00
|
|
|
}
|
2001-05-01 19:29:01 +02:00
|
|
|
|
|
|
|
static void prefs_account_nntpauth_toggled(GtkToggleButton *button,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
gboolean auth;
|
|
|
|
|
2011-10-22 19:09:05 +02:00
|
|
|
if (!gtk_widget_get_sensitive (GTK_WIDGET (button)))
|
2001-05-02 11:50:59 +02:00
|
|
|
return;
|
2001-05-01 19:29:01 +02:00
|
|
|
auth = gtk_toggle_button_get_active (button);
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.uid_label, auth);
|
|
|
|
gtk_widget_set_sensitive(basic_page.pass_label, auth);
|
|
|
|
gtk_widget_set_sensitive(basic_page.uid_entry, auth);
|
|
|
|
gtk_widget_set_sensitive(basic_page.pass_entry, auth);
|
|
|
|
gtk_widget_set_sensitive(basic_page.nntpauth_onconnect_checkbtn, auth);
|
2001-05-01 19:29:01 +02:00
|
|
|
}
|
2001-05-02 05:43:13 +02:00
|
|
|
|
|
|
|
static void prefs_account_mailcmd_toggled(GtkToggleButton *button,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
gboolean use_mailcmd;
|
|
|
|
|
|
|
|
use_mailcmd = gtk_toggle_button_get_active (button);
|
|
|
|
|
2007-06-03 21:32:41 +02:00
|
|
|
gtk_widget_set_sensitive(basic_page.mailcmd_entry, use_mailcmd);
|
|
|
|
gtk_widget_set_sensitive(basic_page.mailcmd_label, use_mailcmd);
|
|
|
|
gtk_widget_set_sensitive(basic_page.smtpserv_entry, !use_mailcmd);
|
|
|
|
gtk_widget_set_sensitive(basic_page.smtpserv_label, !use_mailcmd);
|
|
|
|
gtk_widget_set_sensitive(basic_page.uid_entry, !use_mailcmd);
|
|
|
|
gtk_widget_set_sensitive(basic_page.pass_entry, !use_mailcmd);
|
2001-05-02 05:43:13 +02:00
|
|
|
}
|
2004-11-23 16:57:07 +01:00
|
|
|
|
2007-06-04 15:28:06 +02:00
|
|
|
static void prefs_account_filter_on_recv_toggled(GtkToggleButton *button,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
gboolean do_filter;
|
|
|
|
|
|
|
|
do_filter = gtk_toggle_button_get_active (button);
|
|
|
|
gtk_widget_set_sensitive(receive_page.filterhook_on_recv_checkbtn, do_filter);
|
|
|
|
}
|
|
|
|
|
2008-09-12 18:11:51 +02:00
|
|
|
#if USE_ENCHANT
|
2007-01-11 12:16:38 +01:00
|
|
|
static void prefs_account_compose_default_dictionary_set_string_from_optmenu
|
|
|
|
(PrefParam *pparam)
|
|
|
|
{
|
2007-10-30 09:04:20 +01:00
|
|
|
GtkWidget *combo;
|
2007-01-11 12:16:38 +01:00
|
|
|
gchar **str;
|
|
|
|
|
2009-02-23 17:55:51 +01:00
|
|
|
cm_return_if_fail(*pparam->widget != NULL);
|
2007-01-11 12:16:38 +01:00
|
|
|
|
2007-10-30 09:04:20 +01:00
|
|
|
combo = *pparam->widget;
|
2007-01-11 12:16:38 +01:00
|
|
|
str = (gchar **) pparam->data;
|
2007-10-30 09:04:20 +01:00
|
|
|
|
2007-01-11 12:16:38 +01:00
|
|
|
g_free(*str);
|
2007-10-30 09:04:20 +01:00
|
|
|
*str = gtkaspell_get_dictionary_menu_active_item(GTK_COMBO_BOX(combo));
|
2007-01-11 12:16:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void prefs_account_compose_default_dictionary_set_optmenu_from_string
|
|
|
|
(PrefParam *pparam)
|
|
|
|
{
|
2007-10-30 09:04:20 +01:00
|
|
|
GtkWidget *combo;
|
2007-01-11 12:16:38 +01:00
|
|
|
gchar *dictionary;
|
|
|
|
|
2009-02-23 17:55:51 +01:00
|
|
|
cm_return_if_fail(*pparam->widget != NULL);
|
2007-01-11 12:16:38 +01:00
|
|
|
|
|
|
|
dictionary = *((gchar **) pparam->data);
|
2009-02-23 17:55:51 +01:00
|
|
|
if (dictionary != NULL) {
|
|
|
|
if (strrchr(dictionary, '/')) {
|
|
|
|
dictionary = g_strdup(strrchr(dictionary, '/')+1);
|
|
|
|
}
|
2008-09-12 18:11:51 +02:00
|
|
|
|
2009-02-23 17:55:51 +01:00
|
|
|
if (strchr(dictionary, '-')) {
|
|
|
|
*(strchr(dictionary, '-')) = '\0';
|
|
|
|
}
|
2008-09-16 22:40:24 +02:00
|
|
|
}
|
2007-10-30 09:04:20 +01:00
|
|
|
combo = *pparam->widget;
|
2009-02-23 17:55:51 +01:00
|
|
|
if (dictionary && *dictionary)
|
2007-10-30 09:04:20 +01:00
|
|
|
gtkaspell_set_dictionary_menu_active_item(GTK_COMBO_BOX(combo),
|
|
|
|
dictionary);
|
2009-02-23 17:55:51 +01:00
|
|
|
else {
|
|
|
|
GtkTreeModel *model;
|
|
|
|
GtkTreeIter iter;
|
|
|
|
if((model = gtk_combo_box_get_model(GTK_COMBO_BOX(combo))) == NULL)
|
|
|
|
return;
|
|
|
|
if((gtk_tree_model_get_iter_first(model, &iter)) == FALSE)
|
|
|
|
return;
|
|
|
|
gtk_combo_box_set_active_iter(GTK_COMBO_BOX(combo), &iter);
|
|
|
|
}
|
2007-01-11 12:16:38 +01:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-11-23 16:57:07 +01:00
|
|
|
void prefs_account_register_page(PrefsPage *page)
|
|
|
|
{
|
|
|
|
prefs_pages = g_slist_append(prefs_pages, page);
|
2007-06-03 21:32:41 +02:00
|
|
|
|
2004-11-23 16:57:07 +01:00
|
|
|
}
|
|
|
|
|
2005-07-05 18:53:12 +02:00
|
|
|
void prefs_account_unregister_page(PrefsPage *page)
|
2004-11-23 16:57:07 +01:00
|
|
|
{
|
|
|
|
prefs_pages = g_slist_remove(prefs_pages, page);
|
|
|
|
}
|