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"
62 PrefsCommon prefs_common;
64 static PrefsDialog dialog;
66 static struct Receive {
67 GtkWidget *checkbtn_incext;
68 GtkWidget *entry_incext;
69 GtkWidget *button_incext;
71 GtkWidget *checkbtn_local;
72 GtkWidget *checkbtn_filter_on_inc;
73 GtkWidget *entry_spool;
75 GtkWidget *checkbtn_autochk;
76 GtkWidget *spinbtn_autochk;
77 GtkObject *spinbtn_autochk_adj;
79 GtkWidget *checkbtn_chkonstartup;
80 GtkWidget *checkbtn_noerrorpanel;
81 GtkWidget *checkbtn_scan_after_inc;
84 GtkWidget *spinbtn_maxarticle;
85 GtkObject *spinbtn_maxarticle_adj;
89 GtkWidget *checkbtn_extsend;
90 GtkWidget *entry_extsend;
91 GtkWidget *button_extsend;
93 GtkWidget *checkbtn_savemsg;
94 GtkWidget *checkbtn_queuemsg;
96 GtkWidget *optmenu_charset;
98 GtkWidget *checkbtn_returnreceipt;
101 static struct Compose {
102 GtkWidget *checkbtn_autosig;
103 GtkWidget *entry_sigsep;
105 GtkWidget *entry_fw_quotemark;
106 GtkWidget *text_fw_quotefmt;
108 GtkWidget *checkbtn_autoextedit;
109 GtkWidget *spinbtn_undolevel;
110 GtkObject *spinbtn_undolevel_adj;
111 GtkWidget *checkbtn_reply_account_autosel;
112 GtkWidget *checkbtn_forward_account_autosel;
113 GtkWidget *checkbtn_reedit_account_autosel;
115 GtkWidget *spinbtn_linewrap;
116 GtkObject *spinbtn_linewrap_adj;
117 GtkWidget *checkbtn_wrapquote;
118 GtkWidget *checkbtn_wrapatsend;
120 GtkWidget *checkbtn_quote;
121 GtkWidget *checkbtn_forward_as_attachment;
122 GtkWidget *checkbtn_smart_wrapping;
123 GtkWidget *checkbtn_block_cursor;
124 GtkWidget *checkbtn_reply_with_quote;
129 static struct Spelling {
130 GtkWidget *checkbtn_enable_pspell;
131 GtkWidget *entry_pspell_path;
132 GtkWidget *btn_pspell_path;
133 GtkWidget *optmenu_dictionary;
134 GtkWidget *optmenu_sugmode;
135 GtkWidget *misspelled_btn;
136 GtkWidget *checkbtn_use_alternate;
137 GtkWidget *checkbtn_check_while_typing;
141 static struct Quote {
142 GtkWidget *entry_quotemark;
143 GtkWidget *text_quotefmt;
145 GtkWidget *entry_fw_quotemark;
146 GtkWidget *text_fw_quotefmt;
149 static struct Display {
150 GtkWidget *entry_textfont;
151 GtkWidget *button_textfont;
153 GtkWidget *entry_smallfont;
154 GtkWidget *entry_normalfont;
155 GtkWidget *entry_boldfont;
157 GtkWidget *chkbtn_folder_unread;
159 GtkWidget *chkbtn_transhdr;
161 GtkWidget *chkbtn_swapfrom;
162 GtkWidget *chkbtn_hscrollbar;
163 GtkWidget *chkbtn_useaddrbook;
164 GtkWidget *chkbtn_expand_thread;
165 GtkWidget *chkbtn_bold_unread;
167 GtkWidget *entry_datefmt;
170 static struct Message {
171 GtkWidget *chkbtn_enablecol;
172 GtkWidget *button_edit_col;
173 GtkWidget *chkbtn_mbalnum;
174 GtkWidget *chkbtn_disphdrpane;
175 GtkWidget *chkbtn_disphdr;
176 GtkWidget *spinbtn_linespc;
177 GtkObject *spinbtn_linespc_adj;
178 GtkWidget *chkbtn_headspc;
180 GtkWidget *chkbtn_smoothscroll;
181 GtkWidget *spinbtn_scrollstep;
182 GtkObject *spinbtn_scrollstep_adj;
183 GtkWidget *chkbtn_halfpage;
187 static struct Privacy {
188 GtkWidget *checkbtn_auto_check_signatures;
189 GtkWidget *checkbtn_gpg_signature_popup;
190 GtkWidget *checkbtn_passphrase_grab;
191 GtkWidget *checkbtn_gpg_warning;
192 GtkWidget *optmenu_default_signkey;
196 static struct Interface {
197 /* GtkWidget *checkbtn_emacs; */
198 GtkWidget *checkbtn_openunread;
199 GtkWidget *checkbtn_openinbox;
200 GtkWidget *checkbtn_immedexec;
201 GtkWidget *checkbtn_addaddrbyclick;
202 GtkWidget *optmenu_recvdialog;
203 GtkWidget *optmenu_nextunreadmsgdialog;
204 GtkWidget *entry_pixmap_theme;
205 GtkWidget *combo_pixmap_theme;
208 static struct Other {
209 GtkWidget *uri_combo;
210 GtkWidget *uri_entry;
211 GtkWidget *printcmd_entry;
212 GtkWidget *exteditor_combo;
213 GtkWidget *exteditor_entry;
214 GtkWidget *checkbtn_confonexit;
215 GtkWidget *checkbtn_cleanonexit;
216 GtkWidget *checkbtn_askonclean;
217 GtkWidget *checkbtn_warnqueued;
220 static struct MessageColorButtons {
221 GtkWidget *quote_level1_btn;
222 GtkWidget *quote_level2_btn;
223 GtkWidget *quote_level3_btn;
225 GtkWidget *tgt_folder_btn;
228 static struct KeybindDialog {
233 static GtkWidget *quote_desc_win;
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", "/usr/local/share/pspell/", &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_description_create (void);
767 static void prefs_quote_description_key_pressed (GtkWidget *widget,
771 static void prefs_quote_colors_dialog (void);
772 static void prefs_quote_colors_dialog_create (void);
773 static void prefs_quote_colors_key_pressed (GtkWidget *widget,
776 static void quote_color_set_dialog (GtkWidget *widget,
778 static void quote_colors_set_dialog_ok (GtkWidget *widget,
780 static void quote_colors_set_dialog_cancel (GtkWidget *widget,
782 static void quote_colors_set_dialog_key_pressed (GtkWidget *widget,
785 static void set_button_bg_color (GtkWidget *widget,
787 static void prefs_enable_message_color_toggled (void);
788 static void prefs_recycle_colors_toggled (GtkWidget *widget);
790 static void prefs_font_select (GtkButton *button, GtkEntry *entry);
792 static void prefs_font_selection_key_pressed (GtkWidget *widget,
795 static void prefs_font_selection_ok (GtkButton *button, GtkEntry *entry);
797 static void prefs_keybind_select (void);
798 static gint prefs_keybind_deleted (GtkWidget *widget,
801 static void prefs_keybind_key_pressed (GtkWidget *widget,
804 static void prefs_keybind_cancel (void);
805 static void prefs_keybind_apply_clicked (GtkWidget *widget);
807 static gint prefs_common_deleted (GtkWidget *widget,
810 static void prefs_common_key_pressed (GtkWidget *widget,
813 static void prefs_common_ok (void);
814 static void prefs_common_apply (void);
815 static void prefs_common_cancel (void);
817 void prefs_common_init() {
818 prefs_common.fltlist = NULL;
819 prefs_common.disphdr_list = NULL;
822 void prefs_common_read_config(void)
826 gchar buf[PREFSBUFSIZE];
828 prefs_read_config(param, "Common", COMMON_RC);
830 path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
832 if ((fp = fopen(path, "r")) == NULL) {
833 if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
838 while (fgets(buf, sizeof(buf), fp) != NULL) {
840 if (buf[0] == '\0') continue;
841 prefs_common.mime_open_cmd_history =
842 add_history(prefs_common.mime_open_cmd_history, buf);
846 prefs_common.mime_open_cmd_history =
847 g_list_reverse(prefs_common.mime_open_cmd_history);
850 void prefs_common_save_config(void)
856 prefs_save_config(param, "Common", COMMON_RC);
858 path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
860 if ((fp = fopen(path, "w")) == NULL) {
861 FILE_OP_ERROR(path, "fopen");
866 for (cur = prefs_common.mime_open_cmd_history;
867 cur != NULL; cur = cur->next) {
868 fputs((gchar *)cur->data, fp);
876 void prefs_common_open(void)
878 if (prefs_rc_is_readonly(COMMON_RC))
883 if (!dialog.window) {
884 prefs_common_create();
887 manage_window_set_transient(GTK_WINDOW(dialog.window));
888 gtk_notebook_set_page(GTK_NOTEBOOK(dialog.notebook), 0);
889 gtk_widget_grab_focus(dialog.ok_btn);
891 prefs_set_dialog(param);
893 gtk_widget_show(dialog.window);
896 static void prefs_common_create(void)
900 debug_print(_("Creating common preferences window...\n"));
902 prefs_dialog_create(&dialog);
903 gtk_window_set_title (GTK_WINDOW(dialog.window),
904 _("Common Preferences"));
905 gtk_signal_connect (GTK_OBJECT(dialog.window), "delete_event",
906 GTK_SIGNAL_FUNC(prefs_common_deleted), NULL);
907 gtk_signal_connect (GTK_OBJECT(dialog.window), "key_press_event",
908 GTK_SIGNAL_FUNC(prefs_common_key_pressed), NULL);
909 gtk_signal_connect (GTK_OBJECT(dialog.window), "focus_in_event",
910 GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
911 gtk_signal_connect (GTK_OBJECT(dialog.window), "focus_out_event",
912 GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
913 gtk_signal_connect (GTK_OBJECT(dialog.ok_btn), "clicked",
914 GTK_SIGNAL_FUNC(prefs_common_ok), NULL);
915 gtk_signal_connect (GTK_OBJECT(dialog.apply_btn), "clicked",
916 GTK_SIGNAL_FUNC(prefs_common_apply), NULL);
917 gtk_signal_connect_object (GTK_OBJECT(dialog.cancel_btn), "clicked",
918 GTK_SIGNAL_FUNC(prefs_common_cancel),
919 GTK_OBJECT(dialog.window));
921 /* create all widgets on notebook */
922 prefs_receive_create();
923 SET_NOTEBOOK_LABEL(dialog.notebook, _("Receive"), page++);
925 SET_NOTEBOOK_LABEL(dialog.notebook, _("Send"), page++);
926 prefs_compose_create();
927 SET_NOTEBOOK_LABEL(dialog.notebook, _("Compose"), page++);
929 prefs_spelling_create();
930 SET_NOTEBOOK_LABEL(dialog.notebook, _("Spell Checker"), page++);
932 prefs_quote_create();
933 SET_NOTEBOOK_LABEL(dialog.notebook, _("Quote"), page++);
934 prefs_display_create();
935 SET_NOTEBOOK_LABEL(dialog.notebook, _("Display"), page++);
936 prefs_message_create();
937 SET_NOTEBOOK_LABEL(dialog.notebook, _("Message"), page++);
939 prefs_privacy_create();
940 SET_NOTEBOOK_LABEL(dialog.notebook, _("Privacy"), page++);
942 prefs_interface_create();
943 SET_NOTEBOOK_LABEL(dialog.notebook, _("Interface"), page++);
944 prefs_other_create();
945 SET_NOTEBOOK_LABEL(dialog.notebook, _("Other"), page++);
947 gtk_widget_show_all(dialog.window);
950 static void prefs_receive_create(void)
954 GtkWidget *frame_incext;
955 GtkWidget *checkbtn_incext;
957 GtkWidget *label_incext;
958 GtkWidget *entry_incext;
959 /* GtkWidget *button_incext; */
961 GtkWidget *frame_spool;
962 GtkWidget *checkbtn_local;
963 GtkWidget *checkbtn_filter_on_inc;
964 GtkWidget *label_spool;
965 GtkWidget *entry_spool;
967 GtkWidget *hbox_autochk;
968 GtkWidget *checkbtn_autochk;
969 GtkWidget *label_autochk1;
970 GtkObject *spinbtn_autochk_adj;
971 GtkWidget *spinbtn_autochk;
972 GtkWidget *label_autochk2;
973 GtkWidget *checkbtn_chkonstartup;
974 GtkWidget *checkbtn_noerrorpanel;
975 GtkWidget *checkbtn_scan_after_inc;
978 GtkWidget *frame_news;
979 GtkWidget *label_maxarticle;
980 GtkWidget *spinbtn_maxarticle;
981 GtkObject *spinbtn_maxarticle_adj;
983 vbox1 = gtk_vbox_new (FALSE, VSPACING);
984 gtk_widget_show (vbox1);
985 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
986 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
988 PACK_FRAME(vbox1, frame_incext, _("External program"));
990 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
991 gtk_widget_show (vbox2);
992 gtk_container_add (GTK_CONTAINER (frame_incext), vbox2);
993 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
995 /* Use of external incorporation program */
996 PACK_CHECK_BUTTON (vbox2, checkbtn_incext,
997 _("Use external program for incorporation"));
999 hbox = gtk_hbox_new (FALSE, 8);
1000 gtk_widget_show (hbox);
1001 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1002 SET_TOGGLE_SENSITIVITY (checkbtn_incext, hbox);
1004 label_incext = gtk_label_new (_("Command"));
1005 gtk_widget_show (label_incext);
1006 gtk_box_pack_start (GTK_BOX (hbox), label_incext, FALSE, FALSE, 0);
1008 entry_incext = gtk_entry_new ();
1009 gtk_widget_show (entry_incext);
1010 gtk_box_pack_start (GTK_BOX (hbox), entry_incext, TRUE, TRUE, 0);
1013 button_incext = gtk_button_new_with_label ("... ");
1014 gtk_widget_show (button_incext);
1015 gtk_box_pack_start (GTK_BOX (hbox), button_incext, FALSE, FALSE, 0);
1018 PACK_FRAME(vbox1, frame_spool, _("Local spool"));
1020 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1021 gtk_widget_show (vbox2);
1022 gtk_container_add (GTK_CONTAINER (frame_spool), vbox2);
1023 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1025 hbox = gtk_hbox_new (FALSE, 32);
1026 gtk_widget_show (hbox);
1027 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1029 PACK_CHECK_BUTTON (hbox, checkbtn_local, _("Incorporate from spool"));
1030 PACK_CHECK_BUTTON (hbox, checkbtn_filter_on_inc,
1031 _("Filter on incorporation"));
1032 SET_TOGGLE_SENSITIVITY (checkbtn_local, checkbtn_filter_on_inc);
1034 hbox = gtk_hbox_new (FALSE, 8);
1035 gtk_widget_show (hbox);
1036 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1037 SET_TOGGLE_SENSITIVITY (checkbtn_local, hbox);
1039 label_spool = gtk_label_new (_("Spool directory"));
1040 gtk_widget_show (label_spool);
1041 gtk_box_pack_start (GTK_BOX (hbox), label_spool, FALSE, FALSE, 0);
1043 entry_spool = gtk_entry_new ();
1044 gtk_widget_show (entry_spool);
1045 gtk_box_pack_start (GTK_BOX (hbox), entry_spool, TRUE, TRUE, 0);
1047 vbox2 = gtk_vbox_new (FALSE, 0);
1048 gtk_widget_show (vbox2);
1049 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1052 hbox_autochk = gtk_hbox_new (FALSE, 8);
1053 gtk_widget_show (hbox_autochk);
1054 gtk_box_pack_start (GTK_BOX (vbox2), hbox_autochk, FALSE, FALSE, 0);
1056 PACK_CHECK_BUTTON (hbox_autochk, checkbtn_autochk,
1057 _("Auto-check new mail"));
1059 label_autochk1 = gtk_label_new (_("every"));
1060 gtk_widget_show (label_autochk1);
1061 gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk1, FALSE, FALSE, 0);
1063 spinbtn_autochk_adj = gtk_adjustment_new (5, 1, 100, 1, 10, 10);
1064 spinbtn_autochk = gtk_spin_button_new
1065 (GTK_ADJUSTMENT (spinbtn_autochk_adj), 1, 0);
1066 gtk_widget_show (spinbtn_autochk);
1067 gtk_box_pack_start (GTK_BOX (hbox_autochk), spinbtn_autochk, FALSE, FALSE, 0);
1068 gtk_widget_set_usize (spinbtn_autochk, 64, -1);
1069 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_autochk), TRUE);
1071 label_autochk2 = gtk_label_new (_("minute(s)"));
1072 gtk_widget_show (label_autochk2);
1073 gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk2, FALSE, FALSE, 0);
1075 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk1);
1076 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, spinbtn_autochk);
1077 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk2);
1079 PACK_CHECK_BUTTON (vbox2, checkbtn_chkonstartup,
1080 _("Check new mail on startup"));
1082 PACK_CHECK_BUTTON (vbox2, checkbtn_noerrorpanel,
1083 _("No error popup on receive error"));
1084 PACK_CHECK_BUTTON (vbox2, checkbtn_scan_after_inc,
1085 _("Update all local folders after incorporation"));
1087 PACK_FRAME(vbox1, frame_news, _("News"));
1089 hbox = gtk_hbox_new (FALSE, 8);
1090 gtk_widget_show (hbox);
1091 gtk_container_add (GTK_CONTAINER (frame_news), hbox);
1092 gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
1094 label_maxarticle = gtk_label_new
1095 (_("Maximum number of articles to download\n"
1096 "(unlimited if 0 is specified)"));
1097 gtk_widget_show (label_maxarticle);
1098 gtk_box_pack_start (GTK_BOX (hbox), label_maxarticle, FALSE, FALSE, 0);
1099 gtk_label_set_justify (GTK_LABEL (label_maxarticle), GTK_JUSTIFY_LEFT);
1101 spinbtn_maxarticle_adj =
1102 gtk_adjustment_new (300, 0, 10000, 10, 100, 100);
1103 spinbtn_maxarticle = gtk_spin_button_new
1104 (GTK_ADJUSTMENT (spinbtn_maxarticle_adj), 10, 0);
1105 gtk_widget_show (spinbtn_maxarticle);
1106 gtk_box_pack_start (GTK_BOX (hbox), spinbtn_maxarticle,
1108 gtk_widget_set_usize (spinbtn_maxarticle, 64, -1);
1109 gtk_spin_button_set_numeric
1110 (GTK_SPIN_BUTTON (spinbtn_maxarticle), TRUE);
1112 receive.checkbtn_incext = checkbtn_incext;
1113 receive.entry_incext = entry_incext;
1114 /* receive.button_incext = button_incext; */
1116 receive.checkbtn_local = checkbtn_local;
1117 receive.checkbtn_filter_on_inc = checkbtn_filter_on_inc;
1118 receive.entry_spool = entry_spool;
1120 receive.checkbtn_autochk = checkbtn_autochk;
1121 receive.spinbtn_autochk = spinbtn_autochk;
1122 receive.spinbtn_autochk_adj = spinbtn_autochk_adj;
1124 receive.checkbtn_chkonstartup = checkbtn_chkonstartup;
1125 receive.checkbtn_noerrorpanel = checkbtn_noerrorpanel;
1126 receive.checkbtn_scan_after_inc = checkbtn_scan_after_inc;
1129 receive.spinbtn_maxarticle = spinbtn_maxarticle;
1130 receive.spinbtn_maxarticle_adj = spinbtn_maxarticle_adj;
1133 static void prefs_send_create(void)
1137 GtkWidget *frame_extsend;
1138 GtkWidget *vbox_extsend;
1139 GtkWidget *checkbtn_extsend;
1141 GtkWidget *label_extsend;
1142 GtkWidget *entry_extsend;
1143 /* GtkWidget *button_extsend; */
1144 GtkWidget *checkbtn_savemsg;
1145 GtkWidget *checkbtn_queuemsg;
1146 GtkWidget *label_outcharset;
1148 GtkWidget *optmenu_menu;
1149 GtkWidget *menuitem;
1150 GtkWidget *checkbtn_returnreceipt;
1151 GtkWidget *label_charset_desc;
1153 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1154 gtk_widget_show (vbox1);
1155 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1156 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1158 PACK_FRAME(vbox1, frame_extsend, _("External program"));
1160 vbox_extsend = gtk_vbox_new (FALSE, VSPACING_NARROW);
1161 gtk_widget_show (vbox_extsend);
1162 gtk_container_add (GTK_CONTAINER (frame_extsend), vbox_extsend);
1163 gtk_container_set_border_width (GTK_CONTAINER (vbox_extsend), 8);
1165 PACK_CHECK_BUTTON (vbox_extsend, checkbtn_extsend,
1166 _("Use external program for sending"));
1168 hbox1 = gtk_hbox_new (FALSE, 8);
1169 gtk_widget_show (hbox1);
1170 gtk_box_pack_start (GTK_BOX (vbox_extsend), hbox1, FALSE, FALSE, 0);
1171 SET_TOGGLE_SENSITIVITY(checkbtn_extsend, hbox1);
1173 label_extsend = gtk_label_new (_("Command"));
1174 gtk_widget_show (label_extsend);
1175 gtk_box_pack_start (GTK_BOX (hbox1), label_extsend, FALSE, FALSE, 0);
1177 entry_extsend = gtk_entry_new ();
1178 gtk_widget_show (entry_extsend);
1179 gtk_box_pack_start (GTK_BOX (hbox1), entry_extsend, TRUE, TRUE, 0);
1182 button_extsend = gtk_button_new_with_label ("... ");
1183 gtk_widget_show (button_extsend);
1184 gtk_box_pack_start (GTK_BOX (hbox1), button_extsend, FALSE, FALSE, 0);
1187 vbox2 = gtk_vbox_new (FALSE, 0);
1188 gtk_widget_show (vbox2);
1189 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1191 PACK_CHECK_BUTTON (vbox2, checkbtn_savemsg,
1192 _("Save sent messages to outbox"));
1193 PACK_CHECK_BUTTON (vbox2, checkbtn_queuemsg,
1194 _("Queue messages that fail to send"));
1195 PACK_CHECK_BUTTON (vbox2, checkbtn_returnreceipt,
1196 _("Send return receipt on request"));
1198 hbox1 = gtk_hbox_new (FALSE, 8);
1199 gtk_widget_show (hbox1);
1200 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1202 label_outcharset = gtk_label_new (_("Outgoing codeset"));
1203 gtk_widget_show (label_outcharset);
1204 gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, FALSE, FALSE, 0);
1206 optmenu = gtk_option_menu_new ();
1207 gtk_widget_show (optmenu);
1208 gtk_box_pack_start (GTK_BOX (hbox1), optmenu, FALSE, FALSE, 0);
1210 optmenu_menu = gtk_menu_new ();
1212 #define SET_MENUITEM(str, charset) \
1214 MENUITEM_ADD(optmenu_menu, menuitem, str, charset); \
1217 SET_MENUITEM(_("Automatic (Recommended)"), CS_AUTO);
1218 SET_MENUITEM(_("7bit ascii (US-ASCII)"), CS_US_ASCII);
1220 SET_MENUITEM(_("Unicode (UTF-8)"), CS_UTF_8);
1222 SET_MENUITEM(_("Western European (ISO-8859-1)"), CS_ISO_8859_1);
1223 SET_MENUITEM(_("Central European (ISO-8859-2)"), CS_ISO_8859_2);
1224 SET_MENUITEM(_("Baltic (ISO-8859-13)"), CS_ISO_8859_13);
1225 SET_MENUITEM(_("Baltic (ISO-8859-4)"), CS_ISO_8859_4);
1226 SET_MENUITEM(_("Greek (ISO-8859-7)"), CS_ISO_8859_7);
1227 SET_MENUITEM(_("Turkish (ISO-8859-9)"), CS_ISO_8859_9);
1229 SET_MENUITEM(_("Cyrillic (ISO-8859-5)"), CS_ISO_8859_5);
1231 SET_MENUITEM(_("Cyrillic (KOI8-R)"), CS_KOI8_R);
1233 SET_MENUITEM(_("Cyrillic (Windows-1251)"), CS_CP1251);
1234 SET_MENUITEM(_("Cyrillic (KOI8-U)"), CS_KOI8_U);
1236 SET_MENUITEM(_("Japanese (ISO-2022-JP)"), CS_ISO_2022_JP);
1238 SET_MENUITEM(_("Japanese (EUC-JP)"), CS_EUC_JP);
1239 SET_MENUITEM(_("Japanese (Shift_JIS)"), CS_SHIFT_JIS);
1241 SET_MENUITEM(_("Simplified Chinese (GB2312)"), CS_GB2312);
1242 SET_MENUITEM(_("Traditional Chinese (Big5)"), CS_BIG5);
1244 SET_MENUITEM(_("Traditional Chinese (EUC-TW)"), CS_EUC_TW);
1245 SET_MENUITEM(_("Chinese (ISO-2022-CN)"), CS_ISO_2022_CN);
1247 SET_MENUITEM(_("Korean (EUC-KR)"), CS_EUC_KR);
1248 SET_MENUITEM(_("Thai (TIS-620)"), CS_TIS_620);
1249 SET_MENUITEM(_("Thai (Windows-874)"), CS_WINDOWS_874);
1251 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
1253 hbox1 = gtk_hbox_new (FALSE, 8);
1254 gtk_widget_show (hbox1);
1255 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1257 label_charset_desc = gtk_label_new
1258 (_("If `Automatic' is selected, the optimal encoding\n"
1259 "for the current locale will be used."));
1260 gtk_widget_show (label_charset_desc);
1261 gtk_box_pack_start (GTK_BOX (hbox1), label_charset_desc,
1263 gtk_label_set_justify(GTK_LABEL (label_charset_desc), GTK_JUSTIFY_LEFT);
1265 send.checkbtn_extsend = checkbtn_extsend;
1266 send.entry_extsend = entry_extsend;
1267 /* send.button_extsend = button_extsend; */
1269 send.checkbtn_savemsg = checkbtn_savemsg;
1270 send.checkbtn_queuemsg = checkbtn_queuemsg;
1271 send.checkbtn_returnreceipt = checkbtn_returnreceipt;
1273 send.optmenu_charset = optmenu;
1277 static void prefs_dictionary_set_data_from_optmenu(PrefParam *param)
1280 gchar *dict_fullname;
1282 g_return_if_fail(param);
1283 g_return_if_fail(param->data);
1284 g_return_if_fail(param->widget);
1285 g_return_if_fail(*(param->widget));
1287 dict_fullname = gtkpspell_get_dictionary_menu_active_item
1288 (gtk_option_menu_get_menu(GTK_OPTION_MENU(*(param->widget))));
1289 str = *((gchar **) param->data);
1292 *((gchar **) param->data) = dict_fullname;
1295 static void prefs_dictionary_set_optmenu(PrefParam *pparam)
1298 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
1300 GtkWidget *menuitem;
1304 g_return_if_fail(optmenu != NULL);
1305 g_return_if_fail(pparam->data != NULL);
1307 if (*(gchar **) pparam->data) {
1308 menu = gtk_option_menu_get_menu(optmenu);
1309 for (cur = GTK_MENU_SHELL(menu)->children;
1310 cur != NULL; cur = cur->next) {
1311 menuitem = GTK_WIDGET(cur->data);
1312 dict_name = gtk_object_get_data(GTK_OBJECT(menuitem),
1314 if (!strcmp2(dict_name, *((gchar **)pparam->data))) {
1315 gtk_option_menu_set_history(optmenu, n);
1322 gtk_option_menu_set_history(optmenu, 0);
1323 prefs_dictionary_set_data_from_optmenu(pparam);
1326 static void prefs_speller_sugmode_set_data_from_optmenu(PrefParam *param)
1329 g_return_if_fail(param);
1330 g_return_if_fail(param->data);
1331 g_return_if_fail(param->widget);
1332 g_return_if_fail(*(param->widget));
1334 sugmode = gtkpspell_get_sugmode_from_option_menu
1335 (GTK_OPTION_MENU(*(param->widget)));
1336 *((gint *) param->data) = sugmode;
1339 static void prefs_speller_sugmode_set_optmenu(PrefParam *pparam)
1341 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
1343 GtkWidget *menuitem;
1346 g_return_if_fail(optmenu != NULL);
1347 g_return_if_fail(pparam->data != NULL);
1349 sugmode = *(gint *) pparam->data;
1350 gtkpspell_sugmode_option_menu_set(optmenu, sugmode);
1354 static void prefs_spelling_checkbtn_enable_pspell_toggle_cb
1360 toggled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
1362 gtk_widget_set_sensitive(spelling.entry_pspell_path, toggled);
1363 gtk_widget_set_sensitive(spelling.optmenu_dictionary, toggled);
1364 gtk_widget_set_sensitive(spelling.optmenu_sugmode, toggled);
1365 gtk_widget_set_sensitive(spelling.btn_pspell_path, toggled);
1366 gtk_widget_set_sensitive(spelling.misspelled_btn, toggled);
1367 gtk_widget_set_sensitive(spelling.checkbtn_use_alternate, toggled);
1368 gtk_widget_set_sensitive(spelling.checkbtn_check_while_typing, toggled);
1371 static void prefs_spelling_btn_pspell_path_clicked_cb(GtkWidget *widget,
1374 gchar *file_path, *tmp;
1375 GtkWidget *new_menu;
1377 file_path = filesel_select_file(_("Select dictionaries location"),
1378 prefs_common.pspell_path);
1379 if (file_path == NULL) {
1383 tmp=g_dirname(file_path);
1385 if (prefs_common.pspell_path)
1386 g_free(prefs_common.pspell_path);
1387 prefs_common.pspell_path = g_strdup_printf("%s%s",tmp,
1390 new_menu = gtkpspell_dictionary_option_menu_new(prefs_common.pspell_path);
1391 gtk_option_menu_set_menu(GTK_OPTION_MENU(spelling.optmenu_dictionary),
1394 gtk_entry_set_text(GTK_ENTRY(spelling.entry_pspell_path),
1395 prefs_common.pspell_path);
1396 /* select first one */
1397 gtk_option_menu_set_history(GTK_OPTION_MENU(
1398 spelling.optmenu_dictionary), 0);
1400 if (prefs_common.dictionary)
1401 g_free(prefs_common.dictionary);
1403 prefs_common.dictionary =
1404 gtkpspell_get_dictionary_menu_active_item(
1405 gtk_option_menu_get_menu(
1407 spelling.optmenu_dictionary)));
1413 static void prefs_spelling_create()
1416 GtkWidget *frame_spell;
1417 GtkWidget *hbox_spell;
1418 GtkWidget *vbox_spell;
1419 GtkWidget *hbox_pspell_path;
1420 GtkWidget *checkbtn_enable_pspell;
1421 GtkWidget *label_pspell_path;
1422 GtkWidget *entry_pspell_path;
1423 GtkWidget *btn_pspell_path;
1424 GtkWidget *spell_table;
1425 GtkWidget *label_dictionary;
1426 GtkWidget *optmenu_dictionary;
1427 GtkWidget *sugmode_label;
1428 GtkWidget *sugmode_optmenu;
1429 GtkWidget *checkbtn_use_alternate;
1430 GtkWidget *help_label;
1431 GtkWidget *checkbtn_check_while_typing;
1432 GtkWidget *color_label;
1433 GtkWidget *hbox_col;
1434 GtkWidget *col_align;
1438 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1439 gtk_widget_show (vbox1);
1440 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1441 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1443 /* spell checker defaults */
1444 PACK_FRAME(vbox1, frame_spell, _("Global spelling checker settings"));
1445 vbox_spell = gtk_vbox_new(FALSE, VSPACING_NARROW);
1446 gtk_widget_show (vbox_spell);
1447 gtk_container_add(GTK_CONTAINER(frame_spell), vbox_spell);
1448 gtk_container_set_border_width(GTK_CONTAINER(vbox_spell), 8);
1450 PACK_CHECK_BUTTON(vbox_spell, checkbtn_enable_pspell,
1451 _("Enable spell checker (EXPERIMENTAL)"));
1453 gtk_signal_connect(GTK_OBJECT(checkbtn_enable_pspell), "toggled",
1454 GTK_SIGNAL_FUNC(prefs_spelling_checkbtn_enable_pspell_toggle_cb),
1457 /* Check while typing */
1458 PACK_CHECK_BUTTON(vbox_spell, checkbtn_check_while_typing,
1459 _("Check while typing"));
1461 PACK_CHECK_BUTTON(vbox_spell, checkbtn_use_alternate,
1462 _("Enable alternate dictionary"));
1464 help_label = gtk_label_new(_("Enabling alternate dictionary makes switching\nwith the last used dictionary faster."));
1465 gtk_widget_show(help_label);
1466 gtk_box_pack_start(GTK_BOX(vbox_spell), help_label, FALSE, TRUE, 0);
1468 spell_table = gtk_table_new(4, 3, FALSE);
1469 gtk_container_set_border_width (GTK_CONTAINER (spell_table), VSPACING);
1470 gtk_table_set_row_spacings(GTK_TABLE(spell_table), 8);
1471 gtk_table_set_col_spacings(GTK_TABLE(spell_table), 8);
1473 gtk_box_pack_start(GTK_BOX(vbox_spell), spell_table, TRUE, TRUE, 0);
1475 label_pspell_path = gtk_label_new (_("Dictionaries path:"));
1476 gtk_misc_set_alignment(GTK_MISC(label_pspell_path), 1.0, 0.5);
1477 gtk_widget_show(label_pspell_path);
1478 gtk_table_attach (GTK_TABLE (spell_table), label_pspell_path, 0, 1, 0,
1479 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1481 hbox_pspell_path = gtk_hbox_new (FALSE, 8);
1482 gtk_table_attach (GTK_TABLE (spell_table), hbox_pspell_path, 1, 2, 0,
1483 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1484 gtk_widget_show(hbox_pspell_path);
1486 entry_pspell_path = gtk_entry_new();
1487 gtk_widget_show(entry_pspell_path);
1488 gtk_box_pack_start(GTK_BOX(hbox_pspell_path), entry_pspell_path, TRUE,
1491 gtk_widget_set_sensitive(entry_pspell_path, prefs_common.enable_pspell);
1493 btn_pspell_path = gtk_button_new_with_label(" ... ");
1494 gtk_widget_show(btn_pspell_path);
1495 gtk_box_pack_start(GTK_BOX(hbox_pspell_path), btn_pspell_path, FALSE, FALSE, 0);
1496 gtk_widget_set_sensitive(btn_pspell_path, prefs_common.enable_pspell);
1498 gtk_signal_connect(GTK_OBJECT(btn_pspell_path), "clicked",
1499 GTK_SIGNAL_FUNC(prefs_spelling_btn_pspell_path_clicked_cb),
1502 label_dictionary = gtk_label_new(_("Default dictionary:"));
1503 gtk_misc_set_alignment(GTK_MISC(label_dictionary), 1.0, 0.5);
1504 gtk_widget_show(label_dictionary);
1505 gtk_table_attach (GTK_TABLE (spell_table), label_dictionary, 0, 1, 1, 2,
1506 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1508 optmenu_dictionary = gtk_option_menu_new();
1509 gtk_widget_show(optmenu_dictionary);
1510 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_dictionary),
1511 gtkpspell_dictionary_option_menu_new(
1512 prefs_common.pspell_path));
1513 gtk_table_attach (GTK_TABLE (spell_table), optmenu_dictionary, 1, 2, 1,
1514 2, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1515 gtk_widget_set_sensitive(optmenu_dictionary, prefs_common.enable_pspell);
1517 /* Suggestion mode */
1518 sugmode_label = gtk_label_new(_("Default suggestion mode"));
1519 gtk_misc_set_alignment(GTK_MISC(sugmode_label), 1.0, 0.5);
1520 gtk_widget_show(sugmode_label);
1521 gtk_table_attach(GTK_TABLE (spell_table), sugmode_label, 0, 1, 2, 3,
1522 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1524 sugmode_optmenu = gtk_option_menu_new();
1525 gtk_widget_show(sugmode_optmenu);
1526 gtk_option_menu_set_menu(GTK_OPTION_MENU(sugmode_optmenu),
1527 gtkpspell_sugmode_option_menu_new(prefs_common.pspell_sugmode));
1528 gtk_table_attach(GTK_TABLE(spell_table), sugmode_optmenu, 1, 2, 2, 3,
1529 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1530 gtk_widget_set_sensitive(sugmode_optmenu, prefs_common.enable_pspell);
1533 color_label = gtk_label_new(_("Misspelled word color:"));
1534 gtk_misc_set_alignment(GTK_MISC(color_label), 1.0, 0.5);
1535 gtk_table_attach (GTK_TABLE (spell_table), color_label, 0, 1, 3, 4,
1536 GTK_FILL, GTK_SHRINK, 0, 0);
1537 gtk_widget_show(color_label);
1539 col_align = gtk_alignment_new(0.0, 0.5, 0, 0);
1540 gtk_widget_show(col_align);
1541 gtk_table_attach (GTK_TABLE (spell_table), col_align, 1, 2, 3, 4,
1542 GTK_FILL, GTK_SHRINK, 0, 0);
1544 spelling.misspelled_btn = gtk_button_new_with_label ("");
1545 set_button_bg_color(spelling.misspelled_btn,
1546 prefs_common.misspelled_col);
1547 gtk_widget_set_usize (spelling.misspelled_btn, 30, 20);
1548 gtk_widget_set_sensitive(spelling.misspelled_btn, prefs_common.enable_pspell);
1549 gtk_signal_connect (GTK_OBJECT (spelling.misspelled_btn), "clicked",
1550 GTK_SIGNAL_FUNC(quote_color_set_dialog), "Misspelled word");
1551 gtk_container_add(GTK_CONTAINER(col_align), spelling.misspelled_btn);
1554 spelling.checkbtn_enable_pspell = checkbtn_enable_pspell;
1555 spelling.entry_pspell_path = entry_pspell_path;
1556 spelling.btn_pspell_path = btn_pspell_path;
1557 spelling.optmenu_dictionary = optmenu_dictionary;
1558 spelling.optmenu_sugmode = sugmode_optmenu;
1559 spelling.checkbtn_use_alternate = checkbtn_use_alternate;
1560 spelling.checkbtn_check_while_typing = checkbtn_check_while_typing;
1566 static void prefs_compose_create(void)
1573 GtkWidget *btn_quotefmt;
1575 GtkWidget *frame_sig;
1576 GtkWidget *vbox_sig;
1577 GtkWidget *checkbtn_autosig;
1578 GtkWidget *label_sigsep;
1579 GtkWidget *entry_sigsep;
1581 GtkWidget *frame_editor;
1582 GtkWidget *hbox_editor;
1583 GtkWidget *checkbtn_autoextedit;
1585 GtkWidget *frame_autosel;
1586 GtkWidget *hbox_autosel;
1587 GtkWidget *vbox_autosel;
1588 GtkWidget *checkbtn_reply_account_autosel;
1589 GtkWidget *checkbtn_forward_account_autosel;
1590 GtkWidget *checkbtn_reedit_account_autosel;
1592 GtkWidget *hbox_undolevel;
1593 GtkWidget *label_undolevel;
1594 GtkObject *spinbtn_undolevel_adj;
1595 GtkWidget *spinbtn_undolevel;
1597 GtkWidget *vbox_linewrap;
1602 GtkWidget *label_linewrap;
1603 GtkObject *spinbtn_linewrap_adj;
1604 GtkWidget *spinbtn_linewrap;
1605 GtkWidget *checkbtn_wrapquote;
1606 GtkWidget *checkbtn_wrapatsend;
1608 GtkWidget *frame_reply;
1609 GtkWidget *checkbtn_quote;
1610 GtkWidget *checkbtn_forward_as_attachment;
1611 GtkWidget *checkbtn_smart_wrapping;
1612 GtkWidget *checkbtn_block_cursor;
1614 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1615 gtk_widget_show (vbox1);
1616 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1617 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1621 hbox1 = gtk_hbox_new (FALSE, 32);
1622 gtk_widget_show (hbox1);
1624 hbox2 = gtk_hbox_new (FALSE, 8);
1625 gtk_widget_show (hbox2);
1626 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
1629 hbox1 = gtk_hbox_new (FALSE, 32);
1630 gtk_widget_show (hbox1);
1631 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1633 PACK_FRAME(vbox1, frame_sig, _("Signature"));
1635 vbox_sig = gtk_vbox_new (FALSE, VSPACING_NARROW);
1636 gtk_widget_show (vbox_sig);
1637 gtk_container_add (GTK_CONTAINER (frame_sig), vbox_sig);
1638 gtk_container_set_border_width (GTK_CONTAINER (vbox_sig), 8);
1640 PACK_CHECK_BUTTON (vbox_sig, checkbtn_autosig,
1641 _("Insert signature automatically"));
1643 hbox1 = gtk_hbox_new (FALSE, 8);
1644 gtk_widget_show (hbox1);
1645 gtk_box_pack_start (GTK_BOX (vbox_sig), hbox1, TRUE, TRUE, 0);
1646 label_sigsep = gtk_label_new (_("Signature separator"));
1647 gtk_widget_show (label_sigsep);
1648 gtk_box_pack_start (GTK_BOX (hbox1), label_sigsep, FALSE, FALSE, 0);
1650 entry_sigsep = gtk_entry_new ();
1651 gtk_widget_show (entry_sigsep);
1652 gtk_box_pack_start (GTK_BOX (hbox1), entry_sigsep, FALSE, FALSE, 0);
1654 gtk_widget_set_usize (entry_sigsep, 64, -1);
1656 /* Account autoselection */
1657 PACK_FRAME(vbox1, frame_autosel, _("Automatic Account Selection"));
1659 hbox_autosel = gtk_hbox_new (FALSE, VSPACING_NARROW);
1660 gtk_widget_show (hbox_autosel);
1661 gtk_container_add (GTK_CONTAINER (frame_autosel), hbox_autosel);
1662 gtk_container_set_border_width (GTK_CONTAINER (hbox_autosel), 8);
1664 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reply_account_autosel,
1665 _("when replying"));
1666 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_forward_account_autosel,
1667 _("when forwarding"));
1668 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reedit_account_autosel,
1669 _("when re-editing"));
1671 vbox2 = gtk_vbox_new (FALSE, 0);
1672 gtk_widget_show (vbox2);
1673 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1675 PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
1676 _("Automatically launch the external editor"));
1678 PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
1681 vbox_linewrap = gtk_vbox_new (FALSE, VSPACING_NARROW);
1682 gtk_widget_show (vbox_linewrap);
1683 gtk_box_pack_start (GTK_BOX (vbox1), vbox_linewrap, FALSE, FALSE, 0);
1685 hbox3 = gtk_hbox_new (FALSE, 8);
1686 gtk_widget_show (hbox3);
1687 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox3, FALSE, FALSE, 0);
1690 label_linewrap = gtk_label_new (_("Wrap messages at"));
1691 gtk_widget_show (label_linewrap);
1692 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1694 spinbtn_linewrap_adj = gtk_adjustment_new (72, 20, 1024, 1, 10, 10);
1695 spinbtn_linewrap = gtk_spin_button_new
1696 (GTK_ADJUSTMENT (spinbtn_linewrap_adj), 1, 0);
1697 gtk_widget_show (spinbtn_linewrap);
1698 gtk_box_pack_start (GTK_BOX (hbox3), spinbtn_linewrap, FALSE, FALSE, 0);
1699 gtk_widget_set_usize (spinbtn_linewrap, 64, -1);
1700 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linewrap), TRUE);
1702 label_linewrap = gtk_label_new (_("characters"));
1703 gtk_widget_show (label_linewrap);
1704 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1706 PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
1708 hbox4 = gtk_hbox_new (FALSE, 32);
1709 gtk_widget_show (hbox4);
1710 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox4, FALSE, FALSE, 0);
1712 PACK_CHECK_BUTTON (hbox4, checkbtn_wrapquote, _("Wrap quotation"));
1714 (hbox4, checkbtn_wrapatsend, _("Wrap before sending"));
1716 PACK_CHECK_BUTTON (vbox1, checkbtn_forward_as_attachment,
1717 _("Forward as attachment"));
1719 PACK_CHECK_BUTTON (vbox1, checkbtn_smart_wrapping,
1720 _("Smart wrapping (EXPERIMENTAL)"));
1722 PACK_CHECK_BUTTON (vbox1, checkbtn_block_cursor,
1725 PACK_VSPACER (vbox2, vbox3, VSPACING_NARROW_2);
1727 hbox_undolevel = gtk_hbox_new (FALSE, 8);
1728 gtk_widget_show (hbox3);
1729 gtk_box_pack_start (GTK_BOX (vbox1), hbox_undolevel, FALSE, FALSE, 0);
1731 label_undolevel = gtk_label_new (_("Undo level"));
1732 gtk_widget_show (label_undolevel);
1733 gtk_box_pack_start (GTK_BOX (hbox_undolevel), label_undolevel, FALSE, FALSE, 0);
1735 spinbtn_undolevel_adj = gtk_adjustment_new (50, 0, 100, 1, 10, 10);
1736 spinbtn_undolevel = gtk_spin_button_new
1737 (GTK_ADJUSTMENT (spinbtn_undolevel_adj), 1, 0);
1738 gtk_widget_show (spinbtn_undolevel);
1739 gtk_box_pack_start (GTK_BOX (hbox_undolevel), spinbtn_undolevel, FALSE, FALSE, 0);
1740 gtk_widget_set_usize (spinbtn_undolevel, 64, -1);
1741 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevel), TRUE);
1744 compose.checkbtn_quote = checkbtn_quote;
1745 compose.entry_quotemark = entry_quotemark;
1746 compose.text_quotefmt = text_quotefmt;
1748 compose.checkbtn_autosig = checkbtn_autosig;
1749 compose.entry_sigsep = entry_sigsep;
1751 compose.checkbtn_autoextedit = checkbtn_autoextedit;
1753 compose.checkbtn_reply_account_autosel = checkbtn_reply_account_autosel;
1754 compose.checkbtn_forward_account_autosel = checkbtn_forward_account_autosel;
1755 compose.checkbtn_reedit_account_autosel = checkbtn_reedit_account_autosel;
1757 compose.spinbtn_undolevel = spinbtn_undolevel;
1758 compose.spinbtn_undolevel_adj = spinbtn_undolevel_adj;
1760 compose.spinbtn_linewrap = spinbtn_linewrap;
1761 compose.spinbtn_linewrap_adj = spinbtn_linewrap_adj;
1762 compose.checkbtn_wrapquote = checkbtn_wrapquote;
1763 compose.checkbtn_wrapatsend = checkbtn_wrapatsend;
1765 compose.checkbtn_forward_as_attachment =
1766 checkbtn_forward_as_attachment;
1767 compose.checkbtn_smart_wrapping =
1768 checkbtn_smart_wrapping;
1769 compose.checkbtn_block_cursor =
1770 checkbtn_block_cursor;
1774 static void prefs_quote_create(void)
1777 GtkWidget *frame_quote;
1778 GtkWidget *vbox_quote;
1781 GtkWidget *label_quotemark;
1782 GtkWidget *entry_quotemark;
1783 GtkWidget *scrolledwin_quotefmt;
1784 GtkWidget *text_quotefmt;
1786 GtkWidget *entry_fw_quotemark;
1787 GtkWidget *text_fw_quotefmt;
1789 GtkWidget *btn_quotedesc;
1791 GtkWidget *checkbtn_reply_with_quote;
1793 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1794 gtk_widget_show (vbox1);
1795 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1796 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1800 PACK_CHECK_BUTTON (vbox1, checkbtn_reply_with_quote, _("Reply will quote by default"));
1802 PACK_FRAME (vbox1, frame_quote, _("Reply format"));
1804 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
1805 gtk_widget_show (vbox_quote);
1806 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
1807 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
1809 hbox1 = gtk_hbox_new (FALSE, 32);
1810 gtk_widget_show (hbox1);
1811 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
1813 hbox2 = gtk_hbox_new (FALSE, 8);
1814 gtk_widget_show (hbox2);
1815 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
1817 label_quotemark = gtk_label_new (_("Quotation mark"));
1818 gtk_widget_show (label_quotemark);
1819 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
1821 entry_quotemark = gtk_entry_new ();
1822 gtk_widget_show (entry_quotemark);
1823 gtk_box_pack_start (GTK_BOX (hbox2), entry_quotemark, FALSE, FALSE, 0);
1824 gtk_widget_set_usize (entry_quotemark, 64, -1);
1826 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
1827 gtk_widget_show (scrolledwin_quotefmt);
1828 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
1829 gtk_scrolled_window_set_policy
1830 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
1831 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
1833 text_quotefmt = gtk_text_new (NULL, NULL);
1834 gtk_widget_show (text_quotefmt);
1835 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt), text_quotefmt);
1836 gtk_text_set_editable (GTK_TEXT (text_quotefmt), TRUE);
1837 gtk_widget_set_usize(text_quotefmt, -1, 60);
1841 PACK_FRAME (vbox1, frame_quote, _("Forward format"));
1843 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
1844 gtk_widget_show (vbox_quote);
1845 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
1846 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
1848 hbox1 = gtk_hbox_new (FALSE, 32);
1849 gtk_widget_show (hbox1);
1850 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
1852 hbox2 = gtk_hbox_new (FALSE, 8);
1853 gtk_widget_show (hbox2);
1854 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
1856 label_quotemark = gtk_label_new (_("Quotation mark"));
1857 gtk_widget_show (label_quotemark);
1858 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
1860 entry_fw_quotemark = gtk_entry_new ();
1861 gtk_widget_show (entry_fw_quotemark);
1862 gtk_box_pack_start (GTK_BOX (hbox2), entry_fw_quotemark,
1864 gtk_widget_set_usize (entry_fw_quotemark, 64, -1);
1866 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
1867 gtk_widget_show (scrolledwin_quotefmt);
1868 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
1869 gtk_scrolled_window_set_policy
1870 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
1871 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
1873 text_fw_quotefmt = gtk_text_new (NULL, NULL);
1874 gtk_widget_show (text_fw_quotefmt);
1875 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt),
1877 gtk_text_set_editable (GTK_TEXT (text_fw_quotefmt), TRUE);
1878 gtk_widget_set_usize(text_fw_quotefmt, -1, 60);
1880 hbox1 = gtk_hbox_new (FALSE, 32);
1881 gtk_widget_show (hbox1);
1882 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1885 gtk_button_new_with_label (_(" Description of symbols "));
1886 gtk_widget_show (btn_quotedesc);
1887 gtk_box_pack_start (GTK_BOX (hbox1), btn_quotedesc, FALSE, FALSE, 0);
1888 gtk_signal_connect(GTK_OBJECT(btn_quotedesc), "clicked",
1889 GTK_SIGNAL_FUNC(prefs_quote_description), NULL);
1891 compose.checkbtn_reply_with_quote= checkbtn_reply_with_quote;
1892 quote.entry_quotemark = entry_quotemark;
1893 quote.text_quotefmt = text_quotefmt;
1894 quote.entry_fw_quotemark = entry_fw_quotemark;
1895 quote.text_fw_quotefmt = text_fw_quotefmt;
1898 static void prefs_display_create(void)
1901 GtkWidget *frame_font;
1903 GtkWidget *label_textfont;
1904 GtkWidget *entry_textfont;
1905 GtkWidget *button_textfont;
1906 GtkWidget *chkbtn_folder_unread;
1907 GtkWidget *chkbtn_transhdr;
1908 GtkWidget *frame_summary;
1910 GtkWidget *chkbtn_swapfrom;
1911 GtkWidget *chkbtn_hscrollbar;
1912 GtkWidget *chkbtn_useaddrbook;
1913 GtkWidget *chkbtn_expand_thread;
1914 GtkWidget *chkbtn_bold_unread;
1917 GtkWidget *label_datefmt;
1918 GtkWidget *button_datefmt;
1919 GtkWidget *entry_datefmt;
1920 GtkWidget *button_dispitem;
1921 GtkWidget *tmplabel, *tmpbutton, *tmpentry;
1923 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1924 gtk_widget_show (vbox1);
1925 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1926 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1928 PACK_FRAME(vbox1, frame_font, _("Font"));
1930 table1 = gtk_table_new (4, 3, FALSE);
1932 gtk_widget_show (table1);
1933 gtk_container_add (GTK_CONTAINER (frame_font), table1);
1934 gtk_container_set_border_width (GTK_CONTAINER (table1), 8);
1935 gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
1936 gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
1938 label_textfont = gtk_label_new (_("Text"));
1939 gtk_misc_set_alignment(GTK_MISC(label_textfont), 0, 0.5);
1940 gtk_widget_show (label_textfont);
1941 gtk_table_attach (GTK_TABLE (table1), label_textfont, 0, 1, 0, 1,
1942 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1944 entry_textfont = gtk_entry_new ();
1945 gtk_widget_show (entry_textfont);
1946 gtk_table_attach (GTK_TABLE (table1), entry_textfont, 1, 2, 0, 1,
1947 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
1949 button_textfont = gtk_button_new_with_label (" ... ");
1951 gtk_widget_show (button_textfont);
1952 gtk_table_attach (GTK_TABLE (table1), button_textfont, 2, 3, 0, 1,
1954 gtk_signal_connect (GTK_OBJECT (button_textfont), "clicked",
1955 GTK_SIGNAL_FUNC (prefs_font_select), entry_textfont);
1957 tmplabel = gtk_label_new (_("Small"));
1958 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
1959 gtk_widget_show (tmplabel);
1960 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 1, 2,
1961 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1963 tmpentry = gtk_entry_new ();
1964 gtk_widget_show (tmpentry);
1965 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 1, 2,
1966 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
1968 tmpbutton = gtk_button_new_with_label (" ... ");
1969 gtk_widget_show (tmpbutton);
1970 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 1, 2,
1972 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
1973 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
1974 display.entry_smallfont = tmpentry;
1976 tmplabel = gtk_label_new (_("Normal"));
1977 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
1978 gtk_widget_show (tmplabel);
1979 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 2, 3,
1980 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1982 tmpentry = gtk_entry_new ();
1983 gtk_widget_show (tmpentry);
1984 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 2, 3,
1985 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
1987 tmpbutton = gtk_button_new_with_label (" ... ");
1988 gtk_widget_show (tmpbutton);
1989 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 2, 3,
1991 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
1992 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
1993 display.entry_normalfont = tmpentry;
1995 tmplabel = gtk_label_new (_("Bold"));
1996 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
1997 gtk_widget_show (tmplabel);
1998 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 3, 4,
1999 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2001 tmpentry = gtk_entry_new ();
2002 gtk_widget_show (tmpentry);
2003 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 3, 4,
2004 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2006 tmpbutton = gtk_button_new_with_label (" ... ");
2007 gtk_widget_show (tmpbutton);
2008 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 3, 4,
2010 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2011 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2012 display.entry_boldfont = tmpentry;
2014 vbox2 = gtk_vbox_new (FALSE, 0);
2015 gtk_widget_show (vbox2);
2016 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, TRUE, 0);
2019 (vbox2, chkbtn_transhdr,
2020 _("Translate header name (such as `From:', `Subject:')"));
2022 PACK_CHECK_BUTTON (vbox2, chkbtn_folder_unread,
2023 _("Display unread number next to folder name"));
2025 /* ---- Summary ---- */
2027 PACK_FRAME(vbox1, frame_summary, _("Summary View"));
2029 vbox2 = gtk_vbox_new (FALSE, 0);
2030 gtk_widget_show (vbox2);
2031 gtk_container_add (GTK_CONTAINER (frame_summary), vbox2);
2032 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
2035 (vbox2, chkbtn_swapfrom,
2036 _("Display recipient on `From' column if sender is yourself"));
2038 (vbox2, chkbtn_useaddrbook,
2039 _("Display sender using address book"));
2041 (vbox2, chkbtn_hscrollbar, _("Enable horizontal scroll bar"));
2043 (vbox2, chkbtn_expand_thread, _("Expand threads"));
2045 (vbox2, chkbtn_bold_unread,
2046 _("Display unread messages with bold font"));
2048 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2050 hbox1 = gtk_hbox_new (FALSE, 8);
2051 gtk_widget_show (hbox1);
2052 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2054 label_datefmt = gtk_label_new (_("Date format"));
2055 gtk_widget_show (label_datefmt);
2056 gtk_box_pack_start (GTK_BOX (hbox1), label_datefmt, FALSE, FALSE, 0);
2058 entry_datefmt = gtk_entry_new ();
2059 gtk_widget_show (entry_datefmt);
2060 gtk_box_pack_start (GTK_BOX (hbox1), entry_datefmt, TRUE, TRUE, 0);
2062 button_datefmt = gtk_button_new_with_label (" ... ");
2064 gtk_widget_show (button_datefmt);
2065 gtk_box_pack_start (GTK_BOX (hbox1), button_datefmt, FALSE, FALSE, 0);
2066 gtk_signal_connect (GTK_OBJECT (button_datefmt), "clicked",
2067 GTK_SIGNAL_FUNC (date_format_create), NULL);
2069 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
2071 hbox1 = gtk_hbox_new (FALSE, 8);
2072 gtk_widget_show (hbox1);
2073 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2075 button_dispitem = gtk_button_new_with_label
2076 (_(" Set display item of summary... "));
2077 gtk_widget_show (button_dispitem);
2078 gtk_box_pack_start (GTK_BOX (hbox1), button_dispitem, FALSE, TRUE, 0);
2079 gtk_signal_connect (GTK_OBJECT (button_dispitem), "clicked",
2080 GTK_SIGNAL_FUNC (prefs_summary_column_open),
2083 display.entry_textfont = entry_textfont;
2084 display.button_textfont = button_textfont;
2086 display.chkbtn_folder_unread = chkbtn_folder_unread;
2087 display.chkbtn_transhdr = chkbtn_transhdr;
2089 display.chkbtn_swapfrom = chkbtn_swapfrom;
2090 display.chkbtn_hscrollbar = chkbtn_hscrollbar;
2091 display.chkbtn_expand_thread = chkbtn_expand_thread;
2092 display.chkbtn_bold_unread = chkbtn_bold_unread;
2093 display.chkbtn_useaddrbook = chkbtn_useaddrbook;
2094 display.entry_datefmt = entry_datefmt;
2097 static void prefs_message_create(void)
2103 GtkWidget *chkbtn_enablecol;
2104 GtkWidget *button_edit_col;
2105 GtkWidget *chkbtn_mbalnum;
2106 GtkWidget *chkbtn_disphdrpane;
2107 GtkWidget *chkbtn_disphdr;
2108 GtkWidget *button_edit_disphdr;
2109 GtkWidget *hbox_linespc;
2110 GtkWidget *label_linespc;
2111 GtkObject *spinbtn_linespc_adj;
2112 GtkWidget *spinbtn_linespc;
2113 GtkWidget *chkbtn_headspc;
2115 GtkWidget *frame_scr;
2116 GtkWidget *vbox_scr;
2117 GtkWidget *chkbtn_smoothscroll;
2118 GtkWidget *hbox_scr;
2119 GtkWidget *label_scr;
2120 GtkObject *spinbtn_scrollstep_adj;
2121 GtkWidget *spinbtn_scrollstep;
2122 GtkWidget *chkbtn_halfpage;
2124 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2125 gtk_widget_show (vbox1);
2126 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2127 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2129 hbox1 = gtk_hbox_new (FALSE, 8);
2130 gtk_widget_show (hbox1);
2131 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, TRUE, 0);
2133 PACK_CHECK_BUTTON (hbox1, chkbtn_enablecol,
2134 _("Enable coloration of message"));
2135 gtk_signal_connect (GTK_OBJECT (chkbtn_enablecol), "toggled",
2136 GTK_SIGNAL_FUNC (prefs_enable_message_color_toggled),
2139 button_edit_col = gtk_button_new_with_label (_(" Edit... "));
2140 gtk_widget_show (button_edit_col);
2141 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_col, FALSE, TRUE, 0);
2142 gtk_signal_connect (GTK_OBJECT (button_edit_col), "clicked",
2143 GTK_SIGNAL_FUNC (prefs_quote_colors_dialog), NULL);
2145 SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, button_edit_col);
2147 vbox2 = gtk_vbox_new (FALSE, 0);
2148 gtk_widget_show (vbox2);
2149 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2152 (vbox2, chkbtn_mbalnum,
2153 _("Display 2-byte alphabet and numeric with 1-byte character"));
2154 PACK_CHECK_BUTTON(vbox2, chkbtn_disphdrpane,
2155 _("Display header pane above message view"));
2157 hbox1 = gtk_hbox_new (FALSE, 8);
2158 gtk_widget_show (hbox1);
2159 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2161 PACK_CHECK_BUTTON(hbox1, chkbtn_disphdr,
2162 _("Display short headers on message view"));
2164 button_edit_disphdr = gtk_button_new_with_label (_(" Edit... "));
2165 gtk_widget_show (button_edit_disphdr);
2166 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_disphdr,
2168 gtk_signal_connect (GTK_OBJECT (button_edit_disphdr), "clicked",
2169 GTK_SIGNAL_FUNC (prefs_display_header_open),
2172 SET_TOGGLE_SENSITIVITY(chkbtn_disphdr, button_edit_disphdr);
2174 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2176 hbox1 = gtk_hbox_new (FALSE, 32);
2177 gtk_widget_show (hbox1);
2178 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2180 hbox_linespc = gtk_hbox_new (FALSE, 8);
2181 gtk_widget_show (hbox1);
2182 gtk_box_pack_start (GTK_BOX (hbox1), hbox_linespc, FALSE, TRUE, 0);
2184 label_linespc = gtk_label_new (_("Line space"));
2185 gtk_widget_show (label_linespc);
2186 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2189 spinbtn_linespc_adj = gtk_adjustment_new (2, 0, 16, 1, 1, 16);
2190 spinbtn_linespc = gtk_spin_button_new
2191 (GTK_ADJUSTMENT (spinbtn_linespc_adj), 1, 0);
2192 gtk_widget_show (spinbtn_linespc);
2193 gtk_box_pack_start (GTK_BOX (hbox_linespc), spinbtn_linespc,
2195 gtk_widget_set_usize (spinbtn_linespc, 64, -1);
2196 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linespc), TRUE);
2198 label_linespc = gtk_label_new (_("pixel(s)"));
2199 gtk_widget_show (label_linespc);
2200 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2203 PACK_CHECK_BUTTON(hbox1, chkbtn_headspc, _("Leave space on head"));
2205 PACK_FRAME(vbox1, frame_scr, _("Scroll"));
2207 vbox_scr = gtk_vbox_new (FALSE, 0);
2208 gtk_widget_show (vbox_scr);
2209 gtk_container_add (GTK_CONTAINER (frame_scr), vbox_scr);
2210 gtk_container_set_border_width (GTK_CONTAINER (vbox_scr), 8);
2212 PACK_CHECK_BUTTON(vbox_scr, chkbtn_halfpage, _("Half page"));
2214 hbox1 = gtk_hbox_new (FALSE, 32);
2215 gtk_widget_show (hbox1);
2216 gtk_box_pack_start (GTK_BOX (vbox_scr), hbox1, FALSE, TRUE, 0);
2218 PACK_CHECK_BUTTON(hbox1, chkbtn_smoothscroll, _("Smooth scroll"));
2220 hbox_scr = gtk_hbox_new (FALSE, 8);
2221 gtk_widget_show (hbox_scr);
2222 gtk_box_pack_start (GTK_BOX (hbox1), hbox_scr, FALSE, FALSE, 0);
2224 label_scr = gtk_label_new (_("Step"));
2225 gtk_widget_show (label_scr);
2226 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2228 spinbtn_scrollstep_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 10);
2229 spinbtn_scrollstep = gtk_spin_button_new
2230 (GTK_ADJUSTMENT (spinbtn_scrollstep_adj), 1, 0);
2231 gtk_widget_show (spinbtn_scrollstep);
2232 gtk_box_pack_start (GTK_BOX (hbox_scr), spinbtn_scrollstep,
2234 gtk_widget_set_usize (spinbtn_scrollstep, 64, -1);
2235 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_scrollstep),
2238 label_scr = gtk_label_new (_("pixel(s)"));
2239 gtk_widget_show (label_scr);
2240 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2242 SET_TOGGLE_SENSITIVITY (chkbtn_smoothscroll, hbox_scr)
2244 message.chkbtn_enablecol = chkbtn_enablecol;
2245 message.button_edit_col = button_edit_col;
2246 message.chkbtn_mbalnum = chkbtn_mbalnum;
2247 message.chkbtn_disphdrpane = chkbtn_disphdrpane;
2248 message.chkbtn_disphdr = chkbtn_disphdr;
2249 message.spinbtn_linespc = spinbtn_linespc;
2250 message.chkbtn_headspc = chkbtn_headspc;
2252 message.chkbtn_smoothscroll = chkbtn_smoothscroll;
2253 message.spinbtn_scrollstep = spinbtn_scrollstep;
2254 message.spinbtn_scrollstep_adj = spinbtn_scrollstep_adj;
2255 message.chkbtn_halfpage = chkbtn_halfpage;
2259 static void prefs_privacy_create(void)
2264 GtkWidget *checkbtn_auto_check_signatures;
2265 GtkWidget *checkbtn_gpg_signature_popup;
2266 GtkWidget *checkbtn_passphrase_grab;
2267 GtkWidget *checkbtn_gpg_warning;
2269 GtkWidget *menuitem;
2271 GtkWidget *optmenu_menu;
2273 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2274 gtk_widget_show (vbox1);
2275 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2276 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2278 vbox2 = gtk_vbox_new (FALSE, 0);
2279 gtk_widget_show (vbox2);
2280 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2282 PACK_CHECK_BUTTON (vbox2, checkbtn_auto_check_signatures,
2283 _("Automatically check signatures"));
2285 PACK_CHECK_BUTTON (vbox2, checkbtn_gpg_signature_popup,
2286 _("Show signature check result in a popup window"));
2289 PACK_CHECK_BUTTON (vbox2, checkbtn_passphrase_grab,
2290 _("Grab input while entering a passphrase"));
2294 (vbox2, checkbtn_gpg_warning,
2295 _("Display warning on startup if GnuPG doesn't work"));
2297 hbox1 = gtk_hbox_new (FALSE, 8);
2298 gtk_widget_show (hbox1);
2299 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2301 /* create default signkey box */
2302 label = gtk_label_new (_("Default Sign Key"));
2303 gtk_widget_show (label);
2304 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2305 optmenu = gtk_option_menu_new ();
2306 gtk_widget_show (optmenu);
2307 gtk_box_pack_start(GTK_BOX (hbox1), optmenu, FALSE, FALSE, 0);
2308 optmenu_menu = gtk_menu_new ();
2310 MENUITEM_ADD(optmenu_menu, menuitem, "Default Key", "def_key");
2311 MENUITEM_ADD(optmenu_menu, menuitem, "Second Key", "2nd_key");
2312 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
2313 /* FIXME: disabled because not implemented */
2314 gtk_widget_set_sensitive(optmenu, FALSE);
2316 privacy.checkbtn_auto_check_signatures
2317 = checkbtn_auto_check_signatures;
2318 privacy.checkbtn_gpg_signature_popup
2319 = checkbtn_gpg_signature_popup;
2320 privacy.checkbtn_passphrase_grab = checkbtn_passphrase_grab;
2321 privacy.checkbtn_gpg_warning = checkbtn_gpg_warning;
2322 privacy.optmenu_default_signkey = optmenu;
2326 prefs_common_default_signkey_set_data_from_optmenu(PrefParam *pparam)
2330 GtkWidget *menuitem;
2333 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
2334 menuitem = gtk_menu_get_active(GTK_MENU(menu));
2335 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
2336 g_free(*((gchar **)pparam->data));
2337 *((gchar **)pparam->data) = g_strdup(charset);
2341 static void prefs_common_default_signkey_set_optmenu(PrefParam *pparam)
2345 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
2347 GtkWidget *menuitem;
2351 g_return_if_fail(optmenu != NULL);
2352 g_return_if_fail(*((gchar **)pparam->data) != NULL);
2354 menu = gtk_option_menu_get_menu(optmenu);
2355 for (cur = GTK_MENU_SHELL(menu)->children;
2356 cur != NULL; cur = cur->next) {
2357 menuitem = GTK_WIDGET(cur->data);
2358 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
2359 if (!strcmp(charset, *((gchar **)pparam->data))) {
2360 gtk_option_menu_set_history(optmenu, n);
2366 gtk_option_menu_set_history(optmenu, 0);
2367 prefs_common_charset_set_data_from_optmenu(pparam);
2370 #endif /* USE_GPGME */
2372 static void prefs_interface_create(void)
2377 /* GtkWidget *checkbtn_emacs; */
2378 GtkWidget *checkbtn_openunread;
2379 GtkWidget *checkbtn_openinbox;
2380 GtkWidget *checkbtn_immedexec;
2383 GtkWidget *optmenu_recvdialog;
2385 GtkWidget *menuitem;
2387 GtkWidget *frame_addr;
2388 GtkWidget *vbox_addr;
2389 GtkWidget *checkbtn_addaddrbyclick;
2391 GtkWidget *button_keybind;
2394 GtkWidget *optmenu_nextunreadmsgdialog;
2395 GtkWidget *optmenu_nextunreadmsgdialog_menu;
2396 GtkWidget *nextunreadmsgdialog_menuitem;
2398 GtkWidget *frame_pixmap_theme;
2399 GtkWidget *vbox_pixmap_theme;
2400 GtkWidget *entry_pixmap_theme;
2401 GtkWidget *combo_pixmap_theme;
2402 GList *avail_pixmap_themes = NULL;
2404 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2405 gtk_widget_show (vbox1);
2406 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2407 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2409 vbox2 = gtk_vbox_new (FALSE, 0);
2410 gtk_widget_show (vbox2);
2411 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2413 /* PACK_CHECK_BUTTON (vbox2, checkbtn_emacs,
2414 _("Emulate the behavior of mouse operation of\n"
2415 "Emacs-based mailer"));
2416 gtk_label_set_justify (GTK_LABEL (GTK_BIN (checkbtn_emacs)->child),
2417 GTK_JUSTIFY_LEFT); */
2420 (vbox2, checkbtn_openunread,
2421 _("Open first unread message when entering a folder"));
2424 (vbox2, checkbtn_openinbox,
2425 _("Go to inbox after receiving new mail"));
2427 vbox3 = gtk_vbox_new (FALSE, 0);
2428 gtk_widget_show (vbox3);
2429 gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
2432 (vbox3, checkbtn_immedexec,
2433 _("Execute immediately when moving or deleting messages"));
2435 hbox1 = gtk_hbox_new (FALSE, 0);
2436 gtk_widget_show (hbox1);
2437 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2439 label = gtk_label_new
2440 (_("(Messages will be marked until execution\n"
2441 " if this is turned off)"));
2442 gtk_widget_show (label);
2443 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 8);
2444 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
2446 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
2448 hbox1 = gtk_hbox_new (FALSE, 8);
2449 gtk_widget_show (hbox1);
2450 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
2452 label = gtk_label_new (_("Show receive dialog"));
2453 gtk_widget_show (label);
2454 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2456 optmenu_recvdialog = gtk_option_menu_new ();
2457 gtk_widget_show (optmenu_recvdialog);
2458 gtk_box_pack_start (GTK_BOX (hbox1), optmenu_recvdialog,
2461 menu = gtk_menu_new ();
2462 MENUITEM_ADD (menu, menuitem, _("Always"), RECV_DIALOG_ALWAYS);
2463 MENUITEM_ADD (menu, menuitem, _("Only if a window is active"),
2464 RECV_DIALOG_ACTIVE);
2465 MENUITEM_ADD (menu, menuitem, _("Never"), RECV_DIALOG_NEVER);
2467 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
2469 PACK_FRAME (vbox1, frame_addr, _("Address book"));
2471 vbox_addr = gtk_vbox_new (FALSE, 0);
2472 gtk_widget_show (vbox_addr);
2473 gtk_container_add (GTK_CONTAINER (frame_addr), vbox_addr);
2474 gtk_container_set_border_width (GTK_CONTAINER (vbox_addr), 8);
2477 (vbox_addr, checkbtn_addaddrbyclick,
2478 _("Add address to destination when double-clicked"));
2480 /* Next Unread Message Dialog */
2481 hbox2 = gtk_hbox_new (FALSE, 8);
2482 gtk_widget_show (hbox2);
2483 gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
2485 label = gtk_label_new (_("Show no-unread-message dialog"));
2486 gtk_widget_show (label);
2487 gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
2489 optmenu_nextunreadmsgdialog = gtk_option_menu_new ();
2490 gtk_widget_show (optmenu_nextunreadmsgdialog);
2491 gtk_box_pack_start (GTK_BOX (hbox2), optmenu_nextunreadmsgdialog,
2494 optmenu_nextunreadmsgdialog_menu = gtk_menu_new ();
2495 MENUITEM_ADD (optmenu_nextunreadmsgdialog_menu, nextunreadmsgdialog_menuitem,
2496 _("Always"), NEXTUNREADMSGDIALOG_ALWAYS);
2497 MENUITEM_ADD (optmenu_nextunreadmsgdialog_menu, nextunreadmsgdialog_menuitem,
2498 _("Assume 'Yes'"), NEXTUNREADMSGDIALOG_ASSUME_YES);
2499 MENUITEM_ADD (optmenu_nextunreadmsgdialog_menu, nextunreadmsgdialog_menuitem,
2500 _("Assume 'No'"), NEXTUNREADMSGDIALOG_ASSUME_NO);
2502 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_nextunreadmsgdialog),
2503 optmenu_nextunreadmsgdialog_menu);
2506 /* Receive Dialog */
2507 /* hbox = gtk_hbox_new (FALSE, 8);
2508 gtk_widget_show (hbox);
2509 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
2511 label = gtk_label_new (_("Show receive Dialog"));
2512 gtk_widget_show (label);
2513 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
2515 recvdialog_optmenu = gtk_option_menu_new ();
2516 gtk_widget_show (recvdialog_optmenu);
2517 gtk_box_pack_start (GTK_BOX (hbox), recvdialog_optmenu, FALSE, FALSE, 0);
2519 recvdialog_optmenu_menu = gtk_menu_new ();
2521 MENUITEM_ADD (recvdialog_optmenu_menu, recvdialog_menuitem, _("Always"), RECVDIALOG_ALWAYS);
2522 MENUITEM_ADD (recvdialog_optmenu_menu, recvdialog_menuitem, _("Only if a sylpheed window is active"), RECVDIALOG_WINDOW_ACTIVE);
2523 MENUITEM_ADD (recvdialog_optmenu_menu, recvdialog_menuitem, _("Never"), RECVDIALOG_NEVER);
2525 gtk_option_menu_set_menu (GTK_OPTION_MENU (recvdialog_optmenu), recvdialog_optmenu_menu); */
2527 hbox1 = gtk_hbox_new (FALSE, 8);
2528 gtk_widget_show (hbox1);
2529 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2531 button_keybind = gtk_button_new_with_label (_(" Set key bindings... "));
2532 gtk_widget_show (button_keybind);
2533 gtk_box_pack_start (GTK_BOX (hbox1), button_keybind, FALSE, FALSE, 0);
2534 gtk_signal_connect (GTK_OBJECT (button_keybind), "clicked",
2535 GTK_SIGNAL_FUNC (prefs_keybind_select), NULL);
2537 PACK_FRAME(vbox1, frame_pixmap_theme, "Pixmap theme");
2539 vbox_pixmap_theme = gtk_vbox_new(FALSE, 0);
2540 gtk_widget_show(vbox_pixmap_theme);
2541 gtk_container_add(GTK_CONTAINER(frame_pixmap_theme), vbox_pixmap_theme);
2542 gtk_container_set_border_width(GTK_CONTAINER(vbox_pixmap_theme), 8);
2544 avail_pixmap_themes = stock_pixmap_themes_list_new();
2546 combo_pixmap_theme = gtk_combo_new ();
2547 gtk_widget_show (combo_pixmap_theme);
2548 gtk_box_pack_start (GTK_BOX (vbox_pixmap_theme), combo_pixmap_theme, TRUE, TRUE, 0);
2549 gtk_combo_set_popdown_strings(GTK_COMBO(combo_pixmap_theme), avail_pixmap_themes);
2550 entry_pixmap_theme = GTK_COMBO (combo_pixmap_theme)->entry;
2552 stock_pixmap_themes_list_free(avail_pixmap_themes);
2554 /* interface.checkbtn_emacs = checkbtn_emacs; */
2555 interface.checkbtn_openunread = checkbtn_openunread;
2556 interface.checkbtn_openinbox = checkbtn_openinbox;
2557 interface.checkbtn_immedexec = checkbtn_immedexec;
2558 interface.optmenu_recvdialog = optmenu_recvdialog;
2559 interface.checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
2560 interface.optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
2561 interface.combo_pixmap_theme = combo_pixmap_theme;
2562 interface.entry_pixmap_theme = entry_pixmap_theme;
2565 static void prefs_other_create(void)
2568 GtkWidget *ext_frame;
2569 GtkWidget *ext_table;
2572 GtkWidget *uri_label;
2573 GtkWidget *uri_combo;
2574 GtkWidget *uri_entry;
2576 GtkWidget *printcmd_label;
2577 GtkWidget *printcmd_entry;
2579 GtkWidget *exteditor_label;
2580 GtkWidget *exteditor_combo;
2581 GtkWidget *exteditor_entry;
2583 GtkWidget *frame_exit;
2584 GtkWidget *vbox_exit;
2585 GtkWidget *checkbtn_confonexit;
2586 GtkWidget *checkbtn_cleanonexit;
2587 GtkWidget *checkbtn_askonclean;
2588 GtkWidget *checkbtn_warnqueued;
2590 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2591 gtk_widget_show (vbox1);
2592 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2593 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2595 PACK_FRAME(vbox1, ext_frame,
2596 _("External commands (%s will be replaced with file name / URI)"));
2598 ext_table = gtk_table_new (3, 2, FALSE);
2599 gtk_widget_show (ext_table);
2600 gtk_container_add (GTK_CONTAINER (ext_frame), ext_table);
2601 gtk_container_set_border_width (GTK_CONTAINER (ext_table), 8);
2602 gtk_table_set_row_spacings (GTK_TABLE (ext_table), VSPACING_NARROW);
2603 gtk_table_set_col_spacings (GTK_TABLE (ext_table), 8);
2605 uri_label = gtk_label_new (_("Web browser"));
2606 gtk_widget_show(uri_label);
2607 gtk_table_attach (GTK_TABLE (ext_table), uri_label, 0, 1, 0, 1,
2608 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2609 gtk_misc_set_alignment (GTK_MISC (uri_label), 1, 0.5);
2611 uri_combo = gtk_combo_new ();
2612 gtk_widget_show (uri_combo);
2613 gtk_table_attach (GTK_TABLE (ext_table), uri_combo, 1, 2, 0, 1,
2614 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2615 gtkut_combo_set_items (GTK_COMBO (uri_combo),
2616 "netscape -remote 'openURL(%s,raise)'",
2618 "gnome-moz-remote --raise --newwin '%s'",
2619 "kterm -e w3m '%s'",
2620 "kterm -e lynx '%s'",
2622 uri_entry = GTK_COMBO (uri_combo)->entry;
2624 printcmd_label = gtk_label_new (_("Print"));
2625 gtk_widget_show (printcmd_label);
2626 gtk_table_attach (GTK_TABLE (ext_table), printcmd_label, 0, 1, 1, 2,
2627 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2628 gtk_misc_set_alignment (GTK_MISC (printcmd_label), 1, 0.5);
2630 printcmd_entry = gtk_entry_new ();
2631 gtk_widget_show (printcmd_entry);
2632 gtk_table_attach (GTK_TABLE (ext_table), printcmd_entry, 1, 2, 1, 2,
2633 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2635 exteditor_label = gtk_label_new (_("Editor"));
2636 gtk_widget_show (exteditor_label);
2637 gtk_table_attach (GTK_TABLE (ext_table), exteditor_label, 0, 1, 2, 3,
2638 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2639 gtk_misc_set_alignment (GTK_MISC (exteditor_label), 1, 0.5);
2641 exteditor_combo = gtk_combo_new ();
2642 gtk_widget_show (exteditor_combo);
2643 gtk_table_attach (GTK_TABLE (ext_table), exteditor_combo, 1, 2, 2, 3,
2644 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2645 gtkut_combo_set_items (GTK_COMBO (exteditor_combo),
2648 "mgedit --no-fork %s",
2654 exteditor_entry = GTK_COMBO (exteditor_combo)->entry;
2657 PACK_FRAME (vbox1, frame_exit, _("On exit"));
2659 vbox_exit = gtk_vbox_new (FALSE, 0);
2660 gtk_widget_show (vbox_exit);
2661 gtk_container_add (GTK_CONTAINER (frame_exit), vbox_exit);
2662 gtk_container_set_border_width (GTK_CONTAINER (vbox_exit), 8);
2664 PACK_CHECK_BUTTON (vbox_exit, checkbtn_confonexit,
2665 _("Confirm on exit"));
2667 hbox1 = gtk_hbox_new (FALSE, 32);
2668 gtk_widget_show (hbox1);
2669 gtk_box_pack_start (GTK_BOX (vbox_exit), hbox1, FALSE, FALSE, 0);
2671 PACK_CHECK_BUTTON (hbox1, checkbtn_cleanonexit,
2672 _("Empty trash on exit"));
2673 PACK_CHECK_BUTTON (hbox1, checkbtn_askonclean,
2674 _("Ask before emptying"));
2675 SET_TOGGLE_SENSITIVITY (checkbtn_cleanonexit, checkbtn_askonclean);
2677 PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
2678 _("Warn if there are queued messages"));
2680 other.uri_combo = uri_combo;
2681 other.uri_entry = uri_entry;
2682 other.printcmd_entry = printcmd_entry;
2684 other.exteditor_combo = exteditor_combo;
2685 other.exteditor_entry = exteditor_entry;
2687 other.checkbtn_confonexit = checkbtn_confonexit;
2688 other.checkbtn_cleanonexit = checkbtn_cleanonexit;
2689 other.checkbtn_askonclean = checkbtn_askonclean;
2690 other.checkbtn_warnqueued = checkbtn_warnqueued;
2693 static void date_format_ok_btn_clicked(GtkButton *button, GtkWidget **widget)
2695 GtkWidget *datefmt_sample = NULL;
2698 g_return_if_fail(widget != NULL);
2699 g_return_if_fail(*widget != NULL);
2700 g_return_if_fail(display.entry_datefmt != NULL);
2702 datefmt_sample = GTK_WIDGET(gtk_object_get_data
2703 (GTK_OBJECT(*widget), "datefmt_sample"));
2704 g_return_if_fail(datefmt_sample != NULL);
2706 text = gtk_editable_get_chars(GTK_EDITABLE(datefmt_sample), 0, -1);
2707 g_free(prefs_common.date_format);
2708 prefs_common.date_format = text;
2709 gtk_entry_set_text(GTK_ENTRY(display.entry_datefmt), text);
2711 gtk_widget_destroy(*widget);
2715 static void date_format_cancel_btn_clicked(GtkButton *button,
2718 g_return_if_fail(widget != NULL);
2719 g_return_if_fail(*widget != NULL);
2721 gtk_widget_destroy(*widget);
2725 static void date_format_key_pressed(GtkWidget *keywidget, GdkEventKey *event,
2728 if (event && event->keyval == GDK_Escape)
2729 date_format_cancel_btn_clicked(NULL, widget);
2732 static gboolean date_format_on_delete(GtkWidget *dialogwidget,
2733 GdkEventAny *event, GtkWidget **widget)
2735 g_return_val_if_fail(widget != NULL, FALSE);
2736 g_return_val_if_fail(*widget != NULL, FALSE);
2742 static void date_format_entry_on_change(GtkEditable *editable,
2746 struct tm *cal_time;
2750 cur_time = time(NULL);
2751 cal_time = localtime(&cur_time);
2753 text = gtk_editable_get_chars(editable, 0, -1);
2755 strftime(buffer, sizeof buffer, text, cal_time);
2756 gtk_label_set_text(example, buffer);
2759 static void date_format_select_row(GtkWidget *date_format_list, gint row,
2760 gint column, GdkEventButton *event,
2761 GtkWidget *date_format)
2767 GtkWidget *datefmt_sample;
2769 /* only on double click */
2770 if (!event || event->type != GDK_2BUTTON_PRESS) return;
2773 datefmt_sample = GTK_WIDGET(gtk_object_get_data
2774 (GTK_OBJECT(date_format), "datefmt_sample"));
2776 g_return_if_fail(date_format_list != NULL);
2777 g_return_if_fail(date_format != NULL);
2778 g_return_if_fail(datefmt_sample != NULL);
2780 /* get format from clist */
2781 gtk_clist_get_text(GTK_CLIST(date_format_list), row, 0, &format);
2783 cur_pos = gtk_editable_get_position(GTK_EDITABLE(datefmt_sample));
2784 old_format = gtk_entry_get_text(GTK_ENTRY(datefmt_sample));
2786 /* insert the format into the text entry */
2787 new_format = g_malloc(strlen(old_format) + 3);
2789 strncpy(new_format, old_format, cur_pos);
2790 new_format[cur_pos] = '\0';
2791 strcat(new_format, format);
2792 strcat(new_format, &old_format[cur_pos]);
2794 gtk_entry_set_text(GTK_ENTRY(datefmt_sample), new_format);
2795 gtk_editable_set_position(GTK_EDITABLE(datefmt_sample), cur_pos + 2);
2800 static GtkWidget *date_format_create(GtkButton *button, void *data)
2802 static GtkWidget *datefmt_win = NULL;
2804 GtkWidget *scrolledwindow1;
2805 GtkWidget *datefmt_clist;
2810 GtkWidget *confirm_area;
2812 GtkWidget *cancel_btn;
2813 GtkWidget *datefmt_entry;
2842 const gint TIME_FORMAT_ELEMS =
2843 sizeof time_format / sizeof time_format[0];
2845 time_format[0].txt = _("the full abbreviated weekday name");
2846 time_format[1].txt = _("the full weekday name");
2847 time_format[2].txt = _("the abbreviated month name");
2848 time_format[3].txt = _("the full month name");
2849 time_format[4].txt = _("the preferred date and time for the current locale");
2850 time_format[5].txt = _("the century number (year/100)");
2851 time_format[6].txt = _("the day of the month as a decimal number");
2852 time_format[7].txt = _("the hour as a decimal number using a 24-hour clock");
2853 time_format[8].txt = _("the hour as a decimal number using a 12-hour clock");
2854 time_format[9].txt = _("the day of the year as a decimal number");
2855 time_format[10].txt = _("the month as a decimal number");
2856 time_format[11].txt = _("the minute as a decimal number");
2857 time_format[12].txt = _("either AM or PM");
2858 time_format[13].txt = _("the second as a decimal number");
2859 time_format[14].txt = _("the day of the week as a decimal number");
2860 time_format[15].txt = _("the preferred date for the current locale");
2861 time_format[16].txt = _("the last two digits of a year");
2862 time_format[17].txt = _("the year as a decimal number");
2863 time_format[18].txt = _("the time zone or name or abbreviation");
2865 if (datefmt_win) return datefmt_win;
2867 datefmt_win = gtk_window_new(GTK_WINDOW_DIALOG);
2868 gtk_container_set_border_width(GTK_CONTAINER(datefmt_win), 8);
2869 gtk_window_set_title(GTK_WINDOW(datefmt_win), _("Date format"));
2870 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
2871 gtk_widget_set_usize(datefmt_win, 440, 280);
2873 vbox1 = gtk_vbox_new(FALSE, 10);
2874 gtk_widget_show(vbox1);
2875 gtk_container_add(GTK_CONTAINER(datefmt_win), vbox1);
2877 scrolledwindow1 = gtk_scrolled_window_new(NULL, NULL);
2878 gtk_scrolled_window_set_policy
2879 (GTK_SCROLLED_WINDOW(scrolledwindow1),
2880 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
2881 gtk_widget_show(scrolledwindow1);
2882 gtk_box_pack_start(GTK_BOX(vbox1), scrolledwindow1, TRUE, TRUE, 0);
2884 titles[0] = _("Specifier");
2885 titles[1] = _("Description");
2886 datefmt_clist = gtk_clist_new_with_titles(2, titles);
2887 gtk_widget_show(datefmt_clist);
2888 gtk_container_add(GTK_CONTAINER(scrolledwindow1), datefmt_clist);
2889 /* gtk_clist_set_column_width(GTK_CLIST(datefmt_clist), 0, 80); */
2890 gtk_clist_set_selection_mode(GTK_CLIST(datefmt_clist),
2891 GTK_SELECTION_BROWSE);
2893 for (i = 0; i < TIME_FORMAT_ELEMS; i++) {
2895 /* phoney casting necessary because of gtk... */
2896 text[0] = (gchar *)time_format[i].fmt;
2897 text[1] = (gchar *)time_format[i].txt;
2898 gtk_clist_append(GTK_CLIST(datefmt_clist), text);
2901 table = gtk_table_new(2, 2, FALSE);
2902 gtk_widget_show(table);
2903 gtk_box_pack_start(GTK_BOX(vbox1), table, FALSE, FALSE, 0);
2904 gtk_table_set_row_spacings(GTK_TABLE(table), 4);
2905 gtk_table_set_col_spacings(GTK_TABLE(table), 8);
2907 label1 = gtk_label_new(_("Date format"));
2908 gtk_widget_show(label1);
2909 gtk_table_attach(GTK_TABLE(table), label1, 0, 1, 0, 1,
2911 gtk_label_set_justify(GTK_LABEL(label1), GTK_JUSTIFY_LEFT);
2912 gtk_misc_set_alignment(GTK_MISC(label1), 0, 0.5);
2914 datefmt_entry = gtk_entry_new_with_max_length(256);
2915 gtk_widget_show(datefmt_entry);
2916 gtk_table_attach(GTK_TABLE(table), datefmt_entry, 1, 2, 0, 1,
2917 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2919 /* we need the "sample" entry box; add it as data so callbacks can
2920 * get the entry box */
2921 gtk_object_set_data(GTK_OBJECT(datefmt_win), "datefmt_sample",
2924 label2 = gtk_label_new(_("Example"));
2925 gtk_widget_show(label2);
2926 gtk_table_attach(GTK_TABLE(table), label2, 0, 1, 1, 2,
2928 gtk_label_set_justify(GTK_LABEL(label2), GTK_JUSTIFY_LEFT);
2929 gtk_misc_set_alignment(GTK_MISC(label2), 0, 0.5);
2931 label3 = gtk_label_new("");
2932 gtk_widget_show(label3);
2933 gtk_table_attach(GTK_TABLE(table), label3, 1, 2, 1, 2,
2934 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2935 gtk_label_set_justify(GTK_LABEL(label3), GTK_JUSTIFY_LEFT);
2936 gtk_misc_set_alignment(GTK_MISC(label3), 0, 0.5);
2938 gtkut_button_set_create(&confirm_area, &ok_btn, _("OK"),
2939 &cancel_btn, _("Cancel"), NULL, NULL);
2940 gtk_widget_grab_default(ok_btn);
2941 gtk_widget_show(confirm_area);
2943 gtk_box_pack_start(GTK_BOX(vbox1), confirm_area, FALSE, FALSE, 0);
2945 /* set the current format */
2946 gtk_entry_set_text(GTK_ENTRY(datefmt_entry), prefs_common.date_format);
2947 date_format_entry_on_change(GTK_EDITABLE(datefmt_entry),
2950 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
2951 GTK_SIGNAL_FUNC(date_format_ok_btn_clicked),
2953 gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
2954 GTK_SIGNAL_FUNC(date_format_cancel_btn_clicked),
2956 gtk_signal_connect(GTK_OBJECT(datefmt_win), "key_press_event",
2957 GTK_SIGNAL_FUNC(date_format_key_pressed),
2959 gtk_signal_connect(GTK_OBJECT(datefmt_win), "delete_event",
2960 GTK_SIGNAL_FUNC(date_format_on_delete),
2962 gtk_signal_connect(GTK_OBJECT(datefmt_entry), "changed",
2963 GTK_SIGNAL_FUNC(date_format_entry_on_change),
2966 gtk_signal_connect(GTK_OBJECT(datefmt_clist), "select_row",
2967 GTK_SIGNAL_FUNC(date_format_select_row),
2970 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
2971 gtk_window_set_modal(GTK_WINDOW(datefmt_win), TRUE);
2973 gtk_widget_show(datefmt_win);
2974 manage_window_set_transient(GTK_WINDOW(datefmt_win));
2976 gtk_widget_grab_focus(ok_btn);
2981 void prefs_quote_colors_dialog(void)
2983 if (!quote_color_win)
2984 prefs_quote_colors_dialog_create();
2985 gtk_widget_show(quote_color_win);
2986 manage_window_set_transient(GTK_WINDOW(quote_color_win));
2989 gtk_widget_hide(quote_color_win);
2991 textview_update_message_colors();
2992 main_window_reflect_prefs_all();
2995 static void prefs_quote_colors_dialog_create(void)
3000 GtkWidget *quotelevel1_label;
3001 GtkWidget *quotelevel2_label;
3002 GtkWidget *quotelevel3_label;
3003 GtkWidget *uri_label;
3004 GtkWidget *tgt_folder_label;
3007 GtkWidget *recycle_colors_btn;
3008 GtkWidget *frame_colors;
3010 window = gtk_window_new(GTK_WINDOW_DIALOG);
3011 gtk_container_set_border_width(GTK_CONTAINER(window), 2);
3012 gtk_window_set_title(GTK_WINDOW(window), _("Set message colors"));
3013 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
3014 gtk_window_set_modal(GTK_WINDOW(window), TRUE);
3015 gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
3017 vbox = gtk_vbox_new (FALSE, VSPACING);
3018 gtk_container_add (GTK_CONTAINER (window), vbox);
3019 gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
3020 PACK_FRAME(vbox, frame_colors, _("Colors"));
3022 table = gtk_table_new (4, 2, FALSE);
3023 gtk_container_add (GTK_CONTAINER (frame_colors), table);
3024 gtk_container_set_border_width (GTK_CONTAINER (table), 8);
3025 gtk_table_set_row_spacings (GTK_TABLE (table), 2);
3026 gtk_table_set_col_spacings (GTK_TABLE (table), 5);
3029 color_buttons.quote_level1_btn = gtk_button_new();
3030 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level1_btn,
3031 0, 1, 0, 1, 0, 0, 0, 0);
3032 gtk_widget_set_usize (color_buttons.quote_level1_btn, 40, 30);
3033 gtk_container_set_border_width
3034 (GTK_CONTAINER (color_buttons.quote_level1_btn), 5);
3036 color_buttons.quote_level2_btn = gtk_button_new();
3037 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level2_btn,
3038 0, 1, 1, 2, 0, 0, 0, 0);
3039 gtk_widget_set_usize (color_buttons.quote_level2_btn, 40, 30);
3040 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.quote_level2_btn), 5);
3042 color_buttons.quote_level3_btn = gtk_button_new_with_label ("");
3043 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level3_btn,
3044 0, 1, 2, 3, 0, 0, 0, 0);
3045 gtk_widget_set_usize (color_buttons.quote_level3_btn, 40, 30);
3046 gtk_container_set_border_width
3047 (GTK_CONTAINER (color_buttons.quote_level3_btn), 5);
3049 color_buttons.uri_btn = gtk_button_new_with_label ("");
3050 gtk_table_attach (GTK_TABLE (table), color_buttons.uri_btn,
3051 0, 1, 3, 4, 0, 0, 0, 0);
3052 gtk_widget_set_usize (color_buttons.uri_btn, 40, 30);
3053 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.uri_btn), 5);
3055 color_buttons.tgt_folder_btn = gtk_button_new_with_label ("");
3056 gtk_table_attach (GTK_TABLE (table), color_buttons.tgt_folder_btn,
3057 0, 1, 4, 5, 0, 0, 0, 0);
3058 gtk_widget_set_usize (color_buttons.tgt_folder_btn, 40, 30);
3059 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.tgt_folder_btn), 5);
3061 quotelevel1_label = gtk_label_new (_("Quoted Text - First Level"));
3062 gtk_table_attach (GTK_TABLE (table), quotelevel1_label, 1, 2, 0, 1,
3063 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3064 gtk_label_set_justify (GTK_LABEL (quotelevel1_label), GTK_JUSTIFY_LEFT);
3065 gtk_misc_set_alignment (GTK_MISC (quotelevel1_label), 0, 0.5);
3067 quotelevel2_label = gtk_label_new (_("Quoted Text - Second Level"));
3068 gtk_table_attach (GTK_TABLE (table), quotelevel2_label, 1, 2, 1, 2,
3069 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3070 gtk_label_set_justify (GTK_LABEL (quotelevel2_label), GTK_JUSTIFY_LEFT);
3071 gtk_misc_set_alignment (GTK_MISC (quotelevel2_label), 0, 0.5);
3073 quotelevel3_label = gtk_label_new (_("Quoted Text - Third Level"));
3074 gtk_table_attach (GTK_TABLE (table), quotelevel3_label, 1, 2, 2, 3,
3075 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3076 gtk_label_set_justify (GTK_LABEL (quotelevel3_label), GTK_JUSTIFY_LEFT);
3077 gtk_misc_set_alignment (GTK_MISC (quotelevel3_label), 0, 0.5);
3079 uri_label = gtk_label_new (_("URI link"));
3080 gtk_table_attach (GTK_TABLE (table), uri_label, 1, 2, 3, 4,
3081 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3082 gtk_label_set_justify (GTK_LABEL (uri_label), GTK_JUSTIFY_LEFT);
3083 gtk_misc_set_alignment (GTK_MISC (uri_label), 0, 0.5);
3085 tgt_folder_label = gtk_label_new (_("Target folder"));
3086 gtk_table_attach (GTK_TABLE (table), tgt_folder_label, 1, 2, 4, 5,
3087 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3088 gtk_label_set_justify (GTK_LABEL (tgt_folder_label), GTK_JUSTIFY_LEFT);
3089 gtk_misc_set_alignment (GTK_MISC (tgt_folder_label), 0, 0.5);
3091 PACK_CHECK_BUTTON (vbox, recycle_colors_btn,
3092 _("Recycle quote colors"));
3094 gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
3095 NULL, NULL, NULL, NULL);
3096 gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
3098 gtk_widget_grab_default(ok_btn);
3099 gtk_signal_connect(GTK_OBJECT(window), "focus_in_event",
3100 GTK_SIGNAL_FUNC(manage_window_focus_in), NULL);
3101 gtk_signal_connect(GTK_OBJECT(window), "focus_out_event",
3102 GTK_SIGNAL_FUNC(manage_window_focus_out), NULL);
3103 gtk_signal_connect(GTK_OBJECT(window), "delete_event",
3104 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3105 gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
3106 GTK_SIGNAL_FUNC(prefs_quote_colors_key_pressed),
3109 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level1_btn), "clicked",
3110 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL1");
3111 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level2_btn), "clicked",
3112 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL2");
3113 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level3_btn), "clicked",
3114 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL3");
3115 gtk_signal_connect(GTK_OBJECT(color_buttons.uri_btn), "clicked",
3116 GTK_SIGNAL_FUNC(quote_color_set_dialog), "URI");
3117 gtk_signal_connect(GTK_OBJECT(color_buttons.tgt_folder_btn), "clicked",
3118 GTK_SIGNAL_FUNC(quote_color_set_dialog), "TGTFLD");
3119 gtk_signal_connect(GTK_OBJECT(recycle_colors_btn), "toggled",
3120 GTK_SIGNAL_FUNC(prefs_recycle_colors_toggled), NULL);
3121 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
3122 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3124 /* show message button colors and recycle options */
3125 set_button_bg_color(color_buttons.quote_level1_btn,
3126 prefs_common.quote_level1_col);
3127 set_button_bg_color(color_buttons.quote_level2_btn,
3128 prefs_common.quote_level2_col);
3129 set_button_bg_color(color_buttons.quote_level3_btn,
3130 prefs_common.quote_level3_col);
3131 set_button_bg_color(color_buttons.uri_btn,
3132 prefs_common.uri_col);
3133 set_button_bg_color(color_buttons.tgt_folder_btn,
3134 prefs_common.tgt_folder_col);
3135 gtk_toggle_button_set_active((GtkToggleButton *)recycle_colors_btn,
3136 prefs_common.recycle_quote_colors);
3138 gtk_widget_show_all(vbox);
3139 quote_color_win = window;
3142 static void prefs_quote_colors_key_pressed(GtkWidget *widget,
3143 GdkEventKey *event, gpointer data)
3145 if (event && event->keyval == GDK_Escape)
3149 static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
3151 gchar *type = (gchar *)data;
3152 gchar *title = NULL;
3153 gdouble color[4] = {0.0, 0.0, 0.0, 0.0};
3155 GtkColorSelectionDialog *dialog;
3157 if(g_strcasecmp(type, "LEVEL1") == 0) {
3158 title = _("Pick color for quotation level 1");
3159 rgbvalue = prefs_common.quote_level1_col;
3160 } else if(g_strcasecmp(type, "LEVEL2") == 0) {
3161 title = _("Pick color for quotation level 2");
3162 rgbvalue = prefs_common.quote_level2_col;
3163 } else if(g_strcasecmp(type, "LEVEL3") == 0) {
3164 title = _("Pick color for quotation level 3");
3165 rgbvalue = prefs_common.quote_level3_col;
3166 } else if(g_strcasecmp(type, "URI") == 0) {
3167 title = _("Pick color for URI");
3168 rgbvalue = prefs_common.uri_col;
3169 } else if(g_strcasecmp(type, "TGTFLD") == 0) {
3170 title = _("Pick color for target folder");
3171 rgbvalue = prefs_common.tgt_folder_col;
3173 } else if(g_strcasecmp(type, "Misspelled word") == 0) {
3174 title = _("Pick color for misspelled word");
3175 rgbvalue = prefs_common.misspelled_col;
3177 } else { /* Should never be called */
3178 g_warning("Unrecognized datatype '%s' in quote_color_set_dialog\n", type);
3182 color_dialog = gtk_color_selection_dialog_new(title);
3183 gtk_window_set_position(GTK_WINDOW(color_dialog), GTK_WIN_POS_CENTER);
3184 gtk_window_set_modal(GTK_WINDOW(color_dialog), TRUE);
3185 gtk_window_set_policy(GTK_WINDOW(color_dialog), FALSE, FALSE, FALSE);
3186 manage_window_set_transient(GTK_WINDOW(color_dialog));
3188 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->ok_button),
3189 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_ok), data);
3190 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->cancel_button),
3191 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_cancel), data);
3192 gtk_signal_connect(GTK_OBJECT(color_dialog), "key_press_event",
3193 GTK_SIGNAL_FUNC(quote_colors_set_dialog_key_pressed),
3196 /* preselect the previous color in the color selection dialog */
3197 color[0] = (gdouble) ((rgbvalue & 0xff0000) >> 16) / 255.0;
3198 color[1] = (gdouble) ((rgbvalue & 0x00ff00) >> 8) / 255.0;
3199 color[2] = (gdouble) (rgbvalue & 0x0000ff) / 255.0;
3200 dialog = GTK_COLOR_SELECTION_DIALOG(color_dialog);
3201 gtk_color_selection_set_color
3202 (GTK_COLOR_SELECTION(dialog->colorsel), color);
3204 gtk_widget_show(color_dialog);
3207 static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
3209 GtkColorSelection *colorsel = (GtkColorSelection *)
3210 ((GtkColorSelectionDialog *)color_dialog)->colorsel;
3212 gint red, green, blue, rgbvalue;
3213 gchar *type = (gchar *)data;
3215 gtk_color_selection_get_color(colorsel, color);
3217 red = (gint) (color[0] * 255.0);
3218 green = (gint) (color[1] * 255.0);
3219 blue = (gint) (color[2] * 255.0);
3220 rgbvalue = (gint) ((red * 0x10000) | (green * 0x100) | blue);
3223 fprintf(stderr, "redc = %f, greenc = %f, bluec = %f\n", color[0], color[1], color[2]);
3224 fprintf(stderr, "red = %d, green = %d, blue = %d\n", red, green, blue);
3225 fprintf(stderr, "Color is %x\n", rgbvalue);
3228 if (g_strcasecmp(type, "LEVEL1") == 0) {
3229 prefs_common.quote_level1_col = rgbvalue;
3230 set_button_bg_color(color_buttons.quote_level1_btn, rgbvalue);
3231 } else if (g_strcasecmp(type, "LEVEL2") == 0) {
3232 prefs_common.quote_level2_col = rgbvalue;
3233 set_button_bg_color(color_buttons.quote_level2_btn, rgbvalue);
3234 } else if (g_strcasecmp(type, "LEVEL3") == 0) {
3235 prefs_common.quote_level3_col = rgbvalue;
3236 set_button_bg_color(color_buttons.quote_level3_btn, rgbvalue);
3237 } else if (g_strcasecmp(type, "URI") == 0) {
3238 prefs_common.uri_col = rgbvalue;
3239 set_button_bg_color(color_buttons.uri_btn, rgbvalue);
3240 } else if (g_strcasecmp(type, "TGTFLD") == 0) {
3241 prefs_common.tgt_folder_col = rgbvalue;
3242 set_button_bg_color(color_buttons.tgt_folder_btn, rgbvalue);
3243 folderview_set_target_folder_color(prefs_common.tgt_folder_col);
3245 } else if (g_strcasecmp(type, "Misspelled word") == 0) {
3246 prefs_common.misspelled_col = rgbvalue;
3247 set_button_bg_color(spelling.misspelled_btn, rgbvalue);
3250 fprintf( stderr, "Unrecognized datatype '%s' in quote_color_set_dialog_ok\n", type );
3252 gtk_widget_destroy(color_dialog);
3255 static void quote_colors_set_dialog_cancel(GtkWidget *widget, gpointer data)
3257 gtk_widget_destroy(color_dialog);
3260 static void quote_colors_set_dialog_key_pressed(GtkWidget *widget,
3264 gtk_widget_destroy(color_dialog);
3267 static void set_button_bg_color(GtkWidget *widget, gint rgbvalue)
3272 gtkut_convert_int_to_gdk_color(rgbvalue, &color);
3273 newstyle = gtk_style_copy(gtk_widget_get_default_style());
3274 newstyle->bg[GTK_STATE_NORMAL] = color;
3275 newstyle->bg[GTK_STATE_PRELIGHT] = color;
3276 newstyle->bg[GTK_STATE_ACTIVE] = color;
3278 gtk_widget_set_style(GTK_WIDGET(widget), newstyle);
3281 static void prefs_enable_message_color_toggled(void)
3285 is_active = gtk_toggle_button_get_active
3286 (GTK_TOGGLE_BUTTON(message.chkbtn_enablecol));
3287 gtk_widget_set_sensitive(message.button_edit_col, is_active);
3288 prefs_common.enable_color = is_active;
3291 static void prefs_recycle_colors_toggled(GtkWidget *widget)
3295 is_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
3296 prefs_common.recycle_quote_colors = is_active;
3299 void prefs_quote_description(void)
3301 if (!quote_desc_win)
3302 prefs_quote_description_create();
3304 manage_window_set_transient(GTK_WINDOW(quote_desc_win));
3305 gtk_widget_show(quote_desc_win);
3307 gtk_widget_hide(quote_desc_win);
3310 static void prefs_quote_description_create(void)
3319 quote_desc_win = gtk_window_new(GTK_WINDOW_DIALOG);
3320 gtk_window_set_title(GTK_WINDOW(quote_desc_win),
3321 _("Description of symbols"));
3322 gtk_container_set_border_width(GTK_CONTAINER(quote_desc_win), 8);
3323 gtk_window_set_position(GTK_WINDOW(quote_desc_win), GTK_WIN_POS_CENTER);
3324 gtk_window_set_modal(GTK_WINDOW(quote_desc_win), TRUE);
3325 gtk_window_set_policy(GTK_WINDOW(quote_desc_win), FALSE, FALSE, FALSE);
3327 vbox = gtk_vbox_new(FALSE, 8);
3328 gtk_container_add(GTK_CONTAINER(quote_desc_win), vbox);
3330 hbox = gtk_hbox_new(FALSE, 8);
3331 gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
3333 vbox2 = gtk_vbox_new(FALSE, 8);
3334 gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0);
3336 #define PACK_LABEL() \
3337 gtk_box_pack_start(GTK_BOX(vbox2), label, TRUE, TRUE, 0); \
3338 gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT); \
3339 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
3341 label = gtk_label_new
3344 "%N\n" /* full name of sender */
3345 "%F\n" /* first name of sender */
3346 "%I\n" /* initial of sender */
3347 "%s\n" /* subject */
3350 "%n\n" /* newsgroups */
3351 "%r\n" /* references */
3352 "%i"); /* message id */
3355 label = gtk_label_new
3356 ("?x{expr}"); /* condition */
3359 label = gtk_label_new
3360 ("%M\n" /* message body */
3361 "%Q\n" /* quoted message body */
3362 "%m\n" /* message body without signature */
3363 "%q\n" /* quoted message body without signature */
3364 "%%"); /* literal percent */
3367 label = gtk_label_new
3368 ("\\\\\n" /* literal backslash */
3369 "\\?\n" /* literal question mark */
3370 "\\{\n" /* literal opening curly brace */
3371 "\\}"); /* literal closing curly brace */
3374 vbox2 = gtk_vbox_new(FALSE, 8);
3375 gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0);
3377 label = gtk_label_new
3380 "Full Name of Sender\n"
3381 "First Name of Sender\n"
3382 "Initial of Sender\n"
3391 label = gtk_label_new
3392 (_("If x is set, displays expr"));
3395 label = gtk_label_new
3397 "Quoted message body\n"
3398 "Message body without signature\n"
3399 "Quoted message body without signature\n"
3403 label = gtk_label_new
3404 (_("Literal backslash\n"
3405 "Literal question mark\n"
3406 "Literal opening curly brace\n"
3407 "Literal closing curly brace"));
3412 gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
3413 NULL, NULL, NULL, NULL);
3414 gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
3416 gtk_widget_grab_default(ok_btn);
3417 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
3418 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3420 (GTK_OBJECT(quote_desc_win), "key_press_event",
3421 GTK_SIGNAL_FUNC(prefs_quote_description_key_pressed),
3423 gtk_signal_connect(GTK_OBJECT(quote_desc_win), "delete_event",
3424 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3426 gtk_widget_show_all(vbox);
3429 static void prefs_quote_description_key_pressed(GtkWidget *widget,
3433 if (event && event->keyval == GDK_Escape)
3437 static void prefs_font_select(GtkButton *button, GtkEntry *entry)
3441 g_return_if_fail(entry != NULL);
3443 if (!font_sel_win) {
3444 font_sel_win = gtk_font_selection_dialog_new
3445 (_("Font selection"));
3446 gtk_window_position(GTK_WINDOW(font_sel_win),
3447 GTK_WIN_POS_CENTER);
3448 gtk_signal_connect(GTK_OBJECT(font_sel_win), "delete_event",
3449 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3452 (GTK_OBJECT(font_sel_win), "key_press_event",
3453 GTK_SIGNAL_FUNC(prefs_font_selection_key_pressed),
3455 gtk_signal_connect_object
3456 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->cancel_button),
3458 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3459 GTK_OBJECT(font_sel_win));
3462 if(font_sel_conn_id) {
3463 gtk_signal_disconnect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button), font_sel_conn_id);
3465 font_sel_conn_id = gtk_signal_connect
3466 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button),
3468 GTK_SIGNAL_FUNC(prefs_font_selection_ok),
3470 printf("%i\n", font_sel_conn_id);
3472 font_name = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
3473 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(font_sel_win), font_name);
3475 manage_window_set_transient(GTK_WINDOW(font_sel_win));
3476 gtk_window_set_modal(GTK_WINDOW(font_sel_win), TRUE);
3477 gtk_widget_grab_focus
3478 (GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button);
3479 gtk_widget_show(font_sel_win);
3482 static void prefs_font_selection_key_pressed(GtkWidget *widget,
3486 if (event && event->keyval == GDK_Escape)
3487 gtk_widget_hide(font_sel_win);
3490 static void prefs_font_selection_ok(GtkButton *button, GtkEntry *entry)
3494 fontname = gtk_font_selection_dialog_get_font_name
3495 (GTK_FONT_SELECTION_DIALOG(font_sel_win));
3498 gtk_entry_set_text(entry, fontname);
3503 gtk_widget_hide(font_sel_win);
3506 static void prefs_keybind_select(void)
3513 GtkWidget *confirm_area;
3515 GtkWidget *cancel_btn;
3517 window = gtk_window_new (GTK_WINDOW_DIALOG);
3518 gtk_container_set_border_width (GTK_CONTAINER (window), 8);
3519 gtk_window_set_title (GTK_WINDOW (window), _("Key bindings"));
3520 gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
3521 gtk_window_set_modal (GTK_WINDOW (window), TRUE);
3522 gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, FALSE);
3523 manage_window_set_transient (GTK_WINDOW (window));
3525 vbox1 = gtk_vbox_new (FALSE, VSPACING);
3526 gtk_container_add (GTK_CONTAINER (window), vbox1);
3527 gtk_container_set_border_width (GTK_CONTAINER (vbox1), 2);
3529 hbox1 = gtk_hbox_new (FALSE, 8);
3530 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3532 label = gtk_label_new
3533 (_("Select the preset of key bindings.\n"
3534 "You can also modify each menu's shortcuts by pressing\n"
3535 "any key(s) when placing the mouse pointer on the item."));
3536 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
3537 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
3539 hbox1 = gtk_hbox_new (FALSE, 8);
3540 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3542 combo = gtk_combo_new ();
3543 gtk_box_pack_start (GTK_BOX (hbox1), combo, TRUE, TRUE, 0);
3544 gtkut_combo_set_items (GTK_COMBO (combo),
3550 gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE);
3552 hbox1 = gtk_hbox_new (FALSE, 8);
3553 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3555 gtkut_button_set_create (&confirm_area, &ok_btn, _("OK"),
3556 &cancel_btn, _("Cancel"), NULL, NULL);
3557 gtk_box_pack_end (GTK_BOX (hbox1), confirm_area, FALSE, FALSE, 0);
3558 gtk_widget_grab_default (ok_btn);
3560 gtk_signal_connect (GTK_OBJECT (window), "focus_in_event",
3561 GTK_SIGNAL_FUNC (manage_window_focus_in), NULL);
3562 gtk_signal_connect (GTK_OBJECT (window), "focus_out_event",
3563 GTK_SIGNAL_FUNC (manage_window_focus_out), NULL);
3564 gtk_signal_connect (GTK_OBJECT (window), "delete_event",
3565 GTK_SIGNAL_FUNC (prefs_keybind_deleted), NULL);
3566 gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
3567 GTK_SIGNAL_FUNC (prefs_keybind_key_pressed), NULL);
3568 gtk_signal_connect (GTK_OBJECT (ok_btn), "clicked",
3569 GTK_SIGNAL_FUNC (prefs_keybind_apply_clicked),
3571 gtk_signal_connect (GTK_OBJECT (cancel_btn), "clicked",
3572 GTK_SIGNAL_FUNC (prefs_keybind_cancel),
3575 gtk_widget_show_all(window);
3577 keybind.window = window;
3578 keybind.combo = combo;
3581 static void prefs_keybind_key_pressed(GtkWidget *widget, GdkEventKey *event,
3584 if (event && event->keyval == GDK_Escape)
3585 prefs_keybind_cancel();
3588 static gint prefs_keybind_deleted(GtkWidget *widget, GdkEventAny *event,
3591 prefs_keybind_cancel();
3595 static void prefs_keybind_cancel(void)
3597 gtk_widget_destroy(keybind.window);
3598 keybind.window = NULL;
3599 keybind.combo = NULL;
3602 static void prefs_keybind_apply_clicked(GtkWidget *widget)
3604 GtkEntry *entry = GTK_ENTRY(GTK_COMBO(keybind.combo)->entry);
3608 static gchar *default_menurc =
3609 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3610 "(menu-path \"<Main>/File/Save as...\" \"<control>S\")\n"
3611 "(menu-path \"<Main>/File/Print...\" \"\")\n"
3612 "(menu-path \"<Main>/File/Exit\" \"<control>Q\")\n"
3614 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3615 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3616 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3617 "(menu-path \"<Main>/Edit/Search folder...\" \"<shift><control>F\")\n"
3619 "(menu-path \"<Main>/View/Expand Summary View\" \"V\")\n"
3620 "(menu-path \"<Main>/View/Expand Message View\" \"<shift>V\")\n"
3621 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3622 "(menu-path \"<Main>/View/Unthread view\" \"<shift><control>T\")\n"
3623 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3624 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3625 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3626 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3627 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3628 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3629 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3630 "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
3631 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3633 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3634 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3635 "(menu-path \"<Main>/Message/Compose an email message\" \"<control>M\")\n"
3636 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3637 "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
3638 "(menu-path \"<Main>/Message/Reply to all\" \"<shift><control>R\")\n"
3639 "(menu-path \"<Main>/Message/Forward\" \"<control><alt>F\")\n"
3640 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
3641 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3642 "(menu-path \"<Main>/Message/Copy...\" \"<shift><control>O\")\n"
3643 "(menu-path \"<Main>/Message/Delete\" \"<control>D\")\n"
3644 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3645 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3646 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3647 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3649 "(menu-path \"<Main>/Tool/Address book\" \"<shift><control>A\")\n"
3650 "(menu-path \"<Main>/Tool/Execute\" \"X\")\n"
3651 "(menu-path \"<Main>/Tool/Log window\" \"<control>L\")\n"
3653 "(menu-path \"<Compose>/File/Close\" \"<control>W\")\n"
3654 "(menu-path \"<Compose>/Edit/Select all\" \"<control>A\")\n"
3655 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
3656 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
3657 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
3658 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
3659 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
3661 static gchar *mew_wl_menurc =
3662 "(menu-path \"<Main>/File/Empty trash\" \"<shift>D\")\n"
3663 "(menu-path \"<Main>/File/Save as...\" \"Y\")\n"
3664 "(menu-path \"<Main>/File/Print...\" \"<shift>numbersign\")\n"
3665 "(menu-path \"<Main>/File/Exit\" \"<shift>Q\")\n"
3667 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3668 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3669 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3670 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
3672 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
3673 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
3674 "(menu-path \"<Main>/View/Thread view\" \"<shift>T\")\n"
3675 "(menu-path \"<Main>/View/Unthread view\" \"<shift><control>T\")\n"
3676 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3677 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3678 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3679 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3680 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3681 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3682 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3683 "(menu-path \"<Main>/View/Show all header\" \"<shift>H\")\n"
3684 "(menu-path \"<Main>/View/Update\" \"<shift>S\")\n"
3686 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3687 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3688 "(menu-path \"<Main>/Message/Compose an email message\" \"W\")\n"
3689 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3690 "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
3691 "(menu-path \"<Main>/Message/Reply to all\" \"<shift>A\")\n"
3692 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3693 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift>F\")\n" */
3694 "(menu-path \"<Main>/Message/Move...\" \"O\")\n"
3695 "(menu-path \"<Main>/Message/Copy...\" \"<shift>O\")\n"
3696 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3697 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3698 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3699 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3700 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"<shift>R\")\n"
3702 "(menu-path \"<Main>/Tool/Address book\" \"<shift><control>A\")\n"
3703 "(menu-path \"<Main>/Tool/Execute\" \"X\")\n"
3704 "(menu-path \"<Main>/Tool/Log window\" \"<control>L\")\n"
3706 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3707 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3708 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3709 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3710 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3711 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3712 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3714 static gchar *mutt_menurc =
3715 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3716 "(menu-path \"<Main>/File/Save as...\" \"S\")\n"
3717 "(menu-path \"<Main>/File/Print...\" \"P\")\n"
3718 "(menu-path \"<Main>/File/Exit\" \"Q\")\n"
3720 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3721 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3722 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3723 "(menu-path \"<Main>/Edit/Search messages...\" \"slash\")\n"
3725 "(menu-path \"<Main>/View/Toggle summary view\" \"V\")\n"
3726 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3727 "(menu-path \"<Main>/View/Unthread view\" \"<shift><control>T\")\n"
3728 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
3729 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
3730 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
3731 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
3732 "(menu-path \"<Main>/View/Go to/Other folder...\" \"C\")\n"
3733 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3734 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3735 "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
3736 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3738 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3739 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3740 "(menu-path \"<Main>/Message/Compose new message\" \"M\")\n"
3741 "(menu-path \"<Main>/Message/Reply\" \"R\")\n"
3742 "(menu-path \"<Main>/Message/Reply to all\" \"G\")\n"
3743 "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
3744 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3745 "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n"
3746 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3747 "(menu-path \"<Main>/Message/Copy...\" \"<shift>C\")\n"
3748 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3749 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>F\")\n"
3750 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3751 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>N\")\n"
3752 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3754 "(menu-path \"<Main>/Tool/Address book\" \"<shift><control>A\")\n"
3755 "(menu-path \"<Main>/Tool/Execute\" \"X\")\n"
3756 "(menu-path \"<Main>/Tool/Log window\" \"<control>L\")\n"
3758 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3759 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3760 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3761 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3762 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3763 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3764 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3766 static gchar *old_sylpheed_menurc =
3767 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3768 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
3769 "(menu-path \"<Main>/File/Print...\" \"<alt>P\")\n"
3770 "(menu-path \"<Main>/File/Exit\" \"<alt>Q\")\n"
3772 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3773 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3774 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3775 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
3777 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
3778 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
3779 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3780 "(menu-path \"<Main>/View/Unthread view\" \"<shift><control>T\")\n"
3781 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3782 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3783 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3784 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3785 "(menu-path \"<Main>/View/Go to/Other folder...\" \"<alt>G\")\n"
3786 "(menu-path \"<Main>/View/Open in new window\" \"<shift><control>N\")\n"
3787 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3788 "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
3789 "(menu-path \"<Main>/View/Update\" \"<alt>U\")\n"
3791 "(menu-path \"<Main>/Message/Get new mail\" \"<alt>I\")\n"
3792 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><alt>I\")\n"
3793 "(menu-path \"<Main>/Message/Compose an email message\" \"<alt>N\")\n"
3794 "(menu-path \"<Main>/Message/Reply\" \"<alt>R\")\n"
3795 "(menu-path \"<Main>/Message/Reply to sender\" \"<control><alt>R\")\n"
3796 "(menu-path \"<Main>/Message/Reply to all\" \"<shift><alt>R\")\n"
3797 "(menu-path \"<Main>/Message/Forward\" \"<shift><alt>F\")\n"
3798 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift><control>F\")\n" */
3799 "(menu-path \"<Main>/Message/Move...\" \"<alt>O\")\n"
3800 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
3801 "(menu-path \"<Main>/Message/Delete\" \"<alt>D\")\n"
3802 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3803 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3804 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3805 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3807 "(menu-path \"<Main>/Tool/Address book\" \"<alt>A\")\n"
3808 "(menu-path \"<Main>/Tool/Execute\" \"<alt>X\")\n"
3809 "(menu-path \"<Main>/Tool/Log window\" \"<alt>L\")\n"
3811 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3812 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3813 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3814 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3815 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3816 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3817 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3819 static gchar *empty_menurc =
3820 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3821 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
3822 "(menu-path \"<Main>/File/Print...\" \"\")\n"
3823 "(menu-path \"<Main>/File/Exit\" \"\")\n"
3825 "(menu-path \"<Main>/Edit/Copy\" \"\")\n"
3826 "(menu-path \"<Main>/Edit/Select all\" \"\")\n"
3827 "(menu-path \"<Main>/Edit/Find in current message...\" \"\")\n"
3828 "(menu-path \"<Main>/Edit/Search folder...\" \"\")\n"
3830 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
3831 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
3832 "(menu-path \"<Main>/View/Thread view\" \"\")\n"
3833 "(menu-path \"<Main>/View/Unthread view\" \"\")\n"
3834 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
3835 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
3836 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
3837 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
3838 "(menu-path \"<Main>/View/Go to/Other folder...\" \"\")\n"
3839 "(menu-path \"<Main>/View/Open in new window\" \"\")\n"
3840 "(menu-path \"<Main>/View/View source\" \"\")\n"
3841 "(menu-path \"<Main>/View/Show all header\" \"\")\n"
3842 "(menu-path \"<Main>/View/Update\" \"\")\n"
3844 "(menu-path \"<Main>/Message/Get new mail\" \"\")\n"
3845 "(menu-path \"<Main>/Message/Get from all accounts\" \"\")\n"
3846 "(menu-path \"<Main>/Message/Compose an email message\" \"\")\n"
3847 "(menu-path \"<Main>/Message/Reply\" \"\")\n"
3848 "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
3849 "(menu-path \"<Main>/Message/Reply to all\" \"\")\n"
3850 "(menu-path \"<Main>/Message/Forward\" \"\")\n"
3851 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
3852 "(menu-path \"<Main>/Message/Move...\" \"\")\n"
3853 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
3854 "(menu-path \"<Main>/Message/Delete\" \"\")\n"
3855 "(menu-path \"<Main>/Message/Mark/Mark\" \"\")\n"
3856 "(menu-path \"<Main>/Message/Mark/Unmark\" \"\")\n"
3857 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"\")\n"
3858 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3860 "(menu-path \"<Main>/Tool/Address book\" \"\")\n"
3861 "(menu-path \"<Main>/Tool/Execute\" \"\")\n"
3862 "(menu-path \"<Main>/Tool/Log window\" \"\")\n"
3864 "(menu-path \"<Compose>/File/Close\" \"\")\n"
3865 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3866 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
3867 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
3868 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
3869 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
3870 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
3872 text = gtk_entry_get_text(entry);
3874 if (!strcmp(text, _("Default")))
3875 rc_str = default_menurc;
3876 else if (!strcmp(text, "Mew / Wanderlust"))
3877 rc_str = mew_wl_menurc;
3878 else if (!strcmp(text, "Mutt"))
3879 rc_str = mutt_menurc;
3880 else if (!strcmp(text, _("Old Sylpheed")))
3881 rc_str = old_sylpheed_menurc;
3885 gtk_item_factory_parse_rc_string(empty_menurc);
3886 gtk_item_factory_parse_rc_string(rc_str);
3888 gtk_widget_destroy(keybind.window);
3889 keybind.window = NULL;
3890 keybind.combo = NULL;
3893 static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam)
3896 GtkWidget *menuitem;
3899 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
3900 menuitem = gtk_menu_get_active(GTK_MENU(menu));
3901 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
3902 g_free(*((gchar **)pparam->data));
3903 *((gchar **)pparam->data) = g_strdup(charset);
3906 static void prefs_common_charset_set_optmenu(PrefParam *pparam)
3909 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
3911 GtkWidget *menuitem;
3915 g_return_if_fail(optmenu != NULL);
3916 g_return_if_fail(*((gchar **)pparam->data) != NULL);
3918 menu = gtk_option_menu_get_menu(optmenu);
3919 for (cur = GTK_MENU_SHELL(menu)->children;
3920 cur != NULL; cur = cur->next) {
3921 menuitem = GTK_WIDGET(cur->data);
3922 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
3923 if (!strcmp(charset, *((gchar **)pparam->data))) {
3924 gtk_option_menu_set_history(optmenu, n);
3930 gtk_option_menu_set_history(optmenu, 0);
3931 prefs_common_charset_set_data_from_optmenu(pparam);
3934 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam)
3937 GtkWidget *menuitem;
3939 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
3940 menuitem = gtk_menu_get_active(GTK_MENU(menu));
3941 *((RecvDialogMode *)pparam->data) = GPOINTER_TO_INT
3942 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
3945 static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
3947 RecvDialogMode mode = *((RecvDialogMode *)pparam->data);
3948 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
3950 GtkWidget *menuitem;
3953 case RECV_DIALOG_ALWAYS:
3954 gtk_option_menu_set_history(optmenu, 0);
3956 case RECV_DIALOG_ACTIVE:
3957 gtk_option_menu_set_history(optmenu, 1);
3959 case RECV_DIALOG_NEVER:
3960 gtk_option_menu_set_history(optmenu, 2);
3965 menu = gtk_option_menu_get_menu(optmenu);
3966 menuitem = gtk_menu_get_active(GTK_MENU(menu));
3967 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
3970 static gint prefs_common_deleted(GtkWidget *widget, GdkEventAny *event,
3973 prefs_common_cancel();
3977 static void prefs_common_key_pressed(GtkWidget *widget, GdkEventKey *event,
3980 if (event && event->keyval == GDK_Escape)
3981 prefs_common_cancel();
3984 static void prefs_common_ok(void)
3986 prefs_common_apply();
3987 gtk_widget_hide(dialog.window);
3988 if (quote_desc_win && GTK_WIDGET_VISIBLE(quote_desc_win))
3989 gtk_widget_hide(quote_desc_win);
3994 static void prefs_common_apply(void)
3996 prefs_set_data_from_dialog(param);
3997 main_window_reflect_prefs_all();
3998 compose_reflect_prefs_pixmap_theme();
3999 prefs_common_save_config();
4001 inc_autocheck_timer_remove();
4002 inc_autocheck_timer_set();
4005 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam)
4008 GtkWidget *menuitem;
4010 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4011 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4012 *((NextUnreadMsgDialogShow *)pparam->data) = GPOINTER_TO_INT
4013 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4016 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam)
4018 NextUnreadMsgDialogShow dialog_show;
4019 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4021 GtkWidget *menuitem;
4023 dialog_show = *((NextUnreadMsgDialogShow *)pparam->data);
4025 switch (dialog_show) {
4026 case NEXTUNREADMSGDIALOG_ALWAYS:
4027 gtk_option_menu_set_history(optmenu, 0);
4029 case NEXTUNREADMSGDIALOG_ASSUME_YES:
4030 gtk_option_menu_set_history(optmenu, 1);
4032 case NEXTUNREADMSGDIALOG_ASSUME_NO:
4033 gtk_option_menu_set_history(optmenu, 2);
4038 menu = gtk_option_menu_get_menu(optmenu);
4039 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4040 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4043 static void prefs_common_cancel(void)
4045 gtk_widget_hide(dialog.window);
4050 static struct _ComposePrefs
4054 GtkWidget *close_btn;
4057 static void compose_prefs_key_pressed(GtkWidget *widget, GdkEventKey *event);
4058 static gint compose_prefs_delete_event(GtkWidget *widget, GdkEventAny *event);
4059 static void compose_prefs_close(GtkWidget *widget);
4060 static void compose_prefs_fmt_create(void);
4062 static void compose_prefs_close(GtkWidget *widget)
4064 gtk_widget_hide(composeprefs.window);
4067 static gint compose_prefs_delete_event(GtkWidget *widget, GdkEventAny *event)
4069 gtk_widget_hide(composeprefs.window);
4074 static void compose_prefs_key_pressed(GtkWidget *widget, GdkEventKey *event)
4076 if (event && event->keyval == GDK_Escape) {
4077 gtk_widget_hide(composeprefs.window);
4081 /* static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
4084 GtkWidget *menuitem;
4086 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4087 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4088 *((RecvDialogShow *)pparam->data) = GPOINTER_TO_INT
4089 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4092 /* static void prefs_recvdialog_set_optmenu(PrefParam *pparam)
4094 RecvDialogShow dialog_show;
4095 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4097 GtkWidget *menuitem;
4099 dialog_show = *((RecvDialogShow *)pparam->data);
4101 switch (dialog_show) {
4102 case RECVDIALOG_ALWAYS:
4103 gtk_option_menu_set_history(optmenu, 0);
4105 case RECVDIALOG_WINDOW_ACTIVE:
4106 gtk_option_menu_set_history(optmenu, 1);
4108 case RECVDIALOG_NEVER:
4109 gtk_option_menu_set_history(optmenu, 2);
4114 menu = gtk_option_menu_get_menu(optmenu);
4115 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4116 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));