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"
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_noerrorpanel;
82 GtkWidget *checkbtn_scan_after_inc;
85 GtkWidget *spinbtn_maxarticle;
86 GtkObject *spinbtn_maxarticle_adj;
90 GtkWidget *checkbtn_extsend;
91 GtkWidget *entry_extsend;
92 GtkWidget *button_extsend;
94 GtkWidget *checkbtn_savemsg;
95 GtkWidget *checkbtn_queuemsg;
97 GtkWidget *optmenu_charset;
99 GtkWidget *checkbtn_returnreceipt;
102 static struct Compose {
103 GtkWidget *checkbtn_autosig;
104 GtkWidget *entry_sigsep;
106 GtkWidget *entry_fw_quotemark;
107 GtkWidget *text_fw_quotefmt;
109 GtkWidget *checkbtn_autoextedit;
110 GtkWidget *spinbtn_undolevel;
111 GtkObject *spinbtn_undolevel_adj;
112 GtkWidget *checkbtn_reply_account_autosel;
113 GtkWidget *checkbtn_forward_account_autosel;
114 GtkWidget *checkbtn_reedit_account_autosel;
116 GtkWidget *spinbtn_linewrap;
117 GtkObject *spinbtn_linewrap_adj;
118 GtkWidget *checkbtn_wrapquote;
119 GtkWidget *checkbtn_wrapatsend;
121 GtkWidget *checkbtn_quote;
122 GtkWidget *checkbtn_forward_as_attachment;
123 GtkWidget *checkbtn_smart_wrapping;
124 GtkWidget *checkbtn_block_cursor;
125 GtkWidget *checkbtn_reply_with_quote;
130 static struct Spelling {
131 GtkWidget *checkbtn_enable_pspell;
132 GtkWidget *entry_pspell_path;
133 GtkWidget *btn_pspell_path;
134 GtkWidget *optmenu_dictionary;
135 GtkWidget *optmenu_sugmode;
136 GtkWidget *misspelled_btn;
137 GtkWidget *checkbtn_use_alternate;
138 GtkWidget *checkbtn_check_while_typing;
142 static struct Quote {
143 GtkWidget *entry_quotemark;
144 GtkWidget *text_quotefmt;
146 GtkWidget *entry_fw_quotemark;
147 GtkWidget *text_fw_quotefmt;
150 static struct Display {
151 GtkWidget *entry_textfont;
152 GtkWidget *button_textfont;
154 GtkWidget *entry_smallfont;
155 GtkWidget *entry_normalfont;
156 GtkWidget *entry_boldfont;
158 GtkWidget *chkbtn_folder_unread;
160 GtkWidget *chkbtn_transhdr;
162 GtkWidget *chkbtn_swapfrom;
163 GtkWidget *chkbtn_hscrollbar;
164 GtkWidget *chkbtn_useaddrbook;
165 GtkWidget *chkbtn_expand_thread;
166 GtkWidget *chkbtn_bold_unread;
168 GtkWidget *entry_datefmt;
171 static struct Message {
172 GtkWidget *chkbtn_enablecol;
173 GtkWidget *button_edit_col;
174 GtkWidget *chkbtn_mbalnum;
175 GtkWidget *chkbtn_disphdrpane;
176 GtkWidget *chkbtn_disphdr;
177 GtkWidget *spinbtn_linespc;
178 GtkObject *spinbtn_linespc_adj;
179 GtkWidget *chkbtn_headspc;
181 GtkWidget *chkbtn_smoothscroll;
182 GtkWidget *spinbtn_scrollstep;
183 GtkObject *spinbtn_scrollstep_adj;
184 GtkWidget *chkbtn_halfpage;
188 static struct Privacy {
189 GtkWidget *checkbtn_auto_check_signatures;
190 GtkWidget *checkbtn_gpg_signature_popup;
191 GtkWidget *checkbtn_passphrase_grab;
192 GtkWidget *checkbtn_gpg_warning;
193 GtkWidget *optmenu_default_signkey;
197 static struct Interface {
198 /* GtkWidget *checkbtn_emacs; */
199 GtkWidget *checkbtn_openunread;
200 GtkWidget *checkbtn_openinbox;
201 GtkWidget *checkbtn_immedexec;
202 GtkWidget *checkbtn_addaddrbyclick;
203 GtkWidget *optmenu_recvdialog;
204 GtkWidget *optmenu_nextunreadmsgdialog;
205 GtkWidget *entry_pixmap_theme;
206 GtkWidget *combo_pixmap_theme;
209 static struct Other {
210 GtkWidget *uri_combo;
211 GtkWidget *uri_entry;
212 GtkWidget *printcmd_entry;
213 GtkWidget *exteditor_combo;
214 GtkWidget *exteditor_entry;
215 GtkWidget *checkbtn_confonexit;
216 GtkWidget *checkbtn_cleanonexit;
217 GtkWidget *checkbtn_askonclean;
218 GtkWidget *checkbtn_warnqueued;
221 static struct MessageColorButtons {
222 GtkWidget *quote_level1_btn;
223 GtkWidget *quote_level2_btn;
224 GtkWidget *quote_level3_btn;
226 GtkWidget *tgt_folder_btn;
229 static struct KeybindDialog {
234 static GtkWidget *font_sel_win;
235 static guint font_sel_conn_id;
236 static GtkWidget *quote_color_win;
237 static GtkWidget *color_dialog;
239 static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam);
240 static void prefs_common_charset_set_optmenu (PrefParam *pparam);
242 static void prefs_common_default_signkey_set_data_from_optmenu
244 static void prefs_common_default_signkey_set_optmenu (PrefParam *pparam);
246 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam);
247 static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam);
248 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam);
249 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam);
252 static void prefs_dictionary_set_data_from_optmenu (PrefParam *param);
253 static void prefs_dictionary_set_optmenu (PrefParam *pparam);
254 static void prefs_speller_sugmode_set_data_from_optmenu (PrefParam *pparam);
255 static void prefs_speller_sugmode_set_optmenu (PrefParam *pparam);
260 parameter name, default value, pointer to the prefs variable, data type,
261 pointer to the widget pointer,
262 pointer to the function for data setting,
263 pointer to the function for widget setting
266 static PrefParam param[] = {
268 {"use_ext_inc", "FALSE", &prefs_common.use_extinc, P_BOOL,
269 &receive.checkbtn_incext,
270 prefs_set_data_from_toggle, prefs_set_toggle},
271 {"ext_inc_path", DEFAULT_INC_PATH, &prefs_common.extinc_cmd, P_STRING,
272 &receive.entry_incext,
273 prefs_set_data_from_entry, prefs_set_entry},
275 {"inc_local", "TRUE", &prefs_common.inc_local, P_BOOL,
276 &receive.checkbtn_local,
277 prefs_set_data_from_toggle, prefs_set_toggle},
278 {"filter_on_inc_local", "FALSE", &prefs_common.filter_on_inc, P_BOOL,
279 &receive.checkbtn_filter_on_inc,
280 prefs_set_data_from_toggle, prefs_set_toggle},
281 {"spool_path", DEFAULT_SPOOL_PATH, &prefs_common.spool_path, P_STRING,
282 &receive.entry_spool,
283 prefs_set_data_from_entry, prefs_set_entry},
285 {"autochk_newmail", "FALSE", &prefs_common.autochk_newmail, P_BOOL,
286 &receive.checkbtn_autochk,
287 prefs_set_data_from_toggle, prefs_set_toggle},
288 {"autochk_interval", "10", &prefs_common.autochk_itv, P_INT,
289 &receive.spinbtn_autochk,
290 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
291 {"check_on_startup", "FALSE", &prefs_common.chk_on_startup, P_BOOL,
292 &receive.checkbtn_chkonstartup,
293 prefs_set_data_from_toggle, prefs_set_toggle},
294 {"noerrorpanel", "FALSE", &prefs_common.noerrorpanel, P_BOOL,
295 &receive.checkbtn_noerrorpanel,
296 prefs_set_data_from_toggle, prefs_set_toggle},
297 {"scan_all_after_inc", "FALSE", &prefs_common.scan_all_after_inc,
298 P_BOOL, &receive.checkbtn_scan_after_inc,
299 prefs_set_data_from_toggle, prefs_set_toggle},
300 {"max_news_articles", "300", &prefs_common.max_articles, P_INT,
301 &receive.spinbtn_maxarticle,
302 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
305 {"use_ext_sendmail", "FALSE", &prefs_common.use_extsend, P_BOOL,
306 &send.checkbtn_extsend,
307 prefs_set_data_from_toggle, prefs_set_toggle},
308 {"ext_sendmail_cmd", DEFAULT_SENDMAIL_CMD,
309 &prefs_common.extsend_cmd, P_STRING,
310 &send.entry_extsend, prefs_set_data_from_entry, prefs_set_entry},
311 {"save_message", "TRUE", &prefs_common.savemsg, P_BOOL,
312 &send.checkbtn_savemsg,
313 prefs_set_data_from_toggle, prefs_set_toggle},
314 {"queue_message", "FALSE", &prefs_common.queue_msg, P_BOOL,
315 &send.checkbtn_queuemsg,
316 prefs_set_data_from_toggle, prefs_set_toggle},
318 {"outgoing_charset", CS_AUTO, &prefs_common.outgoing_charset, P_STRING,
319 &send.optmenu_charset,
320 prefs_common_charset_set_data_from_optmenu,
321 prefs_common_charset_set_optmenu},
324 {"auto_signature", "TRUE", &prefs_common.auto_sig, P_BOOL,
325 &compose.checkbtn_autosig,
326 prefs_set_data_from_toggle, prefs_set_toggle},
327 {"signature_separator", "-- ", &prefs_common.sig_sep, P_STRING,
328 &compose.entry_sigsep, prefs_set_data_from_entry, prefs_set_entry},
330 {"auto_ext_editor", "FALSE", &prefs_common.auto_exteditor, P_BOOL,
331 &compose.checkbtn_autoextedit,
332 prefs_set_data_from_toggle, prefs_set_toggle},
334 {"undo_level", "50", &prefs_common.undolevels, P_INT,
335 &compose.spinbtn_undolevel,
336 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
338 {"linewrap_length", "72", &prefs_common.linewrap_len, P_INT,
339 &compose.spinbtn_linewrap,
340 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
341 {"linewrap_quotation", "FALSE", &prefs_common.linewrap_quote, P_BOOL,
342 &compose.checkbtn_wrapquote,
343 prefs_set_data_from_toggle, prefs_set_toggle},
344 {"linewrap_before_sending", "FALSE",
345 &prefs_common.linewrap_at_send, P_BOOL,
346 &compose.checkbtn_wrapatsend,
347 prefs_set_data_from_toggle, prefs_set_toggle},
348 {"forward_as_attachment", "FALSE", &prefs_common.forward_as_attachment,
349 P_BOOL, &compose.checkbtn_forward_as_attachment,
350 prefs_set_data_from_toggle, prefs_set_toggle},
351 {"smart_wrapping", "TRUE", &prefs_common.smart_wrapping,
352 P_BOOL, &compose.checkbtn_smart_wrapping,
353 prefs_set_data_from_toggle, prefs_set_toggle},
354 {"block_cursor", "FALSE", &prefs_common.block_cursor,
355 P_BOOL, &compose.checkbtn_block_cursor,
356 prefs_set_data_from_toggle, prefs_set_toggle},
358 {"enable_pspell", "TRUE", &prefs_common.enable_pspell,
359 P_BOOL, &spelling.checkbtn_enable_pspell,
360 prefs_set_data_from_toggle, prefs_set_toggle},
361 {"pspell_path", PSPELL_PATH, &prefs_common.pspell_path,
362 P_STRING, &spelling.entry_pspell_path,
363 prefs_set_data_from_entry, prefs_set_entry},
364 {"dictionary", "", &prefs_common.dictionary,
365 P_STRING, &spelling.optmenu_dictionary,
366 prefs_dictionary_set_data_from_optmenu, prefs_dictionary_set_optmenu },
367 {"pspell_sugmode", "1", &prefs_common.pspell_sugmode,
368 P_INT, &spelling.optmenu_sugmode,
369 prefs_speller_sugmode_set_data_from_optmenu, prefs_speller_sugmode_set_optmenu },
370 {"use_alternate_dict", "FALSE", &prefs_common.use_alternate,
371 P_BOOL, &spelling.checkbtn_use_alternate,
372 prefs_set_data_from_toggle, prefs_set_toggle},
373 {"check_while_typing", "TRUE", &prefs_common.check_while_typing,
374 P_BOOL, &spelling.checkbtn_check_while_typing,
375 prefs_set_data_from_toggle, prefs_set_toggle},
376 {"misspelled_color", "16711680", &prefs_common.misspelled_col, P_INT,
379 {"reply_with_quote", "TRUE", &prefs_common.reply_with_quote, P_BOOL,
380 &compose.checkbtn_reply_with_quote, prefs_set_data_from_toggle, prefs_set_toggle},
382 /* Account autoselection */
383 {"reply_account_autoselect", "TRUE",
384 &prefs_common.reply_account_autosel, P_BOOL,
385 &compose.checkbtn_reply_account_autosel,
386 prefs_set_data_from_toggle, prefs_set_toggle},
387 {"forward_account_autoselect", "TRUE",
388 &prefs_common.forward_account_autosel, P_BOOL,
389 &compose.checkbtn_forward_account_autosel,
390 prefs_set_data_from_toggle, prefs_set_toggle},
391 {"reedit_account_autoselect", "TRUE",
392 &prefs_common.reedit_account_autosel, P_BOOL,
393 &compose.checkbtn_reedit_account_autosel,
394 prefs_set_data_from_toggle, prefs_set_toggle},
396 {"show_ruler", "TRUE", &prefs_common.show_ruler, P_BOOL,
400 {"reply_quote_mark", "> ", &prefs_common.quotemark, P_STRING,
401 "e.entry_quotemark, prefs_set_data_from_entry, prefs_set_entry},
402 {"reply_quote_format", "On %d\\n%f wrote:\\n\\n%Q",
403 &prefs_common.quotefmt, P_STRING, "e.text_quotefmt,
404 prefs_set_data_from_text, prefs_set_text},
406 {"forward_quote_mark", "> ", &prefs_common.fw_quotemark, P_STRING,
407 "e.entry_fw_quotemark,
408 prefs_set_data_from_entry, prefs_set_entry},
409 {"forward_quote_format",
410 "\\n\\nBegin forwarded message:\\n\\n"
411 "?d{Date: %d\\n}?f{From: %f\\n}?t{To: %t\\n}?c{Cc: %c\\n}"
412 "?n{Newsgroups: %n\\n}?s{Subject: %s\\n}\\n\\n%M",
413 &prefs_common.fw_quotefmt, P_STRING, "e.text_fw_quotefmt,
414 prefs_set_data_from_text, prefs_set_text},
417 {"widget_font", NULL, &prefs_common.widgetfont, P_STRING,
419 {"message_font", "-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*",
420 &prefs_common.textfont, P_STRING,
421 &display.entry_textfont,
422 prefs_set_data_from_entry, prefs_set_entry},
423 {"small_font", "-*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*",
424 &prefs_common.smallfont, P_STRING,
425 &display.entry_smallfont,
426 prefs_set_data_from_entry, prefs_set_entry},
427 {"bold_font", "-*-helvetica-bold-r-normal--12-*-*-*-*-*-*-*",
428 &prefs_common.boldfont, P_STRING,
429 &display.entry_boldfont,
430 prefs_set_data_from_entry, prefs_set_entry},
431 {"normal_font", "-*-helvetica-medium-r-normal--12-*-*-*-*-*-*-*",
432 &prefs_common.normalfont, P_STRING,
433 &display.entry_normalfont,
434 prefs_set_data_from_entry, prefs_set_entry},
437 {"display_folder_unread_num", "TRUE",
438 &prefs_common.display_folder_unread, P_BOOL,
439 &display.chkbtn_folder_unread,
440 prefs_set_data_from_toggle, prefs_set_toggle},
442 {"translate_header", "TRUE", &prefs_common.trans_hdr, P_BOOL,
443 &display.chkbtn_transhdr,
444 prefs_set_data_from_toggle, prefs_set_toggle},
446 /* Display: Summary View */
447 {"enable_swap_from", "TRUE", &prefs_common.swap_from, P_BOOL,
448 &display.chkbtn_swapfrom,
449 prefs_set_data_from_toggle, prefs_set_toggle},
450 {"enable_hscrollbar", "TRUE", &prefs_common.enable_hscrollbar, P_BOOL,
451 &display.chkbtn_hscrollbar,
452 prefs_set_data_from_toggle, prefs_set_toggle},
453 {"use_address_book", "TRUE", &prefs_common.use_addr_book, P_BOOL,
454 &display.chkbtn_useaddrbook,
455 prefs_set_data_from_toggle, prefs_set_toggle},
456 {"date_format", "%y/%m/%d(%a) %H:%M", &prefs_common.date_format,
457 P_STRING, &display.entry_datefmt,
458 prefs_set_data_from_entry, prefs_set_entry},
459 {"expand_thread", "TRUE", &prefs_common.expand_thread, P_BOOL,
460 &display.chkbtn_expand_thread,
461 prefs_set_data_from_toggle, prefs_set_toggle},
462 {"bold_unread", "TRUE", &prefs_common.bold_unread, P_BOOL,
463 &display.chkbtn_bold_unread,
464 prefs_set_data_from_toggle, prefs_set_toggle},
466 {"enable_thread", "TRUE", &prefs_common.enable_thread, P_BOOL,
469 {"toolbar_style", "3", &prefs_common.toolbar_style, P_ENUM,
471 {"show_statusbar", "TRUE", &prefs_common.show_statusbar, P_BOOL,
474 {"summary_col_show_mark", "TRUE",
475 &prefs_common.summary_col_visible[S_COL_MARK], P_BOOL, NULL, NULL, NULL},
476 {"summary_col_show_unread", "TRUE",
477 &prefs_common.summary_col_visible[S_COL_UNREAD], P_BOOL, NULL, NULL, NULL},
478 {"summary_col_show_mime", "TRUE",
479 &prefs_common.summary_col_visible[S_COL_MIME], P_BOOL, NULL, NULL, NULL},
480 {"summary_col_show_subject", "TRUE",
481 &prefs_common.summary_col_visible[S_COL_SUBJECT], P_BOOL, NULL, NULL, NULL},
482 {"summary_col_show_from", "TRUE",
483 &prefs_common.summary_col_visible[S_COL_FROM], P_BOOL, NULL, NULL, NULL},
484 {"summary_col_show_date", "TRUE",
485 &prefs_common.summary_col_visible[S_COL_DATE], P_BOOL, NULL, NULL, NULL},
486 {"summary_col_show_size", "TRUE",
487 &prefs_common.summary_col_visible[S_COL_SIZE], P_BOOL, NULL, NULL, NULL},
488 {"summary_col_show_number", "FALSE",
489 &prefs_common.summary_col_visible[S_COL_NUMBER], P_BOOL, NULL, NULL, NULL},
490 {"summary_col_show_score", "FALSE",
491 &prefs_common.summary_col_visible[S_COL_SCORE], P_BOOL, NULL, NULL, NULL},
492 {"summary_col_show_locked", "FALSE",
493 &prefs_common.summary_col_visible[S_COL_LOCKED], P_BOOL, NULL, NULL, NULL},
495 {"summary_col_pos_mark", "0",
496 &prefs_common.summary_col_pos[S_COL_MARK], P_INT, NULL, NULL, NULL},
497 {"summary_col_pos_unread", "1",
498 &prefs_common.summary_col_pos[S_COL_UNREAD], P_INT, NULL, NULL, NULL},
499 {"summary_col_pos_mime", "2",
500 &prefs_common.summary_col_pos[S_COL_MIME], P_INT, NULL, NULL, NULL},
501 {"summary_col_pos_subject", "3",
502 &prefs_common.summary_col_pos[S_COL_SUBJECT], P_INT, NULL, NULL, NULL},
503 {"summary_col_pos_from", "4",
504 &prefs_common.summary_col_pos[S_COL_FROM], P_INT, NULL, NULL, NULL},
505 {"summary_col_pos_date", "5",
506 &prefs_common.summary_col_pos[S_COL_DATE], P_INT, NULL, NULL, NULL},
507 {"summary_col_pos_size", "6",
508 &prefs_common.summary_col_pos[S_COL_SIZE], P_INT, NULL, NULL, NULL},
509 {"summary_col_pos_number", "7",
510 &prefs_common.summary_col_pos[S_COL_NUMBER], P_INT, NULL, NULL, NULL},
511 {"summary_col_pos_score", "8",
512 &prefs_common.summary_col_pos[S_COL_SCORE], P_INT, NULL, NULL, NULL},
513 {"summary_col_pos_locked", "9",
514 &prefs_common.summary_col_pos[S_COL_LOCKED], P_INT, NULL, NULL, NULL},
516 {"summary_col_size_mark", "10",
517 &prefs_common.summary_col_size[S_COL_MARK], P_INT, NULL, NULL, NULL},
518 {"summary_col_size_unread", "13",
519 &prefs_common.summary_col_size[S_COL_UNREAD], P_INT, NULL, NULL, NULL},
520 {"summary_col_size_mime", "10",
521 &prefs_common.summary_col_size[S_COL_MIME], P_INT, NULL, NULL, NULL},
522 {"summary_col_size_subject", "200",
523 &prefs_common.summary_col_size[S_COL_SUBJECT], P_INT, NULL, NULL, NULL},
524 {"summary_col_size_from", "120",
525 &prefs_common.summary_col_size[S_COL_FROM], P_INT, NULL, NULL, NULL},
526 {"summary_col_size_date", "118",
527 &prefs_common.summary_col_size[S_COL_DATE], P_INT, NULL, NULL, NULL},
528 {"summary_col_size_size", "45",
529 &prefs_common.summary_col_size[S_COL_SIZE], P_INT, NULL, NULL, NULL},
530 {"summary_col_size_number", "40",
531 &prefs_common.summary_col_size[S_COL_NUMBER], P_INT, NULL, NULL, NULL},
532 {"summary_col_size_score", "40",
533 &prefs_common.summary_col_size[S_COL_SCORE], P_INT, NULL, NULL, NULL},
534 {"summary_col_size_locked", "13",
535 &prefs_common.summary_col_size[S_COL_LOCKED], P_INT, NULL, NULL, NULL},
538 {"folderview_width", "179", &prefs_common.folderview_width, P_INT,
540 {"folderview_height", "600", &prefs_common.folderview_height, P_INT,
542 {"folder_col_folder", "150", &prefs_common.folder_col_folder, P_INT,
544 {"folder_col_new", "32", &prefs_common.folder_col_new, P_INT,
546 {"folder_col_unread", "32", &prefs_common.folder_col_unread, P_INT,
548 {"folder_col_total", "32", &prefs_common.folder_col_total, P_INT,
551 {"summaryview_width", "600", &prefs_common.summaryview_width, P_INT,
553 {"summaryview_height", "173", &prefs_common.summaryview_height, P_INT,
556 {"mainview_x", "64", &prefs_common.mainview_x, P_INT,
558 {"mainview_y", "64", &prefs_common.mainview_y, P_INT,
560 {"mainview_width", "600", &prefs_common.mainview_width, P_INT,
562 {"mainview_height", "600", &prefs_common.mainview_height, P_INT,
564 {"mainwin_x", "64", &prefs_common.mainwin_x, P_INT,
566 {"mainwin_y", "64", &prefs_common.mainwin_y, P_INT,
568 {"mainwin_width", "800", &prefs_common.mainwin_width, P_INT,
570 {"mainwin_height", "600", &prefs_common.mainwin_height, P_INT,
572 {"messagewin_width", "600", &prefs_common.msgwin_width, P_INT,
574 {"messagewin_height", "540", &prefs_common.msgwin_height, P_INT,
576 {"compose_width", "600", &prefs_common.compose_width, P_INT,
578 {"compose_height", "560", &prefs_common.compose_height, P_INT,
582 {"enable_color", "TRUE", &prefs_common.enable_color, P_BOOL,
583 &message.chkbtn_enablecol,
584 prefs_set_data_from_toggle, prefs_set_toggle},
586 {"quote_level1_color", "179", &prefs_common.quote_level1_col, P_INT,
588 {"quote_level2_color", "179", &prefs_common.quote_level2_col, P_INT,
590 {"quote_level3_color", "179", &prefs_common.quote_level3_col, P_INT,
592 {"uri_color", "32512", &prefs_common.uri_col, P_INT,
594 {"target_folder_color", "14294218", &prefs_common.tgt_folder_col, P_INT,
596 {"signature_color", "0", &prefs_common.sig_col, P_USHORT,
598 {"recycle_quote_colors", "FALSE", &prefs_common.recycle_quote_colors,
599 P_BOOL, NULL, NULL, NULL},
601 {"convert_mb_alnum", "FALSE", &prefs_common.conv_mb_alnum, P_BOOL,
602 &message.chkbtn_mbalnum,
603 prefs_set_data_from_toggle, prefs_set_toggle},
604 {"display_header_pane", "TRUE", &prefs_common.display_header_pane,
605 P_BOOL, &message.chkbtn_disphdrpane,
606 prefs_set_data_from_toggle, prefs_set_toggle},
607 {"display_header", "TRUE", &prefs_common.display_header, P_BOOL,
608 &message.chkbtn_disphdr,
609 prefs_set_data_from_toggle, prefs_set_toggle},
610 {"line_space", "2", &prefs_common.line_space, P_INT,
611 &message.spinbtn_linespc,
612 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
613 {"enable_head_space", "FALSE", &prefs_common.head_space, P_BOOL,
614 &message.chkbtn_headspc,
615 prefs_set_data_from_toggle, prefs_set_toggle},
617 {"enable_smooth_scroll", "FALSE",
618 &prefs_common.enable_smooth_scroll, P_BOOL,
619 &message.chkbtn_smoothscroll,
620 prefs_set_data_from_toggle, prefs_set_toggle},
621 {"scroll_step", "1", &prefs_common.scroll_step, P_INT,
622 &message.spinbtn_scrollstep,
623 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
624 {"scroll_half_page", "FALSE", &prefs_common.scroll_halfpage, P_BOOL,
625 &message.chkbtn_halfpage,
626 prefs_set_data_from_toggle, prefs_set_toggle},
628 {"show_other_header", "FALSE", &prefs_common.show_other_header, P_BOOL,
632 {"mime_image_viewer", "display '%s'",
633 &prefs_common.mime_image_viewer, P_STRING, NULL, NULL, NULL},
634 {"mime_audio_player", "play '%s'",
635 &prefs_common.mime_audio_player, P_STRING, NULL, NULL, NULL},
636 {"mime_open_command", "gedit '%s'",
637 &prefs_common.mime_open_cmd, P_STRING, NULL, NULL, NULL},
641 {"auto_check_signatures", "TRUE",
642 &prefs_common.auto_check_signatures, P_BOOL,
643 &privacy.checkbtn_auto_check_signatures,
644 prefs_set_data_from_toggle, prefs_set_toggle},
645 {"gpg_signature_popup", "FALSE",
646 &prefs_common.gpg_signature_popup, P_BOOL,
647 &privacy.checkbtn_gpg_signature_popup,
648 prefs_set_data_from_toggle, prefs_set_toggle},
650 {"passphrase_grab", "FALSE", &prefs_common.passphrase_grab, P_BOOL,
651 &privacy.checkbtn_passphrase_grab,
652 prefs_set_data_from_toggle, prefs_set_toggle},
653 #endif /* __MINGW32__ */
654 {"gpg_warning", "TRUE", &prefs_common.gpg_warning, P_BOOL,
655 &privacy.checkbtn_gpg_warning,
656 prefs_set_data_from_toggle, prefs_set_toggle},
657 {"default_signkey", CS_AUTO, &prefs_common.default_signkey, P_STRING,
658 &privacy.optmenu_default_signkey,
659 prefs_common_default_signkey_set_data_from_optmenu,
660 prefs_common_default_signkey_set_optmenu},
661 #endif /* USE_GPGME */
664 {"separate_folder", "FALSE", &prefs_common.sep_folder, P_BOOL,
666 {"separate_message", "FALSE", &prefs_common.sep_msg, P_BOOL,
669 /* {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
670 NULL, NULL, NULL}, */
672 {"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
673 P_BOOL, &interface.checkbtn_openunread,
674 prefs_set_data_from_toggle, prefs_set_toggle},
675 {"open_inbox_on_inc", "FALSE", &prefs_common.open_inbox_on_inc,
676 P_BOOL, &interface.checkbtn_openinbox,
677 prefs_set_data_from_toggle, prefs_set_toggle},
678 {"immediate_execution", "TRUE", &prefs_common.immediate_exec, P_BOOL,
679 &interface.checkbtn_immedexec,
680 prefs_set_data_from_toggle, prefs_set_toggle},
681 {"receive_dialog_mode", "1", &prefs_common.recv_dialog_mode, P_ENUM,
682 &interface.optmenu_recvdialog,
683 prefs_common_recv_dialog_set_data_from_optmenu,
684 prefs_common_recv_dialog_set_optmenu},
685 {"nextunreadmsg_dialog", NULL, &prefs_common.next_unread_msg_dialog, P_ENUM,
686 &interface.optmenu_nextunreadmsgdialog,
687 prefs_nextunreadmsgdialog_set_data_from_optmenu,
688 prefs_nextunreadmsgdialog_set_optmenu},
690 {"add_address_by_click", "FALSE", &prefs_common.add_address_by_click,
691 P_BOOL, &interface.checkbtn_addaddrbyclick,
692 prefs_set_data_from_toggle, prefs_set_toggle},
693 {"pixmap_theme_path", DEFAULT_PIXMAP_THEME,
694 &prefs_common.pixmap_theme_path, P_STRING,
695 &interface.entry_pixmap_theme, prefs_set_data_from_entry, prefs_set_entry},
698 {"uri_open_command", "netscape -remote 'openURL(%s,raise)'",
699 &prefs_common.uri_cmd, P_STRING,
700 &other.uri_entry, prefs_set_data_from_entry, prefs_set_entry},
701 {"print_command", "lpr %s", &prefs_common.print_cmd, P_STRING,
702 &other.printcmd_entry, prefs_set_data_from_entry, prefs_set_entry},
703 {"ext_editor_command", "gedit %s",
704 &prefs_common.ext_editor_cmd, P_STRING,
705 &other.exteditor_entry, prefs_set_data_from_entry, prefs_set_entry},
707 {"confirm_on_exit", "TRUE", &prefs_common.confirm_on_exit, P_BOOL,
708 &other.checkbtn_confonexit,
709 prefs_set_data_from_toggle, prefs_set_toggle},
710 {"send_return_receipt", "TRUE", &prefs_common.return_receipt, P_BOOL,
711 &send.checkbtn_returnreceipt,
712 prefs_set_data_from_toggle, prefs_set_toggle},
713 {"clean_trash_on_exit", "FALSE", &prefs_common.clean_on_exit, P_BOOL,
714 &other.checkbtn_cleanonexit,
715 prefs_set_data_from_toggle, prefs_set_toggle},
716 {"ask_on_cleaning", "TRUE", &prefs_common.ask_on_clean, P_BOOL,
717 &other.checkbtn_askonclean,
718 prefs_set_data_from_toggle, prefs_set_toggle},
719 {"warn_queued_on_exit", "TRUE", &prefs_common.warn_queued_on_exit,
720 P_BOOL, &other.checkbtn_warnqueued,
721 prefs_set_data_from_toggle, prefs_set_toggle},
723 {"kill_score", "-9999", &prefs_common.kill_score, P_INT,
725 {"important_score", "1", &prefs_common.important_score, P_INT,
728 {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
731 /* widget creating functions */
732 static void prefs_common_create (void);
733 static void prefs_receive_create (void);
734 static void prefs_send_create (void);
735 static void prefs_compose_create (void);
736 static void prefs_spelling_create (void);
737 static void prefs_quote_create (void);
738 static void prefs_display_create (void);
739 static void prefs_message_create (void);
741 static void prefs_privacy_create (void);
743 static void prefs_interface_create (void);
744 static void prefs_other_create (void);
746 static void date_format_ok_btn_clicked (GtkButton *button,
748 static void date_format_cancel_btn_clicked (GtkButton *button,
750 static void date_format_key_pressed (GtkWidget *keywidget,
753 static gboolean date_format_on_delete (GtkWidget *dialogwidget,
756 static void date_format_entry_on_change (GtkEditable *editable,
758 static void date_format_select_row (GtkWidget *date_format_list,
761 GdkEventButton *event,
762 GtkWidget *date_format);
763 static GtkWidget *date_format_create (GtkButton *button,
766 static void prefs_quote_colors_dialog (void);
767 static void prefs_quote_colors_dialog_create (void);
768 static void prefs_quote_colors_key_pressed (GtkWidget *widget,
771 static void quote_color_set_dialog (GtkWidget *widget,
773 static void quote_colors_set_dialog_ok (GtkWidget *widget,
775 static void quote_colors_set_dialog_cancel (GtkWidget *widget,
777 static void quote_colors_set_dialog_key_pressed (GtkWidget *widget,
780 static void set_button_bg_color (GtkWidget *widget,
782 static void prefs_enable_message_color_toggled (void);
783 static void prefs_recycle_colors_toggled (GtkWidget *widget);
785 static void prefs_font_select (GtkButton *button, GtkEntry *entry);
787 static void prefs_font_selection_key_pressed (GtkWidget *widget,
790 static void prefs_font_selection_ok (GtkButton *button, GtkEntry *entry);
792 static void prefs_keybind_select (void);
793 static gint prefs_keybind_deleted (GtkWidget *widget,
796 static void prefs_keybind_key_pressed (GtkWidget *widget,
799 static void prefs_keybind_cancel (void);
800 static void prefs_keybind_apply_clicked (GtkWidget *widget);
802 static gint prefs_common_deleted (GtkWidget *widget,
805 static void prefs_common_key_pressed (GtkWidget *widget,
808 static void prefs_common_ok (void);
809 static void prefs_common_apply (void);
810 static void prefs_common_cancel (void);
812 void prefs_common_init() {
813 prefs_common.fltlist = NULL;
814 prefs_common.disphdr_list = NULL;
817 void prefs_common_read_config(void)
821 gchar buf[PREFSBUFSIZE];
823 prefs_read_config(param, "Common", COMMON_RC);
825 path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
827 if ((fp = fopen(path, "r")) == NULL) {
828 if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
833 while (fgets(buf, sizeof(buf), fp) != NULL) {
835 if (buf[0] == '\0') continue;
836 prefs_common.mime_open_cmd_history =
837 add_history(prefs_common.mime_open_cmd_history, buf);
841 prefs_common.mime_open_cmd_history =
842 g_list_reverse(prefs_common.mime_open_cmd_history);
845 void prefs_common_save_config(void)
851 prefs_save_config(param, "Common", COMMON_RC);
853 path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
855 if ((fp = fopen(path, "w")) == NULL) {
856 FILE_OP_ERROR(path, "fopen");
861 for (cur = prefs_common.mime_open_cmd_history;
862 cur != NULL; cur = cur->next) {
863 fputs((gchar *)cur->data, fp);
871 void prefs_common_open(void)
873 if (prefs_rc_is_readonly(COMMON_RC))
878 if (!dialog.window) {
879 prefs_common_create();
882 manage_window_set_transient(GTK_WINDOW(dialog.window));
883 gtk_notebook_set_page(GTK_NOTEBOOK(dialog.notebook), 0);
884 gtk_widget_grab_focus(dialog.ok_btn);
886 prefs_set_dialog(param);
888 gtk_widget_show(dialog.window);
891 static void prefs_common_create(void)
895 debug_print(_("Creating common preferences window...\n"));
897 prefs_dialog_create(&dialog);
898 gtk_window_set_title (GTK_WINDOW(dialog.window),
899 _("Common Preferences"));
900 gtk_signal_connect (GTK_OBJECT(dialog.window), "delete_event",
901 GTK_SIGNAL_FUNC(prefs_common_deleted), NULL);
902 gtk_signal_connect (GTK_OBJECT(dialog.window), "key_press_event",
903 GTK_SIGNAL_FUNC(prefs_common_key_pressed), NULL);
904 MANAGE_WINDOW_SIGNALS_CONNECT(dialog.window);
906 gtk_signal_connect (GTK_OBJECT(dialog.ok_btn), "clicked",
907 GTK_SIGNAL_FUNC(prefs_common_ok), NULL);
908 gtk_signal_connect (GTK_OBJECT(dialog.apply_btn), "clicked",
909 GTK_SIGNAL_FUNC(prefs_common_apply), NULL);
910 gtk_signal_connect_object (GTK_OBJECT(dialog.cancel_btn), "clicked",
911 GTK_SIGNAL_FUNC(prefs_common_cancel),
912 GTK_OBJECT(dialog.window));
914 /* create all widgets on notebook */
915 prefs_receive_create();
916 SET_NOTEBOOK_LABEL(dialog.notebook, _("Receive"), page++);
918 SET_NOTEBOOK_LABEL(dialog.notebook, _("Send"), page++);
919 prefs_compose_create();
920 SET_NOTEBOOK_LABEL(dialog.notebook, _("Compose"), page++);
922 prefs_spelling_create();
923 SET_NOTEBOOK_LABEL(dialog.notebook, _("Spell Checker"), page++);
925 prefs_quote_create();
926 SET_NOTEBOOK_LABEL(dialog.notebook, _("Quote"), page++);
927 prefs_display_create();
928 SET_NOTEBOOK_LABEL(dialog.notebook, _("Display"), page++);
929 prefs_message_create();
930 SET_NOTEBOOK_LABEL(dialog.notebook, _("Message"), page++);
932 prefs_privacy_create();
933 SET_NOTEBOOK_LABEL(dialog.notebook, _("Privacy"), page++);
935 prefs_interface_create();
936 SET_NOTEBOOK_LABEL(dialog.notebook, _("Interface"), page++);
937 prefs_other_create();
938 SET_NOTEBOOK_LABEL(dialog.notebook, _("Other"), page++);
940 gtk_widget_show_all(dialog.window);
943 static void prefs_receive_create(void)
947 GtkWidget *frame_incext;
948 GtkWidget *checkbtn_incext;
950 GtkWidget *label_incext;
951 GtkWidget *entry_incext;
952 /* GtkWidget *button_incext; */
954 GtkWidget *frame_spool;
955 GtkWidget *checkbtn_local;
956 GtkWidget *checkbtn_filter_on_inc;
957 GtkWidget *label_spool;
958 GtkWidget *entry_spool;
960 GtkWidget *hbox_autochk;
961 GtkWidget *checkbtn_autochk;
962 GtkWidget *label_autochk1;
963 GtkObject *spinbtn_autochk_adj;
964 GtkWidget *spinbtn_autochk;
965 GtkWidget *label_autochk2;
966 GtkWidget *checkbtn_chkonstartup;
967 GtkWidget *checkbtn_noerrorpanel;
968 GtkWidget *checkbtn_scan_after_inc;
971 GtkWidget *frame_news;
972 GtkWidget *label_maxarticle;
973 GtkWidget *spinbtn_maxarticle;
974 GtkObject *spinbtn_maxarticle_adj;
976 vbox1 = gtk_vbox_new (FALSE, VSPACING);
977 gtk_widget_show (vbox1);
978 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
979 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
981 PACK_FRAME(vbox1, frame_incext, _("External program"));
983 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
984 gtk_widget_show (vbox2);
985 gtk_container_add (GTK_CONTAINER (frame_incext), vbox2);
986 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
988 /* Use of external incorporation program */
989 PACK_CHECK_BUTTON (vbox2, checkbtn_incext,
990 _("Use external program for incorporation"));
992 hbox = gtk_hbox_new (FALSE, 8);
993 gtk_widget_show (hbox);
994 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
995 SET_TOGGLE_SENSITIVITY (checkbtn_incext, hbox);
997 label_incext = gtk_label_new (_("Command"));
998 gtk_widget_show (label_incext);
999 gtk_box_pack_start (GTK_BOX (hbox), label_incext, FALSE, FALSE, 0);
1001 entry_incext = gtk_entry_new ();
1002 gtk_widget_show (entry_incext);
1003 gtk_box_pack_start (GTK_BOX (hbox), entry_incext, TRUE, TRUE, 0);
1006 button_incext = gtk_button_new_with_label ("... ");
1007 gtk_widget_show (button_incext);
1008 gtk_box_pack_start (GTK_BOX (hbox), button_incext, FALSE, FALSE, 0);
1011 PACK_FRAME(vbox1, frame_spool, _("Local spool"));
1013 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1014 gtk_widget_show (vbox2);
1015 gtk_container_add (GTK_CONTAINER (frame_spool), vbox2);
1016 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1018 hbox = gtk_hbox_new (FALSE, 32);
1019 gtk_widget_show (hbox);
1020 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1022 PACK_CHECK_BUTTON (hbox, checkbtn_local, _("Incorporate from spool"));
1023 PACK_CHECK_BUTTON (hbox, checkbtn_filter_on_inc,
1024 _("Filter on incorporation"));
1025 SET_TOGGLE_SENSITIVITY (checkbtn_local, checkbtn_filter_on_inc);
1027 hbox = gtk_hbox_new (FALSE, 8);
1028 gtk_widget_show (hbox);
1029 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1030 SET_TOGGLE_SENSITIVITY (checkbtn_local, hbox);
1032 label_spool = gtk_label_new (_("Spool directory"));
1033 gtk_widget_show (label_spool);
1034 gtk_box_pack_start (GTK_BOX (hbox), label_spool, FALSE, FALSE, 0);
1036 entry_spool = gtk_entry_new ();
1037 gtk_widget_show (entry_spool);
1038 gtk_box_pack_start (GTK_BOX (hbox), entry_spool, TRUE, TRUE, 0);
1040 vbox2 = gtk_vbox_new (FALSE, 0);
1041 gtk_widget_show (vbox2);
1042 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1045 hbox_autochk = gtk_hbox_new (FALSE, 8);
1046 gtk_widget_show (hbox_autochk);
1047 gtk_box_pack_start (GTK_BOX (vbox2), hbox_autochk, FALSE, FALSE, 0);
1049 PACK_CHECK_BUTTON (hbox_autochk, checkbtn_autochk,
1050 _("Auto-check new mail"));
1052 label_autochk1 = gtk_label_new (_("every"));
1053 gtk_widget_show (label_autochk1);
1054 gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk1, FALSE, FALSE, 0);
1056 spinbtn_autochk_adj = gtk_adjustment_new (5, 1, 100, 1, 10, 10);
1057 spinbtn_autochk = gtk_spin_button_new
1058 (GTK_ADJUSTMENT (spinbtn_autochk_adj), 1, 0);
1059 gtk_widget_show (spinbtn_autochk);
1060 gtk_box_pack_start (GTK_BOX (hbox_autochk), spinbtn_autochk, FALSE, FALSE, 0);
1061 gtk_widget_set_usize (spinbtn_autochk, 64, -1);
1062 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_autochk), TRUE);
1064 label_autochk2 = gtk_label_new (_("minute(s)"));
1065 gtk_widget_show (label_autochk2);
1066 gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk2, FALSE, FALSE, 0);
1068 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk1);
1069 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, spinbtn_autochk);
1070 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk2);
1072 PACK_CHECK_BUTTON (vbox2, checkbtn_chkonstartup,
1073 _("Check new mail on startup"));
1075 PACK_CHECK_BUTTON (vbox2, checkbtn_noerrorpanel,
1076 _("No error popup on receive error"));
1077 PACK_CHECK_BUTTON (vbox2, checkbtn_scan_after_inc,
1078 _("Update all local folders after incorporation"));
1080 PACK_FRAME(vbox1, frame_news, _("News"));
1082 hbox = gtk_hbox_new (FALSE, 8);
1083 gtk_widget_show (hbox);
1084 gtk_container_add (GTK_CONTAINER (frame_news), hbox);
1085 gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
1087 label_maxarticle = gtk_label_new
1088 (_("Maximum number of articles to download\n"
1089 "(unlimited if 0 is specified)"));
1090 gtk_widget_show (label_maxarticle);
1091 gtk_box_pack_start (GTK_BOX (hbox), label_maxarticle, FALSE, FALSE, 0);
1092 gtk_label_set_justify (GTK_LABEL (label_maxarticle), GTK_JUSTIFY_LEFT);
1094 spinbtn_maxarticle_adj =
1095 gtk_adjustment_new (300, 0, 10000, 10, 100, 100);
1096 spinbtn_maxarticle = gtk_spin_button_new
1097 (GTK_ADJUSTMENT (spinbtn_maxarticle_adj), 10, 0);
1098 gtk_widget_show (spinbtn_maxarticle);
1099 gtk_box_pack_start (GTK_BOX (hbox), spinbtn_maxarticle,
1101 gtk_widget_set_usize (spinbtn_maxarticle, 64, -1);
1102 gtk_spin_button_set_numeric
1103 (GTK_SPIN_BUTTON (spinbtn_maxarticle), TRUE);
1105 receive.checkbtn_incext = checkbtn_incext;
1106 receive.entry_incext = entry_incext;
1107 /* receive.button_incext = button_incext; */
1109 receive.checkbtn_local = checkbtn_local;
1110 receive.checkbtn_filter_on_inc = checkbtn_filter_on_inc;
1111 receive.entry_spool = entry_spool;
1113 receive.checkbtn_autochk = checkbtn_autochk;
1114 receive.spinbtn_autochk = spinbtn_autochk;
1115 receive.spinbtn_autochk_adj = spinbtn_autochk_adj;
1117 receive.checkbtn_chkonstartup = checkbtn_chkonstartup;
1118 receive.checkbtn_noerrorpanel = checkbtn_noerrorpanel;
1119 receive.checkbtn_scan_after_inc = checkbtn_scan_after_inc;
1122 receive.spinbtn_maxarticle = spinbtn_maxarticle;
1123 receive.spinbtn_maxarticle_adj = spinbtn_maxarticle_adj;
1126 static void prefs_send_create(void)
1130 GtkWidget *frame_extsend;
1131 GtkWidget *vbox_extsend;
1132 GtkWidget *checkbtn_extsend;
1134 GtkWidget *label_extsend;
1135 GtkWidget *entry_extsend;
1136 /* GtkWidget *button_extsend; */
1137 GtkWidget *checkbtn_savemsg;
1138 GtkWidget *checkbtn_queuemsg;
1139 GtkWidget *label_outcharset;
1141 GtkWidget *optmenu_menu;
1142 GtkWidget *menuitem;
1143 GtkWidget *checkbtn_returnreceipt;
1144 GtkWidget *label_charset_desc;
1146 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1147 gtk_widget_show (vbox1);
1148 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1149 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1151 PACK_FRAME(vbox1, frame_extsend, _("External program"));
1153 vbox_extsend = gtk_vbox_new (FALSE, VSPACING_NARROW);
1154 gtk_widget_show (vbox_extsend);
1155 gtk_container_add (GTK_CONTAINER (frame_extsend), vbox_extsend);
1156 gtk_container_set_border_width (GTK_CONTAINER (vbox_extsend), 8);
1158 PACK_CHECK_BUTTON (vbox_extsend, checkbtn_extsend,
1159 _("Use external program for sending"));
1161 hbox1 = gtk_hbox_new (FALSE, 8);
1162 gtk_widget_show (hbox1);
1163 gtk_box_pack_start (GTK_BOX (vbox_extsend), hbox1, FALSE, FALSE, 0);
1164 SET_TOGGLE_SENSITIVITY(checkbtn_extsend, hbox1);
1166 label_extsend = gtk_label_new (_("Command"));
1167 gtk_widget_show (label_extsend);
1168 gtk_box_pack_start (GTK_BOX (hbox1), label_extsend, FALSE, FALSE, 0);
1170 entry_extsend = gtk_entry_new ();
1171 gtk_widget_show (entry_extsend);
1172 gtk_box_pack_start (GTK_BOX (hbox1), entry_extsend, TRUE, TRUE, 0);
1175 button_extsend = gtk_button_new_with_label ("... ");
1176 gtk_widget_show (button_extsend);
1177 gtk_box_pack_start (GTK_BOX (hbox1), button_extsend, FALSE, FALSE, 0);
1180 vbox2 = gtk_vbox_new (FALSE, 0);
1181 gtk_widget_show (vbox2);
1182 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1184 PACK_CHECK_BUTTON (vbox2, checkbtn_savemsg,
1185 _("Save sent messages to outbox"));
1186 PACK_CHECK_BUTTON (vbox2, checkbtn_queuemsg,
1187 _("Queue messages that fail to send"));
1188 PACK_CHECK_BUTTON (vbox2, checkbtn_returnreceipt,
1189 _("Send return receipt on request"));
1191 hbox1 = gtk_hbox_new (FALSE, 8);
1192 gtk_widget_show (hbox1);
1193 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1195 label_outcharset = gtk_label_new (_("Outgoing codeset"));
1196 gtk_widget_show (label_outcharset);
1197 gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, FALSE, FALSE, 0);
1199 optmenu = gtk_option_menu_new ();
1200 gtk_widget_show (optmenu);
1201 gtk_box_pack_start (GTK_BOX (hbox1), optmenu, FALSE, FALSE, 0);
1203 optmenu_menu = gtk_menu_new ();
1205 #define SET_MENUITEM(str, charset) \
1207 MENUITEM_ADD(optmenu_menu, menuitem, str, charset); \
1210 SET_MENUITEM(_("Automatic (Recommended)"), CS_AUTO);
1211 SET_MENUITEM(_("7bit ascii (US-ASCII)"), CS_US_ASCII);
1213 SET_MENUITEM(_("Unicode (UTF-8)"), CS_UTF_8);
1215 SET_MENUITEM(_("Western European (ISO-8859-1)"), CS_ISO_8859_1);
1216 SET_MENUITEM(_("Central European (ISO-8859-2)"), CS_ISO_8859_2);
1217 SET_MENUITEM(_("Baltic (ISO-8859-13)"), CS_ISO_8859_13);
1218 SET_MENUITEM(_("Baltic (ISO-8859-4)"), CS_ISO_8859_4);
1219 SET_MENUITEM(_("Greek (ISO-8859-7)"), CS_ISO_8859_7);
1220 SET_MENUITEM(_("Turkish (ISO-8859-9)"), CS_ISO_8859_9);
1222 SET_MENUITEM(_("Cyrillic (ISO-8859-5)"), CS_ISO_8859_5);
1224 SET_MENUITEM(_("Cyrillic (KOI8-R)"), CS_KOI8_R);
1226 SET_MENUITEM(_("Cyrillic (Windows-1251)"), CS_CP1251);
1227 SET_MENUITEM(_("Cyrillic (KOI8-U)"), CS_KOI8_U);
1229 SET_MENUITEM(_("Japanese (ISO-2022-JP)"), CS_ISO_2022_JP);
1231 SET_MENUITEM(_("Japanese (EUC-JP)"), CS_EUC_JP);
1232 SET_MENUITEM(_("Japanese (Shift_JIS)"), CS_SHIFT_JIS);
1234 SET_MENUITEM(_("Simplified Chinese (GB2312)"), CS_GB2312);
1235 SET_MENUITEM(_("Traditional Chinese (Big5)"), CS_BIG5);
1237 SET_MENUITEM(_("Traditional Chinese (EUC-TW)"), CS_EUC_TW);
1238 SET_MENUITEM(_("Chinese (ISO-2022-CN)"), CS_ISO_2022_CN);
1240 SET_MENUITEM(_("Korean (EUC-KR)"), CS_EUC_KR);
1241 SET_MENUITEM(_("Thai (TIS-620)"), CS_TIS_620);
1242 SET_MENUITEM(_("Thai (Windows-874)"), CS_WINDOWS_874);
1244 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
1246 hbox1 = gtk_hbox_new (FALSE, 8);
1247 gtk_widget_show (hbox1);
1248 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1250 label_charset_desc = gtk_label_new
1251 (_("If `Automatic' is selected, the optimal encoding\n"
1252 "for the current locale will be used."));
1253 gtk_widget_show (label_charset_desc);
1254 gtk_box_pack_start (GTK_BOX (hbox1), label_charset_desc,
1256 gtk_label_set_justify(GTK_LABEL (label_charset_desc), GTK_JUSTIFY_LEFT);
1258 send.checkbtn_extsend = checkbtn_extsend;
1259 send.entry_extsend = entry_extsend;
1260 /* send.button_extsend = button_extsend; */
1262 send.checkbtn_savemsg = checkbtn_savemsg;
1263 send.checkbtn_queuemsg = checkbtn_queuemsg;
1264 send.checkbtn_returnreceipt = checkbtn_returnreceipt;
1266 send.optmenu_charset = optmenu;
1270 static void prefs_dictionary_set_data_from_optmenu(PrefParam *param)
1273 gchar *dict_fullname;
1275 g_return_if_fail(param);
1276 g_return_if_fail(param->data);
1277 g_return_if_fail(param->widget);
1278 g_return_if_fail(*(param->widget));
1280 dict_fullname = gtkpspell_get_dictionary_menu_active_item
1281 (gtk_option_menu_get_menu(GTK_OPTION_MENU(*(param->widget))));
1282 str = *((gchar **) param->data);
1285 *((gchar **) param->data) = dict_fullname;
1288 static void prefs_dictionary_set_optmenu(PrefParam *pparam)
1291 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
1293 GtkWidget *menuitem;
1297 g_return_if_fail(optmenu != NULL);
1298 g_return_if_fail(pparam->data != NULL);
1300 if (*(gchar **) pparam->data) {
1301 menu = gtk_option_menu_get_menu(optmenu);
1302 for (cur = GTK_MENU_SHELL(menu)->children;
1303 cur != NULL; cur = cur->next) {
1304 menuitem = GTK_WIDGET(cur->data);
1305 dict_name = gtk_object_get_data(GTK_OBJECT(menuitem),
1307 if (!strcmp2(dict_name, *((gchar **)pparam->data))) {
1308 gtk_option_menu_set_history(optmenu, n);
1315 gtk_option_menu_set_history(optmenu, 0);
1316 prefs_dictionary_set_data_from_optmenu(pparam);
1319 static void prefs_speller_sugmode_set_data_from_optmenu(PrefParam *param)
1322 g_return_if_fail(param);
1323 g_return_if_fail(param->data);
1324 g_return_if_fail(param->widget);
1325 g_return_if_fail(*(param->widget));
1327 sugmode = gtkpspell_get_sugmode_from_option_menu
1328 (GTK_OPTION_MENU(*(param->widget)));
1329 *((gint *) param->data) = sugmode;
1332 static void prefs_speller_sugmode_set_optmenu(PrefParam *pparam)
1334 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
1336 GtkWidget *menuitem;
1339 g_return_if_fail(optmenu != NULL);
1340 g_return_if_fail(pparam->data != NULL);
1342 sugmode = *(gint *) pparam->data;
1343 gtkpspell_sugmode_option_menu_set(optmenu, sugmode);
1347 static void prefs_spelling_checkbtn_enable_pspell_toggle_cb
1353 toggled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
1355 gtk_widget_set_sensitive(spelling.entry_pspell_path, toggled);
1356 gtk_widget_set_sensitive(spelling.optmenu_dictionary, toggled);
1357 gtk_widget_set_sensitive(spelling.optmenu_sugmode, toggled);
1358 gtk_widget_set_sensitive(spelling.btn_pspell_path, toggled);
1359 gtk_widget_set_sensitive(spelling.misspelled_btn, toggled);
1360 gtk_widget_set_sensitive(spelling.checkbtn_use_alternate, toggled);
1361 gtk_widget_set_sensitive(spelling.checkbtn_check_while_typing, toggled);
1364 static void prefs_spelling_btn_pspell_path_clicked_cb(GtkWidget *widget,
1367 gchar *file_path, *tmp;
1368 GtkWidget *new_menu;
1370 file_path = filesel_select_file(_("Select dictionaries location"),
1371 prefs_common.pspell_path);
1372 if (file_path == NULL) {
1376 tmp=g_dirname(file_path);
1378 if (prefs_common.pspell_path)
1379 g_free(prefs_common.pspell_path);
1380 prefs_common.pspell_path = g_strdup_printf("%s%s",tmp,
1383 new_menu = gtkpspell_dictionary_option_menu_new(prefs_common.pspell_path);
1384 gtk_option_menu_set_menu(GTK_OPTION_MENU(spelling.optmenu_dictionary),
1387 gtk_entry_set_text(GTK_ENTRY(spelling.entry_pspell_path),
1388 prefs_common.pspell_path);
1389 /* select first one */
1390 gtk_option_menu_set_history(GTK_OPTION_MENU(
1391 spelling.optmenu_dictionary), 0);
1393 if (prefs_common.dictionary)
1394 g_free(prefs_common.dictionary);
1396 prefs_common.dictionary =
1397 gtkpspell_get_dictionary_menu_active_item(
1398 gtk_option_menu_get_menu(
1400 spelling.optmenu_dictionary)));
1406 static void prefs_spelling_create()
1409 GtkWidget *frame_spell;
1410 GtkWidget *hbox_spell;
1411 GtkWidget *vbox_spell;
1412 GtkWidget *hbox_pspell_path;
1413 GtkWidget *checkbtn_enable_pspell;
1414 GtkWidget *label_pspell_path;
1415 GtkWidget *entry_pspell_path;
1416 GtkWidget *btn_pspell_path;
1417 GtkWidget *spell_table;
1418 GtkWidget *label_dictionary;
1419 GtkWidget *optmenu_dictionary;
1420 GtkWidget *sugmode_label;
1421 GtkWidget *sugmode_optmenu;
1422 GtkWidget *checkbtn_use_alternate;
1423 GtkWidget *help_label;
1424 GtkWidget *checkbtn_check_while_typing;
1425 GtkWidget *color_label;
1426 GtkWidget *hbox_col;
1427 GtkWidget *col_align;
1431 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1432 gtk_widget_show (vbox1);
1433 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1434 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1436 /* spell checker defaults */
1437 PACK_FRAME(vbox1, frame_spell, _("Global spelling checker settings"));
1438 vbox_spell = gtk_vbox_new(FALSE, VSPACING_NARROW);
1439 gtk_widget_show (vbox_spell);
1440 gtk_container_add(GTK_CONTAINER(frame_spell), vbox_spell);
1441 gtk_container_set_border_width(GTK_CONTAINER(vbox_spell), 8);
1443 PACK_CHECK_BUTTON(vbox_spell, checkbtn_enable_pspell,
1444 _("Enable spell checker (EXPERIMENTAL)"));
1446 gtk_signal_connect(GTK_OBJECT(checkbtn_enable_pspell), "toggled",
1447 GTK_SIGNAL_FUNC(prefs_spelling_checkbtn_enable_pspell_toggle_cb),
1450 /* Check while typing */
1451 PACK_CHECK_BUTTON(vbox_spell, checkbtn_check_while_typing,
1452 _("Check while typing"));
1454 PACK_CHECK_BUTTON(vbox_spell, checkbtn_use_alternate,
1455 _("Enable alternate dictionary"));
1457 help_label = gtk_label_new(_("Enabling alternate dictionary makes switching\nwith the last used dictionary faster."));
1458 gtk_widget_show(help_label);
1459 gtk_box_pack_start(GTK_BOX(vbox_spell), help_label, FALSE, TRUE, 0);
1461 spell_table = gtk_table_new(4, 3, FALSE);
1462 gtk_container_set_border_width (GTK_CONTAINER (spell_table), VSPACING);
1463 gtk_table_set_row_spacings(GTK_TABLE(spell_table), 8);
1464 gtk_table_set_col_spacings(GTK_TABLE(spell_table), 8);
1466 gtk_box_pack_start(GTK_BOX(vbox_spell), spell_table, TRUE, TRUE, 0);
1468 label_pspell_path = gtk_label_new (_("Dictionaries path:"));
1469 gtk_misc_set_alignment(GTK_MISC(label_pspell_path), 1.0, 0.5);
1470 gtk_widget_show(label_pspell_path);
1471 gtk_table_attach (GTK_TABLE (spell_table), label_pspell_path, 0, 1, 0,
1472 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1474 hbox_pspell_path = gtk_hbox_new (FALSE, 8);
1475 gtk_table_attach (GTK_TABLE (spell_table), hbox_pspell_path, 1, 2, 0,
1476 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1477 gtk_widget_show(hbox_pspell_path);
1479 entry_pspell_path = gtk_entry_new();
1480 gtk_widget_show(entry_pspell_path);
1481 gtk_box_pack_start(GTK_BOX(hbox_pspell_path), entry_pspell_path, TRUE,
1484 gtk_widget_set_sensitive(entry_pspell_path, prefs_common.enable_pspell);
1486 btn_pspell_path = gtk_button_new_with_label(" ... ");
1487 gtk_widget_show(btn_pspell_path);
1488 gtk_box_pack_start(GTK_BOX(hbox_pspell_path), btn_pspell_path, FALSE, FALSE, 0);
1489 gtk_widget_set_sensitive(btn_pspell_path, prefs_common.enable_pspell);
1491 gtk_signal_connect(GTK_OBJECT(btn_pspell_path), "clicked",
1492 GTK_SIGNAL_FUNC(prefs_spelling_btn_pspell_path_clicked_cb),
1495 label_dictionary = gtk_label_new(_("Default dictionary:"));
1496 gtk_misc_set_alignment(GTK_MISC(label_dictionary), 1.0, 0.5);
1497 gtk_widget_show(label_dictionary);
1498 gtk_table_attach (GTK_TABLE (spell_table), label_dictionary, 0, 1, 1, 2,
1499 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1501 optmenu_dictionary = gtk_option_menu_new();
1502 gtk_widget_show(optmenu_dictionary);
1503 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_dictionary),
1504 gtkpspell_dictionary_option_menu_new(
1505 prefs_common.pspell_path));
1506 gtk_table_attach (GTK_TABLE (spell_table), optmenu_dictionary, 1, 2, 1,
1507 2, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1508 gtk_widget_set_sensitive(optmenu_dictionary, prefs_common.enable_pspell);
1510 /* Suggestion mode */
1511 sugmode_label = gtk_label_new(_("Default suggestion mode"));
1512 gtk_misc_set_alignment(GTK_MISC(sugmode_label), 1.0, 0.5);
1513 gtk_widget_show(sugmode_label);
1514 gtk_table_attach(GTK_TABLE (spell_table), sugmode_label, 0, 1, 2, 3,
1515 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1517 sugmode_optmenu = gtk_option_menu_new();
1518 gtk_widget_show(sugmode_optmenu);
1519 gtk_option_menu_set_menu(GTK_OPTION_MENU(sugmode_optmenu),
1520 gtkpspell_sugmode_option_menu_new(prefs_common.pspell_sugmode));
1521 gtk_table_attach(GTK_TABLE(spell_table), sugmode_optmenu, 1, 2, 2, 3,
1522 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1523 gtk_widget_set_sensitive(sugmode_optmenu, prefs_common.enable_pspell);
1526 color_label = gtk_label_new(_("Misspelled word color:"));
1527 gtk_misc_set_alignment(GTK_MISC(color_label), 1.0, 0.5);
1528 gtk_table_attach (GTK_TABLE (spell_table), color_label, 0, 1, 3, 4,
1529 GTK_FILL, GTK_SHRINK, 0, 0);
1530 gtk_widget_show(color_label);
1532 col_align = gtk_alignment_new(0.0, 0.5, 0, 0);
1533 gtk_widget_show(col_align);
1534 gtk_table_attach (GTK_TABLE (spell_table), col_align, 1, 2, 3, 4,
1535 GTK_FILL, GTK_SHRINK, 0, 0);
1537 spelling.misspelled_btn = gtk_button_new_with_label ("");
1538 set_button_bg_color(spelling.misspelled_btn,
1539 prefs_common.misspelled_col);
1540 gtk_widget_set_usize (spelling.misspelled_btn, 30, 20);
1541 gtk_widget_set_sensitive(spelling.misspelled_btn, prefs_common.enable_pspell);
1542 gtk_signal_connect (GTK_OBJECT (spelling.misspelled_btn), "clicked",
1543 GTK_SIGNAL_FUNC(quote_color_set_dialog), "Misspelled word");
1544 gtk_container_add(GTK_CONTAINER(col_align), spelling.misspelled_btn);
1547 spelling.checkbtn_enable_pspell = checkbtn_enable_pspell;
1548 spelling.entry_pspell_path = entry_pspell_path;
1549 spelling.btn_pspell_path = btn_pspell_path;
1550 spelling.optmenu_dictionary = optmenu_dictionary;
1551 spelling.optmenu_sugmode = sugmode_optmenu;
1552 spelling.checkbtn_use_alternate = checkbtn_use_alternate;
1553 spelling.checkbtn_check_while_typing = checkbtn_check_while_typing;
1559 static void prefs_compose_create(void)
1566 GtkWidget *btn_quotefmt;
1568 GtkWidget *frame_sig;
1569 GtkWidget *vbox_sig;
1570 GtkWidget *checkbtn_autosig;
1571 GtkWidget *label_sigsep;
1572 GtkWidget *entry_sigsep;
1574 GtkWidget *frame_editor;
1575 GtkWidget *hbox_editor;
1576 GtkWidget *checkbtn_autoextedit;
1578 GtkWidget *frame_autosel;
1579 GtkWidget *hbox_autosel;
1580 GtkWidget *vbox_autosel;
1581 GtkWidget *checkbtn_reply_account_autosel;
1582 GtkWidget *checkbtn_forward_account_autosel;
1583 GtkWidget *checkbtn_reedit_account_autosel;
1585 GtkWidget *hbox_undolevel;
1586 GtkWidget *label_undolevel;
1587 GtkObject *spinbtn_undolevel_adj;
1588 GtkWidget *spinbtn_undolevel;
1590 GtkWidget *vbox_linewrap;
1595 GtkWidget *label_linewrap;
1596 GtkObject *spinbtn_linewrap_adj;
1597 GtkWidget *spinbtn_linewrap;
1598 GtkWidget *checkbtn_wrapquote;
1599 GtkWidget *checkbtn_wrapatsend;
1601 GtkWidget *frame_reply;
1602 GtkWidget *checkbtn_quote;
1603 GtkWidget *checkbtn_forward_as_attachment;
1604 GtkWidget *checkbtn_smart_wrapping;
1605 GtkWidget *checkbtn_block_cursor;
1607 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1608 gtk_widget_show (vbox1);
1609 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1610 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1614 hbox1 = gtk_hbox_new (FALSE, 32);
1615 gtk_widget_show (hbox1);
1617 hbox2 = gtk_hbox_new (FALSE, 8);
1618 gtk_widget_show (hbox2);
1619 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
1622 hbox1 = gtk_hbox_new (FALSE, 32);
1623 gtk_widget_show (hbox1);
1624 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1626 PACK_FRAME(vbox1, frame_sig, _("Signature"));
1628 vbox_sig = gtk_vbox_new (FALSE, VSPACING_NARROW);
1629 gtk_widget_show (vbox_sig);
1630 gtk_container_add (GTK_CONTAINER (frame_sig), vbox_sig);
1631 gtk_container_set_border_width (GTK_CONTAINER (vbox_sig), 8);
1633 PACK_CHECK_BUTTON (vbox_sig, checkbtn_autosig,
1634 _("Insert signature automatically"));
1636 hbox1 = gtk_hbox_new (FALSE, 8);
1637 gtk_widget_show (hbox1);
1638 gtk_box_pack_start (GTK_BOX (vbox_sig), hbox1, TRUE, TRUE, 0);
1639 label_sigsep = gtk_label_new (_("Signature separator"));
1640 gtk_widget_show (label_sigsep);
1641 gtk_box_pack_start (GTK_BOX (hbox1), label_sigsep, FALSE, FALSE, 0);
1643 entry_sigsep = gtk_entry_new ();
1644 gtk_widget_show (entry_sigsep);
1645 gtk_box_pack_start (GTK_BOX (hbox1), entry_sigsep, FALSE, FALSE, 0);
1647 gtk_widget_set_usize (entry_sigsep, 64, -1);
1649 /* Account autoselection */
1650 PACK_FRAME(vbox1, frame_autosel, _("Automatic Account Selection"));
1652 hbox_autosel = gtk_hbox_new (FALSE, VSPACING_NARROW);
1653 gtk_widget_show (hbox_autosel);
1654 gtk_container_add (GTK_CONTAINER (frame_autosel), hbox_autosel);
1655 gtk_container_set_border_width (GTK_CONTAINER (hbox_autosel), 8);
1657 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reply_account_autosel,
1658 _("when replying"));
1659 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_forward_account_autosel,
1660 _("when forwarding"));
1661 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reedit_account_autosel,
1662 _("when re-editing"));
1664 vbox2 = gtk_vbox_new (FALSE, 0);
1665 gtk_widget_show (vbox2);
1666 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1668 PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
1669 _("Automatically launch the external editor"));
1671 PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
1674 vbox_linewrap = gtk_vbox_new (FALSE, VSPACING_NARROW);
1675 gtk_widget_show (vbox_linewrap);
1676 gtk_box_pack_start (GTK_BOX (vbox1), vbox_linewrap, FALSE, FALSE, 0);
1678 hbox3 = gtk_hbox_new (FALSE, 8);
1679 gtk_widget_show (hbox3);
1680 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox3, FALSE, FALSE, 0);
1683 label_linewrap = gtk_label_new (_("Wrap messages at"));
1684 gtk_widget_show (label_linewrap);
1685 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1687 spinbtn_linewrap_adj = gtk_adjustment_new (72, 20, 1024, 1, 10, 10);
1688 spinbtn_linewrap = gtk_spin_button_new
1689 (GTK_ADJUSTMENT (spinbtn_linewrap_adj), 1, 0);
1690 gtk_widget_show (spinbtn_linewrap);
1691 gtk_box_pack_start (GTK_BOX (hbox3), spinbtn_linewrap, FALSE, FALSE, 0);
1692 gtk_widget_set_usize (spinbtn_linewrap, 64, -1);
1693 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linewrap), TRUE);
1695 label_linewrap = gtk_label_new (_("characters"));
1696 gtk_widget_show (label_linewrap);
1697 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1699 PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
1701 hbox4 = gtk_hbox_new (FALSE, 32);
1702 gtk_widget_show (hbox4);
1703 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox4, FALSE, FALSE, 0);
1705 PACK_CHECK_BUTTON (hbox4, checkbtn_wrapquote, _("Wrap quotation"));
1707 (hbox4, checkbtn_wrapatsend, _("Wrap before sending"));
1709 PACK_CHECK_BUTTON (vbox1, checkbtn_forward_as_attachment,
1710 _("Forward as attachment"));
1712 PACK_CHECK_BUTTON (vbox1, checkbtn_smart_wrapping,
1713 _("Smart wrapping (EXPERIMENTAL)"));
1715 PACK_CHECK_BUTTON (vbox1, checkbtn_block_cursor,
1718 PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
1720 hbox_undolevel = gtk_hbox_new (FALSE, 8);
1721 gtk_widget_show (hbox3);
1722 gtk_box_pack_start (GTK_BOX (vbox1), hbox_undolevel, FALSE, FALSE, 0);
1724 label_undolevel = gtk_label_new (_("Undo level"));
1725 gtk_widget_show (label_undolevel);
1726 gtk_box_pack_start (GTK_BOX (hbox_undolevel), label_undolevel, FALSE, FALSE, 0);
1728 spinbtn_undolevel_adj = gtk_adjustment_new (50, 0, 100, 1, 10, 10);
1729 spinbtn_undolevel = gtk_spin_button_new
1730 (GTK_ADJUSTMENT (spinbtn_undolevel_adj), 1, 0);
1731 gtk_widget_show (spinbtn_undolevel);
1732 gtk_box_pack_start (GTK_BOX (hbox_undolevel), spinbtn_undolevel, FALSE, FALSE, 0);
1733 gtk_widget_set_usize (spinbtn_undolevel, 64, -1);
1734 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevel), TRUE);
1737 compose.checkbtn_quote = checkbtn_quote;
1738 compose.entry_quotemark = entry_quotemark;
1739 compose.text_quotefmt = text_quotefmt;
1741 compose.checkbtn_autosig = checkbtn_autosig;
1742 compose.entry_sigsep = entry_sigsep;
1744 compose.checkbtn_autoextedit = checkbtn_autoextedit;
1746 compose.checkbtn_reply_account_autosel = checkbtn_reply_account_autosel;
1747 compose.checkbtn_forward_account_autosel = checkbtn_forward_account_autosel;
1748 compose.checkbtn_reedit_account_autosel = checkbtn_reedit_account_autosel;
1750 compose.spinbtn_undolevel = spinbtn_undolevel;
1751 compose.spinbtn_undolevel_adj = spinbtn_undolevel_adj;
1753 compose.spinbtn_linewrap = spinbtn_linewrap;
1754 compose.spinbtn_linewrap_adj = spinbtn_linewrap_adj;
1755 compose.checkbtn_wrapquote = checkbtn_wrapquote;
1756 compose.checkbtn_wrapatsend = checkbtn_wrapatsend;
1758 compose.checkbtn_forward_as_attachment =
1759 checkbtn_forward_as_attachment;
1760 compose.checkbtn_smart_wrapping =
1761 checkbtn_smart_wrapping;
1762 compose.checkbtn_block_cursor =
1763 checkbtn_block_cursor;
1767 static void prefs_quote_create(void)
1770 GtkWidget *frame_quote;
1771 GtkWidget *vbox_quote;
1774 GtkWidget *label_quotemark;
1775 GtkWidget *entry_quotemark;
1776 GtkWidget *scrolledwin_quotefmt;
1777 GtkWidget *text_quotefmt;
1779 GtkWidget *entry_fw_quotemark;
1780 GtkWidget *text_fw_quotefmt;
1782 GtkWidget *btn_quotedesc;
1784 GtkWidget *checkbtn_reply_with_quote;
1786 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1787 gtk_widget_show (vbox1);
1788 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1789 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1793 PACK_CHECK_BUTTON (vbox1, checkbtn_reply_with_quote, _("Reply will quote by default"));
1795 PACK_FRAME (vbox1, frame_quote, _("Reply format"));
1797 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
1798 gtk_widget_show (vbox_quote);
1799 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
1800 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
1802 hbox1 = gtk_hbox_new (FALSE, 32);
1803 gtk_widget_show (hbox1);
1804 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
1806 hbox2 = gtk_hbox_new (FALSE, 8);
1807 gtk_widget_show (hbox2);
1808 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
1810 label_quotemark = gtk_label_new (_("Quotation mark"));
1811 gtk_widget_show (label_quotemark);
1812 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
1814 entry_quotemark = gtk_entry_new ();
1815 gtk_widget_show (entry_quotemark);
1816 gtk_box_pack_start (GTK_BOX (hbox2), entry_quotemark, FALSE, FALSE, 0);
1817 gtk_widget_set_usize (entry_quotemark, 64, -1);
1819 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
1820 gtk_widget_show (scrolledwin_quotefmt);
1821 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
1822 gtk_scrolled_window_set_policy
1823 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
1824 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
1826 text_quotefmt = gtk_text_new (NULL, NULL);
1827 gtk_widget_show (text_quotefmt);
1828 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt), text_quotefmt);
1829 gtk_text_set_editable (GTK_TEXT (text_quotefmt), TRUE);
1830 gtk_widget_set_usize(text_quotefmt, -1, 60);
1834 PACK_FRAME (vbox1, frame_quote, _("Forward format"));
1836 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
1837 gtk_widget_show (vbox_quote);
1838 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
1839 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
1841 hbox1 = gtk_hbox_new (FALSE, 32);
1842 gtk_widget_show (hbox1);
1843 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
1845 hbox2 = gtk_hbox_new (FALSE, 8);
1846 gtk_widget_show (hbox2);
1847 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
1849 label_quotemark = gtk_label_new (_("Quotation mark"));
1850 gtk_widget_show (label_quotemark);
1851 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
1853 entry_fw_quotemark = gtk_entry_new ();
1854 gtk_widget_show (entry_fw_quotemark);
1855 gtk_box_pack_start (GTK_BOX (hbox2), entry_fw_quotemark,
1857 gtk_widget_set_usize (entry_fw_quotemark, 64, -1);
1859 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
1860 gtk_widget_show (scrolledwin_quotefmt);
1861 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
1862 gtk_scrolled_window_set_policy
1863 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
1864 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
1866 text_fw_quotefmt = gtk_text_new (NULL, NULL);
1867 gtk_widget_show (text_fw_quotefmt);
1868 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt),
1870 gtk_text_set_editable (GTK_TEXT (text_fw_quotefmt), TRUE);
1871 gtk_widget_set_usize(text_fw_quotefmt, -1, 60);
1873 hbox1 = gtk_hbox_new (FALSE, 32);
1874 gtk_widget_show (hbox1);
1875 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1878 gtk_button_new_with_label (_(" Description of symbols "));
1879 gtk_widget_show (btn_quotedesc);
1880 gtk_box_pack_start (GTK_BOX (hbox1), btn_quotedesc, FALSE, FALSE, 0);
1881 gtk_signal_connect(GTK_OBJECT(btn_quotedesc), "clicked",
1882 GTK_SIGNAL_FUNC(quote_fmt_quote_description), NULL);
1884 compose.checkbtn_reply_with_quote= checkbtn_reply_with_quote;
1885 quote.entry_quotemark = entry_quotemark;
1886 quote.text_quotefmt = text_quotefmt;
1887 quote.entry_fw_quotemark = entry_fw_quotemark;
1888 quote.text_fw_quotefmt = text_fw_quotefmt;
1891 static void prefs_display_create(void)
1894 GtkWidget *frame_font;
1896 GtkWidget *label_textfont;
1897 GtkWidget *entry_textfont;
1898 GtkWidget *button_textfont;
1899 GtkWidget *chkbtn_folder_unread;
1900 GtkWidget *chkbtn_transhdr;
1901 GtkWidget *frame_summary;
1903 GtkWidget *chkbtn_swapfrom;
1904 GtkWidget *chkbtn_hscrollbar;
1905 GtkWidget *chkbtn_useaddrbook;
1906 GtkWidget *chkbtn_expand_thread;
1907 GtkWidget *chkbtn_bold_unread;
1910 GtkWidget *label_datefmt;
1911 GtkWidget *button_datefmt;
1912 GtkWidget *entry_datefmt;
1913 GtkWidget *button_dispitem;
1914 GtkWidget *tmplabel, *tmpbutton, *tmpentry;
1916 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1917 gtk_widget_show (vbox1);
1918 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1919 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1921 PACK_FRAME(vbox1, frame_font, _("Font"));
1923 table1 = gtk_table_new (4, 3, FALSE);
1925 gtk_widget_show (table1);
1926 gtk_container_add (GTK_CONTAINER (frame_font), table1);
1927 gtk_container_set_border_width (GTK_CONTAINER (table1), 8);
1928 gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
1929 gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
1931 label_textfont = gtk_label_new (_("Text"));
1932 gtk_misc_set_alignment(GTK_MISC(label_textfont), 0, 0.5);
1933 gtk_widget_show (label_textfont);
1934 gtk_table_attach (GTK_TABLE (table1), label_textfont, 0, 1, 0, 1,
1935 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1937 entry_textfont = gtk_entry_new ();
1938 gtk_widget_show (entry_textfont);
1939 gtk_table_attach (GTK_TABLE (table1), entry_textfont, 1, 2, 0, 1,
1940 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
1942 button_textfont = gtk_button_new_with_label (" ... ");
1944 gtk_widget_show (button_textfont);
1945 gtk_table_attach (GTK_TABLE (table1), button_textfont, 2, 3, 0, 1,
1947 gtk_signal_connect (GTK_OBJECT (button_textfont), "clicked",
1948 GTK_SIGNAL_FUNC (prefs_font_select), entry_textfont);
1950 tmplabel = gtk_label_new (_("Small"));
1951 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
1952 gtk_widget_show (tmplabel);
1953 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 1, 2,
1954 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1956 tmpentry = gtk_entry_new ();
1957 gtk_widget_show (tmpentry);
1958 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 1, 2,
1959 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
1961 tmpbutton = gtk_button_new_with_label (" ... ");
1962 gtk_widget_show (tmpbutton);
1963 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 1, 2,
1965 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
1966 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
1967 display.entry_smallfont = tmpentry;
1969 tmplabel = gtk_label_new (_("Normal"));
1970 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
1971 gtk_widget_show (tmplabel);
1972 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 2, 3,
1973 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1975 tmpentry = gtk_entry_new ();
1976 gtk_widget_show (tmpentry);
1977 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 2, 3,
1978 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
1980 tmpbutton = gtk_button_new_with_label (" ... ");
1981 gtk_widget_show (tmpbutton);
1982 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 2, 3,
1984 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
1985 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
1986 display.entry_normalfont = tmpentry;
1988 tmplabel = gtk_label_new (_("Bold"));
1989 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
1990 gtk_widget_show (tmplabel);
1991 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 3, 4,
1992 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1994 tmpentry = gtk_entry_new ();
1995 gtk_widget_show (tmpentry);
1996 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 3, 4,
1997 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
1999 tmpbutton = gtk_button_new_with_label (" ... ");
2000 gtk_widget_show (tmpbutton);
2001 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 3, 4,
2003 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2004 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2005 display.entry_boldfont = tmpentry;
2007 vbox2 = gtk_vbox_new (FALSE, 0);
2008 gtk_widget_show (vbox2);
2009 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, TRUE, 0);
2012 (vbox2, chkbtn_transhdr,
2013 _("Translate header name (such as `From:', `Subject:')"));
2015 PACK_CHECK_BUTTON (vbox2, chkbtn_folder_unread,
2016 _("Display unread number next to folder name"));
2018 /* ---- Summary ---- */
2020 PACK_FRAME(vbox1, frame_summary, _("Summary View"));
2022 vbox2 = gtk_vbox_new (FALSE, 0);
2023 gtk_widget_show (vbox2);
2024 gtk_container_add (GTK_CONTAINER (frame_summary), vbox2);
2025 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
2028 (vbox2, chkbtn_swapfrom,
2029 _("Display recipient on `From' column if sender is yourself"));
2031 (vbox2, chkbtn_useaddrbook,
2032 _("Display sender using address book"));
2034 (vbox2, chkbtn_hscrollbar, _("Enable horizontal scroll bar"));
2036 (vbox2, chkbtn_expand_thread, _("Expand threads"));
2038 (vbox2, chkbtn_bold_unread,
2039 _("Display unread messages with bold font"));
2041 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2043 hbox1 = gtk_hbox_new (FALSE, 8);
2044 gtk_widget_show (hbox1);
2045 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2047 label_datefmt = gtk_label_new (_("Date format"));
2048 gtk_widget_show (label_datefmt);
2049 gtk_box_pack_start (GTK_BOX (hbox1), label_datefmt, FALSE, FALSE, 0);
2051 entry_datefmt = gtk_entry_new ();
2052 gtk_widget_show (entry_datefmt);
2053 gtk_box_pack_start (GTK_BOX (hbox1), entry_datefmt, TRUE, TRUE, 0);
2055 button_datefmt = gtk_button_new_with_label (" ... ");
2057 gtk_widget_show (button_datefmt);
2058 gtk_box_pack_start (GTK_BOX (hbox1), button_datefmt, FALSE, FALSE, 0);
2059 gtk_signal_connect (GTK_OBJECT (button_datefmt), "clicked",
2060 GTK_SIGNAL_FUNC (date_format_create), NULL);
2062 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
2064 hbox1 = gtk_hbox_new (FALSE, 8);
2065 gtk_widget_show (hbox1);
2066 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2068 button_dispitem = gtk_button_new_with_label
2069 (_(" Set display item of summary... "));
2070 gtk_widget_show (button_dispitem);
2071 gtk_box_pack_start (GTK_BOX (hbox1), button_dispitem, FALSE, TRUE, 0);
2072 gtk_signal_connect (GTK_OBJECT (button_dispitem), "clicked",
2073 GTK_SIGNAL_FUNC (prefs_summary_column_open),
2076 display.entry_textfont = entry_textfont;
2077 display.button_textfont = button_textfont;
2079 display.chkbtn_folder_unread = chkbtn_folder_unread;
2080 display.chkbtn_transhdr = chkbtn_transhdr;
2082 display.chkbtn_swapfrom = chkbtn_swapfrom;
2083 display.chkbtn_hscrollbar = chkbtn_hscrollbar;
2084 display.chkbtn_expand_thread = chkbtn_expand_thread;
2085 display.chkbtn_bold_unread = chkbtn_bold_unread;
2086 display.chkbtn_useaddrbook = chkbtn_useaddrbook;
2087 display.entry_datefmt = entry_datefmt;
2090 static void prefs_message_create(void)
2096 GtkWidget *chkbtn_enablecol;
2097 GtkWidget *button_edit_col;
2098 GtkWidget *chkbtn_mbalnum;
2099 GtkWidget *chkbtn_disphdrpane;
2100 GtkWidget *chkbtn_disphdr;
2101 GtkWidget *button_edit_disphdr;
2102 GtkWidget *hbox_linespc;
2103 GtkWidget *label_linespc;
2104 GtkObject *spinbtn_linespc_adj;
2105 GtkWidget *spinbtn_linespc;
2106 GtkWidget *chkbtn_headspc;
2108 GtkWidget *frame_scr;
2109 GtkWidget *vbox_scr;
2110 GtkWidget *chkbtn_smoothscroll;
2111 GtkWidget *hbox_scr;
2112 GtkWidget *label_scr;
2113 GtkObject *spinbtn_scrollstep_adj;
2114 GtkWidget *spinbtn_scrollstep;
2115 GtkWidget *chkbtn_halfpage;
2117 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2118 gtk_widget_show (vbox1);
2119 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2120 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2122 hbox1 = gtk_hbox_new (FALSE, 8);
2123 gtk_widget_show (hbox1);
2124 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, TRUE, 0);
2126 PACK_CHECK_BUTTON (hbox1, chkbtn_enablecol,
2127 _("Enable coloration of message"));
2128 gtk_signal_connect (GTK_OBJECT (chkbtn_enablecol), "toggled",
2129 GTK_SIGNAL_FUNC (prefs_enable_message_color_toggled),
2132 button_edit_col = gtk_button_new_with_label (_(" Edit... "));
2133 gtk_widget_show (button_edit_col);
2134 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_col, FALSE, TRUE, 0);
2135 gtk_signal_connect (GTK_OBJECT (button_edit_col), "clicked",
2136 GTK_SIGNAL_FUNC (prefs_quote_colors_dialog), NULL);
2138 SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, button_edit_col);
2140 vbox2 = gtk_vbox_new (FALSE, 0);
2141 gtk_widget_show (vbox2);
2142 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2145 (vbox2, chkbtn_mbalnum,
2146 _("Display 2-byte alphabet and numeric with 1-byte character"));
2147 PACK_CHECK_BUTTON(vbox2, chkbtn_disphdrpane,
2148 _("Display header pane above message view"));
2150 hbox1 = gtk_hbox_new (FALSE, 8);
2151 gtk_widget_show (hbox1);
2152 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2154 PACK_CHECK_BUTTON(hbox1, chkbtn_disphdr,
2155 _("Display short headers on message view"));
2157 button_edit_disphdr = gtk_button_new_with_label (_(" Edit... "));
2158 gtk_widget_show (button_edit_disphdr);
2159 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_disphdr,
2161 gtk_signal_connect (GTK_OBJECT (button_edit_disphdr), "clicked",
2162 GTK_SIGNAL_FUNC (prefs_display_header_open),
2165 SET_TOGGLE_SENSITIVITY(chkbtn_disphdr, button_edit_disphdr);
2167 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2169 hbox1 = gtk_hbox_new (FALSE, 32);
2170 gtk_widget_show (hbox1);
2171 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2173 hbox_linespc = gtk_hbox_new (FALSE, 8);
2174 gtk_widget_show (hbox1);
2175 gtk_box_pack_start (GTK_BOX (hbox1), hbox_linespc, FALSE, TRUE, 0);
2177 label_linespc = gtk_label_new (_("Line space"));
2178 gtk_widget_show (label_linespc);
2179 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2182 spinbtn_linespc_adj = gtk_adjustment_new (2, 0, 16, 1, 1, 16);
2183 spinbtn_linespc = gtk_spin_button_new
2184 (GTK_ADJUSTMENT (spinbtn_linespc_adj), 1, 0);
2185 gtk_widget_show (spinbtn_linespc);
2186 gtk_box_pack_start (GTK_BOX (hbox_linespc), spinbtn_linespc,
2188 gtk_widget_set_usize (spinbtn_linespc, 64, -1);
2189 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linespc), TRUE);
2191 label_linespc = gtk_label_new (_("pixel(s)"));
2192 gtk_widget_show (label_linespc);
2193 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2196 PACK_CHECK_BUTTON(hbox1, chkbtn_headspc, _("Leave space on head"));
2198 PACK_FRAME(vbox1, frame_scr, _("Scroll"));
2200 vbox_scr = gtk_vbox_new (FALSE, 0);
2201 gtk_widget_show (vbox_scr);
2202 gtk_container_add (GTK_CONTAINER (frame_scr), vbox_scr);
2203 gtk_container_set_border_width (GTK_CONTAINER (vbox_scr), 8);
2205 PACK_CHECK_BUTTON(vbox_scr, chkbtn_halfpage, _("Half page"));
2207 hbox1 = gtk_hbox_new (FALSE, 32);
2208 gtk_widget_show (hbox1);
2209 gtk_box_pack_start (GTK_BOX (vbox_scr), hbox1, FALSE, TRUE, 0);
2211 PACK_CHECK_BUTTON(hbox1, chkbtn_smoothscroll, _("Smooth scroll"));
2213 hbox_scr = gtk_hbox_new (FALSE, 8);
2214 gtk_widget_show (hbox_scr);
2215 gtk_box_pack_start (GTK_BOX (hbox1), hbox_scr, FALSE, FALSE, 0);
2217 label_scr = gtk_label_new (_("Step"));
2218 gtk_widget_show (label_scr);
2219 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2221 spinbtn_scrollstep_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 10);
2222 spinbtn_scrollstep = gtk_spin_button_new
2223 (GTK_ADJUSTMENT (spinbtn_scrollstep_adj), 1, 0);
2224 gtk_widget_show (spinbtn_scrollstep);
2225 gtk_box_pack_start (GTK_BOX (hbox_scr), spinbtn_scrollstep,
2227 gtk_widget_set_usize (spinbtn_scrollstep, 64, -1);
2228 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_scrollstep),
2231 label_scr = gtk_label_new (_("pixel(s)"));
2232 gtk_widget_show (label_scr);
2233 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2235 SET_TOGGLE_SENSITIVITY (chkbtn_smoothscroll, hbox_scr)
2237 message.chkbtn_enablecol = chkbtn_enablecol;
2238 message.button_edit_col = button_edit_col;
2239 message.chkbtn_mbalnum = chkbtn_mbalnum;
2240 message.chkbtn_disphdrpane = chkbtn_disphdrpane;
2241 message.chkbtn_disphdr = chkbtn_disphdr;
2242 message.spinbtn_linespc = spinbtn_linespc;
2243 message.chkbtn_headspc = chkbtn_headspc;
2245 message.chkbtn_smoothscroll = chkbtn_smoothscroll;
2246 message.spinbtn_scrollstep = spinbtn_scrollstep;
2247 message.spinbtn_scrollstep_adj = spinbtn_scrollstep_adj;
2248 message.chkbtn_halfpage = chkbtn_halfpage;
2252 static void prefs_privacy_create(void)
2257 GtkWidget *checkbtn_auto_check_signatures;
2258 GtkWidget *checkbtn_gpg_signature_popup;
2259 GtkWidget *checkbtn_passphrase_grab;
2260 GtkWidget *checkbtn_gpg_warning;
2262 GtkWidget *menuitem;
2264 GtkWidget *optmenu_menu;
2266 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2267 gtk_widget_show (vbox1);
2268 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2269 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2271 vbox2 = gtk_vbox_new (FALSE, 0);
2272 gtk_widget_show (vbox2);
2273 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2275 PACK_CHECK_BUTTON (vbox2, checkbtn_auto_check_signatures,
2276 _("Automatically check signatures"));
2278 PACK_CHECK_BUTTON (vbox2, checkbtn_gpg_signature_popup,
2279 _("Show signature check result in a popup window"));
2282 PACK_CHECK_BUTTON (vbox2, checkbtn_passphrase_grab,
2283 _("Grab input while entering a passphrase"));
2287 (vbox2, checkbtn_gpg_warning,
2288 _("Display warning on startup if GnuPG doesn't work"));
2290 hbox1 = gtk_hbox_new (FALSE, 8);
2291 gtk_widget_show (hbox1);
2292 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2294 /* create default signkey box */
2295 label = gtk_label_new (_("Default Sign Key"));
2296 gtk_widget_show (label);
2297 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2298 optmenu = gtk_option_menu_new ();
2299 gtk_widget_show (optmenu);
2300 gtk_box_pack_start(GTK_BOX (hbox1), optmenu, FALSE, FALSE, 0);
2301 optmenu_menu = gtk_menu_new ();
2303 MENUITEM_ADD(optmenu_menu, menuitem, "Default Key", "def_key");
2304 MENUITEM_ADD(optmenu_menu, menuitem, "Second Key", "2nd_key");
2305 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
2306 /* FIXME: disabled because not implemented */
2307 gtk_widget_set_sensitive(optmenu, FALSE);
2309 privacy.checkbtn_auto_check_signatures
2310 = checkbtn_auto_check_signatures;
2311 privacy.checkbtn_gpg_signature_popup
2312 = checkbtn_gpg_signature_popup;
2313 privacy.checkbtn_passphrase_grab = checkbtn_passphrase_grab;
2314 privacy.checkbtn_gpg_warning = checkbtn_gpg_warning;
2315 privacy.optmenu_default_signkey = optmenu;
2319 prefs_common_default_signkey_set_data_from_optmenu(PrefParam *pparam)
2323 GtkWidget *menuitem;
2326 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
2327 menuitem = gtk_menu_get_active(GTK_MENU(menu));
2328 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
2329 g_free(*((gchar **)pparam->data));
2330 *((gchar **)pparam->data) = g_strdup(charset);
2334 static void prefs_common_default_signkey_set_optmenu(PrefParam *pparam)
2338 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
2340 GtkWidget *menuitem;
2344 g_return_if_fail(optmenu != NULL);
2345 g_return_if_fail(*((gchar **)pparam->data) != NULL);
2347 menu = gtk_option_menu_get_menu(optmenu);
2348 for (cur = GTK_MENU_SHELL(menu)->children;
2349 cur != NULL; cur = cur->next) {
2350 menuitem = GTK_WIDGET(cur->data);
2351 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
2352 if (!strcmp(charset, *((gchar **)pparam->data))) {
2353 gtk_option_menu_set_history(optmenu, n);
2359 gtk_option_menu_set_history(optmenu, 0);
2360 prefs_common_charset_set_data_from_optmenu(pparam);
2363 #endif /* USE_GPGME */
2365 static void prefs_interface_create(void)
2370 /* GtkWidget *checkbtn_emacs; */
2371 GtkWidget *checkbtn_openunread;
2372 GtkWidget *checkbtn_openinbox;
2373 GtkWidget *checkbtn_immedexec;
2376 GtkWidget *optmenu_recvdialog;
2378 GtkWidget *menuitem;
2380 GtkWidget *frame_addr;
2381 GtkWidget *vbox_addr;
2382 GtkWidget *checkbtn_addaddrbyclick;
2384 GtkWidget *button_keybind;
2387 GtkWidget *optmenu_nextunreadmsgdialog;
2388 GtkWidget *optmenu_nextunreadmsgdialog_menu;
2389 GtkWidget *nextunreadmsgdialog_menuitem;
2391 GtkWidget *frame_pixmap_theme;
2392 GtkWidget *vbox_pixmap_theme;
2393 GtkWidget *entry_pixmap_theme;
2394 GtkWidget *combo_pixmap_theme;
2395 GList *avail_pixmap_themes = NULL;
2397 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2398 gtk_widget_show (vbox1);
2399 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2400 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2402 vbox2 = gtk_vbox_new (FALSE, 0);
2403 gtk_widget_show (vbox2);
2404 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2406 /* PACK_CHECK_BUTTON (vbox2, checkbtn_emacs,
2407 _("Emulate the behavior of mouse operation of\n"
2408 "Emacs-based mailer"));
2409 gtk_label_set_justify (GTK_LABEL (GTK_BIN (checkbtn_emacs)->child),
2410 GTK_JUSTIFY_LEFT); */
2413 (vbox2, checkbtn_openunread,
2414 _("Open first unread message when entering a folder"));
2417 (vbox2, checkbtn_openinbox,
2418 _("Go to inbox after receiving new mail"));
2420 vbox3 = gtk_vbox_new (FALSE, 0);
2421 gtk_widget_show (vbox3);
2422 gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
2425 (vbox3, checkbtn_immedexec,
2426 _("Execute immediately when moving or deleting messages"));
2428 hbox1 = gtk_hbox_new (FALSE, 0);
2429 gtk_widget_show (hbox1);
2430 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2432 label = gtk_label_new
2433 (_("(Messages will be marked until execution\n"
2434 " if this is turned off)"));
2435 gtk_widget_show (label);
2436 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 8);
2437 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
2439 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
2441 hbox1 = gtk_hbox_new (FALSE, 8);
2442 gtk_widget_show (hbox1);
2443 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
2445 label = gtk_label_new (_("Show receive dialog"));
2446 gtk_widget_show (label);
2447 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2449 optmenu_recvdialog = gtk_option_menu_new ();
2450 gtk_widget_show (optmenu_recvdialog);
2451 gtk_box_pack_start (GTK_BOX (hbox1), optmenu_recvdialog,
2454 menu = gtk_menu_new ();
2455 MENUITEM_ADD (menu, menuitem, _("Always"), RECV_DIALOG_ALWAYS);
2456 MENUITEM_ADD (menu, menuitem, _("Only if a window is active"),
2457 RECV_DIALOG_ACTIVE);
2458 MENUITEM_ADD (menu, menuitem, _("Never"), RECV_DIALOG_NEVER);
2460 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
2462 PACK_FRAME (vbox1, frame_addr, _("Address book"));
2464 vbox_addr = gtk_vbox_new (FALSE, 0);
2465 gtk_widget_show (vbox_addr);
2466 gtk_container_add (GTK_CONTAINER (frame_addr), vbox_addr);
2467 gtk_container_set_border_width (GTK_CONTAINER (vbox_addr), 8);
2470 (vbox_addr, checkbtn_addaddrbyclick,
2471 _("Add address to destination when double-clicked"));
2473 /* Next Unread Message Dialog */
2474 hbox2 = gtk_hbox_new (FALSE, 8);
2475 gtk_widget_show (hbox2);
2476 gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
2478 label = gtk_label_new (_("Show no-unread-message dialog"));
2479 gtk_widget_show (label);
2480 gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
2482 optmenu_nextunreadmsgdialog = gtk_option_menu_new ();
2483 gtk_widget_show (optmenu_nextunreadmsgdialog);
2484 gtk_box_pack_start (GTK_BOX (hbox2), optmenu_nextunreadmsgdialog,
2487 optmenu_nextunreadmsgdialog_menu = gtk_menu_new ();
2488 MENUITEM_ADD (optmenu_nextunreadmsgdialog_menu, nextunreadmsgdialog_menuitem,
2489 _("Always"), NEXTUNREADMSGDIALOG_ALWAYS);
2490 MENUITEM_ADD (optmenu_nextunreadmsgdialog_menu, nextunreadmsgdialog_menuitem,
2491 _("Assume 'Yes'"), NEXTUNREADMSGDIALOG_ASSUME_YES);
2492 MENUITEM_ADD (optmenu_nextunreadmsgdialog_menu, nextunreadmsgdialog_menuitem,
2493 _("Assume 'No'"), NEXTUNREADMSGDIALOG_ASSUME_NO);
2495 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_nextunreadmsgdialog),
2496 optmenu_nextunreadmsgdialog_menu);
2499 /* Receive Dialog */
2500 /* hbox = gtk_hbox_new (FALSE, 8);
2501 gtk_widget_show (hbox);
2502 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
2504 label = gtk_label_new (_("Show receive Dialog"));
2505 gtk_widget_show (label);
2506 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
2508 recvdialog_optmenu = gtk_option_menu_new ();
2509 gtk_widget_show (recvdialog_optmenu);
2510 gtk_box_pack_start (GTK_BOX (hbox), recvdialog_optmenu, FALSE, FALSE, 0);
2512 recvdialog_optmenu_menu = gtk_menu_new ();
2514 MENUITEM_ADD (recvdialog_optmenu_menu, recvdialog_menuitem, _("Always"), RECVDIALOG_ALWAYS);
2515 MENUITEM_ADD (recvdialog_optmenu_menu, recvdialog_menuitem, _("Only if a sylpheed window is active"), RECVDIALOG_WINDOW_ACTIVE);
2516 MENUITEM_ADD (recvdialog_optmenu_menu, recvdialog_menuitem, _("Never"), RECVDIALOG_NEVER);
2518 gtk_option_menu_set_menu (GTK_OPTION_MENU (recvdialog_optmenu), recvdialog_optmenu_menu); */
2520 hbox1 = gtk_hbox_new (FALSE, 8);
2521 gtk_widget_show (hbox1);
2522 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2524 button_keybind = gtk_button_new_with_label (_(" Set key bindings... "));
2525 gtk_widget_show (button_keybind);
2526 gtk_box_pack_start (GTK_BOX (hbox1), button_keybind, FALSE, FALSE, 0);
2527 gtk_signal_connect (GTK_OBJECT (button_keybind), "clicked",
2528 GTK_SIGNAL_FUNC (prefs_keybind_select), NULL);
2530 PACK_FRAME(vbox1, frame_pixmap_theme, "Pixmap theme");
2532 vbox_pixmap_theme = gtk_vbox_new(FALSE, 0);
2533 gtk_widget_show(vbox_pixmap_theme);
2534 gtk_container_add(GTK_CONTAINER(frame_pixmap_theme), vbox_pixmap_theme);
2535 gtk_container_set_border_width(GTK_CONTAINER(vbox_pixmap_theme), 8);
2537 avail_pixmap_themes = stock_pixmap_themes_list_new();
2539 combo_pixmap_theme = gtk_combo_new ();
2540 gtk_widget_show (combo_pixmap_theme);
2541 gtk_box_pack_start (GTK_BOX (vbox_pixmap_theme), combo_pixmap_theme, TRUE, TRUE, 0);
2542 gtk_combo_set_popdown_strings(GTK_COMBO(combo_pixmap_theme), avail_pixmap_themes);
2543 entry_pixmap_theme = GTK_COMBO (combo_pixmap_theme)->entry;
2545 stock_pixmap_themes_list_free(avail_pixmap_themes);
2547 /* interface.checkbtn_emacs = checkbtn_emacs; */
2548 interface.checkbtn_openunread = checkbtn_openunread;
2549 interface.checkbtn_openinbox = checkbtn_openinbox;
2550 interface.checkbtn_immedexec = checkbtn_immedexec;
2551 interface.optmenu_recvdialog = optmenu_recvdialog;
2552 interface.checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
2553 interface.optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
2554 interface.combo_pixmap_theme = combo_pixmap_theme;
2555 interface.entry_pixmap_theme = entry_pixmap_theme;
2558 static void prefs_other_create(void)
2561 GtkWidget *ext_frame;
2562 GtkWidget *ext_table;
2565 GtkWidget *uri_label;
2566 GtkWidget *uri_combo;
2567 GtkWidget *uri_entry;
2569 GtkWidget *printcmd_label;
2570 GtkWidget *printcmd_entry;
2572 GtkWidget *exteditor_label;
2573 GtkWidget *exteditor_combo;
2574 GtkWidget *exteditor_entry;
2576 GtkWidget *frame_exit;
2577 GtkWidget *vbox_exit;
2578 GtkWidget *checkbtn_confonexit;
2579 GtkWidget *checkbtn_cleanonexit;
2580 GtkWidget *checkbtn_askonclean;
2581 GtkWidget *checkbtn_warnqueued;
2583 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2584 gtk_widget_show (vbox1);
2585 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2586 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2588 PACK_FRAME(vbox1, ext_frame,
2589 _("External commands (%s will be replaced with file name / URI)"));
2591 ext_table = gtk_table_new (3, 2, FALSE);
2592 gtk_widget_show (ext_table);
2593 gtk_container_add (GTK_CONTAINER (ext_frame), ext_table);
2594 gtk_container_set_border_width (GTK_CONTAINER (ext_table), 8);
2595 gtk_table_set_row_spacings (GTK_TABLE (ext_table), VSPACING_NARROW);
2596 gtk_table_set_col_spacings (GTK_TABLE (ext_table), 8);
2598 uri_label = gtk_label_new (_("Web browser"));
2599 gtk_widget_show(uri_label);
2600 gtk_table_attach (GTK_TABLE (ext_table), uri_label, 0, 1, 0, 1,
2601 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2602 gtk_misc_set_alignment (GTK_MISC (uri_label), 1, 0.5);
2604 uri_combo = gtk_combo_new ();
2605 gtk_widget_show (uri_combo);
2606 gtk_table_attach (GTK_TABLE (ext_table), uri_combo, 1, 2, 0, 1,
2607 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2608 gtkut_combo_set_items (GTK_COMBO (uri_combo),
2609 "netscape -remote 'openURL(%s,raise)'",
2611 "gnome-moz-remote --raise --newwin '%s'",
2612 "kfmclient openProfile webbrowsing '%s'",
2613 "opera -newwindow '%s'",
2614 "kterm -e w3m '%s'",
2615 "kterm -e lynx '%s'",
2617 uri_entry = GTK_COMBO (uri_combo)->entry;
2619 printcmd_label = gtk_label_new (_("Print"));
2620 gtk_widget_show (printcmd_label);
2621 gtk_table_attach (GTK_TABLE (ext_table), printcmd_label, 0, 1, 1, 2,
2622 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2623 gtk_misc_set_alignment (GTK_MISC (printcmd_label), 1, 0.5);
2625 printcmd_entry = gtk_entry_new ();
2626 gtk_widget_show (printcmd_entry);
2627 gtk_table_attach (GTK_TABLE (ext_table), printcmd_entry, 1, 2, 1, 2,
2628 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2630 exteditor_label = gtk_label_new (_("Editor"));
2631 gtk_widget_show (exteditor_label);
2632 gtk_table_attach (GTK_TABLE (ext_table), exteditor_label, 0, 1, 2, 3,
2633 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2634 gtk_misc_set_alignment (GTK_MISC (exteditor_label), 1, 0.5);
2636 exteditor_combo = gtk_combo_new ();
2637 gtk_widget_show (exteditor_combo);
2638 gtk_table_attach (GTK_TABLE (ext_table), exteditor_combo, 1, 2, 2, 3,
2639 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2640 gtkut_combo_set_items (GTK_COMBO (exteditor_combo),
2643 "mgedit --no-fork %s",
2649 exteditor_entry = GTK_COMBO (exteditor_combo)->entry;
2652 PACK_FRAME (vbox1, frame_exit, _("On exit"));
2654 vbox_exit = gtk_vbox_new (FALSE, 0);
2655 gtk_widget_show (vbox_exit);
2656 gtk_container_add (GTK_CONTAINER (frame_exit), vbox_exit);
2657 gtk_container_set_border_width (GTK_CONTAINER (vbox_exit), 8);
2659 PACK_CHECK_BUTTON (vbox_exit, checkbtn_confonexit,
2660 _("Confirm on exit"));
2662 hbox1 = gtk_hbox_new (FALSE, 32);
2663 gtk_widget_show (hbox1);
2664 gtk_box_pack_start (GTK_BOX (vbox_exit), hbox1, FALSE, FALSE, 0);
2666 PACK_CHECK_BUTTON (hbox1, checkbtn_cleanonexit,
2667 _("Empty trash on exit"));
2668 PACK_CHECK_BUTTON (hbox1, checkbtn_askonclean,
2669 _("Ask before emptying"));
2670 SET_TOGGLE_SENSITIVITY (checkbtn_cleanonexit, checkbtn_askonclean);
2672 PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
2673 _("Warn if there are queued messages"));
2675 other.uri_combo = uri_combo;
2676 other.uri_entry = uri_entry;
2677 other.printcmd_entry = printcmd_entry;
2679 other.exteditor_combo = exteditor_combo;
2680 other.exteditor_entry = exteditor_entry;
2682 other.checkbtn_confonexit = checkbtn_confonexit;
2683 other.checkbtn_cleanonexit = checkbtn_cleanonexit;
2684 other.checkbtn_askonclean = checkbtn_askonclean;
2685 other.checkbtn_warnqueued = checkbtn_warnqueued;
2688 static void date_format_ok_btn_clicked(GtkButton *button, GtkWidget **widget)
2690 GtkWidget *datefmt_sample = NULL;
2693 g_return_if_fail(widget != NULL);
2694 g_return_if_fail(*widget != NULL);
2695 g_return_if_fail(display.entry_datefmt != NULL);
2697 datefmt_sample = GTK_WIDGET(gtk_object_get_data
2698 (GTK_OBJECT(*widget), "datefmt_sample"));
2699 g_return_if_fail(datefmt_sample != NULL);
2701 text = gtk_editable_get_chars(GTK_EDITABLE(datefmt_sample), 0, -1);
2702 g_free(prefs_common.date_format);
2703 prefs_common.date_format = text;
2704 gtk_entry_set_text(GTK_ENTRY(display.entry_datefmt), text);
2706 gtk_widget_destroy(*widget);
2710 static void date_format_cancel_btn_clicked(GtkButton *button,
2713 g_return_if_fail(widget != NULL);
2714 g_return_if_fail(*widget != NULL);
2716 gtk_widget_destroy(*widget);
2720 static void date_format_key_pressed(GtkWidget *keywidget, GdkEventKey *event,
2723 if (event && event->keyval == GDK_Escape)
2724 date_format_cancel_btn_clicked(NULL, widget);
2727 static gboolean date_format_on_delete(GtkWidget *dialogwidget,
2728 GdkEventAny *event, GtkWidget **widget)
2730 g_return_val_if_fail(widget != NULL, FALSE);
2731 g_return_val_if_fail(*widget != NULL, FALSE);
2737 static void date_format_entry_on_change(GtkEditable *editable,
2741 struct tm *cal_time;
2745 cur_time = time(NULL);
2746 cal_time = localtime(&cur_time);
2748 text = gtk_editable_get_chars(editable, 0, -1);
2750 strftime(buffer, sizeof buffer, text, cal_time);
2751 gtk_label_set_text(example, buffer);
2754 static void date_format_select_row(GtkWidget *date_format_list, gint row,
2755 gint column, GdkEventButton *event,
2756 GtkWidget *date_format)
2762 GtkWidget *datefmt_sample;
2764 /* only on double click */
2765 if (!event || event->type != GDK_2BUTTON_PRESS) return;
2768 datefmt_sample = GTK_WIDGET(gtk_object_get_data
2769 (GTK_OBJECT(date_format), "datefmt_sample"));
2771 g_return_if_fail(date_format_list != NULL);
2772 g_return_if_fail(date_format != NULL);
2773 g_return_if_fail(datefmt_sample != NULL);
2775 /* get format from clist */
2776 gtk_clist_get_text(GTK_CLIST(date_format_list), row, 0, &format);
2778 cur_pos = gtk_editable_get_position(GTK_EDITABLE(datefmt_sample));
2779 old_format = gtk_entry_get_text(GTK_ENTRY(datefmt_sample));
2781 /* insert the format into the text entry */
2782 new_format = g_malloc(strlen(old_format) + 3);
2784 strncpy(new_format, old_format, cur_pos);
2785 new_format[cur_pos] = '\0';
2786 strcat(new_format, format);
2787 strcat(new_format, &old_format[cur_pos]);
2789 gtk_entry_set_text(GTK_ENTRY(datefmt_sample), new_format);
2790 gtk_editable_set_position(GTK_EDITABLE(datefmt_sample), cur_pos + 2);
2795 static GtkWidget *date_format_create(GtkButton *button, void *data)
2797 static GtkWidget *datefmt_win = NULL;
2799 GtkWidget *scrolledwindow1;
2800 GtkWidget *datefmt_clist;
2805 GtkWidget *confirm_area;
2807 GtkWidget *cancel_btn;
2808 GtkWidget *datefmt_entry;
2837 const gint TIME_FORMAT_ELEMS =
2838 sizeof time_format / sizeof time_format[0];
2840 time_format[0].txt = _("the full abbreviated weekday name");
2841 time_format[1].txt = _("the full weekday name");
2842 time_format[2].txt = _("the abbreviated month name");
2843 time_format[3].txt = _("the full month name");
2844 time_format[4].txt = _("the preferred date and time for the current locale");
2845 time_format[5].txt = _("the century number (year/100)");
2846 time_format[6].txt = _("the day of the month as a decimal number");
2847 time_format[7].txt = _("the hour as a decimal number using a 24-hour clock");
2848 time_format[8].txt = _("the hour as a decimal number using a 12-hour clock");
2849 time_format[9].txt = _("the day of the year as a decimal number");
2850 time_format[10].txt = _("the month as a decimal number");
2851 time_format[11].txt = _("the minute as a decimal number");
2852 time_format[12].txt = _("either AM or PM");
2853 time_format[13].txt = _("the second as a decimal number");
2854 time_format[14].txt = _("the day of the week as a decimal number");
2855 time_format[15].txt = _("the preferred date for the current locale");
2856 time_format[16].txt = _("the last two digits of a year");
2857 time_format[17].txt = _("the year as a decimal number");
2858 time_format[18].txt = _("the time zone or name or abbreviation");
2860 if (datefmt_win) return datefmt_win;
2862 datefmt_win = gtk_window_new(GTK_WINDOW_DIALOG);
2863 gtk_container_set_border_width(GTK_CONTAINER(datefmt_win), 8);
2864 gtk_window_set_title(GTK_WINDOW(datefmt_win), _("Date format"));
2865 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
2866 gtk_widget_set_usize(datefmt_win, 440, 280);
2868 vbox1 = gtk_vbox_new(FALSE, 10);
2869 gtk_widget_show(vbox1);
2870 gtk_container_add(GTK_CONTAINER(datefmt_win), vbox1);
2872 scrolledwindow1 = gtk_scrolled_window_new(NULL, NULL);
2873 gtk_scrolled_window_set_policy
2874 (GTK_SCROLLED_WINDOW(scrolledwindow1),
2875 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
2876 gtk_widget_show(scrolledwindow1);
2877 gtk_box_pack_start(GTK_BOX(vbox1), scrolledwindow1, TRUE, TRUE, 0);
2879 titles[0] = _("Specifier");
2880 titles[1] = _("Description");
2881 datefmt_clist = gtk_clist_new_with_titles(2, titles);
2882 gtk_widget_show(datefmt_clist);
2883 gtk_container_add(GTK_CONTAINER(scrolledwindow1), datefmt_clist);
2884 /* gtk_clist_set_column_width(GTK_CLIST(datefmt_clist), 0, 80); */
2885 gtk_clist_set_selection_mode(GTK_CLIST(datefmt_clist),
2886 GTK_SELECTION_BROWSE);
2888 for (i = 0; i < TIME_FORMAT_ELEMS; i++) {
2890 /* phoney casting necessary because of gtk... */
2891 text[0] = (gchar *)time_format[i].fmt;
2892 text[1] = (gchar *)time_format[i].txt;
2893 gtk_clist_append(GTK_CLIST(datefmt_clist), text);
2896 table = gtk_table_new(2, 2, FALSE);
2897 gtk_widget_show(table);
2898 gtk_box_pack_start(GTK_BOX(vbox1), table, FALSE, FALSE, 0);
2899 gtk_table_set_row_spacings(GTK_TABLE(table), 4);
2900 gtk_table_set_col_spacings(GTK_TABLE(table), 8);
2902 label1 = gtk_label_new(_("Date format"));
2903 gtk_widget_show(label1);
2904 gtk_table_attach(GTK_TABLE(table), label1, 0, 1, 0, 1,
2906 gtk_label_set_justify(GTK_LABEL(label1), GTK_JUSTIFY_LEFT);
2907 gtk_misc_set_alignment(GTK_MISC(label1), 0, 0.5);
2909 datefmt_entry = gtk_entry_new_with_max_length(256);
2910 gtk_widget_show(datefmt_entry);
2911 gtk_table_attach(GTK_TABLE(table), datefmt_entry, 1, 2, 0, 1,
2912 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2914 /* we need the "sample" entry box; add it as data so callbacks can
2915 * get the entry box */
2916 gtk_object_set_data(GTK_OBJECT(datefmt_win), "datefmt_sample",
2919 label2 = gtk_label_new(_("Example"));
2920 gtk_widget_show(label2);
2921 gtk_table_attach(GTK_TABLE(table), label2, 0, 1, 1, 2,
2923 gtk_label_set_justify(GTK_LABEL(label2), GTK_JUSTIFY_LEFT);
2924 gtk_misc_set_alignment(GTK_MISC(label2), 0, 0.5);
2926 label3 = gtk_label_new("");
2927 gtk_widget_show(label3);
2928 gtk_table_attach(GTK_TABLE(table), label3, 1, 2, 1, 2,
2929 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2930 gtk_label_set_justify(GTK_LABEL(label3), GTK_JUSTIFY_LEFT);
2931 gtk_misc_set_alignment(GTK_MISC(label3), 0, 0.5);
2933 gtkut_button_set_create(&confirm_area, &ok_btn, _("OK"),
2934 &cancel_btn, _("Cancel"), NULL, NULL);
2935 gtk_widget_grab_default(ok_btn);
2936 gtk_widget_show(confirm_area);
2938 gtk_box_pack_start(GTK_BOX(vbox1), confirm_area, FALSE, FALSE, 0);
2940 /* set the current format */
2941 gtk_entry_set_text(GTK_ENTRY(datefmt_entry), prefs_common.date_format);
2942 date_format_entry_on_change(GTK_EDITABLE(datefmt_entry),
2945 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
2946 GTK_SIGNAL_FUNC(date_format_ok_btn_clicked),
2948 gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
2949 GTK_SIGNAL_FUNC(date_format_cancel_btn_clicked),
2951 gtk_signal_connect(GTK_OBJECT(datefmt_win), "key_press_event",
2952 GTK_SIGNAL_FUNC(date_format_key_pressed),
2954 gtk_signal_connect(GTK_OBJECT(datefmt_win), "delete_event",
2955 GTK_SIGNAL_FUNC(date_format_on_delete),
2957 gtk_signal_connect(GTK_OBJECT(datefmt_entry), "changed",
2958 GTK_SIGNAL_FUNC(date_format_entry_on_change),
2961 gtk_signal_connect(GTK_OBJECT(datefmt_clist), "select_row",
2962 GTK_SIGNAL_FUNC(date_format_select_row),
2965 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
2966 gtk_window_set_modal(GTK_WINDOW(datefmt_win), TRUE);
2968 gtk_widget_show(datefmt_win);
2969 manage_window_set_transient(GTK_WINDOW(datefmt_win));
2971 gtk_widget_grab_focus(ok_btn);
2976 void prefs_quote_colors_dialog(void)
2978 if (!quote_color_win)
2979 prefs_quote_colors_dialog_create();
2980 gtk_widget_show(quote_color_win);
2981 manage_window_set_transient(GTK_WINDOW(quote_color_win));
2984 gtk_widget_hide(quote_color_win);
2986 textview_update_message_colors();
2987 main_window_reflect_prefs_all();
2990 static void prefs_quote_colors_dialog_create(void)
2995 GtkWidget *quotelevel1_label;
2996 GtkWidget *quotelevel2_label;
2997 GtkWidget *quotelevel3_label;
2998 GtkWidget *uri_label;
2999 GtkWidget *tgt_folder_label;
3002 GtkWidget *recycle_colors_btn;
3003 GtkWidget *frame_colors;
3005 window = gtk_window_new(GTK_WINDOW_DIALOG);
3006 gtk_container_set_border_width(GTK_CONTAINER(window), 2);
3007 gtk_window_set_title(GTK_WINDOW(window), _("Set message colors"));
3008 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
3009 gtk_window_set_modal(GTK_WINDOW(window), TRUE);
3010 gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
3012 vbox = gtk_vbox_new (FALSE, VSPACING);
3013 gtk_container_add (GTK_CONTAINER (window), vbox);
3014 gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
3015 PACK_FRAME(vbox, frame_colors, _("Colors"));
3017 table = gtk_table_new (4, 2, FALSE);
3018 gtk_container_add (GTK_CONTAINER (frame_colors), table);
3019 gtk_container_set_border_width (GTK_CONTAINER (table), 8);
3020 gtk_table_set_row_spacings (GTK_TABLE (table), 2);
3021 gtk_table_set_col_spacings (GTK_TABLE (table), 5);
3024 color_buttons.quote_level1_btn = gtk_button_new();
3025 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level1_btn,
3026 0, 1, 0, 1, 0, 0, 0, 0);
3027 gtk_widget_set_usize (color_buttons.quote_level1_btn, 40, 30);
3028 gtk_container_set_border_width
3029 (GTK_CONTAINER (color_buttons.quote_level1_btn), 5);
3031 color_buttons.quote_level2_btn = gtk_button_new();
3032 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level2_btn,
3033 0, 1, 1, 2, 0, 0, 0, 0);
3034 gtk_widget_set_usize (color_buttons.quote_level2_btn, 40, 30);
3035 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.quote_level2_btn), 5);
3037 color_buttons.quote_level3_btn = gtk_button_new_with_label ("");
3038 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level3_btn,
3039 0, 1, 2, 3, 0, 0, 0, 0);
3040 gtk_widget_set_usize (color_buttons.quote_level3_btn, 40, 30);
3041 gtk_container_set_border_width
3042 (GTK_CONTAINER (color_buttons.quote_level3_btn), 5);
3044 color_buttons.uri_btn = gtk_button_new_with_label ("");
3045 gtk_table_attach (GTK_TABLE (table), color_buttons.uri_btn,
3046 0, 1, 3, 4, 0, 0, 0, 0);
3047 gtk_widget_set_usize (color_buttons.uri_btn, 40, 30);
3048 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.uri_btn), 5);
3050 color_buttons.tgt_folder_btn = gtk_button_new_with_label ("");
3051 gtk_table_attach (GTK_TABLE (table), color_buttons.tgt_folder_btn,
3052 0, 1, 4, 5, 0, 0, 0, 0);
3053 gtk_widget_set_usize (color_buttons.tgt_folder_btn, 40, 30);
3054 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.tgt_folder_btn), 5);
3056 quotelevel1_label = gtk_label_new (_("Quoted Text - First Level"));
3057 gtk_table_attach (GTK_TABLE (table), quotelevel1_label, 1, 2, 0, 1,
3058 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3059 gtk_label_set_justify (GTK_LABEL (quotelevel1_label), GTK_JUSTIFY_LEFT);
3060 gtk_misc_set_alignment (GTK_MISC (quotelevel1_label), 0, 0.5);
3062 quotelevel2_label = gtk_label_new (_("Quoted Text - Second Level"));
3063 gtk_table_attach (GTK_TABLE (table), quotelevel2_label, 1, 2, 1, 2,
3064 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3065 gtk_label_set_justify (GTK_LABEL (quotelevel2_label), GTK_JUSTIFY_LEFT);
3066 gtk_misc_set_alignment (GTK_MISC (quotelevel2_label), 0, 0.5);
3068 quotelevel3_label = gtk_label_new (_("Quoted Text - Third Level"));
3069 gtk_table_attach (GTK_TABLE (table), quotelevel3_label, 1, 2, 2, 3,
3070 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3071 gtk_label_set_justify (GTK_LABEL (quotelevel3_label), GTK_JUSTIFY_LEFT);
3072 gtk_misc_set_alignment (GTK_MISC (quotelevel3_label), 0, 0.5);
3074 uri_label = gtk_label_new (_("URI link"));
3075 gtk_table_attach (GTK_TABLE (table), uri_label, 1, 2, 3, 4,
3076 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3077 gtk_label_set_justify (GTK_LABEL (uri_label), GTK_JUSTIFY_LEFT);
3078 gtk_misc_set_alignment (GTK_MISC (uri_label), 0, 0.5);
3080 tgt_folder_label = gtk_label_new (_("Target folder"));
3081 gtk_table_attach (GTK_TABLE (table), tgt_folder_label, 1, 2, 4, 5,
3082 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3083 gtk_label_set_justify (GTK_LABEL (tgt_folder_label), GTK_JUSTIFY_LEFT);
3084 gtk_misc_set_alignment (GTK_MISC (tgt_folder_label), 0, 0.5);
3086 PACK_CHECK_BUTTON (vbox, recycle_colors_btn,
3087 _("Recycle quote colors"));
3089 gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
3090 NULL, NULL, NULL, NULL);
3091 gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
3093 gtk_widget_grab_default(ok_btn);
3094 MANAGE_WINDOW_SIGNALS_CONNECT(window);
3095 gtk_signal_connect(GTK_OBJECT(window), "delete_event",
3096 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3097 gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
3098 GTK_SIGNAL_FUNC(prefs_quote_colors_key_pressed),
3101 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level1_btn), "clicked",
3102 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL1");
3103 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level2_btn), "clicked",
3104 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL2");
3105 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level3_btn), "clicked",
3106 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL3");
3107 gtk_signal_connect(GTK_OBJECT(color_buttons.uri_btn), "clicked",
3108 GTK_SIGNAL_FUNC(quote_color_set_dialog), "URI");
3109 gtk_signal_connect(GTK_OBJECT(color_buttons.tgt_folder_btn), "clicked",
3110 GTK_SIGNAL_FUNC(quote_color_set_dialog), "TGTFLD");
3111 gtk_signal_connect(GTK_OBJECT(recycle_colors_btn), "toggled",
3112 GTK_SIGNAL_FUNC(prefs_recycle_colors_toggled), NULL);
3113 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
3114 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3116 /* show message button colors and recycle options */
3117 set_button_bg_color(color_buttons.quote_level1_btn,
3118 prefs_common.quote_level1_col);
3119 set_button_bg_color(color_buttons.quote_level2_btn,
3120 prefs_common.quote_level2_col);
3121 set_button_bg_color(color_buttons.quote_level3_btn,
3122 prefs_common.quote_level3_col);
3123 set_button_bg_color(color_buttons.uri_btn,
3124 prefs_common.uri_col);
3125 set_button_bg_color(color_buttons.tgt_folder_btn,
3126 prefs_common.tgt_folder_col);
3127 gtk_toggle_button_set_active((GtkToggleButton *)recycle_colors_btn,
3128 prefs_common.recycle_quote_colors);
3130 gtk_widget_show_all(vbox);
3131 quote_color_win = window;
3134 static void prefs_quote_colors_key_pressed(GtkWidget *widget,
3135 GdkEventKey *event, gpointer data)
3137 if (event && event->keyval == GDK_Escape)
3141 static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
3143 gchar *type = (gchar *)data;
3144 gchar *title = NULL;
3145 gdouble color[4] = {0.0, 0.0, 0.0, 0.0};
3147 GtkColorSelectionDialog *dialog;
3149 if(g_strcasecmp(type, "LEVEL1") == 0) {
3150 title = _("Pick color for quotation level 1");
3151 rgbvalue = prefs_common.quote_level1_col;
3152 } else if(g_strcasecmp(type, "LEVEL2") == 0) {
3153 title = _("Pick color for quotation level 2");
3154 rgbvalue = prefs_common.quote_level2_col;
3155 } else if(g_strcasecmp(type, "LEVEL3") == 0) {
3156 title = _("Pick color for quotation level 3");
3157 rgbvalue = prefs_common.quote_level3_col;
3158 } else if(g_strcasecmp(type, "URI") == 0) {
3159 title = _("Pick color for URI");
3160 rgbvalue = prefs_common.uri_col;
3161 } else if(g_strcasecmp(type, "TGTFLD") == 0) {
3162 title = _("Pick color for target folder");
3163 rgbvalue = prefs_common.tgt_folder_col;
3165 } else if(g_strcasecmp(type, "Misspelled word") == 0) {
3166 title = _("Pick color for misspelled word");
3167 rgbvalue = prefs_common.misspelled_col;
3169 } else { /* Should never be called */
3170 g_warning("Unrecognized datatype '%s' in quote_color_set_dialog\n", type);
3174 color_dialog = gtk_color_selection_dialog_new(title);
3175 gtk_window_set_position(GTK_WINDOW(color_dialog), GTK_WIN_POS_CENTER);
3176 gtk_window_set_modal(GTK_WINDOW(color_dialog), TRUE);
3177 gtk_window_set_policy(GTK_WINDOW(color_dialog), FALSE, FALSE, FALSE);
3178 manage_window_set_transient(GTK_WINDOW(color_dialog));
3180 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->ok_button),
3181 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_ok), data);
3182 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->cancel_button),
3183 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_cancel), data);
3184 gtk_signal_connect(GTK_OBJECT(color_dialog), "key_press_event",
3185 GTK_SIGNAL_FUNC(quote_colors_set_dialog_key_pressed),
3188 /* preselect the previous color in the color selection dialog */
3189 color[0] = (gdouble) ((rgbvalue & 0xff0000) >> 16) / 255.0;
3190 color[1] = (gdouble) ((rgbvalue & 0x00ff00) >> 8) / 255.0;
3191 color[2] = (gdouble) (rgbvalue & 0x0000ff) / 255.0;
3192 dialog = GTK_COLOR_SELECTION_DIALOG(color_dialog);
3193 gtk_color_selection_set_color
3194 (GTK_COLOR_SELECTION(dialog->colorsel), color);
3196 gtk_widget_show(color_dialog);
3199 static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
3201 GtkColorSelection *colorsel = (GtkColorSelection *)
3202 ((GtkColorSelectionDialog *)color_dialog)->colorsel;
3204 gint red, green, blue, rgbvalue;
3205 gchar *type = (gchar *)data;
3207 gtk_color_selection_get_color(colorsel, color);
3209 red = (gint) (color[0] * 255.0);
3210 green = (gint) (color[1] * 255.0);
3211 blue = (gint) (color[2] * 255.0);
3212 rgbvalue = (gint) ((red * 0x10000) | (green * 0x100) | blue);
3215 fprintf(stderr, "redc = %f, greenc = %f, bluec = %f\n", color[0], color[1], color[2]);
3216 fprintf(stderr, "red = %d, green = %d, blue = %d\n", red, green, blue);
3217 fprintf(stderr, "Color is %x\n", rgbvalue);
3220 if (g_strcasecmp(type, "LEVEL1") == 0) {
3221 prefs_common.quote_level1_col = rgbvalue;
3222 set_button_bg_color(color_buttons.quote_level1_btn, rgbvalue);
3223 } else if (g_strcasecmp(type, "LEVEL2") == 0) {
3224 prefs_common.quote_level2_col = rgbvalue;
3225 set_button_bg_color(color_buttons.quote_level2_btn, rgbvalue);
3226 } else if (g_strcasecmp(type, "LEVEL3") == 0) {
3227 prefs_common.quote_level3_col = rgbvalue;
3228 set_button_bg_color(color_buttons.quote_level3_btn, rgbvalue);
3229 } else if (g_strcasecmp(type, "URI") == 0) {
3230 prefs_common.uri_col = rgbvalue;
3231 set_button_bg_color(color_buttons.uri_btn, rgbvalue);
3232 } else if (g_strcasecmp(type, "TGTFLD") == 0) {
3233 prefs_common.tgt_folder_col = rgbvalue;
3234 set_button_bg_color(color_buttons.tgt_folder_btn, rgbvalue);
3235 folderview_set_target_folder_color(prefs_common.tgt_folder_col);
3237 } else if (g_strcasecmp(type, "Misspelled word") == 0) {
3238 prefs_common.misspelled_col = rgbvalue;
3239 set_button_bg_color(spelling.misspelled_btn, rgbvalue);
3242 fprintf( stderr, "Unrecognized datatype '%s' in quote_color_set_dialog_ok\n", type );
3244 gtk_widget_destroy(color_dialog);
3247 static void quote_colors_set_dialog_cancel(GtkWidget *widget, gpointer data)
3249 gtk_widget_destroy(color_dialog);
3252 static void quote_colors_set_dialog_key_pressed(GtkWidget *widget,
3256 gtk_widget_destroy(color_dialog);
3259 static void set_button_bg_color(GtkWidget *widget, gint rgbvalue)
3264 gtkut_convert_int_to_gdk_color(rgbvalue, &color);
3265 newstyle = gtk_style_copy(gtk_widget_get_default_style());
3266 newstyle->bg[GTK_STATE_NORMAL] = color;
3267 newstyle->bg[GTK_STATE_PRELIGHT] = color;
3268 newstyle->bg[GTK_STATE_ACTIVE] = color;
3270 gtk_widget_set_style(GTK_WIDGET(widget), newstyle);
3273 static void prefs_enable_message_color_toggled(void)
3277 is_active = gtk_toggle_button_get_active
3278 (GTK_TOGGLE_BUTTON(message.chkbtn_enablecol));
3279 gtk_widget_set_sensitive(message.button_edit_col, is_active);
3280 prefs_common.enable_color = is_active;
3283 static void prefs_recycle_colors_toggled(GtkWidget *widget)
3287 is_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
3288 prefs_common.recycle_quote_colors = is_active;
3291 static void prefs_font_select(GtkButton *button, GtkEntry *entry)
3295 g_return_if_fail(entry != NULL);
3297 if (!font_sel_win) {
3298 font_sel_win = gtk_font_selection_dialog_new
3299 (_("Font selection"));
3300 gtk_window_position(GTK_WINDOW(font_sel_win),
3301 GTK_WIN_POS_CENTER);
3302 gtk_signal_connect(GTK_OBJECT(font_sel_win), "delete_event",
3303 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3306 (GTK_OBJECT(font_sel_win), "key_press_event",
3307 GTK_SIGNAL_FUNC(prefs_font_selection_key_pressed),
3309 gtk_signal_connect_object
3310 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->cancel_button),
3312 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3313 GTK_OBJECT(font_sel_win));
3316 if(font_sel_conn_id) {
3317 gtk_signal_disconnect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button), font_sel_conn_id);
3319 font_sel_conn_id = gtk_signal_connect
3320 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button),
3322 GTK_SIGNAL_FUNC(prefs_font_selection_ok),
3324 printf("%i\n", font_sel_conn_id);
3326 font_name = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
3327 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(font_sel_win), font_name);
3329 manage_window_set_transient(GTK_WINDOW(font_sel_win));
3330 gtk_window_set_modal(GTK_WINDOW(font_sel_win), TRUE);
3331 gtk_widget_grab_focus
3332 (GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button);
3333 gtk_widget_show(font_sel_win);
3336 static void prefs_font_selection_key_pressed(GtkWidget *widget,
3340 if (event && event->keyval == GDK_Escape)
3341 gtk_widget_hide(font_sel_win);
3344 static void prefs_font_selection_ok(GtkButton *button, GtkEntry *entry)
3348 fontname = gtk_font_selection_dialog_get_font_name
3349 (GTK_FONT_SELECTION_DIALOG(font_sel_win));
3352 gtk_entry_set_text(entry, fontname);
3357 gtk_widget_hide(font_sel_win);
3360 static void prefs_keybind_select(void)
3367 GtkWidget *confirm_area;
3369 GtkWidget *cancel_btn;
3371 window = gtk_window_new (GTK_WINDOW_DIALOG);
3372 gtk_container_set_border_width (GTK_CONTAINER (window), 8);
3373 gtk_window_set_title (GTK_WINDOW (window), _("Key bindings"));
3374 gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
3375 gtk_window_set_modal (GTK_WINDOW (window), TRUE);
3376 gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, FALSE);
3377 manage_window_set_transient (GTK_WINDOW (window));
3379 vbox1 = gtk_vbox_new (FALSE, VSPACING);
3380 gtk_container_add (GTK_CONTAINER (window), vbox1);
3381 gtk_container_set_border_width (GTK_CONTAINER (vbox1), 2);
3383 hbox1 = gtk_hbox_new (FALSE, 8);
3384 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3386 label = gtk_label_new
3387 (_("Select the preset of key bindings.\n"
3388 "You can also modify each menu's shortcuts by pressing\n"
3389 "any key(s) when placing the mouse pointer on the item."));
3390 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
3391 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
3393 hbox1 = gtk_hbox_new (FALSE, 8);
3394 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3396 combo = gtk_combo_new ();
3397 gtk_box_pack_start (GTK_BOX (hbox1), combo, TRUE, TRUE, 0);
3398 gtkut_combo_set_items (GTK_COMBO (combo),
3404 gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE);
3406 hbox1 = gtk_hbox_new (FALSE, 8);
3407 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3409 gtkut_button_set_create (&confirm_area, &ok_btn, _("OK"),
3410 &cancel_btn, _("Cancel"), NULL, NULL);
3411 gtk_box_pack_end (GTK_BOX (hbox1), confirm_area, FALSE, FALSE, 0);
3412 gtk_widget_grab_default (ok_btn);
3414 MANAGE_WINDOW_SIGNALS_CONNECT(window);
3415 gtk_signal_connect (GTK_OBJECT (window), "delete_event",
3416 GTK_SIGNAL_FUNC (prefs_keybind_deleted), NULL);
3417 gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
3418 GTK_SIGNAL_FUNC (prefs_keybind_key_pressed), NULL);
3419 gtk_signal_connect (GTK_OBJECT (ok_btn), "clicked",
3420 GTK_SIGNAL_FUNC (prefs_keybind_apply_clicked),
3422 gtk_signal_connect (GTK_OBJECT (cancel_btn), "clicked",
3423 GTK_SIGNAL_FUNC (prefs_keybind_cancel),
3426 gtk_widget_show_all(window);
3428 keybind.window = window;
3429 keybind.combo = combo;
3432 static void prefs_keybind_key_pressed(GtkWidget *widget, GdkEventKey *event,
3435 if (event && event->keyval == GDK_Escape)
3436 prefs_keybind_cancel();
3439 static gint prefs_keybind_deleted(GtkWidget *widget, GdkEventAny *event,
3442 prefs_keybind_cancel();
3446 static void prefs_keybind_cancel(void)
3448 gtk_widget_destroy(keybind.window);
3449 keybind.window = NULL;
3450 keybind.combo = NULL;
3453 static void prefs_keybind_apply_clicked(GtkWidget *widget)
3455 GtkEntry *entry = GTK_ENTRY(GTK_COMBO(keybind.combo)->entry);
3459 static gchar *default_menurc =
3460 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3461 "(menu-path \"<Main>/File/Save as...\" \"<control>S\")\n"
3462 "(menu-path \"<Main>/File/Print...\" \"\")\n"
3463 "(menu-path \"<Main>/File/Exit\" \"<control>Q\")\n"
3465 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3466 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3467 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3468 "(menu-path \"<Main>/Edit/Search folder...\" \"<shift><control>F\")\n"
3470 "(menu-path \"<Main>/View/Expand Summary View\" \"V\")\n"
3471 "(menu-path \"<Main>/View/Expand Message View\" \"<shift>V\")\n"
3472 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3473 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3474 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3475 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3476 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3477 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3478 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3479 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3480 "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
3481 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3483 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3484 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3485 "(menu-path \"<Main>/Message/Compose an email message\" \"<control>M\")\n"
3486 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3487 "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
3488 "(menu-path \"<Main>/Message/Reply to all\" \"<shift><control>R\")\n"
3489 "(menu-path \"<Main>/Message/Forward\" \"<control><alt>F\")\n"
3490 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
3491 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3492 "(menu-path \"<Main>/Message/Copy...\" \"<shift><control>O\")\n"
3493 "(menu-path \"<Main>/Message/Delete\" \"<control>D\")\n"
3494 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3495 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3496 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3497 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3499 "(menu-path \"<Main>/Tool/Address book\" \"<shift><control>A\")\n"
3500 "(menu-path \"<Main>/Tool/Execute\" \"X\")\n"
3501 "(menu-path \"<Main>/Tool/Log window\" \"<control>L\")\n"
3503 "(menu-path \"<Compose>/File/Close\" \"<control>W\")\n"
3504 "(menu-path \"<Compose>/Edit/Select all\" \"<control>A\")\n"
3505 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
3506 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
3507 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
3508 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
3509 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
3511 static gchar *mew_wl_menurc =
3512 "(menu-path \"<Main>/File/Empty trash\" \"<shift>D\")\n"
3513 "(menu-path \"<Main>/File/Save as...\" \"Y\")\n"
3514 "(menu-path \"<Main>/File/Print...\" \"<shift>numbersign\")\n"
3515 "(menu-path \"<Main>/File/Exit\" \"<shift>Q\")\n"
3517 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3518 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3519 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3520 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
3522 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
3523 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
3524 "(menu-path \"<Main>/View/Thread view\" \"<shift>T\")\n"
3525 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3526 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3527 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3528 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3529 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3530 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3531 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3532 "(menu-path \"<Main>/View/Show all header\" \"<shift>H\")\n"
3533 "(menu-path \"<Main>/View/Update\" \"<shift>S\")\n"
3535 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3536 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3537 "(menu-path \"<Main>/Message/Compose an email message\" \"W\")\n"
3538 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3539 "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
3540 "(menu-path \"<Main>/Message/Reply to all\" \"<shift>A\")\n"
3541 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3542 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift>F\")\n" */
3543 "(menu-path \"<Main>/Message/Move...\" \"O\")\n"
3544 "(menu-path \"<Main>/Message/Copy...\" \"<shift>O\")\n"
3545 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3546 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3547 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3548 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3549 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"<shift>R\")\n"
3551 "(menu-path \"<Main>/Tool/Address book\" \"<shift><control>A\")\n"
3552 "(menu-path \"<Main>/Tool/Execute\" \"X\")\n"
3553 "(menu-path \"<Main>/Tool/Log window\" \"<control>L\")\n"
3555 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3556 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3557 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3558 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3559 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3560 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3561 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3563 static gchar *mutt_menurc =
3564 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3565 "(menu-path \"<Main>/File/Save as...\" \"S\")\n"
3566 "(menu-path \"<Main>/File/Print...\" \"P\")\n"
3567 "(menu-path \"<Main>/File/Exit\" \"Q\")\n"
3569 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3570 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3571 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3572 "(menu-path \"<Main>/Edit/Search messages...\" \"slash\")\n"
3574 "(menu-path \"<Main>/View/Toggle summary view\" \"V\")\n"
3575 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3576 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
3577 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
3578 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
3579 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
3580 "(menu-path \"<Main>/View/Go to/Other folder...\" \"C\")\n"
3581 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3582 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3583 "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
3584 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3586 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3587 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3588 "(menu-path \"<Main>/Message/Compose new message\" \"M\")\n"
3589 "(menu-path \"<Main>/Message/Reply\" \"R\")\n"
3590 "(menu-path \"<Main>/Message/Reply to all\" \"G\")\n"
3591 "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
3592 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3593 "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n"
3594 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3595 "(menu-path \"<Main>/Message/Copy...\" \"<shift>C\")\n"
3596 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3597 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>F\")\n"
3598 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3599 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>N\")\n"
3600 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3602 "(menu-path \"<Main>/Tool/Address book\" \"<shift><control>A\")\n"
3603 "(menu-path \"<Main>/Tool/Execute\" \"X\")\n"
3604 "(menu-path \"<Main>/Tool/Log window\" \"<control>L\")\n"
3606 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3607 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3608 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3609 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3610 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3611 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3612 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3614 static gchar *old_sylpheed_menurc =
3615 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3616 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
3617 "(menu-path \"<Main>/File/Print...\" \"<alt>P\")\n"
3618 "(menu-path \"<Main>/File/Exit\" \"<alt>Q\")\n"
3620 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3621 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3622 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3623 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
3625 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
3626 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
3627 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3628 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3629 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3630 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3631 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3632 "(menu-path \"<Main>/View/Go to/Other folder...\" \"<alt>G\")\n"
3633 "(menu-path \"<Main>/View/Open in new window\" \"<shift><control>N\")\n"
3634 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3635 "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
3636 "(menu-path \"<Main>/View/Update\" \"<alt>U\")\n"
3638 "(menu-path \"<Main>/Message/Get new mail\" \"<alt>I\")\n"
3639 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><alt>I\")\n"
3640 "(menu-path \"<Main>/Message/Compose an email message\" \"<alt>N\")\n"
3641 "(menu-path \"<Main>/Message/Reply\" \"<alt>R\")\n"
3642 "(menu-path \"<Main>/Message/Reply to sender\" \"<control><alt>R\")\n"
3643 "(menu-path \"<Main>/Message/Reply to all\" \"<shift><alt>R\")\n"
3644 "(menu-path \"<Main>/Message/Forward\" \"<shift><alt>F\")\n"
3645 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift><control>F\")\n" */
3646 "(menu-path \"<Main>/Message/Move...\" \"<alt>O\")\n"
3647 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
3648 "(menu-path \"<Main>/Message/Delete\" \"<alt>D\")\n"
3649 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3650 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3651 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3652 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3654 "(menu-path \"<Main>/Tool/Address book\" \"<alt>A\")\n"
3655 "(menu-path \"<Main>/Tool/Execute\" \"<alt>X\")\n"
3656 "(menu-path \"<Main>/Tool/Log window\" \"<alt>L\")\n"
3658 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3659 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3660 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3661 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3662 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3663 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3664 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3666 static gchar *empty_menurc =
3667 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3668 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
3669 "(menu-path \"<Main>/File/Print...\" \"\")\n"
3670 "(menu-path \"<Main>/File/Exit\" \"\")\n"
3672 "(menu-path \"<Main>/Edit/Copy\" \"\")\n"
3673 "(menu-path \"<Main>/Edit/Select all\" \"\")\n"
3674 "(menu-path \"<Main>/Edit/Find in current message...\" \"\")\n"
3675 "(menu-path \"<Main>/Edit/Search folder...\" \"\")\n"
3677 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
3678 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
3679 "(menu-path \"<Main>/View/Thread view\" \"\")\n"
3680 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
3681 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
3682 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
3683 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
3684 "(menu-path \"<Main>/View/Go to/Other folder...\" \"\")\n"
3685 "(menu-path \"<Main>/View/Open in new window\" \"\")\n"
3686 "(menu-path \"<Main>/View/View source\" \"\")\n"
3687 "(menu-path \"<Main>/View/Show all header\" \"\")\n"
3688 "(menu-path \"<Main>/View/Update\" \"\")\n"
3690 "(menu-path \"<Main>/Message/Get new mail\" \"\")\n"
3691 "(menu-path \"<Main>/Message/Get from all accounts\" \"\")\n"
3692 "(menu-path \"<Main>/Message/Compose an email message\" \"\")\n"
3693 "(menu-path \"<Main>/Message/Reply\" \"\")\n"
3694 "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
3695 "(menu-path \"<Main>/Message/Reply to all\" \"\")\n"
3696 "(menu-path \"<Main>/Message/Forward\" \"\")\n"
3697 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
3698 "(menu-path \"<Main>/Message/Move...\" \"\")\n"
3699 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
3700 "(menu-path \"<Main>/Message/Delete\" \"\")\n"
3701 "(menu-path \"<Main>/Message/Mark/Mark\" \"\")\n"
3702 "(menu-path \"<Main>/Message/Mark/Unmark\" \"\")\n"
3703 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"\")\n"
3704 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3706 "(menu-path \"<Main>/Tool/Address book\" \"\")\n"
3707 "(menu-path \"<Main>/Tool/Execute\" \"\")\n"
3708 "(menu-path \"<Main>/Tool/Log window\" \"\")\n"
3710 "(menu-path \"<Compose>/File/Close\" \"\")\n"
3711 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3712 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
3713 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
3714 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
3715 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
3716 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
3718 text = gtk_entry_get_text(entry);
3720 if (!strcmp(text, _("Default")))
3721 rc_str = default_menurc;
3722 else if (!strcmp(text, "Mew / Wanderlust"))
3723 rc_str = mew_wl_menurc;
3724 else if (!strcmp(text, "Mutt"))
3725 rc_str = mutt_menurc;
3726 else if (!strcmp(text, _("Old Sylpheed")))
3727 rc_str = old_sylpheed_menurc;
3731 gtk_item_factory_parse_rc_string(empty_menurc);
3732 gtk_item_factory_parse_rc_string(rc_str);
3734 gtk_widget_destroy(keybind.window);
3735 keybind.window = NULL;
3736 keybind.combo = NULL;
3739 static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam)
3742 GtkWidget *menuitem;
3745 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
3746 menuitem = gtk_menu_get_active(GTK_MENU(menu));
3747 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
3748 g_free(*((gchar **)pparam->data));
3749 *((gchar **)pparam->data) = g_strdup(charset);
3752 static void prefs_common_charset_set_optmenu(PrefParam *pparam)
3755 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
3757 GtkWidget *menuitem;
3761 g_return_if_fail(optmenu != NULL);
3762 g_return_if_fail(*((gchar **)pparam->data) != NULL);
3764 menu = gtk_option_menu_get_menu(optmenu);
3765 for (cur = GTK_MENU_SHELL(menu)->children;
3766 cur != NULL; cur = cur->next) {
3767 menuitem = GTK_WIDGET(cur->data);
3768 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
3769 if (!strcmp(charset, *((gchar **)pparam->data))) {
3770 gtk_option_menu_set_history(optmenu, n);
3776 gtk_option_menu_set_history(optmenu, 0);
3777 prefs_common_charset_set_data_from_optmenu(pparam);
3780 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam)
3783 GtkWidget *menuitem;
3785 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
3786 menuitem = gtk_menu_get_active(GTK_MENU(menu));
3787 *((RecvDialogMode *)pparam->data) = GPOINTER_TO_INT
3788 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
3791 static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
3793 RecvDialogMode mode = *((RecvDialogMode *)pparam->data);
3794 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
3796 GtkWidget *menuitem;
3799 case RECV_DIALOG_ALWAYS:
3800 gtk_option_menu_set_history(optmenu, 0);
3802 case RECV_DIALOG_ACTIVE:
3803 gtk_option_menu_set_history(optmenu, 1);
3805 case RECV_DIALOG_NEVER:
3806 gtk_option_menu_set_history(optmenu, 2);
3811 menu = gtk_option_menu_get_menu(optmenu);
3812 menuitem = gtk_menu_get_active(GTK_MENU(menu));
3813 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
3816 static gint prefs_common_deleted(GtkWidget *widget, GdkEventAny *event,
3819 prefs_common_cancel();
3823 static void prefs_common_key_pressed(GtkWidget *widget, GdkEventKey *event,
3826 if (event && event->keyval == GDK_Escape)
3827 prefs_common_cancel();
3830 static void prefs_common_ok(void)
3832 prefs_common_apply();
3833 gtk_widget_hide(dialog.window);
3838 static void prefs_common_apply(void)
3840 gchar *entry_pixmap_theme_str;
3841 gboolean update_pixmap_theme;
3843 entry_pixmap_theme_str = gtk_entry_get_text(GTK_ENTRY(interface.entry_pixmap_theme));
3844 if (entry_pixmap_theme_str &&
3845 (strcmp(prefs_common.pixmap_theme_path, entry_pixmap_theme_str) != 0) )
3846 update_pixmap_theme = TRUE;
3848 update_pixmap_theme = FALSE;
3850 prefs_set_data_from_dialog(param);
3852 if (update_pixmap_theme)
3854 main_window_reflect_prefs_all_real(TRUE);
3855 compose_reflect_prefs_pixmap_theme();
3857 main_window_reflect_prefs_all_real(FALSE);
3859 prefs_common_save_config();
3861 inc_autocheck_timer_remove();
3862 inc_autocheck_timer_set();
3865 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam)
3868 GtkWidget *menuitem;
3870 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
3871 menuitem = gtk_menu_get_active(GTK_MENU(menu));
3872 *((NextUnreadMsgDialogShow *)pparam->data) = GPOINTER_TO_INT
3873 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
3876 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam)
3878 NextUnreadMsgDialogShow dialog_show;
3879 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
3881 GtkWidget *menuitem;
3883 dialog_show = *((NextUnreadMsgDialogShow *)pparam->data);
3885 switch (dialog_show) {
3886 case NEXTUNREADMSGDIALOG_ALWAYS:
3887 gtk_option_menu_set_history(optmenu, 0);
3889 case NEXTUNREADMSGDIALOG_ASSUME_YES:
3890 gtk_option_menu_set_history(optmenu, 1);
3892 case NEXTUNREADMSGDIALOG_ASSUME_NO:
3893 gtk_option_menu_set_history(optmenu, 2);
3898 menu = gtk_option_menu_get_menu(optmenu);
3899 menuitem = gtk_menu_get_active(GTK_MENU(menu));
3900 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
3903 static void prefs_common_cancel(void)
3905 gtk_widget_hide(dialog.window);
3910 static struct _ComposePrefs
3914 GtkWidget *close_btn;
3917 static void compose_prefs_key_pressed(GtkWidget *widget, GdkEventKey *event);
3918 static gint compose_prefs_delete_event(GtkWidget *widget, GdkEventAny *event);
3919 static void compose_prefs_close(GtkWidget *widget);
3920 static void compose_prefs_fmt_create(void);
3922 static void compose_prefs_close(GtkWidget *widget)
3924 gtk_widget_hide(composeprefs.window);
3927 static gint compose_prefs_delete_event(GtkWidget *widget, GdkEventAny *event)
3929 gtk_widget_hide(composeprefs.window);
3934 static void compose_prefs_key_pressed(GtkWidget *widget, GdkEventKey *event)
3936 if (event && event->keyval == GDK_Escape) {
3937 gtk_widget_hide(composeprefs.window);
3941 /* static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
3944 GtkWidget *menuitem;
3946 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
3947 menuitem = gtk_menu_get_active(GTK_MENU(menu));
3948 *((RecvDialogShow *)pparam->data) = GPOINTER_TO_INT
3949 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
3952 /* static void prefs_recvdialog_set_optmenu(PrefParam *pparam)
3954 RecvDialogShow dialog_show;
3955 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
3957 GtkWidget *menuitem;
3959 dialog_show = *((RecvDialogShow *)pparam->data);
3961 switch (dialog_show) {
3962 case RECVDIALOG_ALWAYS:
3963 gtk_option_menu_set_history(optmenu, 0);
3965 case RECVDIALOG_WINDOW_ACTIVE:
3966 gtk_option_menu_set_history(optmenu, 1);
3968 case RECVDIALOG_NEVER:
3969 gtk_option_menu_set_history(optmenu, 2);
3974 menu = gtk_option_menu_get_menu(optmenu);
3975 menuitem = gtk_menu_get_active(GTK_MENU(menu));
3976 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));