2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2003 Hiroyuki Yamamoto
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 #include <gdk/gdkkeysyms.h>
33 #include <sys/types.h>
39 #include "prefs_gtk.h"
40 #include "prefs_common.h"
41 #include "prefs_display_header.h"
42 #include "prefs_summary_column.h"
43 #include "mainwindow.h"
44 #include "summaryview.h"
45 #include "messageview.h"
46 #include "manage_window.h"
52 #include "alertpanel.h"
55 #include "folderview.h"
56 #include "stock_pixmap.h"
57 #include "quote_fmt.h"
60 #include "gtkaspell.h"
63 PrefsCommon prefs_common;
65 static PrefsDialog dialog;
67 static struct Receive {
68 GtkWidget *checkbtn_incext;
69 GtkWidget *entry_incext;
70 GtkWidget *button_incext;
72 GtkWidget *checkbtn_local;
73 GtkWidget *checkbtn_filter_on_inc;
74 GtkWidget *entry_spool;
76 GtkWidget *checkbtn_autochk;
77 GtkWidget *spinbtn_autochk;
78 GtkObject *spinbtn_autochk_adj;
80 GtkWidget *checkbtn_chkonstartup;
81 GtkWidget *checkbtn_scan_after_inc;
84 GtkWidget *checkbtn_newmail_auto;
85 GtkWidget *checkbtn_newmail_manu;
86 GtkWidget *entry_newmail_notify_cmd;
87 GtkWidget *hbox_newmail_notify;
91 GtkWidget *checkbtn_extsend;
92 GtkWidget *entry_extsend;
93 GtkWidget *button_extsend;
95 GtkWidget *checkbtn_savemsg;
96 GtkWidget *checkbtn_queuemsg;
98 GtkWidget *optmenu_charset;
99 GtkWidget *optmenu_encoding_method;
102 static struct Compose {
103 GtkWidget *entry_fw_quotemark;
104 GtkWidget *text_fw_quotefmt;
106 GtkWidget *checkbtn_autoextedit;
107 GtkWidget *spinbtn_undolevel;
108 GtkObject *spinbtn_undolevel_adj;
109 GtkWidget *spinbtn_linewrap;
110 GtkObject *spinbtn_linewrap_adj;
111 GtkWidget *checkbtn_wrapquote;
112 GtkWidget *checkbtn_autowrap;
113 GtkWidget *checkbtn_wrapatsend;
115 GtkWidget *checkbtn_reply_account_autosel;
116 GtkWidget *checkbtn_forward_account_autosel;
117 GtkWidget *checkbtn_reedit_account_autosel;
118 GtkWidget *checkbtn_quote;
119 GtkWidget *checkbtn_default_reply_list;
120 GtkWidget *checkbtn_forward_as_attachment;
121 GtkWidget *checkbtn_redirect_keep_from;
122 GtkWidget *checkbtn_smart_wrapping;
123 GtkWidget *checkbtn_block_cursor;
124 GtkWidget *checkbtn_reply_with_quote;
126 GtkWidget *checkbtn_autosave;
127 GtkWidget *entry_autosave_length;
132 static struct Spelling {
133 GtkWidget *checkbtn_enable_aspell;
134 GtkWidget *entry_aspell_path;
135 GtkWidget *btn_aspell_path;
136 GtkWidget *optmenu_dictionary;
137 GtkWidget *optmenu_sugmode;
138 GtkWidget *misspelled_btn;
139 GtkWidget *checkbtn_use_alternate;
140 GtkWidget *checkbtn_check_while_typing;
144 static struct Quote {
145 GtkWidget *entry_quotemark;
146 GtkWidget *text_quotefmt;
148 GtkWidget *entry_fw_quotemark;
149 GtkWidget *text_fw_quotefmt;
151 GtkWidget *entry_quote_chars;
154 static struct Display {
155 GtkWidget *entry_textfont;
156 GtkWidget *button_textfont;
158 GtkWidget *entry_smallfont;
159 GtkWidget *entry_normalfont;
160 GtkWidget *entry_boldfont;
162 GtkWidget *chkbtn_folder_unread;
163 GtkWidget *entry_ng_abbrev_len;
164 GtkWidget *spinbtn_ng_abbrev_len;
165 GtkObject *spinbtn_ng_abbrev_len_adj;
167 GtkWidget *chkbtn_transhdr;
169 GtkWidget *chkbtn_swapfrom;
170 GtkWidget *chkbtn_useaddrbook;
171 GtkWidget *chkbtn_threadsubj;
172 GtkWidget *entry_datefmt;
175 static struct Message {
176 GtkWidget *chkbtn_enablecol;
177 GtkWidget *button_edit_col;
178 GtkWidget *chkbtn_mbalnum;
179 GtkWidget *chkbtn_disphdrpane;
180 GtkWidget *chkbtn_disphdr;
181 GtkWidget *spinbtn_linespc;
182 GtkObject *spinbtn_linespc_adj;
183 GtkWidget *chkbtn_headspc;
185 GtkWidget *chkbtn_smoothscroll;
186 GtkWidget *spinbtn_scrollstep;
187 GtkObject *spinbtn_scrollstep_adj;
188 GtkWidget *chkbtn_halfpage;
190 GtkWidget *chkbtn_display_img;
191 GtkWidget *chkbtn_resize_image;
193 GtkWidget *chkbtn_attach_desc;
197 static struct Privacy {
198 GtkWidget *checkbtn_auto_check_signatures;
199 GtkWidget *checkbtn_gpg_signature_popup;
200 GtkWidget *checkbtn_store_passphrase;
201 GtkWidget *spinbtn_store_passphrase;
202 GtkObject *spinbtn_store_passphrase_adj;
203 GtkWidget *checkbtn_passphrase_grab;
204 GtkWidget *checkbtn_gpg_warning;
208 static struct Interface {
209 /* GtkWidget *checkbtn_emacs; */
210 GtkWidget *checkbtn_show_msg_with_cursor;
211 GtkWidget *checkbtn_openunread;
212 GtkWidget *checkbtn_mark_as_read_on_newwin;
213 GtkWidget *checkbtn_openinbox;
214 GtkWidget *checkbtn_immedexec;
215 GtkWidget *optmenu_recvdialog;
216 GtkWidget *optmenu_senddialog;
217 GtkWidget *checkbtn_no_recv_err_panel;
218 GtkWidget *checkbtn_close_recv_dialog;
219 GtkWidget *optmenu_nextunreadmsgdialog;
220 GtkWidget *entry_pixmap_theme;
221 GtkWidget *combo_pixmap_theme;
224 static struct Other {
225 GtkWidget *uri_combo;
226 GtkWidget *uri_entry;
227 GtkWidget *printcmd_entry;
228 GtkWidget *exteditor_combo;
229 GtkWidget *exteditor_entry;
230 GtkWidget *checkbtn_addaddrbyclick;
231 GtkWidget *checkbtn_confonexit;
232 GtkWidget *checkbtn_cleanonexit;
233 GtkWidget *checkbtn_askonclean;
234 GtkWidget *checkbtn_warnqueued;
235 GtkWidget *checkbtn_cliplog;
236 GtkWidget *loglength_entry;
239 GtkWidget *checkbtn_ssl_ask_unknown_valid;
245 static struct MessageColorButtons {
246 GtkWidget *quote_level1_btn;
247 GtkWidget *quote_level2_btn;
248 GtkWidget *quote_level3_btn;
250 GtkWidget *tgt_folder_btn;
251 GtkWidget *signature_btn;
254 static struct KeybindDialog {
259 static GtkWidget *font_sel_win;
260 static guint font_sel_conn_id;
261 static GtkWidget *quote_color_win;
262 static GtkWidget *color_dialog;
264 static void prefs_common_charset_set_data_from_optmenu (PrefParam *pparam);
265 static void prefs_common_charset_set_optmenu (PrefParam *pparam);
266 static void prefs_common_encoding_set_data_from_optmenu (PrefParam *pparam);
267 static void prefs_common_encoding_set_optmenu (PrefParam *pparam);
268 static void prefs_common_recv_dialog_set_data_from_optmenu (PrefParam *pparam);
269 static void prefs_common_recv_dialog_set_optmenu (PrefParam *pparam);
270 static void prefs_common_recv_dialog_newmail_notify_toggle_cb (GtkWidget *w,
272 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam);
273 static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam);
274 static void prefs_common_send_dialog_set_data_from_optmenu(PrefParam *pparam);
275 static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam);
276 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam);
277 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam);
280 static void prefs_dictionary_set_data_from_optmenu (PrefParam *param);
281 static void prefs_dictionary_set_optmenu (PrefParam *pparam);
282 static void prefs_speller_sugmode_set_data_from_optmenu (PrefParam *pparam);
283 static void prefs_speller_sugmode_set_optmenu (PrefParam *pparam);
288 parameter name, default value, pointer to the prefs variable, data type,
289 pointer to the widget pointer,
290 pointer to the function for data setting,
291 pointer to the function for widget setting
294 static PrefParam param[] = {
296 {"use_ext_inc", "FALSE", &prefs_common.use_extinc, P_BOOL,
297 &receive.checkbtn_incext,
298 prefs_set_data_from_toggle, prefs_set_toggle},
299 {"ext_inc_path", DEFAULT_INC_PATH, &prefs_common.extinc_cmd, P_STRING,
300 &receive.entry_incext,
301 prefs_set_data_from_entry, prefs_set_entry},
303 {"inc_local", "TRUE", &prefs_common.inc_local, P_BOOL,
304 &receive.checkbtn_local,
305 prefs_set_data_from_toggle, prefs_set_toggle},
306 {"filter_on_inc_local", "TRUE", &prefs_common.filter_on_inc, P_BOOL,
307 &receive.checkbtn_filter_on_inc,
308 prefs_set_data_from_toggle, prefs_set_toggle},
309 {"spool_path", DEFAULT_SPOOL_PATH, &prefs_common.spool_path, P_STRING,
310 &receive.entry_spool,
311 prefs_set_data_from_entry, prefs_set_entry},
313 {"autochk_newmail", "FALSE", &prefs_common.autochk_newmail, P_BOOL,
314 &receive.checkbtn_autochk,
315 prefs_set_data_from_toggle, prefs_set_toggle},
316 {"autochk_interval", "10", &prefs_common.autochk_itv, P_INT,
317 &receive.spinbtn_autochk,
318 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
319 {"check_on_startup", "FALSE", &prefs_common.chk_on_startup, P_BOOL,
320 &receive.checkbtn_chkonstartup,
321 prefs_set_data_from_toggle, prefs_set_toggle},
322 {"scan_all_after_inc", "FALSE", &prefs_common.scan_all_after_inc,
323 P_BOOL, &receive.checkbtn_scan_after_inc,
324 prefs_set_data_from_toggle, prefs_set_toggle},
325 {"newmail_notify_manu", "FALSE", &prefs_common.newmail_notify_manu,
326 P_BOOL, &receive.checkbtn_newmail_manu,
327 prefs_set_data_from_toggle, prefs_set_toggle},
328 {"newmail_notify_auto", "FALSE", &prefs_common.newmail_notify_auto,
329 P_BOOL, &receive.checkbtn_newmail_auto,
330 prefs_set_data_from_toggle, prefs_set_toggle},
331 {"newmail_notify_cmd", "", &prefs_common.newmail_notify_cmd, P_STRING,
332 &receive.entry_newmail_notify_cmd,
333 prefs_set_data_from_entry, prefs_set_entry},
336 {"use_ext_sendmail", "FALSE", &prefs_common.use_extsend, P_BOOL,
337 &p_send.checkbtn_extsend,
338 prefs_set_data_from_toggle, prefs_set_toggle},
339 {"ext_sendmail_cmd", DEFAULT_SENDMAIL_CMD,
340 &prefs_common.extsend_cmd, P_STRING,
341 &p_send.entry_extsend, prefs_set_data_from_entry, prefs_set_entry},
342 {"save_message", "TRUE", &prefs_common.savemsg, P_BOOL,
343 &p_send.checkbtn_savemsg,
344 prefs_set_data_from_toggle, prefs_set_toggle},
345 {"queue_message", "FALSE", &prefs_common.queue_msg, P_BOOL,
346 &p_send.checkbtn_queuemsg,
347 prefs_set_data_from_toggle, prefs_set_toggle},
349 {"outgoing_charset", CS_AUTO, &prefs_common.outgoing_charset, P_STRING,
350 &p_send.optmenu_charset,
351 prefs_common_charset_set_data_from_optmenu,
352 prefs_common_charset_set_optmenu},
353 {"encoding_method", "0", &prefs_common.encoding_method, P_ENUM,
354 &p_send.optmenu_encoding_method,
355 prefs_common_encoding_set_data_from_optmenu,
356 prefs_common_encoding_set_optmenu},
359 {"auto_ext_editor", "FALSE", &prefs_common.auto_exteditor, P_BOOL,
360 &compose.checkbtn_autoextedit,
361 prefs_set_data_from_toggle, prefs_set_toggle},
362 {"forward_as_attachment", "FALSE", &prefs_common.forward_as_attachment,
363 P_BOOL, &compose.checkbtn_forward_as_attachment,
364 prefs_set_data_from_toggle, prefs_set_toggle},
365 {"redirect_keep_from", "FALSE",
366 &prefs_common.redirect_keep_from, P_BOOL,
367 &compose.checkbtn_redirect_keep_from,
368 prefs_set_data_from_toggle, prefs_set_toggle},
369 {"undo_level", "50", &prefs_common.undolevels, P_INT,
370 &compose.spinbtn_undolevel,
371 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
372 {"block_cursor", "FALSE", &prefs_common.block_cursor,
373 P_BOOL, &compose.checkbtn_block_cursor,
374 prefs_set_data_from_toggle, prefs_set_toggle},
376 {"linewrap_length", "72", &prefs_common.linewrap_len, P_INT,
377 &compose.spinbtn_linewrap,
378 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
379 {"linewrap_quotation", "FALSE", &prefs_common.linewrap_quote, P_BOOL,
380 &compose.checkbtn_wrapquote,
381 prefs_set_data_from_toggle, prefs_set_toggle},
382 {"linewrap_auto", "FALSE", &prefs_common.autowrap, P_BOOL,
383 &compose.checkbtn_autowrap,
384 prefs_set_data_from_toggle, prefs_set_toggle},
385 {"linewrap_before_sending", "FALSE",
386 &prefs_common.linewrap_at_send, P_BOOL,
387 &compose.checkbtn_wrapatsend,
388 prefs_set_data_from_toggle, prefs_set_toggle},
389 {"smart_wrapping", "TRUE", &prefs_common.smart_wrapping,
390 P_BOOL, &compose.checkbtn_smart_wrapping,
391 prefs_set_data_from_toggle, prefs_set_toggle},
392 {"autosave", "FALSE", &prefs_common.autosave,
393 P_BOOL, &compose.checkbtn_autosave,
394 prefs_set_data_from_toggle, prefs_set_toggle},
395 {"autosave_length", "50", &prefs_common.autosave_length,
396 P_INT, &compose.entry_autosave_length,
397 prefs_set_data_from_entry, prefs_set_entry},
399 {"enable_aspell", "TRUE", &prefs_common.enable_aspell,
400 P_BOOL, &spelling.checkbtn_enable_aspell,
401 prefs_set_data_from_toggle, prefs_set_toggle},
402 {"aspell_path", ASPELL_PATH, &prefs_common.aspell_path,
403 P_STRING, &spelling.entry_aspell_path,
404 prefs_set_data_from_entry, prefs_set_entry},
405 {"dictionary", "", &prefs_common.dictionary,
406 P_STRING, &spelling.optmenu_dictionary,
407 prefs_dictionary_set_data_from_optmenu, prefs_dictionary_set_optmenu },
408 {"aspell_sugmode", "1", &prefs_common.aspell_sugmode,
409 P_INT, &spelling.optmenu_sugmode,
410 prefs_speller_sugmode_set_data_from_optmenu, prefs_speller_sugmode_set_optmenu },
411 {"use_alternate_dict", "FALSE", &prefs_common.use_alternate,
412 P_BOOL, &spelling.checkbtn_use_alternate,
413 prefs_set_data_from_toggle, prefs_set_toggle},
414 {"check_while_typing", "TRUE", &prefs_common.check_while_typing,
415 P_BOOL, &spelling.checkbtn_check_while_typing,
416 prefs_set_data_from_toggle, prefs_set_toggle},
417 {"misspelled_color", "16711680", &prefs_common.misspelled_col, P_COLOR,
420 {"reply_with_quote", "TRUE", &prefs_common.reply_with_quote, P_BOOL,
421 &compose.checkbtn_reply_with_quote, prefs_set_data_from_toggle, prefs_set_toggle},
423 /* Account autoselection */
424 {"reply_account_autoselect", "TRUE",
425 &prefs_common.reply_account_autosel, P_BOOL,
426 &compose.checkbtn_reply_account_autosel,
427 prefs_set_data_from_toggle, prefs_set_toggle},
428 {"forward_account_autoselect", "TRUE",
429 &prefs_common.forward_account_autosel, P_BOOL,
430 &compose.checkbtn_forward_account_autosel,
431 prefs_set_data_from_toggle, prefs_set_toggle},
432 {"reedit_account_autoselect", "TRUE",
433 &prefs_common.reedit_account_autosel, P_BOOL,
434 &compose.checkbtn_reedit_account_autosel,
435 prefs_set_data_from_toggle, prefs_set_toggle},
437 {"default_reply_list", "TRUE", &prefs_common.default_reply_list, P_BOOL,
438 &compose.checkbtn_default_reply_list,
439 prefs_set_data_from_toggle, prefs_set_toggle},
441 {"show_ruler", "TRUE", &prefs_common.show_ruler, P_BOOL,
445 {"reply_quote_mark", "> ", &prefs_common.quotemark, P_STRING,
446 "e.entry_quotemark, prefs_set_data_from_entry, prefs_set_entry},
447 {"reply_quote_format", "On %d\\n%f wrote:\\n\\n%Q",
448 &prefs_common.quotefmt, P_STRING, "e.text_quotefmt,
449 prefs_set_data_from_text, prefs_set_text},
451 {"forward_quote_mark", "> ", &prefs_common.fw_quotemark, P_STRING,
452 "e.entry_fw_quotemark,
453 prefs_set_data_from_entry, prefs_set_entry},
454 {"forward_quote_format",
455 "\\n\\nBegin forwarded message:\\n\\n"
456 "?d{Date: %d\\n}?f{From: %f\\n}?t{To: %t\\n}?c{Cc: %c\\n}"
457 "?n{Newsgroups: %n\\n}?s{Subject: %s\\n}\\n\\n%M",
458 &prefs_common.fw_quotefmt, P_STRING, "e.text_fw_quotefmt,
459 prefs_set_data_from_text, prefs_set_text},
460 {"quote_chars", ">", &prefs_common.quote_chars, P_STRING,
461 "e.entry_quote_chars, prefs_set_data_from_entry, prefs_set_entry},
464 {"widget_font", NULL, &prefs_common.widgetfont, P_STRING,
466 {"message_font", "-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*",
467 &prefs_common.textfont, P_STRING,
468 &display.entry_textfont,
469 prefs_set_data_from_entry, prefs_set_entry},
470 {"small_font", "-*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*",
471 &prefs_common.smallfont, P_STRING,
472 &display.entry_smallfont,
473 prefs_set_data_from_entry, prefs_set_entry},
474 {"bold_font", "-*-helvetica-bold-r-normal--12-*-*-*-*-*-*-*",
475 &prefs_common.boldfont, P_STRING,
476 &display.entry_boldfont,
477 prefs_set_data_from_entry, prefs_set_entry},
478 {"normal_font", "-*-helvetica-medium-r-normal--12-*-*-*-*-*-*-*",
479 &prefs_common.normalfont, P_STRING,
480 &display.entry_normalfont,
481 prefs_set_data_from_entry, prefs_set_entry},
484 {"display_folder_unread_num", "TRUE",
485 &prefs_common.display_folder_unread, P_BOOL,
486 &display.chkbtn_folder_unread,
487 prefs_set_data_from_toggle, prefs_set_toggle},
488 {"newsgroup_abbrev_len", "16",
489 &prefs_common.ng_abbrev_len, P_INT,
490 &display.spinbtn_ng_abbrev_len,
491 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
493 {"translate_header", "TRUE", &prefs_common.trans_hdr, P_BOOL,
494 &display.chkbtn_transhdr,
495 prefs_set_data_from_toggle, prefs_set_toggle},
497 /* Display: Summary View */
498 {"enable_swap_from", "FALSE", &prefs_common.swap_from, P_BOOL,
499 &display.chkbtn_swapfrom,
500 prefs_set_data_from_toggle, prefs_set_toggle},
501 {"use_address_book", "TRUE", &prefs_common.use_addr_book, P_BOOL,
502 &display.chkbtn_useaddrbook,
503 prefs_set_data_from_toggle, prefs_set_toggle},
504 {"thread_by_subject", "TRUE", &prefs_common.thread_by_subject, P_BOOL,
505 &display.chkbtn_threadsubj,
506 prefs_set_data_from_toggle, prefs_set_toggle},
507 {"date_format", "%y/%m/%d(%a) %H:%M", &prefs_common.date_format,
508 P_STRING, &display.entry_datefmt,
509 prefs_set_data_from_entry, prefs_set_entry},
511 {"enable_hscrollbar", "TRUE", &prefs_common.enable_hscrollbar, P_BOOL,
513 {"bold_unread", "TRUE", &prefs_common.bold_unread, P_BOOL,
516 {"enable_thread", "TRUE", &prefs_common.enable_thread, P_BOOL,
518 {"toolbar_style", "3", &prefs_common.toolbar_style, P_ENUM,
520 {"show_statusbar", "TRUE", &prefs_common.show_statusbar, P_BOOL,
522 {"show_searchbar", "TRUE", &prefs_common.show_searchbar, P_BOOL,
525 {"folderview_vscrollbar_policy", "0",
526 &prefs_common.folderview_vscrollbar_policy, P_ENUM,
529 {"summary_col_show_mark", "TRUE",
530 &prefs_common.summary_col_visible[S_COL_MARK], P_BOOL, NULL, NULL, NULL},
531 {"summary_col_show_unread", "TRUE",
532 &prefs_common.summary_col_visible[S_COL_STATUS], P_BOOL, NULL, NULL, NULL},
533 {"summary_col_show_mime", "TRUE",
534 &prefs_common.summary_col_visible[S_COL_MIME], P_BOOL, NULL, NULL, NULL},
535 {"summary_col_show_subject", "TRUE",
536 &prefs_common.summary_col_visible[S_COL_SUBJECT], P_BOOL, NULL, NULL, NULL},
537 {"summary_col_show_from", "TRUE",
538 &prefs_common.summary_col_visible[S_COL_FROM], P_BOOL, NULL, NULL, NULL},
539 {"summary_col_show_date", "TRUE",
540 &prefs_common.summary_col_visible[S_COL_DATE], P_BOOL, NULL, NULL, NULL},
541 {"summary_col_show_size", "TRUE",
542 &prefs_common.summary_col_visible[S_COL_SIZE], P_BOOL, NULL, NULL, NULL},
543 {"summary_col_show_number", "FALSE",
544 &prefs_common.summary_col_visible[S_COL_NUMBER], P_BOOL, NULL, NULL, NULL},
545 {"summary_col_show_score", "FALSE",
546 &prefs_common.summary_col_visible[S_COL_SCORE], P_BOOL, NULL, NULL, NULL},
547 {"summary_col_show_locked", "FALSE",
548 &prefs_common.summary_col_visible[S_COL_LOCKED], P_BOOL, NULL, NULL, NULL},
550 {"summary_col_pos_mark", "0",
551 &prefs_common.summary_col_pos[S_COL_MARK], P_INT, NULL, NULL, NULL},
552 {"summary_col_pos_unread", "1",
553 &prefs_common.summary_col_pos[S_COL_STATUS], P_INT, NULL, NULL, NULL},
554 {"summary_col_pos_mime", "2",
555 &prefs_common.summary_col_pos[S_COL_MIME], P_INT, NULL, NULL, NULL},
556 {"summary_col_pos_subject", "3",
557 &prefs_common.summary_col_pos[S_COL_SUBJECT], P_INT, NULL, NULL, NULL},
558 {"summary_col_pos_from", "4",
559 &prefs_common.summary_col_pos[S_COL_FROM], P_INT, NULL, NULL, NULL},
560 {"summary_col_pos_date", "5",
561 &prefs_common.summary_col_pos[S_COL_DATE], P_INT, NULL, NULL, NULL},
562 {"summary_col_pos_size", "6",
563 &prefs_common.summary_col_pos[S_COL_SIZE], P_INT, NULL, NULL, NULL},
564 {"summary_col_pos_number", "7",
565 &prefs_common.summary_col_pos[S_COL_NUMBER], P_INT, NULL, NULL, NULL},
566 {"summary_col_pos_score", "8",
567 &prefs_common.summary_col_pos[S_COL_SCORE], P_INT, NULL, NULL, NULL},
568 {"summary_col_pos_locked", "9",
569 &prefs_common.summary_col_pos[S_COL_LOCKED], P_INT, NULL, NULL, NULL},
571 {"summary_col_size_mark", "10",
572 &prefs_common.summary_col_size[S_COL_MARK], P_INT, NULL, NULL, NULL},
573 {"summary_col_size_unread", "13",
574 &prefs_common.summary_col_size[S_COL_STATUS], P_INT, NULL, NULL, NULL},
575 {"summary_col_size_mime", "10",
576 &prefs_common.summary_col_size[S_COL_MIME], P_INT, NULL, NULL, NULL},
577 {"summary_col_size_subject", "200",
578 &prefs_common.summary_col_size[S_COL_SUBJECT], P_INT, NULL, NULL, NULL},
579 {"summary_col_size_from", "120",
580 &prefs_common.summary_col_size[S_COL_FROM], P_INT, NULL, NULL, NULL},
581 {"summary_col_size_date", "118",
582 &prefs_common.summary_col_size[S_COL_DATE], P_INT, NULL, NULL, NULL},
583 {"summary_col_size_size", "45",
584 &prefs_common.summary_col_size[S_COL_SIZE], P_INT, NULL, NULL, NULL},
585 {"summary_col_size_number", "40",
586 &prefs_common.summary_col_size[S_COL_NUMBER], P_INT, NULL, NULL, NULL},
587 {"summary_col_size_score", "40",
588 &prefs_common.summary_col_size[S_COL_SCORE], P_INT, NULL, NULL, NULL},
589 {"summary_col_size_locked", "13",
590 &prefs_common.summary_col_size[S_COL_LOCKED], P_INT, NULL, NULL, NULL},
593 {"folderview_width", "179", &prefs_common.folderview_width, P_INT,
595 {"folderview_height", "600", &prefs_common.folderview_height, P_INT,
597 {"folder_col_folder", "150", &prefs_common.folder_col_folder, P_INT,
599 {"folder_col_new", "32", &prefs_common.folder_col_new, P_INT,
601 {"folder_col_unread", "32", &prefs_common.folder_col_unread, P_INT,
603 {"folder_col_total", "32", &prefs_common.folder_col_total, P_INT,
606 {"summaryview_width", "600", &prefs_common.summaryview_width, P_INT,
608 {"summaryview_height", "173", &prefs_common.summaryview_height, P_INT,
611 {"mainview_x", "64", &prefs_common.mainview_x, P_INT,
613 {"mainview_y", "64", &prefs_common.mainview_y, P_INT,
615 {"mainview_width", "600", &prefs_common.mainview_width, P_INT,
617 {"mainview_height", "600", &prefs_common.mainview_height, P_INT,
619 {"mainwin_x", "64", &prefs_common.mainwin_x, P_INT,
621 {"mainwin_y", "64", &prefs_common.mainwin_y, P_INT,
623 {"mainwin_width", "800", &prefs_common.mainwin_width, P_INT,
625 {"mainwin_height", "600", &prefs_common.mainwin_height, P_INT,
627 {"messagewin_width", "600", &prefs_common.msgwin_width, P_INT,
629 {"messagewin_height", "540", &prefs_common.msgwin_height, P_INT,
631 {"sourcewin_width", "600", &prefs_common.sourcewin_width, P_INT,
633 {"sourcewin_height", "500", &prefs_common.sourcewin_height, P_INT,
635 {"compose_width", "600", &prefs_common.compose_width, P_INT,
637 {"compose_height", "560", &prefs_common.compose_height, P_INT,
641 {"enable_color", "TRUE", &prefs_common.enable_color, P_BOOL,
642 &message.chkbtn_enablecol,
643 prefs_set_data_from_toggle, prefs_set_toggle},
645 {"quote_level1_color", "179", &prefs_common.quote_level1_col, P_COLOR,
647 {"quote_level2_color", "179", &prefs_common.quote_level2_col, P_COLOR,
649 {"quote_level3_color", "179", &prefs_common.quote_level3_col, P_COLOR,
651 {"uri_color", "32512", &prefs_common.uri_col, P_COLOR,
653 {"target_folder_color", "14294218", &prefs_common.tgt_folder_col, P_COLOR,
655 {"signature_color", "7960953", &prefs_common.signature_col, P_COLOR,
657 {"recycle_quote_colors", "FALSE", &prefs_common.recycle_quote_colors,
658 P_BOOL, NULL, NULL, NULL},
660 {"convert_mb_alnum", "FALSE", &prefs_common.conv_mb_alnum, P_BOOL,
661 &message.chkbtn_mbalnum,
662 prefs_set_data_from_toggle, prefs_set_toggle},
663 {"display_header_pane", "TRUE", &prefs_common.display_header_pane,
664 P_BOOL, &message.chkbtn_disphdrpane,
665 prefs_set_data_from_toggle, prefs_set_toggle},
666 {"display_header", "TRUE", &prefs_common.display_header, P_BOOL,
667 &message.chkbtn_disphdr,
668 prefs_set_data_from_toggle, prefs_set_toggle},
669 {"line_space", "2", &prefs_common.line_space, P_INT,
670 &message.spinbtn_linespc,
671 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
672 {"enable_head_space", "FALSE", &prefs_common.head_space, P_BOOL,
673 &message.chkbtn_headspc,
674 prefs_set_data_from_toggle, prefs_set_toggle},
676 {"enable_smooth_scroll", "FALSE",
677 &prefs_common.enable_smooth_scroll, P_BOOL,
678 &message.chkbtn_smoothscroll,
679 prefs_set_data_from_toggle, prefs_set_toggle},
680 {"scroll_step", "1", &prefs_common.scroll_step, P_INT,
681 &message.spinbtn_scrollstep,
682 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
683 {"scroll_half_page", "FALSE", &prefs_common.scroll_halfpage, P_BOOL,
684 &message.chkbtn_halfpage,
685 prefs_set_data_from_toggle, prefs_set_toggle},
687 {"display_img", "TRUE", &prefs_common.display_img, P_BOOL,
688 &message.chkbtn_display_img,
689 prefs_set_data_from_toggle, prefs_set_toggle},
690 {"resize_image", "TRUE", &prefs_common.resize_image, P_BOOL,
691 &message.chkbtn_resize_image,
692 prefs_set_data_from_toggle, prefs_set_toggle},
694 {"show_other_header", "FALSE", &prefs_common.show_other_header, P_BOOL,
697 {"attach_desc", "TRUE", &prefs_common.attach_desc, P_BOOL,
698 &message.chkbtn_attach_desc,
699 prefs_set_data_from_toggle, prefs_set_toggle},
702 {"mime_image_viewer", "display '%s'",
703 &prefs_common.mime_image_viewer, P_STRING, NULL, NULL, NULL},
704 {"mime_audio_player", "play '%s'",
705 &prefs_common.mime_audio_player, P_STRING, NULL, NULL, NULL},
706 {"mime_open_command", "gedit '%s'",
707 &prefs_common.mime_open_cmd, P_STRING, NULL, NULL, NULL},
711 {"auto_check_signatures", "TRUE",
712 &prefs_common.auto_check_signatures, P_BOOL,
713 &privacy.checkbtn_auto_check_signatures,
714 prefs_set_data_from_toggle, prefs_set_toggle},
715 {"gpg_signature_popup", "FALSE",
716 &prefs_common.gpg_signature_popup, P_BOOL,
717 &privacy.checkbtn_gpg_signature_popup,
718 prefs_set_data_from_toggle, prefs_set_toggle},
719 {"store_passphrase", "FALSE", &prefs_common.store_passphrase, P_BOOL,
720 &privacy.checkbtn_store_passphrase,
721 prefs_set_data_from_toggle, prefs_set_toggle},
722 {"store_passphrase_timeout", "0",
723 &prefs_common.store_passphrase_timeout, P_INT,
724 &privacy.spinbtn_store_passphrase,
725 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
727 {"passphrase_grab", "FALSE", &prefs_common.passphrase_grab, P_BOOL,
728 &privacy.checkbtn_passphrase_grab,
729 prefs_set_data_from_toggle, prefs_set_toggle},
730 #endif /* __MINGW32__ */
731 {"gpg_warning", "TRUE", &prefs_common.gpg_warning, P_BOOL,
732 &privacy.checkbtn_gpg_warning,
733 prefs_set_data_from_toggle, prefs_set_toggle},
734 #endif /* USE_GPGME */
737 {"separate_folder", "FALSE", &prefs_common.sep_folder, P_BOOL,
739 {"separate_message", "FALSE", &prefs_common.sep_msg, P_BOOL,
742 /* {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
743 NULL, NULL, NULL}, */
744 {"show_message_with_cursor_key", "FALSE",
745 &prefs_common.show_msg_with_cursor_key,
746 P_BOOL, &interface.checkbtn_show_msg_with_cursor,
747 prefs_set_data_from_toggle, prefs_set_toggle},
748 {"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
749 P_BOOL, &interface.checkbtn_openunread,
750 prefs_set_data_from_toggle, prefs_set_toggle},
751 {"mark_as_read_on_new_window", "FALSE",
752 &prefs_common.mark_as_read_on_new_window,
753 P_BOOL, &interface.checkbtn_mark_as_read_on_newwin,
754 prefs_set_data_from_toggle, prefs_set_toggle},
755 {"open_inbox_on_inc", "FALSE", &prefs_common.open_inbox_on_inc,
756 P_BOOL, &interface.checkbtn_openinbox,
757 prefs_set_data_from_toggle, prefs_set_toggle},
758 {"immediate_execution", "TRUE", &prefs_common.immediate_exec, P_BOOL,
759 &interface.checkbtn_immedexec,
760 prefs_set_data_from_toggle, prefs_set_toggle},
761 {"receive_dialog_mode", "1", &prefs_common.recv_dialog_mode, P_ENUM,
762 &interface.optmenu_recvdialog,
763 prefs_common_recv_dialog_set_data_from_optmenu,
764 prefs_common_recv_dialog_set_optmenu},
765 {"send_dialog_mode", "0", &prefs_common.send_dialog_mode, P_ENUM,
766 &interface.optmenu_senddialog,
767 prefs_common_send_dialog_set_data_from_optmenu,
768 prefs_common_send_dialog_set_optmenu},
769 {"no_receive_error_panel", "FALSE", &prefs_common.no_recv_err_panel,
770 P_BOOL, &interface.checkbtn_no_recv_err_panel,
771 prefs_set_data_from_toggle, prefs_set_toggle},
772 {"close_receive_dialog", "TRUE", &prefs_common.close_recv_dialog,
773 P_BOOL, &interface.checkbtn_close_recv_dialog,
774 prefs_set_data_from_toggle, prefs_set_toggle},
775 {"nextunreadmsg_dialog", NULL, &prefs_common.next_unread_msg_dialog, P_ENUM,
776 &interface.optmenu_nextunreadmsgdialog,
777 prefs_nextunreadmsgdialog_set_data_from_optmenu,
778 prefs_nextunreadmsgdialog_set_optmenu},
780 {"pixmap_theme_path", DEFAULT_PIXMAP_THEME,
781 &prefs_common.pixmap_theme_path, P_STRING,
782 &interface.entry_pixmap_theme, prefs_set_data_from_entry, prefs_set_entry},
785 {"uri_open_command", DEFAULT_BROWSER_CMD,
786 &prefs_common.uri_cmd, P_STRING,
787 &other.uri_entry, prefs_set_data_from_entry, prefs_set_entry},
788 {"print_command", "lpr %s", &prefs_common.print_cmd, P_STRING,
789 &other.printcmd_entry, prefs_set_data_from_entry, prefs_set_entry},
790 {"ext_editor_command", "gedit %s",
791 &prefs_common.ext_editor_cmd, P_STRING,
792 &other.exteditor_entry, prefs_set_data_from_entry, prefs_set_entry},
794 {"add_address_by_click", "FALSE", &prefs_common.add_address_by_click,
795 P_BOOL, &other.checkbtn_addaddrbyclick,
796 prefs_set_data_from_toggle, prefs_set_toggle},
798 {"confirm_on_exit", "TRUE", &prefs_common.confirm_on_exit, P_BOOL,
799 &other.checkbtn_confonexit,
800 prefs_set_data_from_toggle, prefs_set_toggle},
801 {"clean_trash_on_exit", "FALSE", &prefs_common.clean_on_exit, P_BOOL,
802 &other.checkbtn_cleanonexit,
803 prefs_set_data_from_toggle, prefs_set_toggle},
804 {"ask_on_cleaning", "TRUE", &prefs_common.ask_on_clean, P_BOOL,
805 &other.checkbtn_askonclean,
806 prefs_set_data_from_toggle, prefs_set_toggle},
807 {"warn_queued_on_exit", "TRUE", &prefs_common.warn_queued_on_exit,
808 P_BOOL, &other.checkbtn_warnqueued,
809 prefs_set_data_from_toggle, prefs_set_toggle},
812 {"ssl_ask_unknown_valid", "TRUE", &prefs_common.ssl_ask_unknown_valid,
813 P_BOOL, &other.checkbtn_ssl_ask_unknown_valid,
814 prefs_set_data_from_toggle, prefs_set_toggle},
817 {"work_offline", "FALSE", &prefs_common.work_offline, P_BOOL,
819 {"summary_quicksearch_type", "0", &prefs_common.summary_quicksearch_type, P_INT,
822 {"hide_score", "-9999", &prefs_common.kill_score, P_INT,
824 {"important_score", "1", &prefs_common.important_score, P_INT,
826 {"clip_log", "FALSE", &prefs_common.cliplog, P_BOOL,
827 &other.checkbtn_cliplog,
828 prefs_set_data_from_toggle, prefs_set_toggle},
829 {"log_length", "1000", &prefs_common.loglength, P_INT,
830 &other.loglength_entry,
831 prefs_set_data_from_entry, prefs_set_entry},
833 {"cache_max_mem_usage", "4096", &prefs_common.cache_max_mem_usage, P_INT,
835 {"cache_min_keep_time", "15", &prefs_common.cache_min_keep_time, P_INT,
838 {"color_new", "179", &prefs_common.color_new, P_COLOR,
841 {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
844 /* widget creating functions */
845 static void prefs_common_create (void);
846 static void prefs_receive_create (void);
847 static void prefs_send_create (void);
849 static void prefs_spelling_create (void);
851 static void prefs_compose_create (void);
852 static void prefs_quote_create (void);
853 static void prefs_display_create (void);
854 static void prefs_message_create (void);
856 static void prefs_privacy_create (void);
858 static void prefs_interface_create (void);
859 static void prefs_other_create (void);
861 static void date_format_ok_btn_clicked (GtkButton *button,
863 static void date_format_cancel_btn_clicked (GtkButton *button,
865 static void date_format_key_pressed (GtkWidget *keywidget,
868 static gboolean date_format_on_delete (GtkWidget *dialogwidget,
871 static void date_format_entry_on_change (GtkEditable *editable,
873 static void date_format_select_row (GtkWidget *date_format_list,
876 GdkEventButton *event,
877 GtkWidget *date_format);
878 static GtkWidget *date_format_create (GtkButton *button,
881 static void prefs_quote_colors_dialog (void);
882 static void prefs_quote_colors_dialog_create (void);
883 static void prefs_quote_colors_key_pressed (GtkWidget *widget,
886 static void quote_color_set_dialog (GtkWidget *widget,
888 static void quote_colors_set_dialog_ok (GtkWidget *widget,
890 static void quote_colors_set_dialog_cancel (GtkWidget *widget,
892 static void quote_colors_set_dialog_key_pressed (GtkWidget *widget,
895 static void set_button_bg_color (GtkWidget *widget,
897 static void prefs_enable_message_color_toggled (void);
898 static void prefs_recycle_colors_toggled (GtkWidget *widget);
900 static void prefs_font_select (GtkButton *button, GtkEntry *entry);
902 static void prefs_font_selection_key_pressed (GtkWidget *widget,
905 static void prefs_font_selection_ok (GtkButton *button, GtkEntry *entry);
907 static void prefs_keybind_select (void);
908 static gint prefs_keybind_deleted (GtkWidget *widget,
911 static void prefs_keybind_key_pressed (GtkWidget *widget,
914 static void prefs_keybind_cancel (void);
915 static void prefs_keybind_apply_clicked (GtkWidget *widget);
917 static gint prefs_common_deleted (GtkWidget *widget,
920 static void prefs_common_key_pressed (GtkWidget *widget,
923 static void prefs_common_ok (void);
924 static void prefs_common_apply (void);
925 static void prefs_common_cancel (void);
927 void prefs_common_init() {
928 prefs_common.disphdr_list = NULL;
931 void prefs_common_read_config(void)
935 gchar buf[PREFSBUFSIZE];
937 prefs_read_config(param, "Common", COMMON_RC);
939 path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
941 if ((fp = fopen(path, "rb")) == NULL) {
942 if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
947 while (fgets(buf, sizeof(buf), fp) != NULL) {
949 if (buf[0] == '\0') continue;
950 prefs_common.mime_open_cmd_history =
951 add_history(prefs_common.mime_open_cmd_history, buf);
955 prefs_common.mime_open_cmd_history =
956 g_list_reverse(prefs_common.mime_open_cmd_history);
959 void prefs_common_save_config(void)
965 prefs_save_config(param, "Common", COMMON_RC);
967 path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
969 if ((fp = fopen(path, "wb")) == NULL) {
970 FILE_OP_ERROR(path, "fopen");
975 for (cur = prefs_common.mime_open_cmd_history;
976 cur != NULL; cur = cur->next) {
977 fputs((gchar *)cur->data, fp);
985 void prefs_common_open(void)
987 if (prefs_rc_is_readonly(COMMON_RC))
992 if (!dialog.window) {
993 prefs_common_create();
996 manage_window_set_transient(GTK_WINDOW(dialog.window));
997 gtk_notebook_set_page(GTK_NOTEBOOK(dialog.notebook), 0);
998 gtk_widget_grab_focus(dialog.ok_btn);
1000 prefs_set_dialog(param);
1002 gtk_widget_show(dialog.window);
1005 static void prefs_common_create(void)
1009 debug_print("Creating common preferences window...\n");
1011 prefs_dialog_create(&dialog);
1012 gtk_window_set_title (GTK_WINDOW(dialog.window),
1013 _("Common Preferences"));
1014 gtk_signal_connect (GTK_OBJECT(dialog.window), "delete_event",
1015 GTK_SIGNAL_FUNC(prefs_common_deleted), NULL);
1016 gtk_signal_connect (GTK_OBJECT(dialog.window), "key_press_event",
1017 GTK_SIGNAL_FUNC(prefs_common_key_pressed), NULL);
1018 MANAGE_WINDOW_SIGNALS_CONNECT(dialog.window);
1020 gtk_signal_connect (GTK_OBJECT(dialog.ok_btn), "clicked",
1021 GTK_SIGNAL_FUNC(prefs_common_ok), NULL);
1022 gtk_signal_connect (GTK_OBJECT(dialog.apply_btn), "clicked",
1023 GTK_SIGNAL_FUNC(prefs_common_apply), NULL);
1024 gtk_signal_connect_object (GTK_OBJECT(dialog.cancel_btn), "clicked",
1025 GTK_SIGNAL_FUNC(prefs_common_cancel),
1026 GTK_OBJECT(dialog.window));
1028 /* create all widgets on notebook */
1029 prefs_receive_create();
1030 SET_NOTEBOOK_LABEL(dialog.notebook, _("Receive"), page++);
1031 prefs_send_create();
1032 SET_NOTEBOOK_LABEL(dialog.notebook, _("Send"), page++);
1033 prefs_compose_create();
1034 SET_NOTEBOOK_LABEL(dialog.notebook, _("Compose"), page++);
1036 prefs_spelling_create();
1037 SET_NOTEBOOK_LABEL(dialog.notebook, _("Spell Checker"), page++);
1039 prefs_quote_create();
1040 SET_NOTEBOOK_LABEL(dialog.notebook, _("Quote"), page++);
1041 prefs_display_create();
1042 SET_NOTEBOOK_LABEL(dialog.notebook, _("Display"), page++);
1043 prefs_message_create();
1044 SET_NOTEBOOK_LABEL(dialog.notebook, _("Message"), page++);
1046 prefs_privacy_create();
1047 SET_NOTEBOOK_LABEL(dialog.notebook, _("Privacy"), page++);
1049 prefs_interface_create();
1050 SET_NOTEBOOK_LABEL(dialog.notebook, _("Interface"), page++);
1051 prefs_other_create();
1052 SET_NOTEBOOK_LABEL(dialog.notebook, _("Other"), page++);
1054 gtk_widget_show_all(dialog.window);
1057 static void prefs_receive_create(void)
1061 GtkWidget *frame_incext;
1062 GtkWidget *checkbtn_incext;
1064 GtkWidget *label_incext;
1065 GtkWidget *entry_incext;
1066 /* GtkWidget *button_incext; */
1068 GtkWidget *frame_spool;
1069 GtkWidget *checkbtn_local;
1070 GtkWidget *checkbtn_filter_on_inc;
1071 GtkWidget *label_spool;
1072 GtkWidget *entry_spool;
1074 GtkWidget *hbox_autochk;
1075 GtkWidget *checkbtn_autochk;
1076 GtkWidget *label_autochk1;
1077 GtkObject *spinbtn_autochk_adj;
1078 GtkWidget *spinbtn_autochk;
1079 GtkWidget *label_autochk2;
1080 GtkWidget *checkbtn_chkonstartup;
1081 GtkWidget *checkbtn_scan_after_inc;
1084 GtkWidget *frame_newmail;
1085 GtkWidget *hbox_newmail_notify;
1086 GtkWidget *checkbtn_newmail_auto;
1087 GtkWidget *checkbtn_newmail_manu;
1088 GtkWidget *entry_newmail_notify_cmd;
1089 GtkWidget *label_newmail_notify_cmd;
1091 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1092 gtk_widget_show (vbox1);
1093 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1094 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1096 PACK_FRAME(vbox1, frame_incext, _("External program"));
1098 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1099 gtk_widget_show (vbox2);
1100 gtk_container_add (GTK_CONTAINER (frame_incext), vbox2);
1101 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1103 /* Use of external incorporation program */
1104 PACK_CHECK_BUTTON (vbox2, checkbtn_incext,
1105 _("Use external program for incorporation"));
1107 hbox = gtk_hbox_new (FALSE, 8);
1108 gtk_widget_show (hbox);
1109 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1110 SET_TOGGLE_SENSITIVITY (checkbtn_incext, hbox);
1112 label_incext = gtk_label_new (_("Command"));
1113 gtk_widget_show (label_incext);
1114 gtk_box_pack_start (GTK_BOX (hbox), label_incext, FALSE, FALSE, 0);
1116 entry_incext = gtk_entry_new ();
1117 gtk_widget_show (entry_incext);
1118 gtk_box_pack_start (GTK_BOX (hbox), entry_incext, TRUE, TRUE, 0);
1121 button_incext = gtk_button_new_with_label ("... ");
1122 gtk_widget_show (button_incext);
1123 gtk_box_pack_start (GTK_BOX (hbox), button_incext, FALSE, FALSE, 0);
1126 PACK_FRAME(vbox1, frame_spool, _("Local spool"));
1128 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1129 gtk_widget_show (vbox2);
1130 gtk_container_add (GTK_CONTAINER (frame_spool), vbox2);
1131 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1133 hbox = gtk_hbox_new (FALSE, 32);
1134 gtk_widget_show (hbox);
1135 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1137 PACK_CHECK_BUTTON (hbox, checkbtn_local, _("Incorporate from spool"));
1138 PACK_CHECK_BUTTON (hbox, checkbtn_filter_on_inc,
1139 _("Filter on incorporation"));
1140 SET_TOGGLE_SENSITIVITY (checkbtn_local, checkbtn_filter_on_inc);
1142 hbox = gtk_hbox_new (FALSE, 8);
1143 gtk_widget_show (hbox);
1144 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1145 SET_TOGGLE_SENSITIVITY (checkbtn_local, hbox);
1147 label_spool = gtk_label_new (_("Spool directory"));
1148 gtk_widget_show (label_spool);
1149 gtk_box_pack_start (GTK_BOX (hbox), label_spool, FALSE, FALSE, 0);
1151 entry_spool = gtk_entry_new ();
1152 gtk_widget_show (entry_spool);
1153 gtk_box_pack_start (GTK_BOX (hbox), entry_spool, TRUE, TRUE, 0);
1155 vbox2 = gtk_vbox_new (FALSE, 0);
1156 gtk_widget_show (vbox2);
1157 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1160 hbox_autochk = gtk_hbox_new (FALSE, 8);
1161 gtk_widget_show (hbox_autochk);
1162 gtk_box_pack_start (GTK_BOX (vbox2), hbox_autochk, FALSE, FALSE, 0);
1164 PACK_CHECK_BUTTON (hbox_autochk, checkbtn_autochk,
1165 _("Auto-check new mail"));
1167 label_autochk1 = gtk_label_new (_("every"));
1168 gtk_widget_show (label_autochk1);
1169 gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk1, FALSE, FALSE, 0);
1171 spinbtn_autochk_adj = gtk_adjustment_new (5, 1, 100, 1, 10, 10);
1172 spinbtn_autochk = gtk_spin_button_new
1173 (GTK_ADJUSTMENT (spinbtn_autochk_adj), 1, 0);
1174 gtk_widget_show (spinbtn_autochk);
1175 gtk_box_pack_start (GTK_BOX (hbox_autochk), spinbtn_autochk, FALSE, FALSE, 0);
1176 gtk_widget_set_usize (spinbtn_autochk, 64, -1);
1177 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_autochk), TRUE);
1179 label_autochk2 = gtk_label_new (_("minute(s)"));
1180 gtk_widget_show (label_autochk2);
1181 gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk2, FALSE, FALSE, 0);
1183 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk1);
1184 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, spinbtn_autochk);
1185 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk2);
1187 PACK_CHECK_BUTTON (vbox2, checkbtn_chkonstartup,
1188 _("Check new mail on startup"));
1189 PACK_CHECK_BUTTON (vbox2, checkbtn_scan_after_inc,
1190 _("Update all local folders after incorporation"));
1193 PACK_FRAME(vbox1, frame_newmail, _("Run command when new mail "
1195 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1196 gtk_widget_show (vbox2);
1197 gtk_container_add (GTK_CONTAINER (frame_newmail), vbox2);
1198 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1200 hbox = gtk_hbox_new (TRUE, 8);
1201 gtk_widget_show (hbox);
1202 PACK_CHECK_BUTTON (hbox, checkbtn_newmail_auto,
1203 _("after autochecking"));
1204 PACK_CHECK_BUTTON (hbox, checkbtn_newmail_manu,
1205 _("after manual checking"));
1206 gtk_box_pack_start (GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
1207 gtk_signal_connect(GTK_OBJECT(checkbtn_newmail_auto), "toggled",
1208 GTK_SIGNAL_FUNC(prefs_common_recv_dialog_newmail_notify_toggle_cb),
1210 gtk_signal_connect(GTK_OBJECT(checkbtn_newmail_manu), "toggled",
1211 GTK_SIGNAL_FUNC(prefs_common_recv_dialog_newmail_notify_toggle_cb),
1214 hbox_newmail_notify = gtk_hbox_new (FALSE, 8);
1215 gtk_widget_show (hbox);
1216 gtk_box_pack_start (GTK_BOX (vbox2), hbox_newmail_notify, FALSE,
1219 label_newmail_notify_cmd = gtk_label_new (_("Command to execute:\n"
1220 "(use %d as number of new "
1222 gtk_label_set_justify(GTK_LABEL(label_newmail_notify_cmd),
1224 gtk_widget_show (label_newmail_notify_cmd);
1225 gtk_box_pack_start (GTK_BOX (hbox_newmail_notify),
1226 label_newmail_notify_cmd, FALSE, FALSE, 0);
1228 entry_newmail_notify_cmd = gtk_entry_new ();
1229 gtk_widget_show (entry_newmail_notify_cmd);
1230 gtk_box_pack_start (GTK_BOX (hbox_newmail_notify),
1231 entry_newmail_notify_cmd, TRUE, TRUE, 0);
1233 gtk_widget_set_sensitive(hbox_newmail_notify,
1234 prefs_common.newmail_notify_auto ||
1235 prefs_common.newmail_notify_manu);
1237 receive.checkbtn_incext = checkbtn_incext;
1238 receive.entry_incext = entry_incext;
1239 /* receive.button_incext = button_incext; */
1241 receive.checkbtn_local = checkbtn_local;
1242 receive.checkbtn_filter_on_inc = checkbtn_filter_on_inc;
1243 receive.entry_spool = entry_spool;
1245 receive.checkbtn_autochk = checkbtn_autochk;
1246 receive.spinbtn_autochk = spinbtn_autochk;
1247 receive.spinbtn_autochk_adj = spinbtn_autochk_adj;
1249 receive.checkbtn_chkonstartup = checkbtn_chkonstartup;
1250 receive.checkbtn_scan_after_inc = checkbtn_scan_after_inc;
1253 receive.checkbtn_newmail_auto = checkbtn_newmail_auto;
1254 receive.checkbtn_newmail_manu = checkbtn_newmail_manu;
1255 receive.hbox_newmail_notify = hbox_newmail_notify;
1256 receive.entry_newmail_notify_cmd = entry_newmail_notify_cmd;
1259 static void prefs_send_create(void)
1263 GtkWidget *frame_extsend;
1264 GtkWidget *vbox_extsend;
1265 GtkWidget *checkbtn_extsend;
1267 GtkWidget *label_extsend;
1268 GtkWidget *entry_extsend;
1269 /* GtkWidget *button_extsend; */
1270 GtkWidget *checkbtn_savemsg;
1271 GtkWidget *checkbtn_queuemsg;
1272 GtkWidget *label_outcharset;
1273 GtkWidget *optmenu_charset;
1274 GtkWidget *optmenu_menu;
1275 GtkWidget *menuitem;
1276 GtkWidget *label_charset_desc;
1277 GtkWidget *optmenu_encoding;
1278 GtkWidget *label_encoding;
1279 GtkWidget *label_encoding_desc;
1281 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1282 gtk_widget_show (vbox1);
1283 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1284 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1286 PACK_FRAME(vbox1, frame_extsend, _("External program"));
1288 vbox_extsend = gtk_vbox_new (FALSE, VSPACING_NARROW);
1289 gtk_widget_show (vbox_extsend);
1290 gtk_container_add (GTK_CONTAINER (frame_extsend), vbox_extsend);
1291 gtk_container_set_border_width (GTK_CONTAINER (vbox_extsend), 8);
1293 PACK_CHECK_BUTTON (vbox_extsend, checkbtn_extsend,
1294 _("Use external program for sending"));
1296 hbox1 = gtk_hbox_new (FALSE, 8);
1297 gtk_widget_show (hbox1);
1298 gtk_box_pack_start (GTK_BOX (vbox_extsend), hbox1, FALSE, FALSE, 0);
1299 SET_TOGGLE_SENSITIVITY(checkbtn_extsend, hbox1);
1301 label_extsend = gtk_label_new (_("Command"));
1302 gtk_widget_show (label_extsend);
1303 gtk_box_pack_start (GTK_BOX (hbox1), label_extsend, FALSE, FALSE, 0);
1305 entry_extsend = gtk_entry_new ();
1306 gtk_widget_show (entry_extsend);
1307 gtk_box_pack_start (GTK_BOX (hbox1), entry_extsend, TRUE, TRUE, 0);
1310 button_extsend = gtk_button_new_with_label ("... ");
1311 gtk_widget_show (button_extsend);
1312 gtk_box_pack_start (GTK_BOX (hbox1), button_extsend, FALSE, FALSE, 0);
1315 vbox2 = gtk_vbox_new (FALSE, 0);
1316 gtk_widget_show (vbox2);
1317 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1319 PACK_CHECK_BUTTON (vbox2, checkbtn_savemsg,
1320 _("Save sent messages to Sent folder"));
1321 PACK_CHECK_BUTTON (vbox2, checkbtn_queuemsg,
1322 _("Queue messages that fail to send"));
1324 hbox1 = gtk_hbox_new (FALSE, 8);
1325 gtk_widget_show (hbox1);
1326 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1328 label_outcharset = gtk_label_new (_("Outgoing codeset"));
1329 gtk_widget_show (label_outcharset);
1330 gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, FALSE, FALSE, 0);
1332 optmenu_charset = gtk_option_menu_new ();
1333 gtk_widget_show (optmenu_charset);
1334 gtk_box_pack_start (GTK_BOX (hbox1), optmenu_charset, FALSE, FALSE, 0);
1336 optmenu_menu = gtk_menu_new ();
1338 #define SET_MENUITEM(str, data) \
1340 MENUITEM_ADD(optmenu_menu, menuitem, str, data); \
1343 SET_MENUITEM(_("Automatic (Recommended)"), CS_AUTO);
1344 SET_MENUITEM(_("7bit ascii (US-ASCII)"), CS_US_ASCII);
1346 SET_MENUITEM(_("Unicode (UTF-8)"), CS_UTF_8);
1348 SET_MENUITEM(_("Western European (ISO-8859-1)"), CS_ISO_8859_1);
1349 SET_MENUITEM(_("Western European (ISO-8859-15)"), CS_ISO_8859_15);
1350 SET_MENUITEM(_("Central European (ISO-8859-2)"), CS_ISO_8859_2);
1351 SET_MENUITEM(_("Baltic (ISO-8859-13)"), CS_ISO_8859_13);
1352 SET_MENUITEM(_("Baltic (ISO-8859-4)"), CS_ISO_8859_4);
1353 SET_MENUITEM(_("Greek (ISO-8859-7)"), CS_ISO_8859_7);
1354 SET_MENUITEM(_("Turkish (ISO-8859-9)"), CS_ISO_8859_9);
1356 SET_MENUITEM(_("Cyrillic (ISO-8859-5)"), CS_ISO_8859_5);
1358 SET_MENUITEM(_("Cyrillic (KOI8-R)"), CS_KOI8_R);
1360 SET_MENUITEM(_("Cyrillic (Windows-1251)"), CS_WINDOWS_1251);
1361 SET_MENUITEM(_("Cyrillic (KOI8-U)"), CS_KOI8_U);
1363 SET_MENUITEM(_("Japanese (ISO-2022-JP)"), CS_ISO_2022_JP);
1365 SET_MENUITEM(_("Japanese (EUC-JP)"), CS_EUC_JP);
1366 SET_MENUITEM(_("Japanese (Shift_JIS)"), CS_SHIFT_JIS);
1368 SET_MENUITEM(_("Simplified Chinese (GB2312)"), CS_GB2312);
1369 SET_MENUITEM(_("Traditional Chinese (Big5)"), CS_BIG5);
1371 SET_MENUITEM(_("Traditional Chinese (EUC-TW)"), CS_EUC_TW);
1372 SET_MENUITEM(_("Chinese (ISO-2022-CN)"), CS_ISO_2022_CN);
1374 SET_MENUITEM(_("Korean (EUC-KR)"), CS_EUC_KR);
1375 SET_MENUITEM(_("Thai (TIS-620)"), CS_TIS_620);
1376 SET_MENUITEM(_("Thai (Windows-874)"), CS_WINDOWS_874);
1378 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_charset),
1381 hbox1 = gtk_hbox_new (FALSE, 8);
1382 gtk_widget_show (hbox1);
1383 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1385 label_charset_desc = gtk_label_new
1386 (_("If `Automatic' is selected, the optimal encoding\n"
1387 "for the current locale will be used."));
1388 gtk_widget_show (label_charset_desc);
1389 gtk_box_pack_start (GTK_BOX (hbox1), label_charset_desc,
1391 gtk_label_set_justify (GTK_LABEL (label_charset_desc),
1394 hbox1 = gtk_hbox_new (FALSE, 8);
1395 gtk_widget_show (hbox1);
1396 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1398 label_encoding = gtk_label_new (_("Transfer encoding"));
1399 gtk_widget_show (label_encoding);
1400 gtk_box_pack_start (GTK_BOX (hbox1), label_encoding, FALSE, FALSE, 0);
1402 optmenu_encoding = gtk_option_menu_new ();
1403 gtk_widget_show (optmenu_encoding);
1404 gtk_box_pack_start (GTK_BOX (hbox1), optmenu_encoding, FALSE, FALSE, 0);
1406 optmenu_menu = gtk_menu_new ();
1408 SET_MENUITEM(_("Automatic"), CTE_AUTO);
1409 SET_MENUITEM("base64", CTE_BASE64);
1410 SET_MENUITEM("quoted-printable", CTE_QUOTED_PRINTABLE);
1411 SET_MENUITEM("8bit", CTE_8BIT);
1413 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_encoding),
1416 hbox1 = gtk_hbox_new (FALSE, 8);
1417 gtk_widget_show (hbox1);
1418 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1420 label_encoding_desc = gtk_label_new
1421 (_("Specify Content-Transfer-Encoding used when\n"
1422 "message body contains non-ASCII characters."));
1423 gtk_widget_show (label_encoding_desc);
1424 gtk_box_pack_start (GTK_BOX (hbox1), label_encoding_desc,
1426 gtk_label_set_justify (GTK_LABEL (label_encoding_desc),
1429 p_send.checkbtn_extsend = checkbtn_extsend;
1430 p_send.entry_extsend = entry_extsend;
1431 /* p_send.button_extsend = button_extsend; */
1433 p_send.checkbtn_savemsg = checkbtn_savemsg;
1434 p_send.checkbtn_queuemsg = checkbtn_queuemsg;
1436 p_send.optmenu_charset = optmenu_charset;
1437 p_send.optmenu_encoding_method = optmenu_encoding;
1440 static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpointer data)
1444 toggled = gtk_toggle_button_get_active
1445 (GTK_TOGGLE_BUTTON(receive.checkbtn_newmail_manu)) ||
1446 gtk_toggle_button_get_active
1447 (GTK_TOGGLE_BUTTON(receive.checkbtn_newmail_auto));
1448 gtk_widget_set_sensitive(receive.hbox_newmail_notify, toggled);
1452 static void prefs_dictionary_set_data_from_optmenu(PrefParam *param)
1455 gchar *dict_fullname;
1457 g_return_if_fail(param);
1458 g_return_if_fail(param->data);
1459 g_return_if_fail(param->widget);
1460 g_return_if_fail(*(param->widget));
1462 dict_fullname = gtkaspell_get_dictionary_menu_active_item
1463 (gtk_option_menu_get_menu(GTK_OPTION_MENU(*(param->widget))));
1464 str = *((gchar **) param->data);
1467 *((gchar **) param->data) = dict_fullname;
1470 static void prefs_dictionary_set_optmenu(PrefParam *pparam)
1473 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
1475 GtkWidget *menuitem;
1479 g_return_if_fail(optmenu != NULL);
1480 g_return_if_fail(pparam->data != NULL);
1482 if (*(gchar **) pparam->data) {
1483 menu = gtk_option_menu_get_menu(optmenu);
1484 for (cur = GTK_MENU_SHELL(menu)->children;
1485 cur != NULL; cur = cur->next) {
1486 menuitem = GTK_WIDGET(cur->data);
1487 dict_name = gtk_object_get_data(GTK_OBJECT(menuitem),
1489 if (!strcmp2(dict_name, *((gchar **)pparam->data))) {
1490 gtk_option_menu_set_history(optmenu, n);
1497 gtk_option_menu_set_history(optmenu, 0);
1498 prefs_dictionary_set_data_from_optmenu(pparam);
1501 static void prefs_speller_sugmode_set_data_from_optmenu(PrefParam *param)
1504 g_return_if_fail(param);
1505 g_return_if_fail(param->data);
1506 g_return_if_fail(param->widget);
1507 g_return_if_fail(*(param->widget));
1509 sugmode = gtkaspell_get_sugmode_from_option_menu
1510 (GTK_OPTION_MENU(*(param->widget)));
1511 *((gint *) param->data) = sugmode;
1514 static void prefs_speller_sugmode_set_optmenu(PrefParam *pparam)
1516 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
1519 g_return_if_fail(optmenu != NULL);
1520 g_return_if_fail(pparam->data != NULL);
1522 sugmode = *(gint *) pparam->data;
1523 gtkaspell_sugmode_option_menu_set(optmenu, sugmode);
1527 static void prefs_spelling_checkbtn_enable_aspell_toggle_cb
1533 toggled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
1535 gtk_widget_set_sensitive(spelling.entry_aspell_path, toggled);
1536 gtk_widget_set_sensitive(spelling.optmenu_dictionary, toggled);
1537 gtk_widget_set_sensitive(spelling.optmenu_sugmode, toggled);
1538 gtk_widget_set_sensitive(spelling.btn_aspell_path, toggled);
1539 gtk_widget_set_sensitive(spelling.misspelled_btn, toggled);
1540 gtk_widget_set_sensitive(spelling.checkbtn_use_alternate, toggled);
1541 gtk_widget_set_sensitive(spelling.checkbtn_check_while_typing, toggled);
1544 static void prefs_spelling_btn_aspell_path_clicked_cb(GtkWidget *widget,
1547 gchar *file_path, *tmp;
1548 GtkWidget *new_menu;
1550 file_path = filesel_select_file(_("Select dictionaries location"),
1551 prefs_common.aspell_path);
1552 if (file_path == NULL) {
1556 tmp=g_dirname(file_path);
1558 if (prefs_common.aspell_path)
1559 g_free(prefs_common.aspell_path);
1560 prefs_common.aspell_path = g_strdup_printf("%s%s",tmp,
1563 new_menu = gtkaspell_dictionary_option_menu_new(prefs_common.aspell_path);
1564 gtk_option_menu_set_menu(GTK_OPTION_MENU(spelling.optmenu_dictionary),
1567 gtk_entry_set_text(GTK_ENTRY(spelling.entry_aspell_path),
1568 prefs_common.aspell_path);
1569 /* select first one */
1570 gtk_option_menu_set_history(GTK_OPTION_MENU(
1571 spelling.optmenu_dictionary), 0);
1573 if (prefs_common.dictionary)
1574 g_free(prefs_common.dictionary);
1576 prefs_common.dictionary =
1577 gtkaspell_get_dictionary_menu_active_item(
1578 gtk_option_menu_get_menu(
1580 spelling.optmenu_dictionary)));
1586 static void prefs_spelling_create()
1589 GtkWidget *frame_spell;
1590 GtkWidget *vbox_spell;
1591 GtkWidget *hbox_aspell_path;
1592 GtkWidget *checkbtn_enable_aspell;
1593 GtkWidget *label_aspell_path;
1594 GtkWidget *entry_aspell_path;
1595 GtkWidget *btn_aspell_path;
1596 GtkWidget *spell_table;
1597 GtkWidget *label_dictionary;
1598 GtkWidget *optmenu_dictionary;
1599 GtkWidget *sugmode_label;
1600 GtkWidget *sugmode_optmenu;
1601 GtkWidget *checkbtn_use_alternate;
1602 GtkWidget *help_label;
1603 GtkWidget *checkbtn_check_while_typing;
1604 GtkWidget *color_label;
1605 GtkWidget *col_align;
1607 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1608 gtk_widget_show (vbox1);
1609 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1610 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1612 /* spell checker defaults */
1613 PACK_FRAME(vbox1, frame_spell, _("Global spelling checker settings"));
1614 vbox_spell = gtk_vbox_new(FALSE, VSPACING_NARROW);
1615 gtk_widget_show (vbox_spell);
1616 gtk_container_add(GTK_CONTAINER(frame_spell), vbox_spell);
1617 gtk_container_set_border_width(GTK_CONTAINER(vbox_spell), 8);
1619 PACK_CHECK_BUTTON(vbox_spell, checkbtn_enable_aspell,
1620 _("Enable spell checker"));
1622 gtk_signal_connect(GTK_OBJECT(checkbtn_enable_aspell), "toggled",
1623 GTK_SIGNAL_FUNC(prefs_spelling_checkbtn_enable_aspell_toggle_cb),
1626 /* Check while typing */
1627 PACK_CHECK_BUTTON(vbox_spell, checkbtn_check_while_typing,
1628 _("Check while typing"));
1630 PACK_CHECK_BUTTON(vbox_spell, checkbtn_use_alternate,
1631 _("Enable alternate dictionary"));
1633 help_label = gtk_label_new(_("Enabling an alternate dictionary makes switching\n"
1634 "with the last used dictionary faster."));
1635 gtk_misc_set_alignment (GTK_MISC (help_label), 0, 0);
1636 gtk_widget_show(help_label);
1637 gtk_box_pack_start(GTK_BOX(vbox_spell), help_label, FALSE, TRUE, 0);
1639 spell_table = gtk_table_new(4, 3, FALSE);
1640 gtk_container_set_border_width (GTK_CONTAINER (spell_table), VSPACING);
1641 gtk_table_set_row_spacings(GTK_TABLE(spell_table), 8);
1642 gtk_table_set_col_spacings(GTK_TABLE(spell_table), 8);
1644 gtk_box_pack_start(GTK_BOX(vbox_spell), spell_table, TRUE, TRUE, 0);
1646 label_aspell_path = gtk_label_new (_("Dictionaries path:"));
1647 gtk_misc_set_alignment(GTK_MISC(label_aspell_path), 1.0, 0.5);
1648 gtk_widget_show(label_aspell_path);
1649 gtk_table_attach (GTK_TABLE (spell_table), label_aspell_path, 0, 1, 0,
1650 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1652 hbox_aspell_path = gtk_hbox_new (FALSE, 8);
1653 gtk_table_attach (GTK_TABLE (spell_table), hbox_aspell_path, 1, 2, 0,
1654 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1655 gtk_widget_show(hbox_aspell_path);
1657 entry_aspell_path = gtk_entry_new();
1658 gtk_widget_show(entry_aspell_path);
1659 gtk_box_pack_start(GTK_BOX(hbox_aspell_path), entry_aspell_path, TRUE,
1662 gtk_widget_set_sensitive(entry_aspell_path, prefs_common.enable_aspell);
1664 btn_aspell_path = gtk_button_new_with_label(" ... ");
1665 gtk_widget_show(btn_aspell_path);
1666 gtk_box_pack_start(GTK_BOX(hbox_aspell_path), btn_aspell_path, FALSE, FALSE, 0);
1667 gtk_widget_set_sensitive(btn_aspell_path, prefs_common.enable_aspell);
1669 gtk_signal_connect(GTK_OBJECT(btn_aspell_path), "clicked",
1670 GTK_SIGNAL_FUNC(prefs_spelling_btn_aspell_path_clicked_cb),
1673 label_dictionary = gtk_label_new(_("Default dictionary:"));
1674 gtk_misc_set_alignment(GTK_MISC(label_dictionary), 1.0, 0.5);
1675 gtk_widget_show(label_dictionary);
1676 gtk_table_attach (GTK_TABLE (spell_table), label_dictionary, 0, 1, 1, 2,
1677 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1679 optmenu_dictionary = gtk_option_menu_new();
1680 gtk_widget_show(optmenu_dictionary);
1681 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_dictionary),
1682 gtkaspell_dictionary_option_menu_new(
1683 prefs_common.aspell_path));
1684 gtk_table_attach (GTK_TABLE (spell_table), optmenu_dictionary, 1, 2, 1,
1685 2, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1686 gtk_widget_set_sensitive(optmenu_dictionary, prefs_common.enable_aspell);
1688 /* Suggestion mode */
1689 sugmode_label = gtk_label_new(_("Default suggestion mode"));
1690 gtk_misc_set_alignment(GTK_MISC(sugmode_label), 1.0, 0.5);
1691 gtk_widget_show(sugmode_label);
1692 gtk_table_attach(GTK_TABLE (spell_table), sugmode_label, 0, 1, 2, 3,
1693 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1695 sugmode_optmenu = gtk_option_menu_new();
1696 gtk_widget_show(sugmode_optmenu);
1697 gtk_option_menu_set_menu(GTK_OPTION_MENU(sugmode_optmenu),
1698 gtkaspell_sugmode_option_menu_new(prefs_common.aspell_sugmode));
1699 gtk_table_attach(GTK_TABLE(spell_table), sugmode_optmenu, 1, 2, 2, 3,
1700 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1701 gtk_widget_set_sensitive(sugmode_optmenu, prefs_common.enable_aspell);
1704 color_label = gtk_label_new(_("Misspelled word color:"));
1705 gtk_misc_set_alignment(GTK_MISC(color_label), 1.0, 0.5);
1706 gtk_table_attach (GTK_TABLE (spell_table), color_label, 0, 1, 3, 4,
1707 GTK_FILL, GTK_SHRINK, 0, 0);
1708 gtk_widget_show(color_label);
1710 col_align = gtk_alignment_new(0.0, 0.5, 0, 0);
1711 gtk_widget_show(col_align);
1712 gtk_table_attach (GTK_TABLE (spell_table), col_align, 1, 2, 3, 4,
1713 GTK_FILL, GTK_SHRINK, 0, 0);
1715 spelling.misspelled_btn = gtk_button_new_with_label ("");
1716 set_button_bg_color(spelling.misspelled_btn,
1717 prefs_common.misspelled_col);
1718 gtk_widget_set_usize (spelling.misspelled_btn, 30, 20);
1719 gtk_widget_set_sensitive(spelling.misspelled_btn, prefs_common.enable_aspell);
1720 gtk_signal_connect (GTK_OBJECT (spelling.misspelled_btn), "clicked",
1721 GTK_SIGNAL_FUNC(quote_color_set_dialog), "Misspelled word");
1722 gtk_container_add(GTK_CONTAINER(col_align), spelling.misspelled_btn);
1725 spelling.checkbtn_enable_aspell = checkbtn_enable_aspell;
1726 spelling.entry_aspell_path = entry_aspell_path;
1727 spelling.btn_aspell_path = btn_aspell_path;
1728 spelling.optmenu_dictionary = optmenu_dictionary;
1729 spelling.optmenu_sugmode = sugmode_optmenu;
1730 spelling.checkbtn_use_alternate = checkbtn_use_alternate;
1731 spelling.checkbtn_check_while_typing = checkbtn_check_while_typing;
1737 static void prefs_compose_create(void)
1742 GtkWidget *checkbtn_autoextedit;
1744 GtkWidget *frame_autosel;
1745 GtkWidget *hbox_autosel;
1746 GtkWidget *checkbtn_reply_account_autosel;
1747 GtkWidget *checkbtn_forward_account_autosel;
1748 GtkWidget *checkbtn_reedit_account_autosel;
1750 GtkWidget *hbox_undolevel;
1751 GtkWidget *label_undolevel;
1752 GtkObject *spinbtn_undolevel_adj;
1753 GtkWidget *spinbtn_undolevel;
1755 GtkWidget *vbox_linewrap;
1760 GtkWidget *label_linewrap;
1761 GtkObject *spinbtn_linewrap_adj;
1762 GtkWidget *spinbtn_linewrap;
1763 GtkWidget *checkbtn_wrapquote;
1764 GtkWidget *checkbtn_autowrap;
1765 GtkWidget *checkbtn_wrapatsend;
1767 GtkWidget *checkbtn_default_reply_list;
1769 GtkWidget *checkbtn_forward_as_attachment;
1770 GtkWidget *checkbtn_redirect_keep_from;
1771 GtkWidget *checkbtn_smart_wrapping;
1772 GtkWidget *checkbtn_block_cursor;
1773 GtkWidget *frame_msgwrap;
1775 GtkWidget *hbox_autosave;
1776 GtkWidget *checkbtn_autosave;
1777 GtkWidget *entry_autosave_length;
1778 GtkWidget *label_autosave_length;
1780 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1781 gtk_widget_show (vbox1);
1782 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1783 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1785 /* Account autoselection */
1786 PACK_FRAME(vbox1, frame_autosel, _("Automatic account selection"));
1788 hbox_autosel = gtk_hbox_new (FALSE, VSPACING_NARROW);
1789 gtk_widget_show (hbox_autosel);
1790 gtk_container_add (GTK_CONTAINER (frame_autosel), hbox_autosel);
1791 gtk_container_set_border_width (GTK_CONTAINER (hbox_autosel), 8);
1793 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reply_account_autosel,
1794 _("when replying"));
1795 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_forward_account_autosel,
1796 _("when forwarding"));
1797 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reedit_account_autosel,
1798 _("when re-editing"));
1800 vbox2 = gtk_vbox_new (FALSE, 0);
1801 gtk_widget_show (vbox2);
1802 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1804 PACK_CHECK_BUTTON (vbox2, checkbtn_default_reply_list,
1805 _("Reply button invokes mailing list reply"));
1807 PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
1808 _("Automatically launch the external editor"));
1810 hbox5 = gtk_hbox_new (FALSE, 8);
1811 gtk_widget_show (hbox5);
1812 gtk_box_pack_start (GTK_BOX (vbox2), hbox5, FALSE, FALSE, 0);
1814 PACK_CHECK_BUTTON (hbox5, checkbtn_forward_as_attachment,
1815 _("Forward as attachment"));
1817 PACK_CHECK_BUTTON (hbox5, checkbtn_block_cursor,
1820 PACK_CHECK_BUTTON (vbox2, checkbtn_redirect_keep_from,
1821 _("Keep the original 'From' header when redirecting"));
1824 hbox_autosave = gtk_hbox_new (FALSE, 8);
1825 gtk_widget_show (hbox_autosave);
1826 gtk_box_pack_start (GTK_BOX (vbox1), hbox_autosave, FALSE, FALSE, 0);
1828 PACK_CHECK_BUTTON (hbox_autosave, checkbtn_autosave,
1829 _("Autosave to Drafts folder every "));
1831 entry_autosave_length = gtk_entry_new();
1832 gtk_widget_set_usize (entry_autosave_length, 64, -1);
1833 gtk_widget_show (entry_autosave_length);
1834 gtk_box_pack_start (GTK_BOX (hbox_autosave), entry_autosave_length, FALSE, FALSE, 0);
1836 label_autosave_length = gtk_label_new(_("characters"));
1837 gtk_widget_show (label_autosave_length);
1838 gtk_box_pack_start (GTK_BOX (hbox_autosave), label_autosave_length, FALSE, FALSE, 0);
1840 hbox_undolevel = gtk_hbox_new (FALSE, 8);
1841 gtk_widget_show (hbox_undolevel);
1842 gtk_box_pack_start (GTK_BOX (vbox1), hbox_undolevel, FALSE, FALSE, 0);
1844 label_undolevel = gtk_label_new (_("Undo level"));
1845 gtk_widget_show (label_undolevel);
1846 gtk_box_pack_start (GTK_BOX (hbox_undolevel), label_undolevel, FALSE, FALSE, 0);
1848 spinbtn_undolevel_adj = gtk_adjustment_new (50, 0, 100, 1, 10, 10);
1849 spinbtn_undolevel = gtk_spin_button_new
1850 (GTK_ADJUSTMENT (spinbtn_undolevel_adj), 1, 0);
1851 gtk_widget_show (spinbtn_undolevel);
1852 gtk_box_pack_start (GTK_BOX (hbox_undolevel), spinbtn_undolevel, FALSE, FALSE, 0);
1853 gtk_widget_set_usize (spinbtn_undolevel, 64, -1);
1854 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevel), TRUE);
1857 PACK_FRAME(vbox1, frame_msgwrap, _("Message wrapping"));
1859 vbox_linewrap = gtk_vbox_new (FALSE, VSPACING_NARROW);
1860 gtk_widget_show (vbox_linewrap);
1861 gtk_container_add (GTK_CONTAINER (frame_msgwrap), vbox_linewrap);
1862 gtk_container_set_border_width (GTK_CONTAINER (vbox_linewrap), 8);
1864 hbox3 = gtk_hbox_new (FALSE, 8);
1865 gtk_widget_show (hbox3);
1866 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox3, FALSE, FALSE, 0);
1869 label_linewrap = gtk_label_new (_("Wrap messages at"));
1870 gtk_widget_show (label_linewrap);
1871 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1873 spinbtn_linewrap_adj = gtk_adjustment_new (72, 20, 1024, 1, 10, 10);
1874 spinbtn_linewrap = gtk_spin_button_new
1875 (GTK_ADJUSTMENT (spinbtn_linewrap_adj), 1, 0);
1876 gtk_widget_show (spinbtn_linewrap);
1877 gtk_box_pack_start (GTK_BOX (hbox3), spinbtn_linewrap, FALSE, FALSE, 0);
1878 gtk_widget_set_usize (spinbtn_linewrap, 64, -1);
1879 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linewrap), TRUE);
1881 label_linewrap = gtk_label_new (_("characters"));
1882 gtk_widget_show (label_linewrap);
1883 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1885 hbox4 = gtk_hbox_new (FALSE, VSPACING);
1886 gtk_widget_show (hbox4);
1887 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox4, FALSE, FALSE, 0);
1889 PACK_CHECK_BUTTON (hbox4, checkbtn_wrapquote, _("Wrap quotation"));
1891 PACK_CHECK_BUTTON (hbox4, checkbtn_autowrap, _("Wrap on input"));
1894 (hbox4, checkbtn_wrapatsend, _("Wrap before sending"));
1896 PACK_CHECK_BUTTON (vbox_linewrap, checkbtn_smart_wrapping,
1897 _("Smart wrapping (EXPERIMENTAL)"));
1900 compose.checkbtn_quote = checkbtn_quote;
1901 compose.entry_quotemark = entry_quotemark;
1902 compose.text_quotefmt = text_quotefmt;
1905 compose.checkbtn_autoextedit = checkbtn_autoextedit;
1907 compose.checkbtn_reply_account_autosel = checkbtn_reply_account_autosel;
1908 compose.checkbtn_forward_account_autosel = checkbtn_forward_account_autosel;
1909 compose.checkbtn_reedit_account_autosel = checkbtn_reedit_account_autosel;
1911 compose.spinbtn_undolevel = spinbtn_undolevel;
1912 compose.spinbtn_undolevel_adj = spinbtn_undolevel_adj;
1914 compose.spinbtn_linewrap = spinbtn_linewrap;
1915 compose.spinbtn_linewrap_adj = spinbtn_linewrap_adj;
1916 compose.checkbtn_wrapquote = checkbtn_wrapquote;
1917 compose.checkbtn_autowrap = checkbtn_autowrap;
1918 compose.checkbtn_wrapatsend = checkbtn_wrapatsend;
1920 compose.checkbtn_autosave = checkbtn_autosave;
1921 compose.entry_autosave_length = entry_autosave_length;
1923 compose.checkbtn_forward_as_attachment =
1924 checkbtn_forward_as_attachment;
1925 compose.checkbtn_redirect_keep_from =
1926 checkbtn_redirect_keep_from;
1927 compose.checkbtn_smart_wrapping =
1928 checkbtn_smart_wrapping;
1929 compose.checkbtn_block_cursor =
1930 checkbtn_block_cursor;
1931 compose.checkbtn_default_reply_list = checkbtn_default_reply_list;
1934 static void prefs_quote_create(void)
1937 GtkWidget *frame_quote;
1938 GtkWidget *vbox_quote;
1941 GtkWidget *label_quotemark;
1942 GtkWidget *entry_quotemark;
1943 GtkWidget *scrolledwin_quotefmt;
1944 GtkWidget *text_quotefmt;
1946 GtkWidget *entry_fw_quotemark;
1947 GtkWidget *text_fw_quotefmt;
1949 GtkWidget *entry_quote_chars;
1950 GtkWidget *label_quote_chars;
1952 GtkWidget *btn_quotedesc;
1954 GtkWidget *checkbtn_reply_with_quote;
1956 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1957 gtk_widget_show (vbox1);
1958 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1959 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1963 PACK_CHECK_BUTTON (vbox1, checkbtn_reply_with_quote, _("Reply will quote by default"));
1965 PACK_FRAME (vbox1, frame_quote, _("Reply format"));
1967 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
1968 gtk_widget_show (vbox_quote);
1969 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
1970 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
1972 hbox1 = gtk_hbox_new (FALSE, 32);
1973 gtk_widget_show (hbox1);
1974 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
1976 hbox2 = gtk_hbox_new (FALSE, 8);
1977 gtk_widget_show (hbox2);
1978 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
1980 label_quotemark = gtk_label_new (_("Quotation mark"));
1981 gtk_widget_show (label_quotemark);
1982 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
1984 entry_quotemark = gtk_entry_new ();
1985 gtk_widget_show (entry_quotemark);
1986 gtk_box_pack_start (GTK_BOX (hbox2), entry_quotemark, FALSE, FALSE, 0);
1987 gtk_widget_set_usize (entry_quotemark, 64, -1);
1989 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
1990 gtk_widget_show (scrolledwin_quotefmt);
1991 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
1992 gtk_scrolled_window_set_policy
1993 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
1994 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
1996 text_quotefmt = gtk_text_new (NULL, NULL);
1997 gtk_widget_show (text_quotefmt);
1998 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt), text_quotefmt);
1999 gtk_text_set_editable (GTK_TEXT (text_quotefmt), TRUE);
2000 gtk_widget_set_usize(text_quotefmt, -1, 60);
2004 PACK_FRAME (vbox1, frame_quote, _("Forward format"));
2006 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
2007 gtk_widget_show (vbox_quote);
2008 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
2009 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
2011 hbox1 = gtk_hbox_new (FALSE, 32);
2012 gtk_widget_show (hbox1);
2013 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
2015 hbox2 = gtk_hbox_new (FALSE, 8);
2016 gtk_widget_show (hbox2);
2017 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
2019 label_quotemark = gtk_label_new (_("Quotation mark"));
2020 gtk_widget_show (label_quotemark);
2021 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
2023 entry_fw_quotemark = gtk_entry_new ();
2024 gtk_widget_show (entry_fw_quotemark);
2025 gtk_box_pack_start (GTK_BOX (hbox2), entry_fw_quotemark,
2027 gtk_widget_set_usize (entry_fw_quotemark, 64, -1);
2029 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
2030 gtk_widget_show (scrolledwin_quotefmt);
2031 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
2032 gtk_scrolled_window_set_policy
2033 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
2034 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
2036 text_fw_quotefmt = gtk_text_new (NULL, NULL);
2037 gtk_widget_show (text_fw_quotefmt);
2038 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt),
2040 gtk_text_set_editable (GTK_TEXT (text_fw_quotefmt), TRUE);
2041 gtk_widget_set_usize(text_fw_quotefmt, -1, 60);
2043 hbox1 = gtk_hbox_new (FALSE, 32);
2044 gtk_widget_show (hbox1);
2045 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2048 gtk_button_new_with_label (_(" Description of symbols "));
2049 gtk_widget_show (btn_quotedesc);
2050 gtk_box_pack_start (GTK_BOX (hbox1), btn_quotedesc, FALSE, FALSE, 0);
2051 gtk_signal_connect(GTK_OBJECT(btn_quotedesc), "clicked",
2052 GTK_SIGNAL_FUNC(quote_fmt_quote_description), NULL);
2056 PACK_FRAME (vbox1, frame_quote, _("Quotation characters"));
2058 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
2059 gtk_widget_show (vbox_quote);
2060 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
2061 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
2063 hbox1 = gtk_hbox_new (FALSE, 32);
2064 gtk_widget_show (hbox1);
2065 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
2067 hbox2 = gtk_hbox_new (FALSE, 8);
2068 gtk_widget_show (hbox2);
2069 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
2071 label_quote_chars = gtk_label_new (_("Treat these characters as quotation marks: "));
2072 gtk_widget_show (label_quote_chars);
2073 gtk_box_pack_start (GTK_BOX (hbox2), label_quote_chars, FALSE, FALSE, 0);
2075 entry_quote_chars = gtk_entry_new ();
2076 gtk_widget_show (entry_quote_chars);
2077 gtk_box_pack_start (GTK_BOX (hbox2), entry_quote_chars,
2079 gtk_widget_set_usize (entry_quote_chars, 64, -1);
2082 compose.checkbtn_reply_with_quote= checkbtn_reply_with_quote;
2083 quote.entry_quotemark = entry_quotemark;
2084 quote.text_quotefmt = text_quotefmt;
2085 quote.entry_fw_quotemark = entry_fw_quotemark;
2086 quote.text_fw_quotefmt = text_fw_quotefmt;
2087 quote.entry_quote_chars = entry_quote_chars;
2090 static void prefs_display_create(void)
2093 GtkWidget *frame_font;
2095 GtkWidget *label_textfont;
2096 GtkWidget *entry_textfont;
2097 GtkWidget *button_textfont;
2098 GtkWidget *chkbtn_transhdr;
2099 GtkWidget *chkbtn_folder_unread;
2101 GtkWidget *label_ng_abbrev;
2102 GtkWidget *spinbtn_ng_abbrev_len;
2103 GtkObject *spinbtn_ng_abbrev_len_adj;
2104 GtkWidget *frame_summary;
2106 GtkWidget *chkbtn_swapfrom;
2107 GtkWidget *chkbtn_useaddrbook;
2108 GtkWidget *chkbtn_threadsubj;
2110 GtkWidget *label_datefmt;
2111 GtkWidget *button_datefmt;
2112 GtkWidget *entry_datefmt;
2113 GtkWidget *button_dispitem;
2114 GtkWidget *tmplabel, *tmpbutton, *tmpentry;
2116 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2117 gtk_widget_show (vbox1);
2118 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2119 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2121 PACK_FRAME(vbox1, frame_font, _("Font"));
2123 table1 = gtk_table_new (4, 3, FALSE);
2125 gtk_widget_show (table1);
2126 gtk_container_add (GTK_CONTAINER (frame_font), table1);
2127 gtk_container_set_border_width (GTK_CONTAINER (table1), 8);
2128 gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
2129 gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
2131 label_textfont = gtk_label_new (_("Text"));
2132 gtk_misc_set_alignment(GTK_MISC(label_textfont), 0, 0.5);
2133 gtk_widget_show (label_textfont);
2134 gtk_table_attach (GTK_TABLE (table1), label_textfont, 0, 1, 0, 1,
2135 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2137 entry_textfont = gtk_entry_new ();
2138 gtk_widget_show (entry_textfont);
2139 gtk_table_attach (GTK_TABLE (table1), entry_textfont, 1, 2, 0, 1,
2140 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2142 button_textfont = gtk_button_new_with_label (" ... ");
2144 gtk_widget_show (button_textfont);
2145 gtk_table_attach (GTK_TABLE (table1), button_textfont, 2, 3, 0, 1,
2147 gtk_signal_connect (GTK_OBJECT (button_textfont), "clicked",
2148 GTK_SIGNAL_FUNC (prefs_font_select), entry_textfont);
2150 tmplabel = gtk_label_new (_("Small"));
2151 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2152 gtk_widget_show (tmplabel);
2153 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 1, 2,
2154 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2156 tmpentry = gtk_entry_new ();
2157 gtk_widget_show (tmpentry);
2158 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 1, 2,
2159 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2161 tmpbutton = gtk_button_new_with_label (" ... ");
2162 gtk_widget_show (tmpbutton);
2163 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 1, 2,
2165 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2166 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2167 display.entry_smallfont = tmpentry;
2169 tmplabel = gtk_label_new (_("Normal"));
2170 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2171 gtk_widget_show (tmplabel);
2172 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 2, 3,
2173 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2175 tmpentry = gtk_entry_new ();
2176 gtk_widget_show (tmpentry);
2177 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 2, 3,
2178 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2180 tmpbutton = gtk_button_new_with_label (" ... ");
2181 gtk_widget_show (tmpbutton);
2182 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 2, 3,
2184 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2185 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2186 display.entry_normalfont = tmpentry;
2188 tmplabel = gtk_label_new (_("Bold"));
2189 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2190 gtk_widget_show (tmplabel);
2191 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 3, 4,
2192 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2194 tmpentry = gtk_entry_new ();
2195 gtk_widget_show (tmpentry);
2196 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 3, 4,
2197 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2199 tmpbutton = gtk_button_new_with_label (" ... ");
2200 gtk_widget_show (tmpbutton);
2201 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 3, 4,
2203 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2204 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2205 display.entry_boldfont = tmpentry;
2207 vbox2 = gtk_vbox_new (FALSE, 0);
2208 gtk_widget_show (vbox2);
2209 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, TRUE, 0);
2212 (vbox2, chkbtn_transhdr,
2213 _("Translate header name (such as `From:', `Subject:')"));
2215 PACK_CHECK_BUTTON (vbox2, chkbtn_folder_unread,
2216 _("Display unread number next to folder name"));
2218 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2220 hbox1 = gtk_hbox_new (FALSE, 8);
2221 gtk_widget_show (hbox1);
2222 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2224 label_ng_abbrev = gtk_label_new
2225 (_("Abbreviate newsgroup names longer than"));
2226 gtk_widget_show (label_ng_abbrev);
2227 gtk_box_pack_start (GTK_BOX (hbox1), label_ng_abbrev, FALSE, FALSE, 0);
2229 spinbtn_ng_abbrev_len_adj = gtk_adjustment_new (16, 0, 999, 1, 10, 10);
2230 spinbtn_ng_abbrev_len = gtk_spin_button_new
2231 (GTK_ADJUSTMENT (spinbtn_ng_abbrev_len_adj), 1, 0);
2232 gtk_widget_show (spinbtn_ng_abbrev_len);
2233 gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_ng_abbrev_len,
2235 gtk_widget_set_usize (spinbtn_ng_abbrev_len, 56, -1);
2236 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_ng_abbrev_len),
2239 label_ng_abbrev = gtk_label_new
2241 gtk_widget_show (label_ng_abbrev);
2242 gtk_box_pack_start (GTK_BOX (hbox1), label_ng_abbrev, FALSE, FALSE, 0);
2244 /* ---- Summary ---- */
2246 PACK_FRAME(vbox1, frame_summary, _("Summary View"));
2248 vbox2 = gtk_vbox_new (FALSE, 0);
2249 gtk_widget_show (vbox2);
2250 gtk_container_add (GTK_CONTAINER (frame_summary), vbox2);
2251 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
2254 (vbox2, chkbtn_swapfrom,
2255 _("Display recipient in `From' column if sender is yourself"));
2257 (vbox2, chkbtn_useaddrbook,
2258 _("Display sender using address book"));
2260 (vbox2, chkbtn_threadsubj,
2261 _("Thread using subject in addition to standard headers"));
2263 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2265 hbox1 = gtk_hbox_new (FALSE, 8);
2266 gtk_widget_show (hbox1);
2267 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2269 label_datefmt = gtk_label_new (_("Date format"));
2270 gtk_widget_show (label_datefmt);
2271 gtk_box_pack_start (GTK_BOX (hbox1), label_datefmt, FALSE, FALSE, 0);
2273 entry_datefmt = gtk_entry_new ();
2274 gtk_widget_show (entry_datefmt);
2275 gtk_box_pack_start (GTK_BOX (hbox1), entry_datefmt, TRUE, TRUE, 0);
2277 button_datefmt = gtk_button_new_with_label (" ... ");
2279 gtk_widget_show (button_datefmt);
2280 gtk_box_pack_start (GTK_BOX (hbox1), button_datefmt, FALSE, FALSE, 0);
2281 gtk_signal_connect (GTK_OBJECT (button_datefmt), "clicked",
2282 GTK_SIGNAL_FUNC (date_format_create), NULL);
2284 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
2286 hbox1 = gtk_hbox_new (FALSE, 8);
2287 gtk_widget_show (hbox1);
2288 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2290 button_dispitem = gtk_button_new_with_label
2291 (_(" Set displayed items in summary... "));
2292 gtk_widget_show (button_dispitem);
2293 gtk_box_pack_start (GTK_BOX (hbox1), button_dispitem, FALSE, TRUE, 0);
2294 gtk_signal_connect (GTK_OBJECT (button_dispitem), "clicked",
2295 GTK_SIGNAL_FUNC (prefs_summary_column_open),
2298 display.entry_textfont = entry_textfont;
2299 display.button_textfont = button_textfont;
2301 display.chkbtn_transhdr = chkbtn_transhdr;
2302 display.chkbtn_folder_unread = chkbtn_folder_unread;
2303 display.spinbtn_ng_abbrev_len = spinbtn_ng_abbrev_len;
2304 display.spinbtn_ng_abbrev_len_adj = spinbtn_ng_abbrev_len_adj;
2306 display.chkbtn_swapfrom = chkbtn_swapfrom;
2307 display.chkbtn_useaddrbook = chkbtn_useaddrbook;
2308 display.chkbtn_threadsubj = chkbtn_threadsubj;
2309 display.entry_datefmt = entry_datefmt;
2312 static void prefs_message_create(void)
2318 GtkWidget *chkbtn_enablecol;
2319 GtkWidget *button_edit_col;
2320 GtkWidget *chkbtn_mbalnum;
2321 GtkWidget *chkbtn_disphdrpane;
2322 GtkWidget *chkbtn_disphdr;
2323 GtkWidget *button_edit_disphdr;
2324 GtkWidget *hbox_linespc;
2325 GtkWidget *label_linespc;
2326 GtkObject *spinbtn_linespc_adj;
2327 GtkWidget *spinbtn_linespc;
2328 GtkWidget *chkbtn_headspc;
2330 GtkWidget *frame_scr;
2331 GtkWidget *vbox_scr;
2332 GtkWidget *chkbtn_smoothscroll;
2333 GtkWidget *hbox_scr;
2334 GtkWidget *label_scr;
2335 GtkObject *spinbtn_scrollstep_adj;
2336 GtkWidget *spinbtn_scrollstep;
2337 GtkWidget *chkbtn_halfpage;
2339 GtkWidget *chkbtn_display_img;
2340 GtkWidget *chkbtn_resize_image;
2342 GtkWidget *chkbtn_attach_desc;
2344 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2345 gtk_widget_show (vbox1);
2346 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2347 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2349 vbox2 = gtk_vbox_new (FALSE, 0);
2350 gtk_widget_show (vbox2);
2351 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2353 hbox1 = gtk_hbox_new (FALSE, 8);
2354 gtk_widget_show (hbox1);
2355 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2357 PACK_CHECK_BUTTON (hbox1, chkbtn_enablecol,
2358 _("Enable coloration of message"));
2359 gtk_signal_connect (GTK_OBJECT (chkbtn_enablecol), "toggled",
2360 GTK_SIGNAL_FUNC (prefs_enable_message_color_toggled),
2363 button_edit_col = gtk_button_new_with_label (_(" Edit... "));
2364 gtk_widget_show (button_edit_col);
2365 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_col, FALSE, TRUE, 0);
2366 gtk_signal_connect (GTK_OBJECT (button_edit_col), "clicked",
2367 GTK_SIGNAL_FUNC (prefs_quote_colors_dialog), NULL);
2369 SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, button_edit_col);
2372 (vbox2, chkbtn_mbalnum,
2373 _("Display multi-byte alphanumeric as\n"
2374 "ASCII character (Japanese only)"));
2375 gtk_label_set_justify (GTK_LABEL (GTK_BIN(chkbtn_mbalnum)->child),
2378 PACK_CHECK_BUTTON(vbox2, chkbtn_disphdrpane,
2379 _("Display header pane above message view"));
2381 hbox1 = gtk_hbox_new (FALSE, 8);
2382 gtk_widget_show (hbox1);
2383 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2385 PACK_CHECK_BUTTON(hbox1, chkbtn_disphdr,
2386 _("Display short headers on message view"));
2388 button_edit_disphdr = gtk_button_new_with_label (_(" Edit... "));
2389 gtk_widget_show (button_edit_disphdr);
2390 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_disphdr,
2392 gtk_signal_connect (GTK_OBJECT (button_edit_disphdr), "clicked",
2393 GTK_SIGNAL_FUNC (prefs_display_header_open),
2396 SET_TOGGLE_SENSITIVITY(chkbtn_disphdr, button_edit_disphdr);
2398 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2400 hbox1 = gtk_hbox_new (FALSE, 32);
2401 gtk_widget_show (hbox1);
2402 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2404 hbox_linespc = gtk_hbox_new (FALSE, 8);
2405 gtk_widget_show (hbox1);
2406 gtk_box_pack_start (GTK_BOX (hbox1), hbox_linespc, FALSE, TRUE, 0);
2408 label_linespc = gtk_label_new (_("Line space"));
2409 gtk_widget_show (label_linespc);
2410 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2413 spinbtn_linespc_adj = gtk_adjustment_new (2, 0, 16, 1, 1, 16);
2414 spinbtn_linespc = gtk_spin_button_new
2415 (GTK_ADJUSTMENT (spinbtn_linespc_adj), 1, 0);
2416 gtk_widget_show (spinbtn_linespc);
2417 gtk_box_pack_start (GTK_BOX (hbox_linespc), spinbtn_linespc,
2419 gtk_widget_set_usize (spinbtn_linespc, 64, -1);
2420 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linespc), TRUE);
2422 label_linespc = gtk_label_new (_("pixel(s)"));
2423 gtk_widget_show (label_linespc);
2424 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2427 PACK_CHECK_BUTTON(hbox1, chkbtn_headspc, _("Leave space on head"));
2429 PACK_FRAME(vbox1, frame_scr, _("Scroll"));
2431 vbox_scr = gtk_vbox_new (FALSE, 0);
2432 gtk_widget_show (vbox_scr);
2433 gtk_container_add (GTK_CONTAINER (frame_scr), vbox_scr);
2434 gtk_container_set_border_width (GTK_CONTAINER (vbox_scr), 8);
2436 PACK_CHECK_BUTTON(vbox_scr, chkbtn_halfpage, _("Half page"));
2438 hbox1 = gtk_hbox_new (FALSE, 32);
2439 gtk_widget_show (hbox1);
2440 gtk_box_pack_start (GTK_BOX (vbox_scr), hbox1, FALSE, TRUE, 0);
2442 PACK_CHECK_BUTTON(hbox1, chkbtn_smoothscroll, _("Smooth scroll"));
2444 hbox_scr = gtk_hbox_new (FALSE, 8);
2445 gtk_widget_show (hbox_scr);
2446 gtk_box_pack_start (GTK_BOX (hbox1), hbox_scr, FALSE, FALSE, 0);
2448 label_scr = gtk_label_new (_("Step"));
2449 gtk_widget_show (label_scr);
2450 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2452 spinbtn_scrollstep_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 10);
2453 spinbtn_scrollstep = gtk_spin_button_new
2454 (GTK_ADJUSTMENT (spinbtn_scrollstep_adj), 1, 0);
2455 gtk_widget_show (spinbtn_scrollstep);
2456 gtk_box_pack_start (GTK_BOX (hbox_scr), spinbtn_scrollstep,
2458 gtk_widget_set_usize (spinbtn_scrollstep, 64, -1);
2459 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_scrollstep),
2462 label_scr = gtk_label_new (_("pixel(s)"));
2463 gtk_widget_show (label_scr);
2464 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2466 SET_TOGGLE_SENSITIVITY (chkbtn_smoothscroll, hbox_scr)
2468 vbox3 = gtk_vbox_new (FALSE, 0);
2469 gtk_widget_show (vbox3);
2470 gtk_box_pack_start (GTK_BOX (vbox1), vbox3, FALSE, FALSE, 0);
2472 PACK_CHECK_BUTTON(vbox3, chkbtn_display_img,
2473 _("Automatically display attached images"));
2475 PACK_CHECK_BUTTON(vbox3, chkbtn_resize_image,
2476 _("Resize attached images"));
2478 PACK_CHECK_BUTTON(vbox3, chkbtn_attach_desc,
2479 _("Show attachment descriptions (rather than names)"));
2482 message.chkbtn_enablecol = chkbtn_enablecol;
2483 message.button_edit_col = button_edit_col;
2484 message.chkbtn_mbalnum = chkbtn_mbalnum;
2485 message.chkbtn_disphdrpane = chkbtn_disphdrpane;
2486 message.chkbtn_disphdr = chkbtn_disphdr;
2487 message.spinbtn_linespc = spinbtn_linespc;
2488 message.chkbtn_headspc = chkbtn_headspc;
2490 message.chkbtn_smoothscroll = chkbtn_smoothscroll;
2491 message.spinbtn_scrollstep = spinbtn_scrollstep;
2492 message.spinbtn_scrollstep_adj = spinbtn_scrollstep_adj;
2493 message.chkbtn_halfpage = chkbtn_halfpage;
2495 message.chkbtn_display_img = chkbtn_display_img;
2496 message.chkbtn_resize_image = chkbtn_resize_image;
2498 message.chkbtn_attach_desc = chkbtn_attach_desc;
2502 static void prefs_privacy_create(void)
2508 GtkWidget *hbox_spc;
2510 GtkWidget *checkbtn_auto_check_signatures;
2511 GtkWidget *checkbtn_gpg_signature_popup;
2512 GtkWidget *checkbtn_store_passphrase;
2513 GtkObject *spinbtn_store_passphrase_adj;
2514 GtkWidget *spinbtn_store_passphrase;
2515 GtkWidget *checkbtn_passphrase_grab;
2516 GtkWidget *checkbtn_gpg_warning;
2518 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2519 gtk_widget_show (vbox1);
2520 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2521 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2523 vbox2 = gtk_vbox_new (FALSE, 0);
2524 gtk_widget_show (vbox2);
2525 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2527 PACK_CHECK_BUTTON (vbox2, checkbtn_auto_check_signatures,
2528 _("Automatically check signatures"));
2530 PACK_CHECK_BUTTON (vbox2, checkbtn_gpg_signature_popup,
2531 _("Show signature check result in a popup window"));
2533 PACK_CHECK_BUTTON (vbox2, checkbtn_store_passphrase,
2534 _("Store passphrase in memory temporarily"));
2536 vbox3 = gtk_vbox_new (FALSE, 0);
2537 gtk_widget_show (vbox3);
2538 gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
2540 hbox1 = gtk_hbox_new (FALSE, 8);
2541 gtk_widget_show (hbox1);
2542 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2544 hbox_spc = gtk_hbox_new (FALSE, 0);
2545 gtk_widget_show (hbox_spc);
2546 gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
2547 gtk_widget_set_usize (hbox_spc, 12, -1);
2549 label = gtk_label_new (_("Expire after"));
2550 gtk_widget_show (label);
2551 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2553 spinbtn_store_passphrase_adj = gtk_adjustment_new (0, 0, 1440, 1, 5, 5);
2554 spinbtn_store_passphrase = gtk_spin_button_new
2555 (GTK_ADJUSTMENT (spinbtn_store_passphrase_adj), 1, 0);
2556 gtk_widget_show (spinbtn_store_passphrase);
2557 gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_store_passphrase, FALSE, FALSE, 0);
2558 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_store_passphrase),
2560 gtk_widget_set_usize (spinbtn_store_passphrase, 64, -1);
2562 label = gtk_label_new (_("minute(s) "));
2563 gtk_widget_show (label);
2564 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2566 hbox1 = gtk_hbox_new (FALSE, 8);
2567 gtk_widget_show (hbox1);
2568 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2570 hbox_spc = gtk_hbox_new (FALSE, 0);
2571 gtk_widget_show (hbox_spc);
2572 gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
2573 gtk_widget_set_usize (hbox_spc, 12, -1);
2575 label = gtk_label_new (_("(Setting to '0' will store the passphrase\n"
2576 " for the whole session)"));
2577 gtk_widget_show (label);
2578 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2579 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
2581 SET_TOGGLE_SENSITIVITY (checkbtn_store_passphrase, vbox3);
2584 PACK_CHECK_BUTTON (vbox2, checkbtn_passphrase_grab,
2585 _("Grab input while entering a passphrase"));
2589 (vbox2, checkbtn_gpg_warning,
2590 _("Display warning on startup if GnuPG doesn't work"));
2592 hbox1 = gtk_hbox_new (FALSE, 8);
2593 gtk_widget_show (hbox1);
2594 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2596 privacy.checkbtn_auto_check_signatures
2597 = checkbtn_auto_check_signatures;
2598 privacy.checkbtn_gpg_signature_popup
2599 = checkbtn_gpg_signature_popup;
2600 privacy.checkbtn_store_passphrase = checkbtn_store_passphrase;
2601 privacy.spinbtn_store_passphrase = spinbtn_store_passphrase;
2602 privacy.spinbtn_store_passphrase_adj = spinbtn_store_passphrase_adj;
2603 privacy.checkbtn_passphrase_grab = checkbtn_passphrase_grab;
2604 privacy.checkbtn_gpg_warning = checkbtn_gpg_warning;
2606 #endif /* USE_GPGME */
2608 static void prefs_interface_create(void)
2613 /* GtkWidget *checkbtn_emacs; */
2614 GtkWidget *checkbtn_show_msg_with_cursor;
2615 GtkWidget *checkbtn_openunread;
2616 GtkWidget *checkbtn_mark_as_read_on_newwin;
2617 GtkWidget *checkbtn_openinbox;
2618 GtkWidget *checkbtn_immedexec;
2619 GtkWidget *frame_dialogs;
2620 GtkWidget *vbox_dialogs;
2623 GtkWidget *dialogs_table;
2624 GtkWidget *optmenu_recvdialog;
2625 GtkWidget *optmenu_senddialog;
2627 GtkWidget *menuitem;
2628 GtkWidget *checkbtn_no_recv_err_panel;
2629 GtkWidget *checkbtn_close_recv_dialog;
2631 GtkWidget *button_keybind;
2633 GtkWidget *optmenu_nextunreadmsgdialog;
2635 GtkWidget *frame_pixmap_theme;
2636 GtkWidget *vbox_pixmap_theme;
2637 GtkWidget *entry_pixmap_theme;
2638 GtkWidget *combo_pixmap_theme;
2639 GList *avail_pixmap_themes = NULL;
2641 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2642 gtk_widget_show (vbox1);
2643 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2644 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2646 vbox2 = gtk_vbox_new (FALSE, 0);
2647 gtk_widget_show (vbox2);
2648 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2650 /* PACK_CHECK_BUTTON (vbox2, checkbtn_emacs,
2651 _("Emulate the behavior of mouse operation of\n"
2652 "Emacs-based mailer"));
2653 gtk_label_set_justify (GTK_LABEL (GTK_BIN (checkbtn_emacs)->child),
2654 GTK_JUSTIFY_LEFT); */
2657 (vbox2, checkbtn_show_msg_with_cursor,
2658 _("Open messages in summary with cursor keys"));
2661 (vbox2, checkbtn_openunread,
2662 _("Open first unread message when entering a folder"));
2665 (vbox2, checkbtn_mark_as_read_on_newwin,
2666 _("Only mark message as read when opened in new window"));
2669 (vbox2, checkbtn_openinbox,
2670 _("Go to inbox after receiving new mail"));
2672 vbox3 = gtk_vbox_new (FALSE, 0);
2673 gtk_widget_show (vbox3);
2674 gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
2677 (vbox3, checkbtn_immedexec,
2678 _("Execute immediately when moving or deleting messages"));
2680 hbox1 = gtk_hbox_new (FALSE, 0);
2681 gtk_widget_show (hbox1);
2682 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2684 label = gtk_label_new
2685 (_("(Messages will be marked until execution\n"
2686 " if this is turned off)"));
2687 gtk_widget_show (label);
2688 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 8);
2689 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
2691 PACK_FRAME (vbox1, frame_dialogs, _("Dialogs"));
2692 vbox_dialogs = gtk_vbox_new (FALSE, 0);
2693 gtk_widget_show (vbox_dialogs);
2694 gtk_container_add (GTK_CONTAINER (frame_dialogs), vbox_dialogs);
2695 gtk_container_set_border_width (GTK_CONTAINER (vbox_dialogs), 8);
2697 dialogs_table = gtk_table_new (2, 2, FALSE);
2698 gtk_widget_show (dialogs_table);
2699 gtk_container_add (GTK_CONTAINER (vbox_dialogs), dialogs_table);
2700 gtk_container_set_border_width (GTK_CONTAINER (dialogs_table), 4);
2701 gtk_table_set_row_spacings (GTK_TABLE (dialogs_table), VSPACING_NARROW);
2702 gtk_table_set_col_spacings (GTK_TABLE (dialogs_table), 8);
2704 /* Next Unread Message Dialog */
2705 label = gtk_label_new (_("Show no-unread-message dialog"));
2706 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2707 gtk_widget_show (label);
2708 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 0, 1,
2709 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2712 optmenu_nextunreadmsgdialog = gtk_option_menu_new ();
2713 gtk_widget_show (optmenu_nextunreadmsgdialog);
2714 gtk_table_attach (GTK_TABLE (dialogs_table),
2715 optmenu_nextunreadmsgdialog, 1, 2, 0, 1,
2716 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2718 menu = gtk_menu_new ();
2719 MENUITEM_ADD (menu, menuitem, _("Always"), NEXTUNREADMSGDIALOG_ALWAYS);
2720 MENUITEM_ADD (menu, menuitem, _("Assume 'Yes'"),
2721 NEXTUNREADMSGDIALOG_ASSUME_YES);
2722 MENUITEM_ADD (menu, menuitem, _("Assume 'No'"),
2723 NEXTUNREADMSGDIALOG_ASSUME_NO);
2725 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_nextunreadmsgdialog), menu);
2727 label = gtk_label_new (_("Show send dialog"));
2728 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2729 gtk_widget_show (label);
2730 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 1, 2,
2731 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2733 optmenu_senddialog = gtk_option_menu_new ();
2734 gtk_widget_show (optmenu_senddialog);
2735 gtk_table_attach (GTK_TABLE (dialogs_table),
2736 optmenu_senddialog, 1, 2, 1, 2,
2737 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2739 menu = gtk_menu_new ();
2740 MENUITEM_ADD (menu, menuitem, _("Always"), SEND_DIALOG_ALWAYS);
2741 MENUITEM_ADD (menu, menuitem, _("Never"), SEND_DIALOG_NEVER);
2743 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_senddialog), menu);
2745 label = gtk_label_new (_("Show receive dialog"));
2746 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2747 gtk_widget_show (label);
2748 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 2, 3,
2749 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2751 optmenu_recvdialog = gtk_option_menu_new ();
2752 gtk_widget_show (optmenu_recvdialog);
2753 gtk_table_attach (GTK_TABLE (dialogs_table), optmenu_recvdialog, 1, 2, 2, 3,
2754 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2756 menu = gtk_menu_new ();
2757 MENUITEM_ADD (menu, menuitem, _("Always"), RECV_DIALOG_ALWAYS);
2758 MENUITEM_ADD (menu, menuitem, _("Only if a window is active"),
2759 RECV_DIALOG_ACTIVE);
2760 MENUITEM_ADD (menu, menuitem, _("Never"), RECV_DIALOG_NEVER);
2762 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
2764 PACK_CHECK_BUTTON (vbox_dialogs, checkbtn_no_recv_err_panel,
2765 _("Don't popup error dialog on receive error"));
2767 PACK_CHECK_BUTTON (vbox_dialogs, checkbtn_close_recv_dialog,
2768 _("Close receive dialog when finished"));
2771 hbox1 = gtk_hbox_new (FALSE, 8);
2772 gtk_widget_show (hbox1);
2773 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2775 button_keybind = gtk_button_new_with_label (_(" Set key bindings... "));
2776 gtk_widget_show (button_keybind);
2777 gtk_box_pack_start (GTK_BOX (hbox1), button_keybind, FALSE, FALSE, 0);
2778 gtk_signal_connect (GTK_OBJECT (button_keybind), "clicked",
2779 GTK_SIGNAL_FUNC (prefs_keybind_select), NULL);
2781 PACK_FRAME(vbox1, frame_pixmap_theme, _("Icon theme"));
2783 vbox_pixmap_theme = gtk_vbox_new(FALSE, 0);
2784 gtk_widget_show(vbox_pixmap_theme);
2785 gtk_container_add(GTK_CONTAINER(frame_pixmap_theme), vbox_pixmap_theme);
2786 gtk_container_set_border_width(GTK_CONTAINER(vbox_pixmap_theme), 8);
2788 avail_pixmap_themes = stock_pixmap_themes_list_new();
2790 combo_pixmap_theme = gtk_combo_new ();
2791 gtk_widget_show (combo_pixmap_theme);
2792 gtk_box_pack_start (GTK_BOX (vbox_pixmap_theme), combo_pixmap_theme, TRUE, TRUE, 0);
2793 gtk_combo_set_popdown_strings(GTK_COMBO(combo_pixmap_theme), avail_pixmap_themes);
2794 entry_pixmap_theme = GTK_COMBO (combo_pixmap_theme)->entry;
2796 stock_pixmap_themes_list_free(avail_pixmap_themes);
2798 /* interface.checkbtn_emacs = checkbtn_emacs; */
2799 interface.checkbtn_show_msg_with_cursor
2800 = checkbtn_show_msg_with_cursor;
2801 interface.checkbtn_openunread = checkbtn_openunread;
2802 interface.checkbtn_mark_as_read_on_newwin
2803 = checkbtn_mark_as_read_on_newwin;
2804 interface.checkbtn_openinbox = checkbtn_openinbox;
2805 interface.checkbtn_immedexec = checkbtn_immedexec;
2806 interface.optmenu_recvdialog = optmenu_recvdialog;
2807 interface.optmenu_senddialog = optmenu_senddialog;
2808 interface.checkbtn_no_recv_err_panel = checkbtn_no_recv_err_panel;
2809 interface.checkbtn_close_recv_dialog = checkbtn_close_recv_dialog;
2810 interface.optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
2811 interface.combo_pixmap_theme = combo_pixmap_theme;
2812 interface.entry_pixmap_theme = entry_pixmap_theme;
2815 static void prefs_other_create(void)
2818 GtkWidget *ext_frame;
2819 GtkWidget *ext_table;
2822 GtkWidget *uri_label;
2823 GtkWidget *uri_combo;
2824 GtkWidget *uri_entry;
2826 GtkWidget *printcmd_label;
2827 GtkWidget *printcmd_entry;
2829 GtkWidget *exteditor_label;
2830 GtkWidget *exteditor_combo;
2831 GtkWidget *exteditor_entry;
2833 GtkWidget *frame_addr;
2834 GtkWidget *vbox_addr;
2835 GtkWidget *checkbtn_addaddrbyclick;
2837 GtkWidget *frame_cliplog;
2838 GtkWidget *vbox_cliplog;
2839 GtkWidget *hbox_cliplog;
2840 GtkWidget *checkbtn_cliplog;
2841 GtkWidget *loglength_label;
2842 GtkWidget *loglength_entry;
2844 GtkWidget *frame_exit;
2845 GtkWidget *vbox_exit;
2846 GtkWidget *checkbtn_confonexit;
2847 GtkWidget *checkbtn_cleanonexit;
2848 GtkWidget *checkbtn_askonclean;
2849 GtkWidget *checkbtn_warnqueued;
2852 GtkWidget *frame_ssl;
2853 GtkWidget *vbox_ssl;
2854 GtkWidget *hbox_ssl;
2855 GtkWidget *checkbtn_ssl_ask_unknown_valid;
2858 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2859 gtk_widget_show (vbox1);
2860 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2861 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2863 PACK_FRAME(vbox1, ext_frame,
2864 _("External commands (%s will be replaced with file name / URI)"));
2866 ext_table = gtk_table_new (3, 2, FALSE);
2867 gtk_widget_show (ext_table);
2868 gtk_container_add (GTK_CONTAINER (ext_frame), ext_table);
2869 gtk_container_set_border_width (GTK_CONTAINER (ext_table), 8);
2870 gtk_table_set_row_spacings (GTK_TABLE (ext_table), VSPACING_NARROW);
2871 gtk_table_set_col_spacings (GTK_TABLE (ext_table), 8);
2873 uri_label = gtk_label_new (_("Web browser"));
2874 gtk_widget_show(uri_label);
2875 gtk_table_attach (GTK_TABLE (ext_table), uri_label, 0, 1, 0, 1,
2876 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2877 gtk_misc_set_alignment (GTK_MISC (uri_label), 1, 0.5);
2879 uri_combo = gtk_combo_new ();
2880 gtk_widget_show (uri_combo);
2881 gtk_table_attach (GTK_TABLE (ext_table), uri_combo, 1, 2, 0, 1,
2882 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2883 gtkut_combo_set_items (GTK_COMBO (uri_combo),
2884 DEFAULT_BROWSER_CMD,
2885 "galeon --new-tab '%s'",
2887 "mozilla -remote 'openurl(%s,new-window)'",
2888 "netscape -remote 'openURL(%s, new-window)'",
2890 "gnome-moz-remote --newwin '%s'",
2891 "kfmclient openURL '%s'",
2892 "opera -newwindow '%s'",
2893 "kterm -e w3m '%s'",
2894 "kterm -e lynx '%s'",
2896 uri_entry = GTK_COMBO (uri_combo)->entry;
2898 printcmd_label = gtk_label_new (_("Print"));
2899 gtk_widget_show (printcmd_label);
2900 gtk_table_attach (GTK_TABLE (ext_table), printcmd_label, 0, 1, 1, 2,
2901 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2902 gtk_misc_set_alignment (GTK_MISC (printcmd_label), 1, 0.5);
2904 printcmd_entry = gtk_entry_new ();
2905 gtk_widget_show (printcmd_entry);
2906 gtk_table_attach (GTK_TABLE (ext_table), printcmd_entry, 1, 2, 1, 2,
2907 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2909 exteditor_label = gtk_label_new (_("Editor"));
2910 gtk_widget_show (exteditor_label);
2911 gtk_table_attach (GTK_TABLE (ext_table), exteditor_label, 0, 1, 2, 3,
2912 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2913 gtk_misc_set_alignment (GTK_MISC (exteditor_label), 1, 0.5);
2915 exteditor_combo = gtk_combo_new ();
2916 gtk_widget_show (exteditor_combo);
2917 gtk_table_attach (GTK_TABLE (ext_table), exteditor_combo, 1, 2, 2, 3,
2918 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2919 gtkut_combo_set_items (GTK_COMBO (exteditor_combo),
2922 "mgedit --no-fork %s",
2928 exteditor_entry = GTK_COMBO (exteditor_combo)->entry;
2930 PACK_FRAME (vbox1, frame_addr, _("Address book"));
2932 vbox_addr = gtk_vbox_new (FALSE, 0);
2933 gtk_widget_show (vbox_addr);
2934 gtk_container_add (GTK_CONTAINER (frame_addr), vbox_addr);
2935 gtk_container_set_border_width (GTK_CONTAINER (vbox_addr), 8);
2938 (vbox_addr, checkbtn_addaddrbyclick,
2939 _("Add address to destination when double-clicked"));
2942 PACK_FRAME (vbox1, frame_cliplog, _("Log Size"));
2944 vbox_cliplog = gtk_vbox_new (FALSE, 0);
2945 gtk_widget_show (vbox_cliplog);
2946 gtk_container_add (GTK_CONTAINER (frame_cliplog), vbox_cliplog);
2947 gtk_container_set_border_width (GTK_CONTAINER (vbox_cliplog), 8);
2948 PACK_CHECK_BUTTON (vbox_cliplog, checkbtn_cliplog,
2949 _("Clip the log size"));
2950 hbox_cliplog = gtk_hbox_new (FALSE, 3);
2951 gtk_container_add (GTK_CONTAINER (vbox_cliplog), hbox_cliplog);
2952 gtk_widget_show (hbox_cliplog);
2954 loglength_label = gtk_label_new (_("Log window length"));
2955 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
2957 gtk_widget_show (GTK_WIDGET (loglength_label));
2958 loglength_entry = gtk_entry_new ();
2959 gtk_widget_set_usize (GTK_WIDGET (loglength_entry), 64, -1);
2960 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_entry,
2962 gtk_widget_show (GTK_WIDGET (loglength_entry));
2963 loglength_label = gtk_label_new (_("(0 to stop logging in the log window)"));
2964 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
2966 SET_TOGGLE_SENSITIVITY(checkbtn_cliplog, loglength_entry);
2971 PACK_FRAME (vbox1, frame_ssl, _("Security"));
2973 vbox_ssl = gtk_vbox_new (FALSE, 0);
2974 gtk_widget_show (vbox_ssl);
2975 gtk_container_add (GTK_CONTAINER (frame_ssl), vbox_ssl);
2976 gtk_container_set_border_width (GTK_CONTAINER (vbox_ssl), 8);
2977 PACK_CHECK_BUTTON (vbox_ssl, checkbtn_ssl_ask_unknown_valid,
2978 _("Ask before accepting SSL certificates"));
2979 hbox_ssl = gtk_hbox_new (FALSE, 3);
2980 gtk_container_add (GTK_CONTAINER (vbox_ssl), hbox_ssl);
2981 gtk_widget_show (hbox_ssl);
2986 PACK_FRAME (vbox1, frame_exit, _("On exit"));
2988 vbox_exit = gtk_vbox_new (FALSE, 0);
2989 gtk_widget_show (vbox_exit);
2990 gtk_container_add (GTK_CONTAINER (frame_exit), vbox_exit);
2991 gtk_container_set_border_width (GTK_CONTAINER (vbox_exit), 8);
2993 PACK_CHECK_BUTTON (vbox_exit, checkbtn_confonexit,
2994 _("Confirm on exit"));
2996 hbox1 = gtk_hbox_new (FALSE, 32);
2997 gtk_widget_show (hbox1);
2998 gtk_box_pack_start (GTK_BOX (vbox_exit), hbox1, FALSE, FALSE, 0);
3000 PACK_CHECK_BUTTON (hbox1, checkbtn_cleanonexit,
3001 _("Empty trash on exit"));
3002 PACK_CHECK_BUTTON (hbox1, checkbtn_askonclean,
3003 _("Ask before emptying"));
3004 SET_TOGGLE_SENSITIVITY (checkbtn_cleanonexit, checkbtn_askonclean);
3006 PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
3007 _("Warn if there are queued messages"));
3009 other.uri_combo = uri_combo;
3010 other.uri_entry = uri_entry;
3011 other.printcmd_entry = printcmd_entry;
3013 other.exteditor_combo = exteditor_combo;
3014 other.exteditor_entry = exteditor_entry;
3016 other.checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
3018 other.checkbtn_cliplog = checkbtn_cliplog;
3019 other.loglength_entry = loglength_entry;
3021 other.checkbtn_confonexit = checkbtn_confonexit;
3022 other.checkbtn_cleanonexit = checkbtn_cleanonexit;
3023 other.checkbtn_askonclean = checkbtn_askonclean;
3024 other.checkbtn_warnqueued = checkbtn_warnqueued;
3028 other.checkbtn_ssl_ask_unknown_valid = checkbtn_ssl_ask_unknown_valid;
3033 static void date_format_ok_btn_clicked(GtkButton *button, GtkWidget **widget)
3035 GtkWidget *datefmt_sample = NULL;
3038 g_return_if_fail(widget != NULL);
3039 g_return_if_fail(*widget != NULL);
3040 g_return_if_fail(display.entry_datefmt != NULL);
3042 datefmt_sample = GTK_WIDGET(gtk_object_get_data
3043 (GTK_OBJECT(*widget), "datefmt_sample"));
3044 g_return_if_fail(datefmt_sample != NULL);
3046 text = gtk_editable_get_chars(GTK_EDITABLE(datefmt_sample), 0, -1);
3047 g_free(prefs_common.date_format);
3048 prefs_common.date_format = text;
3049 gtk_entry_set_text(GTK_ENTRY(display.entry_datefmt), text);
3051 gtk_widget_destroy(*widget);
3055 static void date_format_cancel_btn_clicked(GtkButton *button,
3058 g_return_if_fail(widget != NULL);
3059 g_return_if_fail(*widget != NULL);
3061 gtk_widget_destroy(*widget);
3065 static void date_format_key_pressed(GtkWidget *keywidget, GdkEventKey *event,
3068 if (event && event->keyval == GDK_Escape)
3069 date_format_cancel_btn_clicked(NULL, widget);
3072 static gboolean date_format_on_delete(GtkWidget *dialogwidget,
3073 GdkEventAny *event, GtkWidget **widget)
3075 g_return_val_if_fail(widget != NULL, FALSE);
3076 g_return_val_if_fail(*widget != NULL, FALSE);
3082 static void date_format_entry_on_change(GtkEditable *editable,
3086 struct tm *cal_time;
3090 cur_time = time(NULL);
3091 cal_time = localtime(&cur_time);
3093 text = gtk_editable_get_chars(editable, 0, -1);
3095 strftime(buffer, sizeof buffer, text, cal_time);
3097 gtk_label_set_text(example, buffer);
3100 static void date_format_select_row(GtkWidget *date_format_list, gint row,
3101 gint column, GdkEventButton *event,
3102 GtkWidget *date_format)
3108 GtkWidget *datefmt_sample;
3110 /* only on double click */
3111 if (!event || event->type != GDK_2BUTTON_PRESS) return;
3114 datefmt_sample = GTK_WIDGET(gtk_object_get_data
3115 (GTK_OBJECT(date_format), "datefmt_sample"));
3117 g_return_if_fail(date_format_list != NULL);
3118 g_return_if_fail(date_format != NULL);
3119 g_return_if_fail(datefmt_sample != NULL);
3121 /* get format from clist */
3122 gtk_clist_get_text(GTK_CLIST(date_format_list), row, 0, &format);
3124 cur_pos = gtk_editable_get_position(GTK_EDITABLE(datefmt_sample));
3125 old_format = gtk_entry_get_text(GTK_ENTRY(datefmt_sample));
3127 /* insert the format into the text entry */
3128 new_format = g_malloc(strlen(old_format) + 3);
3130 strncpy(new_format, old_format, cur_pos);
3131 new_format[cur_pos] = '\0';
3132 strcat(new_format, format);
3133 strcat(new_format, &old_format[cur_pos]);
3135 gtk_entry_set_text(GTK_ENTRY(datefmt_sample), new_format);
3136 gtk_editable_set_position(GTK_EDITABLE(datefmt_sample), cur_pos + 2);
3141 static GtkWidget *date_format_create(GtkButton *button, void *data)
3143 static GtkWidget *datefmt_win = NULL;
3145 GtkWidget *scrolledwindow1;
3146 GtkWidget *datefmt_clist;
3151 GtkWidget *confirm_area;
3153 GtkWidget *cancel_btn;
3154 GtkWidget *datefmt_entry;
3183 const gint TIME_FORMAT_ELEMS =
3184 sizeof time_format / sizeof time_format[0];
3186 time_format[0].txt = _("the full abbreviated weekday name");
3187 time_format[1].txt = _("the full weekday name");
3188 time_format[2].txt = _("the abbreviated month name");
3189 time_format[3].txt = _("the full month name");
3190 time_format[4].txt = _("the preferred date and time for the current locale");
3191 time_format[5].txt = _("the century number (year/100)");
3192 time_format[6].txt = _("the day of the month as a decimal number");
3193 time_format[7].txt = _("the hour as a decimal number using a 24-hour clock");
3194 time_format[8].txt = _("the hour as a decimal number using a 12-hour clock");
3195 time_format[9].txt = _("the day of the year as a decimal number");
3196 time_format[10].txt = _("the month as a decimal number");
3197 time_format[11].txt = _("the minute as a decimal number");
3198 time_format[12].txt = _("either AM or PM");
3199 time_format[13].txt = _("the second as a decimal number");
3200 time_format[14].txt = _("the day of the week as a decimal number");
3201 time_format[15].txt = _("the preferred date for the current locale");
3202 time_format[16].txt = _("the last two digits of a year");
3203 time_format[17].txt = _("the year as a decimal number");
3204 time_format[18].txt = _("the time zone or name or abbreviation");
3206 if (datefmt_win) return datefmt_win;
3208 datefmt_win = gtk_window_new(GTK_WINDOW_DIALOG);
3209 gtk_container_set_border_width(GTK_CONTAINER(datefmt_win), 8);
3210 gtk_window_set_title(GTK_WINDOW(datefmt_win), _("Date format"));
3211 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
3212 gtk_widget_set_usize(datefmt_win, 440, 280);
3214 vbox1 = gtk_vbox_new(FALSE, 10);
3215 gtk_widget_show(vbox1);
3216 gtk_container_add(GTK_CONTAINER(datefmt_win), vbox1);
3218 scrolledwindow1 = gtk_scrolled_window_new(NULL, NULL);
3219 gtk_scrolled_window_set_policy
3220 (GTK_SCROLLED_WINDOW(scrolledwindow1),
3221 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
3222 gtk_widget_show(scrolledwindow1);
3223 gtk_box_pack_start(GTK_BOX(vbox1), scrolledwindow1, TRUE, TRUE, 0);
3225 titles[0] = _("Specifier");
3226 titles[1] = _("Description");
3227 datefmt_clist = gtk_clist_new_with_titles(2, titles);
3228 gtk_widget_show(datefmt_clist);
3229 gtk_container_add(GTK_CONTAINER(scrolledwindow1), datefmt_clist);
3230 /* gtk_clist_set_column_width(GTK_CLIST(datefmt_clist), 0, 80); */
3231 gtk_clist_set_selection_mode(GTK_CLIST(datefmt_clist),
3232 GTK_SELECTION_BROWSE);
3234 for (i = 0; i < TIME_FORMAT_ELEMS; i++) {
3236 /* phoney casting necessary because of gtk... */
3237 text[0] = (gchar *)time_format[i].fmt;
3238 text[1] = (gchar *)time_format[i].txt;
3239 gtk_clist_append(GTK_CLIST(datefmt_clist), text);
3242 table = gtk_table_new(2, 2, FALSE);
3243 gtk_widget_show(table);
3244 gtk_box_pack_start(GTK_BOX(vbox1), table, FALSE, FALSE, 0);
3245 gtk_table_set_row_spacings(GTK_TABLE(table), 4);
3246 gtk_table_set_col_spacings(GTK_TABLE(table), 8);
3248 label1 = gtk_label_new(_("Date format"));
3249 gtk_widget_show(label1);
3250 gtk_table_attach(GTK_TABLE(table), label1, 0, 1, 0, 1,
3252 gtk_label_set_justify(GTK_LABEL(label1), GTK_JUSTIFY_LEFT);
3253 gtk_misc_set_alignment(GTK_MISC(label1), 0, 0.5);
3255 datefmt_entry = gtk_entry_new_with_max_length(256);
3256 gtk_widget_show(datefmt_entry);
3257 gtk_table_attach(GTK_TABLE(table), datefmt_entry, 1, 2, 0, 1,
3258 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3260 /* we need the "sample" entry box; add it as data so callbacks can
3261 * get the entry box */
3262 gtk_object_set_data(GTK_OBJECT(datefmt_win), "datefmt_sample",
3265 label2 = gtk_label_new(_("Example"));
3266 gtk_widget_show(label2);
3267 gtk_table_attach(GTK_TABLE(table), label2, 0, 1, 1, 2,
3269 gtk_label_set_justify(GTK_LABEL(label2), GTK_JUSTIFY_LEFT);
3270 gtk_misc_set_alignment(GTK_MISC(label2), 0, 0.5);
3272 label3 = gtk_label_new("");
3273 gtk_widget_show(label3);
3274 gtk_table_attach(GTK_TABLE(table), label3, 1, 2, 1, 2,
3275 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3276 gtk_label_set_justify(GTK_LABEL(label3), GTK_JUSTIFY_LEFT);
3277 gtk_misc_set_alignment(GTK_MISC(label3), 0, 0.5);
3279 gtkut_button_set_create(&confirm_area, &ok_btn, _("OK"),
3280 &cancel_btn, _("Cancel"), NULL, NULL);
3281 gtk_widget_grab_default(ok_btn);
3282 gtk_widget_show(confirm_area);
3284 gtk_box_pack_start(GTK_BOX(vbox1), confirm_area, FALSE, FALSE, 0);
3286 /* set the current format */
3287 gtk_entry_set_text(GTK_ENTRY(datefmt_entry), prefs_common.date_format);
3288 date_format_entry_on_change(GTK_EDITABLE(datefmt_entry),
3291 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
3292 GTK_SIGNAL_FUNC(date_format_ok_btn_clicked),
3294 gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
3295 GTK_SIGNAL_FUNC(date_format_cancel_btn_clicked),
3297 gtk_signal_connect(GTK_OBJECT(datefmt_win), "key_press_event",
3298 GTK_SIGNAL_FUNC(date_format_key_pressed),
3300 gtk_signal_connect(GTK_OBJECT(datefmt_win), "delete_event",
3301 GTK_SIGNAL_FUNC(date_format_on_delete),
3303 gtk_signal_connect(GTK_OBJECT(datefmt_entry), "changed",
3304 GTK_SIGNAL_FUNC(date_format_entry_on_change),
3307 gtk_signal_connect(GTK_OBJECT(datefmt_clist), "select_row",
3308 GTK_SIGNAL_FUNC(date_format_select_row),
3311 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
3312 gtk_window_set_modal(GTK_WINDOW(datefmt_win), TRUE);
3314 gtk_widget_show(datefmt_win);
3315 manage_window_set_transient(GTK_WINDOW(datefmt_win));
3317 gtk_widget_grab_focus(ok_btn);
3322 void prefs_quote_colors_dialog(void)
3324 if (!quote_color_win)
3325 prefs_quote_colors_dialog_create();
3326 gtk_widget_show(quote_color_win);
3327 manage_window_set_transient(GTK_WINDOW(quote_color_win));
3330 gtk_widget_hide(quote_color_win);
3332 textview_update_message_colors();
3333 main_window_reflect_prefs_all();
3336 static void prefs_quote_colors_dialog_create(void)
3341 GtkWidget *quotelevel1_label;
3342 GtkWidget *quotelevel2_label;
3343 GtkWidget *quotelevel3_label;
3344 GtkWidget *uri_label;
3345 GtkWidget *signature_label;
3346 GtkWidget *tgt_folder_label;
3349 GtkWidget *recycle_colors_btn;
3350 GtkWidget *frame_colors;
3352 window = gtk_window_new(GTK_WINDOW_DIALOG);
3353 gtk_container_set_border_width(GTK_CONTAINER(window), 2);
3354 gtk_window_set_title(GTK_WINDOW(window), _("Set message colors"));
3355 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
3356 gtk_window_set_modal(GTK_WINDOW(window), TRUE);
3357 gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
3359 vbox = gtk_vbox_new (FALSE, VSPACING);
3360 gtk_container_add (GTK_CONTAINER (window), vbox);
3361 gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
3362 PACK_FRAME(vbox, frame_colors, _("Colors"));
3364 table = gtk_table_new (5, 2, FALSE);
3365 gtk_container_add (GTK_CONTAINER (frame_colors), table);
3366 gtk_container_set_border_width (GTK_CONTAINER (table), 8);
3367 gtk_table_set_row_spacings (GTK_TABLE (table), 2);
3368 gtk_table_set_col_spacings (GTK_TABLE (table), 5);
3371 color_buttons.quote_level1_btn = gtk_button_new();
3372 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level1_btn,
3373 0, 1, 0, 1, 0, 0, 0, 0);
3374 gtk_widget_set_usize (color_buttons.quote_level1_btn, 40, 30);
3375 gtk_container_set_border_width
3376 (GTK_CONTAINER (color_buttons.quote_level1_btn), 5);
3378 color_buttons.quote_level2_btn = gtk_button_new();
3379 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level2_btn,
3380 0, 1, 1, 2, 0, 0, 0, 0);
3381 gtk_widget_set_usize (color_buttons.quote_level2_btn, 40, 30);
3382 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.quote_level2_btn), 5);
3384 color_buttons.quote_level3_btn = gtk_button_new_with_label ("");
3385 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level3_btn,
3386 0, 1, 2, 3, 0, 0, 0, 0);
3387 gtk_widget_set_usize (color_buttons.quote_level3_btn, 40, 30);
3388 gtk_container_set_border_width
3389 (GTK_CONTAINER (color_buttons.quote_level3_btn), 5);
3391 color_buttons.uri_btn = gtk_button_new_with_label ("");
3392 gtk_table_attach (GTK_TABLE (table), color_buttons.uri_btn,
3393 0, 1, 3, 4, 0, 0, 0, 0);
3394 gtk_widget_set_usize (color_buttons.uri_btn, 40, 30);
3395 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.uri_btn), 5);
3397 color_buttons.tgt_folder_btn = gtk_button_new_with_label ("");
3398 gtk_table_attach (GTK_TABLE (table), color_buttons.tgt_folder_btn,
3399 0, 1, 4, 5, 0, 0, 0, 0);
3400 gtk_widget_set_usize (color_buttons.tgt_folder_btn, 40, 30);
3401 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.tgt_folder_btn), 5);
3403 color_buttons.signature_btn = gtk_button_new_with_label ("");
3404 gtk_table_attach (GTK_TABLE (table), color_buttons.signature_btn,
3405 0, 1, 5, 6, 0, 0, 0, 0);
3406 gtk_widget_set_usize (color_buttons.signature_btn, 40, 30);
3407 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.signature_btn), 5);
3409 quotelevel1_label = gtk_label_new (_("Quoted Text - First Level"));
3410 gtk_table_attach (GTK_TABLE (table), quotelevel1_label, 1, 2, 0, 1,
3411 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3412 gtk_label_set_justify (GTK_LABEL (quotelevel1_label), GTK_JUSTIFY_LEFT);
3413 gtk_misc_set_alignment (GTK_MISC (quotelevel1_label), 0, 0.5);
3415 quotelevel2_label = gtk_label_new (_("Quoted Text - Second Level"));
3416 gtk_table_attach (GTK_TABLE (table), quotelevel2_label, 1, 2, 1, 2,
3417 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3418 gtk_label_set_justify (GTK_LABEL (quotelevel2_label), GTK_JUSTIFY_LEFT);
3419 gtk_misc_set_alignment (GTK_MISC (quotelevel2_label), 0, 0.5);
3421 quotelevel3_label = gtk_label_new (_("Quoted Text - Third Level"));
3422 gtk_table_attach (GTK_TABLE (table), quotelevel3_label, 1, 2, 2, 3,
3423 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3424 gtk_label_set_justify (GTK_LABEL (quotelevel3_label), GTK_JUSTIFY_LEFT);
3425 gtk_misc_set_alignment (GTK_MISC (quotelevel3_label), 0, 0.5);
3427 uri_label = gtk_label_new (_("URI link"));
3428 gtk_table_attach (GTK_TABLE (table), uri_label, 1, 2, 3, 4,
3429 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3430 gtk_label_set_justify (GTK_LABEL (uri_label), GTK_JUSTIFY_LEFT);
3431 gtk_misc_set_alignment (GTK_MISC (uri_label), 0, 0.5);
3433 tgt_folder_label = gtk_label_new (_("Target folder"));
3434 gtk_table_attach (GTK_TABLE (table), tgt_folder_label, 1, 2, 4, 5,
3435 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3436 gtk_label_set_justify (GTK_LABEL (tgt_folder_label), GTK_JUSTIFY_LEFT);
3437 gtk_misc_set_alignment (GTK_MISC (tgt_folder_label), 0, 0.5);
3439 signature_label = gtk_label_new (_("Signatures"));
3440 gtk_table_attach (GTK_TABLE (table), signature_label, 1, 2, 5, 6,
3441 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3442 gtk_label_set_justify (GTK_LABEL (signature_label), GTK_JUSTIFY_LEFT);
3443 gtk_misc_set_alignment (GTK_MISC (signature_label), 0, 0.5);
3445 PACK_CHECK_BUTTON (vbox, recycle_colors_btn,
3446 _("Recycle quote colors"));
3448 gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
3449 NULL, NULL, NULL, NULL);
3450 gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
3452 gtk_widget_grab_default(ok_btn);
3453 MANAGE_WINDOW_SIGNALS_CONNECT(window);
3454 gtk_signal_connect(GTK_OBJECT(window), "delete_event",
3455 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3456 gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
3457 GTK_SIGNAL_FUNC(prefs_quote_colors_key_pressed),
3460 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level1_btn), "clicked",
3461 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL1");
3462 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level2_btn), "clicked",
3463 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL2");
3464 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level3_btn), "clicked",
3465 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL3");
3466 gtk_signal_connect(GTK_OBJECT(color_buttons.uri_btn), "clicked",
3467 GTK_SIGNAL_FUNC(quote_color_set_dialog), "URI");
3468 gtk_signal_connect(GTK_OBJECT(color_buttons.tgt_folder_btn), "clicked",
3469 GTK_SIGNAL_FUNC(quote_color_set_dialog), "TGTFLD");
3470 gtk_signal_connect(GTK_OBJECT(color_buttons.signature_btn), "clicked",
3471 GTK_SIGNAL_FUNC(quote_color_set_dialog), "SIGNATURE");
3472 gtk_signal_connect(GTK_OBJECT(recycle_colors_btn), "toggled",
3473 GTK_SIGNAL_FUNC(prefs_recycle_colors_toggled), NULL);
3474 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
3475 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3477 /* show message button colors and recycle options */
3478 set_button_bg_color(color_buttons.quote_level1_btn,
3479 prefs_common.quote_level1_col);
3480 set_button_bg_color(color_buttons.quote_level2_btn,
3481 prefs_common.quote_level2_col);
3482 set_button_bg_color(color_buttons.quote_level3_btn,
3483 prefs_common.quote_level3_col);
3484 set_button_bg_color(color_buttons.uri_btn,
3485 prefs_common.uri_col);
3486 set_button_bg_color(color_buttons.tgt_folder_btn,
3487 prefs_common.tgt_folder_col);
3488 set_button_bg_color(color_buttons.signature_btn,
3489 prefs_common.signature_col);
3490 gtk_toggle_button_set_active((GtkToggleButton *)recycle_colors_btn,
3491 prefs_common.recycle_quote_colors);
3493 gtk_widget_show_all(vbox);
3494 quote_color_win = window;
3497 static void prefs_quote_colors_key_pressed(GtkWidget *widget,
3498 GdkEventKey *event, gpointer data)
3500 if (event && event->keyval == GDK_Escape)
3504 static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
3506 gchar *type = (gchar *)data;
3507 gchar *title = NULL;
3508 gdouble color[4] = {0.0, 0.0, 0.0, 0.0};
3510 GtkColorSelectionDialog *dialog;
3512 if(g_strcasecmp(type, "LEVEL1") == 0) {
3513 title = _("Pick color for quotation level 1");
3514 rgbvalue = prefs_common.quote_level1_col;
3515 } else if(g_strcasecmp(type, "LEVEL2") == 0) {
3516 title = _("Pick color for quotation level 2");
3517 rgbvalue = prefs_common.quote_level2_col;
3518 } else if(g_strcasecmp(type, "LEVEL3") == 0) {
3519 title = _("Pick color for quotation level 3");
3520 rgbvalue = prefs_common.quote_level3_col;
3521 } else if(g_strcasecmp(type, "URI") == 0) {
3522 title = _("Pick color for URI");
3523 rgbvalue = prefs_common.uri_col;
3524 } else if(g_strcasecmp(type, "TGTFLD") == 0) {
3525 title = _("Pick color for target folder");
3526 rgbvalue = prefs_common.tgt_folder_col;
3527 } else if(g_strcasecmp(type, "SIGNATURE") == 0) {
3528 title = _("Pick color for signatures");
3529 rgbvalue = prefs_common.signature_col;
3531 } else if(g_strcasecmp(type, "Misspelled word") == 0) {
3532 title = _("Pick color for misspelled word");
3533 rgbvalue = prefs_common.misspelled_col;
3535 } else { /* Should never be called */
3536 g_warning("Unrecognized datatype '%s' in quote_color_set_dialog\n", type);
3540 color_dialog = gtk_color_selection_dialog_new(title);
3541 gtk_window_set_position(GTK_WINDOW(color_dialog), GTK_WIN_POS_CENTER);
3542 gtk_window_set_modal(GTK_WINDOW(color_dialog), TRUE);
3543 gtk_window_set_policy(GTK_WINDOW(color_dialog), FALSE, FALSE, FALSE);
3544 manage_window_set_transient(GTK_WINDOW(color_dialog));
3546 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->ok_button),
3547 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_ok), data);
3548 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->cancel_button),
3549 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_cancel), data);
3550 gtk_signal_connect(GTK_OBJECT(color_dialog), "key_press_event",
3551 GTK_SIGNAL_FUNC(quote_colors_set_dialog_key_pressed),
3554 /* preselect the previous color in the color selection dialog */
3555 color[0] = (gdouble) ((rgbvalue & 0xff0000) >> 16) / 255.0;
3556 color[1] = (gdouble) ((rgbvalue & 0x00ff00) >> 8) / 255.0;
3557 color[2] = (gdouble) (rgbvalue & 0x0000ff) / 255.0;
3558 dialog = GTK_COLOR_SELECTION_DIALOG(color_dialog);
3559 gtk_color_selection_set_color
3560 (GTK_COLOR_SELECTION(dialog->colorsel), color);
3562 gtk_widget_show(color_dialog);
3565 static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
3567 GtkColorSelection *colorsel = (GtkColorSelection *)
3568 ((GtkColorSelectionDialog *)color_dialog)->colorsel;
3570 gint red, green, blue, rgbvalue;
3571 gchar *type = (gchar *)data;
3573 gtk_color_selection_get_color(colorsel, color);
3575 red = (gint) (color[0] * 255.0);
3576 green = (gint) (color[1] * 255.0);
3577 blue = (gint) (color[2] * 255.0);
3578 rgbvalue = (gint) ((red * 0x10000) | (green * 0x100) | blue);
3581 fprintf(stderr, "redc = %f, greenc = %f, bluec = %f\n", color[0], color[1], color[2]);
3582 fprintf(stderr, "red = %d, green = %d, blue = %d\n", red, green, blue);
3583 fprintf(stderr, "Color is %x\n", rgbvalue);
3586 if (g_strcasecmp(type, "LEVEL1") == 0) {
3587 prefs_common.quote_level1_col = rgbvalue;
3588 set_button_bg_color(color_buttons.quote_level1_btn, rgbvalue);
3589 } else if (g_strcasecmp(type, "LEVEL2") == 0) {
3590 prefs_common.quote_level2_col = rgbvalue;
3591 set_button_bg_color(color_buttons.quote_level2_btn, rgbvalue);
3592 } else if (g_strcasecmp(type, "LEVEL3") == 0) {
3593 prefs_common.quote_level3_col = rgbvalue;
3594 set_button_bg_color(color_buttons.quote_level3_btn, rgbvalue);
3595 } else if (g_strcasecmp(type, "URI") == 0) {
3596 prefs_common.uri_col = rgbvalue;
3597 set_button_bg_color(color_buttons.uri_btn, rgbvalue);
3598 } else if (g_strcasecmp(type, "TGTFLD") == 0) {
3599 prefs_common.tgt_folder_col = rgbvalue;
3600 set_button_bg_color(color_buttons.tgt_folder_btn, rgbvalue);
3601 folderview_set_target_folder_color(prefs_common.tgt_folder_col);
3602 } else if (g_strcasecmp(type, "SIGNATURE") == 0) {
3603 prefs_common.signature_col = rgbvalue;
3604 set_button_bg_color(color_buttons.signature_btn, rgbvalue);
3606 } else if (g_strcasecmp(type, "Misspelled word") == 0) {
3607 prefs_common.misspelled_col = rgbvalue;
3608 set_button_bg_color(spelling.misspelled_btn, rgbvalue);
3611 fprintf( stderr, "Unrecognized datatype '%s' in quote_color_set_dialog_ok\n", type );
3613 gtk_widget_destroy(color_dialog);
3616 static void quote_colors_set_dialog_cancel(GtkWidget *widget, gpointer data)
3618 gtk_widget_destroy(color_dialog);
3621 static void quote_colors_set_dialog_key_pressed(GtkWidget *widget,
3625 gtk_widget_destroy(color_dialog);
3628 static void set_button_bg_color(GtkWidget *widget, gint rgbvalue)
3633 gtkut_convert_int_to_gdk_color(rgbvalue, &color);
3634 newstyle = gtk_style_copy(gtk_widget_get_default_style());
3635 newstyle->bg[GTK_STATE_NORMAL] = color;
3636 newstyle->bg[GTK_STATE_PRELIGHT] = color;
3637 newstyle->bg[GTK_STATE_ACTIVE] = color;
3639 gtk_widget_set_style(GTK_WIDGET(widget), newstyle);
3642 static void prefs_enable_message_color_toggled(void)
3646 is_active = gtk_toggle_button_get_active
3647 (GTK_TOGGLE_BUTTON(message.chkbtn_enablecol));
3648 gtk_widget_set_sensitive(message.button_edit_col, is_active);
3649 prefs_common.enable_color = is_active;
3652 static void prefs_recycle_colors_toggled(GtkWidget *widget)
3656 is_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
3657 prefs_common.recycle_quote_colors = is_active;
3660 static void prefs_font_select(GtkButton *button, GtkEntry *entry)
3664 g_return_if_fail(entry != NULL);
3666 if (!font_sel_win) {
3667 font_sel_win = gtk_font_selection_dialog_new
3668 (_("Font selection"));
3669 gtk_window_position(GTK_WINDOW(font_sel_win),
3670 GTK_WIN_POS_CENTER);
3671 gtk_signal_connect(GTK_OBJECT(font_sel_win), "delete_event",
3672 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3675 (GTK_OBJECT(font_sel_win), "key_press_event",
3676 GTK_SIGNAL_FUNC(prefs_font_selection_key_pressed),
3678 gtk_signal_connect_object
3679 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->cancel_button),
3681 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3682 GTK_OBJECT(font_sel_win));
3685 if(font_sel_conn_id) {
3686 gtk_signal_disconnect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button), font_sel_conn_id);
3688 font_sel_conn_id = gtk_signal_connect
3689 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button),
3691 GTK_SIGNAL_FUNC(prefs_font_selection_ok),
3693 printf("%i\n", font_sel_conn_id);
3695 font_name = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
3696 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(font_sel_win), font_name);
3698 manage_window_set_transient(GTK_WINDOW(font_sel_win));
3699 gtk_window_set_modal(GTK_WINDOW(font_sel_win), TRUE);
3700 gtk_widget_grab_focus
3701 (GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button);
3702 gtk_widget_show(font_sel_win);
3705 static void prefs_font_selection_key_pressed(GtkWidget *widget,
3709 if (event && event->keyval == GDK_Escape)
3710 gtk_widget_hide(font_sel_win);
3713 static void prefs_font_selection_ok(GtkButton *button, GtkEntry *entry)
3717 fontname = gtk_font_selection_dialog_get_font_name
3718 (GTK_FONT_SELECTION_DIALOG(font_sel_win));
3721 gtk_entry_set_text(entry, fontname);
3726 gtk_widget_hide(font_sel_win);
3729 static void prefs_keybind_select(void)
3736 GtkWidget *confirm_area;
3738 GtkWidget *cancel_btn;
3740 window = gtk_window_new (GTK_WINDOW_DIALOG);
3741 gtk_container_set_border_width (GTK_CONTAINER (window), 8);
3742 gtk_window_set_title (GTK_WINDOW (window), _("Key bindings"));
3743 gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
3744 gtk_window_set_modal (GTK_WINDOW (window), TRUE);
3745 gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, FALSE);
3746 manage_window_set_transient (GTK_WINDOW (window));
3748 vbox1 = gtk_vbox_new (FALSE, VSPACING);
3749 gtk_container_add (GTK_CONTAINER (window), vbox1);
3750 gtk_container_set_border_width (GTK_CONTAINER (vbox1), 2);
3752 hbox1 = gtk_hbox_new (FALSE, 8);
3753 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3755 label = gtk_label_new
3756 (_("Select preset:"));
3757 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
3758 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
3760 hbox1 = gtk_hbox_new (FALSE, 8);
3761 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3763 combo = gtk_combo_new ();
3764 gtk_box_pack_start (GTK_BOX (hbox1), combo, TRUE, TRUE, 0);
3765 gtkut_combo_set_items (GTK_COMBO (combo),
3771 gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE);
3773 hbox1 = gtk_hbox_new (FALSE, 8);
3774 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3776 label = gtk_label_new
3777 (_("You can also modify each menu shortcut by pressing\n"
3778 "any key(s) when placing the mouse pointer on the item."));
3779 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
3780 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
3782 hbox1 = gtk_hbox_new (FALSE, 8);
3783 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3785 gtkut_button_set_create (&confirm_area, &ok_btn, _("OK"),
3786 &cancel_btn, _("Cancel"), NULL, NULL);
3787 gtk_box_pack_end (GTK_BOX (hbox1), confirm_area, FALSE, FALSE, 0);
3788 gtk_widget_grab_default (ok_btn);
3790 MANAGE_WINDOW_SIGNALS_CONNECT(window);
3791 gtk_signal_connect (GTK_OBJECT (window), "delete_event",
3792 GTK_SIGNAL_FUNC (prefs_keybind_deleted), NULL);
3793 gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
3794 GTK_SIGNAL_FUNC (prefs_keybind_key_pressed), NULL);
3795 gtk_signal_connect (GTK_OBJECT (ok_btn), "clicked",
3796 GTK_SIGNAL_FUNC (prefs_keybind_apply_clicked),
3798 gtk_signal_connect (GTK_OBJECT (cancel_btn), "clicked",
3799 GTK_SIGNAL_FUNC (prefs_keybind_cancel),
3802 gtk_widget_show_all(window);
3804 keybind.window = window;
3805 keybind.combo = combo;
3808 static void prefs_keybind_key_pressed(GtkWidget *widget, GdkEventKey *event,
3811 if (event && event->keyval == GDK_Escape)
3812 prefs_keybind_cancel();
3815 static gint prefs_keybind_deleted(GtkWidget *widget, GdkEventAny *event,
3818 prefs_keybind_cancel();
3822 static void prefs_keybind_cancel(void)
3824 gtk_widget_destroy(keybind.window);
3825 keybind.window = NULL;
3826 keybind.combo = NULL;
3829 static void prefs_keybind_apply_clicked(GtkWidget *widget)
3831 GtkEntry *entry = GTK_ENTRY(GTK_COMBO(keybind.combo)->entry);
3835 static gchar *default_menurc =
3836 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3837 "(menu-path \"<Main>/File/Save as...\" \"<control>S\")\n"
3838 "(menu-path \"<Main>/File/Print...\" \"\")\n"
3839 "(menu-path \"<Main>/File/Exit\" \"<control>Q\")\n"
3841 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3842 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3843 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3844 "(menu-path \"<Main>/Edit/Search folder...\" \"<shift><control>F\")\n"
3846 "(menu-path \"<Main>/View/Expand Summary View\" \"V\")\n"
3847 "(menu-path \"<Main>/View/Expand Message View\" \"<shift>V\")\n"
3848 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3849 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3850 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3851 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3852 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3853 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3854 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3855 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3856 "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
3857 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3859 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3860 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3861 "(menu-path \"<Main>/Message/Compose an email message\" \"<control>M\")\n"
3862 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3863 "(menu-path \"<Main>/Message/Reply to/all\" \"<shift><control>R\")\n"
3864 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
3865 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
3866 "(menu-path \"<Main>/Message/Forward\" \"<control><alt>F\")\n"
3867 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
3868 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3869 "(menu-path \"<Main>/Message/Copy...\" \"<shift><control>O\")\n"
3870 "(menu-path \"<Main>/Message/Delete\" \"<control>D\")\n"
3871 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3872 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3873 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3874 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3876 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3877 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3878 "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
3880 "(menu-path \"<Compose>/File/Close\" \"<control>W\")\n"
3881 "(menu-path \"<Compose>/Edit/Select all\" \"<control>A\")\n"
3882 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
3883 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
3884 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
3885 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
3886 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
3888 static gchar *mew_wl_menurc =
3889 "(menu-path \"<Main>/File/Empty trash\" \"<shift>D\")\n"
3890 "(menu-path \"<Main>/File/Save as...\" \"Y\")\n"
3891 "(menu-path \"<Main>/File/Print...\" \"<shift>numbersign\")\n"
3892 "(menu-path \"<Main>/File/Exit\" \"<shift>Q\")\n"
3894 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3895 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3896 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3897 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
3899 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
3900 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
3901 "(menu-path \"<Main>/View/Thread view\" \"<shift>T\")\n"
3902 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3903 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3904 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3905 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3906 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3907 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3908 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3909 "(menu-path \"<Main>/View/Show all headers\" \"<shift>H\")\n"
3910 "(menu-path \"<Main>/View/Update\" \"<shift>S\")\n"
3912 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3913 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3914 "(menu-path \"<Main>/Message/Compose an email message\" \"W\")\n"
3915 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3916 "(menu-path \"<Main>/Message/Reply to/all\" \"<shift>A\")\n"
3917 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
3918 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
3919 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3920 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift>F\")\n" */
3921 "(menu-path \"<Main>/Message/Move...\" \"O\")\n"
3922 "(menu-path \"<Main>/Message/Copy...\" \"<shift>O\")\n"
3923 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3924 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3925 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3926 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3927 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"<shift>R\")\n"
3929 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3930 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3931 "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
3933 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3934 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3935 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3936 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3937 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3938 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3939 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3941 static gchar *mutt_menurc =
3942 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3943 "(menu-path \"<Main>/File/Save as...\" \"S\")\n"
3944 "(menu-path \"<Main>/File/Print...\" \"P\")\n"
3945 "(menu-path \"<Main>/File/Exit\" \"Q\")\n"
3947 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3948 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3949 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3950 "(menu-path \"<Main>/Edit/Search messages...\" \"slash\")\n"
3952 "(menu-path \"<Main>/View/Toggle summary view\" \"V\")\n"
3953 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3954 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
3955 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
3956 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
3957 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
3958 "(menu-path \"<Main>/View/Go to/Other folder...\" \"C\")\n"
3959 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3960 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3961 "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
3962 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3964 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3965 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3966 "(menu-path \"<Main>/Message/Compose new message\" \"M\")\n"
3967 "(menu-path \"<Main>/Message/Reply\" \"R\")\n"
3968 "(menu-path \"<Main>/Message/Reply to/all\" \"G\")\n"
3969 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
3970 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
3971 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3972 "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n"
3973 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3974 "(menu-path \"<Main>/Message/Copy...\" \"<shift>C\")\n"
3975 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3976 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>F\")\n"
3977 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3978 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>N\")\n"
3979 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3981 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3982 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3983 "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
3985 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3986 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3987 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3988 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3989 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3990 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3991 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3993 static gchar *old_sylpheed_menurc =
3994 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3995 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
3996 "(menu-path \"<Main>/File/Print...\" \"<alt>P\")\n"
3997 "(menu-path \"<Main>/File/Exit\" \"<alt>Q\")\n"
3999 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
4000 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
4001 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
4002 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
4004 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
4005 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
4006 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
4007 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
4008 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
4009 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
4010 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
4011 "(menu-path \"<Main>/View/Go to/Other folder...\" \"<alt>G\")\n"
4012 "(menu-path \"<Main>/View/Open in new window\" \"<shift><control>N\")\n"
4013 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
4014 "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
4015 "(menu-path \"<Main>/View/Update\" \"<alt>U\")\n"
4017 "(menu-path \"<Main>/Message/Get new mail\" \"<alt>I\")\n"
4018 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><alt>I\")\n"
4019 "(menu-path \"<Main>/Message/Compose an email message\" \"<alt>N\")\n"
4020 "(menu-path \"<Main>/Message/Reply\" \"<alt>R\")\n"
4021 "(menu-path \"<Main>/Message/Reply to/all\" \"<shift><alt>R\")\n"
4022 "(menu-path \"<Main>/Message/Reply to/sender\" \"<control><alt>R\")\n"
4023 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
4024 "(menu-path \"<Main>/Message/Forward\" \"<shift><alt>F\")\n"
4025 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift><control>F\")\n" */
4026 "(menu-path \"<Main>/Message/Move...\" \"<alt>O\")\n"
4027 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
4028 "(menu-path \"<Main>/Message/Delete\" \"<alt>D\")\n"
4029 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
4030 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
4031 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
4032 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
4034 "(menu-path \"<Main>/Tools/Address book\" \"<alt>A\")\n"
4035 "(menu-path \"<Main>/Tools/Execute\" \"<alt>X\")\n"
4036 "(menu-path \"<Main>/Tools/Log window\" \"<alt>L\")\n"
4038 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
4039 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
4040 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
4041 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
4042 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
4043 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
4044 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
4046 static gchar *empty_menurc =
4047 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
4048 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
4049 "(menu-path \"<Main>/File/Print...\" \"\")\n"
4050 "(menu-path \"<Main>/File/Exit\" \"\")\n"
4052 "(menu-path \"<Main>/Edit/Copy\" \"\")\n"
4053 "(menu-path \"<Main>/Edit/Select all\" \"\")\n"
4054 "(menu-path \"<Main>/Edit/Find in current message...\" \"\")\n"
4055 "(menu-path \"<Main>/Edit/Search folder...\" \"\")\n"
4057 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
4058 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
4059 "(menu-path \"<Main>/View/Thread view\" \"\")\n"
4060 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
4061 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
4062 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
4063 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
4064 "(menu-path \"<Main>/View/Go to/Other folder...\" \"\")\n"
4065 "(menu-path \"<Main>/View/Open in new window\" \"\")\n"
4066 "(menu-path \"<Main>/View/View source\" \"\")\n"
4067 "(menu-path \"<Main>/View/Show all headers\" \"\")\n"
4068 "(menu-path \"<Main>/View/Update\" \"\")\n"
4070 "(menu-path \"<Main>/Message/Get new mail\" \"\")\n"
4071 "(menu-path \"<Main>/Message/Get from all accounts\" \"\")\n"
4072 "(menu-path \"<Main>/Message/Compose an email message\" \"\")\n"
4073 "(menu-path \"<Main>/Message/Reply\" \"\")\n"
4074 "(menu-path \"<Main>/Message/Reply to/all\" \"\")\n"
4075 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
4076 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"\")\n"
4077 "(menu-path \"<Main>/Message/Forward\" \"\")\n"
4078 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
4079 "(menu-path \"<Main>/Message/Move...\" \"\")\n"
4080 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
4081 "(menu-path \"<Main>/Message/Delete\" \"\")\n"
4082 "(menu-path \"<Main>/Message/Mark/Mark\" \"\")\n"
4083 "(menu-path \"<Main>/Message/Mark/Unmark\" \"\")\n"
4084 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"\")\n"
4085 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
4087 "(menu-path \"<Main>/Tools/Address book\" \"\")\n"
4088 "(menu-path \"<Main>/Tools/Execute\" \"\")\n"
4089 "(menu-path \"<Main>/Tools/Log window\" \"\")\n"
4091 "(menu-path \"<Compose>/File/Close\" \"\")\n"
4092 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
4093 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
4094 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
4095 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
4096 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
4097 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
4099 text = gtk_entry_get_text(entry);
4101 if (!strcmp(text, _("Default")))
4102 rc_str = default_menurc;
4103 else if (!strcmp(text, "Mew / Wanderlust"))
4104 rc_str = mew_wl_menurc;
4105 else if (!strcmp(text, "Mutt"))
4106 rc_str = mutt_menurc;
4107 else if (!strcmp(text, _("Old Sylpheed")))
4108 rc_str = old_sylpheed_menurc;
4112 gtk_item_factory_parse_rc_string(empty_menurc);
4113 gtk_item_factory_parse_rc_string(rc_str);
4115 gtk_widget_destroy(keybind.window);
4116 keybind.window = NULL;
4117 keybind.combo = NULL;
4120 static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam)
4123 GtkWidget *menuitem;
4126 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4127 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4128 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
4129 g_free(*((gchar **)pparam->data));
4130 *((gchar **)pparam->data) = g_strdup(charset);
4133 static void prefs_common_charset_set_optmenu(PrefParam *pparam)
4135 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4138 g_return_if_fail(optmenu != NULL);
4139 g_return_if_fail(*((gchar **)pparam->data) != NULL);
4141 index = menu_find_option_menu_index(optmenu, *((gchar **)pparam->data),
4142 (GCompareFunc)strcmp);
4144 gtk_option_menu_set_history(optmenu, index);
4146 gtk_option_menu_set_history(optmenu, 0);
4147 prefs_common_charset_set_data_from_optmenu(pparam);
4151 static void prefs_common_encoding_set_data_from_optmenu(PrefParam *pparam)
4154 GtkWidget *menuitem;
4156 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4157 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4158 *((TransferEncodingMethod *)pparam->data) = GPOINTER_TO_INT
4159 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4162 static void prefs_common_encoding_set_optmenu(PrefParam *pparam)
4164 TransferEncodingMethod method =
4165 *((TransferEncodingMethod *)pparam->data);
4166 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4169 g_return_if_fail(optmenu != NULL);
4171 index = menu_find_option_menu_index(optmenu, GINT_TO_POINTER(method),
4174 gtk_option_menu_set_history(optmenu, index);
4176 gtk_option_menu_set_history(optmenu, 0);
4177 prefs_common_encoding_set_data_from_optmenu(pparam);
4181 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam)
4184 GtkWidget *menuitem;
4186 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4187 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4188 *((RecvDialogMode *)pparam->data) = GPOINTER_TO_INT
4189 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4192 static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
4194 RecvDialogMode mode = *((RecvDialogMode *)pparam->data);
4195 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4197 GtkWidget *menuitem;
4200 index = menu_find_option_menu_index(optmenu, GINT_TO_POINTER(mode),
4203 gtk_option_menu_set_history(optmenu, index);
4205 gtk_option_menu_set_history(optmenu, 0);
4206 prefs_common_recv_dialog_set_data_from_optmenu(pparam);
4209 menu = gtk_option_menu_get_menu(optmenu);
4210 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4211 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4214 static void prefs_common_send_dialog_set_data_from_optmenu(PrefParam *pparam)
4217 GtkWidget *menuitem;
4219 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4220 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4221 *((SendDialogMode *)pparam->data) = GPOINTER_TO_INT
4222 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4225 static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam)
4227 SendDialogMode mode = *((SendDialogMode *)pparam->data);
4228 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4230 GtkWidget *menuitem;
4233 case SEND_DIALOG_ALWAYS:
4234 gtk_option_menu_set_history(optmenu, 0);
4236 case SEND_DIALOG_NEVER:
4237 gtk_option_menu_set_history(optmenu, 1);
4243 menu = gtk_option_menu_get_menu(optmenu);
4244 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4245 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4248 static gint prefs_common_deleted(GtkWidget *widget, GdkEventAny *event,
4251 prefs_common_cancel();
4255 static void prefs_common_key_pressed(GtkWidget *widget, GdkEventKey *event,
4258 if (event && event->keyval == GDK_Escape)
4259 prefs_common_cancel();
4262 static void prefs_common_ok(void)
4264 prefs_common_apply();
4265 gtk_widget_hide(dialog.window);
4270 static void prefs_common_apply(void)
4272 gchar *entry_pixmap_theme_str;
4273 gboolean update_pixmap_theme;
4275 entry_pixmap_theme_str = gtk_entry_get_text(GTK_ENTRY(interface.entry_pixmap_theme));
4276 if (entry_pixmap_theme_str &&
4277 (strcmp(prefs_common.pixmap_theme_path, entry_pixmap_theme_str) != 0) )
4278 update_pixmap_theme = TRUE;
4280 update_pixmap_theme = FALSE;
4282 prefs_set_data_from_dialog(param);
4284 if (update_pixmap_theme)
4286 main_window_reflect_prefs_all_real(TRUE);
4287 compose_reflect_prefs_pixmap_theme();
4289 main_window_reflect_prefs_all_real(FALSE);
4291 prefs_common_save_config();
4293 inc_autocheck_timer_remove();
4294 inc_autocheck_timer_set();
4297 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam)
4300 GtkWidget *menuitem;
4302 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4303 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4304 *((NextUnreadMsgDialogShow *)pparam->data) = GPOINTER_TO_INT
4305 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4308 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam)
4310 NextUnreadMsgDialogShow dialog_show;
4311 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4313 GtkWidget *menuitem;
4315 dialog_show = *((NextUnreadMsgDialogShow *)pparam->data);
4317 switch (dialog_show) {
4318 case NEXTUNREADMSGDIALOG_ALWAYS:
4319 gtk_option_menu_set_history(optmenu, 0);
4321 case NEXTUNREADMSGDIALOG_ASSUME_YES:
4322 gtk_option_menu_set_history(optmenu, 1);
4324 case NEXTUNREADMSGDIALOG_ASSUME_NO:
4325 gtk_option_menu_set_history(optmenu, 2);
4329 menu = gtk_option_menu_get_menu(optmenu);
4330 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4331 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4334 static void prefs_common_cancel(void)
4336 gtk_widget_hide(dialog.window);
4341 /* static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
4344 GtkWidget *menuitem;
4346 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4347 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4348 *((RecvDialogShow *)pparam->data) = GPOINTER_TO_INT
4349 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4352 /* static void prefs_recvdialog_set_optmenu(PrefParam *pparam)
4354 RecvDialogShow dialog_show;
4355 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4357 GtkWidget *menuitem;
4359 dialog_show = *((RecvDialogShow *)pparam->data);
4361 switch (dialog_show) {
4362 case RECVDIALOG_ALWAYS:
4363 gtk_option_menu_set_history(optmenu, 0);
4365 case RECVDIALOG_WINDOW_ACTIVE:
4366 gtk_option_menu_set_history(optmenu, 1);
4368 case RECVDIALOG_NEVER:
4369 gtk_option_menu_set_history(optmenu, 2);
4374 menu = gtk_option_menu_get_menu(optmenu);
4375 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4376 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));