2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2002 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>
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;
89 GtkWidget *spinbtn_maxarticle;
90 GtkObject *spinbtn_maxarticle_adj;
94 GtkWidget *checkbtn_extsend;
95 GtkWidget *entry_extsend;
96 GtkWidget *button_extsend;
98 GtkWidget *checkbtn_savemsg;
99 GtkWidget *checkbtn_queuemsg;
101 GtkWidget *optmenu_charset;
104 static struct Compose {
105 GtkWidget *checkbtn_autosig;
106 GtkWidget *entry_sigsep;
108 GtkWidget *entry_fw_quotemark;
109 GtkWidget *text_fw_quotefmt;
111 GtkWidget *checkbtn_autoextedit;
112 GtkWidget *spinbtn_undolevel;
113 GtkObject *spinbtn_undolevel_adj;
114 GtkWidget *spinbtn_linewrap;
115 GtkObject *spinbtn_linewrap_adj;
116 GtkWidget *checkbtn_wrapquote;
117 GtkWidget *checkbtn_autowrap;
118 GtkWidget *checkbtn_wrapatsend;
120 GtkWidget *checkbtn_reply_account_autosel;
121 GtkWidget *checkbtn_forward_account_autosel;
122 GtkWidget *checkbtn_reedit_account_autosel;
123 GtkWidget *checkbtn_quote;
124 GtkWidget *checkbtn_default_reply_list;
125 GtkWidget *checkbtn_forward_as_attachment;
126 GtkWidget *checkbtn_redirect_keep_from;
127 GtkWidget *checkbtn_smart_wrapping;
128 GtkWidget *checkbtn_block_cursor;
129 GtkWidget *checkbtn_reply_with_quote;
131 GtkWidget *checkbtn_autosave;
132 GtkWidget *entry_autosave_length;
137 static struct Spelling {
138 GtkWidget *checkbtn_enable_aspell;
139 GtkWidget *entry_aspell_path;
140 GtkWidget *btn_aspell_path;
141 GtkWidget *optmenu_dictionary;
142 GtkWidget *optmenu_sugmode;
143 GtkWidget *misspelled_btn;
144 GtkWidget *checkbtn_use_alternate;
145 GtkWidget *checkbtn_check_while_typing;
149 static struct Quote {
150 GtkWidget *entry_quotemark;
151 GtkWidget *text_quotefmt;
153 GtkWidget *entry_fw_quotemark;
154 GtkWidget *text_fw_quotefmt;
156 GtkWidget *entry_quote_chars;
159 static struct Display {
160 GtkWidget *entry_textfont;
161 GtkWidget *button_textfont;
163 GtkWidget *entry_smallfont;
164 GtkWidget *entry_normalfont;
165 GtkWidget *entry_boldfont;
167 GtkWidget *chkbtn_folder_unread;
168 GtkWidget *entry_ng_abbrev_len;
169 GtkWidget *spinbtn_ng_abbrev_len;
170 GtkObject *spinbtn_ng_abbrev_len_adj;
172 GtkWidget *chkbtn_transhdr;
174 GtkWidget *chkbtn_swapfrom;
175 GtkWidget *chkbtn_useaddrbook;
176 GtkWidget *chkbtn_expand_thread;
177 GtkWidget *entry_datefmt;
180 static struct Message {
181 GtkWidget *chkbtn_enablecol;
182 GtkWidget *button_edit_col;
183 GtkWidget *chkbtn_mbalnum;
184 GtkWidget *chkbtn_disphdrpane;
185 GtkWidget *chkbtn_disphdr;
186 GtkWidget *spinbtn_linespc;
187 GtkObject *spinbtn_linespc_adj;
188 GtkWidget *chkbtn_headspc;
190 GtkWidget *chkbtn_smoothscroll;
191 GtkWidget *spinbtn_scrollstep;
192 GtkObject *spinbtn_scrollstep_adj;
193 GtkWidget *chkbtn_halfpage;
195 GtkWidget *chkbtn_display_img;
196 GtkWidget *chkbtn_resize_image;
200 static struct Privacy {
201 GtkWidget *checkbtn_auto_check_signatures;
202 GtkWidget *checkbtn_gpg_signature_popup;
203 GtkWidget *checkbtn_store_passphrase;
204 GtkWidget *spinbtn_store_passphrase;
205 GtkObject *spinbtn_store_passphrase_adj;
206 GtkWidget *checkbtn_passphrase_grab;
207 GtkWidget *checkbtn_gpg_warning;
211 static struct Interface {
212 /* GtkWidget *checkbtn_emacs; */
213 GtkWidget *checkbtn_show_msg_with_cursor;
214 GtkWidget *checkbtn_openunread;
215 GtkWidget *checkbtn_mark_as_read_on_newwin;
216 GtkWidget *checkbtn_openinbox;
217 GtkWidget *checkbtn_immedexec;
218 GtkWidget *optmenu_recvdialog;
219 GtkWidget *optmenu_senddialog;
220 GtkWidget *checkbtn_no_recv_err_panel;
221 GtkWidget *checkbtn_close_recv_dialog;
222 GtkWidget *optmenu_nextunreadmsgdialog;
223 GtkWidget *entry_pixmap_theme;
224 GtkWidget *combo_pixmap_theme;
227 static struct Other {
228 GtkWidget *uri_combo;
229 GtkWidget *uri_entry;
230 GtkWidget *printcmd_entry;
231 GtkWidget *exteditor_combo;
232 GtkWidget *exteditor_entry;
233 GtkWidget *checkbtn_addaddrbyclick;
234 GtkWidget *checkbtn_confonexit;
235 GtkWidget *checkbtn_cleanonexit;
236 GtkWidget *checkbtn_askonclean;
237 GtkWidget *checkbtn_warnqueued;
238 GtkWidget *checkbtn_cliplog;
239 GtkWidget *loglength_entry;
242 GtkWidget *checkbtn_ssl_ask_unknown_valid;
248 static struct MessageColorButtons {
249 GtkWidget *quote_level1_btn;
250 GtkWidget *quote_level2_btn;
251 GtkWidget *quote_level3_btn;
253 GtkWidget *tgt_folder_btn;
254 GtkWidget *signature_btn;
257 static struct KeybindDialog {
262 static GtkWidget *font_sel_win;
263 static guint font_sel_conn_id;
264 static GtkWidget *quote_color_win;
265 static GtkWidget *color_dialog;
267 static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam);
268 static void prefs_common_charset_set_optmenu (PrefParam *pparam);
269 static void prefs_common_recv_dialog_newmail_notify_toggle_cb (GtkWidget *w,
271 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam);
272 static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam);
273 static void prefs_common_send_dialog_set_data_from_optmenu(PrefParam *pparam);
274 static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam);
275 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam);
276 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam);
279 static void prefs_dictionary_set_data_from_optmenu (PrefParam *param);
280 static void prefs_dictionary_set_optmenu (PrefParam *pparam);
281 static void prefs_speller_sugmode_set_data_from_optmenu (PrefParam *pparam);
282 static void prefs_speller_sugmode_set_optmenu (PrefParam *pparam);
287 parameter name, default value, pointer to the prefs variable, data type,
288 pointer to the widget pointer,
289 pointer to the function for data setting,
290 pointer to the function for widget setting
293 static PrefParam param[] = {
295 {"use_ext_inc", "FALSE", &prefs_common.use_extinc, P_BOOL,
296 &receive.checkbtn_incext,
297 prefs_set_data_from_toggle, prefs_set_toggle},
298 {"ext_inc_path", DEFAULT_INC_PATH, &prefs_common.extinc_cmd, P_STRING,
299 &receive.entry_incext,
300 prefs_set_data_from_entry, prefs_set_entry},
302 {"inc_local", "TRUE", &prefs_common.inc_local, P_BOOL,
303 &receive.checkbtn_local,
304 prefs_set_data_from_toggle, prefs_set_toggle},
305 {"filter_on_inc_local", "FALSE", &prefs_common.filter_on_inc, P_BOOL,
306 &receive.checkbtn_filter_on_inc,
307 prefs_set_data_from_toggle, prefs_set_toggle},
308 {"spool_path", DEFAULT_SPOOL_PATH, &prefs_common.spool_path, P_STRING,
309 &receive.entry_spool,
310 prefs_set_data_from_entry, prefs_set_entry},
312 {"autochk_newmail", "FALSE", &prefs_common.autochk_newmail, P_BOOL,
313 &receive.checkbtn_autochk,
314 prefs_set_data_from_toggle, prefs_set_toggle},
315 {"autochk_interval", "10", &prefs_common.autochk_itv, P_INT,
316 &receive.spinbtn_autochk,
317 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
318 {"check_on_startup", "FALSE", &prefs_common.chk_on_startup, P_BOOL,
319 &receive.checkbtn_chkonstartup,
320 prefs_set_data_from_toggle, prefs_set_toggle},
321 {"scan_all_after_inc", "FALSE", &prefs_common.scan_all_after_inc,
322 P_BOOL, &receive.checkbtn_scan_after_inc,
323 prefs_set_data_from_toggle, prefs_set_toggle},
324 {"newmail_notify_manu", "FALSE", &prefs_common.newmail_notify_manu,
325 P_BOOL, &receive.checkbtn_newmail_manu,
326 prefs_set_data_from_toggle, prefs_set_toggle},
327 {"newmail_notify_auto", "FALSE", &prefs_common.newmail_notify_auto,
328 P_BOOL, &receive.checkbtn_newmail_auto,
329 prefs_set_data_from_toggle, prefs_set_toggle},
330 {"newmail_notify_cmd", "", &prefs_common.newmail_notify_cmd, P_STRING,
331 &receive.entry_newmail_notify_cmd,
332 prefs_set_data_from_entry, prefs_set_entry},
334 {"max_news_articles", "300", &prefs_common.max_articles, P_INT,
335 &receive.spinbtn_maxarticle,
336 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
339 {"use_ext_sendmail", "FALSE", &prefs_common.use_extsend, P_BOOL,
340 &p_send.checkbtn_extsend,
341 prefs_set_data_from_toggle, prefs_set_toggle},
342 {"ext_sendmail_cmd", DEFAULT_SENDMAIL_CMD,
343 &prefs_common.extsend_cmd, P_STRING,
344 &p_send.entry_extsend, prefs_set_data_from_entry, prefs_set_entry},
345 {"save_message", "TRUE", &prefs_common.savemsg, P_BOOL,
346 &p_send.checkbtn_savemsg,
347 prefs_set_data_from_toggle, prefs_set_toggle},
348 {"queue_message", "FALSE", &prefs_common.queue_msg, P_BOOL,
349 &p_send.checkbtn_queuemsg,
350 prefs_set_data_from_toggle, prefs_set_toggle},
352 {"outgoing_charset", CS_AUTO, &prefs_common.outgoing_charset, P_STRING,
353 &p_send.optmenu_charset,
354 prefs_common_charset_set_data_from_optmenu,
355 prefs_common_charset_set_optmenu},
358 {"auto_signature", "TRUE", &prefs_common.auto_sig, P_BOOL,
359 &compose.checkbtn_autosig,
360 prefs_set_data_from_toggle, prefs_set_toggle},
361 {"signature_separator", "-- ", &prefs_common.sig_sep, P_STRING,
362 &compose.entry_sigsep, prefs_set_data_from_entry, prefs_set_entry},
364 {"auto_ext_editor", "FALSE", &prefs_common.auto_exteditor, P_BOOL,
365 &compose.checkbtn_autoextedit,
366 prefs_set_data_from_toggle, prefs_set_toggle},
367 {"forward_as_attachment", "FALSE", &prefs_common.forward_as_attachment,
368 P_BOOL, &compose.checkbtn_forward_as_attachment,
369 prefs_set_data_from_toggle, prefs_set_toggle},
370 {"redirect_keep_from", "FALSE",
371 &prefs_common.redirect_keep_from, P_BOOL,
372 &compose.checkbtn_redirect_keep_from,
373 prefs_set_data_from_toggle, prefs_set_toggle},
374 {"undo_level", "50", &prefs_common.undolevels, P_INT,
375 &compose.spinbtn_undolevel,
376 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
377 {"block_cursor", "FALSE", &prefs_common.block_cursor,
378 P_BOOL, &compose.checkbtn_block_cursor,
379 prefs_set_data_from_toggle, prefs_set_toggle},
381 {"linewrap_length", "72", &prefs_common.linewrap_len, P_INT,
382 &compose.spinbtn_linewrap,
383 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
384 {"linewrap_quotation", "FALSE", &prefs_common.linewrap_quote, P_BOOL,
385 &compose.checkbtn_wrapquote,
386 prefs_set_data_from_toggle, prefs_set_toggle},
387 {"linewrap_auto", "FALSE", &prefs_common.autowrap, P_BOOL,
388 &compose.checkbtn_autowrap,
389 prefs_set_data_from_toggle, prefs_set_toggle},
390 {"linewrap_before_sending", "FALSE",
391 &prefs_common.linewrap_at_send, P_BOOL,
392 &compose.checkbtn_wrapatsend,
393 prefs_set_data_from_toggle, prefs_set_toggle},
394 {"smart_wrapping", "TRUE", &prefs_common.smart_wrapping,
395 P_BOOL, &compose.checkbtn_smart_wrapping,
396 prefs_set_data_from_toggle, prefs_set_toggle},
397 {"autosave", "FALSE", &prefs_common.autosave,
398 P_BOOL, &compose.checkbtn_autosave,
399 prefs_set_data_from_toggle, prefs_set_toggle},
400 {"autosave_length", "50", &prefs_common.autosave_length,
401 P_INT, &compose.entry_autosave_length,
402 prefs_set_data_from_entry, prefs_set_entry},
404 {"enable_aspell", "TRUE", &prefs_common.enable_aspell,
405 P_BOOL, &spelling.checkbtn_enable_aspell,
406 prefs_set_data_from_toggle, prefs_set_toggle},
407 {"aspell_path", ASPELL_PATH, &prefs_common.aspell_path,
408 P_STRING, &spelling.entry_aspell_path,
409 prefs_set_data_from_entry, prefs_set_entry},
410 {"dictionary", "", &prefs_common.dictionary,
411 P_STRING, &spelling.optmenu_dictionary,
412 prefs_dictionary_set_data_from_optmenu, prefs_dictionary_set_optmenu },
413 {"aspell_sugmode", "1", &prefs_common.aspell_sugmode,
414 P_INT, &spelling.optmenu_sugmode,
415 prefs_speller_sugmode_set_data_from_optmenu, prefs_speller_sugmode_set_optmenu },
416 {"use_alternate_dict", "FALSE", &prefs_common.use_alternate,
417 P_BOOL, &spelling.checkbtn_use_alternate,
418 prefs_set_data_from_toggle, prefs_set_toggle},
419 {"check_while_typing", "TRUE", &prefs_common.check_while_typing,
420 P_BOOL, &spelling.checkbtn_check_while_typing,
421 prefs_set_data_from_toggle, prefs_set_toggle},
422 {"misspelled_color", "16711680", &prefs_common.misspelled_col, P_INT,
425 {"reply_with_quote", "TRUE", &prefs_common.reply_with_quote, P_BOOL,
426 &compose.checkbtn_reply_with_quote, prefs_set_data_from_toggle, prefs_set_toggle},
428 /* Account autoselection */
429 {"reply_account_autoselect", "TRUE",
430 &prefs_common.reply_account_autosel, P_BOOL,
431 &compose.checkbtn_reply_account_autosel,
432 prefs_set_data_from_toggle, prefs_set_toggle},
433 {"forward_account_autoselect", "TRUE",
434 &prefs_common.forward_account_autosel, P_BOOL,
435 &compose.checkbtn_forward_account_autosel,
436 prefs_set_data_from_toggle, prefs_set_toggle},
437 {"reedit_account_autoselect", "TRUE",
438 &prefs_common.reedit_account_autosel, P_BOOL,
439 &compose.checkbtn_reedit_account_autosel,
440 prefs_set_data_from_toggle, prefs_set_toggle},
442 {"default_reply_list", "TRUE", &prefs_common.default_reply_list, P_BOOL,
443 &compose.checkbtn_default_reply_list,
444 prefs_set_data_from_toggle, prefs_set_toggle},
446 {"show_ruler", "TRUE", &prefs_common.show_ruler, P_BOOL,
450 {"reply_quote_mark", "> ", &prefs_common.quotemark, P_STRING,
451 "e.entry_quotemark, prefs_set_data_from_entry, prefs_set_entry},
452 {"reply_quote_format", "On %d\\n%f wrote:\\n\\n%Q",
453 &prefs_common.quotefmt, P_STRING, "e.text_quotefmt,
454 prefs_set_data_from_text, prefs_set_text},
456 {"forward_quote_mark", "> ", &prefs_common.fw_quotemark, P_STRING,
457 "e.entry_fw_quotemark,
458 prefs_set_data_from_entry, prefs_set_entry},
459 {"forward_quote_format",
460 "\\n\\nBegin forwarded message:\\n\\n"
461 "?d{Date: %d\\n}?f{From: %f\\n}?t{To: %t\\n}?c{Cc: %c\\n}"
462 "?n{Newsgroups: %n\\n}?s{Subject: %s\\n}\\n\\n%M",
463 &prefs_common.fw_quotefmt, P_STRING, "e.text_fw_quotefmt,
464 prefs_set_data_from_text, prefs_set_text},
465 {"quote_chars", ">", &prefs_common.quote_chars, P_STRING,
466 "e.entry_quote_chars, prefs_set_data_from_entry, prefs_set_entry},
469 {"widget_font", NULL, &prefs_common.widgetfont, P_STRING,
471 {"message_font", "-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*",
472 &prefs_common.textfont, P_STRING,
473 &display.entry_textfont,
474 prefs_set_data_from_entry, prefs_set_entry},
475 {"small_font", "-*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*",
476 &prefs_common.smallfont, P_STRING,
477 &display.entry_smallfont,
478 prefs_set_data_from_entry, prefs_set_entry},
479 {"bold_font", "-*-helvetica-bold-r-normal--12-*-*-*-*-*-*-*",
480 &prefs_common.boldfont, P_STRING,
481 &display.entry_boldfont,
482 prefs_set_data_from_entry, prefs_set_entry},
483 {"normal_font", "-*-helvetica-medium-r-normal--12-*-*-*-*-*-*-*",
484 &prefs_common.normalfont, P_STRING,
485 &display.entry_normalfont,
486 prefs_set_data_from_entry, prefs_set_entry},
489 {"display_folder_unread_num", "TRUE",
490 &prefs_common.display_folder_unread, P_BOOL,
491 &display.chkbtn_folder_unread,
492 prefs_set_data_from_toggle, prefs_set_toggle},
493 {"newsgroup_abbrev_len", "16",
494 &prefs_common.ng_abbrev_len, P_INT,
495 &display.spinbtn_ng_abbrev_len,
496 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
498 {"translate_header", "TRUE", &prefs_common.trans_hdr, P_BOOL,
499 &display.chkbtn_transhdr,
500 prefs_set_data_from_toggle, prefs_set_toggle},
502 /* Display: Summary View */
503 {"enable_swap_from", "FALSE", &prefs_common.swap_from, P_BOOL,
504 &display.chkbtn_swapfrom,
505 prefs_set_data_from_toggle, prefs_set_toggle},
506 {"use_address_book", "TRUE", &prefs_common.use_addr_book, P_BOOL,
507 &display.chkbtn_useaddrbook,
508 prefs_set_data_from_toggle, prefs_set_toggle},
509 {"date_format", "%y/%m/%d(%a) %H:%M", &prefs_common.date_format,
510 P_STRING, &display.entry_datefmt,
511 prefs_set_data_from_entry, prefs_set_entry},
512 {"expand_thread", "TRUE", &prefs_common.expand_thread, P_BOOL,
513 &display.chkbtn_expand_thread,
514 prefs_set_data_from_toggle, prefs_set_toggle},
516 {"enable_hscrollbar", "TRUE", &prefs_common.enable_hscrollbar, P_BOOL,
518 {"bold_unread", "TRUE", &prefs_common.bold_unread, P_BOOL,
521 {"enable_thread", "TRUE", &prefs_common.enable_thread, P_BOOL,
523 {"toolbar_style", "3", &prefs_common.toolbar_style, P_ENUM,
525 {"show_statusbar", "TRUE", &prefs_common.show_statusbar, P_BOOL,
527 {"show_searchbar", "TRUE", &prefs_common.show_searchbar, P_BOOL,
530 {"folderview_vscrollbar_policy", "0",
531 &prefs_common.folderview_vscrollbar_policy, P_ENUM,
534 {"summary_col_show_mark", "TRUE",
535 &prefs_common.summary_col_visible[S_COL_MARK], P_BOOL, NULL, NULL, NULL},
536 {"summary_col_show_unread", "TRUE",
537 &prefs_common.summary_col_visible[S_COL_UNREAD], P_BOOL, NULL, NULL, NULL},
538 {"summary_col_show_mime", "TRUE",
539 &prefs_common.summary_col_visible[S_COL_MIME], P_BOOL, NULL, NULL, NULL},
540 {"summary_col_show_subject", "TRUE",
541 &prefs_common.summary_col_visible[S_COL_SUBJECT], P_BOOL, NULL, NULL, NULL},
542 {"summary_col_show_from", "TRUE",
543 &prefs_common.summary_col_visible[S_COL_FROM], P_BOOL, NULL, NULL, NULL},
544 {"summary_col_show_date", "TRUE",
545 &prefs_common.summary_col_visible[S_COL_DATE], P_BOOL, NULL, NULL, NULL},
546 {"summary_col_show_size", "TRUE",
547 &prefs_common.summary_col_visible[S_COL_SIZE], P_BOOL, NULL, NULL, NULL},
548 {"summary_col_show_number", "FALSE",
549 &prefs_common.summary_col_visible[S_COL_NUMBER], P_BOOL, NULL, NULL, NULL},
550 {"summary_col_show_score", "FALSE",
551 &prefs_common.summary_col_visible[S_COL_SCORE], P_BOOL, NULL, NULL, NULL},
552 {"summary_col_show_locked", "FALSE",
553 &prefs_common.summary_col_visible[S_COL_LOCKED], P_BOOL, NULL, NULL, NULL},
555 {"summary_col_pos_mark", "0",
556 &prefs_common.summary_col_pos[S_COL_MARK], P_INT, NULL, NULL, NULL},
557 {"summary_col_pos_unread", "1",
558 &prefs_common.summary_col_pos[S_COL_UNREAD], P_INT, NULL, NULL, NULL},
559 {"summary_col_pos_mime", "2",
560 &prefs_common.summary_col_pos[S_COL_MIME], P_INT, NULL, NULL, NULL},
561 {"summary_col_pos_subject", "3",
562 &prefs_common.summary_col_pos[S_COL_SUBJECT], P_INT, NULL, NULL, NULL},
563 {"summary_col_pos_from", "4",
564 &prefs_common.summary_col_pos[S_COL_FROM], P_INT, NULL, NULL, NULL},
565 {"summary_col_pos_date", "5",
566 &prefs_common.summary_col_pos[S_COL_DATE], P_INT, NULL, NULL, NULL},
567 {"summary_col_pos_size", "6",
568 &prefs_common.summary_col_pos[S_COL_SIZE], P_INT, NULL, NULL, NULL},
569 {"summary_col_pos_number", "7",
570 &prefs_common.summary_col_pos[S_COL_NUMBER], P_INT, NULL, NULL, NULL},
571 {"summary_col_pos_score", "8",
572 &prefs_common.summary_col_pos[S_COL_SCORE], P_INT, NULL, NULL, NULL},
573 {"summary_col_pos_locked", "9",
574 &prefs_common.summary_col_pos[S_COL_LOCKED], P_INT, NULL, NULL, NULL},
576 {"summary_col_size_mark", "10",
577 &prefs_common.summary_col_size[S_COL_MARK], P_INT, NULL, NULL, NULL},
578 {"summary_col_size_unread", "13",
579 &prefs_common.summary_col_size[S_COL_UNREAD], P_INT, NULL, NULL, NULL},
580 {"summary_col_size_mime", "10",
581 &prefs_common.summary_col_size[S_COL_MIME], P_INT, NULL, NULL, NULL},
582 {"summary_col_size_subject", "200",
583 &prefs_common.summary_col_size[S_COL_SUBJECT], P_INT, NULL, NULL, NULL},
584 {"summary_col_size_from", "120",
585 &prefs_common.summary_col_size[S_COL_FROM], P_INT, NULL, NULL, NULL},
586 {"summary_col_size_date", "118",
587 &prefs_common.summary_col_size[S_COL_DATE], P_INT, NULL, NULL, NULL},
588 {"summary_col_size_size", "45",
589 &prefs_common.summary_col_size[S_COL_SIZE], P_INT, NULL, NULL, NULL},
590 {"summary_col_size_number", "40",
591 &prefs_common.summary_col_size[S_COL_NUMBER], P_INT, NULL, NULL, NULL},
592 {"summary_col_size_score", "40",
593 &prefs_common.summary_col_size[S_COL_SCORE], P_INT, NULL, NULL, NULL},
594 {"summary_col_size_locked", "13",
595 &prefs_common.summary_col_size[S_COL_LOCKED], P_INT, NULL, NULL, NULL},
598 {"folderview_width", "179", &prefs_common.folderview_width, P_INT,
600 {"folderview_height", "600", &prefs_common.folderview_height, P_INT,
602 {"folder_col_folder", "150", &prefs_common.folder_col_folder, P_INT,
604 {"folder_col_new", "32", &prefs_common.folder_col_new, P_INT,
606 {"folder_col_unread", "32", &prefs_common.folder_col_unread, P_INT,
608 {"folder_col_total", "32", &prefs_common.folder_col_total, P_INT,
611 {"summaryview_width", "600", &prefs_common.summaryview_width, P_INT,
613 {"summaryview_height", "173", &prefs_common.summaryview_height, P_INT,
616 {"mainview_x", "64", &prefs_common.mainview_x, P_INT,
618 {"mainview_y", "64", &prefs_common.mainview_y, P_INT,
620 {"mainview_width", "600", &prefs_common.mainview_width, P_INT,
622 {"mainview_height", "600", &prefs_common.mainview_height, P_INT,
624 {"mainwin_x", "64", &prefs_common.mainwin_x, P_INT,
626 {"mainwin_y", "64", &prefs_common.mainwin_y, P_INT,
628 {"mainwin_width", "800", &prefs_common.mainwin_width, P_INT,
630 {"mainwin_height", "600", &prefs_common.mainwin_height, P_INT,
632 {"messagewin_width", "600", &prefs_common.msgwin_width, P_INT,
634 {"messagewin_height", "540", &prefs_common.msgwin_height, P_INT,
636 {"compose_width", "600", &prefs_common.compose_width, P_INT,
638 {"compose_height", "560", &prefs_common.compose_height, P_INT,
642 {"enable_color", "TRUE", &prefs_common.enable_color, P_BOOL,
643 &message.chkbtn_enablecol,
644 prefs_set_data_from_toggle, prefs_set_toggle},
646 {"quote_level1_color", "179", &prefs_common.quote_level1_col, P_INT,
648 {"quote_level2_color", "179", &prefs_common.quote_level2_col, P_INT,
650 {"quote_level3_color", "179", &prefs_common.quote_level3_col, P_INT,
652 {"uri_color", "32512", &prefs_common.uri_col, P_INT,
654 {"target_folder_color", "14294218", &prefs_common.tgt_folder_col, P_INT,
656 {"signature_color", "7960953", &prefs_common.signature_col, P_INT,
658 {"recycle_quote_colors", "FALSE", &prefs_common.recycle_quote_colors,
659 P_BOOL, NULL, NULL, NULL},
661 {"convert_mb_alnum", "FALSE", &prefs_common.conv_mb_alnum, P_BOOL,
662 &message.chkbtn_mbalnum,
663 prefs_set_data_from_toggle, prefs_set_toggle},
664 {"display_header_pane", "TRUE", &prefs_common.display_header_pane,
665 P_BOOL, &message.chkbtn_disphdrpane,
666 prefs_set_data_from_toggle, prefs_set_toggle},
667 {"display_header", "TRUE", &prefs_common.display_header, P_BOOL,
668 &message.chkbtn_disphdr,
669 prefs_set_data_from_toggle, prefs_set_toggle},
670 {"line_space", "2", &prefs_common.line_space, P_INT,
671 &message.spinbtn_linespc,
672 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
673 {"enable_head_space", "FALSE", &prefs_common.head_space, P_BOOL,
674 &message.chkbtn_headspc,
675 prefs_set_data_from_toggle, prefs_set_toggle},
677 {"enable_smooth_scroll", "FALSE",
678 &prefs_common.enable_smooth_scroll, P_BOOL,
679 &message.chkbtn_smoothscroll,
680 prefs_set_data_from_toggle, prefs_set_toggle},
681 {"scroll_step", "1", &prefs_common.scroll_step, P_INT,
682 &message.spinbtn_scrollstep,
683 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
684 {"scroll_half_page", "FALSE", &prefs_common.scroll_halfpage, P_BOOL,
685 &message.chkbtn_halfpage,
686 prefs_set_data_from_toggle, prefs_set_toggle},
688 {"display_img", "TRUE", &prefs_common.display_img, P_BOOL,
689 &message.chkbtn_display_img,
690 prefs_set_data_from_toggle, prefs_set_toggle},
691 {"resize_image", "TRUE", &prefs_common.resize_image, P_BOOL,
692 &message.chkbtn_resize_image,
693 prefs_set_data_from_toggle, prefs_set_toggle},
695 {"show_other_header", "FALSE", &prefs_common.show_other_header, P_BOOL,
699 {"mime_image_viewer", "display '%s'",
700 &prefs_common.mime_image_viewer, P_STRING, NULL, NULL, NULL},
701 {"mime_audio_player", "play '%s'",
702 &prefs_common.mime_audio_player, P_STRING, NULL, NULL, NULL},
703 {"mime_open_command", "gedit '%s'",
704 &prefs_common.mime_open_cmd, P_STRING, NULL, NULL, NULL},
708 {"auto_check_signatures", "TRUE",
709 &prefs_common.auto_check_signatures, P_BOOL,
710 &privacy.checkbtn_auto_check_signatures,
711 prefs_set_data_from_toggle, prefs_set_toggle},
712 {"gpg_signature_popup", "FALSE",
713 &prefs_common.gpg_signature_popup, P_BOOL,
714 &privacy.checkbtn_gpg_signature_popup,
715 prefs_set_data_from_toggle, prefs_set_toggle},
716 {"store_passphrase", "FALSE", &prefs_common.store_passphrase, P_BOOL,
717 &privacy.checkbtn_store_passphrase,
718 prefs_set_data_from_toggle, prefs_set_toggle},
719 {"store_passphrase_timeout", "0",
720 &prefs_common.store_passphrase_timeout, P_INT,
721 &privacy.spinbtn_store_passphrase,
722 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
724 {"passphrase_grab", "FALSE", &prefs_common.passphrase_grab, P_BOOL,
725 &privacy.checkbtn_passphrase_grab,
726 prefs_set_data_from_toggle, prefs_set_toggle},
727 #endif /* __MINGW32__ */
728 {"gpg_warning", "TRUE", &prefs_common.gpg_warning, P_BOOL,
729 &privacy.checkbtn_gpg_warning,
730 prefs_set_data_from_toggle, prefs_set_toggle},
731 #endif /* USE_GPGME */
734 {"separate_folder", "FALSE", &prefs_common.sep_folder, P_BOOL,
736 {"separate_message", "FALSE", &prefs_common.sep_msg, P_BOOL,
739 /* {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
740 NULL, NULL, NULL}, */
741 {"show_message_with_cursor_key", "FALSE",
742 &prefs_common.show_msg_with_cursor_key,
743 P_BOOL, &interface.checkbtn_show_msg_with_cursor,
744 prefs_set_data_from_toggle, prefs_set_toggle},
745 {"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
746 P_BOOL, &interface.checkbtn_openunread,
747 prefs_set_data_from_toggle, prefs_set_toggle},
748 {"mark_as_read_on_new_window", "FALSE",
749 &prefs_common.mark_as_read_on_new_window,
750 P_BOOL, &interface.checkbtn_mark_as_read_on_newwin,
751 prefs_set_data_from_toggle, prefs_set_toggle},
752 {"open_inbox_on_inc", "FALSE", &prefs_common.open_inbox_on_inc,
753 P_BOOL, &interface.checkbtn_openinbox,
754 prefs_set_data_from_toggle, prefs_set_toggle},
755 {"immediate_execution", "TRUE", &prefs_common.immediate_exec, P_BOOL,
756 &interface.checkbtn_immedexec,
757 prefs_set_data_from_toggle, prefs_set_toggle},
758 {"receive_dialog_mode", "1", &prefs_common.recv_dialog_mode, P_ENUM,
759 &interface.optmenu_recvdialog,
760 prefs_common_recv_dialog_set_data_from_optmenu,
761 prefs_common_recv_dialog_set_optmenu},
762 {"send_dialog_mode", "0", &prefs_common.send_dialog_mode, P_ENUM,
763 &interface.optmenu_senddialog,
764 prefs_common_send_dialog_set_data_from_optmenu,
765 prefs_common_send_dialog_set_optmenu},
766 {"no_receive_error_panel", "FALSE", &prefs_common.no_recv_err_panel,
767 P_BOOL, &interface.checkbtn_no_recv_err_panel,
768 prefs_set_data_from_toggle, prefs_set_toggle},
769 {"close_receive_dialog", "TRUE", &prefs_common.close_recv_dialog,
770 P_BOOL, &interface.checkbtn_close_recv_dialog,
771 prefs_set_data_from_toggle, prefs_set_toggle},
772 {"nextunreadmsg_dialog", NULL, &prefs_common.next_unread_msg_dialog, P_ENUM,
773 &interface.optmenu_nextunreadmsgdialog,
774 prefs_nextunreadmsgdialog_set_data_from_optmenu,
775 prefs_nextunreadmsgdialog_set_optmenu},
777 {"pixmap_theme_path", DEFAULT_PIXMAP_THEME,
778 &prefs_common.pixmap_theme_path, P_STRING,
779 &interface.entry_pixmap_theme, prefs_set_data_from_entry, prefs_set_entry},
782 {"uri_open_command", "netscape -remote 'openURL(%s,raise)'",
783 &prefs_common.uri_cmd, P_STRING,
784 &other.uri_entry, prefs_set_data_from_entry, prefs_set_entry},
785 {"print_command", "lpr %s", &prefs_common.print_cmd, P_STRING,
786 &other.printcmd_entry, prefs_set_data_from_entry, prefs_set_entry},
787 {"ext_editor_command", "gedit %s",
788 &prefs_common.ext_editor_cmd, P_STRING,
789 &other.exteditor_entry, prefs_set_data_from_entry, prefs_set_entry},
791 {"add_address_by_click", "FALSE", &prefs_common.add_address_by_click,
792 P_BOOL, &other.checkbtn_addaddrbyclick,
793 prefs_set_data_from_toggle, prefs_set_toggle},
795 {"confirm_on_exit", "TRUE", &prefs_common.confirm_on_exit, P_BOOL,
796 &other.checkbtn_confonexit,
797 prefs_set_data_from_toggle, prefs_set_toggle},
798 {"clean_trash_on_exit", "FALSE", &prefs_common.clean_on_exit, P_BOOL,
799 &other.checkbtn_cleanonexit,
800 prefs_set_data_from_toggle, prefs_set_toggle},
801 {"ask_on_cleaning", "TRUE", &prefs_common.ask_on_clean, P_BOOL,
802 &other.checkbtn_askonclean,
803 prefs_set_data_from_toggle, prefs_set_toggle},
804 {"warn_queued_on_exit", "TRUE", &prefs_common.warn_queued_on_exit,
805 P_BOOL, &other.checkbtn_warnqueued,
806 prefs_set_data_from_toggle, prefs_set_toggle},
809 {"ssl_ask_unknown_valid", "TRUE", &prefs_common.ssl_ask_unknown_valid,
810 P_BOOL, &other.checkbtn_ssl_ask_unknown_valid,
811 prefs_set_data_from_toggle, prefs_set_toggle},
814 {"work_offline", "FALSE", &prefs_common.work_offline, P_BOOL,
817 {"hide_score", "-9999", &prefs_common.kill_score, P_INT,
819 {"important_score", "1", &prefs_common.important_score, P_INT,
821 {"clip_log", "FALSE", &prefs_common.cliplog, P_BOOL,
822 &other.checkbtn_cliplog,
823 prefs_set_data_from_toggle, prefs_set_toggle},
824 {"log_length", "1000", &prefs_common.loglength, P_INT,
825 &other.loglength_entry,
826 prefs_set_data_from_entry, prefs_set_entry},
828 {"cache_max_mem_usage", "4096", &prefs_common.cache_max_mem_usage, P_INT,
830 {"cache_min_keep_time", "15", &prefs_common.cache_min_keep_time, P_INT,
833 {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
836 /* widget creating functions */
837 static void prefs_common_create (void);
838 static void prefs_receive_create (void);
839 static void prefs_send_create (void);
841 static void prefs_spelling_create (void);
843 static void prefs_compose_create (void);
844 static void prefs_quote_create (void);
845 static void prefs_display_create (void);
846 static void prefs_message_create (void);
848 static void prefs_privacy_create (void);
850 static void prefs_interface_create (void);
851 static void prefs_other_create (void);
853 static void date_format_ok_btn_clicked (GtkButton *button,
855 static void date_format_cancel_btn_clicked (GtkButton *button,
857 static void date_format_key_pressed (GtkWidget *keywidget,
860 static gboolean date_format_on_delete (GtkWidget *dialogwidget,
863 static void date_format_entry_on_change (GtkEditable *editable,
865 static void date_format_select_row (GtkWidget *date_format_list,
868 GdkEventButton *event,
869 GtkWidget *date_format);
870 static GtkWidget *date_format_create (GtkButton *button,
873 static void prefs_quote_colors_dialog (void);
874 static void prefs_quote_colors_dialog_create (void);
875 static void prefs_quote_colors_key_pressed (GtkWidget *widget,
878 static void quote_color_set_dialog (GtkWidget *widget,
880 static void quote_colors_set_dialog_ok (GtkWidget *widget,
882 static void quote_colors_set_dialog_cancel (GtkWidget *widget,
884 static void quote_colors_set_dialog_key_pressed (GtkWidget *widget,
887 static void set_button_bg_color (GtkWidget *widget,
889 static void prefs_enable_message_color_toggled (void);
890 static void prefs_recycle_colors_toggled (GtkWidget *widget);
892 static void prefs_font_select (GtkButton *button, GtkEntry *entry);
894 static void prefs_font_selection_key_pressed (GtkWidget *widget,
897 static void prefs_font_selection_ok (GtkButton *button, GtkEntry *entry);
899 static void prefs_keybind_select (void);
900 static gint prefs_keybind_deleted (GtkWidget *widget,
903 static void prefs_keybind_key_pressed (GtkWidget *widget,
906 static void prefs_keybind_cancel (void);
907 static void prefs_keybind_apply_clicked (GtkWidget *widget);
909 static gint prefs_common_deleted (GtkWidget *widget,
912 static void prefs_common_key_pressed (GtkWidget *widget,
915 static void prefs_common_ok (void);
916 static void prefs_common_apply (void);
917 static void prefs_common_cancel (void);
919 void prefs_common_init() {
920 prefs_common.disphdr_list = NULL;
923 void prefs_common_read_config(void)
927 gchar buf[PREFSBUFSIZE];
929 prefs_read_config(param, "Common", COMMON_RC);
931 path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
933 if ((fp = fopen(path, "rb")) == NULL) {
934 if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
939 while (fgets(buf, sizeof(buf), fp) != NULL) {
941 if (buf[0] == '\0') continue;
942 prefs_common.mime_open_cmd_history =
943 add_history(prefs_common.mime_open_cmd_history, buf);
947 prefs_common.mime_open_cmd_history =
948 g_list_reverse(prefs_common.mime_open_cmd_history);
951 void prefs_common_save_config(void)
957 prefs_save_config(param, "Common", COMMON_RC);
959 path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
961 if ((fp = fopen(path, "wb")) == NULL) {
962 FILE_OP_ERROR(path, "fopen");
967 for (cur = prefs_common.mime_open_cmd_history;
968 cur != NULL; cur = cur->next) {
969 fputs((gchar *)cur->data, fp);
977 void prefs_common_open(void)
979 if (prefs_rc_is_readonly(COMMON_RC))
984 if (!dialog.window) {
985 prefs_common_create();
988 manage_window_set_transient(GTK_WINDOW(dialog.window));
989 gtk_notebook_set_page(GTK_NOTEBOOK(dialog.notebook), 0);
990 gtk_widget_grab_focus(dialog.ok_btn);
992 prefs_set_dialog(param);
994 gtk_widget_show(dialog.window);
997 static void prefs_common_create(void)
1001 debug_print("Creating common preferences window...\n");
1003 prefs_dialog_create(&dialog);
1004 gtk_window_set_title (GTK_WINDOW(dialog.window),
1005 _("Common Preferences"));
1006 gtk_signal_connect (GTK_OBJECT(dialog.window), "delete_event",
1007 GTK_SIGNAL_FUNC(prefs_common_deleted), NULL);
1008 gtk_signal_connect (GTK_OBJECT(dialog.window), "key_press_event",
1009 GTK_SIGNAL_FUNC(prefs_common_key_pressed), NULL);
1010 MANAGE_WINDOW_SIGNALS_CONNECT(dialog.window);
1012 gtk_signal_connect (GTK_OBJECT(dialog.ok_btn), "clicked",
1013 GTK_SIGNAL_FUNC(prefs_common_ok), NULL);
1014 gtk_signal_connect (GTK_OBJECT(dialog.apply_btn), "clicked",
1015 GTK_SIGNAL_FUNC(prefs_common_apply), NULL);
1016 gtk_signal_connect_object (GTK_OBJECT(dialog.cancel_btn), "clicked",
1017 GTK_SIGNAL_FUNC(prefs_common_cancel),
1018 GTK_OBJECT(dialog.window));
1020 /* create all widgets on notebook */
1021 prefs_receive_create();
1022 SET_NOTEBOOK_LABEL(dialog.notebook, _("Receive"), page++);
1023 prefs_send_create();
1024 SET_NOTEBOOK_LABEL(dialog.notebook, _("Send"), page++);
1025 prefs_compose_create();
1026 SET_NOTEBOOK_LABEL(dialog.notebook, _("Compose"), page++);
1028 prefs_spelling_create();
1029 SET_NOTEBOOK_LABEL(dialog.notebook, _("Spell Checker"), page++);
1031 prefs_quote_create();
1032 SET_NOTEBOOK_LABEL(dialog.notebook, _("Quote"), page++);
1033 prefs_display_create();
1034 SET_NOTEBOOK_LABEL(dialog.notebook, _("Display"), page++);
1035 prefs_message_create();
1036 SET_NOTEBOOK_LABEL(dialog.notebook, _("Message"), page++);
1038 prefs_privacy_create();
1039 SET_NOTEBOOK_LABEL(dialog.notebook, _("Privacy"), page++);
1041 prefs_interface_create();
1042 SET_NOTEBOOK_LABEL(dialog.notebook, _("Interface"), page++);
1043 prefs_other_create();
1044 SET_NOTEBOOK_LABEL(dialog.notebook, _("Other"), page++);
1046 gtk_widget_show_all(dialog.window);
1049 static void prefs_receive_create(void)
1053 GtkWidget *frame_incext;
1054 GtkWidget *checkbtn_incext;
1056 GtkWidget *label_incext;
1057 GtkWidget *entry_incext;
1058 /* GtkWidget *button_incext; */
1060 GtkWidget *frame_spool;
1061 GtkWidget *checkbtn_local;
1062 GtkWidget *checkbtn_filter_on_inc;
1063 GtkWidget *label_spool;
1064 GtkWidget *entry_spool;
1066 GtkWidget *hbox_autochk;
1067 GtkWidget *checkbtn_autochk;
1068 GtkWidget *label_autochk1;
1069 GtkObject *spinbtn_autochk_adj;
1070 GtkWidget *spinbtn_autochk;
1071 GtkWidget *label_autochk2;
1072 GtkWidget *checkbtn_chkonstartup;
1073 GtkWidget *checkbtn_scan_after_inc;
1076 GtkWidget *frame_newmail;
1077 GtkWidget *hbox_newmail_notify;
1078 GtkWidget *checkbtn_newmail_auto;
1079 GtkWidget *checkbtn_newmail_manu;
1080 GtkWidget *entry_newmail_notify_cmd;
1081 GtkWidget *label_newmail_notify_cmd;
1083 GtkWidget *frame_news;
1084 GtkWidget *label_maxarticle;
1085 GtkWidget *spinbtn_maxarticle;
1086 GtkObject *spinbtn_maxarticle_adj;
1088 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1089 gtk_widget_show (vbox1);
1090 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1091 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1093 PACK_FRAME(vbox1, frame_incext, _("External program"));
1095 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1096 gtk_widget_show (vbox2);
1097 gtk_container_add (GTK_CONTAINER (frame_incext), vbox2);
1098 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1100 /* Use of external incorporation program */
1101 PACK_CHECK_BUTTON (vbox2, checkbtn_incext,
1102 _("Use external program for incorporation"));
1104 hbox = gtk_hbox_new (FALSE, 8);
1105 gtk_widget_show (hbox);
1106 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1107 SET_TOGGLE_SENSITIVITY (checkbtn_incext, hbox);
1109 label_incext = gtk_label_new (_("Command"));
1110 gtk_widget_show (label_incext);
1111 gtk_box_pack_start (GTK_BOX (hbox), label_incext, FALSE, FALSE, 0);
1113 entry_incext = gtk_entry_new ();
1114 gtk_widget_show (entry_incext);
1115 gtk_box_pack_start (GTK_BOX (hbox), entry_incext, TRUE, TRUE, 0);
1118 button_incext = gtk_button_new_with_label ("... ");
1119 gtk_widget_show (button_incext);
1120 gtk_box_pack_start (GTK_BOX (hbox), button_incext, FALSE, FALSE, 0);
1123 PACK_FRAME(vbox1, frame_spool, _("Local spool"));
1125 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1126 gtk_widget_show (vbox2);
1127 gtk_container_add (GTK_CONTAINER (frame_spool), vbox2);
1128 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1130 hbox = gtk_hbox_new (FALSE, 32);
1131 gtk_widget_show (hbox);
1132 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1134 PACK_CHECK_BUTTON (hbox, checkbtn_local, _("Incorporate from spool"));
1135 PACK_CHECK_BUTTON (hbox, checkbtn_filter_on_inc,
1136 _("Filter on incorporation"));
1137 SET_TOGGLE_SENSITIVITY (checkbtn_local, checkbtn_filter_on_inc);
1139 hbox = gtk_hbox_new (FALSE, 8);
1140 gtk_widget_show (hbox);
1141 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1142 SET_TOGGLE_SENSITIVITY (checkbtn_local, hbox);
1144 label_spool = gtk_label_new (_("Spool directory"));
1145 gtk_widget_show (label_spool);
1146 gtk_box_pack_start (GTK_BOX (hbox), label_spool, FALSE, FALSE, 0);
1148 entry_spool = gtk_entry_new ();
1149 gtk_widget_show (entry_spool);
1150 gtk_box_pack_start (GTK_BOX (hbox), entry_spool, TRUE, TRUE, 0);
1152 vbox2 = gtk_vbox_new (FALSE, 0);
1153 gtk_widget_show (vbox2);
1154 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1157 hbox_autochk = gtk_hbox_new (FALSE, 8);
1158 gtk_widget_show (hbox_autochk);
1159 gtk_box_pack_start (GTK_BOX (vbox2), hbox_autochk, FALSE, FALSE, 0);
1161 PACK_CHECK_BUTTON (hbox_autochk, checkbtn_autochk,
1162 _("Auto-check new mail"));
1164 label_autochk1 = gtk_label_new (_("every"));
1165 gtk_widget_show (label_autochk1);
1166 gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk1, FALSE, FALSE, 0);
1168 spinbtn_autochk_adj = gtk_adjustment_new (5, 1, 100, 1, 10, 10);
1169 spinbtn_autochk = gtk_spin_button_new
1170 (GTK_ADJUSTMENT (spinbtn_autochk_adj), 1, 0);
1171 gtk_widget_show (spinbtn_autochk);
1172 gtk_box_pack_start (GTK_BOX (hbox_autochk), spinbtn_autochk, FALSE, FALSE, 0);
1173 gtk_widget_set_usize (spinbtn_autochk, 64, -1);
1174 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_autochk), TRUE);
1176 label_autochk2 = gtk_label_new (_("minute(s)"));
1177 gtk_widget_show (label_autochk2);
1178 gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk2, FALSE, FALSE, 0);
1180 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk1);
1181 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, spinbtn_autochk);
1182 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk2);
1184 PACK_CHECK_BUTTON (vbox2, checkbtn_chkonstartup,
1185 _("Check new mail on startup"));
1186 PACK_CHECK_BUTTON (vbox2, checkbtn_scan_after_inc,
1187 _("Update all local folders after incorporation"));
1190 PACK_FRAME(vbox1, frame_newmail, _("Run command when new mail "
1192 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1193 gtk_widget_show (vbox2);
1194 gtk_container_add (GTK_CONTAINER (frame_newmail), vbox2);
1195 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1197 hbox = gtk_hbox_new (TRUE, 8);
1198 gtk_widget_show (hbox);
1199 PACK_CHECK_BUTTON (hbox, checkbtn_newmail_auto,
1200 _("after autochecking"));
1201 PACK_CHECK_BUTTON (hbox, checkbtn_newmail_manu,
1202 _("after manual checking"));
1203 gtk_box_pack_start (GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
1204 gtk_signal_connect(GTK_OBJECT(checkbtn_newmail_auto), "toggled",
1205 GTK_SIGNAL_FUNC(prefs_common_recv_dialog_newmail_notify_toggle_cb),
1207 gtk_signal_connect(GTK_OBJECT(checkbtn_newmail_manu), "toggled",
1208 GTK_SIGNAL_FUNC(prefs_common_recv_dialog_newmail_notify_toggle_cb),
1211 hbox_newmail_notify = gtk_hbox_new (FALSE, 8);
1212 gtk_widget_show (hbox);
1213 gtk_box_pack_start (GTK_BOX (vbox2), hbox_newmail_notify, FALSE,
1216 label_newmail_notify_cmd = gtk_label_new (_("Command to execute:\n"
1217 "(use %d as number of new "
1219 gtk_label_set_justify(GTK_LABEL(label_newmail_notify_cmd),
1221 gtk_widget_show (label_newmail_notify_cmd);
1222 gtk_box_pack_start (GTK_BOX (hbox_newmail_notify),
1223 label_newmail_notify_cmd, FALSE, FALSE, 0);
1225 entry_newmail_notify_cmd = gtk_entry_new ();
1226 gtk_widget_show (entry_newmail_notify_cmd);
1227 gtk_box_pack_start (GTK_BOX (hbox_newmail_notify),
1228 entry_newmail_notify_cmd, TRUE, TRUE, 0);
1230 gtk_widget_set_sensitive(hbox_newmail_notify,
1231 prefs_common.newmail_notify_auto ||
1232 prefs_common.newmail_notify_manu);
1234 PACK_FRAME(vbox1, frame_news, _("News"));
1236 hbox = gtk_hbox_new (FALSE, 8);
1237 gtk_widget_show (hbox);
1238 gtk_container_add (GTK_CONTAINER (frame_news), hbox);
1239 gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
1241 label_maxarticle = gtk_label_new
1242 (_("Maximum number of articles to download\n"
1243 "(unlimited if 0 is specified)"));
1244 gtk_widget_show (label_maxarticle);
1245 gtk_box_pack_start (GTK_BOX (hbox), label_maxarticle, FALSE, FALSE, 0);
1246 gtk_label_set_justify (GTK_LABEL (label_maxarticle), GTK_JUSTIFY_LEFT);
1248 spinbtn_maxarticle_adj =
1249 gtk_adjustment_new (300, 0, 10000, 10, 100, 100);
1250 spinbtn_maxarticle = gtk_spin_button_new
1251 (GTK_ADJUSTMENT (spinbtn_maxarticle_adj), 10, 0);
1252 gtk_widget_show (spinbtn_maxarticle);
1253 gtk_box_pack_start (GTK_BOX (hbox), spinbtn_maxarticle,
1255 gtk_widget_set_usize (spinbtn_maxarticle, 64, -1);
1256 gtk_spin_button_set_numeric
1257 (GTK_SPIN_BUTTON (spinbtn_maxarticle), TRUE);
1259 receive.checkbtn_incext = checkbtn_incext;
1260 receive.entry_incext = entry_incext;
1261 /* receive.button_incext = button_incext; */
1263 receive.checkbtn_local = checkbtn_local;
1264 receive.checkbtn_filter_on_inc = checkbtn_filter_on_inc;
1265 receive.entry_spool = entry_spool;
1267 receive.checkbtn_autochk = checkbtn_autochk;
1268 receive.spinbtn_autochk = spinbtn_autochk;
1269 receive.spinbtn_autochk_adj = spinbtn_autochk_adj;
1271 receive.checkbtn_chkonstartup = checkbtn_chkonstartup;
1272 receive.checkbtn_scan_after_inc = checkbtn_scan_after_inc;
1275 receive.checkbtn_newmail_auto = checkbtn_newmail_auto;
1276 receive.checkbtn_newmail_manu = checkbtn_newmail_manu;
1277 receive.hbox_newmail_notify = hbox_newmail_notify;
1278 receive.entry_newmail_notify_cmd = entry_newmail_notify_cmd;
1280 receive.spinbtn_maxarticle = spinbtn_maxarticle;
1281 receive.spinbtn_maxarticle_adj = spinbtn_maxarticle_adj;
1284 static void prefs_send_create(void)
1288 GtkWidget *frame_extsend;
1289 GtkWidget *vbox_extsend;
1290 GtkWidget *checkbtn_extsend;
1292 GtkWidget *label_extsend;
1293 GtkWidget *entry_extsend;
1294 /* GtkWidget *button_extsend; */
1295 GtkWidget *checkbtn_savemsg;
1296 GtkWidget *checkbtn_queuemsg;
1297 GtkWidget *label_outcharset;
1299 GtkWidget *optmenu_menu;
1300 GtkWidget *menuitem;
1301 GtkWidget *label_charset_desc;
1303 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1304 gtk_widget_show (vbox1);
1305 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1306 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1308 PACK_FRAME(vbox1, frame_extsend, _("External program"));
1310 vbox_extsend = gtk_vbox_new (FALSE, VSPACING_NARROW);
1311 gtk_widget_show (vbox_extsend);
1312 gtk_container_add (GTK_CONTAINER (frame_extsend), vbox_extsend);
1313 gtk_container_set_border_width (GTK_CONTAINER (vbox_extsend), 8);
1315 PACK_CHECK_BUTTON (vbox_extsend, checkbtn_extsend,
1316 _("Use external program for sending"));
1318 hbox1 = gtk_hbox_new (FALSE, 8);
1319 gtk_widget_show (hbox1);
1320 gtk_box_pack_start (GTK_BOX (vbox_extsend), hbox1, FALSE, FALSE, 0);
1321 SET_TOGGLE_SENSITIVITY(checkbtn_extsend, hbox1);
1323 label_extsend = gtk_label_new (_("Command"));
1324 gtk_widget_show (label_extsend);
1325 gtk_box_pack_start (GTK_BOX (hbox1), label_extsend, FALSE, FALSE, 0);
1327 entry_extsend = gtk_entry_new ();
1328 gtk_widget_show (entry_extsend);
1329 gtk_box_pack_start (GTK_BOX (hbox1), entry_extsend, TRUE, TRUE, 0);
1332 button_extsend = gtk_button_new_with_label ("... ");
1333 gtk_widget_show (button_extsend);
1334 gtk_box_pack_start (GTK_BOX (hbox1), button_extsend, FALSE, FALSE, 0);
1337 vbox2 = gtk_vbox_new (FALSE, 0);
1338 gtk_widget_show (vbox2);
1339 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1341 PACK_CHECK_BUTTON (vbox2, checkbtn_savemsg,
1342 _("Save sent messages to Sent folder"));
1343 PACK_CHECK_BUTTON (vbox2, checkbtn_queuemsg,
1344 _("Queue messages that fail to send"));
1346 hbox1 = gtk_hbox_new (FALSE, 8);
1347 gtk_widget_show (hbox1);
1348 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1350 label_outcharset = gtk_label_new (_("Outgoing codeset"));
1351 gtk_widget_show (label_outcharset);
1352 gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, FALSE, FALSE, 0);
1354 optmenu = gtk_option_menu_new ();
1355 gtk_widget_show (optmenu);
1356 gtk_box_pack_start (GTK_BOX (hbox1), optmenu, FALSE, FALSE, 0);
1358 optmenu_menu = gtk_menu_new ();
1360 #define SET_MENUITEM(str, charset) \
1362 MENUITEM_ADD(optmenu_menu, menuitem, str, charset); \
1365 SET_MENUITEM(_("Automatic (Recommended)"), CS_AUTO);
1366 SET_MENUITEM(_("7bit ascii (US-ASCII)"), CS_US_ASCII);
1368 SET_MENUITEM(_("Unicode (UTF-8)"), CS_UTF_8);
1370 SET_MENUITEM(_("Western European (ISO-8859-1)"), CS_ISO_8859_1);
1371 SET_MENUITEM(_("Western European (ISO-8859-15)"), CS_ISO_8859_15);
1372 SET_MENUITEM(_("Central European (ISO-8859-2)"), CS_ISO_8859_2);
1373 SET_MENUITEM(_("Baltic (ISO-8859-13)"), CS_ISO_8859_13);
1374 SET_MENUITEM(_("Baltic (ISO-8859-4)"), CS_ISO_8859_4);
1375 SET_MENUITEM(_("Greek (ISO-8859-7)"), CS_ISO_8859_7);
1376 SET_MENUITEM(_("Turkish (ISO-8859-9)"), CS_ISO_8859_9);
1378 SET_MENUITEM(_("Cyrillic (ISO-8859-5)"), CS_ISO_8859_5);
1380 SET_MENUITEM(_("Cyrillic (KOI8-R)"), CS_KOI8_R);
1382 SET_MENUITEM(_("Cyrillic (Windows-1251)"), CS_WINDOWS_1251);
1383 SET_MENUITEM(_("Cyrillic (KOI8-U)"), CS_KOI8_U);
1385 SET_MENUITEM(_("Japanese (ISO-2022-JP)"), CS_ISO_2022_JP);
1387 SET_MENUITEM(_("Japanese (EUC-JP)"), CS_EUC_JP);
1388 SET_MENUITEM(_("Japanese (Shift_JIS)"), CS_SHIFT_JIS);
1390 SET_MENUITEM(_("Simplified Chinese (GB2312)"), CS_GB2312);
1391 SET_MENUITEM(_("Traditional Chinese (Big5)"), CS_BIG5);
1393 SET_MENUITEM(_("Traditional Chinese (EUC-TW)"), CS_EUC_TW);
1394 SET_MENUITEM(_("Chinese (ISO-2022-CN)"), CS_ISO_2022_CN);
1396 SET_MENUITEM(_("Korean (EUC-KR)"), CS_EUC_KR);
1397 SET_MENUITEM(_("Thai (TIS-620)"), CS_TIS_620);
1398 SET_MENUITEM(_("Thai (Windows-874)"), CS_WINDOWS_874);
1400 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
1402 hbox1 = gtk_hbox_new (FALSE, 8);
1403 gtk_widget_show (hbox1);
1404 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1406 label_charset_desc = gtk_label_new
1407 (_("If `Automatic' is selected, the optimal encoding\n"
1408 "for the current locale will be used."));
1409 gtk_widget_show (label_charset_desc);
1410 gtk_box_pack_start (GTK_BOX (hbox1), label_charset_desc,
1412 gtk_label_set_justify(GTK_LABEL (label_charset_desc), GTK_JUSTIFY_LEFT);
1414 p_send.checkbtn_extsend = checkbtn_extsend;
1415 p_send.entry_extsend = entry_extsend;
1416 /* p_send.button_extsend = button_extsend; */
1418 p_send.checkbtn_savemsg = checkbtn_savemsg;
1419 p_send.checkbtn_queuemsg = checkbtn_queuemsg;
1421 p_send.optmenu_charset = optmenu;
1424 static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpointer data)
1428 toggled = gtk_toggle_button_get_active
1429 (GTK_TOGGLE_BUTTON(receive.checkbtn_newmail_manu)) ||
1430 gtk_toggle_button_get_active
1431 (GTK_TOGGLE_BUTTON(receive.checkbtn_newmail_auto));
1432 gtk_widget_set_sensitive(receive.hbox_newmail_notify, toggled);
1436 static void prefs_dictionary_set_data_from_optmenu(PrefParam *param)
1439 gchar *dict_fullname;
1441 g_return_if_fail(param);
1442 g_return_if_fail(param->data);
1443 g_return_if_fail(param->widget);
1444 g_return_if_fail(*(param->widget));
1446 dict_fullname = gtkaspell_get_dictionary_menu_active_item
1447 (gtk_option_menu_get_menu(GTK_OPTION_MENU(*(param->widget))));
1448 str = *((gchar **) param->data);
1451 *((gchar **) param->data) = dict_fullname;
1454 static void prefs_dictionary_set_optmenu(PrefParam *pparam)
1457 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
1459 GtkWidget *menuitem;
1463 g_return_if_fail(optmenu != NULL);
1464 g_return_if_fail(pparam->data != NULL);
1466 if (*(gchar **) pparam->data) {
1467 menu = gtk_option_menu_get_menu(optmenu);
1468 for (cur = GTK_MENU_SHELL(menu)->children;
1469 cur != NULL; cur = cur->next) {
1470 menuitem = GTK_WIDGET(cur->data);
1471 dict_name = gtk_object_get_data(GTK_OBJECT(menuitem),
1473 if (!strcmp2(dict_name, *((gchar **)pparam->data))) {
1474 gtk_option_menu_set_history(optmenu, n);
1481 gtk_option_menu_set_history(optmenu, 0);
1482 prefs_dictionary_set_data_from_optmenu(pparam);
1485 static void prefs_speller_sugmode_set_data_from_optmenu(PrefParam *param)
1488 g_return_if_fail(param);
1489 g_return_if_fail(param->data);
1490 g_return_if_fail(param->widget);
1491 g_return_if_fail(*(param->widget));
1493 sugmode = gtkaspell_get_sugmode_from_option_menu
1494 (GTK_OPTION_MENU(*(param->widget)));
1495 *((gint *) param->data) = sugmode;
1498 static void prefs_speller_sugmode_set_optmenu(PrefParam *pparam)
1500 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
1503 g_return_if_fail(optmenu != NULL);
1504 g_return_if_fail(pparam->data != NULL);
1506 sugmode = *(gint *) pparam->data;
1507 gtkaspell_sugmode_option_menu_set(optmenu, sugmode);
1511 static void prefs_spelling_checkbtn_enable_aspell_toggle_cb
1517 toggled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
1519 gtk_widget_set_sensitive(spelling.entry_aspell_path, toggled);
1520 gtk_widget_set_sensitive(spelling.optmenu_dictionary, toggled);
1521 gtk_widget_set_sensitive(spelling.optmenu_sugmode, toggled);
1522 gtk_widget_set_sensitive(spelling.btn_aspell_path, toggled);
1523 gtk_widget_set_sensitive(spelling.misspelled_btn, toggled);
1524 gtk_widget_set_sensitive(spelling.checkbtn_use_alternate, toggled);
1525 gtk_widget_set_sensitive(spelling.checkbtn_check_while_typing, toggled);
1528 static void prefs_spelling_btn_aspell_path_clicked_cb(GtkWidget *widget,
1531 gchar *file_path, *tmp;
1532 GtkWidget *new_menu;
1534 file_path = filesel_select_file(_("Select dictionaries location"),
1535 prefs_common.aspell_path);
1536 if (file_path == NULL) {
1540 tmp=g_dirname(file_path);
1542 if (prefs_common.aspell_path)
1543 g_free(prefs_common.aspell_path);
1544 prefs_common.aspell_path = g_strdup_printf("%s%s",tmp,
1547 new_menu = gtkaspell_dictionary_option_menu_new(prefs_common.aspell_path);
1548 gtk_option_menu_set_menu(GTK_OPTION_MENU(spelling.optmenu_dictionary),
1551 gtk_entry_set_text(GTK_ENTRY(spelling.entry_aspell_path),
1552 prefs_common.aspell_path);
1553 /* select first one */
1554 gtk_option_menu_set_history(GTK_OPTION_MENU(
1555 spelling.optmenu_dictionary), 0);
1557 if (prefs_common.dictionary)
1558 g_free(prefs_common.dictionary);
1560 prefs_common.dictionary =
1561 gtkaspell_get_dictionary_menu_active_item(
1562 gtk_option_menu_get_menu(
1564 spelling.optmenu_dictionary)));
1570 static void prefs_spelling_create()
1573 GtkWidget *frame_spell;
1574 GtkWidget *vbox_spell;
1575 GtkWidget *hbox_aspell_path;
1576 GtkWidget *checkbtn_enable_aspell;
1577 GtkWidget *label_aspell_path;
1578 GtkWidget *entry_aspell_path;
1579 GtkWidget *btn_aspell_path;
1580 GtkWidget *spell_table;
1581 GtkWidget *label_dictionary;
1582 GtkWidget *optmenu_dictionary;
1583 GtkWidget *sugmode_label;
1584 GtkWidget *sugmode_optmenu;
1585 GtkWidget *checkbtn_use_alternate;
1586 GtkWidget *help_label;
1587 GtkWidget *checkbtn_check_while_typing;
1588 GtkWidget *color_label;
1589 GtkWidget *col_align;
1591 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1592 gtk_widget_show (vbox1);
1593 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1594 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1596 /* spell checker defaults */
1597 PACK_FRAME(vbox1, frame_spell, _("Global spelling checker settings"));
1598 vbox_spell = gtk_vbox_new(FALSE, VSPACING_NARROW);
1599 gtk_widget_show (vbox_spell);
1600 gtk_container_add(GTK_CONTAINER(frame_spell), vbox_spell);
1601 gtk_container_set_border_width(GTK_CONTAINER(vbox_spell), 8);
1603 PACK_CHECK_BUTTON(vbox_spell, checkbtn_enable_aspell,
1604 _("Enable spell checker"));
1606 gtk_signal_connect(GTK_OBJECT(checkbtn_enable_aspell), "toggled",
1607 GTK_SIGNAL_FUNC(prefs_spelling_checkbtn_enable_aspell_toggle_cb),
1610 /* Check while typing */
1611 PACK_CHECK_BUTTON(vbox_spell, checkbtn_check_while_typing,
1612 _("Check while typing"));
1614 PACK_CHECK_BUTTON(vbox_spell, checkbtn_use_alternate,
1615 _("Enable alternate dictionary"));
1617 help_label = gtk_label_new(_("Enabling an alternate dictionary makes switching\n"
1618 "with the last used dictionary faster."));
1619 gtk_misc_set_alignment (GTK_MISC (help_label), 0, 0);
1620 gtk_widget_show(help_label);
1621 gtk_box_pack_start(GTK_BOX(vbox_spell), help_label, FALSE, TRUE, 0);
1623 spell_table = gtk_table_new(4, 3, FALSE);
1624 gtk_container_set_border_width (GTK_CONTAINER (spell_table), VSPACING);
1625 gtk_table_set_row_spacings(GTK_TABLE(spell_table), 8);
1626 gtk_table_set_col_spacings(GTK_TABLE(spell_table), 8);
1628 gtk_box_pack_start(GTK_BOX(vbox_spell), spell_table, TRUE, TRUE, 0);
1630 label_aspell_path = gtk_label_new (_("Dictionaries path:"));
1631 gtk_misc_set_alignment(GTK_MISC(label_aspell_path), 1.0, 0.5);
1632 gtk_widget_show(label_aspell_path);
1633 gtk_table_attach (GTK_TABLE (spell_table), label_aspell_path, 0, 1, 0,
1634 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1636 hbox_aspell_path = gtk_hbox_new (FALSE, 8);
1637 gtk_table_attach (GTK_TABLE (spell_table), hbox_aspell_path, 1, 2, 0,
1638 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1639 gtk_widget_show(hbox_aspell_path);
1641 entry_aspell_path = gtk_entry_new();
1642 gtk_widget_show(entry_aspell_path);
1643 gtk_box_pack_start(GTK_BOX(hbox_aspell_path), entry_aspell_path, TRUE,
1646 gtk_widget_set_sensitive(entry_aspell_path, prefs_common.enable_aspell);
1648 btn_aspell_path = gtk_button_new_with_label(" ... ");
1649 gtk_widget_show(btn_aspell_path);
1650 gtk_box_pack_start(GTK_BOX(hbox_aspell_path), btn_aspell_path, FALSE, FALSE, 0);
1651 gtk_widget_set_sensitive(btn_aspell_path, prefs_common.enable_aspell);
1653 gtk_signal_connect(GTK_OBJECT(btn_aspell_path), "clicked",
1654 GTK_SIGNAL_FUNC(prefs_spelling_btn_aspell_path_clicked_cb),
1657 label_dictionary = gtk_label_new(_("Default dictionary:"));
1658 gtk_misc_set_alignment(GTK_MISC(label_dictionary), 1.0, 0.5);
1659 gtk_widget_show(label_dictionary);
1660 gtk_table_attach (GTK_TABLE (spell_table), label_dictionary, 0, 1, 1, 2,
1661 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1663 optmenu_dictionary = gtk_option_menu_new();
1664 gtk_widget_show(optmenu_dictionary);
1665 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_dictionary),
1666 gtkaspell_dictionary_option_menu_new(
1667 prefs_common.aspell_path));
1668 gtk_table_attach (GTK_TABLE (spell_table), optmenu_dictionary, 1, 2, 1,
1669 2, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1670 gtk_widget_set_sensitive(optmenu_dictionary, prefs_common.enable_aspell);
1672 /* Suggestion mode */
1673 sugmode_label = gtk_label_new(_("Default suggestion mode"));
1674 gtk_misc_set_alignment(GTK_MISC(sugmode_label), 1.0, 0.5);
1675 gtk_widget_show(sugmode_label);
1676 gtk_table_attach(GTK_TABLE (spell_table), sugmode_label, 0, 1, 2, 3,
1677 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1679 sugmode_optmenu = gtk_option_menu_new();
1680 gtk_widget_show(sugmode_optmenu);
1681 gtk_option_menu_set_menu(GTK_OPTION_MENU(sugmode_optmenu),
1682 gtkaspell_sugmode_option_menu_new(prefs_common.aspell_sugmode));
1683 gtk_table_attach(GTK_TABLE(spell_table), sugmode_optmenu, 1, 2, 2, 3,
1684 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1685 gtk_widget_set_sensitive(sugmode_optmenu, prefs_common.enable_aspell);
1688 color_label = gtk_label_new(_("Misspelled word color:"));
1689 gtk_misc_set_alignment(GTK_MISC(color_label), 1.0, 0.5);
1690 gtk_table_attach (GTK_TABLE (spell_table), color_label, 0, 1, 3, 4,
1691 GTK_FILL, GTK_SHRINK, 0, 0);
1692 gtk_widget_show(color_label);
1694 col_align = gtk_alignment_new(0.0, 0.5, 0, 0);
1695 gtk_widget_show(col_align);
1696 gtk_table_attach (GTK_TABLE (spell_table), col_align, 1, 2, 3, 4,
1697 GTK_FILL, GTK_SHRINK, 0, 0);
1699 spelling.misspelled_btn = gtk_button_new_with_label ("");
1700 set_button_bg_color(spelling.misspelled_btn,
1701 prefs_common.misspelled_col);
1702 gtk_widget_set_usize (spelling.misspelled_btn, 30, 20);
1703 gtk_widget_set_sensitive(spelling.misspelled_btn, prefs_common.enable_aspell);
1704 gtk_signal_connect (GTK_OBJECT (spelling.misspelled_btn), "clicked",
1705 GTK_SIGNAL_FUNC(quote_color_set_dialog), "Misspelled word");
1706 gtk_container_add(GTK_CONTAINER(col_align), spelling.misspelled_btn);
1709 spelling.checkbtn_enable_aspell = checkbtn_enable_aspell;
1710 spelling.entry_aspell_path = entry_aspell_path;
1711 spelling.btn_aspell_path = btn_aspell_path;
1712 spelling.optmenu_dictionary = optmenu_dictionary;
1713 spelling.optmenu_sugmode = sugmode_optmenu;
1714 spelling.checkbtn_use_alternate = checkbtn_use_alternate;
1715 spelling.checkbtn_check_while_typing = checkbtn_check_while_typing;
1721 static void prefs_compose_create(void)
1727 GtkWidget *frame_sig;
1728 GtkWidget *vbox_sig;
1729 GtkWidget *checkbtn_autosig;
1730 GtkWidget *label_sigsep;
1731 GtkWidget *entry_sigsep;
1733 GtkWidget *checkbtn_autoextedit;
1735 GtkWidget *frame_autosel;
1736 GtkWidget *hbox_autosel;
1737 GtkWidget *checkbtn_reply_account_autosel;
1738 GtkWidget *checkbtn_forward_account_autosel;
1739 GtkWidget *checkbtn_reedit_account_autosel;
1741 GtkWidget *hbox_undolevel;
1742 GtkWidget *label_undolevel;
1743 GtkObject *spinbtn_undolevel_adj;
1744 GtkWidget *spinbtn_undolevel;
1746 GtkWidget *vbox_linewrap;
1751 GtkWidget *label_linewrap;
1752 GtkObject *spinbtn_linewrap_adj;
1753 GtkWidget *spinbtn_linewrap;
1754 GtkWidget *checkbtn_wrapquote;
1755 GtkWidget *checkbtn_autowrap;
1756 GtkWidget *checkbtn_wrapatsend;
1758 GtkWidget *checkbtn_default_reply_list;
1760 GtkWidget *checkbtn_forward_as_attachment;
1761 GtkWidget *checkbtn_redirect_keep_from;
1762 GtkWidget *checkbtn_smart_wrapping;
1763 GtkWidget *checkbtn_block_cursor;
1764 GtkWidget *frame_msgwrap;
1766 GtkWidget *hbox_autosave;
1767 GtkWidget *checkbtn_autosave;
1768 GtkWidget *entry_autosave_length;
1769 GtkWidget *label_autosave_length;
1771 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1772 gtk_widget_show (vbox1);
1773 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1774 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1776 PACK_FRAME(vbox1, frame_sig, _("Signature"));
1778 vbox_sig = gtk_vbox_new (FALSE, VSPACING_NARROW);
1779 gtk_widget_show (vbox_sig);
1780 gtk_container_add (GTK_CONTAINER (frame_sig), vbox_sig);
1781 gtk_container_set_border_width (GTK_CONTAINER (vbox_sig), 8);
1783 PACK_CHECK_BUTTON (vbox_sig, checkbtn_autosig,
1784 _("Insert signature automatically"));
1786 hbox1 = gtk_hbox_new (FALSE, 8);
1787 gtk_widget_show (hbox1);
1788 gtk_box_pack_start (GTK_BOX (vbox_sig), hbox1, TRUE, TRUE, 0);
1789 label_sigsep = gtk_label_new (_("Signature separator"));
1790 gtk_widget_show (label_sigsep);
1791 gtk_box_pack_start (GTK_BOX (hbox1), label_sigsep, FALSE, FALSE, 0);
1793 entry_sigsep = gtk_entry_new ();
1794 gtk_widget_show (entry_sigsep);
1795 gtk_box_pack_start (GTK_BOX (hbox1), entry_sigsep, FALSE, FALSE, 0);
1797 gtk_widget_set_usize (entry_sigsep, 64, -1);
1799 /* Account autoselection */
1800 PACK_FRAME(vbox1, frame_autosel, _("Automatic account selection"));
1802 hbox_autosel = gtk_hbox_new (FALSE, VSPACING_NARROW);
1803 gtk_widget_show (hbox_autosel);
1804 gtk_container_add (GTK_CONTAINER (frame_autosel), hbox_autosel);
1805 gtk_container_set_border_width (GTK_CONTAINER (hbox_autosel), 8);
1807 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reply_account_autosel,
1808 _("when replying"));
1809 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_forward_account_autosel,
1810 _("when forwarding"));
1811 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reedit_account_autosel,
1812 _("when re-editing"));
1814 vbox2 = gtk_vbox_new (FALSE, 0);
1815 gtk_widget_show (vbox2);
1816 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1818 PACK_CHECK_BUTTON (vbox2, checkbtn_default_reply_list,
1819 _("Reply button invokes mailing list reply"));
1821 PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
1822 _("Automatically launch the external editor"));
1824 hbox5 = gtk_hbox_new (FALSE, 8);
1825 gtk_widget_show (hbox5);
1826 gtk_box_pack_start (GTK_BOX (vbox2), hbox5, FALSE, FALSE, 0);
1828 PACK_CHECK_BUTTON (hbox5, checkbtn_forward_as_attachment,
1829 _("Forward as attachment"));
1831 PACK_CHECK_BUTTON (hbox5, checkbtn_block_cursor,
1834 PACK_CHECK_BUTTON (vbox2, checkbtn_redirect_keep_from,
1835 _("Keep the original 'From' header when redirecting"));
1838 hbox_autosave = gtk_hbox_new (FALSE, 8);
1839 gtk_widget_show (hbox_autosave);
1840 gtk_box_pack_start (GTK_BOX (vbox1), hbox_autosave, FALSE, FALSE, 0);
1842 PACK_CHECK_BUTTON (hbox_autosave, checkbtn_autosave,
1843 _("Autosave to Drafts folder every "));
1845 entry_autosave_length = gtk_entry_new();
1846 gtk_widget_set_usize (entry_autosave_length, 64, -1);
1847 gtk_widget_show (entry_autosave_length);
1848 gtk_box_pack_start (GTK_BOX (hbox_autosave), entry_autosave_length, FALSE, FALSE, 0);
1850 label_autosave_length = gtk_label_new(_("characters"));
1851 gtk_widget_show (label_autosave_length);
1852 gtk_box_pack_start (GTK_BOX (hbox_autosave), label_autosave_length, FALSE, FALSE, 0);
1854 hbox_undolevel = gtk_hbox_new (FALSE, 8);
1855 gtk_widget_show (hbox_undolevel);
1856 gtk_box_pack_start (GTK_BOX (vbox1), hbox_undolevel, FALSE, FALSE, 0);
1858 label_undolevel = gtk_label_new (_("Undo level"));
1859 gtk_widget_show (label_undolevel);
1860 gtk_box_pack_start (GTK_BOX (hbox_undolevel), label_undolevel, FALSE, FALSE, 0);
1862 spinbtn_undolevel_adj = gtk_adjustment_new (50, 0, 100, 1, 10, 10);
1863 spinbtn_undolevel = gtk_spin_button_new
1864 (GTK_ADJUSTMENT (spinbtn_undolevel_adj), 1, 0);
1865 gtk_widget_show (spinbtn_undolevel);
1866 gtk_box_pack_start (GTK_BOX (hbox_undolevel), spinbtn_undolevel, FALSE, FALSE, 0);
1867 gtk_widget_set_usize (spinbtn_undolevel, 64, -1);
1868 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevel), TRUE);
1871 PACK_FRAME(vbox1, frame_msgwrap, _("Message wrapping"));
1873 vbox_linewrap = gtk_vbox_new (FALSE, VSPACING_NARROW);
1874 gtk_widget_show (vbox_linewrap);
1875 gtk_container_add (GTK_CONTAINER (frame_msgwrap), vbox_linewrap);
1876 gtk_container_set_border_width (GTK_CONTAINER (vbox_linewrap), 8);
1878 hbox3 = gtk_hbox_new (FALSE, 8);
1879 gtk_widget_show (hbox3);
1880 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox3, FALSE, FALSE, 0);
1883 label_linewrap = gtk_label_new (_("Wrap messages at"));
1884 gtk_widget_show (label_linewrap);
1885 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1887 spinbtn_linewrap_adj = gtk_adjustment_new (72, 20, 1024, 1, 10, 10);
1888 spinbtn_linewrap = gtk_spin_button_new
1889 (GTK_ADJUSTMENT (spinbtn_linewrap_adj), 1, 0);
1890 gtk_widget_show (spinbtn_linewrap);
1891 gtk_box_pack_start (GTK_BOX (hbox3), spinbtn_linewrap, FALSE, FALSE, 0);
1892 gtk_widget_set_usize (spinbtn_linewrap, 64, -1);
1893 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linewrap), TRUE);
1895 label_linewrap = gtk_label_new (_("characters"));
1896 gtk_widget_show (label_linewrap);
1897 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1899 hbox4 = gtk_hbox_new (FALSE, VSPACING);
1900 gtk_widget_show (hbox4);
1901 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox4, FALSE, FALSE, 0);
1903 PACK_CHECK_BUTTON (hbox4, checkbtn_wrapquote, _("Wrap quotation"));
1905 PACK_CHECK_BUTTON (hbox4, checkbtn_autowrap, _("Wrap on input"));
1908 (hbox4, checkbtn_wrapatsend, _("Wrap before sending"));
1910 PACK_CHECK_BUTTON (vbox_linewrap, checkbtn_smart_wrapping,
1911 _("Smart wrapping (EXPERIMENTAL)"));
1914 compose.checkbtn_quote = checkbtn_quote;
1915 compose.entry_quotemark = entry_quotemark;
1916 compose.text_quotefmt = text_quotefmt;
1918 compose.checkbtn_autosig = checkbtn_autosig;
1919 compose.entry_sigsep = entry_sigsep;
1921 compose.checkbtn_autoextedit = checkbtn_autoextedit;
1923 compose.checkbtn_reply_account_autosel = checkbtn_reply_account_autosel;
1924 compose.checkbtn_forward_account_autosel = checkbtn_forward_account_autosel;
1925 compose.checkbtn_reedit_account_autosel = checkbtn_reedit_account_autosel;
1927 compose.spinbtn_undolevel = spinbtn_undolevel;
1928 compose.spinbtn_undolevel_adj = spinbtn_undolevel_adj;
1930 compose.spinbtn_linewrap = spinbtn_linewrap;
1931 compose.spinbtn_linewrap_adj = spinbtn_linewrap_adj;
1932 compose.checkbtn_wrapquote = checkbtn_wrapquote;
1933 compose.checkbtn_autowrap = checkbtn_autowrap;
1934 compose.checkbtn_wrapatsend = checkbtn_wrapatsend;
1936 compose.checkbtn_autosave = checkbtn_autosave;
1937 compose.entry_autosave_length = entry_autosave_length;
1939 compose.checkbtn_forward_as_attachment =
1940 checkbtn_forward_as_attachment;
1941 compose.checkbtn_redirect_keep_from =
1942 checkbtn_redirect_keep_from;
1943 compose.checkbtn_smart_wrapping =
1944 checkbtn_smart_wrapping;
1945 compose.checkbtn_block_cursor =
1946 checkbtn_block_cursor;
1947 compose.checkbtn_default_reply_list = checkbtn_default_reply_list;
1950 static void prefs_quote_create(void)
1953 GtkWidget *frame_quote;
1954 GtkWidget *vbox_quote;
1957 GtkWidget *label_quotemark;
1958 GtkWidget *entry_quotemark;
1959 GtkWidget *scrolledwin_quotefmt;
1960 GtkWidget *text_quotefmt;
1962 GtkWidget *entry_fw_quotemark;
1963 GtkWidget *text_fw_quotefmt;
1965 GtkWidget *entry_quote_chars;
1966 GtkWidget *label_quote_chars;
1968 GtkWidget *btn_quotedesc;
1970 GtkWidget *checkbtn_reply_with_quote;
1972 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1973 gtk_widget_show (vbox1);
1974 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1975 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1979 PACK_CHECK_BUTTON (vbox1, checkbtn_reply_with_quote, _("Reply will quote by default"));
1981 PACK_FRAME (vbox1, frame_quote, _("Reply format"));
1983 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
1984 gtk_widget_show (vbox_quote);
1985 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
1986 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
1988 hbox1 = gtk_hbox_new (FALSE, 32);
1989 gtk_widget_show (hbox1);
1990 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
1992 hbox2 = gtk_hbox_new (FALSE, 8);
1993 gtk_widget_show (hbox2);
1994 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
1996 label_quotemark = gtk_label_new (_("Quotation mark"));
1997 gtk_widget_show (label_quotemark);
1998 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
2000 entry_quotemark = gtk_entry_new ();
2001 gtk_widget_show (entry_quotemark);
2002 gtk_box_pack_start (GTK_BOX (hbox2), entry_quotemark, FALSE, FALSE, 0);
2003 gtk_widget_set_usize (entry_quotemark, 64, -1);
2005 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
2006 gtk_widget_show (scrolledwin_quotefmt);
2007 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
2008 gtk_scrolled_window_set_policy
2009 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
2010 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
2012 text_quotefmt = gtk_text_new (NULL, NULL);
2013 gtk_widget_show (text_quotefmt);
2014 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt), text_quotefmt);
2015 gtk_text_set_editable (GTK_TEXT (text_quotefmt), TRUE);
2016 gtk_widget_set_usize(text_quotefmt, -1, 60);
2020 PACK_FRAME (vbox1, frame_quote, _("Forward format"));
2022 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
2023 gtk_widget_show (vbox_quote);
2024 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
2025 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
2027 hbox1 = gtk_hbox_new (FALSE, 32);
2028 gtk_widget_show (hbox1);
2029 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
2031 hbox2 = gtk_hbox_new (FALSE, 8);
2032 gtk_widget_show (hbox2);
2033 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
2035 label_quotemark = gtk_label_new (_("Quotation mark"));
2036 gtk_widget_show (label_quotemark);
2037 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
2039 entry_fw_quotemark = gtk_entry_new ();
2040 gtk_widget_show (entry_fw_quotemark);
2041 gtk_box_pack_start (GTK_BOX (hbox2), entry_fw_quotemark,
2043 gtk_widget_set_usize (entry_fw_quotemark, 64, -1);
2045 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
2046 gtk_widget_show (scrolledwin_quotefmt);
2047 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
2048 gtk_scrolled_window_set_policy
2049 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
2050 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
2052 text_fw_quotefmt = gtk_text_new (NULL, NULL);
2053 gtk_widget_show (text_fw_quotefmt);
2054 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt),
2056 gtk_text_set_editable (GTK_TEXT (text_fw_quotefmt), TRUE);
2057 gtk_widget_set_usize(text_fw_quotefmt, -1, 60);
2059 hbox1 = gtk_hbox_new (FALSE, 32);
2060 gtk_widget_show (hbox1);
2061 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2064 gtk_button_new_with_label (_(" Description of symbols "));
2065 gtk_widget_show (btn_quotedesc);
2066 gtk_box_pack_start (GTK_BOX (hbox1), btn_quotedesc, FALSE, FALSE, 0);
2067 gtk_signal_connect(GTK_OBJECT(btn_quotedesc), "clicked",
2068 GTK_SIGNAL_FUNC(quote_fmt_quote_description), NULL);
2072 PACK_FRAME (vbox1, frame_quote, _("Quotation characters"));
2074 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
2075 gtk_widget_show (vbox_quote);
2076 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
2077 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
2079 hbox1 = gtk_hbox_new (FALSE, 32);
2080 gtk_widget_show (hbox1);
2081 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
2083 hbox2 = gtk_hbox_new (FALSE, 8);
2084 gtk_widget_show (hbox2);
2085 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
2087 label_quote_chars = gtk_label_new (_("Treat these characters as quotation marks: "));
2088 gtk_widget_show (label_quote_chars);
2089 gtk_box_pack_start (GTK_BOX (hbox2), label_quote_chars, FALSE, FALSE, 0);
2091 entry_quote_chars = gtk_entry_new ();
2092 gtk_widget_show (entry_quote_chars);
2093 gtk_box_pack_start (GTK_BOX (hbox2), entry_quote_chars,
2095 gtk_widget_set_usize (entry_quote_chars, 64, -1);
2098 compose.checkbtn_reply_with_quote= checkbtn_reply_with_quote;
2099 quote.entry_quotemark = entry_quotemark;
2100 quote.text_quotefmt = text_quotefmt;
2101 quote.entry_fw_quotemark = entry_fw_quotemark;
2102 quote.text_fw_quotefmt = text_fw_quotefmt;
2103 quote.entry_quote_chars = entry_quote_chars;
2106 static void prefs_display_create(void)
2109 GtkWidget *frame_font;
2111 GtkWidget *label_textfont;
2112 GtkWidget *entry_textfont;
2113 GtkWidget *button_textfont;
2114 GtkWidget *chkbtn_transhdr;
2115 GtkWidget *chkbtn_folder_unread;
2117 GtkWidget *label_ng_abbrev;
2118 GtkWidget *spinbtn_ng_abbrev_len;
2119 GtkObject *spinbtn_ng_abbrev_len_adj;
2120 GtkWidget *frame_summary;
2122 GtkWidget *chkbtn_swapfrom;
2123 GtkWidget *chkbtn_useaddrbook;
2124 GtkWidget *chkbtn_expand_thread;
2126 GtkWidget *label_datefmt;
2127 GtkWidget *button_datefmt;
2128 GtkWidget *entry_datefmt;
2129 GtkWidget *button_dispitem;
2130 GtkWidget *tmplabel, *tmpbutton, *tmpentry;
2132 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2133 gtk_widget_show (vbox1);
2134 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2135 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2137 PACK_FRAME(vbox1, frame_font, _("Font"));
2139 table1 = gtk_table_new (4, 3, FALSE);
2141 gtk_widget_show (table1);
2142 gtk_container_add (GTK_CONTAINER (frame_font), table1);
2143 gtk_container_set_border_width (GTK_CONTAINER (table1), 8);
2144 gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
2145 gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
2147 label_textfont = gtk_label_new (_("Text"));
2148 gtk_misc_set_alignment(GTK_MISC(label_textfont), 0, 0.5);
2149 gtk_widget_show (label_textfont);
2150 gtk_table_attach (GTK_TABLE (table1), label_textfont, 0, 1, 0, 1,
2151 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2153 entry_textfont = gtk_entry_new ();
2154 gtk_widget_show (entry_textfont);
2155 gtk_table_attach (GTK_TABLE (table1), entry_textfont, 1, 2, 0, 1,
2156 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2158 button_textfont = gtk_button_new_with_label (" ... ");
2160 gtk_widget_show (button_textfont);
2161 gtk_table_attach (GTK_TABLE (table1), button_textfont, 2, 3, 0, 1,
2163 gtk_signal_connect (GTK_OBJECT (button_textfont), "clicked",
2164 GTK_SIGNAL_FUNC (prefs_font_select), entry_textfont);
2166 tmplabel = gtk_label_new (_("Small"));
2167 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2168 gtk_widget_show (tmplabel);
2169 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 1, 2,
2170 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2172 tmpentry = gtk_entry_new ();
2173 gtk_widget_show (tmpentry);
2174 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 1, 2,
2175 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2177 tmpbutton = gtk_button_new_with_label (" ... ");
2178 gtk_widget_show (tmpbutton);
2179 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 1, 2,
2181 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2182 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2183 display.entry_smallfont = tmpentry;
2185 tmplabel = gtk_label_new (_("Normal"));
2186 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2187 gtk_widget_show (tmplabel);
2188 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 2, 3,
2189 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2191 tmpentry = gtk_entry_new ();
2192 gtk_widget_show (tmpentry);
2193 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 2, 3,
2194 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2196 tmpbutton = gtk_button_new_with_label (" ... ");
2197 gtk_widget_show (tmpbutton);
2198 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 2, 3,
2200 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2201 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2202 display.entry_normalfont = tmpentry;
2204 tmplabel = gtk_label_new (_("Bold"));
2205 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2206 gtk_widget_show (tmplabel);
2207 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 3, 4,
2208 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2210 tmpentry = gtk_entry_new ();
2211 gtk_widget_show (tmpentry);
2212 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 3, 4,
2213 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2215 tmpbutton = gtk_button_new_with_label (" ... ");
2216 gtk_widget_show (tmpbutton);
2217 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 3, 4,
2219 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2220 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2221 display.entry_boldfont = tmpentry;
2223 vbox2 = gtk_vbox_new (FALSE, 0);
2224 gtk_widget_show (vbox2);
2225 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, TRUE, 0);
2228 (vbox2, chkbtn_transhdr,
2229 _("Translate header name (such as `From:', `Subject:')"));
2231 PACK_CHECK_BUTTON (vbox2, chkbtn_folder_unread,
2232 _("Display unread number next to folder name"));
2234 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2236 hbox1 = gtk_hbox_new (FALSE, 8);
2237 gtk_widget_show (hbox1);
2238 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2240 label_ng_abbrev = gtk_label_new
2241 (_("Abbreviate newsgroup names longer than"));
2242 gtk_widget_show (label_ng_abbrev);
2243 gtk_box_pack_start (GTK_BOX (hbox1), label_ng_abbrev, FALSE, FALSE, 0);
2245 spinbtn_ng_abbrev_len_adj = gtk_adjustment_new (16, 0, 999, 1, 10, 10);
2246 spinbtn_ng_abbrev_len = gtk_spin_button_new
2247 (GTK_ADJUSTMENT (spinbtn_ng_abbrev_len_adj), 1, 0);
2248 gtk_widget_show (spinbtn_ng_abbrev_len);
2249 gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_ng_abbrev_len,
2251 gtk_widget_set_usize (spinbtn_ng_abbrev_len, 56, -1);
2252 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_ng_abbrev_len),
2255 label_ng_abbrev = gtk_label_new
2257 gtk_widget_show (label_ng_abbrev);
2258 gtk_box_pack_start (GTK_BOX (hbox1), label_ng_abbrev, FALSE, FALSE, 0);
2260 /* ---- Summary ---- */
2262 PACK_FRAME(vbox1, frame_summary, _("Summary View"));
2264 vbox2 = gtk_vbox_new (FALSE, 0);
2265 gtk_widget_show (vbox2);
2266 gtk_container_add (GTK_CONTAINER (frame_summary), vbox2);
2267 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
2270 (vbox2, chkbtn_swapfrom,
2271 _("Display recipient on `From' column if sender is yourself"));
2273 (vbox2, chkbtn_useaddrbook,
2274 _("Display sender using address book"));
2276 (vbox2, chkbtn_expand_thread, _("Expand threads"));
2278 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2280 hbox1 = gtk_hbox_new (FALSE, 8);
2281 gtk_widget_show (hbox1);
2282 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2284 label_datefmt = gtk_label_new (_("Date format"));
2285 gtk_widget_show (label_datefmt);
2286 gtk_box_pack_start (GTK_BOX (hbox1), label_datefmt, FALSE, FALSE, 0);
2288 entry_datefmt = gtk_entry_new ();
2289 gtk_widget_show (entry_datefmt);
2290 gtk_box_pack_start (GTK_BOX (hbox1), entry_datefmt, TRUE, TRUE, 0);
2292 button_datefmt = gtk_button_new_with_label (" ... ");
2294 gtk_widget_show (button_datefmt);
2295 gtk_box_pack_start (GTK_BOX (hbox1), button_datefmt, FALSE, FALSE, 0);
2296 gtk_signal_connect (GTK_OBJECT (button_datefmt), "clicked",
2297 GTK_SIGNAL_FUNC (date_format_create), NULL);
2299 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
2301 hbox1 = gtk_hbox_new (FALSE, 8);
2302 gtk_widget_show (hbox1);
2303 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2305 button_dispitem = gtk_button_new_with_label
2306 (_(" Set displayed items in summary... "));
2307 gtk_widget_show (button_dispitem);
2308 gtk_box_pack_start (GTK_BOX (hbox1), button_dispitem, FALSE, TRUE, 0);
2309 gtk_signal_connect (GTK_OBJECT (button_dispitem), "clicked",
2310 GTK_SIGNAL_FUNC (prefs_summary_column_open),
2313 display.entry_textfont = entry_textfont;
2314 display.button_textfont = button_textfont;
2316 display.chkbtn_transhdr = chkbtn_transhdr;
2317 display.chkbtn_folder_unread = chkbtn_folder_unread;
2318 display.spinbtn_ng_abbrev_len = spinbtn_ng_abbrev_len;
2319 display.spinbtn_ng_abbrev_len_adj = spinbtn_ng_abbrev_len_adj;
2321 display.chkbtn_swapfrom = chkbtn_swapfrom;
2322 display.chkbtn_expand_thread = chkbtn_expand_thread;
2323 display.chkbtn_useaddrbook = chkbtn_useaddrbook;
2324 display.entry_datefmt = entry_datefmt;
2327 static void prefs_message_create(void)
2333 GtkWidget *chkbtn_enablecol;
2334 GtkWidget *button_edit_col;
2335 GtkWidget *chkbtn_mbalnum;
2336 GtkWidget *chkbtn_disphdrpane;
2337 GtkWidget *chkbtn_disphdr;
2338 GtkWidget *button_edit_disphdr;
2339 GtkWidget *hbox_linespc;
2340 GtkWidget *label_linespc;
2341 GtkObject *spinbtn_linespc_adj;
2342 GtkWidget *spinbtn_linespc;
2343 GtkWidget *chkbtn_headspc;
2345 GtkWidget *frame_scr;
2346 GtkWidget *vbox_scr;
2347 GtkWidget *chkbtn_smoothscroll;
2348 GtkWidget *hbox_scr;
2349 GtkWidget *label_scr;
2350 GtkObject *spinbtn_scrollstep_adj;
2351 GtkWidget *spinbtn_scrollstep;
2352 GtkWidget *chkbtn_halfpage;
2354 GtkWidget *chkbtn_display_img;
2355 GtkWidget *chkbtn_resize_image;
2357 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2358 gtk_widget_show (vbox1);
2359 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2360 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2362 vbox2 = gtk_vbox_new (FALSE, 0);
2363 gtk_widget_show (vbox2);
2364 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2366 hbox1 = gtk_hbox_new (FALSE, 8);
2367 gtk_widget_show (hbox1);
2368 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2370 PACK_CHECK_BUTTON (hbox1, chkbtn_enablecol,
2371 _("Enable coloration of message"));
2372 gtk_signal_connect (GTK_OBJECT (chkbtn_enablecol), "toggled",
2373 GTK_SIGNAL_FUNC (prefs_enable_message_color_toggled),
2376 button_edit_col = gtk_button_new_with_label (_(" Edit... "));
2377 gtk_widget_show (button_edit_col);
2378 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_col, FALSE, TRUE, 0);
2379 gtk_signal_connect (GTK_OBJECT (button_edit_col), "clicked",
2380 GTK_SIGNAL_FUNC (prefs_quote_colors_dialog), NULL);
2382 SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, button_edit_col);
2385 (vbox2, chkbtn_mbalnum,
2386 _("Display multi-byte alphanumeric as\n"
2387 "ASCII character (Japanese only)"));
2388 gtk_label_set_justify (GTK_LABEL (GTK_BIN(chkbtn_mbalnum)->child),
2391 PACK_CHECK_BUTTON(vbox2, chkbtn_disphdrpane,
2392 _("Display header pane above message view"));
2394 hbox1 = gtk_hbox_new (FALSE, 8);
2395 gtk_widget_show (hbox1);
2396 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2398 PACK_CHECK_BUTTON(hbox1, chkbtn_disphdr,
2399 _("Display short headers on message view"));
2401 button_edit_disphdr = gtk_button_new_with_label (_(" Edit... "));
2402 gtk_widget_show (button_edit_disphdr);
2403 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_disphdr,
2405 gtk_signal_connect (GTK_OBJECT (button_edit_disphdr), "clicked",
2406 GTK_SIGNAL_FUNC (prefs_display_header_open),
2409 SET_TOGGLE_SENSITIVITY(chkbtn_disphdr, button_edit_disphdr);
2411 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2413 hbox1 = gtk_hbox_new (FALSE, 32);
2414 gtk_widget_show (hbox1);
2415 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2417 hbox_linespc = gtk_hbox_new (FALSE, 8);
2418 gtk_widget_show (hbox1);
2419 gtk_box_pack_start (GTK_BOX (hbox1), hbox_linespc, FALSE, TRUE, 0);
2421 label_linespc = gtk_label_new (_("Line space"));
2422 gtk_widget_show (label_linespc);
2423 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2426 spinbtn_linespc_adj = gtk_adjustment_new (2, 0, 16, 1, 1, 16);
2427 spinbtn_linespc = gtk_spin_button_new
2428 (GTK_ADJUSTMENT (spinbtn_linespc_adj), 1, 0);
2429 gtk_widget_show (spinbtn_linespc);
2430 gtk_box_pack_start (GTK_BOX (hbox_linespc), spinbtn_linespc,
2432 gtk_widget_set_usize (spinbtn_linespc, 64, -1);
2433 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linespc), TRUE);
2435 label_linespc = gtk_label_new (_("pixel(s)"));
2436 gtk_widget_show (label_linespc);
2437 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2440 PACK_CHECK_BUTTON(hbox1, chkbtn_headspc, _("Leave space on head"));
2442 PACK_FRAME(vbox1, frame_scr, _("Scroll"));
2444 vbox_scr = gtk_vbox_new (FALSE, 0);
2445 gtk_widget_show (vbox_scr);
2446 gtk_container_add (GTK_CONTAINER (frame_scr), vbox_scr);
2447 gtk_container_set_border_width (GTK_CONTAINER (vbox_scr), 8);
2449 PACK_CHECK_BUTTON(vbox_scr, chkbtn_halfpage, _("Half page"));
2451 hbox1 = gtk_hbox_new (FALSE, 32);
2452 gtk_widget_show (hbox1);
2453 gtk_box_pack_start (GTK_BOX (vbox_scr), hbox1, FALSE, TRUE, 0);
2455 PACK_CHECK_BUTTON(hbox1, chkbtn_smoothscroll, _("Smooth scroll"));
2457 hbox_scr = gtk_hbox_new (FALSE, 8);
2458 gtk_widget_show (hbox_scr);
2459 gtk_box_pack_start (GTK_BOX (hbox1), hbox_scr, FALSE, FALSE, 0);
2461 label_scr = gtk_label_new (_("Step"));
2462 gtk_widget_show (label_scr);
2463 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2465 spinbtn_scrollstep_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 10);
2466 spinbtn_scrollstep = gtk_spin_button_new
2467 (GTK_ADJUSTMENT (spinbtn_scrollstep_adj), 1, 0);
2468 gtk_widget_show (spinbtn_scrollstep);
2469 gtk_box_pack_start (GTK_BOX (hbox_scr), spinbtn_scrollstep,
2471 gtk_widget_set_usize (spinbtn_scrollstep, 64, -1);
2472 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_scrollstep),
2475 label_scr = gtk_label_new (_("pixel(s)"));
2476 gtk_widget_show (label_scr);
2477 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2479 SET_TOGGLE_SENSITIVITY (chkbtn_smoothscroll, hbox_scr)
2481 vbox3 = gtk_vbox_new (FALSE, 0);
2482 gtk_widget_show (vbox3);
2483 gtk_box_pack_start (GTK_BOX (vbox1), vbox3, FALSE, FALSE, 0);
2485 PACK_CHECK_BUTTON(vbox3, chkbtn_display_img,
2486 _("Automatically display attached images"));
2488 PACK_CHECK_BUTTON(vbox3, chkbtn_resize_image,
2489 _("Resize attached images"));
2491 message.chkbtn_enablecol = chkbtn_enablecol;
2492 message.button_edit_col = button_edit_col;
2493 message.chkbtn_mbalnum = chkbtn_mbalnum;
2494 message.chkbtn_disphdrpane = chkbtn_disphdrpane;
2495 message.chkbtn_disphdr = chkbtn_disphdr;
2496 message.spinbtn_linespc = spinbtn_linespc;
2497 message.chkbtn_headspc = chkbtn_headspc;
2499 message.chkbtn_smoothscroll = chkbtn_smoothscroll;
2500 message.spinbtn_scrollstep = spinbtn_scrollstep;
2501 message.spinbtn_scrollstep_adj = spinbtn_scrollstep_adj;
2502 message.chkbtn_halfpage = chkbtn_halfpage;
2504 message.chkbtn_display_img = chkbtn_display_img;
2505 message.chkbtn_resize_image = chkbtn_resize_image;
2509 static void prefs_privacy_create(void)
2515 GtkWidget *hbox_spc;
2517 GtkWidget *checkbtn_auto_check_signatures;
2518 GtkWidget *checkbtn_gpg_signature_popup;
2519 GtkWidget *checkbtn_store_passphrase;
2520 GtkObject *spinbtn_store_passphrase_adj;
2521 GtkWidget *spinbtn_store_passphrase;
2522 GtkWidget *checkbtn_passphrase_grab;
2523 GtkWidget *checkbtn_gpg_warning;
2525 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2526 gtk_widget_show (vbox1);
2527 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2528 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2530 vbox2 = gtk_vbox_new (FALSE, 0);
2531 gtk_widget_show (vbox2);
2532 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2534 PACK_CHECK_BUTTON (vbox2, checkbtn_auto_check_signatures,
2535 _("Automatically check signatures"));
2537 PACK_CHECK_BUTTON (vbox2, checkbtn_gpg_signature_popup,
2538 _("Show signature check result in a popup window"));
2540 PACK_CHECK_BUTTON (vbox2, checkbtn_store_passphrase,
2541 _("Store passphrase in memory temporarily"));
2543 vbox3 = gtk_vbox_new (FALSE, 0);
2544 gtk_widget_show (vbox3);
2545 gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
2547 hbox1 = gtk_hbox_new (FALSE, 8);
2548 gtk_widget_show (hbox1);
2549 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2551 hbox_spc = gtk_hbox_new (FALSE, 0);
2552 gtk_widget_show (hbox_spc);
2553 gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
2554 gtk_widget_set_usize (hbox_spc, 12, -1);
2556 label = gtk_label_new (_("Expire after"));
2557 gtk_widget_show (label);
2558 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2560 spinbtn_store_passphrase_adj = gtk_adjustment_new (0, 0, 1440, 1, 5, 5);
2561 spinbtn_store_passphrase = gtk_spin_button_new
2562 (GTK_ADJUSTMENT (spinbtn_store_passphrase_adj), 1, 0);
2563 gtk_widget_show (spinbtn_store_passphrase);
2564 gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_store_passphrase, FALSE, FALSE, 0);
2565 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_store_passphrase),
2567 gtk_widget_set_usize (spinbtn_store_passphrase, 64, -1);
2569 label = gtk_label_new (_("minute(s) "));
2570 gtk_widget_show (label);
2571 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2573 hbox1 = gtk_hbox_new (FALSE, 8);
2574 gtk_widget_show (hbox1);
2575 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2577 hbox_spc = gtk_hbox_new (FALSE, 0);
2578 gtk_widget_show (hbox_spc);
2579 gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
2580 gtk_widget_set_usize (hbox_spc, 12, -1);
2582 label = gtk_label_new (_("(Setting to '0' will store the passphrase\n"
2583 " for the whole session)"));
2584 gtk_widget_show (label);
2585 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2586 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
2588 SET_TOGGLE_SENSITIVITY (checkbtn_store_passphrase, vbox3);
2591 PACK_CHECK_BUTTON (vbox2, checkbtn_passphrase_grab,
2592 _("Grab input while entering a passphrase"));
2596 (vbox2, checkbtn_gpg_warning,
2597 _("Display warning on startup if GnuPG doesn't work"));
2599 hbox1 = gtk_hbox_new (FALSE, 8);
2600 gtk_widget_show (hbox1);
2601 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2603 privacy.checkbtn_auto_check_signatures
2604 = checkbtn_auto_check_signatures;
2605 privacy.checkbtn_gpg_signature_popup
2606 = checkbtn_gpg_signature_popup;
2607 privacy.checkbtn_store_passphrase = checkbtn_store_passphrase;
2608 privacy.spinbtn_store_passphrase = spinbtn_store_passphrase;
2609 privacy.spinbtn_store_passphrase_adj = spinbtn_store_passphrase_adj;
2610 privacy.checkbtn_passphrase_grab = checkbtn_passphrase_grab;
2611 privacy.checkbtn_gpg_warning = checkbtn_gpg_warning;
2613 #endif /* USE_GPGME */
2615 static void prefs_interface_create(void)
2620 /* GtkWidget *checkbtn_emacs; */
2621 GtkWidget *checkbtn_show_msg_with_cursor;
2622 GtkWidget *checkbtn_openunread;
2623 GtkWidget *checkbtn_mark_as_read_on_newwin;
2624 GtkWidget *checkbtn_openinbox;
2625 GtkWidget *checkbtn_immedexec;
2626 GtkWidget *frame_dialogs;
2627 GtkWidget *vbox_dialogs;
2630 GtkWidget *dialogs_table;
2631 GtkWidget *optmenu_recvdialog;
2632 GtkWidget *optmenu_senddialog;
2634 GtkWidget *menuitem;
2635 GtkWidget *checkbtn_no_recv_err_panel;
2636 GtkWidget *checkbtn_close_recv_dialog;
2638 GtkWidget *button_keybind;
2640 GtkWidget *optmenu_nextunreadmsgdialog;
2642 GtkWidget *frame_pixmap_theme;
2643 GtkWidget *vbox_pixmap_theme;
2644 GtkWidget *entry_pixmap_theme;
2645 GtkWidget *combo_pixmap_theme;
2646 GList *avail_pixmap_themes = NULL;
2648 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2649 gtk_widget_show (vbox1);
2650 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2651 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2653 vbox2 = gtk_vbox_new (FALSE, 0);
2654 gtk_widget_show (vbox2);
2655 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2657 /* PACK_CHECK_BUTTON (vbox2, checkbtn_emacs,
2658 _("Emulate the behavior of mouse operation of\n"
2659 "Emacs-based mailer"));
2660 gtk_label_set_justify (GTK_LABEL (GTK_BIN (checkbtn_emacs)->child),
2661 GTK_JUSTIFY_LEFT); */
2664 (vbox2, checkbtn_show_msg_with_cursor,
2665 _("Open messages in summary with cursor keys"));
2668 (vbox2, checkbtn_openunread,
2669 _("Open first unread message when entering a folder"));
2672 (vbox2, checkbtn_mark_as_read_on_newwin,
2673 _("Only mark message as read when opened in new window"));
2676 (vbox2, checkbtn_openinbox,
2677 _("Go to inbox after receiving new mail"));
2679 vbox3 = gtk_vbox_new (FALSE, 0);
2680 gtk_widget_show (vbox3);
2681 gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
2684 (vbox3, checkbtn_immedexec,
2685 _("Execute immediately when moving or deleting messages"));
2687 hbox1 = gtk_hbox_new (FALSE, 0);
2688 gtk_widget_show (hbox1);
2689 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2691 label = gtk_label_new
2692 (_("(Messages will be marked until execution\n"
2693 " if this is turned off)"));
2694 gtk_widget_show (label);
2695 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 8);
2696 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
2698 PACK_FRAME (vbox1, frame_dialogs, _("Dialogs"));
2699 vbox_dialogs = gtk_vbox_new (FALSE, 0);
2700 gtk_widget_show (vbox_dialogs);
2701 gtk_container_add (GTK_CONTAINER (frame_dialogs), vbox_dialogs);
2702 gtk_container_set_border_width (GTK_CONTAINER (vbox_dialogs), 8);
2704 dialogs_table = gtk_table_new (2, 2, FALSE);
2705 gtk_widget_show (dialogs_table);
2706 gtk_container_add (GTK_CONTAINER (vbox_dialogs), dialogs_table);
2707 gtk_container_set_border_width (GTK_CONTAINER (dialogs_table), 4);
2708 gtk_table_set_row_spacings (GTK_TABLE (dialogs_table), VSPACING_NARROW);
2709 gtk_table_set_col_spacings (GTK_TABLE (dialogs_table), 8);
2711 /* Next Unread Message Dialog */
2712 label = gtk_label_new (_("Show no-unread-message dialog"));
2713 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2714 gtk_widget_show (label);
2715 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 0, 1,
2716 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2719 optmenu_nextunreadmsgdialog = gtk_option_menu_new ();
2720 gtk_widget_show (optmenu_nextunreadmsgdialog);
2721 gtk_table_attach (GTK_TABLE (dialogs_table),
2722 optmenu_nextunreadmsgdialog, 1, 2, 0, 1,
2723 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2725 menu = gtk_menu_new ();
2726 MENUITEM_ADD (menu, menuitem, _("Always"), NEXTUNREADMSGDIALOG_ALWAYS);
2727 MENUITEM_ADD (menu, menuitem, _("Assume 'Yes'"),
2728 NEXTUNREADMSGDIALOG_ASSUME_YES);
2729 MENUITEM_ADD (menu, menuitem, _("Assume 'No'"),
2730 NEXTUNREADMSGDIALOG_ASSUME_NO);
2732 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_nextunreadmsgdialog), menu);
2734 label = gtk_label_new (_("Show send dialog"));
2735 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2736 gtk_widget_show (label);
2737 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 1, 2,
2738 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2740 optmenu_senddialog = gtk_option_menu_new ();
2741 gtk_widget_show (optmenu_senddialog);
2742 gtk_table_attach (GTK_TABLE (dialogs_table),
2743 optmenu_senddialog, 1, 2, 1, 2,
2744 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2746 menu = gtk_menu_new ();
2747 MENUITEM_ADD (menu, menuitem, _("Always"), SEND_DIALOG_ALWAYS);
2748 MENUITEM_ADD (menu, menuitem, _("Never"), SEND_DIALOG_NEVER);
2750 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_senddialog), menu);
2752 label = gtk_label_new (_("Show receive dialog"));
2753 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2754 gtk_widget_show (label);
2755 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 2, 3,
2756 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2758 optmenu_recvdialog = gtk_option_menu_new ();
2759 gtk_widget_show (optmenu_recvdialog);
2760 gtk_table_attach (GTK_TABLE (dialogs_table), optmenu_recvdialog, 1, 2, 2, 3,
2761 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2763 menu = gtk_menu_new ();
2764 MENUITEM_ADD (menu, menuitem, _("Always"), RECV_DIALOG_ALWAYS);
2765 MENUITEM_ADD (menu, menuitem, _("Only if a window is active"),
2766 RECV_DIALOG_ACTIVE);
2767 MENUITEM_ADD (menu, menuitem, _("Never"), RECV_DIALOG_NEVER);
2769 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
2771 PACK_CHECK_BUTTON (vbox_dialogs, checkbtn_no_recv_err_panel,
2772 _("Don't popup error dialog on receive error"));
2774 PACK_CHECK_BUTTON (vbox_dialogs, checkbtn_close_recv_dialog,
2775 _("Close receive dialog when finished"));
2778 hbox1 = gtk_hbox_new (FALSE, 8);
2779 gtk_widget_show (hbox1);
2780 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2782 button_keybind = gtk_button_new_with_label (_(" Set key bindings... "));
2783 gtk_widget_show (button_keybind);
2784 gtk_box_pack_start (GTK_BOX (hbox1), button_keybind, FALSE, FALSE, 0);
2785 gtk_signal_connect (GTK_OBJECT (button_keybind), "clicked",
2786 GTK_SIGNAL_FUNC (prefs_keybind_select), NULL);
2788 PACK_FRAME(vbox1, frame_pixmap_theme, _("Icon theme"));
2790 vbox_pixmap_theme = gtk_vbox_new(FALSE, 0);
2791 gtk_widget_show(vbox_pixmap_theme);
2792 gtk_container_add(GTK_CONTAINER(frame_pixmap_theme), vbox_pixmap_theme);
2793 gtk_container_set_border_width(GTK_CONTAINER(vbox_pixmap_theme), 8);
2795 avail_pixmap_themes = stock_pixmap_themes_list_new();
2797 combo_pixmap_theme = gtk_combo_new ();
2798 gtk_widget_show (combo_pixmap_theme);
2799 gtk_box_pack_start (GTK_BOX (vbox_pixmap_theme), combo_pixmap_theme, TRUE, TRUE, 0);
2800 gtk_combo_set_popdown_strings(GTK_COMBO(combo_pixmap_theme), avail_pixmap_themes);
2801 entry_pixmap_theme = GTK_COMBO (combo_pixmap_theme)->entry;
2803 stock_pixmap_themes_list_free(avail_pixmap_themes);
2805 /* interface.checkbtn_emacs = checkbtn_emacs; */
2806 interface.checkbtn_show_msg_with_cursor
2807 = checkbtn_show_msg_with_cursor;
2808 interface.checkbtn_openunread = checkbtn_openunread;
2809 interface.checkbtn_mark_as_read_on_newwin
2810 = checkbtn_mark_as_read_on_newwin;
2811 interface.checkbtn_openinbox = checkbtn_openinbox;
2812 interface.checkbtn_immedexec = checkbtn_immedexec;
2813 interface.optmenu_recvdialog = optmenu_recvdialog;
2814 interface.optmenu_senddialog = optmenu_senddialog;
2815 interface.checkbtn_no_recv_err_panel = checkbtn_no_recv_err_panel;
2816 interface.checkbtn_close_recv_dialog = checkbtn_close_recv_dialog;
2817 interface.optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
2818 interface.combo_pixmap_theme = combo_pixmap_theme;
2819 interface.entry_pixmap_theme = entry_pixmap_theme;
2822 static void prefs_other_create(void)
2825 GtkWidget *ext_frame;
2826 GtkWidget *ext_table;
2829 GtkWidget *uri_label;
2830 GtkWidget *uri_combo;
2831 GtkWidget *uri_entry;
2833 GtkWidget *printcmd_label;
2834 GtkWidget *printcmd_entry;
2836 GtkWidget *exteditor_label;
2837 GtkWidget *exteditor_combo;
2838 GtkWidget *exteditor_entry;
2840 GtkWidget *frame_addr;
2841 GtkWidget *vbox_addr;
2842 GtkWidget *checkbtn_addaddrbyclick;
2844 GtkWidget *frame_cliplog;
2845 GtkWidget *vbox_cliplog;
2846 GtkWidget *hbox_cliplog;
2847 GtkWidget *checkbtn_cliplog;
2848 GtkWidget *loglength_label;
2849 GtkWidget *loglength_entry;
2851 GtkWidget *frame_exit;
2852 GtkWidget *vbox_exit;
2853 GtkWidget *checkbtn_confonexit;
2854 GtkWidget *checkbtn_cleanonexit;
2855 GtkWidget *checkbtn_askonclean;
2856 GtkWidget *checkbtn_warnqueued;
2859 GtkWidget *frame_ssl;
2860 GtkWidget *vbox_ssl;
2861 GtkWidget *hbox_ssl;
2862 GtkWidget *checkbtn_ssl_ask_unknown_valid;
2865 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2866 gtk_widget_show (vbox1);
2867 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2868 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2870 PACK_FRAME(vbox1, ext_frame,
2871 _("External commands (%s will be replaced with file name / URI)"));
2873 ext_table = gtk_table_new (3, 2, FALSE);
2874 gtk_widget_show (ext_table);
2875 gtk_container_add (GTK_CONTAINER (ext_frame), ext_table);
2876 gtk_container_set_border_width (GTK_CONTAINER (ext_table), 8);
2877 gtk_table_set_row_spacings (GTK_TABLE (ext_table), VSPACING_NARROW);
2878 gtk_table_set_col_spacings (GTK_TABLE (ext_table), 8);
2880 uri_label = gtk_label_new (_("Web browser"));
2881 gtk_widget_show(uri_label);
2882 gtk_table_attach (GTK_TABLE (ext_table), uri_label, 0, 1, 0, 1,
2883 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2884 gtk_misc_set_alignment (GTK_MISC (uri_label), 1, 0.5);
2886 uri_combo = gtk_combo_new ();
2887 gtk_widget_show (uri_combo);
2888 gtk_table_attach (GTK_TABLE (ext_table), uri_combo, 1, 2, 0, 1,
2889 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2890 gtkut_combo_set_items (GTK_COMBO (uri_combo),
2892 "mozilla -remote 'openurl(%s,new-window)'",
2893 "netscape -remote 'openURL(%s,raise)'",
2895 "gnome-moz-remote --raise --newwin '%s'",
2896 "kfmclient openURL '%s'",
2897 "opera -newwindow '%s'",
2898 "kterm -e w3m '%s'",
2899 "kterm -e lynx '%s'",
2901 uri_entry = GTK_COMBO (uri_combo)->entry;
2903 printcmd_label = gtk_label_new (_("Print"));
2904 gtk_widget_show (printcmd_label);
2905 gtk_table_attach (GTK_TABLE (ext_table), printcmd_label, 0, 1, 1, 2,
2906 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2907 gtk_misc_set_alignment (GTK_MISC (printcmd_label), 1, 0.5);
2909 printcmd_entry = gtk_entry_new ();
2910 gtk_widget_show (printcmd_entry);
2911 gtk_table_attach (GTK_TABLE (ext_table), printcmd_entry, 1, 2, 1, 2,
2912 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2914 exteditor_label = gtk_label_new (_("Editor"));
2915 gtk_widget_show (exteditor_label);
2916 gtk_table_attach (GTK_TABLE (ext_table), exteditor_label, 0, 1, 2, 3,
2917 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2918 gtk_misc_set_alignment (GTK_MISC (exteditor_label), 1, 0.5);
2920 exteditor_combo = gtk_combo_new ();
2921 gtk_widget_show (exteditor_combo);
2922 gtk_table_attach (GTK_TABLE (ext_table), exteditor_combo, 1, 2, 2, 3,
2923 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2924 gtkut_combo_set_items (GTK_COMBO (exteditor_combo),
2927 "mgedit --no-fork %s",
2933 exteditor_entry = GTK_COMBO (exteditor_combo)->entry;
2935 PACK_FRAME (vbox1, frame_addr, _("Address book"));
2937 vbox_addr = gtk_vbox_new (FALSE, 0);
2938 gtk_widget_show (vbox_addr);
2939 gtk_container_add (GTK_CONTAINER (frame_addr), vbox_addr);
2940 gtk_container_set_border_width (GTK_CONTAINER (vbox_addr), 8);
2943 (vbox_addr, checkbtn_addaddrbyclick,
2944 _("Add address to destination when double-clicked"));
2947 PACK_FRAME (vbox1, frame_cliplog, _("Log Size"));
2949 vbox_cliplog = gtk_vbox_new (FALSE, 0);
2950 gtk_widget_show (vbox_cliplog);
2951 gtk_container_add (GTK_CONTAINER (frame_cliplog), vbox_cliplog);
2952 gtk_container_set_border_width (GTK_CONTAINER (vbox_cliplog), 8);
2953 PACK_CHECK_BUTTON (vbox_cliplog, checkbtn_cliplog,
2954 _("Clip the log size"));
2955 hbox_cliplog = gtk_hbox_new (FALSE, 3);
2956 gtk_container_add (GTK_CONTAINER (vbox_cliplog), hbox_cliplog);
2957 gtk_widget_show (hbox_cliplog);
2959 loglength_label = gtk_label_new (_("Log window length"));
2960 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
2962 gtk_widget_show (GTK_WIDGET (loglength_label));
2963 loglength_entry = gtk_entry_new ();
2964 gtk_widget_set_usize (GTK_WIDGET (loglength_entry), 64, -1);
2965 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_entry,
2967 gtk_widget_show (GTK_WIDGET (loglength_entry));
2968 loglength_label = gtk_label_new (_("(0 to stop logging in the log window)"));
2969 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
2971 SET_TOGGLE_SENSITIVITY(checkbtn_cliplog, loglength_entry);
2976 PACK_FRAME (vbox1, frame_ssl, _("Security"));
2978 vbox_ssl = gtk_vbox_new (FALSE, 0);
2979 gtk_widget_show (vbox_ssl);
2980 gtk_container_add (GTK_CONTAINER (frame_ssl), vbox_ssl);
2981 gtk_container_set_border_width (GTK_CONTAINER (vbox_ssl), 8);
2982 PACK_CHECK_BUTTON (vbox_ssl, checkbtn_ssl_ask_unknown_valid,
2983 _("Ask before accepting SSL certificates"));
2984 hbox_ssl = gtk_hbox_new (FALSE, 3);
2985 gtk_container_add (GTK_CONTAINER (vbox_ssl), hbox_ssl);
2986 gtk_widget_show (hbox_ssl);
2991 PACK_FRAME (vbox1, frame_exit, _("On exit"));
2993 vbox_exit = gtk_vbox_new (FALSE, 0);
2994 gtk_widget_show (vbox_exit);
2995 gtk_container_add (GTK_CONTAINER (frame_exit), vbox_exit);
2996 gtk_container_set_border_width (GTK_CONTAINER (vbox_exit), 8);
2998 PACK_CHECK_BUTTON (vbox_exit, checkbtn_confonexit,
2999 _("Confirm on exit"));
3001 hbox1 = gtk_hbox_new (FALSE, 32);
3002 gtk_widget_show (hbox1);
3003 gtk_box_pack_start (GTK_BOX (vbox_exit), hbox1, FALSE, FALSE, 0);
3005 PACK_CHECK_BUTTON (hbox1, checkbtn_cleanonexit,
3006 _("Empty trash on exit"));
3007 PACK_CHECK_BUTTON (hbox1, checkbtn_askonclean,
3008 _("Ask before emptying"));
3009 SET_TOGGLE_SENSITIVITY (checkbtn_cleanonexit, checkbtn_askonclean);
3011 PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
3012 _("Warn if there are queued messages"));
3014 other.uri_combo = uri_combo;
3015 other.uri_entry = uri_entry;
3016 other.printcmd_entry = printcmd_entry;
3018 other.exteditor_combo = exteditor_combo;
3019 other.exteditor_entry = exteditor_entry;
3021 other.checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
3023 other.checkbtn_cliplog = checkbtn_cliplog;
3024 other.loglength_entry = loglength_entry;
3026 other.checkbtn_confonexit = checkbtn_confonexit;
3027 other.checkbtn_cleanonexit = checkbtn_cleanonexit;
3028 other.checkbtn_askonclean = checkbtn_askonclean;
3029 other.checkbtn_warnqueued = checkbtn_warnqueued;
3033 other.checkbtn_ssl_ask_unknown_valid = checkbtn_ssl_ask_unknown_valid;
3038 static void date_format_ok_btn_clicked(GtkButton *button, GtkWidget **widget)
3040 GtkWidget *datefmt_sample = NULL;
3043 g_return_if_fail(widget != NULL);
3044 g_return_if_fail(*widget != NULL);
3045 g_return_if_fail(display.entry_datefmt != NULL);
3047 datefmt_sample = GTK_WIDGET(gtk_object_get_data
3048 (GTK_OBJECT(*widget), "datefmt_sample"));
3049 g_return_if_fail(datefmt_sample != NULL);
3051 text = gtk_editable_get_chars(GTK_EDITABLE(datefmt_sample), 0, -1);
3052 g_free(prefs_common.date_format);
3053 prefs_common.date_format = text;
3054 gtk_entry_set_text(GTK_ENTRY(display.entry_datefmt), text);
3056 gtk_widget_destroy(*widget);
3060 static void date_format_cancel_btn_clicked(GtkButton *button,
3063 g_return_if_fail(widget != NULL);
3064 g_return_if_fail(*widget != NULL);
3066 gtk_widget_destroy(*widget);
3070 static void date_format_key_pressed(GtkWidget *keywidget, GdkEventKey *event,
3073 if (event && event->keyval == GDK_Escape)
3074 date_format_cancel_btn_clicked(NULL, widget);
3077 static gboolean date_format_on_delete(GtkWidget *dialogwidget,
3078 GdkEventAny *event, GtkWidget **widget)
3080 g_return_val_if_fail(widget != NULL, FALSE);
3081 g_return_val_if_fail(*widget != NULL, FALSE);
3087 static void date_format_entry_on_change(GtkEditable *editable,
3091 struct tm *cal_time;
3095 cur_time = time(NULL);
3096 cal_time = localtime(&cur_time);
3098 text = gtk_editable_get_chars(editable, 0, -1);
3100 strftime(buffer, sizeof buffer, text, cal_time);
3102 gtk_label_set_text(example, buffer);
3105 static void date_format_select_row(GtkWidget *date_format_list, gint row,
3106 gint column, GdkEventButton *event,
3107 GtkWidget *date_format)
3113 GtkWidget *datefmt_sample;
3115 /* only on double click */
3116 if (!event || event->type != GDK_2BUTTON_PRESS) return;
3119 datefmt_sample = GTK_WIDGET(gtk_object_get_data
3120 (GTK_OBJECT(date_format), "datefmt_sample"));
3122 g_return_if_fail(date_format_list != NULL);
3123 g_return_if_fail(date_format != NULL);
3124 g_return_if_fail(datefmt_sample != NULL);
3126 /* get format from clist */
3127 gtk_clist_get_text(GTK_CLIST(date_format_list), row, 0, &format);
3129 cur_pos = gtk_editable_get_position(GTK_EDITABLE(datefmt_sample));
3130 old_format = gtk_entry_get_text(GTK_ENTRY(datefmt_sample));
3132 /* insert the format into the text entry */
3133 new_format = g_malloc(strlen(old_format) + 3);
3135 strncpy(new_format, old_format, cur_pos);
3136 new_format[cur_pos] = '\0';
3137 strcat(new_format, format);
3138 strcat(new_format, &old_format[cur_pos]);
3140 gtk_entry_set_text(GTK_ENTRY(datefmt_sample), new_format);
3141 gtk_editable_set_position(GTK_EDITABLE(datefmt_sample), cur_pos + 2);
3146 static GtkWidget *date_format_create(GtkButton *button, void *data)
3148 static GtkWidget *datefmt_win = NULL;
3150 GtkWidget *scrolledwindow1;
3151 GtkWidget *datefmt_clist;
3156 GtkWidget *confirm_area;
3158 GtkWidget *cancel_btn;
3159 GtkWidget *datefmt_entry;
3188 const gint TIME_FORMAT_ELEMS =
3189 sizeof time_format / sizeof time_format[0];
3191 time_format[0].txt = _("the full abbreviated weekday name");
3192 time_format[1].txt = _("the full weekday name");
3193 time_format[2].txt = _("the abbreviated month name");
3194 time_format[3].txt = _("the full month name");
3195 time_format[4].txt = _("the preferred date and time for the current locale");
3196 time_format[5].txt = _("the century number (year/100)");
3197 time_format[6].txt = _("the day of the month as a decimal number");
3198 time_format[7].txt = _("the hour as a decimal number using a 24-hour clock");
3199 time_format[8].txt = _("the hour as a decimal number using a 12-hour clock");
3200 time_format[9].txt = _("the day of the year as a decimal number");
3201 time_format[10].txt = _("the month as a decimal number");
3202 time_format[11].txt = _("the minute as a decimal number");
3203 time_format[12].txt = _("either AM or PM");
3204 time_format[13].txt = _("the second as a decimal number");
3205 time_format[14].txt = _("the day of the week as a decimal number");
3206 time_format[15].txt = _("the preferred date for the current locale");
3207 time_format[16].txt = _("the last two digits of a year");
3208 time_format[17].txt = _("the year as a decimal number");
3209 time_format[18].txt = _("the time zone or name or abbreviation");
3211 if (datefmt_win) return datefmt_win;
3213 datefmt_win = gtk_window_new(GTK_WINDOW_DIALOG);
3214 gtk_container_set_border_width(GTK_CONTAINER(datefmt_win), 8);
3215 gtk_window_set_title(GTK_WINDOW(datefmt_win), _("Date format"));
3216 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
3217 gtk_widget_set_usize(datefmt_win, 440, 280);
3219 vbox1 = gtk_vbox_new(FALSE, 10);
3220 gtk_widget_show(vbox1);
3221 gtk_container_add(GTK_CONTAINER(datefmt_win), vbox1);
3223 scrolledwindow1 = gtk_scrolled_window_new(NULL, NULL);
3224 gtk_scrolled_window_set_policy
3225 (GTK_SCROLLED_WINDOW(scrolledwindow1),
3226 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
3227 gtk_widget_show(scrolledwindow1);
3228 gtk_box_pack_start(GTK_BOX(vbox1), scrolledwindow1, TRUE, TRUE, 0);
3230 titles[0] = _("Specifier");
3231 titles[1] = _("Description");
3232 datefmt_clist = gtk_clist_new_with_titles(2, titles);
3233 gtk_widget_show(datefmt_clist);
3234 gtk_container_add(GTK_CONTAINER(scrolledwindow1), datefmt_clist);
3235 /* gtk_clist_set_column_width(GTK_CLIST(datefmt_clist), 0, 80); */
3236 gtk_clist_set_selection_mode(GTK_CLIST(datefmt_clist),
3237 GTK_SELECTION_BROWSE);
3239 for (i = 0; i < TIME_FORMAT_ELEMS; i++) {
3241 /* phoney casting necessary because of gtk... */
3242 text[0] = (gchar *)time_format[i].fmt;
3243 text[1] = (gchar *)time_format[i].txt;
3244 gtk_clist_append(GTK_CLIST(datefmt_clist), text);
3247 table = gtk_table_new(2, 2, FALSE);
3248 gtk_widget_show(table);
3249 gtk_box_pack_start(GTK_BOX(vbox1), table, FALSE, FALSE, 0);
3250 gtk_table_set_row_spacings(GTK_TABLE(table), 4);
3251 gtk_table_set_col_spacings(GTK_TABLE(table), 8);
3253 label1 = gtk_label_new(_("Date format"));
3254 gtk_widget_show(label1);
3255 gtk_table_attach(GTK_TABLE(table), label1, 0, 1, 0, 1,
3257 gtk_label_set_justify(GTK_LABEL(label1), GTK_JUSTIFY_LEFT);
3258 gtk_misc_set_alignment(GTK_MISC(label1), 0, 0.5);
3260 datefmt_entry = gtk_entry_new_with_max_length(256);
3261 gtk_widget_show(datefmt_entry);
3262 gtk_table_attach(GTK_TABLE(table), datefmt_entry, 1, 2, 0, 1,
3263 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3265 /* we need the "sample" entry box; add it as data so callbacks can
3266 * get the entry box */
3267 gtk_object_set_data(GTK_OBJECT(datefmt_win), "datefmt_sample",
3270 label2 = gtk_label_new(_("Example"));
3271 gtk_widget_show(label2);
3272 gtk_table_attach(GTK_TABLE(table), label2, 0, 1, 1, 2,
3274 gtk_label_set_justify(GTK_LABEL(label2), GTK_JUSTIFY_LEFT);
3275 gtk_misc_set_alignment(GTK_MISC(label2), 0, 0.5);
3277 label3 = gtk_label_new("");
3278 gtk_widget_show(label3);
3279 gtk_table_attach(GTK_TABLE(table), label3, 1, 2, 1, 2,
3280 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3281 gtk_label_set_justify(GTK_LABEL(label3), GTK_JUSTIFY_LEFT);
3282 gtk_misc_set_alignment(GTK_MISC(label3), 0, 0.5);
3284 gtkut_button_set_create(&confirm_area, &ok_btn, _("OK"),
3285 &cancel_btn, _("Cancel"), NULL, NULL);
3286 gtk_widget_grab_default(ok_btn);
3287 gtk_widget_show(confirm_area);
3289 gtk_box_pack_start(GTK_BOX(vbox1), confirm_area, FALSE, FALSE, 0);
3291 /* set the current format */
3292 gtk_entry_set_text(GTK_ENTRY(datefmt_entry), prefs_common.date_format);
3293 date_format_entry_on_change(GTK_EDITABLE(datefmt_entry),
3296 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
3297 GTK_SIGNAL_FUNC(date_format_ok_btn_clicked),
3299 gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
3300 GTK_SIGNAL_FUNC(date_format_cancel_btn_clicked),
3302 gtk_signal_connect(GTK_OBJECT(datefmt_win), "key_press_event",
3303 GTK_SIGNAL_FUNC(date_format_key_pressed),
3305 gtk_signal_connect(GTK_OBJECT(datefmt_win), "delete_event",
3306 GTK_SIGNAL_FUNC(date_format_on_delete),
3308 gtk_signal_connect(GTK_OBJECT(datefmt_entry), "changed",
3309 GTK_SIGNAL_FUNC(date_format_entry_on_change),
3312 gtk_signal_connect(GTK_OBJECT(datefmt_clist), "select_row",
3313 GTK_SIGNAL_FUNC(date_format_select_row),
3316 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
3317 gtk_window_set_modal(GTK_WINDOW(datefmt_win), TRUE);
3319 gtk_widget_show(datefmt_win);
3320 manage_window_set_transient(GTK_WINDOW(datefmt_win));
3322 gtk_widget_grab_focus(ok_btn);
3327 void prefs_quote_colors_dialog(void)
3329 if (!quote_color_win)
3330 prefs_quote_colors_dialog_create();
3331 gtk_widget_show(quote_color_win);
3332 manage_window_set_transient(GTK_WINDOW(quote_color_win));
3335 gtk_widget_hide(quote_color_win);
3337 textview_update_message_colors();
3338 main_window_reflect_prefs_all();
3341 static void prefs_quote_colors_dialog_create(void)
3346 GtkWidget *quotelevel1_label;
3347 GtkWidget *quotelevel2_label;
3348 GtkWidget *quotelevel3_label;
3349 GtkWidget *uri_label;
3350 GtkWidget *signature_label;
3351 GtkWidget *tgt_folder_label;
3354 GtkWidget *recycle_colors_btn;
3355 GtkWidget *frame_colors;
3357 window = gtk_window_new(GTK_WINDOW_DIALOG);
3358 gtk_container_set_border_width(GTK_CONTAINER(window), 2);
3359 gtk_window_set_title(GTK_WINDOW(window), _("Set message colors"));
3360 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
3361 gtk_window_set_modal(GTK_WINDOW(window), TRUE);
3362 gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
3364 vbox = gtk_vbox_new (FALSE, VSPACING);
3365 gtk_container_add (GTK_CONTAINER (window), vbox);
3366 gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
3367 PACK_FRAME(vbox, frame_colors, _("Colors"));
3369 table = gtk_table_new (5, 2, FALSE);
3370 gtk_container_add (GTK_CONTAINER (frame_colors), table);
3371 gtk_container_set_border_width (GTK_CONTAINER (table), 8);
3372 gtk_table_set_row_spacings (GTK_TABLE (table), 2);
3373 gtk_table_set_col_spacings (GTK_TABLE (table), 5);
3376 color_buttons.quote_level1_btn = gtk_button_new();
3377 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level1_btn,
3378 0, 1, 0, 1, 0, 0, 0, 0);
3379 gtk_widget_set_usize (color_buttons.quote_level1_btn, 40, 30);
3380 gtk_container_set_border_width
3381 (GTK_CONTAINER (color_buttons.quote_level1_btn), 5);
3383 color_buttons.quote_level2_btn = gtk_button_new();
3384 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level2_btn,
3385 0, 1, 1, 2, 0, 0, 0, 0);
3386 gtk_widget_set_usize (color_buttons.quote_level2_btn, 40, 30);
3387 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.quote_level2_btn), 5);
3389 color_buttons.quote_level3_btn = gtk_button_new_with_label ("");
3390 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level3_btn,
3391 0, 1, 2, 3, 0, 0, 0, 0);
3392 gtk_widget_set_usize (color_buttons.quote_level3_btn, 40, 30);
3393 gtk_container_set_border_width
3394 (GTK_CONTAINER (color_buttons.quote_level3_btn), 5);
3396 color_buttons.uri_btn = gtk_button_new_with_label ("");
3397 gtk_table_attach (GTK_TABLE (table), color_buttons.uri_btn,
3398 0, 1, 3, 4, 0, 0, 0, 0);
3399 gtk_widget_set_usize (color_buttons.uri_btn, 40, 30);
3400 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.uri_btn), 5);
3402 color_buttons.tgt_folder_btn = gtk_button_new_with_label ("");
3403 gtk_table_attach (GTK_TABLE (table), color_buttons.tgt_folder_btn,
3404 0, 1, 4, 5, 0, 0, 0, 0);
3405 gtk_widget_set_usize (color_buttons.tgt_folder_btn, 40, 30);
3406 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.tgt_folder_btn), 5);
3408 color_buttons.signature_btn = gtk_button_new_with_label ("");
3409 gtk_table_attach (GTK_TABLE (table), color_buttons.signature_btn,
3410 0, 1, 5, 6, 0, 0, 0, 0);
3411 gtk_widget_set_usize (color_buttons.signature_btn, 40, 30);
3412 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.signature_btn), 5);
3414 quotelevel1_label = gtk_label_new (_("Quoted Text - First Level"));
3415 gtk_table_attach (GTK_TABLE (table), quotelevel1_label, 1, 2, 0, 1,
3416 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3417 gtk_label_set_justify (GTK_LABEL (quotelevel1_label), GTK_JUSTIFY_LEFT);
3418 gtk_misc_set_alignment (GTK_MISC (quotelevel1_label), 0, 0.5);
3420 quotelevel2_label = gtk_label_new (_("Quoted Text - Second Level"));
3421 gtk_table_attach (GTK_TABLE (table), quotelevel2_label, 1, 2, 1, 2,
3422 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3423 gtk_label_set_justify (GTK_LABEL (quotelevel2_label), GTK_JUSTIFY_LEFT);
3424 gtk_misc_set_alignment (GTK_MISC (quotelevel2_label), 0, 0.5);
3426 quotelevel3_label = gtk_label_new (_("Quoted Text - Third Level"));
3427 gtk_table_attach (GTK_TABLE (table), quotelevel3_label, 1, 2, 2, 3,
3428 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3429 gtk_label_set_justify (GTK_LABEL (quotelevel3_label), GTK_JUSTIFY_LEFT);
3430 gtk_misc_set_alignment (GTK_MISC (quotelevel3_label), 0, 0.5);
3432 uri_label = gtk_label_new (_("URI link"));
3433 gtk_table_attach (GTK_TABLE (table), uri_label, 1, 2, 3, 4,
3434 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3435 gtk_label_set_justify (GTK_LABEL (uri_label), GTK_JUSTIFY_LEFT);
3436 gtk_misc_set_alignment (GTK_MISC (uri_label), 0, 0.5);
3438 tgt_folder_label = gtk_label_new (_("Target folder"));
3439 gtk_table_attach (GTK_TABLE (table), tgt_folder_label, 1, 2, 4, 5,
3440 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3441 gtk_label_set_justify (GTK_LABEL (tgt_folder_label), GTK_JUSTIFY_LEFT);
3442 gtk_misc_set_alignment (GTK_MISC (tgt_folder_label), 0, 0.5);
3444 signature_label = gtk_label_new (_("Signatures"));
3445 gtk_table_attach (GTK_TABLE (table), signature_label, 1, 2, 5, 6,
3446 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3447 gtk_label_set_justify (GTK_LABEL (signature_label), GTK_JUSTIFY_LEFT);
3448 gtk_misc_set_alignment (GTK_MISC (signature_label), 0, 0.5);
3450 PACK_CHECK_BUTTON (vbox, recycle_colors_btn,
3451 _("Recycle quote colors"));
3453 gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
3454 NULL, NULL, NULL, NULL);
3455 gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
3457 gtk_widget_grab_default(ok_btn);
3458 MANAGE_WINDOW_SIGNALS_CONNECT(window);
3459 gtk_signal_connect(GTK_OBJECT(window), "delete_event",
3460 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3461 gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
3462 GTK_SIGNAL_FUNC(prefs_quote_colors_key_pressed),
3465 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level1_btn), "clicked",
3466 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL1");
3467 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level2_btn), "clicked",
3468 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL2");
3469 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level3_btn), "clicked",
3470 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL3");
3471 gtk_signal_connect(GTK_OBJECT(color_buttons.uri_btn), "clicked",
3472 GTK_SIGNAL_FUNC(quote_color_set_dialog), "URI");
3473 gtk_signal_connect(GTK_OBJECT(color_buttons.tgt_folder_btn), "clicked",
3474 GTK_SIGNAL_FUNC(quote_color_set_dialog), "TGTFLD");
3475 gtk_signal_connect(GTK_OBJECT(color_buttons.signature_btn), "clicked",
3476 GTK_SIGNAL_FUNC(quote_color_set_dialog), "SIGNATURE");
3477 gtk_signal_connect(GTK_OBJECT(recycle_colors_btn), "toggled",
3478 GTK_SIGNAL_FUNC(prefs_recycle_colors_toggled), NULL);
3479 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
3480 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3482 /* show message button colors and recycle options */
3483 set_button_bg_color(color_buttons.quote_level1_btn,
3484 prefs_common.quote_level1_col);
3485 set_button_bg_color(color_buttons.quote_level2_btn,
3486 prefs_common.quote_level2_col);
3487 set_button_bg_color(color_buttons.quote_level3_btn,
3488 prefs_common.quote_level3_col);
3489 set_button_bg_color(color_buttons.uri_btn,
3490 prefs_common.uri_col);
3491 set_button_bg_color(color_buttons.tgt_folder_btn,
3492 prefs_common.tgt_folder_col);
3493 set_button_bg_color(color_buttons.signature_btn,
3494 prefs_common.signature_col);
3495 gtk_toggle_button_set_active((GtkToggleButton *)recycle_colors_btn,
3496 prefs_common.recycle_quote_colors);
3498 gtk_widget_show_all(vbox);
3499 quote_color_win = window;
3502 static void prefs_quote_colors_key_pressed(GtkWidget *widget,
3503 GdkEventKey *event, gpointer data)
3505 if (event && event->keyval == GDK_Escape)
3509 static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
3511 gchar *type = (gchar *)data;
3512 gchar *title = NULL;
3513 gdouble color[4] = {0.0, 0.0, 0.0, 0.0};
3515 GtkColorSelectionDialog *dialog;
3517 if(g_strcasecmp(type, "LEVEL1") == 0) {
3518 title = _("Pick color for quotation level 1");
3519 rgbvalue = prefs_common.quote_level1_col;
3520 } else if(g_strcasecmp(type, "LEVEL2") == 0) {
3521 title = _("Pick color for quotation level 2");
3522 rgbvalue = prefs_common.quote_level2_col;
3523 } else if(g_strcasecmp(type, "LEVEL3") == 0) {
3524 title = _("Pick color for quotation level 3");
3525 rgbvalue = prefs_common.quote_level3_col;
3526 } else if(g_strcasecmp(type, "URI") == 0) {
3527 title = _("Pick color for URI");
3528 rgbvalue = prefs_common.uri_col;
3529 } else if(g_strcasecmp(type, "TGTFLD") == 0) {
3530 title = _("Pick color for target folder");
3531 rgbvalue = prefs_common.tgt_folder_col;
3532 } else if(g_strcasecmp(type, "SIGNATURE") == 0) {
3533 title = _("Pick color for signatures");
3534 rgbvalue = prefs_common.signature_col;
3536 } else if(g_strcasecmp(type, "Misspelled word") == 0) {
3537 title = _("Pick color for misspelled word");
3538 rgbvalue = prefs_common.misspelled_col;
3540 } else { /* Should never be called */
3541 g_warning("Unrecognized datatype '%s' in quote_color_set_dialog\n", type);
3545 color_dialog = gtk_color_selection_dialog_new(title);
3546 gtk_window_set_position(GTK_WINDOW(color_dialog), GTK_WIN_POS_CENTER);
3547 gtk_window_set_modal(GTK_WINDOW(color_dialog), TRUE);
3548 gtk_window_set_policy(GTK_WINDOW(color_dialog), FALSE, FALSE, FALSE);
3549 manage_window_set_transient(GTK_WINDOW(color_dialog));
3551 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->ok_button),
3552 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_ok), data);
3553 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->cancel_button),
3554 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_cancel), data);
3555 gtk_signal_connect(GTK_OBJECT(color_dialog), "key_press_event",
3556 GTK_SIGNAL_FUNC(quote_colors_set_dialog_key_pressed),
3559 /* preselect the previous color in the color selection dialog */
3560 color[0] = (gdouble) ((rgbvalue & 0xff0000) >> 16) / 255.0;
3561 color[1] = (gdouble) ((rgbvalue & 0x00ff00) >> 8) / 255.0;
3562 color[2] = (gdouble) (rgbvalue & 0x0000ff) / 255.0;
3563 dialog = GTK_COLOR_SELECTION_DIALOG(color_dialog);
3564 gtk_color_selection_set_color
3565 (GTK_COLOR_SELECTION(dialog->colorsel), color);
3567 gtk_widget_show(color_dialog);
3570 static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
3572 GtkColorSelection *colorsel = (GtkColorSelection *)
3573 ((GtkColorSelectionDialog *)color_dialog)->colorsel;
3575 gint red, green, blue, rgbvalue;
3576 gchar *type = (gchar *)data;
3578 gtk_color_selection_get_color(colorsel, color);
3580 red = (gint) (color[0] * 255.0);
3581 green = (gint) (color[1] * 255.0);
3582 blue = (gint) (color[2] * 255.0);
3583 rgbvalue = (gint) ((red * 0x10000) | (green * 0x100) | blue);
3586 fprintf(stderr, "redc = %f, greenc = %f, bluec = %f\n", color[0], color[1], color[2]);
3587 fprintf(stderr, "red = %d, green = %d, blue = %d\n", red, green, blue);
3588 fprintf(stderr, "Color is %x\n", rgbvalue);
3591 if (g_strcasecmp(type, "LEVEL1") == 0) {
3592 prefs_common.quote_level1_col = rgbvalue;
3593 set_button_bg_color(color_buttons.quote_level1_btn, rgbvalue);
3594 } else if (g_strcasecmp(type, "LEVEL2") == 0) {
3595 prefs_common.quote_level2_col = rgbvalue;
3596 set_button_bg_color(color_buttons.quote_level2_btn, rgbvalue);
3597 } else if (g_strcasecmp(type, "LEVEL3") == 0) {
3598 prefs_common.quote_level3_col = rgbvalue;
3599 set_button_bg_color(color_buttons.quote_level3_btn, rgbvalue);
3600 } else if (g_strcasecmp(type, "URI") == 0) {
3601 prefs_common.uri_col = rgbvalue;
3602 set_button_bg_color(color_buttons.uri_btn, rgbvalue);
3603 } else if (g_strcasecmp(type, "TGTFLD") == 0) {
3604 prefs_common.tgt_folder_col = rgbvalue;
3605 set_button_bg_color(color_buttons.tgt_folder_btn, rgbvalue);
3606 folderview_set_target_folder_color(prefs_common.tgt_folder_col);
3607 } else if (g_strcasecmp(type, "SIGNATURE") == 0) {
3608 prefs_common.signature_col = rgbvalue;
3609 set_button_bg_color(color_buttons.signature_btn, rgbvalue);
3611 } else if (g_strcasecmp(type, "Misspelled word") == 0) {
3612 prefs_common.misspelled_col = rgbvalue;
3613 set_button_bg_color(spelling.misspelled_btn, rgbvalue);
3616 fprintf( stderr, "Unrecognized datatype '%s' in quote_color_set_dialog_ok\n", type );
3618 gtk_widget_destroy(color_dialog);
3621 static void quote_colors_set_dialog_cancel(GtkWidget *widget, gpointer data)
3623 gtk_widget_destroy(color_dialog);
3626 static void quote_colors_set_dialog_key_pressed(GtkWidget *widget,
3630 gtk_widget_destroy(color_dialog);
3633 static void set_button_bg_color(GtkWidget *widget, gint rgbvalue)
3638 gtkut_convert_int_to_gdk_color(rgbvalue, &color);
3639 newstyle = gtk_style_copy(gtk_widget_get_default_style());
3640 newstyle->bg[GTK_STATE_NORMAL] = color;
3641 newstyle->bg[GTK_STATE_PRELIGHT] = color;
3642 newstyle->bg[GTK_STATE_ACTIVE] = color;
3644 gtk_widget_set_style(GTK_WIDGET(widget), newstyle);
3647 static void prefs_enable_message_color_toggled(void)
3651 is_active = gtk_toggle_button_get_active
3652 (GTK_TOGGLE_BUTTON(message.chkbtn_enablecol));
3653 gtk_widget_set_sensitive(message.button_edit_col, is_active);
3654 prefs_common.enable_color = is_active;
3657 static void prefs_recycle_colors_toggled(GtkWidget *widget)
3661 is_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
3662 prefs_common.recycle_quote_colors = is_active;
3665 static void prefs_font_select(GtkButton *button, GtkEntry *entry)
3669 g_return_if_fail(entry != NULL);
3671 if (!font_sel_win) {
3672 font_sel_win = gtk_font_selection_dialog_new
3673 (_("Font selection"));
3674 gtk_window_position(GTK_WINDOW(font_sel_win),
3675 GTK_WIN_POS_CENTER);
3676 gtk_signal_connect(GTK_OBJECT(font_sel_win), "delete_event",
3677 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3680 (GTK_OBJECT(font_sel_win), "key_press_event",
3681 GTK_SIGNAL_FUNC(prefs_font_selection_key_pressed),
3683 gtk_signal_connect_object
3684 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->cancel_button),
3686 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3687 GTK_OBJECT(font_sel_win));
3690 if(font_sel_conn_id) {
3691 gtk_signal_disconnect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button), font_sel_conn_id);
3693 font_sel_conn_id = gtk_signal_connect
3694 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button),
3696 GTK_SIGNAL_FUNC(prefs_font_selection_ok),
3698 printf("%i\n", font_sel_conn_id);
3700 font_name = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
3701 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(font_sel_win), font_name);
3703 manage_window_set_transient(GTK_WINDOW(font_sel_win));
3704 gtk_window_set_modal(GTK_WINDOW(font_sel_win), TRUE);
3705 gtk_widget_grab_focus
3706 (GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button);
3707 gtk_widget_show(font_sel_win);
3710 static void prefs_font_selection_key_pressed(GtkWidget *widget,
3714 if (event && event->keyval == GDK_Escape)
3715 gtk_widget_hide(font_sel_win);
3718 static void prefs_font_selection_ok(GtkButton *button, GtkEntry *entry)
3722 fontname = gtk_font_selection_dialog_get_font_name
3723 (GTK_FONT_SELECTION_DIALOG(font_sel_win));
3726 gtk_entry_set_text(entry, fontname);
3731 gtk_widget_hide(font_sel_win);
3734 static void prefs_keybind_select(void)
3741 GtkWidget *confirm_area;
3743 GtkWidget *cancel_btn;
3745 window = gtk_window_new (GTK_WINDOW_DIALOG);
3746 gtk_container_set_border_width (GTK_CONTAINER (window), 8);
3747 gtk_window_set_title (GTK_WINDOW (window), _("Key bindings"));
3748 gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
3749 gtk_window_set_modal (GTK_WINDOW (window), TRUE);
3750 gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, FALSE);
3751 manage_window_set_transient (GTK_WINDOW (window));
3753 vbox1 = gtk_vbox_new (FALSE, VSPACING);
3754 gtk_container_add (GTK_CONTAINER (window), vbox1);
3755 gtk_container_set_border_width (GTK_CONTAINER (vbox1), 2);
3757 hbox1 = gtk_hbox_new (FALSE, 8);
3758 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3760 label = gtk_label_new
3761 (_("Select preset:"));
3762 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
3763 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
3765 hbox1 = gtk_hbox_new (FALSE, 8);
3766 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3768 combo = gtk_combo_new ();
3769 gtk_box_pack_start (GTK_BOX (hbox1), combo, TRUE, TRUE, 0);
3770 gtkut_combo_set_items (GTK_COMBO (combo),
3776 gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE);
3778 hbox1 = gtk_hbox_new (FALSE, 8);
3779 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3781 label = gtk_label_new
3782 (_("You can also modify each menu shortcut by pressing\n"
3783 "any key(s) when placing the mouse pointer on the item."));
3784 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
3785 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
3787 hbox1 = gtk_hbox_new (FALSE, 8);
3788 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3790 gtkut_button_set_create (&confirm_area, &ok_btn, _("OK"),
3791 &cancel_btn, _("Cancel"), NULL, NULL);
3792 gtk_box_pack_end (GTK_BOX (hbox1), confirm_area, FALSE, FALSE, 0);
3793 gtk_widget_grab_default (ok_btn);
3795 MANAGE_WINDOW_SIGNALS_CONNECT(window);
3796 gtk_signal_connect (GTK_OBJECT (window), "delete_event",
3797 GTK_SIGNAL_FUNC (prefs_keybind_deleted), NULL);
3798 gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
3799 GTK_SIGNAL_FUNC (prefs_keybind_key_pressed), NULL);
3800 gtk_signal_connect (GTK_OBJECT (ok_btn), "clicked",
3801 GTK_SIGNAL_FUNC (prefs_keybind_apply_clicked),
3803 gtk_signal_connect (GTK_OBJECT (cancel_btn), "clicked",
3804 GTK_SIGNAL_FUNC (prefs_keybind_cancel),
3807 gtk_widget_show_all(window);
3809 keybind.window = window;
3810 keybind.combo = combo;
3813 static void prefs_keybind_key_pressed(GtkWidget *widget, GdkEventKey *event,
3816 if (event && event->keyval == GDK_Escape)
3817 prefs_keybind_cancel();
3820 static gint prefs_keybind_deleted(GtkWidget *widget, GdkEventAny *event,
3823 prefs_keybind_cancel();
3827 static void prefs_keybind_cancel(void)
3829 gtk_widget_destroy(keybind.window);
3830 keybind.window = NULL;
3831 keybind.combo = NULL;
3834 static void prefs_keybind_apply_clicked(GtkWidget *widget)
3836 GtkEntry *entry = GTK_ENTRY(GTK_COMBO(keybind.combo)->entry);
3840 static gchar *default_menurc =
3841 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3842 "(menu-path \"<Main>/File/Save as...\" \"<control>S\")\n"
3843 "(menu-path \"<Main>/File/Print...\" \"\")\n"
3844 "(menu-path \"<Main>/File/Exit\" \"<control>Q\")\n"
3846 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3847 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3848 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3849 "(menu-path \"<Main>/Edit/Search folder...\" \"<shift><control>F\")\n"
3851 "(menu-path \"<Main>/View/Expand Summary View\" \"V\")\n"
3852 "(menu-path \"<Main>/View/Expand Message View\" \"<shift>V\")\n"
3853 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3854 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3855 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3856 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3857 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3858 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3859 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3860 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3861 "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
3862 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3864 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3865 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3866 "(menu-path \"<Main>/Message/Compose an email message\" \"<control>M\")\n"
3867 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3868 "(menu-path \"<Main>/Message/Reply to/all\" \"<shift><control>R\")\n"
3869 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
3870 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
3871 "(menu-path \"<Main>/Message/Forward\" \"<control><alt>F\")\n"
3872 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
3873 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3874 "(menu-path \"<Main>/Message/Copy...\" \"<shift><control>O\")\n"
3875 "(menu-path \"<Main>/Message/Delete\" \"<control>D\")\n"
3876 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3877 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3878 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3879 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3881 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3882 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3883 "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
3885 "(menu-path \"<Compose>/File/Close\" \"<control>W\")\n"
3886 "(menu-path \"<Compose>/Edit/Select all\" \"<control>A\")\n"
3887 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
3888 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
3889 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
3890 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
3891 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
3893 static gchar *mew_wl_menurc =
3894 "(menu-path \"<Main>/File/Empty trash\" \"<shift>D\")\n"
3895 "(menu-path \"<Main>/File/Save as...\" \"Y\")\n"
3896 "(menu-path \"<Main>/File/Print...\" \"<shift>numbersign\")\n"
3897 "(menu-path \"<Main>/File/Exit\" \"<shift>Q\")\n"
3899 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3900 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3901 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3902 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
3904 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
3905 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
3906 "(menu-path \"<Main>/View/Thread view\" \"<shift>T\")\n"
3907 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3908 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3909 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3910 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3911 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3912 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3913 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3914 "(menu-path \"<Main>/View/Show all headers\" \"<shift>H\")\n"
3915 "(menu-path \"<Main>/View/Update\" \"<shift>S\")\n"
3917 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3918 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3919 "(menu-path \"<Main>/Message/Compose an email message\" \"W\")\n"
3920 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3921 "(menu-path \"<Main>/Message/Reply to/all\" \"<shift>A\")\n"
3922 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
3923 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
3924 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3925 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift>F\")\n" */
3926 "(menu-path \"<Main>/Message/Move...\" \"O\")\n"
3927 "(menu-path \"<Main>/Message/Copy...\" \"<shift>O\")\n"
3928 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3929 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3930 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3931 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3932 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"<shift>R\")\n"
3934 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3935 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3936 "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
3938 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3939 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3940 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3941 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3942 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3943 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3944 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3946 static gchar *mutt_menurc =
3947 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3948 "(menu-path \"<Main>/File/Save as...\" \"S\")\n"
3949 "(menu-path \"<Main>/File/Print...\" \"P\")\n"
3950 "(menu-path \"<Main>/File/Exit\" \"Q\")\n"
3952 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3953 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3954 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3955 "(menu-path \"<Main>/Edit/Search messages...\" \"slash\")\n"
3957 "(menu-path \"<Main>/View/Toggle summary view\" \"V\")\n"
3958 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3959 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
3960 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
3961 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
3962 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
3963 "(menu-path \"<Main>/View/Go to/Other folder...\" \"C\")\n"
3964 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3965 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3966 "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
3967 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3969 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3970 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3971 "(menu-path \"<Main>/Message/Compose new message\" \"M\")\n"
3972 "(menu-path \"<Main>/Message/Reply\" \"R\")\n"
3973 "(menu-path \"<Main>/Message/Reply to/all\" \"G\")\n"
3974 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
3975 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
3976 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3977 "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n"
3978 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3979 "(menu-path \"<Main>/Message/Copy...\" \"<shift>C\")\n"
3980 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3981 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>F\")\n"
3982 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3983 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>N\")\n"
3984 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3986 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3987 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3988 "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
3990 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3991 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3992 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3993 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3994 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3995 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3996 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3998 static gchar *old_sylpheed_menurc =
3999 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
4000 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
4001 "(menu-path \"<Main>/File/Print...\" \"<alt>P\")\n"
4002 "(menu-path \"<Main>/File/Exit\" \"<alt>Q\")\n"
4004 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
4005 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
4006 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
4007 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
4009 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
4010 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
4011 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
4012 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
4013 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
4014 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
4015 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
4016 "(menu-path \"<Main>/View/Go to/Other folder...\" \"<alt>G\")\n"
4017 "(menu-path \"<Main>/View/Open in new window\" \"<shift><control>N\")\n"
4018 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
4019 "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
4020 "(menu-path \"<Main>/View/Update\" \"<alt>U\")\n"
4022 "(menu-path \"<Main>/Message/Get new mail\" \"<alt>I\")\n"
4023 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><alt>I\")\n"
4024 "(menu-path \"<Main>/Message/Compose an email message\" \"<alt>N\")\n"
4025 "(menu-path \"<Main>/Message/Reply\" \"<alt>R\")\n"
4026 "(menu-path \"<Main>/Message/Reply to/all\" \"<shift><alt>R\")\n"
4027 "(menu-path \"<Main>/Message/Reply to/sender\" \"<control><alt>R\")\n"
4028 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
4029 "(menu-path \"<Main>/Message/Forward\" \"<shift><alt>F\")\n"
4030 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift><control>F\")\n" */
4031 "(menu-path \"<Main>/Message/Move...\" \"<alt>O\")\n"
4032 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
4033 "(menu-path \"<Main>/Message/Delete\" \"<alt>D\")\n"
4034 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
4035 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
4036 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
4037 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
4039 "(menu-path \"<Main>/Tools/Address book\" \"<alt>A\")\n"
4040 "(menu-path \"<Main>/Tools/Execute\" \"<alt>X\")\n"
4041 "(menu-path \"<Main>/Tools/Log window\" \"<alt>L\")\n"
4043 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
4044 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
4045 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
4046 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
4047 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
4048 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
4049 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
4051 static gchar *empty_menurc =
4052 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
4053 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
4054 "(menu-path \"<Main>/File/Print...\" \"\")\n"
4055 "(menu-path \"<Main>/File/Exit\" \"\")\n"
4057 "(menu-path \"<Main>/Edit/Copy\" \"\")\n"
4058 "(menu-path \"<Main>/Edit/Select all\" \"\")\n"
4059 "(menu-path \"<Main>/Edit/Find in current message...\" \"\")\n"
4060 "(menu-path \"<Main>/Edit/Search folder...\" \"\")\n"
4062 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
4063 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
4064 "(menu-path \"<Main>/View/Thread view\" \"\")\n"
4065 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
4066 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
4067 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
4068 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
4069 "(menu-path \"<Main>/View/Go to/Other folder...\" \"\")\n"
4070 "(menu-path \"<Main>/View/Open in new window\" \"\")\n"
4071 "(menu-path \"<Main>/View/View source\" \"\")\n"
4072 "(menu-path \"<Main>/View/Show all headers\" \"\")\n"
4073 "(menu-path \"<Main>/View/Update\" \"\")\n"
4075 "(menu-path \"<Main>/Message/Get new mail\" \"\")\n"
4076 "(menu-path \"<Main>/Message/Get from all accounts\" \"\")\n"
4077 "(menu-path \"<Main>/Message/Compose an email message\" \"\")\n"
4078 "(menu-path \"<Main>/Message/Reply\" \"\")\n"
4079 "(menu-path \"<Main>/Message/Reply to/all\" \"\")\n"
4080 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
4081 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"\")\n"
4082 "(menu-path \"<Main>/Message/Forward\" \"\")\n"
4083 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
4084 "(menu-path \"<Main>/Message/Move...\" \"\")\n"
4085 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
4086 "(menu-path \"<Main>/Message/Delete\" \"\")\n"
4087 "(menu-path \"<Main>/Message/Mark/Mark\" \"\")\n"
4088 "(menu-path \"<Main>/Message/Mark/Unmark\" \"\")\n"
4089 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"\")\n"
4090 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
4092 "(menu-path \"<Main>/Tools/Address book\" \"\")\n"
4093 "(menu-path \"<Main>/Tools/Execute\" \"\")\n"
4094 "(menu-path \"<Main>/Tools/Log window\" \"\")\n"
4096 "(menu-path \"<Compose>/File/Close\" \"\")\n"
4097 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
4098 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
4099 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
4100 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
4101 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
4102 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
4104 text = gtk_entry_get_text(entry);
4106 if (!strcmp(text, _("Default")))
4107 rc_str = default_menurc;
4108 else if (!strcmp(text, "Mew / Wanderlust"))
4109 rc_str = mew_wl_menurc;
4110 else if (!strcmp(text, "Mutt"))
4111 rc_str = mutt_menurc;
4112 else if (!strcmp(text, _("Old Sylpheed")))
4113 rc_str = old_sylpheed_menurc;
4117 gtk_item_factory_parse_rc_string(empty_menurc);
4118 gtk_item_factory_parse_rc_string(rc_str);
4120 gtk_widget_destroy(keybind.window);
4121 keybind.window = NULL;
4122 keybind.combo = NULL;
4125 static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam)
4128 GtkWidget *menuitem;
4131 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4132 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4133 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
4134 g_free(*((gchar **)pparam->data));
4135 *((gchar **)pparam->data) = g_strdup(charset);
4138 static void prefs_common_charset_set_optmenu(PrefParam *pparam)
4140 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4143 g_return_if_fail(optmenu != NULL);
4144 g_return_if_fail(*((gchar **)pparam->data) != NULL);
4146 index = menu_find_option_menu_index(optmenu, *((gchar **)pparam->data),
4147 (GCompareFunc)strcmp);
4149 gtk_option_menu_set_history(optmenu, index);
4151 gtk_option_menu_set_history(optmenu, 0);
4152 prefs_common_charset_set_data_from_optmenu(pparam);
4156 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam)
4159 GtkWidget *menuitem;
4161 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4162 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4163 *((RecvDialogMode *)pparam->data) = GPOINTER_TO_INT
4164 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4167 static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
4169 RecvDialogMode mode = *((RecvDialogMode *)pparam->data);
4170 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4172 GtkWidget *menuitem;
4175 case RECV_DIALOG_ALWAYS:
4176 gtk_option_menu_set_history(optmenu, 0);
4178 case RECV_DIALOG_ACTIVE:
4179 gtk_option_menu_set_history(optmenu, 1);
4181 case RECV_DIALOG_NEVER:
4182 gtk_option_menu_set_history(optmenu, 2);
4188 menu = gtk_option_menu_get_menu(optmenu);
4189 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4190 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4193 static void prefs_common_send_dialog_set_data_from_optmenu(PrefParam *pparam)
4196 GtkWidget *menuitem;
4198 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4199 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4200 *((SendDialogMode *)pparam->data) = GPOINTER_TO_INT
4201 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4204 static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam)
4206 SendDialogMode mode = *((SendDialogMode *)pparam->data);
4207 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4209 GtkWidget *menuitem;
4212 case SEND_DIALOG_ALWAYS:
4213 gtk_option_menu_set_history(optmenu, 0);
4215 case SEND_DIALOG_NEVER:
4216 gtk_option_menu_set_history(optmenu, 1);
4222 menu = gtk_option_menu_get_menu(optmenu);
4223 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4224 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4227 static gint prefs_common_deleted(GtkWidget *widget, GdkEventAny *event,
4230 prefs_common_cancel();
4234 static void prefs_common_key_pressed(GtkWidget *widget, GdkEventKey *event,
4237 if (event && event->keyval == GDK_Escape)
4238 prefs_common_cancel();
4241 static void prefs_common_ok(void)
4243 prefs_common_apply();
4244 gtk_widget_hide(dialog.window);
4249 static void prefs_common_apply(void)
4251 gchar *entry_pixmap_theme_str;
4252 gboolean update_pixmap_theme;
4254 entry_pixmap_theme_str = gtk_entry_get_text(GTK_ENTRY(interface.entry_pixmap_theme));
4255 if (entry_pixmap_theme_str &&
4256 (strcmp(prefs_common.pixmap_theme_path, entry_pixmap_theme_str) != 0) )
4257 update_pixmap_theme = TRUE;
4259 update_pixmap_theme = FALSE;
4261 prefs_set_data_from_dialog(param);
4263 if (update_pixmap_theme)
4265 main_window_reflect_prefs_all_real(TRUE);
4266 compose_reflect_prefs_pixmap_theme();
4268 main_window_reflect_prefs_all_real(FALSE);
4270 prefs_common_save_config();
4272 inc_autocheck_timer_remove();
4273 inc_autocheck_timer_set();
4276 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam)
4279 GtkWidget *menuitem;
4281 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4282 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4283 *((NextUnreadMsgDialogShow *)pparam->data) = GPOINTER_TO_INT
4284 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4287 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam)
4289 NextUnreadMsgDialogShow dialog_show;
4290 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4292 GtkWidget *menuitem;
4294 dialog_show = *((NextUnreadMsgDialogShow *)pparam->data);
4296 switch (dialog_show) {
4297 case NEXTUNREADMSGDIALOG_ALWAYS:
4298 gtk_option_menu_set_history(optmenu, 0);
4300 case NEXTUNREADMSGDIALOG_ASSUME_YES:
4301 gtk_option_menu_set_history(optmenu, 1);
4303 case NEXTUNREADMSGDIALOG_ASSUME_NO:
4304 gtk_option_menu_set_history(optmenu, 2);
4308 menu = gtk_option_menu_get_menu(optmenu);
4309 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4310 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4313 static void prefs_common_cancel(void)
4315 gtk_widget_hide(dialog.window);
4320 /* static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
4323 GtkWidget *menuitem;
4325 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4326 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4327 *((RecvDialogShow *)pparam->data) = GPOINTER_TO_INT
4328 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4331 /* static void prefs_recvdialog_set_optmenu(PrefParam *pparam)
4333 RecvDialogShow dialog_show;
4334 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4336 GtkWidget *menuitem;
4338 dialog_show = *((RecvDialogShow *)pparam->data);
4340 switch (dialog_show) {
4341 case RECVDIALOG_ALWAYS:
4342 gtk_option_menu_set_history(optmenu, 0);
4344 case RECVDIALOG_WINDOW_ACTIVE:
4345 gtk_option_menu_set_history(optmenu, 1);
4347 case RECVDIALOG_NEVER:
4348 gtk_option_menu_set_history(optmenu, 2);
4353 menu = gtk_option_menu_get_menu(optmenu);
4354 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4355 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));