root / src / prefs_account_dialog.c @ 533
History | View | Annotate | Download (69.8 kB)
| 1 | 533 | hiro | /*
|
|---|---|---|---|
| 2 | 533 | hiro | * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client |
| 3 | 533 | hiro | * Copyright (C) 1999-2005 Hiroyuki Yamamoto |
| 4 | 533 | hiro | * |
| 5 | 533 | hiro | * This program is free software; you can redistribute it and/or modify |
| 6 | 533 | hiro | * it under the terms of the GNU General Public License as published by |
| 7 | 533 | hiro | * the Free Software Foundation; either version 2 of the License, or |
| 8 | 533 | hiro | * (at your option) any later version. |
| 9 | 533 | hiro | * |
| 10 | 533 | hiro | * This program is distributed in the hope that it will be useful, |
| 11 | 533 | hiro | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | 533 | hiro | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | 533 | hiro | * GNU General Public License for more details. |
| 14 | 533 | hiro | * |
| 15 | 533 | hiro | * You should have received a copy of the GNU General Public License |
| 16 | 533 | hiro | * along with this program; if not, write to the Free Software |
| 17 | 533 | hiro | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 18 | 533 | hiro | */ |
| 19 | 533 | hiro | |
| 20 | 533 | hiro | #ifdef HAVE_CONFIG_H
|
| 21 | 533 | hiro | # include "config.h" |
| 22 | 533 | hiro | #endif
|
| 23 | 533 | hiro | |
| 24 | 533 | hiro | #include "defs.h" |
| 25 | 533 | hiro | |
| 26 | 533 | hiro | #include <glib.h> |
| 27 | 533 | hiro | #include <glib/gi18n.h> |
| 28 | 533 | hiro | #include <gtk/gtk.h> |
| 29 | 533 | hiro | #include <gdk/gdkkeysyms.h> |
| 30 | 533 | hiro | #include <stdio.h> |
| 31 | 533 | hiro | #include <sys/types.h> |
| 32 | 533 | hiro | #include <sys/stat.h> |
| 33 | 533 | hiro | #include <string.h> |
| 34 | 533 | hiro | #include <stdlib.h> |
| 35 | 533 | hiro | #include <ctype.h> |
| 36 | 533 | hiro | |
| 37 | 533 | hiro | #include "main.h" |
| 38 | 533 | hiro | #include "prefs.h" |
| 39 | 533 | hiro | #include "prefs_ui.h" |
| 40 | 533 | hiro | #include "prefs_account.h" |
| 41 | 533 | hiro | #include "prefs_account_dialog.h" |
| 42 | 533 | hiro | #include "prefs_customheader.h" |
| 43 | 533 | hiro | #include "prefs_common.h" |
| 44 | 533 | hiro | #include "account.h" |
| 45 | 533 | hiro | #include "mainwindow.h" |
| 46 | 533 | hiro | #include "manage_window.h" |
| 47 | 533 | hiro | #include "foldersel.h" |
| 48 | 533 | hiro | #include "inc.h" |
| 49 | 533 | hiro | #include "menu.h" |
| 50 | 533 | hiro | #include "gtkutils.h" |
| 51 | 533 | hiro | #include "utils.h" |
| 52 | 533 | hiro | #include "alertpanel.h" |
| 53 | 533 | hiro | #include "smtp.h" |
| 54 | 533 | hiro | #include "imap.h" |
| 55 | 533 | hiro | |
| 56 | 533 | hiro | static gboolean cancelled;
|
| 57 | 533 | hiro | static PrefsDialog dialog;
|
| 58 | 533 | hiro | |
| 59 | 533 | hiro | static struct Basic { |
| 60 | 533 | hiro | GtkWidget *acname_entry; |
| 61 | 533 | hiro | GtkWidget *default_chkbtn; |
| 62 | 533 | hiro | |
| 63 | 533 | hiro | GtkWidget *name_entry; |
| 64 | 533 | hiro | GtkWidget *addr_entry; |
| 65 | 533 | hiro | GtkWidget *org_entry; |
| 66 | 533 | hiro | |
| 67 | 533 | hiro | GtkWidget *serv_frame; |
| 68 | 533 | hiro | GtkWidget *serv_table; |
| 69 | 533 | hiro | GtkWidget *protocol_optmenu; |
| 70 | 533 | hiro | GtkWidget *recvserv_label; |
| 71 | 533 | hiro | GtkWidget *smtpserv_label; |
| 72 | 533 | hiro | GtkWidget *nntpserv_label; |
| 73 | 533 | hiro | GtkWidget *recvserv_entry; |
| 74 | 533 | hiro | GtkWidget *smtpserv_entry; |
| 75 | 533 | hiro | GtkWidget *nntpserv_entry; |
| 76 | 533 | hiro | GtkWidget *nntpauth_chkbtn; |
| 77 | 533 | hiro | GtkWidget *uid_label; |
| 78 | 533 | hiro | GtkWidget *pass_label; |
| 79 | 533 | hiro | GtkWidget *uid_entry; |
| 80 | 533 | hiro | GtkWidget *pass_entry; |
| 81 | 533 | hiro | } basic; |
| 82 | 533 | hiro | |
| 83 | 533 | hiro | static struct Receive { |
| 84 | 533 | hiro | GtkWidget *pop3_frame; |
| 85 | 533 | hiro | GtkWidget *use_apop_chkbtn; |
| 86 | 533 | hiro | GtkWidget *rmmail_chkbtn; |
| 87 | 533 | hiro | GtkWidget *leave_time_entry; |
| 88 | 533 | hiro | GtkWidget *getall_chkbtn; |
| 89 | 533 | hiro | GtkWidget *size_limit_chkbtn; |
| 90 | 533 | hiro | GtkWidget *size_limit_entry; |
| 91 | 533 | hiro | GtkWidget *filter_on_recv_chkbtn; |
| 92 | 533 | hiro | GtkWidget *inbox_label; |
| 93 | 533 | hiro | GtkWidget *inbox_entry; |
| 94 | 533 | hiro | GtkWidget *inbox_btn; |
| 95 | 533 | hiro | |
| 96 | 533 | hiro | GtkWidget *imap_frame; |
| 97 | 533 | hiro | GtkWidget *imap_auth_type_optmenu; |
| 98 | 533 | hiro | |
| 99 | 533 | hiro | GtkWidget *nntp_frame; |
| 100 | 533 | hiro | GtkWidget *maxarticle_spinbtn; |
| 101 | 533 | hiro | GtkObject *maxarticle_spinbtn_adj; |
| 102 | 533 | hiro | |
| 103 | 533 | hiro | GtkWidget *recvatgetall_chkbtn; |
| 104 | 533 | hiro | } receive; |
| 105 | 533 | hiro | |
| 106 | 533 | hiro | static struct Send { |
| 107 | 533 | hiro | GtkWidget *date_chkbtn; |
| 108 | 533 | hiro | GtkWidget *msgid_chkbtn; |
| 109 | 533 | hiro | |
| 110 | 533 | hiro | GtkWidget *customhdr_chkbtn; |
| 111 | 533 | hiro | |
| 112 | 533 | hiro | GtkWidget *smtp_auth_chkbtn; |
| 113 | 533 | hiro | GtkWidget *smtp_auth_type_optmenu; |
| 114 | 533 | hiro | GtkWidget *smtp_uid_entry; |
| 115 | 533 | hiro | GtkWidget *smtp_pass_entry; |
| 116 | 533 | hiro | /* GtkWidget *pop_bfr_smtp_chkbtn; */
|
| 117 | 533 | hiro | } p_send; |
| 118 | 533 | hiro | |
| 119 | 533 | hiro | static struct Compose { |
| 120 | 533 | hiro | GtkWidget *sigfile_radiobtn; |
| 121 | 533 | hiro | GtkWidget *sigpath_entry; |
| 122 | 533 | hiro | |
| 123 | 533 | hiro | GtkWidget *autocc_chkbtn; |
| 124 | 533 | hiro | GtkWidget *autocc_entry; |
| 125 | 533 | hiro | GtkWidget *autobcc_chkbtn; |
| 126 | 533 | hiro | GtkWidget *autobcc_entry; |
| 127 | 533 | hiro | GtkWidget *autoreplyto_chkbtn; |
| 128 | 533 | hiro | GtkWidget *autoreplyto_entry; |
| 129 | 533 | hiro | } compose; |
| 130 | 533 | hiro | |
| 131 | 533 | hiro | #if USE_GPGME
|
| 132 | 533 | hiro | static struct Privacy { |
| 133 | 533 | hiro | GtkWidget *default_sign_chkbtn; |
| 134 | 533 | hiro | GtkWidget *default_encrypt_chkbtn; |
| 135 | 533 | hiro | GtkWidget *encrypt_reply_chkbtn; |
| 136 | 533 | hiro | GtkWidget *ascii_armored_chkbtn; |
| 137 | 533 | hiro | GtkWidget *clearsign_chkbtn; |
| 138 | 533 | hiro | GtkWidget *defaultkey_radiobtn; |
| 139 | 533 | hiro | GtkWidget *emailkey_radiobtn; |
| 140 | 533 | hiro | GtkWidget *customkey_radiobtn; |
| 141 | 533 | hiro | GtkWidget *customkey_entry; |
| 142 | 533 | hiro | } privacy; |
| 143 | 533 | hiro | #endif /* USE_GPGME */ |
| 144 | 533 | hiro | |
| 145 | 533 | hiro | #if USE_SSL
|
| 146 | 533 | hiro | static struct SSLPrefs { |
| 147 | 533 | hiro | GtkWidget *pop_frame; |
| 148 | 533 | hiro | GtkWidget *pop_nossl_radiobtn; |
| 149 | 533 | hiro | GtkWidget *pop_ssltunnel_radiobtn; |
| 150 | 533 | hiro | GtkWidget *pop_starttls_radiobtn; |
| 151 | 533 | hiro | |
| 152 | 533 | hiro | GtkWidget *imap_frame; |
| 153 | 533 | hiro | GtkWidget *imap_nossl_radiobtn; |
| 154 | 533 | hiro | GtkWidget *imap_ssltunnel_radiobtn; |
| 155 | 533 | hiro | GtkWidget *imap_starttls_radiobtn; |
| 156 | 533 | hiro | |
| 157 | 533 | hiro | GtkWidget *nntp_frame; |
| 158 | 533 | hiro | GtkWidget *nntp_nossl_radiobtn; |
| 159 | 533 | hiro | GtkWidget *nntp_ssltunnel_radiobtn; |
| 160 | 533 | hiro | |
| 161 | 533 | hiro | GtkWidget *send_frame; |
| 162 | 533 | hiro | GtkWidget *smtp_nossl_radiobtn; |
| 163 | 533 | hiro | GtkWidget *smtp_ssltunnel_radiobtn; |
| 164 | 533 | hiro | GtkWidget *smtp_starttls_radiobtn; |
| 165 | 533 | hiro | |
| 166 | 533 | hiro | GtkWidget *use_nonblocking_ssl_chkbtn; |
| 167 | 533 | hiro | } ssl; |
| 168 | 533 | hiro | #endif /* USE_SSL */ |
| 169 | 533 | hiro | |
| 170 | 533 | hiro | static struct Advanced { |
| 171 | 533 | hiro | GtkWidget *smtpport_chkbtn; |
| 172 | 533 | hiro | GtkWidget *smtpport_entry; |
| 173 | 533 | hiro | GtkWidget *popport_hbox; |
| 174 | 533 | hiro | GtkWidget *popport_chkbtn; |
| 175 | 533 | hiro | GtkWidget *popport_entry; |
| 176 | 533 | hiro | GtkWidget *imapport_hbox; |
| 177 | 533 | hiro | GtkWidget *imapport_chkbtn; |
| 178 | 533 | hiro | GtkWidget *imapport_entry; |
| 179 | 533 | hiro | GtkWidget *nntpport_hbox; |
| 180 | 533 | hiro | GtkWidget *nntpport_chkbtn; |
| 181 | 533 | hiro | GtkWidget *nntpport_entry; |
| 182 | 533 | hiro | GtkWidget *domain_chkbtn; |
| 183 | 533 | hiro | GtkWidget *domain_entry; |
| 184 | 533 | hiro | |
| 185 | 533 | hiro | GtkWidget *imap_frame; |
| 186 | 533 | hiro | GtkWidget *imapdir_entry; |
| 187 | 533 | hiro | |
| 188 | 533 | hiro | GtkWidget *sent_folder_chkbtn; |
| 189 | 533 | hiro | GtkWidget *sent_folder_entry; |
| 190 | 533 | hiro | GtkWidget *draft_folder_chkbtn; |
| 191 | 533 | hiro | GtkWidget *draft_folder_entry; |
| 192 | 533 | hiro | GtkWidget *trash_folder_chkbtn; |
| 193 | 533 | hiro | GtkWidget *trash_folder_entry; |
| 194 | 533 | hiro | } advanced; |
| 195 | 533 | hiro | |
| 196 | 533 | hiro | static void prefs_account_protocol_set_data_from_optmenu(PrefParam *pparam); |
| 197 | 533 | hiro | static void prefs_account_protocol_set_optmenu (PrefParam *pparam); |
| 198 | 533 | hiro | static void prefs_account_protocol_activated (GtkMenuItem *menuitem); |
| 199 | 533 | hiro | |
| 200 | 533 | hiro | static void prefs_account_imap_auth_type_set_data_from_optmenu |
| 201 | 533 | hiro | (PrefParam *pparam); |
| 202 | 533 | hiro | static void prefs_account_imap_auth_type_set_optmenu (PrefParam *pparam); |
| 203 | 533 | hiro | static void prefs_account_smtp_auth_type_set_data_from_optmenu |
| 204 | 533 | hiro | (PrefParam *pparam); |
| 205 | 533 | hiro | static void prefs_account_smtp_auth_type_set_optmenu (PrefParam *pparam); |
| 206 | 533 | hiro | |
| 207 | 533 | hiro | static void prefs_account_enum_set_data_from_radiobtn (PrefParam *pparam); |
| 208 | 533 | hiro | static void prefs_account_enum_set_radiobtn (PrefParam *pparam); |
| 209 | 533 | hiro | |
| 210 | 533 | hiro | #if USE_GPGME
|
| 211 | 533 | hiro | static void prefs_account_ascii_armored_warning (GtkWidget *widget); |
| 212 | 533 | hiro | #endif /* USE_GPGME */ |
| 213 | 533 | hiro | |
| 214 | 533 | hiro | static PrefsUIData ui_data[] = {
|
| 215 | 533 | hiro | /* Basic */
|
| 216 | 533 | hiro | {"account_name", &basic.acname_entry,
|
| 217 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 218 | 533 | hiro | {"is_default", &basic.default_chkbtn,
|
| 219 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 220 | 533 | hiro | {"name", &basic.name_entry,
|
| 221 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 222 | 533 | hiro | {"address", &basic.addr_entry,
|
| 223 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 224 | 533 | hiro | {"organization", &basic.org_entry,
|
| 225 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 226 | 533 | hiro | {"protocol", &basic.protocol_optmenu,
|
| 227 | 533 | hiro | prefs_account_protocol_set_data_from_optmenu, |
| 228 | 533 | hiro | prefs_account_protocol_set_optmenu}, |
| 229 | 533 | hiro | {"receive_server", &basic.recvserv_entry,
|
| 230 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 231 | 533 | hiro | {"smtp_server", &basic.smtpserv_entry,
|
| 232 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 233 | 533 | hiro | {"nntp_server", &basic.nntpserv_entry,
|
| 234 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 235 | 533 | hiro | {"use_nntp_auth", &basic.nntpauth_chkbtn,
|
| 236 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 237 | 533 | hiro | {"user_id", &basic.uid_entry,
|
| 238 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 239 | 533 | hiro | {"password", &basic.pass_entry,
|
| 240 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 241 | 533 | hiro | {"inbox", &receive.inbox_entry,
|
| 242 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 243 | 533 | hiro | |
| 244 | 533 | hiro | /* Receive */
|
| 245 | 533 | hiro | {"use_apop_auth", &receive.use_apop_chkbtn,
|
| 246 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 247 | 533 | hiro | {"remove_mail", &receive.rmmail_chkbtn,
|
| 248 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 249 | 533 | hiro | {"message_leave_time", &receive.leave_time_entry,
|
| 250 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 251 | 533 | hiro | {"get_all_mail", &receive.getall_chkbtn,
|
| 252 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 253 | 533 | hiro | {"enable_size_limit", &receive.size_limit_chkbtn,
|
| 254 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 255 | 533 | hiro | {"size_limit", &receive.size_limit_entry,
|
| 256 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 257 | 533 | hiro | {"filter_on_receive", &receive.filter_on_recv_chkbtn,
|
| 258 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 259 | 533 | hiro | {"imap_auth_method", &receive.imap_auth_type_optmenu,
|
| 260 | 533 | hiro | prefs_account_imap_auth_type_set_data_from_optmenu, |
| 261 | 533 | hiro | prefs_account_imap_auth_type_set_optmenu}, |
| 262 | 533 | hiro | {"max_nntp_articles", &receive.maxarticle_spinbtn,
|
| 263 | 533 | hiro | prefs_set_data_from_spinbtn, prefs_set_spinbtn}, |
| 264 | 533 | hiro | {"receive_at_get_all", &receive.recvatgetall_chkbtn,
|
| 265 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 266 | 533 | hiro | |
| 267 | 533 | hiro | /* Send */
|
| 268 | 533 | hiro | {"add_date", &p_send.date_chkbtn,
|
| 269 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 270 | 533 | hiro | {"generate_msgid", &p_send.msgid_chkbtn,
|
| 271 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 272 | 533 | hiro | {"add_custom_header", &p_send.customhdr_chkbtn,
|
| 273 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 274 | 533 | hiro | {"use_smtp_auth", &p_send.smtp_auth_chkbtn,
|
| 275 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 276 | 533 | hiro | {"smtp_auth_method", &p_send.smtp_auth_type_optmenu,
|
| 277 | 533 | hiro | prefs_account_smtp_auth_type_set_data_from_optmenu, |
| 278 | 533 | hiro | prefs_account_smtp_auth_type_set_optmenu}, |
| 279 | 533 | hiro | {"smtp_user_id", &p_send.smtp_uid_entry,
|
| 280 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 281 | 533 | hiro | {"smtp_password", &p_send.smtp_pass_entry,
|
| 282 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 283 | 533 | hiro | |
| 284 | 533 | hiro | /* {"pop_before_smtp", NULL, NULL, NULL}, */
|
| 285 | 533 | hiro | |
| 286 | 533 | hiro | /* Compose */
|
| 287 | 533 | hiro | {"signature_type", &compose.sigfile_radiobtn,
|
| 288 | 533 | hiro | prefs_account_enum_set_data_from_radiobtn, |
| 289 | 533 | hiro | prefs_account_enum_set_radiobtn}, |
| 290 | 533 | hiro | {"signature_path", &compose.sigpath_entry,
|
| 291 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 292 | 533 | hiro | {"set_autocc", &compose.autocc_chkbtn,
|
| 293 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 294 | 533 | hiro | {"auto_cc", &compose.autocc_entry,
|
| 295 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 296 | 533 | hiro | {"set_autobcc", &compose.autobcc_chkbtn,
|
| 297 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 298 | 533 | hiro | {"auto_bcc", &compose.autobcc_entry,
|
| 299 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 300 | 533 | hiro | {"set_autoreplyto", &compose.autoreplyto_chkbtn,
|
| 301 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 302 | 533 | hiro | {"auto_replyto", &compose.autoreplyto_entry,
|
| 303 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 304 | 533 | hiro | |
| 305 | 533 | hiro | #if USE_GPGME
|
| 306 | 533 | hiro | /* Privacy */
|
| 307 | 533 | hiro | {"default_sign", &privacy.default_sign_chkbtn,
|
| 308 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 309 | 533 | hiro | {"default_encrypt", &privacy.default_encrypt_chkbtn,
|
| 310 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 311 | 533 | hiro | {"encrypt_reply", &privacy.encrypt_reply_chkbtn,
|
| 312 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 313 | 533 | hiro | {"ascii_armored", &privacy.ascii_armored_chkbtn,
|
| 314 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 315 | 533 | hiro | {"clearsign", &privacy.clearsign_chkbtn,
|
| 316 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 317 | 533 | hiro | {"sign_key", &privacy.defaultkey_radiobtn,
|
| 318 | 533 | hiro | prefs_account_enum_set_data_from_radiobtn, |
| 319 | 533 | hiro | prefs_account_enum_set_radiobtn}, |
| 320 | 533 | hiro | {"sign_key_id", &privacy.customkey_entry,
|
| 321 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 322 | 533 | hiro | #endif /* USE_GPGME */ |
| 323 | 533 | hiro | |
| 324 | 533 | hiro | #if USE_SSL
|
| 325 | 533 | hiro | /* SSL */
|
| 326 | 533 | hiro | {"ssl_pop", &ssl.pop_nossl_radiobtn,
|
| 327 | 533 | hiro | prefs_account_enum_set_data_from_radiobtn, |
| 328 | 533 | hiro | prefs_account_enum_set_radiobtn}, |
| 329 | 533 | hiro | {"ssl_imap", &ssl.imap_nossl_radiobtn,
|
| 330 | 533 | hiro | prefs_account_enum_set_data_from_radiobtn, |
| 331 | 533 | hiro | prefs_account_enum_set_radiobtn}, |
| 332 | 533 | hiro | {"ssl_nntp", &ssl.nntp_nossl_radiobtn,
|
| 333 | 533 | hiro | prefs_account_enum_set_data_from_radiobtn, |
| 334 | 533 | hiro | prefs_account_enum_set_radiobtn}, |
| 335 | 533 | hiro | {"ssl_smtp", &ssl.smtp_nossl_radiobtn,
|
| 336 | 533 | hiro | prefs_account_enum_set_data_from_radiobtn, |
| 337 | 533 | hiro | prefs_account_enum_set_radiobtn}, |
| 338 | 533 | hiro | {"use_nonblocking_ssl", &ssl.use_nonblocking_ssl_chkbtn,
|
| 339 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 340 | 533 | hiro | #endif /* USE_SSL */ |
| 341 | 533 | hiro | |
| 342 | 533 | hiro | /* Advanced */
|
| 343 | 533 | hiro | {"set_smtpport", &advanced.smtpport_chkbtn,
|
| 344 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 345 | 533 | hiro | {"smtp_port", &advanced.smtpport_entry,
|
| 346 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 347 | 533 | hiro | {"set_popport", &advanced.popport_chkbtn,
|
| 348 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 349 | 533 | hiro | {"pop_port", &advanced.popport_entry,
|
| 350 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 351 | 533 | hiro | {"set_imapport", &advanced.imapport_chkbtn,
|
| 352 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 353 | 533 | hiro | {"imap_port", &advanced.imapport_entry,
|
| 354 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 355 | 533 | hiro | {"set_nntpport", &advanced.nntpport_chkbtn,
|
| 356 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 357 | 533 | hiro | {"nntp_port", &advanced.nntpport_entry,
|
| 358 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 359 | 533 | hiro | {"set_domain", &advanced.domain_chkbtn,
|
| 360 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 361 | 533 | hiro | {"domain", &advanced.domain_entry,
|
| 362 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 363 | 533 | hiro | {"imap_directory", &advanced.imapdir_entry,
|
| 364 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 365 | 533 | hiro | {"set_sent_folder", &advanced.sent_folder_chkbtn,
|
| 366 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 367 | 533 | hiro | {"sent_folder", &advanced.sent_folder_entry,
|
| 368 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 369 | 533 | hiro | {"set_draft_folder", &advanced.draft_folder_chkbtn,
|
| 370 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 371 | 533 | hiro | {"draft_folder", &advanced.draft_folder_entry,
|
| 372 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 373 | 533 | hiro | {"set_trash_folder", &advanced.trash_folder_chkbtn,
|
| 374 | 533 | hiro | prefs_set_data_from_toggle, prefs_set_toggle}, |
| 375 | 533 | hiro | {"trash_folder", &advanced.trash_folder_entry,
|
| 376 | 533 | hiro | prefs_set_data_from_entry, prefs_set_entry}, |
| 377 | 533 | hiro | |
| 378 | 533 | hiro | {NULL, NULL, NULL, NULL}
|
| 379 | 533 | hiro | }; |
| 380 | 533 | hiro | |
| 381 | 533 | hiro | static void prefs_account_create (void); |
| 382 | 533 | hiro | static void prefs_account_basic_create (void); |
| 383 | 533 | hiro | static void prefs_account_receive_create (void); |
| 384 | 533 | hiro | static void prefs_account_send_create (void); |
| 385 | 533 | hiro | static void prefs_account_compose_create (void); |
| 386 | 533 | hiro | #if USE_GPGME
|
| 387 | 533 | hiro | static void prefs_account_privacy_create (void); |
| 388 | 533 | hiro | #endif /* USE_GPGME */ |
| 389 | 533 | hiro | #if USE_SSL
|
| 390 | 533 | hiro | static void prefs_account_ssl_create (void); |
| 391 | 533 | hiro | #endif /* USE_SSL */ |
| 392 | 533 | hiro | static void prefs_account_advanced_create (void); |
| 393 | 533 | hiro | |
| 394 | 533 | hiro | static void prefs_account_select_folder_cb (GtkWidget *widget, |
| 395 | 533 | hiro | gpointer data); |
| 396 | 533 | hiro | static void prefs_account_edit_custom_header (void); |
| 397 | 533 | hiro | |
| 398 | 533 | hiro | static gint prefs_account_deleted (GtkWidget *widget,
|
| 399 | 533 | hiro | GdkEventAny *event, |
| 400 | 533 | hiro | gpointer data); |
| 401 | 533 | hiro | static gboolean prefs_account_key_pressed (GtkWidget *widget,
|
| 402 | 533 | hiro | GdkEventKey *event, |
| 403 | 533 | hiro | gpointer data); |
| 404 | 533 | hiro | static void prefs_account_ok (void); |
| 405 | 533 | hiro | static gint prefs_account_apply (void); |
| 406 | 533 | hiro | static void prefs_account_cancel (void); |
| 407 | 533 | hiro | |
| 408 | 533 | hiro | |
| 409 | 533 | hiro | PrefsAccount *prefs_account_open(PrefsAccount *ac_prefs) |
| 410 | 533 | hiro | {
|
| 411 | 533 | hiro | gboolean new_account = FALSE; |
| 412 | 533 | hiro | static gboolean ui_registered = FALSE;
|
| 413 | 533 | hiro | |
| 414 | 533 | hiro | debug_print(_("Opening account preferences window...\n"));
|
| 415 | 533 | hiro | |
| 416 | 533 | hiro | inc_lock(); |
| 417 | 533 | hiro | |
| 418 | 533 | hiro | cancelled = FALSE; |
| 419 | 533 | hiro | |
| 420 | 533 | hiro | if (!ui_registered) {
|
| 421 | 533 | hiro | prefs_register_ui(prefs_account_get_params(), ui_data); |
| 422 | 533 | hiro | ui_registered = TRUE; |
| 423 | 533 | hiro | } |
| 424 | 533 | hiro | |
| 425 | 533 | hiro | if (!ac_prefs) {
|
| 426 | 533 | hiro | ac_prefs = prefs_account_new(); |
| 427 | 533 | hiro | new_account = TRUE; |
| 428 | 533 | hiro | } |
| 429 | 533 | hiro | |
| 430 | 533 | hiro | if (!dialog.window) {
|
| 431 | 533 | hiro | prefs_account_create(); |
| 432 | 533 | hiro | } |
| 433 | 533 | hiro | |
| 434 | 533 | hiro | gtkut_box_set_reverse_order(GTK_BOX(dialog.confirm_area), |
| 435 | 533 | hiro | !prefs_common.comply_gnome_hig); |
| 436 | 533 | hiro | manage_window_set_transient(GTK_WINDOW(dialog.window)); |
| 437 | 533 | hiro | gtk_notebook_set_current_page(GTK_NOTEBOOK(dialog.notebook), 0);
|
| 438 | 533 | hiro | gtk_widget_grab_focus(dialog.ok_btn); |
| 439 | 533 | hiro | |
| 440 | 533 | hiro | prefs_account_set_tmp_prefs(ac_prefs); |
| 441 | 533 | hiro | |
| 442 | 533 | hiro | if (new_account) {
|
| 443 | 533 | hiro | PrefsAccount *def_ac; |
| 444 | 533 | hiro | gchar *buf; |
| 445 | 533 | hiro | |
| 446 | 533 | hiro | prefs_set_dialog_to_default(prefs_account_get_params()); |
| 447 | 533 | hiro | buf = g_strdup_printf(_("Account%d"), ac_prefs->account_id);
|
| 448 | 533 | hiro | gtk_entry_set_text(GTK_ENTRY(basic.acname_entry), buf); |
| 449 | 533 | hiro | g_free(buf); |
| 450 | 533 | hiro | def_ac = account_get_default(); |
| 451 | 533 | hiro | if (def_ac) {
|
| 452 | 533 | hiro | gtk_entry_set_text(GTK_ENTRY(basic.name_entry), |
| 453 | 533 | hiro | def_ac->name ? def_ac->name : "");
|
| 454 | 533 | hiro | gtk_entry_set_text(GTK_ENTRY(basic.addr_entry), |
| 455 | 533 | hiro | def_ac->address ? def_ac->address : "");
|
| 456 | 533 | hiro | gtk_entry_set_text(GTK_ENTRY(basic.org_entry), |
| 457 | 533 | hiro | def_ac->organization ? def_ac->organization : "");
|
| 458 | 533 | hiro | } |
| 459 | 533 | hiro | menu_set_sensitive_all |
| 460 | 533 | hiro | (GTK_MENU_SHELL |
| 461 | 533 | hiro | (gtk_option_menu_get_menu |
| 462 | 533 | hiro | (GTK_OPTION_MENU |
| 463 | 533 | hiro | (basic.protocol_optmenu))), |
| 464 | 533 | hiro | TRUE); |
| 465 | 533 | hiro | gtk_window_set_title(GTK_WINDOW(dialog.window), |
| 466 | 533 | hiro | _("Preferences for new account"));
|
| 467 | 533 | hiro | gtk_widget_hide(dialog.apply_btn); |
| 468 | 533 | hiro | } else {
|
| 469 | 533 | hiro | prefs_set_dialog(prefs_account_get_params()); |
| 470 | 533 | hiro | gtk_window_set_title(GTK_WINDOW(dialog.window), |
| 471 | 533 | hiro | _("Account preferences"));
|
| 472 | 533 | hiro | gtk_widget_show(dialog.apply_btn); |
| 473 | 533 | hiro | } |
| 474 | 533 | hiro | |
| 475 | 533 | hiro | gtk_widget_show(dialog.window); |
| 476 | 533 | hiro | gtk_main(); |
| 477 | 533 | hiro | gtk_widget_hide(dialog.window); |
| 478 | 533 | hiro | |
| 479 | 533 | hiro | inc_unlock(); |
| 480 | 533 | hiro | |
| 481 | 533 | hiro | if (cancelled && new_account) {
|
| 482 | 533 | hiro | g_free(ac_prefs); |
| 483 | 533 | hiro | return NULL; |
| 484 | 533 | hiro | } else {
|
| 485 | 533 | hiro | prefs_account_apply_tmp_prefs(ac_prefs); |
| 486 | 533 | hiro | return ac_prefs;
|
| 487 | 533 | hiro | } |
| 488 | 533 | hiro | } |
| 489 | 533 | hiro | |
| 490 | 533 | hiro | static void prefs_account_create(void) |
| 491 | 533 | hiro | {
|
| 492 | 533 | hiro | gint page = 0;
|
| 493 | 533 | hiro | |
| 494 | 533 | hiro | debug_print(_("Creating account preferences window...\n"));
|
| 495 | 533 | hiro | |
| 496 | 533 | hiro | /* create dialog */
|
| 497 | 533 | hiro | prefs_dialog_create(&dialog); |
| 498 | 533 | hiro | g_signal_connect(G_OBJECT(dialog.window), "delete_event",
|
| 499 | 533 | hiro | G_CALLBACK(prefs_account_deleted), NULL);
|
| 500 | 533 | hiro | g_signal_connect(G_OBJECT(dialog.window), "key_press_event",
|
| 501 | 533 | hiro | G_CALLBACK(prefs_account_key_pressed), NULL);
|
| 502 | 533 | hiro | MANAGE_WINDOW_SIGNALS_CONNECT(dialog.window); |
| 503 | 533 | hiro | |
| 504 | 533 | hiro | g_signal_connect(G_OBJECT(dialog.ok_btn), "clicked",
|
| 505 | 533 | hiro | G_CALLBACK(prefs_account_ok), NULL);
|
| 506 | 533 | hiro | g_signal_connect(G_OBJECT(dialog.apply_btn), "clicked",
|
| 507 | 533 | hiro | G_CALLBACK(prefs_account_apply), NULL);
|
| 508 | 533 | hiro | g_signal_connect(G_OBJECT(dialog.cancel_btn), "clicked",
|
| 509 | 533 | hiro | G_CALLBACK(prefs_account_cancel), NULL);
|
| 510 | 533 | hiro | |
| 511 | 533 | hiro | prefs_account_basic_create(); |
| 512 | 533 | hiro | SET_NOTEBOOK_LABEL(dialog.notebook, _("Basic"), page++);
|
| 513 | 533 | hiro | prefs_account_receive_create(); |
| 514 | 533 | hiro | SET_NOTEBOOK_LABEL(dialog.notebook, _("Receive"), page++);
|
| 515 | 533 | hiro | prefs_account_send_create(); |
| 516 | 533 | hiro | SET_NOTEBOOK_LABEL(dialog.notebook, _("Send"), page++);
|
| 517 | 533 | hiro | prefs_account_compose_create(); |
| 518 | 533 | hiro | SET_NOTEBOOK_LABEL(dialog.notebook, _("Compose"), page++);
|
| 519 | 533 | hiro | #if USE_GPGME
|
| 520 | 533 | hiro | prefs_account_privacy_create(); |
| 521 | 533 | hiro | SET_NOTEBOOK_LABEL(dialog.notebook, _("Privacy"), page++);
|
| 522 | 533 | hiro | #endif /* USE_GPGME */ |
| 523 | 533 | hiro | #if USE_SSL
|
| 524 | 533 | hiro | prefs_account_ssl_create(); |
| 525 | 533 | hiro | SET_NOTEBOOK_LABEL(dialog.notebook, _("SSL"), page++);
|
| 526 | 533 | hiro | #endif /* USE_SSL */ |
| 527 | 533 | hiro | prefs_account_advanced_create(); |
| 528 | 533 | hiro | SET_NOTEBOOK_LABEL(dialog.notebook, _("Advanced"), page++);
|
| 529 | 533 | hiro | } |
| 530 | 533 | hiro | |
| 531 | 533 | hiro | #define SET_ACTIVATE(menuitem) \
|
| 532 | 533 | hiro | { \
|
| 533 | 533 | hiro | g_signal_connect(G_OBJECT(menuitem), "activate", \
|
| 534 | 533 | hiro | G_CALLBACK(prefs_account_protocol_activated), NULL); \
|
| 535 | 533 | hiro | } |
| 536 | 533 | hiro | |
| 537 | 533 | hiro | static void prefs_account_basic_create(void) |
| 538 | 533 | hiro | {
|
| 539 | 533 | hiro | GtkWidget *vbox1; |
| 540 | 533 | hiro | GtkWidget *hbox; |
| 541 | 533 | hiro | GtkWidget *label; |
| 542 | 533 | hiro | GtkWidget *acname_entry; |
| 543 | 533 | hiro | GtkWidget *default_chkbtn; |
| 544 | 533 | hiro | GtkWidget *frame1; |
| 545 | 533 | hiro | GtkWidget *table1; |
| 546 | 533 | hiro | GtkWidget *name_entry; |
| 547 | 533 | hiro | GtkWidget *addr_entry; |
| 548 | 533 | hiro | GtkWidget *org_entry; |
| 549 | 533 | hiro | |
| 550 | 533 | hiro | GtkWidget *serv_frame; |
| 551 | 533 | hiro | GtkWidget *vbox2; |
| 552 | 533 | hiro | GtkWidget *optmenu; |
| 553 | 533 | hiro | GtkWidget *optmenu_menu; |
| 554 | 533 | hiro | GtkWidget *menuitem; |
| 555 | 533 | hiro | GtkWidget *serv_table; |
| 556 | 533 | hiro | GtkWidget *recvserv_label; |
| 557 | 533 | hiro | GtkWidget *smtpserv_label; |
| 558 | 533 | hiro | GtkWidget *nntpserv_label; |
| 559 | 533 | hiro | GtkWidget *recvserv_entry; |
| 560 | 533 | hiro | GtkWidget *smtpserv_entry; |
| 561 | 533 | hiro | GtkWidget *nntpserv_entry; |
| 562 | 533 | hiro | GtkWidget *nntpauth_chkbtn; |
| 563 | 533 | hiro | GtkWidget *uid_label; |
| 564 | 533 | hiro | GtkWidget *pass_label; |
| 565 | 533 | hiro | GtkWidget *uid_entry; |
| 566 | 533 | hiro | GtkWidget *pass_entry; |
| 567 | 533 | hiro | |
| 568 | 533 | hiro | vbox1 = gtk_vbox_new (FALSE, VSPACING); |
| 569 | 533 | hiro | gtk_widget_show (vbox1); |
| 570 | 533 | hiro | gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1); |
| 571 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER); |
| 572 | 533 | hiro | |
| 573 | 533 | hiro | hbox = gtk_hbox_new (FALSE, 8);
|
| 574 | 533 | hiro | gtk_widget_show (hbox); |
| 575 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox1), hbox, FALSE, FALSE, 0);
|
| 576 | 533 | hiro | |
| 577 | 533 | hiro | label = gtk_label_new (_("Name of this account"));
|
| 578 | 533 | hiro | gtk_widget_show (label); |
| 579 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
| 580 | 533 | hiro | |
| 581 | 533 | hiro | acname_entry = gtk_entry_new (); |
| 582 | 533 | hiro | gtk_widget_show (acname_entry); |
| 583 | 533 | hiro | gtk_widget_set_size_request (acname_entry, DEFAULT_ENTRY_WIDTH, -1);
|
| 584 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), acname_entry, TRUE, TRUE, 0);
|
| 585 | 533 | hiro | |
| 586 | 533 | hiro | default_chkbtn = gtk_check_button_new_with_label (_("Set as default"));
|
| 587 | 533 | hiro | gtk_widget_show (default_chkbtn); |
| 588 | 533 | hiro | gtk_box_pack_end (GTK_BOX (hbox), default_chkbtn, FALSE, FALSE, 0);
|
| 589 | 533 | hiro | |
| 590 | 533 | hiro | PACK_FRAME (vbox1, frame1, _("Personal information"));
|
| 591 | 533 | hiro | |
| 592 | 533 | hiro | table1 = gtk_table_new (3, 2, FALSE); |
| 593 | 533 | hiro | gtk_widget_show (table1); |
| 594 | 533 | hiro | gtk_container_add (GTK_CONTAINER (frame1), table1); |
| 595 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (table1), 8);
|
| 596 | 533 | hiro | gtk_table_set_row_spacings (GTK_TABLE (table1), VSPACING_NARROW); |
| 597 | 533 | hiro | gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
|
| 598 | 533 | hiro | |
| 599 | 533 | hiro | label = gtk_label_new (_("Full name"));
|
| 600 | 533 | hiro | gtk_widget_show (label); |
| 601 | 533 | hiro | gtk_table_attach (GTK_TABLE (table1), label, 0, 1, 0, 1, |
| 602 | 533 | hiro | GTK_FILL, 0, 0, 0); |
| 603 | 533 | hiro | gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); |
| 604 | 533 | hiro | |
| 605 | 533 | hiro | label = gtk_label_new (_("Mail address"));
|
| 606 | 533 | hiro | gtk_widget_show (label); |
| 607 | 533 | hiro | gtk_table_attach (GTK_TABLE (table1), label, 0, 1, 1, 2, |
| 608 | 533 | hiro | GTK_FILL, 0, 0, 0); |
| 609 | 533 | hiro | gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); |
| 610 | 533 | hiro | |
| 611 | 533 | hiro | label = gtk_label_new (_("Organization"));
|
| 612 | 533 | hiro | gtk_widget_show (label); |
| 613 | 533 | hiro | gtk_table_attach (GTK_TABLE (table1), label, 0, 1, 2, 3, |
| 614 | 533 | hiro | GTK_FILL, 0, 0, 0); |
| 615 | 533 | hiro | gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5); |
| 616 | 533 | hiro | |
| 617 | 533 | hiro | name_entry = gtk_entry_new (); |
| 618 | 533 | hiro | gtk_widget_show (name_entry); |
| 619 | 533 | hiro | gtk_table_attach (GTK_TABLE (table1), name_entry, 1, 2, 0, 1, |
| 620 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, |
| 621 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); |
| 622 | 533 | hiro | |
| 623 | 533 | hiro | addr_entry = gtk_entry_new (); |
| 624 | 533 | hiro | gtk_widget_show (addr_entry); |
| 625 | 533 | hiro | gtk_table_attach (GTK_TABLE (table1), addr_entry, 1, 2, 1, 2, |
| 626 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, |
| 627 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); |
| 628 | 533 | hiro | |
| 629 | 533 | hiro | org_entry = gtk_entry_new (); |
| 630 | 533 | hiro | gtk_widget_show (org_entry); |
| 631 | 533 | hiro | gtk_table_attach (GTK_TABLE (table1), org_entry, 1, 2, 2, 3, |
| 632 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, |
| 633 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); |
| 634 | 533 | hiro | |
| 635 | 533 | hiro | PACK_FRAME (vbox1, serv_frame, _("Server information"));
|
| 636 | 533 | hiro | |
| 637 | 533 | hiro | vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW); |
| 638 | 533 | hiro | gtk_widget_show (vbox2); |
| 639 | 533 | hiro | gtk_container_add (GTK_CONTAINER (serv_frame), vbox2); |
| 640 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
|
| 641 | 533 | hiro | |
| 642 | 533 | hiro | hbox = gtk_hbox_new (FALSE, 8);
|
| 643 | 533 | hiro | gtk_widget_show (hbox); |
| 644 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
|
| 645 | 533 | hiro | |
| 646 | 533 | hiro | label = gtk_label_new (_("Protocol"));
|
| 647 | 533 | hiro | gtk_widget_show (label); |
| 648 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
| 649 | 533 | hiro | |
| 650 | 533 | hiro | optmenu = gtk_option_menu_new (); |
| 651 | 533 | hiro | gtk_widget_show (optmenu); |
| 652 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), optmenu, FALSE, FALSE, 0);
|
| 653 | 533 | hiro | |
| 654 | 533 | hiro | optmenu_menu = gtk_menu_new (); |
| 655 | 533 | hiro | |
| 656 | 533 | hiro | MENUITEM_ADD (optmenu_menu, menuitem, _("POP3"), A_POP3);
|
| 657 | 533 | hiro | SET_ACTIVATE (menuitem); |
| 658 | 533 | hiro | MENUITEM_ADD (optmenu_menu, menuitem, _("IMAP4"), A_IMAP4);
|
| 659 | 533 | hiro | SET_ACTIVATE (menuitem); |
| 660 | 533 | hiro | MENUITEM_ADD (optmenu_menu, menuitem, _("News (NNTP)"), A_NNTP);
|
| 661 | 533 | hiro | SET_ACTIVATE (menuitem); |
| 662 | 533 | hiro | MENUITEM_ADD (optmenu_menu, menuitem, _("None (local)"), A_LOCAL);
|
| 663 | 533 | hiro | SET_ACTIVATE (menuitem); |
| 664 | 533 | hiro | |
| 665 | 533 | hiro | gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu); |
| 666 | 533 | hiro | |
| 667 | 533 | hiro | serv_table = gtk_table_new (6, 4, FALSE); |
| 668 | 533 | hiro | gtk_widget_show (serv_table); |
| 669 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), serv_table, FALSE, FALSE, 0);
|
| 670 | 533 | hiro | gtk_table_set_row_spacings (GTK_TABLE (serv_table), VSPACING_NARROW); |
| 671 | 533 | hiro | gtk_table_set_row_spacing (GTK_TABLE (serv_table), 3, 0); |
| 672 | 533 | hiro | gtk_table_set_col_spacings (GTK_TABLE (serv_table), 8);
|
| 673 | 533 | hiro | |
| 674 | 533 | hiro | nntpauth_chkbtn = gtk_check_button_new_with_label |
| 675 | 533 | hiro | (_("This server requires authentication"));
|
| 676 | 533 | hiro | gtk_widget_show (nntpauth_chkbtn); |
| 677 | 533 | hiro | gtk_table_attach (GTK_TABLE (serv_table), nntpauth_chkbtn, 0, 4, 4, 5, |
| 678 | 533 | hiro | GTK_FILL, 0, 0, 0); |
| 679 | 533 | hiro | |
| 680 | 533 | hiro | nntpserv_entry = gtk_entry_new (); |
| 681 | 533 | hiro | gtk_widget_show (nntpserv_entry); |
| 682 | 533 | hiro | gtk_table_attach (GTK_TABLE (serv_table), nntpserv_entry, 1, 4, 0, 1, |
| 683 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, |
| 684 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); |
| 685 | 533 | hiro | gtk_table_set_row_spacing (GTK_TABLE (serv_table), 0, 0); |
| 686 | 533 | hiro | |
| 687 | 533 | hiro | recvserv_entry = gtk_entry_new (); |
| 688 | 533 | hiro | gtk_widget_show (recvserv_entry); |
| 689 | 533 | hiro | gtk_table_attach (GTK_TABLE (serv_table), recvserv_entry, 1, 4, 1, 2, |
| 690 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, |
| 691 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); |
| 692 | 533 | hiro | |
| 693 | 533 | hiro | smtpserv_entry = gtk_entry_new (); |
| 694 | 533 | hiro | gtk_widget_show (smtpserv_entry); |
| 695 | 533 | hiro | gtk_table_attach (GTK_TABLE (serv_table), smtpserv_entry, 1, 4, 2, 3, |
| 696 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, |
| 697 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); |
| 698 | 533 | hiro | |
| 699 | 533 | hiro | uid_entry = gtk_entry_new (); |
| 700 | 533 | hiro | gtk_widget_show (uid_entry); |
| 701 | 533 | hiro | gtk_widget_set_size_request (uid_entry, DEFAULT_ENTRY_WIDTH, -1);
|
| 702 | 533 | hiro | gtk_table_attach (GTK_TABLE (serv_table), uid_entry, 1, 2, 5, 6, |
| 703 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, |
| 704 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); |
| 705 | 533 | hiro | |
| 706 | 533 | hiro | pass_entry = gtk_entry_new (); |
| 707 | 533 | hiro | gtk_widget_show (pass_entry); |
| 708 | 533 | hiro | gtk_widget_set_size_request (pass_entry, DEFAULT_ENTRY_WIDTH, -1);
|
| 709 | 533 | hiro | gtk_table_attach (GTK_TABLE (serv_table), pass_entry, 3, 4, 5, 6, |
| 710 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, |
| 711 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); |
| 712 | 533 | hiro | gtk_entry_set_visibility (GTK_ENTRY (pass_entry), FALSE); |
| 713 | 533 | hiro | |
| 714 | 533 | hiro | nntpserv_label = gtk_label_new (_("News server"));
|
| 715 | 533 | hiro | gtk_widget_show (nntpserv_label); |
| 716 | 533 | hiro | gtk_table_attach (GTK_TABLE (serv_table), nntpserv_label, 0, 1, 0, 1, |
| 717 | 533 | hiro | GTK_FILL, 0, 0, 0); |
| 718 | 533 | hiro | gtk_misc_set_alignment (GTK_MISC (nntpserv_label), 1, 0.5); |
| 719 | 533 | hiro | |
| 720 | 533 | hiro | recvserv_label = gtk_label_new (_("Server for receiving"));
|
| 721 | 533 | hiro | gtk_widget_show (recvserv_label); |
| 722 | 533 | hiro | gtk_table_attach (GTK_TABLE (serv_table), recvserv_label, 0, 1, 1, 2, |
| 723 | 533 | hiro | GTK_FILL, 0, 0, 0); |
| 724 | 533 | hiro | gtk_misc_set_alignment (GTK_MISC (recvserv_label), 1, 0.5); |
| 725 | 533 | hiro | |
| 726 | 533 | hiro | smtpserv_label = gtk_label_new (_("SMTP server (send)"));
|
| 727 | 533 | hiro | gtk_widget_show (smtpserv_label); |
| 728 | 533 | hiro | gtk_table_attach (GTK_TABLE (serv_table), smtpserv_label, 0, 1, 2, 3, |
| 729 | 533 | hiro | GTK_FILL, 0, 0, 0); |
| 730 | 533 | hiro | gtk_misc_set_alignment (GTK_MISC (smtpserv_label), 1, 0.5); |
| 731 | 533 | hiro | gtk_table_set_row_spacing (GTK_TABLE (serv_table), 2, 0); |
| 732 | 533 | hiro | |
| 733 | 533 | hiro | uid_label = gtk_label_new (_("User ID"));
|
| 734 | 533 | hiro | gtk_widget_show (uid_label); |
| 735 | 533 | hiro | gtk_table_attach (GTK_TABLE (serv_table), uid_label, 0, 1, 5, 6, |
| 736 | 533 | hiro | GTK_FILL, 0, 0, 0); |
| 737 | 533 | hiro | gtk_misc_set_alignment (GTK_MISC (uid_label), 1, 0.5); |
| 738 | 533 | hiro | |
| 739 | 533 | hiro | pass_label = gtk_label_new (_("Password"));
|
| 740 | 533 | hiro | gtk_widget_show (pass_label); |
| 741 | 533 | hiro | gtk_table_attach (GTK_TABLE (serv_table), pass_label, 2, 3, 5, 6, |
| 742 | 533 | hiro | 0, 0, 0, 0); |
| 743 | 533 | hiro | |
| 744 | 533 | hiro | SET_TOGGLE_SENSITIVITY (nntpauth_chkbtn, uid_label); |
| 745 | 533 | hiro | SET_TOGGLE_SENSITIVITY (nntpauth_chkbtn, pass_label); |
| 746 | 533 | hiro | SET_TOGGLE_SENSITIVITY (nntpauth_chkbtn, uid_entry); |
| 747 | 533 | hiro | SET_TOGGLE_SENSITIVITY (nntpauth_chkbtn, pass_entry); |
| 748 | 533 | hiro | |
| 749 | 533 | hiro | basic.acname_entry = acname_entry; |
| 750 | 533 | hiro | basic.default_chkbtn = default_chkbtn; |
| 751 | 533 | hiro | |
| 752 | 533 | hiro | basic.name_entry = name_entry; |
| 753 | 533 | hiro | basic.addr_entry = addr_entry; |
| 754 | 533 | hiro | basic.org_entry = org_entry; |
| 755 | 533 | hiro | |
| 756 | 533 | hiro | basic.serv_frame = serv_frame; |
| 757 | 533 | hiro | basic.serv_table = serv_table; |
| 758 | 533 | hiro | basic.protocol_optmenu = optmenu; |
| 759 | 533 | hiro | basic.recvserv_label = recvserv_label; |
| 760 | 533 | hiro | basic.recvserv_entry = recvserv_entry; |
| 761 | 533 | hiro | basic.smtpserv_label = smtpserv_label; |
| 762 | 533 | hiro | basic.smtpserv_entry = smtpserv_entry; |
| 763 | 533 | hiro | basic.nntpserv_label = nntpserv_label; |
| 764 | 533 | hiro | basic.nntpserv_entry = nntpserv_entry; |
| 765 | 533 | hiro | basic.nntpauth_chkbtn = nntpauth_chkbtn; |
| 766 | 533 | hiro | basic.uid_label = uid_label; |
| 767 | 533 | hiro | basic.pass_label = pass_label; |
| 768 | 533 | hiro | basic.uid_entry = uid_entry; |
| 769 | 533 | hiro | basic.pass_entry = pass_entry; |
| 770 | 533 | hiro | } |
| 771 | 533 | hiro | |
| 772 | 533 | hiro | static void prefs_account_receive_create(void) |
| 773 | 533 | hiro | {
|
| 774 | 533 | hiro | GtkWidget *vbox1; |
| 775 | 533 | hiro | GtkWidget *frame1; |
| 776 | 533 | hiro | GtkWidget *vbox2; |
| 777 | 533 | hiro | GtkWidget *use_apop_chkbtn; |
| 778 | 533 | hiro | GtkWidget *rmmail_chkbtn; |
| 779 | 533 | hiro | GtkWidget *hbox_spc; |
| 780 | 533 | hiro | GtkWidget *leave_time_label; |
| 781 | 533 | hiro | GtkWidget *leave_time_entry; |
| 782 | 533 | hiro | GtkWidget *getall_chkbtn; |
| 783 | 533 | hiro | GtkWidget *hbox1; |
| 784 | 533 | hiro | GtkWidget *size_limit_chkbtn; |
| 785 | 533 | hiro | GtkWidget *size_limit_entry; |
| 786 | 533 | hiro | GtkWidget *label; |
| 787 | 533 | hiro | GtkWidget *filter_on_recv_chkbtn; |
| 788 | 533 | hiro | GtkWidget *vbox3; |
| 789 | 533 | hiro | GtkWidget *inbox_label; |
| 790 | 533 | hiro | GtkWidget *inbox_entry; |
| 791 | 533 | hiro | GtkWidget *inbox_btn; |
| 792 | 533 | hiro | |
| 793 | 533 | hiro | GtkWidget *imap_frame; |
| 794 | 533 | hiro | GtkWidget *optmenu; |
| 795 | 533 | hiro | GtkWidget *optmenu_menu; |
| 796 | 533 | hiro | GtkWidget *menuitem; |
| 797 | 533 | hiro | |
| 798 | 533 | hiro | GtkWidget *nntp_frame; |
| 799 | 533 | hiro | GtkWidget *maxarticle_label; |
| 800 | 533 | hiro | GtkWidget *maxarticle_spinbtn; |
| 801 | 533 | hiro | GtkObject *maxarticle_spinbtn_adj; |
| 802 | 533 | hiro | GtkWidget *maxarticle_desc_label; |
| 803 | 533 | hiro | |
| 804 | 533 | hiro | GtkWidget *recvatgetall_chkbtn; |
| 805 | 533 | hiro | |
| 806 | 533 | hiro | vbox1 = gtk_vbox_new (FALSE, VSPACING); |
| 807 | 533 | hiro | gtk_widget_show (vbox1); |
| 808 | 533 | hiro | gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1); |
| 809 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER); |
| 810 | 533 | hiro | |
| 811 | 533 | hiro | PACK_FRAME (vbox1, frame1, _("POP3"));
|
| 812 | 533 | hiro | |
| 813 | 533 | hiro | vbox2 = gtk_vbox_new (FALSE, 0);
|
| 814 | 533 | hiro | gtk_widget_show (vbox2); |
| 815 | 533 | hiro | gtk_container_add (GTK_CONTAINER (frame1), vbox2); |
| 816 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
|
| 817 | 533 | hiro | |
| 818 | 533 | hiro | PACK_CHECK_BUTTON (vbox2, use_apop_chkbtn, |
| 819 | 533 | hiro | _("Use secure authentication (APOP)"));
|
| 820 | 533 | hiro | |
| 821 | 533 | hiro | PACK_CHECK_BUTTON (vbox2, rmmail_chkbtn, |
| 822 | 533 | hiro | _("Remove messages on server when received"));
|
| 823 | 533 | hiro | |
| 824 | 533 | hiro | hbox1 = gtk_hbox_new (FALSE, 8);
|
| 825 | 533 | hiro | gtk_widget_show (hbox1); |
| 826 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
|
| 827 | 533 | hiro | |
| 828 | 533 | hiro | hbox_spc = gtk_hbox_new (FALSE, 0);
|
| 829 | 533 | hiro | gtk_widget_show (hbox_spc); |
| 830 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
|
| 831 | 533 | hiro | gtk_widget_set_size_request (hbox_spc, 12, -1); |
| 832 | 533 | hiro | |
| 833 | 533 | hiro | leave_time_label = gtk_label_new (_("Remove after"));
|
| 834 | 533 | hiro | gtk_widget_show (leave_time_label); |
| 835 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), leave_time_label, FALSE, FALSE, 0);
|
| 836 | 533 | hiro | |
| 837 | 533 | hiro | leave_time_entry = gtk_entry_new (); |
| 838 | 533 | hiro | gtk_widget_show (leave_time_entry); |
| 839 | 533 | hiro | gtk_widget_set_size_request (leave_time_entry, 64, -1); |
| 840 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), leave_time_entry, FALSE, FALSE, 0);
|
| 841 | 533 | hiro | |
| 842 | 533 | hiro | leave_time_label = gtk_label_new (_("days"));
|
| 843 | 533 | hiro | gtk_widget_show (leave_time_label); |
| 844 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), leave_time_label, FALSE, FALSE, 0);
|
| 845 | 533 | hiro | |
| 846 | 533 | hiro | SET_TOGGLE_SENSITIVITY (rmmail_chkbtn, hbox1); |
| 847 | 533 | hiro | |
| 848 | 533 | hiro | PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2); |
| 849 | 533 | hiro | |
| 850 | 533 | hiro | hbox1 = gtk_hbox_new (FALSE, 8);
|
| 851 | 533 | hiro | gtk_widget_show (hbox1); |
| 852 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
|
| 853 | 533 | hiro | |
| 854 | 533 | hiro | hbox_spc = gtk_hbox_new (FALSE, 0);
|
| 855 | 533 | hiro | gtk_widget_show (hbox_spc); |
| 856 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
|
| 857 | 533 | hiro | gtk_widget_set_size_request (hbox_spc, 12, -1); |
| 858 | 533 | hiro | |
| 859 | 533 | hiro | leave_time_label = gtk_label_new (_("(0 days: remove immediately)"));
|
| 860 | 533 | hiro | gtk_widget_show (leave_time_label); |
| 861 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), leave_time_label, FALSE, FALSE, 0);
|
| 862 | 533 | hiro | |
| 863 | 533 | hiro | SET_TOGGLE_SENSITIVITY (rmmail_chkbtn, hbox1); |
| 864 | 533 | hiro | |
| 865 | 533 | hiro | PACK_CHECK_BUTTON (vbox2, getall_chkbtn, |
| 866 | 533 | hiro | _("Download all messages on server"));
|
| 867 | 533 | hiro | |
| 868 | 533 | hiro | hbox1 = gtk_hbox_new (FALSE, 8);
|
| 869 | 533 | hiro | gtk_widget_show (hbox1); |
| 870 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
|
| 871 | 533 | hiro | |
| 872 | 533 | hiro | PACK_CHECK_BUTTON (hbox1, size_limit_chkbtn, _("Receive size limit"));
|
| 873 | 533 | hiro | |
| 874 | 533 | hiro | size_limit_entry = gtk_entry_new (); |
| 875 | 533 | hiro | gtk_widget_show (size_limit_entry); |
| 876 | 533 | hiro | gtk_widget_set_size_request (size_limit_entry, 64, -1); |
| 877 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), size_limit_entry, FALSE, FALSE, 0);
|
| 878 | 533 | hiro | |
| 879 | 533 | hiro | label = gtk_label_new (_("KB"));
|
| 880 | 533 | hiro | gtk_widget_show (label); |
| 881 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
|
| 882 | 533 | hiro | |
| 883 | 533 | hiro | SET_TOGGLE_SENSITIVITY (size_limit_chkbtn, size_limit_entry); |
| 884 | 533 | hiro | |
| 885 | 533 | hiro | PACK_CHECK_BUTTON (vbox2, filter_on_recv_chkbtn, |
| 886 | 533 | hiro | _("Filter messages on receiving"));
|
| 887 | 533 | hiro | |
| 888 | 533 | hiro | PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2); |
| 889 | 533 | hiro | |
| 890 | 533 | hiro | hbox1 = gtk_hbox_new (FALSE, 8);
|
| 891 | 533 | hiro | gtk_widget_show (hbox1); |
| 892 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
|
| 893 | 533 | hiro | |
| 894 | 533 | hiro | inbox_label = gtk_label_new (_("Default inbox"));
|
| 895 | 533 | hiro | gtk_widget_show (inbox_label); |
| 896 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), inbox_label, FALSE, FALSE, 0);
|
| 897 | 533 | hiro | |
| 898 | 533 | hiro | inbox_entry = gtk_entry_new (); |
| 899 | 533 | hiro | gtk_widget_show (inbox_entry); |
| 900 | 533 | hiro | gtk_widget_set_size_request (inbox_entry, DEFAULT_ENTRY_WIDTH, -1);
|
| 901 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), inbox_entry, TRUE, TRUE, 0);
|
| 902 | 533 | hiro | |
| 903 | 533 | hiro | inbox_btn = gtk_button_new_with_label (_(" Select... "));
|
| 904 | 533 | hiro | gtk_widget_show (inbox_btn); |
| 905 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), inbox_btn, FALSE, FALSE, 0);
|
| 906 | 533 | hiro | g_signal_connect (G_OBJECT (inbox_btn), "clicked",
|
| 907 | 533 | hiro | G_CALLBACK (prefs_account_select_folder_cb), |
| 908 | 533 | hiro | inbox_entry); |
| 909 | 533 | hiro | |
| 910 | 533 | hiro | PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2); |
| 911 | 533 | hiro | |
| 912 | 533 | hiro | PACK_SMALL_LABEL |
| 913 | 533 | hiro | (vbox2, label, |
| 914 | 533 | hiro | _("Unfiltered messages will be stored in this folder."));
|
| 915 | 533 | hiro | |
| 916 | 533 | hiro | PACK_FRAME (vbox1, imap_frame, _("IMAP4"));
|
| 917 | 533 | hiro | |
| 918 | 533 | hiro | vbox2 = gtk_vbox_new (FALSE, 0);
|
| 919 | 533 | hiro | gtk_widget_show (vbox2); |
| 920 | 533 | hiro | gtk_container_add (GTK_CONTAINER (imap_frame), vbox2); |
| 921 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
|
| 922 | 533 | hiro | |
| 923 | 533 | hiro | hbox1 = gtk_hbox_new (FALSE, 8);
|
| 924 | 533 | hiro | gtk_widget_show (hbox1); |
| 925 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
|
| 926 | 533 | hiro | |
| 927 | 533 | hiro | label = gtk_label_new (_("Authentication method"));
|
| 928 | 533 | hiro | gtk_widget_show (label); |
| 929 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
|
| 930 | 533 | hiro | |
| 931 | 533 | hiro | optmenu = gtk_option_menu_new (); |
| 932 | 533 | hiro | gtk_widget_show (optmenu); |
| 933 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), optmenu, FALSE, FALSE, 0);
|
| 934 | 533 | hiro | |
| 935 | 533 | hiro | optmenu_menu = gtk_menu_new (); |
| 936 | 533 | hiro | |
| 937 | 533 | hiro | MENUITEM_ADD (optmenu_menu, menuitem, _("Automatic"), 0); |
| 938 | 533 | hiro | MENUITEM_ADD (optmenu_menu, menuitem, "LOGIN", IMAP_AUTH_LOGIN);
|
| 939 | 533 | hiro | MENUITEM_ADD (optmenu_menu, menuitem, "CRAM-MD5", IMAP_AUTH_CRAM_MD5);
|
| 940 | 533 | hiro | |
| 941 | 533 | hiro | gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu); |
| 942 | 533 | hiro | |
| 943 | 533 | hiro | PACK_FRAME (vbox1, nntp_frame, _("News"));
|
| 944 | 533 | hiro | |
| 945 | 533 | hiro | vbox2 = gtk_vbox_new (FALSE, 0);
|
| 946 | 533 | hiro | gtk_widget_show (vbox2); |
| 947 | 533 | hiro | gtk_container_add (GTK_CONTAINER (nntp_frame), vbox2); |
| 948 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
|
| 949 | 533 | hiro | |
| 950 | 533 | hiro | hbox1 = gtk_hbox_new (FALSE, 8);
|
| 951 | 533 | hiro | gtk_widget_show (hbox1); |
| 952 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
|
| 953 | 533 | hiro | |
| 954 | 533 | hiro | maxarticle_label = gtk_label_new |
| 955 | 533 | hiro | (_("Maximum number of articles to download"));
|
| 956 | 533 | hiro | gtk_widget_show (maxarticle_label); |
| 957 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), maxarticle_label, FALSE, FALSE, 0);
|
| 958 | 533 | hiro | gtk_label_set_justify (GTK_LABEL (maxarticle_label), GTK_JUSTIFY_LEFT); |
| 959 | 533 | hiro | |
| 960 | 533 | hiro | maxarticle_spinbtn_adj = |
| 961 | 533 | hiro | gtk_adjustment_new (300, 0, 10000, 10, 100, 100); |
| 962 | 533 | hiro | maxarticle_spinbtn = gtk_spin_button_new |
| 963 | 533 | hiro | (GTK_ADJUSTMENT (maxarticle_spinbtn_adj), 10, 0); |
| 964 | 533 | hiro | gtk_widget_show (maxarticle_spinbtn); |
| 965 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), maxarticle_spinbtn, |
| 966 | 533 | hiro | FALSE, FALSE, 0);
|
| 967 | 533 | hiro | gtk_widget_set_size_request (maxarticle_spinbtn, 64, -1); |
| 968 | 533 | hiro | gtk_spin_button_set_numeric |
| 969 | 533 | hiro | (GTK_SPIN_BUTTON (maxarticle_spinbtn), TRUE); |
| 970 | 533 | hiro | |
| 971 | 533 | hiro | PACK_SMALL_LABEL (vbox2, maxarticle_desc_label, |
| 972 | 533 | hiro | _("No limit if 0 is specified."));
|
| 973 | 533 | hiro | |
| 974 | 533 | hiro | PACK_CHECK_BUTTON |
| 975 | 533 | hiro | (vbox1, recvatgetall_chkbtn, |
| 976 | 533 | hiro | _("`Get all' checks for new messages on this account"));
|
| 977 | 533 | hiro | |
| 978 | 533 | hiro | receive.pop3_frame = frame1; |
| 979 | 533 | hiro | receive.use_apop_chkbtn = use_apop_chkbtn; |
| 980 | 533 | hiro | receive.rmmail_chkbtn = rmmail_chkbtn; |
| 981 | 533 | hiro | receive.leave_time_entry = leave_time_entry; |
| 982 | 533 | hiro | receive.getall_chkbtn = getall_chkbtn; |
| 983 | 533 | hiro | receive.size_limit_chkbtn = size_limit_chkbtn; |
| 984 | 533 | hiro | receive.size_limit_entry = size_limit_entry; |
| 985 | 533 | hiro | receive.filter_on_recv_chkbtn = filter_on_recv_chkbtn; |
| 986 | 533 | hiro | receive.inbox_label = inbox_label; |
| 987 | 533 | hiro | receive.inbox_entry = inbox_entry; |
| 988 | 533 | hiro | receive.inbox_btn = inbox_btn; |
| 989 | 533 | hiro | |
| 990 | 533 | hiro | receive.imap_frame = imap_frame; |
| 991 | 533 | hiro | receive.imap_auth_type_optmenu = optmenu; |
| 992 | 533 | hiro | |
| 993 | 533 | hiro | receive.nntp_frame = nntp_frame; |
| 994 | 533 | hiro | receive.maxarticle_spinbtn = maxarticle_spinbtn; |
| 995 | 533 | hiro | receive.maxarticle_spinbtn_adj = maxarticle_spinbtn_adj; |
| 996 | 533 | hiro | |
| 997 | 533 | hiro | receive.recvatgetall_chkbtn = recvatgetall_chkbtn; |
| 998 | 533 | hiro | } |
| 999 | 533 | hiro | |
| 1000 | 533 | hiro | static void prefs_account_send_create(void) |
| 1001 | 533 | hiro | {
|
| 1002 | 533 | hiro | GtkWidget *vbox1; |
| 1003 | 533 | hiro | GtkWidget *vbox2; |
| 1004 | 533 | hiro | GtkWidget *frame; |
| 1005 | 533 | hiro | GtkWidget *date_chkbtn; |
| 1006 | 533 | hiro | GtkWidget *msgid_chkbtn; |
| 1007 | 533 | hiro | GtkWidget *hbox; |
| 1008 | 533 | hiro | GtkWidget *customhdr_chkbtn; |
| 1009 | 533 | hiro | GtkWidget *customhdr_edit_btn; |
| 1010 | 533 | hiro | GtkWidget *vbox3; |
| 1011 | 533 | hiro | GtkWidget *smtp_auth_chkbtn; |
| 1012 | 533 | hiro | GtkWidget *optmenu; |
| 1013 | 533 | hiro | GtkWidget *optmenu_menu; |
| 1014 | 533 | hiro | GtkWidget *menuitem; |
| 1015 | 533 | hiro | GtkWidget *vbox4; |
| 1016 | 533 | hiro | GtkWidget *hbox_spc; |
| 1017 | 533 | hiro | GtkWidget *label; |
| 1018 | 533 | hiro | GtkWidget *smtp_uid_entry; |
| 1019 | 533 | hiro | GtkWidget *smtp_pass_entry; |
| 1020 | 533 | hiro | GtkWidget *vbox_spc; |
| 1021 | 533 | hiro | /* GtkWidget *pop_bfr_smtp_chkbtn; */
|
| 1022 | 533 | hiro | |
| 1023 | 533 | hiro | vbox1 = gtk_vbox_new (FALSE, VSPACING); |
| 1024 | 533 | hiro | gtk_widget_show (vbox1); |
| 1025 | 533 | hiro | gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1); |
| 1026 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER); |
| 1027 | 533 | hiro | |
| 1028 | 533 | hiro | PACK_FRAME (vbox1, frame, _("Header"));
|
| 1029 | 533 | hiro | |
| 1030 | 533 | hiro | vbox2 = gtk_vbox_new (FALSE, 0);
|
| 1031 | 533 | hiro | gtk_widget_show (vbox2); |
| 1032 | 533 | hiro | gtk_container_add (GTK_CONTAINER (frame), vbox2); |
| 1033 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
|
| 1034 | 533 | hiro | |
| 1035 | 533 | hiro | PACK_CHECK_BUTTON (vbox2, date_chkbtn, _("Add Date header field"));
|
| 1036 | 533 | hiro | PACK_CHECK_BUTTON (vbox2, msgid_chkbtn, _("Generate Message-ID"));
|
| 1037 | 533 | hiro | |
| 1038 | 533 | hiro | hbox = gtk_hbox_new (FALSE, 12);
|
| 1039 | 533 | hiro | gtk_widget_show (hbox); |
| 1040 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
|
| 1041 | 533 | hiro | |
| 1042 | 533 | hiro | PACK_CHECK_BUTTON (hbox, customhdr_chkbtn, |
| 1043 | 533 | hiro | _("Add user-defined header"));
|
| 1044 | 533 | hiro | |
| 1045 | 533 | hiro | customhdr_edit_btn = gtk_button_new_with_label (_(" Edit... "));
|
| 1046 | 533 | hiro | gtk_widget_show (customhdr_edit_btn); |
| 1047 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), customhdr_edit_btn, |
| 1048 | 533 | hiro | FALSE, FALSE, 0);
|
| 1049 | 533 | hiro | g_signal_connect (G_OBJECT (customhdr_edit_btn), "clicked",
|
| 1050 | 533 | hiro | G_CALLBACK (prefs_account_edit_custom_header), |
| 1051 | 533 | hiro | NULL);
|
| 1052 | 533 | hiro | |
| 1053 | 533 | hiro | SET_TOGGLE_SENSITIVITY (customhdr_chkbtn, customhdr_edit_btn); |
| 1054 | 533 | hiro | |
| 1055 | 533 | hiro | PACK_FRAME (vbox1, frame, _("Authentication"));
|
| 1056 | 533 | hiro | |
| 1057 | 533 | hiro | vbox3 = gtk_vbox_new (FALSE, 0);
|
| 1058 | 533 | hiro | gtk_widget_show (vbox3); |
| 1059 | 533 | hiro | gtk_container_add (GTK_CONTAINER (frame), vbox3); |
| 1060 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox3), 8);
|
| 1061 | 533 | hiro | |
| 1062 | 533 | hiro | PACK_CHECK_BUTTON (vbox3, smtp_auth_chkbtn, |
| 1063 | 533 | hiro | _("SMTP Authentication (SMTP AUTH)"));
|
| 1064 | 533 | hiro | |
| 1065 | 533 | hiro | vbox4 = gtk_vbox_new (FALSE, 0);
|
| 1066 | 533 | hiro | gtk_widget_show (vbox4); |
| 1067 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox3), vbox4, FALSE, FALSE, 0);
|
| 1068 | 533 | hiro | |
| 1069 | 533 | hiro | hbox = gtk_hbox_new (FALSE, 8);
|
| 1070 | 533 | hiro | gtk_widget_show (hbox); |
| 1071 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox4), hbox, FALSE, FALSE, 0);
|
| 1072 | 533 | hiro | |
| 1073 | 533 | hiro | hbox_spc = gtk_hbox_new (FALSE, 0);
|
| 1074 | 533 | hiro | gtk_widget_show (hbox_spc); |
| 1075 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
|
| 1076 | 533 | hiro | gtk_widget_set_size_request (hbox_spc, 12, -1); |
| 1077 | 533 | hiro | |
| 1078 | 533 | hiro | label = gtk_label_new (_("Authentication method"));
|
| 1079 | 533 | hiro | gtk_widget_show (label); |
| 1080 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
| 1081 | 533 | hiro | |
| 1082 | 533 | hiro | optmenu = gtk_option_menu_new (); |
| 1083 | 533 | hiro | gtk_widget_show (optmenu); |
| 1084 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), optmenu, FALSE, FALSE, 0);
|
| 1085 | 533 | hiro | |
| 1086 | 533 | hiro | optmenu_menu = gtk_menu_new (); |
| 1087 | 533 | hiro | |
| 1088 | 533 | hiro | MENUITEM_ADD (optmenu_menu, menuitem, _("Automatic"), 0); |
| 1089 | 533 | hiro | MENUITEM_ADD (optmenu_menu, menuitem, "PLAIN", SMTPAUTH_PLAIN);
|
| 1090 | 533 | hiro | MENUITEM_ADD (optmenu_menu, menuitem, "LOGIN", SMTPAUTH_LOGIN);
|
| 1091 | 533 | hiro | MENUITEM_ADD (optmenu_menu, menuitem, "CRAM-MD5", SMTPAUTH_CRAM_MD5);
|
| 1092 | 533 | hiro | MENUITEM_ADD (optmenu_menu, menuitem, "DIGEST-MD5", SMTPAUTH_DIGEST_MD5);
|
| 1093 | 533 | hiro | gtk_widget_set_sensitive (menuitem, FALSE); |
| 1094 | 533 | hiro | |
| 1095 | 533 | hiro | gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu); |
| 1096 | 533 | hiro | |
| 1097 | 533 | hiro | PACK_VSPACER(vbox4, vbox_spc, VSPACING_NARROW_2); |
| 1098 | 533 | hiro | |
| 1099 | 533 | hiro | hbox = gtk_hbox_new (FALSE, 8);
|
| 1100 | 533 | hiro | gtk_widget_show (hbox); |
| 1101 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox4), hbox, FALSE, FALSE, 0);
|
| 1102 | 533 | hiro | |
| 1103 | 533 | hiro | hbox_spc = gtk_hbox_new (FALSE, 0);
|
| 1104 | 533 | hiro | gtk_widget_show (hbox_spc); |
| 1105 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
|
| 1106 | 533 | hiro | gtk_widget_set_size_request (hbox_spc, 12, -1); |
| 1107 | 533 | hiro | |
| 1108 | 533 | hiro | label = gtk_label_new (_("User ID"));
|
| 1109 | 533 | hiro | gtk_widget_show (label); |
| 1110 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
| 1111 | 533 | hiro | |
| 1112 | 533 | hiro | smtp_uid_entry = gtk_entry_new (); |
| 1113 | 533 | hiro | gtk_widget_show (smtp_uid_entry); |
| 1114 | 533 | hiro | gtk_widget_set_size_request (smtp_uid_entry, DEFAULT_ENTRY_WIDTH, -1);
|
| 1115 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), smtp_uid_entry, TRUE, TRUE, 0);
|
| 1116 | 533 | hiro | |
| 1117 | 533 | hiro | label = gtk_label_new (_("Password"));
|
| 1118 | 533 | hiro | gtk_widget_show (label); |
| 1119 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
| 1120 | 533 | hiro | |
| 1121 | 533 | hiro | smtp_pass_entry = gtk_entry_new (); |
| 1122 | 533 | hiro | gtk_widget_show (smtp_pass_entry); |
| 1123 | 533 | hiro | gtk_widget_set_size_request (smtp_pass_entry, DEFAULT_ENTRY_WIDTH, -1);
|
| 1124 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), smtp_pass_entry, TRUE, TRUE, 0);
|
| 1125 | 533 | hiro | gtk_entry_set_visibility (GTK_ENTRY (smtp_pass_entry), FALSE); |
| 1126 | 533 | hiro | |
| 1127 | 533 | hiro | PACK_VSPACER(vbox4, vbox_spc, VSPACING_NARROW_2); |
| 1128 | 533 | hiro | |
| 1129 | 533 | hiro | hbox = gtk_hbox_new (FALSE, 8);
|
| 1130 | 533 | hiro | gtk_widget_show (hbox); |
| 1131 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox4), hbox, FALSE, FALSE, 0);
|
| 1132 | 533 | hiro | |
| 1133 | 533 | hiro | hbox_spc = gtk_hbox_new (FALSE, 0);
|
| 1134 | 533 | hiro | gtk_widget_show (hbox_spc); |
| 1135 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), hbox_spc, FALSE, FALSE, 0);
|
| 1136 | 533 | hiro | gtk_widget_set_size_request (hbox_spc, 12, -1); |
| 1137 | 533 | hiro | |
| 1138 | 533 | hiro | label = gtk_label_new |
| 1139 | 533 | hiro | (_("If you leave these entries empty, the same "
|
| 1140 | 533 | hiro | "user ID and password as receiving will be used."));
|
| 1141 | 533 | hiro | gtk_widget_show (label); |
| 1142 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
| 1143 | 533 | hiro | gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); |
| 1144 | 533 | hiro | gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); |
| 1145 | 533 | hiro | gtkut_widget_set_small_font_size (label); |
| 1146 | 533 | hiro | |
| 1147 | 533 | hiro | SET_TOGGLE_SENSITIVITY (smtp_auth_chkbtn, vbox4); |
| 1148 | 533 | hiro | |
| 1149 | 533 | hiro | #if 0
|
| 1150 | 533 | hiro | PACK_CHECK_BUTTON (vbox3, pop_bfr_smtp_chkbtn, |
| 1151 | 533 | hiro | _("Authenticate with POP3 before sending"));
|
| 1152 | 533 | hiro | gtk_widget_set_sensitive(pop_bfr_smtp_chkbtn, FALSE); |
| 1153 | 533 | hiro | #endif |
| 1154 | 533 | hiro | |
| 1155 | 533 | hiro | p_send.date_chkbtn = date_chkbtn; |
| 1156 | 533 | hiro | p_send.msgid_chkbtn = msgid_chkbtn; |
| 1157 | 533 | hiro | p_send.customhdr_chkbtn = customhdr_chkbtn; |
| 1158 | 533 | hiro | |
| 1159 | 533 | hiro | p_send.smtp_auth_chkbtn = smtp_auth_chkbtn; |
| 1160 | 533 | hiro | p_send.smtp_auth_type_optmenu = optmenu; |
| 1161 | 533 | hiro | p_send.smtp_uid_entry = smtp_uid_entry; |
| 1162 | 533 | hiro | p_send.smtp_pass_entry = smtp_pass_entry; |
| 1163 | 533 | hiro | /* p_send.pop_bfr_smtp_chkbtn = pop_bfr_smtp_chkbtn; */
|
| 1164 | 533 | hiro | } |
| 1165 | 533 | hiro | |
| 1166 | 533 | hiro | static void prefs_account_compose_create(void) |
| 1167 | 533 | hiro | {
|
| 1168 | 533 | hiro | GtkWidget *vbox1; |
| 1169 | 533 | hiro | GtkWidget *sig_vbox; |
| 1170 | 533 | hiro | GtkWidget *sig_hbox; |
| 1171 | 533 | hiro | GtkWidget *sigfile_radiobtn; |
| 1172 | 533 | hiro | GtkWidget *sigcmd_radiobtn; |
| 1173 | 533 | hiro | GtkWidget *sigpath_entry; |
| 1174 | 533 | hiro | GtkWidget *frame; |
| 1175 | 533 | hiro | GtkWidget *table; |
| 1176 | 533 | hiro | GtkWidget *autocc_chkbtn; |
| 1177 | 533 | hiro | GtkWidget *autocc_entry; |
| 1178 | 533 | hiro | GtkWidget *autobcc_chkbtn; |
| 1179 | 533 | hiro | GtkWidget *autobcc_entry; |
| 1180 | 533 | hiro | GtkWidget *autoreplyto_chkbtn; |
| 1181 | 533 | hiro | GtkWidget *autoreplyto_entry; |
| 1182 | 533 | hiro | |
| 1183 | 533 | hiro | vbox1 = gtk_vbox_new (FALSE, VSPACING); |
| 1184 | 533 | hiro | gtk_widget_show (vbox1); |
| 1185 | 533 | hiro | gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1); |
| 1186 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER); |
| 1187 | 533 | hiro | |
| 1188 | 533 | hiro | PACK_FRAME (vbox1, frame, _("Signature"));
|
| 1189 | 533 | hiro | |
| 1190 | 533 | hiro | sig_vbox = gtk_vbox_new (FALSE, VSPACING_NARROW_2); |
| 1191 | 533 | hiro | gtk_widget_show (sig_vbox); |
| 1192 | 533 | hiro | gtk_container_add (GTK_CONTAINER (frame), sig_vbox); |
| 1193 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (sig_vbox), 8);
|
| 1194 | 533 | hiro | |
| 1195 | 533 | hiro | sig_hbox = gtk_hbox_new (FALSE, 8);
|
| 1196 | 533 | hiro | gtk_widget_show (sig_hbox); |
| 1197 | 533 | hiro | gtk_box_pack_start (GTK_BOX (sig_vbox), sig_hbox, FALSE, FALSE, 0);
|
| 1198 | 533 | hiro | |
| 1199 | 533 | hiro | sigfile_radiobtn = gtk_radio_button_new_with_label (NULL, _("File")); |
| 1200 | 533 | hiro | gtk_widget_show (sigfile_radiobtn); |
| 1201 | 533 | hiro | gtk_box_pack_start (GTK_BOX (sig_hbox), sigfile_radiobtn, |
| 1202 | 533 | hiro | FALSE, FALSE, 0);
|
| 1203 | 533 | hiro | g_object_set_data (G_OBJECT (sigfile_radiobtn), MENU_VAL_ID, |
| 1204 | 533 | hiro | GINT_TO_POINTER (SIG_FILE)); |
| 1205 | 533 | hiro | |
| 1206 | 533 | hiro | sigcmd_radiobtn = gtk_radio_button_new_with_label_from_widget |
| 1207 | 533 | hiro | (GTK_RADIO_BUTTON(sigfile_radiobtn), _("Command output"));
|
| 1208 | 533 | hiro | gtk_widget_show (sigcmd_radiobtn); |
| 1209 | 533 | hiro | gtk_box_pack_start (GTK_BOX (sig_hbox), sigcmd_radiobtn, |
| 1210 | 533 | hiro | FALSE, FALSE, 0);
|
| 1211 | 533 | hiro | g_object_set_data (G_OBJECT (sigcmd_radiobtn), MENU_VAL_ID, |
| 1212 | 533 | hiro | GINT_TO_POINTER (SIG_COMMAND)); |
| 1213 | 533 | hiro | |
| 1214 | 533 | hiro | sigpath_entry = gtk_entry_new (); |
| 1215 | 533 | hiro | gtk_widget_show (sigpath_entry); |
| 1216 | 533 | hiro | gtk_box_pack_start (GTK_BOX (sig_vbox), sigpath_entry, TRUE, TRUE, 0);
|
| 1217 | 533 | hiro | |
| 1218 | 533 | hiro | PACK_FRAME (vbox1, frame, _("Automatically set the following addresses"));
|
| 1219 | 533 | hiro | |
| 1220 | 533 | hiro | table = gtk_table_new (3, 2, FALSE); |
| 1221 | 533 | hiro | gtk_widget_show (table); |
| 1222 | 533 | hiro | gtk_container_add (GTK_CONTAINER (frame), table); |
| 1223 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (table), 8);
|
| 1224 | 533 | hiro | gtk_table_set_row_spacings (GTK_TABLE (table), VSPACING_NARROW_2); |
| 1225 | 533 | hiro | gtk_table_set_col_spacings (GTK_TABLE (table), 8);
|
| 1226 | 533 | hiro | |
| 1227 | 533 | hiro | autocc_chkbtn = gtk_check_button_new_with_label (_("Cc"));
|
| 1228 | 533 | hiro | gtk_widget_show (autocc_chkbtn); |
| 1229 | 533 | hiro | gtk_table_attach (GTK_TABLE (table), autocc_chkbtn, 0, 1, 0, 1, |
| 1230 | 533 | hiro | GTK_FILL, 0, 0, 0); |
| 1231 | 533 | hiro | |
| 1232 | 533 | hiro | autocc_entry = gtk_entry_new (); |
| 1233 | 533 | hiro | gtk_widget_show (autocc_entry); |
| 1234 | 533 | hiro | gtk_table_attach (GTK_TABLE (table), autocc_entry, 1, 2, 0, 1, |
| 1235 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, |
| 1236 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); |
| 1237 | 533 | hiro | |
| 1238 | 533 | hiro | SET_TOGGLE_SENSITIVITY (autocc_chkbtn, autocc_entry); |
| 1239 | 533 | hiro | |
| 1240 | 533 | hiro | autobcc_chkbtn = gtk_check_button_new_with_label (_("Bcc"));
|
| 1241 | 533 | hiro | gtk_widget_show (autobcc_chkbtn); |
| 1242 | 533 | hiro | gtk_table_attach (GTK_TABLE (table), autobcc_chkbtn, 0, 1, 1, 2, |
| 1243 | 533 | hiro | GTK_FILL, 0, 0, 0); |
| 1244 | 533 | hiro | |
| 1245 | 533 | hiro | autobcc_entry = gtk_entry_new (); |
| 1246 | 533 | hiro | gtk_widget_show (autobcc_entry); |
| 1247 | 533 | hiro | gtk_table_attach (GTK_TABLE (table), autobcc_entry, 1, 2, 1, 2, |
| 1248 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, |
| 1249 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); |
| 1250 | 533 | hiro | |
| 1251 | 533 | hiro | SET_TOGGLE_SENSITIVITY (autobcc_chkbtn, autobcc_entry); |
| 1252 | 533 | hiro | |
| 1253 | 533 | hiro | autoreplyto_chkbtn = gtk_check_button_new_with_label (_("Reply-To"));
|
| 1254 | 533 | hiro | gtk_widget_show (autoreplyto_chkbtn); |
| 1255 | 533 | hiro | gtk_table_attach (GTK_TABLE (table), autoreplyto_chkbtn, 0, 1, 2, 3, |
| 1256 | 533 | hiro | GTK_FILL, 0, 0, 0); |
| 1257 | 533 | hiro | |
| 1258 | 533 | hiro | autoreplyto_entry = gtk_entry_new (); |
| 1259 | 533 | hiro | gtk_widget_show (autoreplyto_entry); |
| 1260 | 533 | hiro | gtk_table_attach (GTK_TABLE (table), autoreplyto_entry, 1, 2, 2, 3, |
| 1261 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, |
| 1262 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); |
| 1263 | 533 | hiro | |
| 1264 | 533 | hiro | SET_TOGGLE_SENSITIVITY (autoreplyto_chkbtn, autoreplyto_entry); |
| 1265 | 533 | hiro | |
| 1266 | 533 | hiro | |
| 1267 | 533 | hiro | compose.sigfile_radiobtn = sigfile_radiobtn; |
| 1268 | 533 | hiro | compose.sigpath_entry = sigpath_entry; |
| 1269 | 533 | hiro | |
| 1270 | 533 | hiro | compose.autocc_chkbtn = autocc_chkbtn; |
| 1271 | 533 | hiro | compose.autocc_entry = autocc_entry; |
| 1272 | 533 | hiro | compose.autobcc_chkbtn = autobcc_chkbtn; |
| 1273 | 533 | hiro | compose.autobcc_entry = autobcc_entry; |
| 1274 | 533 | hiro | compose.autoreplyto_chkbtn = autoreplyto_chkbtn; |
| 1275 | 533 | hiro | compose.autoreplyto_entry = autoreplyto_entry; |
| 1276 | 533 | hiro | } |
| 1277 | 533 | hiro | |
| 1278 | 533 | hiro | #if USE_GPGME
|
| 1279 | 533 | hiro | static void prefs_account_privacy_create(void) |
| 1280 | 533 | hiro | {
|
| 1281 | 533 | hiro | GtkWidget *vbox1; |
| 1282 | 533 | hiro | GtkWidget *frame1; |
| 1283 | 533 | hiro | GtkWidget *vbox2; |
| 1284 | 533 | hiro | GtkWidget *hbox1; |
| 1285 | 533 | hiro | GtkWidget *label; |
| 1286 | 533 | hiro | GtkWidget *default_sign_chkbtn; |
| 1287 | 533 | hiro | GtkWidget *default_encrypt_chkbtn; |
| 1288 | 533 | hiro | GtkWidget *encrypt_reply_chkbtn; |
| 1289 | 533 | hiro | GtkWidget *ascii_armored_chkbtn; |
| 1290 | 533 | hiro | GtkWidget *clearsign_chkbtn; |
| 1291 | 533 | hiro | GtkWidget *defaultkey_radiobtn; |
| 1292 | 533 | hiro | GtkWidget *emailkey_radiobtn; |
| 1293 | 533 | hiro | GtkWidget *customkey_radiobtn; |
| 1294 | 533 | hiro | GtkWidget *customkey_entry; |
| 1295 | 533 | hiro | |
| 1296 | 533 | hiro | vbox1 = gtk_vbox_new (FALSE, VSPACING); |
| 1297 | 533 | hiro | gtk_widget_show (vbox1); |
| 1298 | 533 | hiro | gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1); |
| 1299 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER); |
| 1300 | 533 | hiro | |
| 1301 | 533 | hiro | vbox2 = gtk_vbox_new (FALSE, 0);
|
| 1302 | 533 | hiro | gtk_widget_show (vbox2); |
| 1303 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
|
| 1304 | 533 | hiro | |
| 1305 | 533 | hiro | PACK_CHECK_BUTTON (vbox2, default_sign_chkbtn, |
| 1306 | 533 | hiro | _("Sign message by default"));
|
| 1307 | 533 | hiro | PACK_CHECK_BUTTON (vbox2, default_encrypt_chkbtn, |
| 1308 | 533 | hiro | _("Encrypt message by default"));
|
| 1309 | 533 | hiro | PACK_CHECK_BUTTON (vbox2, encrypt_reply_chkbtn, |
| 1310 | 533 | hiro | _("Encrypt when replying to encrypted message"));
|
| 1311 | 533 | hiro | PACK_CHECK_BUTTON (vbox2, ascii_armored_chkbtn, |
| 1312 | 533 | hiro | _("Use ASCII-armored format for encryption"));
|
| 1313 | 533 | hiro | PACK_CHECK_BUTTON (vbox2, clearsign_chkbtn, |
| 1314 | 533 | hiro | _("Use clear text signature"));
|
| 1315 | 533 | hiro | g_signal_connect (G_OBJECT (ascii_armored_chkbtn), "toggled",
|
| 1316 | 533 | hiro | G_CALLBACK (prefs_account_ascii_armored_warning), |
| 1317 | 533 | hiro | NULL);
|
| 1318 | 533 | hiro | |
| 1319 | 533 | hiro | PACK_FRAME (vbox1, frame1, _("Sign key"));
|
| 1320 | 533 | hiro | |
| 1321 | 533 | hiro | vbox2 = gtk_vbox_new (FALSE, 0);
|
| 1322 | 533 | hiro | gtk_widget_show (vbox2); |
| 1323 | 533 | hiro | gtk_container_add (GTK_CONTAINER (frame1), vbox2); |
| 1324 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
|
| 1325 | 533 | hiro | |
| 1326 | 533 | hiro | defaultkey_radiobtn = gtk_radio_button_new_with_label |
| 1327 | 533 | hiro | (NULL, _("Use default GnuPG key")); |
| 1328 | 533 | hiro | gtk_widget_show (defaultkey_radiobtn); |
| 1329 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), defaultkey_radiobtn, |
| 1330 | 533 | hiro | FALSE, FALSE, 0);
|
| 1331 | 533 | hiro | g_object_set_data (G_OBJECT (defaultkey_radiobtn), MENU_VAL_ID, |
| 1332 | 533 | hiro | GINT_TO_POINTER (SIGN_KEY_DEFAULT)); |
| 1333 | 533 | hiro | |
| 1334 | 533 | hiro | emailkey_radiobtn = gtk_radio_button_new_with_label_from_widget |
| 1335 | 533 | hiro | (GTK_RADIO_BUTTON (defaultkey_radiobtn), |
| 1336 | 533 | hiro | _("Select key by your email address"));
|
| 1337 | 533 | hiro | gtk_widget_show (emailkey_radiobtn); |
| 1338 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), emailkey_radiobtn, |
| 1339 | 533 | hiro | FALSE, FALSE, 0);
|
| 1340 | 533 | hiro | g_object_set_data (G_OBJECT (emailkey_radiobtn), MENU_VAL_ID, |
| 1341 | 533 | hiro | GINT_TO_POINTER (SIGN_KEY_BY_FROM)); |
| 1342 | 533 | hiro | |
| 1343 | 533 | hiro | customkey_radiobtn = gtk_radio_button_new_with_label_from_widget |
| 1344 | 533 | hiro | (GTK_RADIO_BUTTON (defaultkey_radiobtn), |
| 1345 | 533 | hiro | _("Specify key manually"));
|
| 1346 | 533 | hiro | gtk_widget_show (customkey_radiobtn); |
| 1347 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), customkey_radiobtn, |
| 1348 | 533 | hiro | FALSE, FALSE, 0);
|
| 1349 | 533 | hiro | g_object_set_data (G_OBJECT (customkey_radiobtn), MENU_VAL_ID, |
| 1350 | 533 | hiro | GINT_TO_POINTER (SIGN_KEY_CUSTOM)); |
| 1351 | 533 | hiro | |
| 1352 | 533 | hiro | hbox1 = gtk_hbox_new (FALSE, 8);
|
| 1353 | 533 | hiro | gtk_widget_show (hbox1); |
| 1354 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
|
| 1355 | 533 | hiro | |
| 1356 | 533 | hiro | label = gtk_label_new ("");
|
| 1357 | 533 | hiro | gtk_widget_show (label); |
| 1358 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
|
| 1359 | 533 | hiro | gtk_widget_set_size_request (label, 16, -1); |
| 1360 | 533 | hiro | |
| 1361 | 533 | hiro | label = gtk_label_new (_("User or key ID:"));
|
| 1362 | 533 | hiro | gtk_widget_show (label); |
| 1363 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
|
| 1364 | 533 | hiro | |
| 1365 | 533 | hiro | customkey_entry = gtk_entry_new (); |
| 1366 | 533 | hiro | gtk_widget_show (customkey_entry); |
| 1367 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), customkey_entry, |
| 1368 | 533 | hiro | TRUE, TRUE, 0);
|
| 1369 | 533 | hiro | |
| 1370 | 533 | hiro | SET_TOGGLE_SENSITIVITY (customkey_radiobtn, customkey_entry); |
| 1371 | 533 | hiro | |
| 1372 | 533 | hiro | privacy.default_sign_chkbtn = default_sign_chkbtn; |
| 1373 | 533 | hiro | privacy.default_encrypt_chkbtn = default_encrypt_chkbtn; |
| 1374 | 533 | hiro | privacy.encrypt_reply_chkbtn = encrypt_reply_chkbtn; |
| 1375 | 533 | hiro | privacy.ascii_armored_chkbtn = ascii_armored_chkbtn; |
| 1376 | 533 | hiro | privacy.clearsign_chkbtn = clearsign_chkbtn; |
| 1377 | 533 | hiro | privacy.defaultkey_radiobtn = defaultkey_radiobtn; |
| 1378 | 533 | hiro | privacy.emailkey_radiobtn = emailkey_radiobtn; |
| 1379 | 533 | hiro | privacy.customkey_radiobtn = customkey_radiobtn; |
| 1380 | 533 | hiro | privacy.customkey_entry = customkey_entry; |
| 1381 | 533 | hiro | } |
| 1382 | 533 | hiro | #endif /* USE_GPGME */ |
| 1383 | 533 | hiro | |
| 1384 | 533 | hiro | #if USE_SSL
|
| 1385 | 533 | hiro | |
| 1386 | 533 | hiro | #define CREATE_RADIO_BUTTON(box, btn, btn_p, label, data) \
|
| 1387 | 533 | hiro | { \
|
| 1388 | 533 | hiro | btn = gtk_radio_button_new_with_label_from_widget \ |
| 1389 | 533 | hiro | (GTK_RADIO_BUTTON (btn_p), label); \ |
| 1390 | 533 | hiro | gtk_widget_show (btn); \ |
| 1391 | 533 | hiro | gtk_box_pack_start (GTK_BOX (box), btn, FALSE, FALSE, 0); \
|
| 1392 | 533 | hiro | g_object_set_data (G_OBJECT (btn), MENU_VAL_ID, \ |
| 1393 | 533 | hiro | GINT_TO_POINTER (data)); \ |
| 1394 | 533 | hiro | } |
| 1395 | 533 | hiro | |
| 1396 | 533 | hiro | #define CREATE_RADIO_BUTTONS(box, \
|
| 1397 | 533 | hiro | btn1, btn1_label, btn1_data, \ |
| 1398 | 533 | hiro | btn2, btn2_label, btn2_data, \ |
| 1399 | 533 | hiro | btn3, btn3_label, btn3_data) \ |
| 1400 | 533 | hiro | { \
|
| 1401 | 533 | hiro | btn1 = gtk_radio_button_new_with_label(NULL, btn1_label); \
|
| 1402 | 533 | hiro | gtk_widget_show (btn1); \ |
| 1403 | 533 | hiro | gtk_box_pack_start (GTK_BOX (box), btn1, FALSE, FALSE, 0); \
|
| 1404 | 533 | hiro | g_object_set_data (G_OBJECT (btn1), MENU_VAL_ID, \ |
| 1405 | 533 | hiro | GINT_TO_POINTER (btn1_data)); \ |
| 1406 | 533 | hiro | \ |
| 1407 | 533 | hiro | CREATE_RADIO_BUTTON(box, btn2, btn1, btn2_label, btn2_data); \ |
| 1408 | 533 | hiro | CREATE_RADIO_BUTTON(box, btn3, btn1, btn3_label, btn3_data); \ |
| 1409 | 533 | hiro | } |
| 1410 | 533 | hiro | |
| 1411 | 533 | hiro | static void prefs_account_ssl_create(void) |
| 1412 | 533 | hiro | {
|
| 1413 | 533 | hiro | GtkWidget *vbox1; |
| 1414 | 533 | hiro | |
| 1415 | 533 | hiro | GtkWidget *pop_frame; |
| 1416 | 533 | hiro | GtkWidget *vbox2; |
| 1417 | 533 | hiro | GtkWidget *pop_nossl_radiobtn; |
| 1418 | 533 | hiro | GtkWidget *pop_ssltunnel_radiobtn; |
| 1419 | 533 | hiro | GtkWidget *pop_starttls_radiobtn; |
| 1420 | 533 | hiro | |
| 1421 | 533 | hiro | GtkWidget *imap_frame; |
| 1422 | 533 | hiro | GtkWidget *vbox3; |
| 1423 | 533 | hiro | GtkWidget *imap_nossl_radiobtn; |
| 1424 | 533 | hiro | GtkWidget *imap_ssltunnel_radiobtn; |
| 1425 | 533 | hiro | GtkWidget *imap_starttls_radiobtn; |
| 1426 | 533 | hiro | |
| 1427 | 533 | hiro | GtkWidget *nntp_frame; |
| 1428 | 533 | hiro | GtkWidget *vbox4; |
| 1429 | 533 | hiro | GtkWidget *nntp_nossl_radiobtn; |
| 1430 | 533 | hiro | GtkWidget *nntp_ssltunnel_radiobtn; |
| 1431 | 533 | hiro | |
| 1432 | 533 | hiro | GtkWidget *send_frame; |
| 1433 | 533 | hiro | GtkWidget *vbox5; |
| 1434 | 533 | hiro | GtkWidget *smtp_nossl_radiobtn; |
| 1435 | 533 | hiro | GtkWidget *smtp_ssltunnel_radiobtn; |
| 1436 | 533 | hiro | GtkWidget *smtp_starttls_radiobtn; |
| 1437 | 533 | hiro | |
| 1438 | 533 | hiro | GtkWidget *vbox6; |
| 1439 | 533 | hiro | GtkWidget *use_nonblocking_ssl_chkbtn; |
| 1440 | 533 | hiro | GtkWidget *label; |
| 1441 | 533 | hiro | |
| 1442 | 533 | hiro | vbox1 = gtk_vbox_new (FALSE, VSPACING); |
| 1443 | 533 | hiro | gtk_widget_show (vbox1); |
| 1444 | 533 | hiro | gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1); |
| 1445 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER); |
| 1446 | 533 | hiro | |
| 1447 | 533 | hiro | PACK_FRAME (vbox1, pop_frame, _("POP3"));
|
| 1448 | 533 | hiro | vbox2 = gtk_vbox_new (FALSE, 0);
|
| 1449 | 533 | hiro | gtk_widget_show (vbox2); |
| 1450 | 533 | hiro | gtk_container_add (GTK_CONTAINER (pop_frame), vbox2); |
| 1451 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
|
| 1452 | 533 | hiro | |
| 1453 | 533 | hiro | CREATE_RADIO_BUTTONS(vbox2, |
| 1454 | 533 | hiro | pop_nossl_radiobtn, |
| 1455 | 533 | hiro | _("Don't use SSL"),
|
| 1456 | 533 | hiro | SSL_NONE, |
| 1457 | 533 | hiro | pop_ssltunnel_radiobtn, |
| 1458 | 533 | hiro | _("Use SSL for POP3 connection"),
|
| 1459 | 533 | hiro | SSL_TUNNEL, |
| 1460 | 533 | hiro | pop_starttls_radiobtn, |
| 1461 | 533 | hiro | _("Use STARTTLS command to start SSL session"),
|
| 1462 | 533 | hiro | SSL_STARTTLS); |
| 1463 | 533 | hiro | |
| 1464 | 533 | hiro | PACK_FRAME (vbox1, imap_frame, _("IMAP4"));
|
| 1465 | 533 | hiro | vbox3 = gtk_vbox_new (FALSE, 0);
|
| 1466 | 533 | hiro | gtk_widget_show (vbox3); |
| 1467 | 533 | hiro | gtk_container_add (GTK_CONTAINER (imap_frame), vbox3); |
| 1468 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox3), 8);
|
| 1469 | 533 | hiro | |
| 1470 | 533 | hiro | CREATE_RADIO_BUTTONS(vbox3, |
| 1471 | 533 | hiro | imap_nossl_radiobtn, |
| 1472 | 533 | hiro | _("Don't use SSL"),
|
| 1473 | 533 | hiro | SSL_NONE, |
| 1474 | 533 | hiro | imap_ssltunnel_radiobtn, |
| 1475 | 533 | hiro | _("Use SSL for IMAP4 connection"),
|
| 1476 | 533 | hiro | SSL_TUNNEL, |
| 1477 | 533 | hiro | imap_starttls_radiobtn, |
| 1478 | 533 | hiro | _("Use STARTTLS command to start SSL session"),
|
| 1479 | 533 | hiro | SSL_STARTTLS); |
| 1480 | 533 | hiro | |
| 1481 | 533 | hiro | PACK_FRAME (vbox1, nntp_frame, _("NNTP"));
|
| 1482 | 533 | hiro | vbox4 = gtk_vbox_new (FALSE, 0);
|
| 1483 | 533 | hiro | gtk_widget_show (vbox4); |
| 1484 | 533 | hiro | gtk_container_add (GTK_CONTAINER (nntp_frame), vbox4); |
| 1485 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox4), 8);
|
| 1486 | 533 | hiro | |
| 1487 | 533 | hiro | nntp_nossl_radiobtn = |
| 1488 | 533 | hiro | gtk_radio_button_new_with_label (NULL, _("Don't use SSL")); |
| 1489 | 533 | hiro | gtk_widget_show (nntp_nossl_radiobtn); |
| 1490 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox4), nntp_nossl_radiobtn, |
| 1491 | 533 | hiro | FALSE, FALSE, 0);
|
| 1492 | 533 | hiro | g_object_set_data (G_OBJECT (nntp_nossl_radiobtn), MENU_VAL_ID, |
| 1493 | 533 | hiro | GINT_TO_POINTER (SSL_NONE)); |
| 1494 | 533 | hiro | |
| 1495 | 533 | hiro | CREATE_RADIO_BUTTON(vbox4, nntp_ssltunnel_radiobtn, nntp_nossl_radiobtn, |
| 1496 | 533 | hiro | _("Use SSL for NNTP connection"), SSL_TUNNEL);
|
| 1497 | 533 | hiro | |
| 1498 | 533 | hiro | PACK_FRAME (vbox1, send_frame, _("Send (SMTP)"));
|
| 1499 | 533 | hiro | vbox5 = gtk_vbox_new (FALSE, 0);
|
| 1500 | 533 | hiro | gtk_widget_show (vbox5); |
| 1501 | 533 | hiro | gtk_container_add (GTK_CONTAINER (send_frame), vbox5); |
| 1502 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox5), 8);
|
| 1503 | 533 | hiro | |
| 1504 | 533 | hiro | CREATE_RADIO_BUTTONS(vbox5, |
| 1505 | 533 | hiro | smtp_nossl_radiobtn, |
| 1506 | 533 | hiro | _("Don't use SSL"),
|
| 1507 | 533 | hiro | SSL_NONE, |
| 1508 | 533 | hiro | smtp_ssltunnel_radiobtn, |
| 1509 | 533 | hiro | _("Use SSL for SMTP connection"),
|
| 1510 | 533 | hiro | SSL_TUNNEL, |
| 1511 | 533 | hiro | smtp_starttls_radiobtn, |
| 1512 | 533 | hiro | _("Use STARTTLS command to start SSL session"),
|
| 1513 | 533 | hiro | SSL_STARTTLS); |
| 1514 | 533 | hiro | |
| 1515 | 533 | hiro | vbox6 = gtk_vbox_new (FALSE, 0);
|
| 1516 | 533 | hiro | gtk_widget_show (vbox6); |
| 1517 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox1), vbox6, FALSE, FALSE, 0);
|
| 1518 | 533 | hiro | |
| 1519 | 533 | hiro | PACK_CHECK_BUTTON(vbox6, use_nonblocking_ssl_chkbtn, |
| 1520 | 533 | hiro | _("Use non-blocking SSL"));
|
| 1521 | 533 | hiro | PACK_SMALL_LABEL |
| 1522 | 533 | hiro | (vbox6, label, |
| 1523 | 533 | hiro | _("Turn this off if you have problems in SSL connection."));
|
| 1524 | 533 | hiro | |
| 1525 | 533 | hiro | ssl.pop_frame = pop_frame; |
| 1526 | 533 | hiro | ssl.pop_nossl_radiobtn = pop_nossl_radiobtn; |
| 1527 | 533 | hiro | ssl.pop_ssltunnel_radiobtn = pop_ssltunnel_radiobtn; |
| 1528 | 533 | hiro | ssl.pop_starttls_radiobtn = pop_starttls_radiobtn; |
| 1529 | 533 | hiro | |
| 1530 | 533 | hiro | ssl.imap_frame = imap_frame; |
| 1531 | 533 | hiro | ssl.imap_nossl_radiobtn = imap_nossl_radiobtn; |
| 1532 | 533 | hiro | ssl.imap_ssltunnel_radiobtn = imap_ssltunnel_radiobtn; |
| 1533 | 533 | hiro | ssl.imap_starttls_radiobtn = imap_starttls_radiobtn; |
| 1534 | 533 | hiro | |
| 1535 | 533 | hiro | ssl.nntp_frame = nntp_frame; |
| 1536 | 533 | hiro | ssl.nntp_nossl_radiobtn = nntp_nossl_radiobtn; |
| 1537 | 533 | hiro | ssl.nntp_ssltunnel_radiobtn = nntp_ssltunnel_radiobtn; |
| 1538 | 533 | hiro | |
| 1539 | 533 | hiro | ssl.send_frame = send_frame; |
| 1540 | 533 | hiro | ssl.smtp_nossl_radiobtn = smtp_nossl_radiobtn; |
| 1541 | 533 | hiro | ssl.smtp_ssltunnel_radiobtn = smtp_ssltunnel_radiobtn; |
| 1542 | 533 | hiro | ssl.smtp_starttls_radiobtn = smtp_starttls_radiobtn; |
| 1543 | 533 | hiro | |
| 1544 | 533 | hiro | ssl.use_nonblocking_ssl_chkbtn = use_nonblocking_ssl_chkbtn; |
| 1545 | 533 | hiro | } |
| 1546 | 533 | hiro | |
| 1547 | 533 | hiro | #undef CREATE_RADIO_BUTTONS
|
| 1548 | 533 | hiro | #undef CREATE_RADIO_BUTTON
|
| 1549 | 533 | hiro | |
| 1550 | 533 | hiro | #endif /* USE_SSL */ |
| 1551 | 533 | hiro | |
| 1552 | 533 | hiro | static void prefs_account_advanced_create(void) |
| 1553 | 533 | hiro | {
|
| 1554 | 533 | hiro | GtkWidget *vbox1; |
| 1555 | 533 | hiro | GtkWidget *vbox2; |
| 1556 | 533 | hiro | GtkWidget *hbox1; |
| 1557 | 533 | hiro | GtkWidget *checkbtn_smtpport; |
| 1558 | 533 | hiro | GtkWidget *entry_smtpport; |
| 1559 | 533 | hiro | GtkWidget *hbox_popport; |
| 1560 | 533 | hiro | GtkWidget *checkbtn_popport; |
| 1561 | 533 | hiro | GtkWidget *entry_popport; |
| 1562 | 533 | hiro | GtkWidget *hbox_imapport; |
| 1563 | 533 | hiro | GtkWidget *checkbtn_imapport; |
| 1564 | 533 | hiro | GtkWidget *entry_imapport; |
| 1565 | 533 | hiro | GtkWidget *hbox_nntpport; |
| 1566 | 533 | hiro | GtkWidget *checkbtn_nntpport; |
| 1567 | 533 | hiro | GtkWidget *entry_nntpport; |
| 1568 | 533 | hiro | GtkWidget *checkbtn_domain; |
| 1569 | 533 | hiro | GtkWidget *entry_domain; |
| 1570 | 533 | hiro | GtkWidget *imap_frame; |
| 1571 | 533 | hiro | GtkWidget *imapdir_label; |
| 1572 | 533 | hiro | GtkWidget *imapdir_entry; |
| 1573 | 533 | hiro | GtkWidget *folder_frame; |
| 1574 | 533 | hiro | GtkWidget *vbox3; |
| 1575 | 533 | hiro | GtkWidget *table; |
| 1576 | 533 | hiro | GtkWidget *sent_folder_chkbtn; |
| 1577 | 533 | hiro | GtkWidget *sent_folder_entry; |
| 1578 | 533 | hiro | GtkWidget *draft_folder_chkbtn; |
| 1579 | 533 | hiro | GtkWidget *draft_folder_entry; |
| 1580 | 533 | hiro | GtkWidget *trash_folder_chkbtn; |
| 1581 | 533 | hiro | GtkWidget *trash_folder_entry; |
| 1582 | 533 | hiro | |
| 1583 | 533 | hiro | #define PACK_HBOX(hbox) \
|
| 1584 | 533 | hiro | { \
|
| 1585 | 533 | hiro | hbox = gtk_hbox_new (FALSE, 8); \
|
| 1586 | 533 | hiro | gtk_widget_show (hbox); \ |
| 1587 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0); \
|
| 1588 | 533 | hiro | } |
| 1589 | 533 | hiro | |
| 1590 | 533 | hiro | #define PACK_PORT_ENTRY(box, entry) \
|
| 1591 | 533 | hiro | { \
|
| 1592 | 533 | hiro | entry = gtk_entry_new (); \ |
| 1593 | 533 | hiro | gtk_entry_set_max_length (GTK_ENTRY(entry), 5); \
|
| 1594 | 533 | hiro | gtk_widget_show (entry); \ |
| 1595 | 533 | hiro | gtk_box_pack_start (GTK_BOX (box), entry, FALSE, FALSE, 0); \
|
| 1596 | 533 | hiro | gtk_widget_set_size_request (entry, 64, -1); \ |
| 1597 | 533 | hiro | } |
| 1598 | 533 | hiro | |
| 1599 | 533 | hiro | vbox1 = gtk_vbox_new (FALSE, VSPACING); |
| 1600 | 533 | hiro | gtk_widget_show (vbox1); |
| 1601 | 533 | hiro | gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1); |
| 1602 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER); |
| 1603 | 533 | hiro | |
| 1604 | 533 | hiro | vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW_2); |
| 1605 | 533 | hiro | gtk_widget_show (vbox2); |
| 1606 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
|
| 1607 | 533 | hiro | |
| 1608 | 533 | hiro | PACK_HBOX (hbox1); |
| 1609 | 533 | hiro | PACK_CHECK_BUTTON (hbox1, checkbtn_smtpport, _("Specify SMTP port"));
|
| 1610 | 533 | hiro | PACK_PORT_ENTRY (hbox1, entry_smtpport); |
| 1611 | 533 | hiro | SET_TOGGLE_SENSITIVITY (checkbtn_smtpport, entry_smtpport); |
| 1612 | 533 | hiro | |
| 1613 | 533 | hiro | PACK_HBOX (hbox_popport); |
| 1614 | 533 | hiro | PACK_CHECK_BUTTON (hbox_popport, checkbtn_popport, |
| 1615 | 533 | hiro | _("Specify POP3 port"));
|
| 1616 | 533 | hiro | PACK_PORT_ENTRY (hbox_popport, entry_popport); |
| 1617 | 533 | hiro | SET_TOGGLE_SENSITIVITY (checkbtn_popport, entry_popport); |
| 1618 | 533 | hiro | |
| 1619 | 533 | hiro | PACK_HBOX (hbox_imapport); |
| 1620 | 533 | hiro | PACK_CHECK_BUTTON (hbox_imapport, checkbtn_imapport, |
| 1621 | 533 | hiro | _("Specify IMAP4 port"));
|
| 1622 | 533 | hiro | PACK_PORT_ENTRY (hbox_imapport, entry_imapport); |
| 1623 | 533 | hiro | SET_TOGGLE_SENSITIVITY (checkbtn_imapport, entry_imapport); |
| 1624 | 533 | hiro | |
| 1625 | 533 | hiro | PACK_HBOX (hbox_nntpport); |
| 1626 | 533 | hiro | PACK_CHECK_BUTTON (hbox_nntpport, checkbtn_nntpport, |
| 1627 | 533 | hiro | _("Specify NNTP port"));
|
| 1628 | 533 | hiro | PACK_PORT_ENTRY (hbox_nntpport, entry_nntpport); |
| 1629 | 533 | hiro | SET_TOGGLE_SENSITIVITY (checkbtn_nntpport, entry_nntpport); |
| 1630 | 533 | hiro | |
| 1631 | 533 | hiro | PACK_HBOX (hbox1); |
| 1632 | 533 | hiro | PACK_CHECK_BUTTON (hbox1, checkbtn_domain, _("Specify domain name"));
|
| 1633 | 533 | hiro | |
| 1634 | 533 | hiro | entry_domain = gtk_entry_new (); |
| 1635 | 533 | hiro | gtk_widget_show (entry_domain); |
| 1636 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), entry_domain, TRUE, TRUE, 0);
|
| 1637 | 533 | hiro | SET_TOGGLE_SENSITIVITY (checkbtn_domain, entry_domain); |
| 1638 | 533 | hiro | |
| 1639 | 533 | hiro | PACK_FRAME (vbox1, imap_frame, _("IMAP4"));
|
| 1640 | 533 | hiro | |
| 1641 | 533 | hiro | vbox3 = gtk_vbox_new (FALSE, VSPACING_NARROW); |
| 1642 | 533 | hiro | gtk_widget_show (vbox3); |
| 1643 | 533 | hiro | gtk_container_add (GTK_CONTAINER (imap_frame), vbox3); |
| 1644 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox3), 8);
|
| 1645 | 533 | hiro | |
| 1646 | 533 | hiro | hbox1 = gtk_hbox_new (FALSE, 8);
|
| 1647 | 533 | hiro | gtk_widget_show (hbox1); |
| 1648 | 533 | hiro | gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
|
| 1649 | 533 | hiro | |
| 1650 | 533 | hiro | imapdir_label = gtk_label_new (_("IMAP server directory"));
|
| 1651 | 533 | hiro | gtk_widget_show (imapdir_label); |
| 1652 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), imapdir_label, FALSE, FALSE, 0);
|
| 1653 | 533 | hiro | |
| 1654 | 533 | hiro | imapdir_entry = gtk_entry_new(); |
| 1655 | 533 | hiro | gtk_widget_show (imapdir_entry); |
| 1656 | 533 | hiro | gtk_box_pack_start (GTK_BOX (hbox1), imapdir_entry, TRUE, TRUE, 0);
|
| 1657 | 533 | hiro | |
| 1658 | 533 | hiro | #undef PACK_HBOX
|
| 1659 | 533 | hiro | #undef PACK_PORT_ENTRY
|
| 1660 | 533 | hiro | |
| 1661 | 533 | hiro | /* special folder setting (maybe these options are redundant) */
|
| 1662 | 533 | hiro | |
| 1663 | 533 | hiro | PACK_FRAME (vbox1, folder_frame, _("Folder"));
|
| 1664 | 533 | hiro | |
| 1665 | 533 | hiro | vbox3 = gtk_vbox_new (FALSE, 0);
|
| 1666 | 533 | hiro | gtk_widget_show (vbox3); |
| 1667 | 533 | hiro | gtk_container_add (GTK_CONTAINER (folder_frame), vbox3); |
| 1668 | 533 | hiro | gtk_container_set_border_width (GTK_CONTAINER (vbox3), 8);
|
| 1669 | 533 | hiro | |
| 1670 | 533 | hiro | table = gtk_table_new (3, 3, FALSE); |
| 1671 | 533 | hiro | gtk_widget_show (table); |
| 1672 | 533 | hiro | gtk_container_add (GTK_CONTAINER (vbox3), table); |
| 1673 | 533 | hiro | gtk_table_set_row_spacings (GTK_TABLE (table), VSPACING_NARROW_2); |
| 1674 | 533 | hiro | gtk_table_set_col_spacings (GTK_TABLE (table), 4);
|
| 1675 | 533 | hiro | |
| 1676 | 533 | hiro | #define SET_CHECK_BTN_AND_ENTRY(label, chkbtn, entry, n) \
|
| 1677 | 533 | hiro | { \
|
| 1678 | 533 | hiro | GtkWidget *button; \ |
| 1679 | 533 | hiro | \ |
| 1680 | 533 | hiro | chkbtn = gtk_check_button_new_with_label (label); \ |
| 1681 | 533 | hiro | gtk_widget_show (chkbtn); \ |
| 1682 | 533 | hiro | gtk_table_attach (GTK_TABLE (table), chkbtn, \ |
| 1683 | 533 | hiro | 0, 1, n, n + 1, GTK_FILL, 0, 0, 0); \ |
| 1684 | 533 | hiro | \ |
| 1685 | 533 | hiro | entry = gtk_entry_new (); \ |
| 1686 | 533 | hiro | gtk_widget_show (entry); \ |
| 1687 | 533 | hiro | gtk_table_attach (GTK_TABLE (table), entry, 1, 2, n, n + 1, \ |
| 1688 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, \ |
| 1689 | 533 | hiro | GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); \ |
| 1690 | 533 | hiro | \ |
| 1691 | 533 | hiro | button = gtk_button_new_with_label (_(" ... ")); \
|
| 1692 | 533 | hiro | gtk_widget_show (button); \ |
| 1693 | 533 | hiro | gtk_table_attach (GTK_TABLE (table), button, \ |
| 1694 | 533 | hiro | 2, 3, n, n + 1, GTK_FILL, 0, 0, 0); \ |
| 1695 | 533 | hiro | g_signal_connect \ |
| 1696 | 533 | hiro | (G_OBJECT (button), "clicked", \
|
| 1697 | 533 | hiro | G_CALLBACK (prefs_account_select_folder_cb), \ |
| 1698 | 533 | hiro | entry); \ |
| 1699 | 533 | hiro | \ |
| 1700 | 533 | hiro | SET_TOGGLE_SENSITIVITY (chkbtn, entry); \ |
| 1701 | 533 | hiro | SET_TOGGLE_SENSITIVITY (chkbtn, button); \ |
| 1702 | 533 | hiro | } |
| 1703 | 533 | hiro | |
| 1704 | 533 | hiro | SET_CHECK_BTN_AND_ENTRY(_("Put sent messages in"),
|
| 1705 | 533 | hiro | sent_folder_chkbtn, sent_folder_entry, 0);
|
| 1706 | 533 | hiro | SET_CHECK_BTN_AND_ENTRY(_("Put draft messages in"),
|
| 1707 | 533 | hiro | draft_folder_chkbtn, draft_folder_entry, 1);
|
| 1708 | 533 | hiro | SET_CHECK_BTN_AND_ENTRY(_("Put deleted messages in"),
|
| 1709 | 533 | hiro | trash_folder_chkbtn, trash_folder_entry, 2);
|
| 1710 | 533 | hiro | |
| 1711 | 533 | hiro | advanced.smtpport_chkbtn = checkbtn_smtpport; |
| 1712 | 533 | hiro | advanced.smtpport_entry = entry_smtpport; |
| 1713 | 533 | hiro | advanced.popport_hbox = hbox_popport; |
| 1714 | 533 | hiro | advanced.popport_chkbtn = checkbtn_popport; |
| 1715 | 533 | hiro | advanced.popport_entry = entry_popport; |
| 1716 | 533 | hiro | advanced.imapport_hbox = hbox_imapport; |
| 1717 | 533 | hiro | advanced.imapport_chkbtn = checkbtn_imapport; |
| 1718 | 533 | hiro | advanced.imapport_entry = entry_imapport; |
| 1719 | 533 | hiro | advanced.nntpport_hbox = hbox_nntpport; |
| 1720 | 533 | hiro | advanced.nntpport_chkbtn = checkbtn_nntpport; |
| 1721 | 533 | hiro | advanced.nntpport_entry = entry_nntpport; |
| 1722 | 533 | hiro | advanced.domain_chkbtn = checkbtn_domain; |
| 1723 | 533 | hiro | advanced.domain_entry = entry_domain; |
| 1724 | 533 | hiro | |
| 1725 | 533 | hiro | advanced.imap_frame = imap_frame; |
| 1726 | 533 | hiro | advanced.imapdir_entry = imapdir_entry; |
| 1727 | 533 | hiro | |
| 1728 | 533 | hiro | advanced.sent_folder_chkbtn = sent_folder_chkbtn; |
| 1729 | 533 | hiro | advanced.sent_folder_entry = sent_folder_entry; |
| 1730 | 533 | hiro | advanced.draft_folder_chkbtn = draft_folder_chkbtn; |
| 1731 | 533 | hiro | advanced.draft_folder_entry = draft_folder_entry; |
| 1732 | 533 | hiro | advanced.trash_folder_chkbtn = trash_folder_chkbtn; |
| 1733 | 533 | hiro | advanced.trash_folder_entry = trash_folder_entry; |
| 1734 | 533 | hiro | } |
| 1735 | 533 | hiro | |
| 1736 | 533 | hiro | static gint prefs_account_deleted(GtkWidget *widget, GdkEventAny *event,
|
| 1737 | 533 | hiro | gpointer data) |
| 1738 | 533 | hiro | {
|
| 1739 | 533 | hiro | prefs_account_cancel(); |
| 1740 | 533 | hiro | return TRUE;
|
| 1741 | 533 | hiro | } |
| 1742 | 533 | hiro | |
| 1743 | 533 | hiro | static gboolean prefs_account_key_pressed(GtkWidget *widget, GdkEventKey *event,
|
| 1744 | 533 | hiro | gpointer data) |
| 1745 | 533 | hiro | {
|
| 1746 | 533 | hiro | if (event && event->keyval == GDK_Escape)
|
| 1747 | 533 | hiro | prefs_account_cancel(); |
| 1748 | 533 | hiro | return FALSE;
|
| 1749 | 533 | hiro | } |
| 1750 | 533 | hiro | |
| 1751 | 533 | hiro | static void prefs_account_ok(void) |
| 1752 | 533 | hiro | {
|
| 1753 | 533 | hiro | if (prefs_account_apply() == 0) |
| 1754 | 533 | hiro | gtk_main_quit(); |
| 1755 | 533 | hiro | } |
| 1756 | 533 | hiro | |
| 1757 | 533 | hiro | static gint prefs_account_apply(void) |
| 1758 | 533 | hiro | {
|
| 1759 | 533 | hiro | RecvProtocol protocol; |
| 1760 | 533 | hiro | GtkWidget *menu; |
| 1761 | 533 | hiro | GtkWidget *menuitem; |
| 1762 | 533 | hiro | |
| 1763 | 533 | hiro | menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(basic.protocol_optmenu)); |
| 1764 | 533 | hiro | menuitem = gtk_menu_get_active(GTK_MENU(menu)); |
| 1765 | 533 | hiro | protocol = GPOINTER_TO_INT |
| 1766 | 533 | hiro | (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID)); |
| 1767 | 533 | hiro | |
| 1768 | 533 | hiro | if (*gtk_entry_get_text(GTK_ENTRY(basic.acname_entry)) == '\0') { |
| 1769 | 533 | hiro | alertpanel_error(_("Account name is not entered."));
|
| 1770 | 533 | hiro | return -1; |
| 1771 | 533 | hiro | } |
| 1772 | 533 | hiro | if (*gtk_entry_get_text(GTK_ENTRY(basic.addr_entry)) == '\0') { |
| 1773 | 533 | hiro | alertpanel_error(_("Mail address is not entered."));
|
| 1774 | 533 | hiro | return -1; |
| 1775 | 533 | hiro | } |
| 1776 | 533 | hiro | if ((protocol == A_POP3 || protocol == A_LOCAL) &&
|
| 1777 | 533 | hiro | *gtk_entry_get_text(GTK_ENTRY(basic.smtpserv_entry)) == '\0') {
|
| 1778 | 533 | hiro | alertpanel_error(_("SMTP server is not entered."));
|
| 1779 | 533 | hiro | return -1; |
| 1780 | 533 | hiro | } |
| 1781 | 533 | hiro | if ((protocol == A_POP3 || protocol == A_IMAP4) &&
|
| 1782 | 533 | hiro | *gtk_entry_get_text(GTK_ENTRY(basic.uid_entry)) == '\0') {
|
| 1783 | 533 | hiro | alertpanel_error(_("User ID is not entered."));
|
| 1784 | 533 | hiro | return -1; |
| 1785 | 533 | hiro | } |
| 1786 | 533 | hiro | if (protocol == A_POP3 &&
|
| 1787 | 533 | hiro | *gtk_entry_get_text(GTK_ENTRY(basic.recvserv_entry)) == '\0') {
|
| 1788 | 533 | hiro | alertpanel_error(_("POP3 server is not entered."));
|
| 1789 | 533 | hiro | return -1; |
| 1790 | 533 | hiro | } |
| 1791 | 533 | hiro | if (protocol == A_IMAP4 &&
|
| 1792 | 533 | hiro | *gtk_entry_get_text(GTK_ENTRY(basic.recvserv_entry)) == '\0') {
|
| 1793 | 533 | hiro | alertpanel_error(_("IMAP4 server is not entered."));
|
| 1794 | 533 | hiro | return -1; |
| 1795 | 533 | hiro | } |
| 1796 | 533 | hiro | if (protocol == A_NNTP &&
|
| 1797 | 533 | hiro | *gtk_entry_get_text(GTK_ENTRY(basic.nntpserv_entry)) == '\0') {
|
| 1798 | 533 | hiro | alertpanel_error(_("NNTP server is not entered."));
|
| 1799 | 533 | hiro | return -1; |
| 1800 | 533 | hiro | } |
| 1801 | 533 | hiro | |
| 1802 | 533 | hiro | prefs_set_data_from_dialog(prefs_account_get_params()); |
| 1803 | 533 | hiro | return 0; |
| 1804 | 533 | hiro | } |
| 1805 | 533 | hiro | |
| 1806 | 533 | hiro | static void prefs_account_cancel(void) |
| 1807 | 533 | hiro | {
|
| 1808 | 533 | hiro | cancelled = TRUE; |
| 1809 | 533 | hiro | gtk_main_quit(); |
| 1810 | 533 | hiro | } |
| 1811 | 533 | hiro | |
| 1812 | 533 | hiro | static void prefs_account_select_folder_cb(GtkWidget *widget, gpointer data) |
| 1813 | 533 | hiro | {
|
| 1814 | 533 | hiro | FolderItem *item; |
| 1815 | 533 | hiro | gchar *id; |
| 1816 | 533 | hiro | |
| 1817 | 533 | hiro | item = foldersel_folder_sel(NULL, FOLDER_SEL_COPY, NULL); |
| 1818 | 533 | hiro | if (item && item->path) {
|
| 1819 | 533 | hiro | id = folder_item_get_identifier(item); |
| 1820 | 533 | hiro | if (id) {
|
| 1821 | 533 | hiro | gtk_entry_set_text(GTK_ENTRY(data), id); |
| 1822 | 533 | hiro | g_free(id); |
| 1823 | 533 | hiro | } |
| 1824 | 533 | hiro | } |
| 1825 | 533 | hiro | } |
| 1826 | 533 | hiro | |
| 1827 | 533 | hiro | static void prefs_account_edit_custom_header(void) |
| 1828 | 533 | hiro | {
|
| 1829 | 533 | hiro | prefs_custom_header_open(prefs_account_get_tmp_prefs()); |
| 1830 | 533 | hiro | } |
| 1831 | 533 | hiro | |
| 1832 | 533 | hiro | static void prefs_account_enum_set_data_from_radiobtn(PrefParam *pparam) |
| 1833 | 533 | hiro | {
|
| 1834 | 533 | hiro | PrefsUIData *ui_data; |
| 1835 | 533 | hiro | GtkRadioButton *radiobtn; |
| 1836 | 533 | hiro | GSList *group; |
| 1837 | 533 | hiro | |
| 1838 | 533 | hiro | ui_data = (PrefsUIData *)pparam->ui_data; |
| 1839 | 533 | hiro | g_return_if_fail(ui_data != NULL);
|
| 1840 | 533 | hiro | g_return_if_fail(*ui_data->widget != NULL);
|
| 1841 | 533 | hiro | |
| 1842 | 533 | hiro | radiobtn = GTK_RADIO_BUTTON(*ui_data->widget); |
| 1843 | 533 | hiro | group = gtk_radio_button_get_group(radiobtn); |
| 1844 | 533 | hiro | while (group != NULL) { |
| 1845 | 533 | hiro | GtkToggleButton *btn = GTK_TOGGLE_BUTTON(group->data); |
| 1846 | 533 | hiro | if (gtk_toggle_button_get_active(btn)) {
|
| 1847 | 533 | hiro | *((gint *)pparam->data) = GPOINTER_TO_INT |
| 1848 | 533 | hiro | (g_object_get_data(G_OBJECT(btn), MENU_VAL_ID)); |
| 1849 | 533 | hiro | break;
|
| 1850 | 533 | hiro | } |
| 1851 | 533 | hiro | group = group->next; |
| 1852 | 533 | hiro | } |
| 1853 | 533 | hiro | } |
| 1854 | 533 | hiro | |
| 1855 | 533 | hiro | static void prefs_account_enum_set_radiobtn(PrefParam *pparam) |
| 1856 | 533 | hiro | {
|
| 1857 | 533 | hiro | PrefsUIData *ui_data; |
| 1858 | 533 | hiro | GtkRadioButton *radiobtn; |
| 1859 | 533 | hiro | GSList *group; |
| 1860 | 533 | hiro | gpointer data; |
| 1861 | 533 | hiro | |
| 1862 | 533 | hiro | ui_data = (PrefsUIData *)pparam->ui_data; |
| 1863 | 533 | hiro | g_return_if_fail(ui_data != NULL);
|
| 1864 | 533 | hiro | g_return_if_fail(*ui_data->widget != NULL);
|
| 1865 | 533 | hiro | |
| 1866 | 533 | hiro | data = GINT_TO_POINTER(*((gint *)pparam->data)); |
| 1867 | 533 | hiro | radiobtn = GTK_RADIO_BUTTON(*ui_data->widget); |
| 1868 | 533 | hiro | group = gtk_radio_button_get_group(radiobtn); |
| 1869 | 533 | hiro | while (group != NULL) { |
| 1870 | 533 | hiro | GtkToggleButton *btn = GTK_TOGGLE_BUTTON(group->data); |
| 1871 | 533 | hiro | gpointer data1; |
| 1872 | 533 | hiro | |
| 1873 | 533 | hiro | data1 = g_object_get_data(G_OBJECT(btn), MENU_VAL_ID); |
| 1874 | 533 | hiro | if (data1 == data) {
|
| 1875 | 533 | hiro | gtk_toggle_button_set_active(btn, TRUE); |
| 1876 | 533 | hiro | break;
|
| 1877 | 533 | hiro | } |
| 1878 | 533 | hiro | group = group->next; |
| 1879 | 533 | hiro | } |
| 1880 | 533 | hiro | } |
| 1881 | 533 | hiro | |
| 1882 | 533 | hiro | |
| 1883 | 533 | hiro | #if USE_GPGME
|
| 1884 | 533 | hiro | static void prefs_account_ascii_armored_warning(GtkWidget *widget) |
| 1885 | 533 | hiro | {
|
| 1886 | 533 | hiro | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)) &&
|
| 1887 | 533 | hiro | gtk_notebook_get_current_page(GTK_NOTEBOOK(dialog.notebook)) > 0)
|
| 1888 | 533 | hiro | alertpanel_warning |
| 1889 | 533 | hiro | (_("It's not recommended to use the old style ASCII-armored\n"
|
| 1890 | 533 | hiro | "mode for encrypted messages. It doesn't comply with the\n"
|
| 1891 | 533 | hiro | "RFC 3156 - MIME Security with OpenPGP."));
|
| 1892 | 533 | hiro | } |
| 1893 | 533 | hiro | #endif /* USE_GPGME */ |
| 1894 | 533 | hiro | |
| 1895 | 533 | hiro | static void prefs_account_protocol_set_data_from_optmenu(PrefParam *pparam) |
| 1896 | 533 | hiro | {
|
| 1897 | 533 | hiro | PrefsUIData *ui_data; |
| 1898 | 533 | hiro | GtkWidget *menu; |
| 1899 | 533 | hiro | GtkWidget *menuitem; |
| 1900 | 533 | hiro | |
| 1901 | 533 | hiro | ui_data = (PrefsUIData *)pparam->ui_data; |
| 1902 | 533 | hiro | g_return_if_fail(ui_data != NULL);
|
| 1903 | 533 | hiro | g_return_if_fail(*ui_data->widget != NULL);
|
| 1904 | 533 | hiro | |
| 1905 | 533 | hiro | menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*ui_data->widget)); |
| 1906 | 533 | hiro | menuitem = gtk_menu_get_active(GTK_MENU(menu)); |
| 1907 | 533 | hiro | *((RecvProtocol *)pparam->data) = GPOINTER_TO_INT |
| 1908 | 533 | hiro | (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID)); |
| 1909 | 533 | hiro | } |
| 1910 | 533 | hiro | |
| 1911 | 533 | hiro | static void prefs_account_protocol_set_optmenu(PrefParam *pparam) |
| 1912 | 533 | hiro | {
|
| 1913 | 533 | hiro | PrefsUIData *ui_data; |
| 1914 | 533 | hiro | RecvProtocol protocol; |
| 1915 | 533 | hiro | GtkOptionMenu *optmenu; |
| 1916 | 533 | hiro | GtkWidget *menu; |
| 1917 | 533 | hiro | GtkWidget *menuitem; |
| 1918 | 533 | hiro | gint index; |
| 1919 | 533 | hiro | |
| 1920 | 533 | hiro | ui_data = (PrefsUIData *)pparam->ui_data; |
| 1921 | 533 | hiro | g_return_if_fail(ui_data != NULL);
|
| 1922 | 533 | hiro | g_return_if_fail(*ui_data->widget != NULL);
|
| 1923 | 533 | hiro | |
| 1924 | 533 | hiro | optmenu = GTK_OPTION_MENU(*ui_data->widget); |
| 1925 | 533 | hiro | |
| 1926 | 533 | hiro | protocol = *((RecvProtocol *)pparam->data); |
| 1927 | 533 | hiro | index = menu_find_option_menu_index |
| 1928 | 533 | hiro | (optmenu, GINT_TO_POINTER(protocol), NULL);
|
| 1929 | 533 | hiro | if (index < 0) return; |
| 1930 | 533 | hiro | gtk_option_menu_set_history(optmenu, index); |
| 1931 | 533 | hiro | |
| 1932 | 533 | hiro | menu = gtk_option_menu_get_menu(optmenu); |
| 1933 | 533 | hiro | menu_set_insensitive_all(GTK_MENU_SHELL(menu)); |
| 1934 | 533 | hiro | |
| 1935 | 533 | hiro | menuitem = gtk_menu_get_active(GTK_MENU(menu)); |
| 1936 | 533 | hiro | gtk_widget_set_sensitive(menuitem, TRUE); |
| 1937 | 533 | hiro | gtk_menu_item_activate(GTK_MENU_ITEM(menuitem)); |
| 1938 | 533 | hiro | } |
| 1939 | 533 | hiro | |
| 1940 | 533 | hiro | static void prefs_account_imap_auth_type_set_data_from_optmenu(PrefParam *pparam) |
| 1941 | 533 | hiro | {
|
| 1942 | 533 | hiro | PrefsUIData *ui_data; |
| 1943 | 533 | hiro | GtkWidget *menu; |
| 1944 | 533 | hiro | GtkWidget *menuitem; |
| 1945 | 533 | hiro | |
| 1946 | 533 | hiro | ui_data = (PrefsUIData *)pparam->ui_data; |
| 1947 | 533 | hiro | g_return_if_fail(ui_data != NULL);
|
| 1948 | 533 | hiro | g_return_if_fail(*ui_data->widget != NULL);
|
| 1949 | 533 | hiro | |
| 1950 | 533 | hiro | menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*ui_data->widget)); |
| 1951 | 533 | hiro | menuitem = gtk_menu_get_active(GTK_MENU(menu)); |
| 1952 | 533 | hiro | *((RecvProtocol *)pparam->data) = GPOINTER_TO_INT |
| 1953 | 533 | hiro | (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID)); |
| 1954 | 533 | hiro | } |
| 1955 | 533 | hiro | |
| 1956 | 533 | hiro | static void prefs_account_imap_auth_type_set_optmenu(PrefParam *pparam) |
| 1957 | 533 | hiro | {
|
| 1958 | 533 | hiro | PrefsUIData *ui_data; |
| 1959 | 533 | hiro | IMAPAuthType type = *((IMAPAuthType *)pparam->data); |
| 1960 | 533 | hiro | GtkOptionMenu *optmenu; |
| 1961 | 533 | hiro | GtkWidget *menu; |
| 1962 | 533 | hiro | GtkWidget *menuitem; |
| 1963 | 533 | hiro | |
| 1964 | 533 | hiro | ui_data = (PrefsUIData *)pparam->ui_data; |
| 1965 | 533 | hiro | g_return_if_fail(ui_data != NULL);
|
| 1966 | 533 | hiro | g_return_if_fail(*ui_data->widget != NULL);
|
| 1967 | 533 | hiro | |
| 1968 | 533 | hiro | optmenu = GTK_OPTION_MENU(*ui_data->widget); |
| 1969 | 533 | hiro | |
| 1970 | 533 | hiro | switch (type) {
|
| 1971 | 533 | hiro | case IMAP_AUTH_LOGIN:
|
| 1972 | 533 | hiro | gtk_option_menu_set_history(optmenu, 1);
|
| 1973 | 533 | hiro | break;
|
| 1974 | 533 | hiro | case IMAP_AUTH_CRAM_MD5:
|
| 1975 | 533 | hiro | gtk_option_menu_set_history(optmenu, 2);
|
| 1976 | 533 | hiro | break;
|
| 1977 | 533 | hiro | case 0: |
| 1978 | 533 | hiro | default:
|
| 1979 | 533 | hiro | gtk_option_menu_set_history(optmenu, 0);
|
| 1980 | 533 | hiro | } |
| 1981 | 533 | hiro | |
| 1982 | 533 | hiro | menu = gtk_option_menu_get_menu(optmenu); |
| 1983 | 533 | hiro | menuitem = gtk_menu_get_active(GTK_MENU(menu)); |
| 1984 | 533 | hiro | gtk_menu_item_activate(GTK_MENU_ITEM(menuitem)); |
| 1985 | 533 | hiro | } |
| 1986 | 533 | hiro | |
| 1987 | 533 | hiro | static void prefs_account_smtp_auth_type_set_data_from_optmenu(PrefParam *pparam) |
| 1988 | 533 | hiro | {
|
| 1989 | 533 | hiro | PrefsUIData *ui_data; |
| 1990 | 533 | hiro | GtkWidget *menu; |
| 1991 | 533 | hiro | GtkWidget *menuitem; |
| 1992 | 533 | hiro | |
| 1993 | 533 | hiro | ui_data = (PrefsUIData *)pparam->ui_data; |
| 1994 | 533 | hiro | g_return_if_fail(ui_data != NULL);
|
| 1995 | 533 | hiro | g_return_if_fail(*ui_data->widget != NULL);
|
| 1996 | 533 | hiro | |
| 1997 | 533 | hiro | menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*ui_data->widget)); |
| 1998 | 533 | hiro | menuitem = gtk_menu_get_active(GTK_MENU(menu)); |
| 1999 | 533 | hiro | *((RecvProtocol *)pparam->data) = GPOINTER_TO_INT |
| 2000 | 533 | hiro | (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID)); |
| 2001 | 533 | hiro | } |
| 2002 | 533 | hiro | |
| 2003 | 533 | hiro | static void prefs_account_smtp_auth_type_set_optmenu(PrefParam *pparam) |
| 2004 | 533 | hiro | {
|
| 2005 | 533 | hiro | PrefsUIData *ui_data; |
| 2006 | 533 | hiro | SMTPAuthType type = *((SMTPAuthType *)pparam->data); |
| 2007 | 533 | hiro | GtkOptionMenu *optmenu; |
| 2008 | 533 | hiro | GtkWidget *menu; |
| 2009 | 533 | hiro | GtkWidget *menuitem; |
| 2010 | 533 | hiro | |
| 2011 | 533 | hiro | ui_data = (PrefsUIData *)pparam->ui_data; |
| 2012 | 533 | hiro | g_return_if_fail(ui_data != NULL);
|
| 2013 | 533 | hiro | g_return_if_fail(*ui_data->widget != NULL);
|
| 2014 | 533 | hiro | |
| 2015 | 533 | hiro | optmenu = GTK_OPTION_MENU(*ui_data->widget); |
| 2016 | 533 | hiro | |
| 2017 | 533 | hiro | switch (type) {
|
| 2018 | 533 | hiro | case SMTPAUTH_PLAIN:
|
| 2019 | 533 | hiro | gtk_option_menu_set_history(optmenu, 1);
|
| 2020 | 533 | hiro | break;
|
| 2021 | 533 | hiro | case SMTPAUTH_LOGIN:
|
| 2022 | 533 | hiro | gtk_option_menu_set_history(optmenu, 2);
|
| 2023 | 533 | hiro | break;
|
| 2024 | 533 | hiro | case SMTPAUTH_CRAM_MD5:
|
| 2025 | 533 | hiro | gtk_option_menu_set_history(optmenu, 3);
|
| 2026 | 533 | hiro | break;
|
| 2027 | 533 | hiro | case SMTPAUTH_DIGEST_MD5:
|
| 2028 | 533 | hiro | gtk_option_menu_set_history(optmenu, 4);
|
| 2029 | 533 | hiro | break;
|
| 2030 | 533 | hiro | case 0: |
| 2031 | 533 | hiro | default:
|
| 2032 | 533 | hiro | gtk_option_menu_set_history(optmenu, 0);
|
| 2033 | 533 | hiro | } |
| 2034 | 533 | hiro | |
| 2035 | 533 | hiro | menu = gtk_option_menu_get_menu(optmenu); |
| 2036 | 533 | hiro | menuitem = gtk_menu_get_active(GTK_MENU(menu)); |
| 2037 | 533 | hiro | gtk_menu_item_activate(GTK_MENU_ITEM(menuitem)); |
| 2038 | 533 | hiro | } |
| 2039 | 533 | hiro | |
| 2040 | 533 | hiro | static void prefs_account_protocol_activated(GtkMenuItem *menuitem) |
| 2041 | 533 | hiro | {
|
| 2042 | 533 | hiro | RecvProtocol protocol; |
| 2043 | 533 | hiro | gboolean active; |
| 2044 | 533 | hiro | PrefsAccount *tmp_ac_prefs; |
| 2045 | 533 | hiro | |
| 2046 | 533 | hiro | tmp_ac_prefs = prefs_account_get_tmp_prefs(); |
| 2047 | 533 | hiro | |
| 2048 | 533 | hiro | protocol = GPOINTER_TO_INT |
| 2049 | 533 | hiro | (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID)); |
| 2050 | 533 | hiro | |
| 2051 | 533 | hiro | switch(protocol) {
|
| 2052 | 533 | hiro | case A_NNTP:
|
| 2053 | 533 | hiro | gtk_widget_show(basic.nntpserv_label); |
| 2054 | 533 | hiro | gtk_widget_show(basic.nntpserv_entry); |
| 2055 | 533 | hiro | gtk_widget_show(basic.nntpauth_chkbtn); |
| 2056 | 533 | hiro | gtk_widget_hide(basic.recvserv_label); |
| 2057 | 533 | hiro | gtk_widget_hide(basic.recvserv_entry); |
| 2058 | 533 | hiro | gtk_widget_hide(basic.smtpserv_label); |
| 2059 | 533 | hiro | gtk_widget_hide(basic.smtpserv_entry); |
| 2060 | 533 | hiro | active = gtk_toggle_button_get_active |
| 2061 | 533 | hiro | (GTK_TOGGLE_BUTTON(basic.nntpauth_chkbtn)); |
| 2062 | 533 | hiro | gtk_widget_set_sensitive(basic.uid_label, active); |
| 2063 | 533 | hiro | gtk_widget_set_sensitive(basic.pass_label, active); |
| 2064 | 533 | hiro | gtk_widget_set_sensitive(basic.uid_entry, active); |
| 2065 | 533 | hiro | gtk_widget_set_sensitive(basic.pass_entry, active); |
| 2066 | 533 | hiro | gtk_widget_hide(receive.pop3_frame); |
| 2067 | 533 | hiro | gtk_widget_hide(receive.imap_frame); |
| 2068 | 533 | hiro | gtk_widget_show(receive.nntp_frame); |
| 2069 | 533 | hiro | gtk_widget_set_sensitive(receive.recvatgetall_chkbtn, TRUE); |
| 2070 | 533 | hiro | |
| 2071 | 533 | hiro | if (!tmp_ac_prefs->account_name) {
|
| 2072 | 533 | hiro | gtk_toggle_button_set_active |
| 2073 | 533 | hiro | (GTK_TOGGLE_BUTTON(receive.recvatgetall_chkbtn), |
| 2074 | 533 | hiro | FALSE); |
| 2075 | 533 | hiro | } |
| 2076 | 533 | hiro | |
| 2077 | 533 | hiro | #if USE_SSL
|
| 2078 | 533 | hiro | gtk_widget_hide(ssl.pop_frame); |
| 2079 | 533 | hiro | gtk_widget_hide(ssl.imap_frame); |
| 2080 | 533 | hiro | gtk_widget_show(ssl.nntp_frame); |
| 2081 | 533 | hiro | gtk_widget_hide(ssl.send_frame); |
| 2082 | 533 | hiro | #endif
|
| 2083 | 533 | hiro | gtk_widget_hide(advanced.popport_hbox); |
| 2084 | 533 | hiro | gtk_widget_hide(advanced.imapport_hbox); |
| 2085 | 533 | hiro | gtk_widget_show(advanced.nntpport_hbox); |
| 2086 | 533 | hiro | gtk_widget_hide(advanced.imap_frame); |
| 2087 | 533 | hiro | break;
|
| 2088 | 533 | hiro | case A_LOCAL:
|
| 2089 | 533 | hiro | gtk_widget_hide(basic.nntpserv_label); |
| 2090 | 533 | hiro | gtk_widget_hide(basic.nntpserv_entry); |
| 2091 | 533 | hiro | gtk_widget_hide(basic.nntpauth_chkbtn); |
| 2092 | 533 | hiro | gtk_widget_set_sensitive(basic.recvserv_label, FALSE); |
| 2093 | 533 | hiro | gtk_widget_set_sensitive(basic.recvserv_entry, FALSE); |
| 2094 | 533 | hiro | gtk_widget_show(basic.recvserv_label); |
| 2095 | 533 | hiro | gtk_widget_show(basic.recvserv_entry); |
| 2096 | 533 | hiro | gtk_widget_show(basic.smtpserv_label); |
| 2097 | 533 | hiro | gtk_widget_show(basic.smtpserv_entry); |
| 2098 | 533 | hiro | gtk_widget_set_sensitive(basic.uid_label, FALSE); |
| 2099 | 533 | hiro | gtk_widget_set_sensitive(basic.pass_label, FALSE); |
| 2100 | 533 | hiro | gtk_widget_set_sensitive(basic.uid_entry, FALSE); |
| 2101 | 533 | hiro | gtk_widget_set_sensitive(basic.pass_entry, FALSE); |
| 2102 | 533 | hiro | gtk_widget_hide(receive.pop3_frame); |
| 2103 | 533 | hiro | gtk_widget_hide(receive.imap_frame); |
| 2104 | 533 | hiro | gtk_widget_hide(receive.nntp_frame); |
| 2105 | 533 | hiro | gtk_widget_set_sensitive(receive.recvatgetall_chkbtn, FALSE); |
| 2106 | 533 | hiro | |
| 2107 | 533 | hiro | if (!tmp_ac_prefs->account_name) {
|
| 2108 | 533 | hiro | gtk_toggle_button_set_active |
| 2109 | 533 | hiro | (GTK_TOGGLE_BUTTON(receive.recvatgetall_chkbtn), |
| 2110 | 533 | hiro | TRUE); |
| 2111 | 533 | hiro | } |
| 2112 | 533 | hiro | |
| 2113 | 533 | hiro | #if USE_SSL
|
| 2114 | 533 | hiro | gtk_widget_hide(ssl.pop_frame); |
| 2115 | 533 | hiro | gtk_widget_hide(ssl.imap_frame); |
| 2116 | 533 | hiro | gtk_widget_hide(ssl.nntp_frame); |
| 2117 | 533 | hiro | gtk_widget_show(ssl.send_frame); |
| 2118 | 533 | hiro | #endif
|
| 2119 | 533 | hiro | gtk_widget_hide(advanced.popport_hbox); |
| 2120 | 533 | hiro | gtk_widget_hide(advanced.imapport_hbox); |
| 2121 | 533 | hiro | gtk_widget_hide(advanced.nntpport_hbox); |
| 2122 | 533 | hiro | gtk_widget_hide(advanced.imap_frame); |
| 2123 | 533 | hiro | break;
|
| 2124 | 533 | hiro | case A_IMAP4:
|
| 2125 | 533 | hiro | gtk_widget_hide(basic.nntpserv_label); |
| 2126 | 533 | hiro | gtk_widget_hide(basic.nntpserv_entry); |
| 2127 | 533 | hiro | gtk_widget_hide(basic.nntpauth_chkbtn); |
| 2128 | 533 | hiro | gtk_widget_set_sensitive(basic.recvserv_label, TRUE); |
| 2129 | 533 | hiro | gtk_widget_set_sensitive(basic.recvserv_entry, TRUE); |
| 2130 | 533 | hiro | gtk_widget_show(basic.recvserv_label); |
| 2131 | 533 | hiro | gtk_widget_show(basic.recvserv_entry); |
| 2132 | 533 | hiro | gtk_widget_show(basic.smtpserv_label); |
| 2133 | 533 | hiro | gtk_widget_show(basic.smtpserv_entry); |
| 2134 | 533 | hiro | gtk_widget_set_sensitive(basic.uid_label, TRUE); |
| 2135 | 533 | hiro | gtk_widget_set_sensitive(basic.pass_label, TRUE); |
| 2136 | 533 | hiro | gtk_widget_set_sensitive(basic.uid_entry, TRUE); |
| 2137 | 533 | hiro | gtk_widget_set_sensitive(basic.pass_entry, TRUE); |
| 2138 | 533 | hiro | gtk_widget_hide(receive.pop3_frame); |
| 2139 | 533 | hiro | gtk_widget_show(receive.imap_frame); |
| 2140 | 533 | hiro | gtk_widget_hide(receive.nntp_frame); |
| 2141 | 533 | hiro | gtk_widget_set_sensitive(receive.recvatgetall_chkbtn, TRUE); |
| 2142 | 533 | hiro | |
| 2143 | 533 | hiro | if (!tmp_ac_prefs->account_name) {
|
| 2144 | 533 | hiro | gtk_toggle_button_set_active |
| 2145 | 533 | hiro | (GTK_TOGGLE_BUTTON(receive.recvatgetall_chkbtn), |
| 2146 | 533 | hiro | FALSE); |
| 2147 | 533 | hiro | } |
| 2148 | 533 | hiro | |
| 2149 | 533 | hiro | #if USE_SSL
|
| 2150 | 533 | hiro | gtk_widget_hide(ssl.pop_frame); |
| 2151 | 533 | hiro | gtk_widget_show(ssl.imap_frame); |
| 2152 | 533 | hiro | gtk_widget_hide(ssl.nntp_frame); |
| 2153 | 533 | hiro | gtk_widget_show(ssl.send_frame); |
| 2154 | 533 | hiro | #endif
|
| 2155 | 533 | hiro | gtk_widget_hide(advanced.popport_hbox); |
| 2156 | 533 | hiro | gtk_widget_show(advanced.imapport_hbox); |
| 2157 | 533 | hiro | gtk_widget_hide(advanced.nntpport_hbox); |
| 2158 | 533 | hiro | gtk_widget_show(advanced.imap_frame); |
| 2159 | 533 | hiro | break;
|
| 2160 | 533 | hiro | case A_POP3:
|
| 2161 | 533 | hiro | default:
|
| 2162 | 533 | hiro | gtk_widget_hide(basic.nntpserv_label); |
| 2163 | 533 | hiro | gtk_widget_hide(basic.nntpserv_entry); |
| 2164 | 533 | hiro | gtk_widget_hide(basic.nntpauth_chkbtn); |
| 2165 | 533 | hiro | gtk_widget_set_sensitive(basic.recvserv_label, TRUE); |
| 2166 | 533 | hiro | gtk_widget_set_sensitive(basic.recvserv_entry, TRUE); |
| 2167 | 533 | hiro | gtk_widget_show(basic.recvserv_label); |
| 2168 | 533 | hiro | gtk_widget_show(basic.recvserv_entry); |
| 2169 | 533 | hiro | gtk_widget_show(basic.smtpserv_label); |
| 2170 | 533 | hiro | gtk_widget_show(basic.smtpserv_entry); |
| 2171 | 533 | hiro | gtk_widget_set_sensitive(basic.uid_label, TRUE); |
| 2172 | 533 | hiro | gtk_widget_set_sensitive(basic.pass_label, TRUE); |
| 2173 | 533 | hiro | gtk_widget_set_sensitive(basic.uid_entry, TRUE); |
| 2174 | 533 | hiro | gtk_widget_set_sensitive(basic.pass_entry, TRUE); |
| 2175 | 533 | hiro | gtk_widget_show(receive.pop3_frame); |
| 2176 | 533 | hiro | gtk_widget_hide(receive.imap_frame); |
| 2177 | 533 | hiro | gtk_widget_hide(receive.nntp_frame); |
| 2178 | 533 | hiro | gtk_widget_set_sensitive(receive.recvatgetall_chkbtn, TRUE); |
| 2179 | 533 | hiro | |
| 2180 | 533 | hiro | if (!tmp_ac_prefs->account_name) {
|
| 2181 | 533 | hiro | gtk_toggle_button_set_active |
| 2182 | 533 | hiro | (GTK_TOGGLE_BUTTON(receive.recvatgetall_chkbtn), |
| 2183 | 533 | hiro | TRUE); |
| 2184 | 533 | hiro | } |
| 2185 | 533 | hiro | |
| 2186 | 533 | hiro | #if USE_SSL
|
| 2187 | 533 | hiro | gtk_widget_show(ssl.pop_frame); |
| 2188 | 533 | hiro | gtk_widget_hide(ssl.imap_frame); |
| 2189 | 533 | hiro | gtk_widget_hide(ssl.nntp_frame); |
| 2190 | 533 | hiro | gtk_widget_show(ssl.send_frame); |
| 2191 | 533 | hiro | #endif
|
| 2192 | 533 | hiro | gtk_widget_show(advanced.popport_hbox); |
| 2193 | 533 | hiro | gtk_widget_hide(advanced.imapport_hbox); |
| 2194 | 533 | hiro | gtk_widget_hide(advanced.nntpport_hbox); |
| 2195 | 533 | hiro | gtk_widget_hide(advanced.imap_frame); |
| 2196 | 533 | hiro | break;
|
| 2197 | 533 | hiro | } |
| 2198 | 533 | hiro | |
| 2199 | 533 | hiro | gtk_widget_queue_resize(basic.serv_frame); |
| 2200 | 533 | hiro | } |