2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2002 Hiroyuki Yamamoto
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 #include <gdk/gdkkeysyms.h>
33 #include <sys/types.h>
40 #include "prefs_common.h"
41 #include "prefs_display_header.h"
42 #include "prefs_summary_column.h"
43 #include "mainwindow.h"
44 #include "summaryview.h"
45 #include "messageview.h"
46 #include "manage_window.h"
52 #include "alertpanel.h"
55 #include "folderview.h"
56 #include "stock_pixmap.h"
57 #include "quote_fmt.h"
60 #include "gtkaspell.h"
63 PrefsCommon prefs_common;
65 static PrefsDialog dialog;
67 static struct Receive {
68 GtkWidget *checkbtn_incext;
69 GtkWidget *entry_incext;
70 GtkWidget *button_incext;
72 GtkWidget *checkbtn_local;
73 GtkWidget *checkbtn_filter_on_inc;
74 GtkWidget *entry_spool;
76 GtkWidget *checkbtn_autochk;
77 GtkWidget *spinbtn_autochk;
78 GtkObject *spinbtn_autochk_adj;
80 GtkWidget *checkbtn_chkonstartup;
81 GtkWidget *checkbtn_scan_after_inc;
84 GtkWidget *checkbtn_newmail_auto;
85 GtkWidget *checkbtn_newmail_manu;
86 GtkWidget *entry_newmail_notify_cmd;
87 GtkWidget *hbox_newmail_notify;
89 GtkWidget *spinbtn_maxarticle;
90 GtkObject *spinbtn_maxarticle_adj;
94 GtkWidget *checkbtn_extsend;
95 GtkWidget *entry_extsend;
96 GtkWidget *button_extsend;
98 GtkWidget *checkbtn_savemsg;
99 GtkWidget *checkbtn_queuemsg;
101 GtkWidget *optmenu_charset;
104 static struct Compose {
105 GtkWidget *checkbtn_autosig;
106 GtkWidget *entry_sigsep;
108 GtkWidget *entry_fw_quotemark;
109 GtkWidget *text_fw_quotefmt;
111 GtkWidget *checkbtn_autoextedit;
112 GtkWidget *spinbtn_undolevel;
113 GtkObject *spinbtn_undolevel_adj;
114 GtkWidget *spinbtn_linewrap;
115 GtkObject *spinbtn_linewrap_adj;
116 GtkWidget *checkbtn_wrapquote;
117 GtkWidget *checkbtn_autowrap;
118 GtkWidget *checkbtn_wrapatsend;
120 GtkWidget *checkbtn_reply_account_autosel;
121 GtkWidget *checkbtn_forward_account_autosel;
122 GtkWidget *checkbtn_reedit_account_autosel;
123 GtkWidget *checkbtn_quote;
124 GtkWidget *checkbtn_default_reply_list;
125 GtkWidget *checkbtn_forward_as_attachment;
126 GtkWidget *checkbtn_redirect_keep_from;
127 GtkWidget *checkbtn_smart_wrapping;
128 GtkWidget *checkbtn_block_cursor;
129 GtkWidget *checkbtn_reply_with_quote;
131 GtkWidget *checkbtn_autosave;
132 GtkWidget *entry_autosave_length;
137 static struct Spelling {
138 GtkWidget *checkbtn_enable_aspell;
139 GtkWidget *entry_aspell_path;
140 GtkWidget *btn_aspell_path;
141 GtkWidget *optmenu_dictionary;
142 GtkWidget *optmenu_sugmode;
143 GtkWidget *misspelled_btn;
144 GtkWidget *checkbtn_use_alternate;
145 GtkWidget *checkbtn_check_while_typing;
149 static struct Quote {
150 GtkWidget *entry_quotemark;
151 GtkWidget *text_quotefmt;
153 GtkWidget *entry_fw_quotemark;
154 GtkWidget *text_fw_quotefmt;
156 GtkWidget *entry_quote_chars;
159 static struct Display {
160 GtkWidget *entry_textfont;
161 GtkWidget *button_textfont;
163 GtkWidget *entry_smallfont;
164 GtkWidget *entry_normalfont;
165 GtkWidget *entry_boldfont;
167 GtkWidget *chkbtn_folder_unread;
168 GtkWidget *entry_ng_abbrev_len;
169 GtkWidget *spinbtn_ng_abbrev_len;
170 GtkObject *spinbtn_ng_abbrev_len_adj;
172 GtkWidget *chkbtn_transhdr;
174 GtkWidget *chkbtn_swapfrom;
175 GtkWidget *chkbtn_useaddrbook;
176 GtkWidget *chkbtn_expand_thread;
177 GtkWidget *entry_datefmt;
180 static struct Message {
181 GtkWidget *chkbtn_enablecol;
182 GtkWidget *button_edit_col;
183 GtkWidget *chkbtn_mbalnum;
184 GtkWidget *chkbtn_disphdrpane;
185 GtkWidget *chkbtn_disphdr;
186 GtkWidget *spinbtn_linespc;
187 GtkObject *spinbtn_linespc_adj;
188 GtkWidget *chkbtn_headspc;
190 GtkWidget *chkbtn_smoothscroll;
191 GtkWidget *spinbtn_scrollstep;
192 GtkObject *spinbtn_scrollstep_adj;
193 GtkWidget *chkbtn_halfpage;
195 GtkWidget *chkbtn_display_img;
196 GtkWidget *chkbtn_resize_image;
200 static struct Privacy {
201 GtkWidget *checkbtn_auto_check_signatures;
202 GtkWidget *checkbtn_gpg_signature_popup;
203 GtkWidget *checkbtn_store_passphrase;
204 GtkWidget *spinbtn_store_passphrase;
205 GtkObject *spinbtn_store_passphrase_adj;
206 GtkWidget *checkbtn_passphrase_grab;
207 GtkWidget *checkbtn_gpg_warning;
211 static struct Interface {
212 /* GtkWidget *checkbtn_emacs; */
213 GtkWidget *checkbtn_show_msg_with_cursor;
214 GtkWidget *checkbtn_openunread;
215 GtkWidget *checkbtn_mark_as_read_on_newwin;
216 GtkWidget *checkbtn_openinbox;
217 GtkWidget *checkbtn_immedexec;
218 GtkWidget *optmenu_recvdialog;
219 GtkWidget *optmenu_senddialog;
220 GtkWidget *checkbtn_no_recv_err_panel;
221 GtkWidget *checkbtn_close_recv_dialog;
222 GtkWidget *optmenu_nextunreadmsgdialog;
223 GtkWidget *entry_pixmap_theme;
224 GtkWidget *combo_pixmap_theme;
227 static struct Other {
228 GtkWidget *uri_combo;
229 GtkWidget *uri_entry;
230 GtkWidget *printcmd_entry;
231 GtkWidget *exteditor_combo;
232 GtkWidget *exteditor_entry;
233 GtkWidget *checkbtn_addaddrbyclick;
234 GtkWidget *checkbtn_confonexit;
235 GtkWidget *checkbtn_cleanonexit;
236 GtkWidget *checkbtn_askonclean;
237 GtkWidget *checkbtn_warnqueued;
238 GtkWidget *checkbtn_cliplog;
239 GtkWidget *loglength_entry;
241 GtkWidget *checkbtn_ssl_ask_unknown_valid;
245 static struct MessageColorButtons {
246 GtkWidget *quote_level1_btn;
247 GtkWidget *quote_level2_btn;
248 GtkWidget *quote_level3_btn;
250 GtkWidget *tgt_folder_btn;
251 GtkWidget *signature_btn;
254 static struct KeybindDialog {
259 static GtkWidget *font_sel_win;
260 static guint font_sel_conn_id;
261 static GtkWidget *quote_color_win;
262 static GtkWidget *color_dialog;
264 static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam);
265 static void prefs_common_charset_set_optmenu (PrefParam *pparam);
266 static void prefs_common_recv_dialog_newmail_notify_toggle_cb (GtkWidget *w,
268 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam);
269 static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam);
270 static void prefs_common_send_dialog_set_data_from_optmenu(PrefParam *pparam);
271 static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam);
272 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam);
273 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam);
276 static void prefs_dictionary_set_data_from_optmenu (PrefParam *param);
277 static void prefs_dictionary_set_optmenu (PrefParam *pparam);
278 static void prefs_speller_sugmode_set_data_from_optmenu (PrefParam *pparam);
279 static void prefs_speller_sugmode_set_optmenu (PrefParam *pparam);
284 parameter name, default value, pointer to the prefs variable, data type,
285 pointer to the widget pointer,
286 pointer to the function for data setting,
287 pointer to the function for widget setting
290 static PrefParam param[] = {
292 {"use_ext_inc", "FALSE", &prefs_common.use_extinc, P_BOOL,
293 &receive.checkbtn_incext,
294 prefs_set_data_from_toggle, prefs_set_toggle},
295 {"ext_inc_path", DEFAULT_INC_PATH, &prefs_common.extinc_cmd, P_STRING,
296 &receive.entry_incext,
297 prefs_set_data_from_entry, prefs_set_entry},
299 {"inc_local", "TRUE", &prefs_common.inc_local, P_BOOL,
300 &receive.checkbtn_local,
301 prefs_set_data_from_toggle, prefs_set_toggle},
302 {"filter_on_inc_local", "FALSE", &prefs_common.filter_on_inc, P_BOOL,
303 &receive.checkbtn_filter_on_inc,
304 prefs_set_data_from_toggle, prefs_set_toggle},
305 {"spool_path", DEFAULT_SPOOL_PATH, &prefs_common.spool_path, P_STRING,
306 &receive.entry_spool,
307 prefs_set_data_from_entry, prefs_set_entry},
309 {"autochk_newmail", "FALSE", &prefs_common.autochk_newmail, P_BOOL,
310 &receive.checkbtn_autochk,
311 prefs_set_data_from_toggle, prefs_set_toggle},
312 {"autochk_interval", "10", &prefs_common.autochk_itv, P_INT,
313 &receive.spinbtn_autochk,
314 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
315 {"check_on_startup", "FALSE", &prefs_common.chk_on_startup, P_BOOL,
316 &receive.checkbtn_chkonstartup,
317 prefs_set_data_from_toggle, prefs_set_toggle},
318 {"scan_all_after_inc", "FALSE", &prefs_common.scan_all_after_inc,
319 P_BOOL, &receive.checkbtn_scan_after_inc,
320 prefs_set_data_from_toggle, prefs_set_toggle},
321 {"newmail_notify_manu", "FALSE", &prefs_common.newmail_notify_manu,
322 P_BOOL, &receive.checkbtn_newmail_manu,
323 prefs_set_data_from_toggle, prefs_set_toggle},
324 {"newmail_notify_auto", "FALSE", &prefs_common.newmail_notify_auto,
325 P_BOOL, &receive.checkbtn_newmail_auto,
326 prefs_set_data_from_toggle, prefs_set_toggle},
327 {"newmail_notify_cmd", "", &prefs_common.newmail_notify_cmd, P_STRING,
328 &receive.entry_newmail_notify_cmd,
329 prefs_set_data_from_entry, prefs_set_entry},
331 {"max_news_articles", "300", &prefs_common.max_articles, P_INT,
332 &receive.spinbtn_maxarticle,
333 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
336 {"use_ext_sendmail", "FALSE", &prefs_common.use_extsend, P_BOOL,
337 &p_send.checkbtn_extsend,
338 prefs_set_data_from_toggle, prefs_set_toggle},
339 {"ext_sendmail_cmd", DEFAULT_SENDMAIL_CMD,
340 &prefs_common.extsend_cmd, P_STRING,
341 &p_send.entry_extsend, prefs_set_data_from_entry, prefs_set_entry},
342 {"save_message", "TRUE", &prefs_common.savemsg, P_BOOL,
343 &p_send.checkbtn_savemsg,
344 prefs_set_data_from_toggle, prefs_set_toggle},
345 {"queue_message", "FALSE", &prefs_common.queue_msg, P_BOOL,
346 &p_send.checkbtn_queuemsg,
347 prefs_set_data_from_toggle, prefs_set_toggle},
349 {"outgoing_charset", CS_AUTO, &prefs_common.outgoing_charset, P_STRING,
350 &p_send.optmenu_charset,
351 prefs_common_charset_set_data_from_optmenu,
352 prefs_common_charset_set_optmenu},
355 {"auto_signature", "TRUE", &prefs_common.auto_sig, P_BOOL,
356 &compose.checkbtn_autosig,
357 prefs_set_data_from_toggle, prefs_set_toggle},
358 {"signature_separator", "-- ", &prefs_common.sig_sep, P_STRING,
359 &compose.entry_sigsep, prefs_set_data_from_entry, prefs_set_entry},
361 {"auto_ext_editor", "FALSE", &prefs_common.auto_exteditor, P_BOOL,
362 &compose.checkbtn_autoextedit,
363 prefs_set_data_from_toggle, prefs_set_toggle},
364 {"forward_as_attachment", "FALSE", &prefs_common.forward_as_attachment,
365 P_BOOL, &compose.checkbtn_forward_as_attachment,
366 prefs_set_data_from_toggle, prefs_set_toggle},
367 {"redirect_keep_from", "FALSE",
368 &prefs_common.redirect_keep_from, P_BOOL,
369 &compose.checkbtn_redirect_keep_from,
370 prefs_set_data_from_toggle, prefs_set_toggle},
371 {"undo_level", "50", &prefs_common.undolevels, P_INT,
372 &compose.spinbtn_undolevel,
373 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
374 {"block_cursor", "FALSE", &prefs_common.block_cursor,
375 P_BOOL, &compose.checkbtn_block_cursor,
376 prefs_set_data_from_toggle, prefs_set_toggle},
378 {"linewrap_length", "72", &prefs_common.linewrap_len, P_INT,
379 &compose.spinbtn_linewrap,
380 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
381 {"linewrap_quotation", "FALSE", &prefs_common.linewrap_quote, P_BOOL,
382 &compose.checkbtn_wrapquote,
383 prefs_set_data_from_toggle, prefs_set_toggle},
384 {"linewrap_auto", "FALSE", &prefs_common.autowrap, P_BOOL,
385 &compose.checkbtn_autowrap,
386 prefs_set_data_from_toggle, prefs_set_toggle},
387 {"linewrap_before_sending", "FALSE",
388 &prefs_common.linewrap_at_send, P_BOOL,
389 &compose.checkbtn_wrapatsend,
390 prefs_set_data_from_toggle, prefs_set_toggle},
391 {"smart_wrapping", "TRUE", &prefs_common.smart_wrapping,
392 P_BOOL, &compose.checkbtn_smart_wrapping,
393 prefs_set_data_from_toggle, prefs_set_toggle},
394 {"autosave", "FALSE", &prefs_common.autosave,
395 P_BOOL, &compose.checkbtn_autosave,
396 prefs_set_data_from_toggle, prefs_set_toggle},
397 {"autosave_length", "50", &prefs_common.autosave_length,
398 P_INT, &compose.entry_autosave_length,
399 prefs_set_data_from_entry, prefs_set_entry},
401 {"enable_aspell", "TRUE", &prefs_common.enable_aspell,
402 P_BOOL, &spelling.checkbtn_enable_aspell,
403 prefs_set_data_from_toggle, prefs_set_toggle},
404 {"aspell_path", ASPELL_PATH, &prefs_common.aspell_path,
405 P_STRING, &spelling.entry_aspell_path,
406 prefs_set_data_from_entry, prefs_set_entry},
407 {"dictionary", "", &prefs_common.dictionary,
408 P_STRING, &spelling.optmenu_dictionary,
409 prefs_dictionary_set_data_from_optmenu, prefs_dictionary_set_optmenu },
410 {"aspell_sugmode", "1", &prefs_common.aspell_sugmode,
411 P_INT, &spelling.optmenu_sugmode,
412 prefs_speller_sugmode_set_data_from_optmenu, prefs_speller_sugmode_set_optmenu },
413 {"use_alternate_dict", "FALSE", &prefs_common.use_alternate,
414 P_BOOL, &spelling.checkbtn_use_alternate,
415 prefs_set_data_from_toggle, prefs_set_toggle},
416 {"check_while_typing", "TRUE", &prefs_common.check_while_typing,
417 P_BOOL, &spelling.checkbtn_check_while_typing,
418 prefs_set_data_from_toggle, prefs_set_toggle},
419 {"misspelled_color", "16711680", &prefs_common.misspelled_col, P_INT,
422 {"reply_with_quote", "TRUE", &prefs_common.reply_with_quote, P_BOOL,
423 &compose.checkbtn_reply_with_quote, prefs_set_data_from_toggle, prefs_set_toggle},
425 /* Account autoselection */
426 {"reply_account_autoselect", "TRUE",
427 &prefs_common.reply_account_autosel, P_BOOL,
428 &compose.checkbtn_reply_account_autosel,
429 prefs_set_data_from_toggle, prefs_set_toggle},
430 {"forward_account_autoselect", "TRUE",
431 &prefs_common.forward_account_autosel, P_BOOL,
432 &compose.checkbtn_forward_account_autosel,
433 prefs_set_data_from_toggle, prefs_set_toggle},
434 {"reedit_account_autoselect", "TRUE",
435 &prefs_common.reedit_account_autosel, P_BOOL,
436 &compose.checkbtn_reedit_account_autosel,
437 prefs_set_data_from_toggle, prefs_set_toggle},
439 {"default_reply_list", "TRUE", &prefs_common.default_reply_list, P_BOOL,
440 &compose.checkbtn_default_reply_list,
441 prefs_set_data_from_toggle, prefs_set_toggle},
443 {"show_ruler", "TRUE", &prefs_common.show_ruler, P_BOOL,
447 {"reply_quote_mark", "> ", &prefs_common.quotemark, P_STRING,
448 "e.entry_quotemark, prefs_set_data_from_entry, prefs_set_entry},
449 {"reply_quote_format", "On %d\\n%f wrote:\\n\\n%Q",
450 &prefs_common.quotefmt, P_STRING, "e.text_quotefmt,
451 prefs_set_data_from_text, prefs_set_text},
453 {"forward_quote_mark", "> ", &prefs_common.fw_quotemark, P_STRING,
454 "e.entry_fw_quotemark,
455 prefs_set_data_from_entry, prefs_set_entry},
456 {"forward_quote_format",
457 "\\n\\nBegin forwarded message:\\n\\n"
458 "?d{Date: %d\\n}?f{From: %f\\n}?t{To: %t\\n}?c{Cc: %c\\n}"
459 "?n{Newsgroups: %n\\n}?s{Subject: %s\\n}\\n\\n%M",
460 &prefs_common.fw_quotefmt, P_STRING, "e.text_fw_quotefmt,
461 prefs_set_data_from_text, prefs_set_text},
462 {"quote_chars", ">", &prefs_common.quote_chars, P_STRING,
463 "e.entry_quote_chars, prefs_set_data_from_entry, prefs_set_entry},
466 {"widget_font", NULL, &prefs_common.widgetfont, P_STRING,
468 {"message_font", "-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*",
469 &prefs_common.textfont, P_STRING,
470 &display.entry_textfont,
471 prefs_set_data_from_entry, prefs_set_entry},
472 {"small_font", "-*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*",
473 &prefs_common.smallfont, P_STRING,
474 &display.entry_smallfont,
475 prefs_set_data_from_entry, prefs_set_entry},
476 {"bold_font", "-*-helvetica-bold-r-normal--12-*-*-*-*-*-*-*",
477 &prefs_common.boldfont, P_STRING,
478 &display.entry_boldfont,
479 prefs_set_data_from_entry, prefs_set_entry},
480 {"normal_font", "-*-helvetica-medium-r-normal--12-*-*-*-*-*-*-*",
481 &prefs_common.normalfont, P_STRING,
482 &display.entry_normalfont,
483 prefs_set_data_from_entry, prefs_set_entry},
486 {"display_folder_unread_num", "TRUE",
487 &prefs_common.display_folder_unread, P_BOOL,
488 &display.chkbtn_folder_unread,
489 prefs_set_data_from_toggle, prefs_set_toggle},
490 {"newsgroup_abbrev_len", "16",
491 &prefs_common.ng_abbrev_len, P_INT,
492 &display.spinbtn_ng_abbrev_len,
493 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
495 {"translate_header", "TRUE", &prefs_common.trans_hdr, P_BOOL,
496 &display.chkbtn_transhdr,
497 prefs_set_data_from_toggle, prefs_set_toggle},
499 /* Display: Summary View */
500 {"enable_swap_from", "FALSE", &prefs_common.swap_from, P_BOOL,
501 &display.chkbtn_swapfrom,
502 prefs_set_data_from_toggle, prefs_set_toggle},
503 {"use_address_book", "TRUE", &prefs_common.use_addr_book, P_BOOL,
504 &display.chkbtn_useaddrbook,
505 prefs_set_data_from_toggle, prefs_set_toggle},
506 {"date_format", "%y/%m/%d(%a) %H:%M", &prefs_common.date_format,
507 P_STRING, &display.entry_datefmt,
508 prefs_set_data_from_entry, prefs_set_entry},
509 {"expand_thread", "TRUE", &prefs_common.expand_thread, P_BOOL,
510 &display.chkbtn_expand_thread,
511 prefs_set_data_from_toggle, prefs_set_toggle},
513 {"enable_hscrollbar", "TRUE", &prefs_common.enable_hscrollbar, P_BOOL,
515 {"bold_unread", "TRUE", &prefs_common.bold_unread, P_BOOL,
518 {"enable_thread", "TRUE", &prefs_common.enable_thread, P_BOOL,
520 {"toolbar_style", "3", &prefs_common.toolbar_style, P_ENUM,
522 {"show_statusbar", "TRUE", &prefs_common.show_statusbar, P_BOOL,
524 {"show_searchbar", "TRUE", &prefs_common.show_searchbar, P_BOOL,
527 {"folderview_vscrollbar_policy", "0",
528 &prefs_common.folderview_vscrollbar_policy, P_ENUM,
531 {"summary_col_show_mark", "TRUE",
532 &prefs_common.summary_col_visible[S_COL_MARK], P_BOOL, NULL, NULL, NULL},
533 {"summary_col_show_unread", "TRUE",
534 &prefs_common.summary_col_visible[S_COL_UNREAD], P_BOOL, NULL, NULL, NULL},
535 {"summary_col_show_mime", "TRUE",
536 &prefs_common.summary_col_visible[S_COL_MIME], P_BOOL, NULL, NULL, NULL},
537 {"summary_col_show_subject", "TRUE",
538 &prefs_common.summary_col_visible[S_COL_SUBJECT], P_BOOL, NULL, NULL, NULL},
539 {"summary_col_show_from", "TRUE",
540 &prefs_common.summary_col_visible[S_COL_FROM], P_BOOL, NULL, NULL, NULL},
541 {"summary_col_show_date", "TRUE",
542 &prefs_common.summary_col_visible[S_COL_DATE], P_BOOL, NULL, NULL, NULL},
543 {"summary_col_show_size", "TRUE",
544 &prefs_common.summary_col_visible[S_COL_SIZE], P_BOOL, NULL, NULL, NULL},
545 {"summary_col_show_number", "FALSE",
546 &prefs_common.summary_col_visible[S_COL_NUMBER], P_BOOL, NULL, NULL, NULL},
547 {"summary_col_show_score", "FALSE",
548 &prefs_common.summary_col_visible[S_COL_SCORE], P_BOOL, NULL, NULL, NULL},
549 {"summary_col_show_locked", "FALSE",
550 &prefs_common.summary_col_visible[S_COL_LOCKED], P_BOOL, NULL, NULL, NULL},
552 {"summary_col_pos_mark", "0",
553 &prefs_common.summary_col_pos[S_COL_MARK], P_INT, NULL, NULL, NULL},
554 {"summary_col_pos_unread", "1",
555 &prefs_common.summary_col_pos[S_COL_UNREAD], P_INT, NULL, NULL, NULL},
556 {"summary_col_pos_mime", "2",
557 &prefs_common.summary_col_pos[S_COL_MIME], P_INT, NULL, NULL, NULL},
558 {"summary_col_pos_subject", "3",
559 &prefs_common.summary_col_pos[S_COL_SUBJECT], P_INT, NULL, NULL, NULL},
560 {"summary_col_pos_from", "4",
561 &prefs_common.summary_col_pos[S_COL_FROM], P_INT, NULL, NULL, NULL},
562 {"summary_col_pos_date", "5",
563 &prefs_common.summary_col_pos[S_COL_DATE], P_INT, NULL, NULL, NULL},
564 {"summary_col_pos_size", "6",
565 &prefs_common.summary_col_pos[S_COL_SIZE], P_INT, NULL, NULL, NULL},
566 {"summary_col_pos_number", "7",
567 &prefs_common.summary_col_pos[S_COL_NUMBER], P_INT, NULL, NULL, NULL},
568 {"summary_col_pos_score", "8",
569 &prefs_common.summary_col_pos[S_COL_SCORE], P_INT, NULL, NULL, NULL},
570 {"summary_col_pos_locked", "9",
571 &prefs_common.summary_col_pos[S_COL_LOCKED], P_INT, NULL, NULL, NULL},
573 {"summary_col_size_mark", "10",
574 &prefs_common.summary_col_size[S_COL_MARK], P_INT, NULL, NULL, NULL},
575 {"summary_col_size_unread", "13",
576 &prefs_common.summary_col_size[S_COL_UNREAD], P_INT, NULL, NULL, NULL},
577 {"summary_col_size_mime", "10",
578 &prefs_common.summary_col_size[S_COL_MIME], P_INT, NULL, NULL, NULL},
579 {"summary_col_size_subject", "200",
580 &prefs_common.summary_col_size[S_COL_SUBJECT], P_INT, NULL, NULL, NULL},
581 {"summary_col_size_from", "120",
582 &prefs_common.summary_col_size[S_COL_FROM], P_INT, NULL, NULL, NULL},
583 {"summary_col_size_date", "118",
584 &prefs_common.summary_col_size[S_COL_DATE], P_INT, NULL, NULL, NULL},
585 {"summary_col_size_size", "45",
586 &prefs_common.summary_col_size[S_COL_SIZE], P_INT, NULL, NULL, NULL},
587 {"summary_col_size_number", "40",
588 &prefs_common.summary_col_size[S_COL_NUMBER], P_INT, NULL, NULL, NULL},
589 {"summary_col_size_score", "40",
590 &prefs_common.summary_col_size[S_COL_SCORE], P_INT, NULL, NULL, NULL},
591 {"summary_col_size_locked", "13",
592 &prefs_common.summary_col_size[S_COL_LOCKED], P_INT, NULL, NULL, NULL},
595 {"folderview_width", "179", &prefs_common.folderview_width, P_INT,
597 {"folderview_height", "600", &prefs_common.folderview_height, P_INT,
599 {"folder_col_folder", "150", &prefs_common.folder_col_folder, P_INT,
601 {"folder_col_new", "32", &prefs_common.folder_col_new, P_INT,
603 {"folder_col_unread", "32", &prefs_common.folder_col_unread, P_INT,
605 {"folder_col_total", "32", &prefs_common.folder_col_total, P_INT,
608 {"summaryview_width", "600", &prefs_common.summaryview_width, P_INT,
610 {"summaryview_height", "173", &prefs_common.summaryview_height, P_INT,
613 {"mainview_x", "64", &prefs_common.mainview_x, P_INT,
615 {"mainview_y", "64", &prefs_common.mainview_y, P_INT,
617 {"mainview_width", "600", &prefs_common.mainview_width, P_INT,
619 {"mainview_height", "600", &prefs_common.mainview_height, P_INT,
621 {"mainwin_x", "64", &prefs_common.mainwin_x, P_INT,
623 {"mainwin_y", "64", &prefs_common.mainwin_y, P_INT,
625 {"mainwin_width", "800", &prefs_common.mainwin_width, P_INT,
627 {"mainwin_height", "600", &prefs_common.mainwin_height, P_INT,
629 {"messagewin_width", "600", &prefs_common.msgwin_width, P_INT,
631 {"messagewin_height", "540", &prefs_common.msgwin_height, P_INT,
633 {"compose_width", "600", &prefs_common.compose_width, P_INT,
635 {"compose_height", "560", &prefs_common.compose_height, P_INT,
639 {"enable_color", "TRUE", &prefs_common.enable_color, P_BOOL,
640 &message.chkbtn_enablecol,
641 prefs_set_data_from_toggle, prefs_set_toggle},
643 {"quote_level1_color", "179", &prefs_common.quote_level1_col, P_INT,
645 {"quote_level2_color", "179", &prefs_common.quote_level2_col, P_INT,
647 {"quote_level3_color", "179", &prefs_common.quote_level3_col, P_INT,
649 {"uri_color", "32512", &prefs_common.uri_col, P_INT,
651 {"target_folder_color", "14294218", &prefs_common.tgt_folder_col, P_INT,
653 {"signature_color", "7960953", &prefs_common.signature_col, P_INT,
655 {"recycle_quote_colors", "FALSE", &prefs_common.recycle_quote_colors,
656 P_BOOL, NULL, NULL, NULL},
658 {"convert_mb_alnum", "FALSE", &prefs_common.conv_mb_alnum, P_BOOL,
659 &message.chkbtn_mbalnum,
660 prefs_set_data_from_toggle, prefs_set_toggle},
661 {"display_header_pane", "TRUE", &prefs_common.display_header_pane,
662 P_BOOL, &message.chkbtn_disphdrpane,
663 prefs_set_data_from_toggle, prefs_set_toggle},
664 {"display_header", "TRUE", &prefs_common.display_header, P_BOOL,
665 &message.chkbtn_disphdr,
666 prefs_set_data_from_toggle, prefs_set_toggle},
667 {"line_space", "2", &prefs_common.line_space, P_INT,
668 &message.spinbtn_linespc,
669 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
670 {"enable_head_space", "FALSE", &prefs_common.head_space, P_BOOL,
671 &message.chkbtn_headspc,
672 prefs_set_data_from_toggle, prefs_set_toggle},
674 {"enable_smooth_scroll", "FALSE",
675 &prefs_common.enable_smooth_scroll, P_BOOL,
676 &message.chkbtn_smoothscroll,
677 prefs_set_data_from_toggle, prefs_set_toggle},
678 {"scroll_step", "1", &prefs_common.scroll_step, P_INT,
679 &message.spinbtn_scrollstep,
680 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
681 {"scroll_half_page", "FALSE", &prefs_common.scroll_halfpage, P_BOOL,
682 &message.chkbtn_halfpage,
683 prefs_set_data_from_toggle, prefs_set_toggle},
685 {"display_img", "TRUE", &prefs_common.display_img, P_BOOL,
686 &message.chkbtn_display_img,
687 prefs_set_data_from_toggle, prefs_set_toggle},
688 {"resize_image", "TRUE", &prefs_common.resize_image, P_BOOL,
689 &message.chkbtn_resize_image,
690 prefs_set_data_from_toggle, prefs_set_toggle},
692 {"show_other_header", "FALSE", &prefs_common.show_other_header, P_BOOL,
696 {"mime_image_viewer", "display '%s'",
697 &prefs_common.mime_image_viewer, P_STRING, NULL, NULL, NULL},
698 {"mime_audio_player", "play '%s'",
699 &prefs_common.mime_audio_player, P_STRING, NULL, NULL, NULL},
700 {"mime_open_command", "gedit '%s'",
701 &prefs_common.mime_open_cmd, P_STRING, NULL, NULL, NULL},
705 {"auto_check_signatures", "TRUE",
706 &prefs_common.auto_check_signatures, P_BOOL,
707 &privacy.checkbtn_auto_check_signatures,
708 prefs_set_data_from_toggle, prefs_set_toggle},
709 {"gpg_signature_popup", "FALSE",
710 &prefs_common.gpg_signature_popup, P_BOOL,
711 &privacy.checkbtn_gpg_signature_popup,
712 prefs_set_data_from_toggle, prefs_set_toggle},
713 {"store_passphrase", "FALSE", &prefs_common.store_passphrase, P_BOOL,
714 &privacy.checkbtn_store_passphrase,
715 prefs_set_data_from_toggle, prefs_set_toggle},
716 {"store_passphrase_timeout", "0",
717 &prefs_common.store_passphrase_timeout, P_INT,
718 &privacy.spinbtn_store_passphrase,
719 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
721 {"passphrase_grab", "FALSE", &prefs_common.passphrase_grab, P_BOOL,
722 &privacy.checkbtn_passphrase_grab,
723 prefs_set_data_from_toggle, prefs_set_toggle},
724 #endif /* __MINGW32__ */
725 {"gpg_warning", "TRUE", &prefs_common.gpg_warning, P_BOOL,
726 &privacy.checkbtn_gpg_warning,
727 prefs_set_data_from_toggle, prefs_set_toggle},
728 #endif /* USE_GPGME */
731 {"separate_folder", "FALSE", &prefs_common.sep_folder, P_BOOL,
733 {"separate_message", "FALSE", &prefs_common.sep_msg, P_BOOL,
736 /* {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
737 NULL, NULL, NULL}, */
738 {"show_message_with_cursor_key", "FALSE",
739 &prefs_common.show_msg_with_cursor_key,
740 P_BOOL, &interface.checkbtn_show_msg_with_cursor,
741 prefs_set_data_from_toggle, prefs_set_toggle},
742 {"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
743 P_BOOL, &interface.checkbtn_openunread,
744 prefs_set_data_from_toggle, prefs_set_toggle},
745 {"mark_as_read_on_new_window", "FALSE",
746 &prefs_common.mark_as_read_on_new_window,
747 P_BOOL, &interface.checkbtn_mark_as_read_on_newwin,
748 prefs_set_data_from_toggle, prefs_set_toggle},
749 {"open_inbox_on_inc", "FALSE", &prefs_common.open_inbox_on_inc,
750 P_BOOL, &interface.checkbtn_openinbox,
751 prefs_set_data_from_toggle, prefs_set_toggle},
752 {"immediate_execution", "TRUE", &prefs_common.immediate_exec, P_BOOL,
753 &interface.checkbtn_immedexec,
754 prefs_set_data_from_toggle, prefs_set_toggle},
755 {"receive_dialog_mode", "1", &prefs_common.recv_dialog_mode, P_ENUM,
756 &interface.optmenu_recvdialog,
757 prefs_common_recv_dialog_set_data_from_optmenu,
758 prefs_common_recv_dialog_set_optmenu},
759 {"send_dialog_mode", "0", &prefs_common.send_dialog_mode, P_ENUM,
760 &interface.optmenu_senddialog,
761 prefs_common_send_dialog_set_data_from_optmenu,
762 prefs_common_send_dialog_set_optmenu},
763 {"no_receive_error_panel", "FALSE", &prefs_common.no_recv_err_panel,
764 P_BOOL, &interface.checkbtn_no_recv_err_panel,
765 prefs_set_data_from_toggle, prefs_set_toggle},
766 {"close_receive_dialog", "TRUE", &prefs_common.close_recv_dialog,
767 P_BOOL, &interface.checkbtn_close_recv_dialog,
768 prefs_set_data_from_toggle, prefs_set_toggle},
769 {"nextunreadmsg_dialog", NULL, &prefs_common.next_unread_msg_dialog, P_ENUM,
770 &interface.optmenu_nextunreadmsgdialog,
771 prefs_nextunreadmsgdialog_set_data_from_optmenu,
772 prefs_nextunreadmsgdialog_set_optmenu},
774 {"pixmap_theme_path", DEFAULT_PIXMAP_THEME,
775 &prefs_common.pixmap_theme_path, P_STRING,
776 &interface.entry_pixmap_theme, prefs_set_data_from_entry, prefs_set_entry},
779 {"uri_open_command", "netscape -remote 'openURL(%s,raise)'",
780 &prefs_common.uri_cmd, P_STRING,
781 &other.uri_entry, prefs_set_data_from_entry, prefs_set_entry},
782 {"print_command", "lpr %s", &prefs_common.print_cmd, P_STRING,
783 &other.printcmd_entry, prefs_set_data_from_entry, prefs_set_entry},
784 {"ext_editor_command", "gedit %s",
785 &prefs_common.ext_editor_cmd, P_STRING,
786 &other.exteditor_entry, prefs_set_data_from_entry, prefs_set_entry},
788 {"add_address_by_click", "FALSE", &prefs_common.add_address_by_click,
789 P_BOOL, &other.checkbtn_addaddrbyclick,
790 prefs_set_data_from_toggle, prefs_set_toggle},
792 {"confirm_on_exit", "TRUE", &prefs_common.confirm_on_exit, P_BOOL,
793 &other.checkbtn_confonexit,
794 prefs_set_data_from_toggle, prefs_set_toggle},
795 {"clean_trash_on_exit", "FALSE", &prefs_common.clean_on_exit, P_BOOL,
796 &other.checkbtn_cleanonexit,
797 prefs_set_data_from_toggle, prefs_set_toggle},
798 {"ask_on_cleaning", "TRUE", &prefs_common.ask_on_clean, P_BOOL,
799 &other.checkbtn_askonclean,
800 prefs_set_data_from_toggle, prefs_set_toggle},
801 {"warn_queued_on_exit", "TRUE", &prefs_common.warn_queued_on_exit,
802 P_BOOL, &other.checkbtn_warnqueued,
803 prefs_set_data_from_toggle, prefs_set_toggle},
805 {"ssl_ask_unknown_valid", "TRUE", &prefs_common.ssl_ask_unknown_valid,
806 P_BOOL, &other.checkbtn_ssl_ask_unknown_valid,
807 prefs_set_data_from_toggle, prefs_set_toggle},
809 {"work_offline", "FALSE", &prefs_common.work_offline, P_BOOL,
812 {"hide_score", "-9999", &prefs_common.kill_score, P_INT,
814 {"important_score", "1", &prefs_common.important_score, P_INT,
816 {"clip_log", "FALSE", &prefs_common.cliplog, P_BOOL,
817 &other.checkbtn_cliplog,
818 prefs_set_data_from_toggle, prefs_set_toggle},
819 {"log_length", "1000", &prefs_common.loglength, P_INT,
820 &other.loglength_entry,
821 prefs_set_data_from_entry, prefs_set_entry},
823 {"cache_max_mem_usage", "4096", &prefs_common.cache_max_mem_usage, P_INT,
825 {"cache_min_keep_time", "15", &prefs_common.cache_min_keep_time, P_INT,
828 {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
831 /* widget creating functions */
832 static void prefs_common_create (void);
833 static void prefs_receive_create (void);
834 static void prefs_send_create (void);
836 static void prefs_spelling_create (void);
838 static void prefs_compose_create (void);
839 static void prefs_quote_create (void);
840 static void prefs_display_create (void);
841 static void prefs_message_create (void);
843 static void prefs_privacy_create (void);
845 static void prefs_interface_create (void);
846 static void prefs_other_create (void);
848 static void date_format_ok_btn_clicked (GtkButton *button,
850 static void date_format_cancel_btn_clicked (GtkButton *button,
852 static void date_format_key_pressed (GtkWidget *keywidget,
855 static gboolean date_format_on_delete (GtkWidget *dialogwidget,
858 static void date_format_entry_on_change (GtkEditable *editable,
860 static void date_format_select_row (GtkWidget *date_format_list,
863 GdkEventButton *event,
864 GtkWidget *date_format);
865 static GtkWidget *date_format_create (GtkButton *button,
868 static void prefs_quote_colors_dialog (void);
869 static void prefs_quote_colors_dialog_create (void);
870 static void prefs_quote_colors_key_pressed (GtkWidget *widget,
873 static void quote_color_set_dialog (GtkWidget *widget,
875 static void quote_colors_set_dialog_ok (GtkWidget *widget,
877 static void quote_colors_set_dialog_cancel (GtkWidget *widget,
879 static void quote_colors_set_dialog_key_pressed (GtkWidget *widget,
882 static void set_button_bg_color (GtkWidget *widget,
884 static void prefs_enable_message_color_toggled (void);
885 static void prefs_recycle_colors_toggled (GtkWidget *widget);
887 static void prefs_font_select (GtkButton *button, GtkEntry *entry);
889 static void prefs_font_selection_key_pressed (GtkWidget *widget,
892 static void prefs_font_selection_ok (GtkButton *button, GtkEntry *entry);
894 static void prefs_keybind_select (void);
895 static gint prefs_keybind_deleted (GtkWidget *widget,
898 static void prefs_keybind_key_pressed (GtkWidget *widget,
901 static void prefs_keybind_cancel (void);
902 static void prefs_keybind_apply_clicked (GtkWidget *widget);
904 static gint prefs_common_deleted (GtkWidget *widget,
907 static void prefs_common_key_pressed (GtkWidget *widget,
910 static void prefs_common_ok (void);
911 static void prefs_common_apply (void);
912 static void prefs_common_cancel (void);
914 void prefs_common_init() {
915 prefs_common.disphdr_list = NULL;
918 void prefs_common_read_config(void)
922 gchar buf[PREFSBUFSIZE];
924 prefs_read_config(param, "Common", COMMON_RC);
926 path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
928 if ((fp = fopen(path, "rb")) == NULL) {
929 if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
934 while (fgets(buf, sizeof(buf), fp) != NULL) {
936 if (buf[0] == '\0') continue;
937 prefs_common.mime_open_cmd_history =
938 add_history(prefs_common.mime_open_cmd_history, buf);
942 prefs_common.mime_open_cmd_history =
943 g_list_reverse(prefs_common.mime_open_cmd_history);
946 void prefs_common_save_config(void)
952 prefs_save_config(param, "Common", COMMON_RC);
954 path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
956 if ((fp = fopen(path, "wb")) == NULL) {
957 FILE_OP_ERROR(path, "fopen");
962 for (cur = prefs_common.mime_open_cmd_history;
963 cur != NULL; cur = cur->next) {
964 fputs((gchar *)cur->data, fp);
972 void prefs_common_open(void)
974 if (prefs_rc_is_readonly(COMMON_RC))
979 if (!dialog.window) {
980 prefs_common_create();
983 manage_window_set_transient(GTK_WINDOW(dialog.window));
984 gtk_notebook_set_page(GTK_NOTEBOOK(dialog.notebook), 0);
985 gtk_widget_grab_focus(dialog.ok_btn);
987 prefs_set_dialog(param);
989 gtk_widget_show(dialog.window);
992 static void prefs_common_create(void)
996 debug_print("Creating common preferences window...\n");
998 prefs_dialog_create(&dialog);
999 gtk_window_set_title (GTK_WINDOW(dialog.window),
1000 _("Common Preferences"));
1001 gtk_signal_connect (GTK_OBJECT(dialog.window), "delete_event",
1002 GTK_SIGNAL_FUNC(prefs_common_deleted), NULL);
1003 gtk_signal_connect (GTK_OBJECT(dialog.window), "key_press_event",
1004 GTK_SIGNAL_FUNC(prefs_common_key_pressed), NULL);
1005 MANAGE_WINDOW_SIGNALS_CONNECT(dialog.window);
1007 gtk_signal_connect (GTK_OBJECT(dialog.ok_btn), "clicked",
1008 GTK_SIGNAL_FUNC(prefs_common_ok), NULL);
1009 gtk_signal_connect (GTK_OBJECT(dialog.apply_btn), "clicked",
1010 GTK_SIGNAL_FUNC(prefs_common_apply), NULL);
1011 gtk_signal_connect_object (GTK_OBJECT(dialog.cancel_btn), "clicked",
1012 GTK_SIGNAL_FUNC(prefs_common_cancel),
1013 GTK_OBJECT(dialog.window));
1015 /* create all widgets on notebook */
1016 prefs_receive_create();
1017 SET_NOTEBOOK_LABEL(dialog.notebook, _("Receive"), page++);
1018 prefs_send_create();
1019 SET_NOTEBOOK_LABEL(dialog.notebook, _("Send"), page++);
1020 prefs_compose_create();
1021 SET_NOTEBOOK_LABEL(dialog.notebook, _("Compose"), page++);
1023 prefs_spelling_create();
1024 SET_NOTEBOOK_LABEL(dialog.notebook, _("Spell Checker"), page++);
1026 prefs_quote_create();
1027 SET_NOTEBOOK_LABEL(dialog.notebook, _("Quote"), page++);
1028 prefs_display_create();
1029 SET_NOTEBOOK_LABEL(dialog.notebook, _("Display"), page++);
1030 prefs_message_create();
1031 SET_NOTEBOOK_LABEL(dialog.notebook, _("Message"), page++);
1033 prefs_privacy_create();
1034 SET_NOTEBOOK_LABEL(dialog.notebook, _("Privacy"), page++);
1036 prefs_interface_create();
1037 SET_NOTEBOOK_LABEL(dialog.notebook, _("Interface"), page++);
1038 prefs_other_create();
1039 SET_NOTEBOOK_LABEL(dialog.notebook, _("Other"), page++);
1041 gtk_widget_show_all(dialog.window);
1044 static void prefs_receive_create(void)
1048 GtkWidget *frame_incext;
1049 GtkWidget *checkbtn_incext;
1051 GtkWidget *label_incext;
1052 GtkWidget *entry_incext;
1053 /* GtkWidget *button_incext; */
1055 GtkWidget *frame_spool;
1056 GtkWidget *checkbtn_local;
1057 GtkWidget *checkbtn_filter_on_inc;
1058 GtkWidget *label_spool;
1059 GtkWidget *entry_spool;
1061 GtkWidget *hbox_autochk;
1062 GtkWidget *checkbtn_autochk;
1063 GtkWidget *label_autochk1;
1064 GtkObject *spinbtn_autochk_adj;
1065 GtkWidget *spinbtn_autochk;
1066 GtkWidget *label_autochk2;
1067 GtkWidget *checkbtn_chkonstartup;
1068 GtkWidget *checkbtn_scan_after_inc;
1071 GtkWidget *frame_newmail;
1072 GtkWidget *hbox_newmail_notify;
1073 GtkWidget *checkbtn_newmail_auto;
1074 GtkWidget *checkbtn_newmail_manu;
1075 GtkWidget *entry_newmail_notify_cmd;
1076 GtkWidget *label_newmail_notify_cmd;
1078 GtkWidget *frame_news;
1079 GtkWidget *label_maxarticle;
1080 GtkWidget *spinbtn_maxarticle;
1081 GtkObject *spinbtn_maxarticle_adj;
1083 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1084 gtk_widget_show (vbox1);
1085 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1086 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1088 PACK_FRAME(vbox1, frame_incext, _("External program"));
1090 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1091 gtk_widget_show (vbox2);
1092 gtk_container_add (GTK_CONTAINER (frame_incext), vbox2);
1093 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1095 /* Use of external incorporation program */
1096 PACK_CHECK_BUTTON (vbox2, checkbtn_incext,
1097 _("Use external program for incorporation"));
1099 hbox = gtk_hbox_new (FALSE, 8);
1100 gtk_widget_show (hbox);
1101 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1102 SET_TOGGLE_SENSITIVITY (checkbtn_incext, hbox);
1104 label_incext = gtk_label_new (_("Command"));
1105 gtk_widget_show (label_incext);
1106 gtk_box_pack_start (GTK_BOX (hbox), label_incext, FALSE, FALSE, 0);
1108 entry_incext = gtk_entry_new ();
1109 gtk_widget_show (entry_incext);
1110 gtk_box_pack_start (GTK_BOX (hbox), entry_incext, TRUE, TRUE, 0);
1113 button_incext = gtk_button_new_with_label ("... ");
1114 gtk_widget_show (button_incext);
1115 gtk_box_pack_start (GTK_BOX (hbox), button_incext, FALSE, FALSE, 0);
1118 PACK_FRAME(vbox1, frame_spool, _("Local spool"));
1120 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1121 gtk_widget_show (vbox2);
1122 gtk_container_add (GTK_CONTAINER (frame_spool), vbox2);
1123 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1125 hbox = gtk_hbox_new (FALSE, 32);
1126 gtk_widget_show (hbox);
1127 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1129 PACK_CHECK_BUTTON (hbox, checkbtn_local, _("Incorporate from spool"));
1130 PACK_CHECK_BUTTON (hbox, checkbtn_filter_on_inc,
1131 _("Filter on incorporation"));
1132 SET_TOGGLE_SENSITIVITY (checkbtn_local, checkbtn_filter_on_inc);
1134 hbox = gtk_hbox_new (FALSE, 8);
1135 gtk_widget_show (hbox);
1136 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1137 SET_TOGGLE_SENSITIVITY (checkbtn_local, hbox);
1139 label_spool = gtk_label_new (_("Spool directory"));
1140 gtk_widget_show (label_spool);
1141 gtk_box_pack_start (GTK_BOX (hbox), label_spool, FALSE, FALSE, 0);
1143 entry_spool = gtk_entry_new ();
1144 gtk_widget_show (entry_spool);
1145 gtk_box_pack_start (GTK_BOX (hbox), entry_spool, TRUE, TRUE, 0);
1147 vbox2 = gtk_vbox_new (FALSE, 0);
1148 gtk_widget_show (vbox2);
1149 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1152 hbox_autochk = gtk_hbox_new (FALSE, 8);
1153 gtk_widget_show (hbox_autochk);
1154 gtk_box_pack_start (GTK_BOX (vbox2), hbox_autochk, FALSE, FALSE, 0);
1156 PACK_CHECK_BUTTON (hbox_autochk, checkbtn_autochk,
1157 _("Auto-check new mail"));
1159 label_autochk1 = gtk_label_new (_("every"));
1160 gtk_widget_show (label_autochk1);
1161 gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk1, FALSE, FALSE, 0);
1163 spinbtn_autochk_adj = gtk_adjustment_new (5, 1, 100, 1, 10, 10);
1164 spinbtn_autochk = gtk_spin_button_new
1165 (GTK_ADJUSTMENT (spinbtn_autochk_adj), 1, 0);
1166 gtk_widget_show (spinbtn_autochk);
1167 gtk_box_pack_start (GTK_BOX (hbox_autochk), spinbtn_autochk, FALSE, FALSE, 0);
1168 gtk_widget_set_usize (spinbtn_autochk, 64, -1);
1169 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_autochk), TRUE);
1171 label_autochk2 = gtk_label_new (_("minute(s)"));
1172 gtk_widget_show (label_autochk2);
1173 gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk2, FALSE, FALSE, 0);
1175 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk1);
1176 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, spinbtn_autochk);
1177 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk2);
1179 PACK_CHECK_BUTTON (vbox2, checkbtn_chkonstartup,
1180 _("Check new mail on startup"));
1181 PACK_CHECK_BUTTON (vbox2, checkbtn_scan_after_inc,
1182 _("Update all local folders after incorporation"));
1185 PACK_FRAME(vbox1, frame_newmail, _("Run command when new mail "
1187 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1188 gtk_widget_show (vbox2);
1189 gtk_container_add (GTK_CONTAINER (frame_newmail), vbox2);
1190 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1192 hbox = gtk_hbox_new (TRUE, 8);
1193 gtk_widget_show (hbox);
1194 PACK_CHECK_BUTTON (hbox, checkbtn_newmail_auto,
1195 _("after autochecking"));
1196 PACK_CHECK_BUTTON (hbox, checkbtn_newmail_manu,
1197 _("after manual checking"));
1198 gtk_box_pack_start (GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
1199 gtk_signal_connect(GTK_OBJECT(checkbtn_newmail_auto), "toggled",
1200 GTK_SIGNAL_FUNC(prefs_common_recv_dialog_newmail_notify_toggle_cb),
1202 gtk_signal_connect(GTK_OBJECT(checkbtn_newmail_manu), "toggled",
1203 GTK_SIGNAL_FUNC(prefs_common_recv_dialog_newmail_notify_toggle_cb),
1206 hbox_newmail_notify = gtk_hbox_new (FALSE, 8);
1207 gtk_widget_show (hbox);
1208 gtk_box_pack_start (GTK_BOX (vbox2), hbox_newmail_notify, FALSE,
1211 label_newmail_notify_cmd = gtk_label_new (_("Command to execute:\n"
1212 "(use %d as number of new "
1214 gtk_label_set_justify(GTK_LABEL(label_newmail_notify_cmd),
1216 gtk_widget_show (label_newmail_notify_cmd);
1217 gtk_box_pack_start (GTK_BOX (hbox_newmail_notify),
1218 label_newmail_notify_cmd, FALSE, FALSE, 0);
1220 entry_newmail_notify_cmd = gtk_entry_new ();
1221 gtk_widget_show (entry_newmail_notify_cmd);
1222 gtk_box_pack_start (GTK_BOX (hbox_newmail_notify),
1223 entry_newmail_notify_cmd, TRUE, TRUE, 0);
1225 gtk_widget_set_sensitive(hbox_newmail_notify,
1226 prefs_common.newmail_notify_auto ||
1227 prefs_common.newmail_notify_manu);
1229 PACK_FRAME(vbox1, frame_news, _("News"));
1231 hbox = gtk_hbox_new (FALSE, 8);
1232 gtk_widget_show (hbox);
1233 gtk_container_add (GTK_CONTAINER (frame_news), hbox);
1234 gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
1236 label_maxarticle = gtk_label_new
1237 (_("Maximum number of articles to download\n"
1238 "(unlimited if 0 is specified)"));
1239 gtk_widget_show (label_maxarticle);
1240 gtk_box_pack_start (GTK_BOX (hbox), label_maxarticle, FALSE, FALSE, 0);
1241 gtk_label_set_justify (GTK_LABEL (label_maxarticle), GTK_JUSTIFY_LEFT);
1243 spinbtn_maxarticle_adj =
1244 gtk_adjustment_new (300, 0, 10000, 10, 100, 100);
1245 spinbtn_maxarticle = gtk_spin_button_new
1246 (GTK_ADJUSTMENT (spinbtn_maxarticle_adj), 10, 0);
1247 gtk_widget_show (spinbtn_maxarticle);
1248 gtk_box_pack_start (GTK_BOX (hbox), spinbtn_maxarticle,
1250 gtk_widget_set_usize (spinbtn_maxarticle, 64, -1);
1251 gtk_spin_button_set_numeric
1252 (GTK_SPIN_BUTTON (spinbtn_maxarticle), TRUE);
1254 receive.checkbtn_incext = checkbtn_incext;
1255 receive.entry_incext = entry_incext;
1256 /* receive.button_incext = button_incext; */
1258 receive.checkbtn_local = checkbtn_local;
1259 receive.checkbtn_filter_on_inc = checkbtn_filter_on_inc;
1260 receive.entry_spool = entry_spool;
1262 receive.checkbtn_autochk = checkbtn_autochk;
1263 receive.spinbtn_autochk = spinbtn_autochk;
1264 receive.spinbtn_autochk_adj = spinbtn_autochk_adj;
1266 receive.checkbtn_chkonstartup = checkbtn_chkonstartup;
1267 receive.checkbtn_scan_after_inc = checkbtn_scan_after_inc;
1270 receive.checkbtn_newmail_auto = checkbtn_newmail_auto;
1271 receive.checkbtn_newmail_manu = checkbtn_newmail_manu;
1272 receive.hbox_newmail_notify = hbox_newmail_notify;
1273 receive.entry_newmail_notify_cmd = entry_newmail_notify_cmd;
1275 receive.spinbtn_maxarticle = spinbtn_maxarticle;
1276 receive.spinbtn_maxarticle_adj = spinbtn_maxarticle_adj;
1279 static void prefs_send_create(void)
1283 GtkWidget *frame_extsend;
1284 GtkWidget *vbox_extsend;
1285 GtkWidget *checkbtn_extsend;
1287 GtkWidget *label_extsend;
1288 GtkWidget *entry_extsend;
1289 /* GtkWidget *button_extsend; */
1290 GtkWidget *checkbtn_savemsg;
1291 GtkWidget *checkbtn_queuemsg;
1292 GtkWidget *label_outcharset;
1294 GtkWidget *optmenu_menu;
1295 GtkWidget *menuitem;
1296 GtkWidget *label_charset_desc;
1298 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1299 gtk_widget_show (vbox1);
1300 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1301 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1303 PACK_FRAME(vbox1, frame_extsend, _("External program"));
1305 vbox_extsend = gtk_vbox_new (FALSE, VSPACING_NARROW);
1306 gtk_widget_show (vbox_extsend);
1307 gtk_container_add (GTK_CONTAINER (frame_extsend), vbox_extsend);
1308 gtk_container_set_border_width (GTK_CONTAINER (vbox_extsend), 8);
1310 PACK_CHECK_BUTTON (vbox_extsend, checkbtn_extsend,
1311 _("Use external program for sending"));
1313 hbox1 = gtk_hbox_new (FALSE, 8);
1314 gtk_widget_show (hbox1);
1315 gtk_box_pack_start (GTK_BOX (vbox_extsend), hbox1, FALSE, FALSE, 0);
1316 SET_TOGGLE_SENSITIVITY(checkbtn_extsend, hbox1);
1318 label_extsend = gtk_label_new (_("Command"));
1319 gtk_widget_show (label_extsend);
1320 gtk_box_pack_start (GTK_BOX (hbox1), label_extsend, FALSE, FALSE, 0);
1322 entry_extsend = gtk_entry_new ();
1323 gtk_widget_show (entry_extsend);
1324 gtk_box_pack_start (GTK_BOX (hbox1), entry_extsend, TRUE, TRUE, 0);
1327 button_extsend = gtk_button_new_with_label ("... ");
1328 gtk_widget_show (button_extsend);
1329 gtk_box_pack_start (GTK_BOX (hbox1), button_extsend, FALSE, FALSE, 0);
1332 vbox2 = gtk_vbox_new (FALSE, 0);
1333 gtk_widget_show (vbox2);
1334 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1336 PACK_CHECK_BUTTON (vbox2, checkbtn_savemsg,
1337 _("Save sent messages to Sent folder"));
1338 PACK_CHECK_BUTTON (vbox2, checkbtn_queuemsg,
1339 _("Queue messages that fail to send"));
1341 hbox1 = gtk_hbox_new (FALSE, 8);
1342 gtk_widget_show (hbox1);
1343 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1345 label_outcharset = gtk_label_new (_("Outgoing codeset"));
1346 gtk_widget_show (label_outcharset);
1347 gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, FALSE, FALSE, 0);
1349 optmenu = gtk_option_menu_new ();
1350 gtk_widget_show (optmenu);
1351 gtk_box_pack_start (GTK_BOX (hbox1), optmenu, FALSE, FALSE, 0);
1353 optmenu_menu = gtk_menu_new ();
1355 #define SET_MENUITEM(str, charset) \
1357 MENUITEM_ADD(optmenu_menu, menuitem, str, charset); \
1360 SET_MENUITEM(_("Automatic (Recommended)"), CS_AUTO);
1361 SET_MENUITEM(_("7bit ascii (US-ASCII)"), CS_US_ASCII);
1363 SET_MENUITEM(_("Unicode (UTF-8)"), CS_UTF_8);
1365 SET_MENUITEM(_("Western European (ISO-8859-1)"), CS_ISO_8859_1);
1366 SET_MENUITEM(_("Western European (ISO-8859-15)"), CS_ISO_8859_15);
1367 SET_MENUITEM(_("Central European (ISO-8859-2)"), CS_ISO_8859_2);
1368 SET_MENUITEM(_("Baltic (ISO-8859-13)"), CS_ISO_8859_13);
1369 SET_MENUITEM(_("Baltic (ISO-8859-4)"), CS_ISO_8859_4);
1370 SET_MENUITEM(_("Greek (ISO-8859-7)"), CS_ISO_8859_7);
1371 SET_MENUITEM(_("Turkish (ISO-8859-9)"), CS_ISO_8859_9);
1373 SET_MENUITEM(_("Cyrillic (ISO-8859-5)"), CS_ISO_8859_5);
1375 SET_MENUITEM(_("Cyrillic (KOI8-R)"), CS_KOI8_R);
1377 SET_MENUITEM(_("Cyrillic (Windows-1251)"), CS_WINDOWS_1251);
1378 SET_MENUITEM(_("Cyrillic (KOI8-U)"), CS_KOI8_U);
1380 SET_MENUITEM(_("Japanese (ISO-2022-JP)"), CS_ISO_2022_JP);
1382 SET_MENUITEM(_("Japanese (EUC-JP)"), CS_EUC_JP);
1383 SET_MENUITEM(_("Japanese (Shift_JIS)"), CS_SHIFT_JIS);
1385 SET_MENUITEM(_("Simplified Chinese (GB2312)"), CS_GB2312);
1386 SET_MENUITEM(_("Traditional Chinese (Big5)"), CS_BIG5);
1388 SET_MENUITEM(_("Traditional Chinese (EUC-TW)"), CS_EUC_TW);
1389 SET_MENUITEM(_("Chinese (ISO-2022-CN)"), CS_ISO_2022_CN);
1391 SET_MENUITEM(_("Korean (EUC-KR)"), CS_EUC_KR);
1392 SET_MENUITEM(_("Thai (TIS-620)"), CS_TIS_620);
1393 SET_MENUITEM(_("Thai (Windows-874)"), CS_WINDOWS_874);
1395 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
1397 hbox1 = gtk_hbox_new (FALSE, 8);
1398 gtk_widget_show (hbox1);
1399 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1401 label_charset_desc = gtk_label_new
1402 (_("If `Automatic' is selected, the optimal encoding\n"
1403 "for the current locale will be used."));
1404 gtk_widget_show (label_charset_desc);
1405 gtk_box_pack_start (GTK_BOX (hbox1), label_charset_desc,
1407 gtk_label_set_justify(GTK_LABEL (label_charset_desc), GTK_JUSTIFY_LEFT);
1409 p_send.checkbtn_extsend = checkbtn_extsend;
1410 p_send.entry_extsend = entry_extsend;
1411 /* p_send.button_extsend = button_extsend; */
1413 p_send.checkbtn_savemsg = checkbtn_savemsg;
1414 p_send.checkbtn_queuemsg = checkbtn_queuemsg;
1416 p_send.optmenu_charset = optmenu;
1419 static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpointer data)
1423 toggled = gtk_toggle_button_get_active
1424 (GTK_TOGGLE_BUTTON(receive.checkbtn_newmail_manu)) ||
1425 gtk_toggle_button_get_active
1426 (GTK_TOGGLE_BUTTON(receive.checkbtn_newmail_auto));
1427 gtk_widget_set_sensitive(receive.hbox_newmail_notify, toggled);
1431 static void prefs_dictionary_set_data_from_optmenu(PrefParam *param)
1434 gchar *dict_fullname;
1436 g_return_if_fail(param);
1437 g_return_if_fail(param->data);
1438 g_return_if_fail(param->widget);
1439 g_return_if_fail(*(param->widget));
1441 dict_fullname = gtkaspell_get_dictionary_menu_active_item
1442 (gtk_option_menu_get_menu(GTK_OPTION_MENU(*(param->widget))));
1443 str = *((gchar **) param->data);
1446 *((gchar **) param->data) = dict_fullname;
1449 static void prefs_dictionary_set_optmenu(PrefParam *pparam)
1452 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
1454 GtkWidget *menuitem;
1458 g_return_if_fail(optmenu != NULL);
1459 g_return_if_fail(pparam->data != NULL);
1461 if (*(gchar **) pparam->data) {
1462 menu = gtk_option_menu_get_menu(optmenu);
1463 for (cur = GTK_MENU_SHELL(menu)->children;
1464 cur != NULL; cur = cur->next) {
1465 menuitem = GTK_WIDGET(cur->data);
1466 dict_name = gtk_object_get_data(GTK_OBJECT(menuitem),
1468 if (!strcmp2(dict_name, *((gchar **)pparam->data))) {
1469 gtk_option_menu_set_history(optmenu, n);
1476 gtk_option_menu_set_history(optmenu, 0);
1477 prefs_dictionary_set_data_from_optmenu(pparam);
1480 static void prefs_speller_sugmode_set_data_from_optmenu(PrefParam *param)
1483 g_return_if_fail(param);
1484 g_return_if_fail(param->data);
1485 g_return_if_fail(param->widget);
1486 g_return_if_fail(*(param->widget));
1488 sugmode = gtkaspell_get_sugmode_from_option_menu
1489 (GTK_OPTION_MENU(*(param->widget)));
1490 *((gint *) param->data) = sugmode;
1493 static void prefs_speller_sugmode_set_optmenu(PrefParam *pparam)
1495 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
1498 g_return_if_fail(optmenu != NULL);
1499 g_return_if_fail(pparam->data != NULL);
1501 sugmode = *(gint *) pparam->data;
1502 gtkaspell_sugmode_option_menu_set(optmenu, sugmode);
1506 static void prefs_spelling_checkbtn_enable_aspell_toggle_cb
1512 toggled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
1514 gtk_widget_set_sensitive(spelling.entry_aspell_path, toggled);
1515 gtk_widget_set_sensitive(spelling.optmenu_dictionary, toggled);
1516 gtk_widget_set_sensitive(spelling.optmenu_sugmode, toggled);
1517 gtk_widget_set_sensitive(spelling.btn_aspell_path, toggled);
1518 gtk_widget_set_sensitive(spelling.misspelled_btn, toggled);
1519 gtk_widget_set_sensitive(spelling.checkbtn_use_alternate, toggled);
1520 gtk_widget_set_sensitive(spelling.checkbtn_check_while_typing, toggled);
1523 static void prefs_spelling_btn_aspell_path_clicked_cb(GtkWidget *widget,
1526 gchar *file_path, *tmp;
1527 GtkWidget *new_menu;
1529 file_path = filesel_select_file(_("Select dictionaries location"),
1530 prefs_common.aspell_path);
1531 if (file_path == NULL) {
1535 tmp=g_dirname(file_path);
1537 if (prefs_common.aspell_path)
1538 g_free(prefs_common.aspell_path);
1539 prefs_common.aspell_path = g_strdup_printf("%s%s",tmp,
1542 new_menu = gtkaspell_dictionary_option_menu_new(prefs_common.aspell_path);
1543 gtk_option_menu_set_menu(GTK_OPTION_MENU(spelling.optmenu_dictionary),
1546 gtk_entry_set_text(GTK_ENTRY(spelling.entry_aspell_path),
1547 prefs_common.aspell_path);
1548 /* select first one */
1549 gtk_option_menu_set_history(GTK_OPTION_MENU(
1550 spelling.optmenu_dictionary), 0);
1552 if (prefs_common.dictionary)
1553 g_free(prefs_common.dictionary);
1555 prefs_common.dictionary =
1556 gtkaspell_get_dictionary_menu_active_item(
1557 gtk_option_menu_get_menu(
1559 spelling.optmenu_dictionary)));
1565 static void prefs_spelling_create()
1568 GtkWidget *frame_spell;
1569 GtkWidget *vbox_spell;
1570 GtkWidget *hbox_aspell_path;
1571 GtkWidget *checkbtn_enable_aspell;
1572 GtkWidget *label_aspell_path;
1573 GtkWidget *entry_aspell_path;
1574 GtkWidget *btn_aspell_path;
1575 GtkWidget *spell_table;
1576 GtkWidget *label_dictionary;
1577 GtkWidget *optmenu_dictionary;
1578 GtkWidget *sugmode_label;
1579 GtkWidget *sugmode_optmenu;
1580 GtkWidget *checkbtn_use_alternate;
1581 GtkWidget *help_label;
1582 GtkWidget *checkbtn_check_while_typing;
1583 GtkWidget *color_label;
1584 GtkWidget *col_align;
1586 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1587 gtk_widget_show (vbox1);
1588 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1589 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1591 /* spell checker defaults */
1592 PACK_FRAME(vbox1, frame_spell, _("Global spelling checker settings"));
1593 vbox_spell = gtk_vbox_new(FALSE, VSPACING_NARROW);
1594 gtk_widget_show (vbox_spell);
1595 gtk_container_add(GTK_CONTAINER(frame_spell), vbox_spell);
1596 gtk_container_set_border_width(GTK_CONTAINER(vbox_spell), 8);
1598 PACK_CHECK_BUTTON(vbox_spell, checkbtn_enable_aspell,
1599 _("Enable spell checker"));
1601 gtk_signal_connect(GTK_OBJECT(checkbtn_enable_aspell), "toggled",
1602 GTK_SIGNAL_FUNC(prefs_spelling_checkbtn_enable_aspell_toggle_cb),
1605 /* Check while typing */
1606 PACK_CHECK_BUTTON(vbox_spell, checkbtn_check_while_typing,
1607 _("Check while typing"));
1609 PACK_CHECK_BUTTON(vbox_spell, checkbtn_use_alternate,
1610 _("Enable alternate dictionary"));
1612 help_label = gtk_label_new(_("Enabling an alternate dictionary makes switching\n"
1613 "with the last used dictionary faster."));
1614 gtk_misc_set_alignment (GTK_MISC (help_label), 0, 0);
1615 gtk_widget_show(help_label);
1616 gtk_box_pack_start(GTK_BOX(vbox_spell), help_label, FALSE, TRUE, 0);
1618 spell_table = gtk_table_new(4, 3, FALSE);
1619 gtk_container_set_border_width (GTK_CONTAINER (spell_table), VSPACING);
1620 gtk_table_set_row_spacings(GTK_TABLE(spell_table), 8);
1621 gtk_table_set_col_spacings(GTK_TABLE(spell_table), 8);
1623 gtk_box_pack_start(GTK_BOX(vbox_spell), spell_table, TRUE, TRUE, 0);
1625 label_aspell_path = gtk_label_new (_("Dictionaries path:"));
1626 gtk_misc_set_alignment(GTK_MISC(label_aspell_path), 1.0, 0.5);
1627 gtk_widget_show(label_aspell_path);
1628 gtk_table_attach (GTK_TABLE (spell_table), label_aspell_path, 0, 1, 0,
1629 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1631 hbox_aspell_path = gtk_hbox_new (FALSE, 8);
1632 gtk_table_attach (GTK_TABLE (spell_table), hbox_aspell_path, 1, 2, 0,
1633 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1634 gtk_widget_show(hbox_aspell_path);
1636 entry_aspell_path = gtk_entry_new();
1637 gtk_widget_show(entry_aspell_path);
1638 gtk_box_pack_start(GTK_BOX(hbox_aspell_path), entry_aspell_path, TRUE,
1641 gtk_widget_set_sensitive(entry_aspell_path, prefs_common.enable_aspell);
1643 btn_aspell_path = gtk_button_new_with_label(" ... ");
1644 gtk_widget_show(btn_aspell_path);
1645 gtk_box_pack_start(GTK_BOX(hbox_aspell_path), btn_aspell_path, FALSE, FALSE, 0);
1646 gtk_widget_set_sensitive(btn_aspell_path, prefs_common.enable_aspell);
1648 gtk_signal_connect(GTK_OBJECT(btn_aspell_path), "clicked",
1649 GTK_SIGNAL_FUNC(prefs_spelling_btn_aspell_path_clicked_cb),
1652 label_dictionary = gtk_label_new(_("Default dictionary:"));
1653 gtk_misc_set_alignment(GTK_MISC(label_dictionary), 1.0, 0.5);
1654 gtk_widget_show(label_dictionary);
1655 gtk_table_attach (GTK_TABLE (spell_table), label_dictionary, 0, 1, 1, 2,
1656 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1658 optmenu_dictionary = gtk_option_menu_new();
1659 gtk_widget_show(optmenu_dictionary);
1660 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_dictionary),
1661 gtkaspell_dictionary_option_menu_new(
1662 prefs_common.aspell_path));
1663 gtk_table_attach (GTK_TABLE (spell_table), optmenu_dictionary, 1, 2, 1,
1664 2, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1665 gtk_widget_set_sensitive(optmenu_dictionary, prefs_common.enable_aspell);
1667 /* Suggestion mode */
1668 sugmode_label = gtk_label_new(_("Default suggestion mode"));
1669 gtk_misc_set_alignment(GTK_MISC(sugmode_label), 1.0, 0.5);
1670 gtk_widget_show(sugmode_label);
1671 gtk_table_attach(GTK_TABLE (spell_table), sugmode_label, 0, 1, 2, 3,
1672 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1674 sugmode_optmenu = gtk_option_menu_new();
1675 gtk_widget_show(sugmode_optmenu);
1676 gtk_option_menu_set_menu(GTK_OPTION_MENU(sugmode_optmenu),
1677 gtkaspell_sugmode_option_menu_new(prefs_common.aspell_sugmode));
1678 gtk_table_attach(GTK_TABLE(spell_table), sugmode_optmenu, 1, 2, 2, 3,
1679 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1680 gtk_widget_set_sensitive(sugmode_optmenu, prefs_common.enable_aspell);
1683 color_label = gtk_label_new(_("Misspelled word color:"));
1684 gtk_misc_set_alignment(GTK_MISC(color_label), 1.0, 0.5);
1685 gtk_table_attach (GTK_TABLE (spell_table), color_label, 0, 1, 3, 4,
1686 GTK_FILL, GTK_SHRINK, 0, 0);
1687 gtk_widget_show(color_label);
1689 col_align = gtk_alignment_new(0.0, 0.5, 0, 0);
1690 gtk_widget_show(col_align);
1691 gtk_table_attach (GTK_TABLE (spell_table), col_align, 1, 2, 3, 4,
1692 GTK_FILL, GTK_SHRINK, 0, 0);
1694 spelling.misspelled_btn = gtk_button_new_with_label ("");
1695 set_button_bg_color(spelling.misspelled_btn,
1696 prefs_common.misspelled_col);
1697 gtk_widget_set_usize (spelling.misspelled_btn, 30, 20);
1698 gtk_widget_set_sensitive(spelling.misspelled_btn, prefs_common.enable_aspell);
1699 gtk_signal_connect (GTK_OBJECT (spelling.misspelled_btn), "clicked",
1700 GTK_SIGNAL_FUNC(quote_color_set_dialog), "Misspelled word");
1701 gtk_container_add(GTK_CONTAINER(col_align), spelling.misspelled_btn);
1704 spelling.checkbtn_enable_aspell = checkbtn_enable_aspell;
1705 spelling.entry_aspell_path = entry_aspell_path;
1706 spelling.btn_aspell_path = btn_aspell_path;
1707 spelling.optmenu_dictionary = optmenu_dictionary;
1708 spelling.optmenu_sugmode = sugmode_optmenu;
1709 spelling.checkbtn_use_alternate = checkbtn_use_alternate;
1710 spelling.checkbtn_check_while_typing = checkbtn_check_while_typing;
1716 static void prefs_compose_create(void)
1722 GtkWidget *frame_sig;
1723 GtkWidget *vbox_sig;
1724 GtkWidget *checkbtn_autosig;
1725 GtkWidget *label_sigsep;
1726 GtkWidget *entry_sigsep;
1728 GtkWidget *checkbtn_autoextedit;
1730 GtkWidget *frame_autosel;
1731 GtkWidget *hbox_autosel;
1732 GtkWidget *checkbtn_reply_account_autosel;
1733 GtkWidget *checkbtn_forward_account_autosel;
1734 GtkWidget *checkbtn_reedit_account_autosel;
1736 GtkWidget *hbox_undolevel;
1737 GtkWidget *label_undolevel;
1738 GtkObject *spinbtn_undolevel_adj;
1739 GtkWidget *spinbtn_undolevel;
1741 GtkWidget *vbox_linewrap;
1746 GtkWidget *label_linewrap;
1747 GtkObject *spinbtn_linewrap_adj;
1748 GtkWidget *spinbtn_linewrap;
1749 GtkWidget *checkbtn_wrapquote;
1750 GtkWidget *checkbtn_autowrap;
1751 GtkWidget *checkbtn_wrapatsend;
1753 GtkWidget *checkbtn_default_reply_list;
1755 GtkWidget *checkbtn_forward_as_attachment;
1756 GtkWidget *checkbtn_redirect_keep_from;
1757 GtkWidget *checkbtn_smart_wrapping;
1758 GtkWidget *checkbtn_block_cursor;
1759 GtkWidget *frame_msgwrap;
1761 GtkWidget *hbox_autosave;
1762 GtkWidget *checkbtn_autosave;
1763 GtkWidget *entry_autosave_length;
1764 GtkWidget *label_autosave_length;
1766 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1767 gtk_widget_show (vbox1);
1768 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1769 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1771 PACK_FRAME(vbox1, frame_sig, _("Signature"));
1773 vbox_sig = gtk_vbox_new (FALSE, VSPACING_NARROW);
1774 gtk_widget_show (vbox_sig);
1775 gtk_container_add (GTK_CONTAINER (frame_sig), vbox_sig);
1776 gtk_container_set_border_width (GTK_CONTAINER (vbox_sig), 8);
1778 PACK_CHECK_BUTTON (vbox_sig, checkbtn_autosig,
1779 _("Insert signature automatically"));
1781 hbox1 = gtk_hbox_new (FALSE, 8);
1782 gtk_widget_show (hbox1);
1783 gtk_box_pack_start (GTK_BOX (vbox_sig), hbox1, TRUE, TRUE, 0);
1784 label_sigsep = gtk_label_new (_("Signature separator"));
1785 gtk_widget_show (label_sigsep);
1786 gtk_box_pack_start (GTK_BOX (hbox1), label_sigsep, FALSE, FALSE, 0);
1788 entry_sigsep = gtk_entry_new ();
1789 gtk_widget_show (entry_sigsep);
1790 gtk_box_pack_start (GTK_BOX (hbox1), entry_sigsep, FALSE, FALSE, 0);
1792 gtk_widget_set_usize (entry_sigsep, 64, -1);
1794 /* Account autoselection */
1795 PACK_FRAME(vbox1, frame_autosel, _("Automatic account selection"));
1797 hbox_autosel = gtk_hbox_new (FALSE, VSPACING_NARROW);
1798 gtk_widget_show (hbox_autosel);
1799 gtk_container_add (GTK_CONTAINER (frame_autosel), hbox_autosel);
1800 gtk_container_set_border_width (GTK_CONTAINER (hbox_autosel), 8);
1802 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reply_account_autosel,
1803 _("when replying"));
1804 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_forward_account_autosel,
1805 _("when forwarding"));
1806 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reedit_account_autosel,
1807 _("when re-editing"));
1809 vbox2 = gtk_vbox_new (FALSE, 0);
1810 gtk_widget_show (vbox2);
1811 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1813 PACK_CHECK_BUTTON (vbox2, checkbtn_default_reply_list,
1814 _("Reply button invokes mailing list reply"));
1816 PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
1817 _("Automatically launch the external editor"));
1819 hbox5 = gtk_hbox_new (FALSE, 8);
1820 gtk_widget_show (hbox5);
1821 gtk_box_pack_start (GTK_BOX (vbox2), hbox5, FALSE, FALSE, 0);
1823 PACK_CHECK_BUTTON (hbox5, checkbtn_forward_as_attachment,
1824 _("Forward as attachment"));
1826 PACK_CHECK_BUTTON (hbox5, checkbtn_block_cursor,
1829 PACK_CHECK_BUTTON (vbox2, checkbtn_redirect_keep_from,
1830 _("Keep the original 'From' header when redirecting"));
1833 hbox_autosave = gtk_hbox_new (FALSE, 8);
1834 gtk_widget_show (hbox_autosave);
1835 gtk_box_pack_start (GTK_BOX (vbox1), hbox_autosave, FALSE, FALSE, 0);
1837 PACK_CHECK_BUTTON (hbox_autosave, checkbtn_autosave,
1838 _("Autosave to Drafts folder every "));
1840 entry_autosave_length = gtk_entry_new();
1841 gtk_widget_set_usize (entry_autosave_length, 64, -1);
1842 gtk_widget_show (entry_autosave_length);
1843 gtk_box_pack_start (GTK_BOX (hbox_autosave), entry_autosave_length, FALSE, FALSE, 0);
1845 label_autosave_length = gtk_label_new(_("characters"));
1846 gtk_widget_show (label_autosave_length);
1847 gtk_box_pack_start (GTK_BOX (hbox_autosave), label_autosave_length, FALSE, FALSE, 0);
1849 hbox_undolevel = gtk_hbox_new (FALSE, 8);
1850 gtk_widget_show (hbox_undolevel);
1851 gtk_box_pack_start (GTK_BOX (vbox1), hbox_undolevel, FALSE, FALSE, 0);
1853 label_undolevel = gtk_label_new (_("Undo level"));
1854 gtk_widget_show (label_undolevel);
1855 gtk_box_pack_start (GTK_BOX (hbox_undolevel), label_undolevel, FALSE, FALSE, 0);
1857 spinbtn_undolevel_adj = gtk_adjustment_new (50, 0, 100, 1, 10, 10);
1858 spinbtn_undolevel = gtk_spin_button_new
1859 (GTK_ADJUSTMENT (spinbtn_undolevel_adj), 1, 0);
1860 gtk_widget_show (spinbtn_undolevel);
1861 gtk_box_pack_start (GTK_BOX (hbox_undolevel), spinbtn_undolevel, FALSE, FALSE, 0);
1862 gtk_widget_set_usize (spinbtn_undolevel, 64, -1);
1863 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevel), TRUE);
1866 PACK_FRAME(vbox1, frame_msgwrap, _("Message wrapping"));
1868 vbox_linewrap = gtk_vbox_new (FALSE, VSPACING_NARROW);
1869 gtk_widget_show (vbox_linewrap);
1870 gtk_container_add (GTK_CONTAINER (frame_msgwrap), vbox_linewrap);
1871 gtk_container_set_border_width (GTK_CONTAINER (vbox_linewrap), 8);
1873 hbox3 = gtk_hbox_new (FALSE, 8);
1874 gtk_widget_show (hbox3);
1875 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox3, FALSE, FALSE, 0);
1878 label_linewrap = gtk_label_new (_("Wrap messages at"));
1879 gtk_widget_show (label_linewrap);
1880 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1882 spinbtn_linewrap_adj = gtk_adjustment_new (72, 20, 1024, 1, 10, 10);
1883 spinbtn_linewrap = gtk_spin_button_new
1884 (GTK_ADJUSTMENT (spinbtn_linewrap_adj), 1, 0);
1885 gtk_widget_show (spinbtn_linewrap);
1886 gtk_box_pack_start (GTK_BOX (hbox3), spinbtn_linewrap, FALSE, FALSE, 0);
1887 gtk_widget_set_usize (spinbtn_linewrap, 64, -1);
1888 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linewrap), TRUE);
1890 label_linewrap = gtk_label_new (_("characters"));
1891 gtk_widget_show (label_linewrap);
1892 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1894 hbox4 = gtk_hbox_new (FALSE, VSPACING);
1895 gtk_widget_show (hbox4);
1896 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox4, FALSE, FALSE, 0);
1898 PACK_CHECK_BUTTON (hbox4, checkbtn_wrapquote, _("Wrap quotation"));
1900 PACK_CHECK_BUTTON (hbox4, checkbtn_autowrap, _("Wrap on input"));
1903 (hbox4, checkbtn_wrapatsend, _("Wrap before sending"));
1905 PACK_CHECK_BUTTON (vbox_linewrap, checkbtn_smart_wrapping,
1906 _("Smart wrapping (EXPERIMENTAL)"));
1909 compose.checkbtn_quote = checkbtn_quote;
1910 compose.entry_quotemark = entry_quotemark;
1911 compose.text_quotefmt = text_quotefmt;
1913 compose.checkbtn_autosig = checkbtn_autosig;
1914 compose.entry_sigsep = entry_sigsep;
1916 compose.checkbtn_autoextedit = checkbtn_autoextedit;
1918 compose.checkbtn_reply_account_autosel = checkbtn_reply_account_autosel;
1919 compose.checkbtn_forward_account_autosel = checkbtn_forward_account_autosel;
1920 compose.checkbtn_reedit_account_autosel = checkbtn_reedit_account_autosel;
1922 compose.spinbtn_undolevel = spinbtn_undolevel;
1923 compose.spinbtn_undolevel_adj = spinbtn_undolevel_adj;
1925 compose.spinbtn_linewrap = spinbtn_linewrap;
1926 compose.spinbtn_linewrap_adj = spinbtn_linewrap_adj;
1927 compose.checkbtn_wrapquote = checkbtn_wrapquote;
1928 compose.checkbtn_autowrap = checkbtn_autowrap;
1929 compose.checkbtn_wrapatsend = checkbtn_wrapatsend;
1931 compose.checkbtn_autosave = checkbtn_autosave;
1932 compose.entry_autosave_length = entry_autosave_length;
1934 compose.checkbtn_forward_as_attachment =
1935 checkbtn_forward_as_attachment;
1936 compose.checkbtn_redirect_keep_from =
1937 checkbtn_redirect_keep_from;
1938 compose.checkbtn_smart_wrapping =
1939 checkbtn_smart_wrapping;
1940 compose.checkbtn_block_cursor =
1941 checkbtn_block_cursor;
1942 compose.checkbtn_default_reply_list = checkbtn_default_reply_list;
1945 static void prefs_quote_create(void)
1948 GtkWidget *frame_quote;
1949 GtkWidget *vbox_quote;
1952 GtkWidget *label_quotemark;
1953 GtkWidget *entry_quotemark;
1954 GtkWidget *scrolledwin_quotefmt;
1955 GtkWidget *text_quotefmt;
1957 GtkWidget *entry_fw_quotemark;
1958 GtkWidget *text_fw_quotefmt;
1960 GtkWidget *entry_quote_chars;
1961 GtkWidget *label_quote_chars;
1963 GtkWidget *btn_quotedesc;
1965 GtkWidget *checkbtn_reply_with_quote;
1967 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1968 gtk_widget_show (vbox1);
1969 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1970 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1974 PACK_CHECK_BUTTON (vbox1, checkbtn_reply_with_quote, _("Reply will quote by default"));
1976 PACK_FRAME (vbox1, frame_quote, _("Reply format"));
1978 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
1979 gtk_widget_show (vbox_quote);
1980 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
1981 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
1983 hbox1 = gtk_hbox_new (FALSE, 32);
1984 gtk_widget_show (hbox1);
1985 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
1987 hbox2 = gtk_hbox_new (FALSE, 8);
1988 gtk_widget_show (hbox2);
1989 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
1991 label_quotemark = gtk_label_new (_("Quotation mark"));
1992 gtk_widget_show (label_quotemark);
1993 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
1995 entry_quotemark = gtk_entry_new ();
1996 gtk_widget_show (entry_quotemark);
1997 gtk_box_pack_start (GTK_BOX (hbox2), entry_quotemark, FALSE, FALSE, 0);
1998 gtk_widget_set_usize (entry_quotemark, 64, -1);
2000 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
2001 gtk_widget_show (scrolledwin_quotefmt);
2002 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
2003 gtk_scrolled_window_set_policy
2004 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
2005 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
2007 text_quotefmt = gtk_text_new (NULL, NULL);
2008 gtk_widget_show (text_quotefmt);
2009 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt), text_quotefmt);
2010 gtk_text_set_editable (GTK_TEXT (text_quotefmt), TRUE);
2011 gtk_widget_set_usize(text_quotefmt, -1, 60);
2015 PACK_FRAME (vbox1, frame_quote, _("Forward format"));
2017 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
2018 gtk_widget_show (vbox_quote);
2019 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
2020 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
2022 hbox1 = gtk_hbox_new (FALSE, 32);
2023 gtk_widget_show (hbox1);
2024 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
2026 hbox2 = gtk_hbox_new (FALSE, 8);
2027 gtk_widget_show (hbox2);
2028 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
2030 label_quotemark = gtk_label_new (_("Quotation mark"));
2031 gtk_widget_show (label_quotemark);
2032 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
2034 entry_fw_quotemark = gtk_entry_new ();
2035 gtk_widget_show (entry_fw_quotemark);
2036 gtk_box_pack_start (GTK_BOX (hbox2), entry_fw_quotemark,
2038 gtk_widget_set_usize (entry_fw_quotemark, 64, -1);
2040 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
2041 gtk_widget_show (scrolledwin_quotefmt);
2042 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
2043 gtk_scrolled_window_set_policy
2044 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
2045 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
2047 text_fw_quotefmt = gtk_text_new (NULL, NULL);
2048 gtk_widget_show (text_fw_quotefmt);
2049 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt),
2051 gtk_text_set_editable (GTK_TEXT (text_fw_quotefmt), TRUE);
2052 gtk_widget_set_usize(text_fw_quotefmt, -1, 60);
2054 hbox1 = gtk_hbox_new (FALSE, 32);
2055 gtk_widget_show (hbox1);
2056 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2059 gtk_button_new_with_label (_(" Description of symbols "));
2060 gtk_widget_show (btn_quotedesc);
2061 gtk_box_pack_start (GTK_BOX (hbox1), btn_quotedesc, FALSE, FALSE, 0);
2062 gtk_signal_connect(GTK_OBJECT(btn_quotedesc), "clicked",
2063 GTK_SIGNAL_FUNC(quote_fmt_quote_description), NULL);
2067 PACK_FRAME (vbox1, frame_quote, _("Quotation characters"));
2069 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
2070 gtk_widget_show (vbox_quote);
2071 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
2072 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
2074 hbox1 = gtk_hbox_new (FALSE, 32);
2075 gtk_widget_show (hbox1);
2076 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
2078 hbox2 = gtk_hbox_new (FALSE, 8);
2079 gtk_widget_show (hbox2);
2080 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
2082 label_quote_chars = gtk_label_new (_("Treat these characters as quotation marks: "));
2083 gtk_widget_show (label_quote_chars);
2084 gtk_box_pack_start (GTK_BOX (hbox2), label_quote_chars, FALSE, FALSE, 0);
2086 entry_quote_chars = gtk_entry_new ();
2087 gtk_widget_show (entry_quote_chars);
2088 gtk_box_pack_start (GTK_BOX (hbox2), entry_quote_chars,
2090 gtk_widget_set_usize (entry_quote_chars, 64, -1);
2093 compose.checkbtn_reply_with_quote= checkbtn_reply_with_quote;
2094 quote.entry_quotemark = entry_quotemark;
2095 quote.text_quotefmt = text_quotefmt;
2096 quote.entry_fw_quotemark = entry_fw_quotemark;
2097 quote.text_fw_quotefmt = text_fw_quotefmt;
2098 quote.entry_quote_chars = entry_quote_chars;
2101 static void prefs_display_create(void)
2104 GtkWidget *frame_font;
2106 GtkWidget *label_textfont;
2107 GtkWidget *entry_textfont;
2108 GtkWidget *button_textfont;
2109 GtkWidget *chkbtn_transhdr;
2110 GtkWidget *chkbtn_folder_unread;
2112 GtkWidget *label_ng_abbrev;
2113 GtkWidget *spinbtn_ng_abbrev_len;
2114 GtkObject *spinbtn_ng_abbrev_len_adj;
2115 GtkWidget *frame_summary;
2117 GtkWidget *chkbtn_swapfrom;
2118 GtkWidget *chkbtn_useaddrbook;
2119 GtkWidget *chkbtn_expand_thread;
2121 GtkWidget *label_datefmt;
2122 GtkWidget *button_datefmt;
2123 GtkWidget *entry_datefmt;
2124 GtkWidget *button_dispitem;
2125 GtkWidget *tmplabel, *tmpbutton, *tmpentry;
2127 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2128 gtk_widget_show (vbox1);
2129 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2130 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2132 PACK_FRAME(vbox1, frame_font, _("Font"));
2134 table1 = gtk_table_new (4, 3, FALSE);
2136 gtk_widget_show (table1);
2137 gtk_container_add (GTK_CONTAINER (frame_font), table1);
2138 gtk_container_set_border_width (GTK_CONTAINER (table1), 8);
2139 gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
2140 gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
2142 label_textfont = gtk_label_new (_("Text"));
2143 gtk_misc_set_alignment(GTK_MISC(label_textfont), 0, 0.5);
2144 gtk_widget_show (label_textfont);
2145 gtk_table_attach (GTK_TABLE (table1), label_textfont, 0, 1, 0, 1,
2146 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2148 entry_textfont = gtk_entry_new ();
2149 gtk_widget_show (entry_textfont);
2150 gtk_table_attach (GTK_TABLE (table1), entry_textfont, 1, 2, 0, 1,
2151 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2153 button_textfont = gtk_button_new_with_label (" ... ");
2155 gtk_widget_show (button_textfont);
2156 gtk_table_attach (GTK_TABLE (table1), button_textfont, 2, 3, 0, 1,
2158 gtk_signal_connect (GTK_OBJECT (button_textfont), "clicked",
2159 GTK_SIGNAL_FUNC (prefs_font_select), entry_textfont);
2161 tmplabel = gtk_label_new (_("Small"));
2162 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2163 gtk_widget_show (tmplabel);
2164 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 1, 2,
2165 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2167 tmpentry = gtk_entry_new ();
2168 gtk_widget_show (tmpentry);
2169 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 1, 2,
2170 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2172 tmpbutton = gtk_button_new_with_label (" ... ");
2173 gtk_widget_show (tmpbutton);
2174 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 1, 2,
2176 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2177 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2178 display.entry_smallfont = tmpentry;
2180 tmplabel = gtk_label_new (_("Normal"));
2181 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2182 gtk_widget_show (tmplabel);
2183 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 2, 3,
2184 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2186 tmpentry = gtk_entry_new ();
2187 gtk_widget_show (tmpentry);
2188 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 2, 3,
2189 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2191 tmpbutton = gtk_button_new_with_label (" ... ");
2192 gtk_widget_show (tmpbutton);
2193 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 2, 3,
2195 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2196 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2197 display.entry_normalfont = tmpentry;
2199 tmplabel = gtk_label_new (_("Bold"));
2200 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2201 gtk_widget_show (tmplabel);
2202 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 3, 4,
2203 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2205 tmpentry = gtk_entry_new ();
2206 gtk_widget_show (tmpentry);
2207 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 3, 4,
2208 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2210 tmpbutton = gtk_button_new_with_label (" ... ");
2211 gtk_widget_show (tmpbutton);
2212 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 3, 4,
2214 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2215 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2216 display.entry_boldfont = tmpentry;
2218 vbox2 = gtk_vbox_new (FALSE, 0);
2219 gtk_widget_show (vbox2);
2220 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, TRUE, 0);
2223 (vbox2, chkbtn_transhdr,
2224 _("Translate header name (such as `From:', `Subject:')"));
2226 PACK_CHECK_BUTTON (vbox2, chkbtn_folder_unread,
2227 _("Display unread number next to folder name"));
2229 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2231 hbox1 = gtk_hbox_new (FALSE, 8);
2232 gtk_widget_show (hbox1);
2233 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2235 label_ng_abbrev = gtk_label_new
2236 (_("Abbreviate newsgroup names longer than"));
2237 gtk_widget_show (label_ng_abbrev);
2238 gtk_box_pack_start (GTK_BOX (hbox1), label_ng_abbrev, FALSE, FALSE, 0);
2240 spinbtn_ng_abbrev_len_adj = gtk_adjustment_new (16, 0, 999, 1, 10, 10);
2241 spinbtn_ng_abbrev_len = gtk_spin_button_new
2242 (GTK_ADJUSTMENT (spinbtn_ng_abbrev_len_adj), 1, 0);
2243 gtk_widget_show (spinbtn_ng_abbrev_len);
2244 gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_ng_abbrev_len,
2246 gtk_widget_set_usize (spinbtn_ng_abbrev_len, 56, -1);
2247 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_ng_abbrev_len),
2250 label_ng_abbrev = gtk_label_new
2252 gtk_widget_show (label_ng_abbrev);
2253 gtk_box_pack_start (GTK_BOX (hbox1), label_ng_abbrev, FALSE, FALSE, 0);
2255 /* ---- Summary ---- */
2257 PACK_FRAME(vbox1, frame_summary, _("Summary View"));
2259 vbox2 = gtk_vbox_new (FALSE, 0);
2260 gtk_widget_show (vbox2);
2261 gtk_container_add (GTK_CONTAINER (frame_summary), vbox2);
2262 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
2265 (vbox2, chkbtn_swapfrom,
2266 _("Display recipient on `From' column if sender is yourself"));
2268 (vbox2, chkbtn_useaddrbook,
2269 _("Display sender using address book"));
2271 (vbox2, chkbtn_expand_thread, _("Expand threads"));
2273 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2275 hbox1 = gtk_hbox_new (FALSE, 8);
2276 gtk_widget_show (hbox1);
2277 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2279 label_datefmt = gtk_label_new (_("Date format"));
2280 gtk_widget_show (label_datefmt);
2281 gtk_box_pack_start (GTK_BOX (hbox1), label_datefmt, FALSE, FALSE, 0);
2283 entry_datefmt = gtk_entry_new ();
2284 gtk_widget_show (entry_datefmt);
2285 gtk_box_pack_start (GTK_BOX (hbox1), entry_datefmt, TRUE, TRUE, 0);
2287 button_datefmt = gtk_button_new_with_label (" ... ");
2289 gtk_widget_show (button_datefmt);
2290 gtk_box_pack_start (GTK_BOX (hbox1), button_datefmt, FALSE, FALSE, 0);
2291 gtk_signal_connect (GTK_OBJECT (button_datefmt), "clicked",
2292 GTK_SIGNAL_FUNC (date_format_create), NULL);
2294 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
2296 hbox1 = gtk_hbox_new (FALSE, 8);
2297 gtk_widget_show (hbox1);
2298 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2300 button_dispitem = gtk_button_new_with_label
2301 (_(" Set displayed items in summary... "));
2302 gtk_widget_show (button_dispitem);
2303 gtk_box_pack_start (GTK_BOX (hbox1), button_dispitem, FALSE, TRUE, 0);
2304 gtk_signal_connect (GTK_OBJECT (button_dispitem), "clicked",
2305 GTK_SIGNAL_FUNC (prefs_summary_column_open),
2308 display.entry_textfont = entry_textfont;
2309 display.button_textfont = button_textfont;
2311 display.chkbtn_transhdr = chkbtn_transhdr;
2312 display.chkbtn_folder_unread = chkbtn_folder_unread;
2313 display.spinbtn_ng_abbrev_len = spinbtn_ng_abbrev_len;
2314 display.spinbtn_ng_abbrev_len_adj = spinbtn_ng_abbrev_len_adj;
2316 display.chkbtn_swapfrom = chkbtn_swapfrom;
2317 display.chkbtn_expand_thread = chkbtn_expand_thread;
2318 display.chkbtn_useaddrbook = chkbtn_useaddrbook;
2319 display.entry_datefmt = entry_datefmt;
2322 static void prefs_message_create(void)
2328 GtkWidget *chkbtn_enablecol;
2329 GtkWidget *button_edit_col;
2330 GtkWidget *chkbtn_mbalnum;
2331 GtkWidget *chkbtn_disphdrpane;
2332 GtkWidget *chkbtn_disphdr;
2333 GtkWidget *button_edit_disphdr;
2334 GtkWidget *hbox_linespc;
2335 GtkWidget *label_linespc;
2336 GtkObject *spinbtn_linespc_adj;
2337 GtkWidget *spinbtn_linespc;
2338 GtkWidget *chkbtn_headspc;
2340 GtkWidget *frame_scr;
2341 GtkWidget *vbox_scr;
2342 GtkWidget *chkbtn_smoothscroll;
2343 GtkWidget *hbox_scr;
2344 GtkWidget *label_scr;
2345 GtkObject *spinbtn_scrollstep_adj;
2346 GtkWidget *spinbtn_scrollstep;
2347 GtkWidget *chkbtn_halfpage;
2349 GtkWidget *chkbtn_display_img;
2350 GtkWidget *chkbtn_resize_image;
2352 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2353 gtk_widget_show (vbox1);
2354 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2355 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2357 vbox2 = gtk_vbox_new (FALSE, 0);
2358 gtk_widget_show (vbox2);
2359 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2361 hbox1 = gtk_hbox_new (FALSE, 8);
2362 gtk_widget_show (hbox1);
2363 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2365 PACK_CHECK_BUTTON (hbox1, chkbtn_enablecol,
2366 _("Enable coloration of message"));
2367 gtk_signal_connect (GTK_OBJECT (chkbtn_enablecol), "toggled",
2368 GTK_SIGNAL_FUNC (prefs_enable_message_color_toggled),
2371 button_edit_col = gtk_button_new_with_label (_(" Edit... "));
2372 gtk_widget_show (button_edit_col);
2373 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_col, FALSE, TRUE, 0);
2374 gtk_signal_connect (GTK_OBJECT (button_edit_col), "clicked",
2375 GTK_SIGNAL_FUNC (prefs_quote_colors_dialog), NULL);
2377 SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, button_edit_col);
2380 (vbox2, chkbtn_mbalnum,
2381 _("Display multi-byte alphanumeric as\n"
2382 "ASCII character (Japanese only)"));
2383 gtk_label_set_justify (GTK_LABEL (GTK_BIN(chkbtn_mbalnum)->child),
2386 PACK_CHECK_BUTTON(vbox2, chkbtn_disphdrpane,
2387 _("Display header pane above message view"));
2389 hbox1 = gtk_hbox_new (FALSE, 8);
2390 gtk_widget_show (hbox1);
2391 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2393 PACK_CHECK_BUTTON(hbox1, chkbtn_disphdr,
2394 _("Display short headers on message view"));
2396 button_edit_disphdr = gtk_button_new_with_label (_(" Edit... "));
2397 gtk_widget_show (button_edit_disphdr);
2398 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_disphdr,
2400 gtk_signal_connect (GTK_OBJECT (button_edit_disphdr), "clicked",
2401 GTK_SIGNAL_FUNC (prefs_display_header_open),
2404 SET_TOGGLE_SENSITIVITY(chkbtn_disphdr, button_edit_disphdr);
2406 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2408 hbox1 = gtk_hbox_new (FALSE, 32);
2409 gtk_widget_show (hbox1);
2410 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2412 hbox_linespc = gtk_hbox_new (FALSE, 8);
2413 gtk_widget_show (hbox1);
2414 gtk_box_pack_start (GTK_BOX (hbox1), hbox_linespc, FALSE, TRUE, 0);
2416 label_linespc = gtk_label_new (_("Line space"));
2417 gtk_widget_show (label_linespc);
2418 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2421 spinbtn_linespc_adj = gtk_adjustment_new (2, 0, 16, 1, 1, 16);
2422 spinbtn_linespc = gtk_spin_button_new
2423 (GTK_ADJUSTMENT (spinbtn_linespc_adj), 1, 0);
2424 gtk_widget_show (spinbtn_linespc);
2425 gtk_box_pack_start (GTK_BOX (hbox_linespc), spinbtn_linespc,
2427 gtk_widget_set_usize (spinbtn_linespc, 64, -1);
2428 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linespc), TRUE);
2430 label_linespc = gtk_label_new (_("pixel(s)"));
2431 gtk_widget_show (label_linespc);
2432 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2435 PACK_CHECK_BUTTON(hbox1, chkbtn_headspc, _("Leave space on head"));
2437 PACK_FRAME(vbox1, frame_scr, _("Scroll"));
2439 vbox_scr = gtk_vbox_new (FALSE, 0);
2440 gtk_widget_show (vbox_scr);
2441 gtk_container_add (GTK_CONTAINER (frame_scr), vbox_scr);
2442 gtk_container_set_border_width (GTK_CONTAINER (vbox_scr), 8);
2444 PACK_CHECK_BUTTON(vbox_scr, chkbtn_halfpage, _("Half page"));
2446 hbox1 = gtk_hbox_new (FALSE, 32);
2447 gtk_widget_show (hbox1);
2448 gtk_box_pack_start (GTK_BOX (vbox_scr), hbox1, FALSE, TRUE, 0);
2450 PACK_CHECK_BUTTON(hbox1, chkbtn_smoothscroll, _("Smooth scroll"));
2452 hbox_scr = gtk_hbox_new (FALSE, 8);
2453 gtk_widget_show (hbox_scr);
2454 gtk_box_pack_start (GTK_BOX (hbox1), hbox_scr, FALSE, FALSE, 0);
2456 label_scr = gtk_label_new (_("Step"));
2457 gtk_widget_show (label_scr);
2458 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2460 spinbtn_scrollstep_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 10);
2461 spinbtn_scrollstep = gtk_spin_button_new
2462 (GTK_ADJUSTMENT (spinbtn_scrollstep_adj), 1, 0);
2463 gtk_widget_show (spinbtn_scrollstep);
2464 gtk_box_pack_start (GTK_BOX (hbox_scr), spinbtn_scrollstep,
2466 gtk_widget_set_usize (spinbtn_scrollstep, 64, -1);
2467 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_scrollstep),
2470 label_scr = gtk_label_new (_("pixel(s)"));
2471 gtk_widget_show (label_scr);
2472 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2474 SET_TOGGLE_SENSITIVITY (chkbtn_smoothscroll, hbox_scr)
2476 vbox3 = gtk_vbox_new (FALSE, 0);
2477 gtk_widget_show (vbox3);
2478 gtk_box_pack_start (GTK_BOX (vbox1), vbox3, FALSE, FALSE, 0);
2480 PACK_CHECK_BUTTON(vbox3, chkbtn_display_img,
2481 _("Automatically display attached images"));
2483 PACK_CHECK_BUTTON(vbox3, chkbtn_resize_image,
2484 _("Resize attached images"));
2486 message.chkbtn_enablecol = chkbtn_enablecol;
2487 message.button_edit_col = button_edit_col;
2488 message.chkbtn_mbalnum = chkbtn_mbalnum;
2489 message.chkbtn_disphdrpane = chkbtn_disphdrpane;
2490 message.chkbtn_disphdr = chkbtn_disphdr;
2491 message.spinbtn_linespc = spinbtn_linespc;
2492 message.chkbtn_headspc = chkbtn_headspc;
2494 message.chkbtn_smoothscroll = chkbtn_smoothscroll;
2495 message.spinbtn_scrollstep = spinbtn_scrollstep;
2496 message.spinbtn_scrollstep_adj = spinbtn_scrollstep_adj;
2497 message.chkbtn_halfpage = chkbtn_halfpage;
2499 message.chkbtn_display_img = chkbtn_display_img;
2500 message.chkbtn_resize_image = chkbtn_resize_image;
2504 static void prefs_privacy_create(void)
2510 GtkWidget *hbox_spc;
2512 GtkWidget *checkbtn_auto_check_signatures;
2513 GtkWidget *checkbtn_gpg_signature_popup;
2514 GtkWidget *checkbtn_store_passphrase;
2515 GtkObject *spinbtn_store_passphrase_adj;
2516 GtkWidget *spinbtn_store_passphrase;
2517 GtkWidget *checkbtn_passphrase_grab;
2518 GtkWidget *checkbtn_gpg_warning;
2520 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2521 gtk_widget_show (vbox1);
2522 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2523 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2525 vbox2 = gtk_vbox_new (FALSE, 0);
2526 gtk_widget_show (vbox2);
2527 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2529 PACK_CHECK_BUTTON (vbox2, checkbtn_auto_check_signatures,
2530 _("Automatically check signatures"));
2532 PACK_CHECK_BUTTON (vbox2, checkbtn_gpg_signature_popup,
2533 _("Show signature check result in a popup window"));
2535 PACK_CHECK_BUTTON (vbox2, checkbtn_store_passphrase,
2536 _("Store passphrase in memory temporarily"));
2538 vbox3 = gtk_vbox_new (FALSE, 0);
2539 gtk_widget_show (vbox3);
2540 gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
2542 hbox1 = gtk_hbox_new (FALSE, 8);
2543 gtk_widget_show (hbox1);
2544 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2546 hbox_spc = gtk_hbox_new (FALSE, 0);
2547 gtk_widget_show (hbox_spc);
2548 gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
2549 gtk_widget_set_usize (hbox_spc, 12, -1);
2551 label = gtk_label_new (_("Expire after"));
2552 gtk_widget_show (label);
2553 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2555 spinbtn_store_passphrase_adj = gtk_adjustment_new (0, 0, 1440, 1, 5, 5);
2556 spinbtn_store_passphrase = gtk_spin_button_new
2557 (GTK_ADJUSTMENT (spinbtn_store_passphrase_adj), 1, 0);
2558 gtk_widget_show (spinbtn_store_passphrase);
2559 gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_store_passphrase, FALSE, FALSE, 0);
2560 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_store_passphrase),
2562 gtk_widget_set_usize (spinbtn_store_passphrase, 64, -1);
2564 label = gtk_label_new (_("minute(s) "));
2565 gtk_widget_show (label);
2566 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2568 hbox1 = gtk_hbox_new (FALSE, 8);
2569 gtk_widget_show (hbox1);
2570 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2572 hbox_spc = gtk_hbox_new (FALSE, 0);
2573 gtk_widget_show (hbox_spc);
2574 gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
2575 gtk_widget_set_usize (hbox_spc, 12, -1);
2577 label = gtk_label_new (_("(Setting to '0' will store the passphrase\n"
2578 " for the whole session)"));
2579 gtk_widget_show (label);
2580 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2581 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
2583 SET_TOGGLE_SENSITIVITY (checkbtn_store_passphrase, vbox3);
2586 PACK_CHECK_BUTTON (vbox2, checkbtn_passphrase_grab,
2587 _("Grab input while entering a passphrase"));
2591 (vbox2, checkbtn_gpg_warning,
2592 _("Display warning on startup if GnuPG doesn't work"));
2594 hbox1 = gtk_hbox_new (FALSE, 8);
2595 gtk_widget_show (hbox1);
2596 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2598 privacy.checkbtn_auto_check_signatures
2599 = checkbtn_auto_check_signatures;
2600 privacy.checkbtn_gpg_signature_popup
2601 = checkbtn_gpg_signature_popup;
2602 privacy.checkbtn_store_passphrase = checkbtn_store_passphrase;
2603 privacy.spinbtn_store_passphrase = spinbtn_store_passphrase;
2604 privacy.spinbtn_store_passphrase_adj = spinbtn_store_passphrase_adj;
2605 privacy.checkbtn_passphrase_grab = checkbtn_passphrase_grab;
2606 privacy.checkbtn_gpg_warning = checkbtn_gpg_warning;
2608 #endif /* USE_GPGME */
2610 static void prefs_interface_create(void)
2615 /* GtkWidget *checkbtn_emacs; */
2616 GtkWidget *checkbtn_show_msg_with_cursor;
2617 GtkWidget *checkbtn_openunread;
2618 GtkWidget *checkbtn_mark_as_read_on_newwin;
2619 GtkWidget *checkbtn_openinbox;
2620 GtkWidget *checkbtn_immedexec;
2621 GtkWidget *frame_dialogs;
2622 GtkWidget *vbox_dialogs;
2625 GtkWidget *dialogs_table;
2626 GtkWidget *optmenu_recvdialog;
2627 GtkWidget *optmenu_senddialog;
2629 GtkWidget *menuitem;
2630 GtkWidget *checkbtn_no_recv_err_panel;
2631 GtkWidget *checkbtn_close_recv_dialog;
2633 GtkWidget *button_keybind;
2636 GtkWidget *optmenu_nextunreadmsgdialog;
2637 GtkWidget *optmenu_nextunreadmsgdialog_menu;
2638 GtkWidget *nextunreadmsgdialog_menuitem;
2640 GtkWidget *frame_pixmap_theme;
2641 GtkWidget *vbox_pixmap_theme;
2642 GtkWidget *entry_pixmap_theme;
2643 GtkWidget *combo_pixmap_theme;
2644 GList *avail_pixmap_themes = NULL;
2646 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2647 gtk_widget_show (vbox1);
2648 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2649 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2651 vbox2 = gtk_vbox_new (FALSE, 0);
2652 gtk_widget_show (vbox2);
2653 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2655 /* PACK_CHECK_BUTTON (vbox2, checkbtn_emacs,
2656 _("Emulate the behavior of mouse operation of\n"
2657 "Emacs-based mailer"));
2658 gtk_label_set_justify (GTK_LABEL (GTK_BIN (checkbtn_emacs)->child),
2659 GTK_JUSTIFY_LEFT); */
2662 (vbox2, checkbtn_show_msg_with_cursor,
2663 _("Open messages in summary with cursor keys"));
2666 (vbox2, checkbtn_openunread,
2667 _("Open first unread message when entering a folder"));
2670 (vbox2, checkbtn_mark_as_read_on_newwin,
2671 _("Only mark message as read when opened in new window"));
2674 (vbox2, checkbtn_openinbox,
2675 _("Go to inbox after receiving new mail"));
2677 vbox3 = gtk_vbox_new (FALSE, 0);
2678 gtk_widget_show (vbox3);
2679 gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
2682 (vbox3, checkbtn_immedexec,
2683 _("Execute immediately when moving or deleting messages"));
2685 hbox1 = gtk_hbox_new (FALSE, 0);
2686 gtk_widget_show (hbox1);
2687 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2689 label = gtk_label_new
2690 (_("(Messages will be marked until execution\n"
2691 " if this is turned off)"));
2692 gtk_widget_show (label);
2693 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 8);
2694 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
2696 PACK_FRAME (vbox1, frame_dialogs, _("Dialogs"));
2697 vbox_dialogs = gtk_vbox_new (FALSE, 0);
2698 gtk_widget_show (vbox_dialogs);
2699 gtk_container_add (GTK_CONTAINER (frame_dialogs), vbox_dialogs);
2700 gtk_container_set_border_width (GTK_CONTAINER (vbox_dialogs), 8);
2702 dialogs_table = gtk_table_new (2, 2, FALSE);
2703 gtk_widget_show (dialogs_table);
2704 gtk_container_add (GTK_CONTAINER (vbox_dialogs), dialogs_table);
2705 gtk_container_set_border_width (GTK_CONTAINER (dialogs_table), 4);
2706 gtk_table_set_row_spacings (GTK_TABLE (dialogs_table), VSPACING_NARROW);
2707 gtk_table_set_col_spacings (GTK_TABLE (dialogs_table), 8);
2709 /* Next Unread Message Dialog */
2710 label = gtk_label_new (_("Show no-unread-message dialog"));
2711 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2712 gtk_widget_show (label);
2713 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 0, 1,
2714 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2717 optmenu_nextunreadmsgdialog = gtk_option_menu_new ();
2718 gtk_widget_show (optmenu_nextunreadmsgdialog);
2719 gtk_table_attach (GTK_TABLE (dialogs_table),
2720 optmenu_nextunreadmsgdialog, 1, 2, 0, 1,
2721 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2723 menu = gtk_menu_new ();
2724 MENUITEM_ADD (menu, menuitem, _("Always"), NEXTUNREADMSGDIALOG_ALWAYS);
2725 MENUITEM_ADD (menu, menuitem, _("Assume 'Yes'"),
2726 NEXTUNREADMSGDIALOG_ASSUME_YES);
2727 MENUITEM_ADD (menu, menuitem, _("Assume 'No'"),
2728 NEXTUNREADMSGDIALOG_ASSUME_NO);
2730 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_nextunreadmsgdialog), menu);
2732 label = gtk_label_new (_("Show send dialog"));
2733 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2734 gtk_widget_show (label);
2735 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 1, 2,
2736 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2738 optmenu_senddialog = gtk_option_menu_new ();
2739 gtk_widget_show (optmenu_senddialog);
2740 gtk_table_attach (GTK_TABLE (dialogs_table),
2741 optmenu_senddialog, 1, 2, 1, 2,
2742 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2744 menu = gtk_menu_new ();
2745 MENUITEM_ADD (menu, menuitem, _("Always"), SEND_DIALOG_ALWAYS);
2746 MENUITEM_ADD (menu, menuitem, _("Never"), SEND_DIALOG_NEVER);
2748 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_senddialog), menu);
2750 label = gtk_label_new (_("Show receive dialog"));
2751 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2752 gtk_widget_show (label);
2753 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 2, 3,
2754 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2756 optmenu_recvdialog = gtk_option_menu_new ();
2757 gtk_widget_show (optmenu_recvdialog);
2758 gtk_table_attach (GTK_TABLE (dialogs_table), optmenu_recvdialog, 1, 2, 2, 3,
2759 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2761 menu = gtk_menu_new ();
2762 MENUITEM_ADD (menu, menuitem, _("Always"), RECV_DIALOG_ALWAYS);
2763 MENUITEM_ADD (menu, menuitem, _("Only if a window is active"),
2764 RECV_DIALOG_ACTIVE);
2765 MENUITEM_ADD (menu, menuitem, _("Never"), RECV_DIALOG_NEVER);
2767 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
2769 PACK_CHECK_BUTTON (vbox_dialogs, checkbtn_no_recv_err_panel,
2770 _("Don't popup error dialog on receive error"));
2772 PACK_CHECK_BUTTON (vbox_dialogs, checkbtn_close_recv_dialog,
2773 _("Close receive dialog when finished"));
2776 hbox1 = gtk_hbox_new (FALSE, 8);
2777 gtk_widget_show (hbox1);
2778 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2780 button_keybind = gtk_button_new_with_label (_(" Set key bindings... "));
2781 gtk_widget_show (button_keybind);
2782 gtk_box_pack_start (GTK_BOX (hbox1), button_keybind, FALSE, FALSE, 0);
2783 gtk_signal_connect (GTK_OBJECT (button_keybind), "clicked",
2784 GTK_SIGNAL_FUNC (prefs_keybind_select), NULL);
2786 PACK_FRAME(vbox1, frame_pixmap_theme, _("Icon theme"));
2788 vbox_pixmap_theme = gtk_vbox_new(FALSE, 0);
2789 gtk_widget_show(vbox_pixmap_theme);
2790 gtk_container_add(GTK_CONTAINER(frame_pixmap_theme), vbox_pixmap_theme);
2791 gtk_container_set_border_width(GTK_CONTAINER(vbox_pixmap_theme), 8);
2793 avail_pixmap_themes = stock_pixmap_themes_list_new();
2795 combo_pixmap_theme = gtk_combo_new ();
2796 gtk_widget_show (combo_pixmap_theme);
2797 gtk_box_pack_start (GTK_BOX (vbox_pixmap_theme), combo_pixmap_theme, TRUE, TRUE, 0);
2798 gtk_combo_set_popdown_strings(GTK_COMBO(combo_pixmap_theme), avail_pixmap_themes);
2799 entry_pixmap_theme = GTK_COMBO (combo_pixmap_theme)->entry;
2801 stock_pixmap_themes_list_free(avail_pixmap_themes);
2803 /* interface.checkbtn_emacs = checkbtn_emacs; */
2804 interface.checkbtn_show_msg_with_cursor
2805 = checkbtn_show_msg_with_cursor;
2806 interface.checkbtn_openunread = checkbtn_openunread;
2807 interface.checkbtn_mark_as_read_on_newwin
2808 = checkbtn_mark_as_read_on_newwin;
2809 interface.checkbtn_openinbox = checkbtn_openinbox;
2810 interface.checkbtn_immedexec = checkbtn_immedexec;
2811 interface.optmenu_recvdialog = optmenu_recvdialog;
2812 interface.optmenu_senddialog = optmenu_senddialog;
2813 interface.checkbtn_no_recv_err_panel = checkbtn_no_recv_err_panel;
2814 interface.checkbtn_close_recv_dialog = checkbtn_close_recv_dialog;
2815 interface.optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
2816 interface.combo_pixmap_theme = combo_pixmap_theme;
2817 interface.entry_pixmap_theme = entry_pixmap_theme;
2820 static void prefs_other_create(void)
2823 GtkWidget *ext_frame;
2824 GtkWidget *ext_table;
2827 GtkWidget *uri_label;
2828 GtkWidget *uri_combo;
2829 GtkWidget *uri_entry;
2831 GtkWidget *printcmd_label;
2832 GtkWidget *printcmd_entry;
2834 GtkWidget *exteditor_label;
2835 GtkWidget *exteditor_combo;
2836 GtkWidget *exteditor_entry;
2838 GtkWidget *frame_addr;
2839 GtkWidget *vbox_addr;
2840 GtkWidget *checkbtn_addaddrbyclick;
2842 GtkWidget *frame_cliplog;
2843 GtkWidget *vbox_cliplog;
2844 GtkWidget *hbox_cliplog;
2845 GtkWidget *checkbtn_cliplog;
2846 GtkWidget *loglength_label;
2847 GtkWidget *loglength_entry;
2849 GtkWidget *frame_exit;
2850 GtkWidget *vbox_exit;
2851 GtkWidget *checkbtn_confonexit;
2852 GtkWidget *checkbtn_cleanonexit;
2853 GtkWidget *checkbtn_askonclean;
2854 GtkWidget *checkbtn_warnqueued;
2856 GtkWidget *frame_ssl;
2857 GtkWidget *vbox_ssl;
2858 GtkWidget *hbox_ssl;
2859 GtkWidget *checkbtn_ssl_ask_unknown_valid;
2861 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2862 gtk_widget_show (vbox1);
2863 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2864 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2866 PACK_FRAME(vbox1, ext_frame,
2867 _("External commands (%s will be replaced with file name / URI)"));
2869 ext_table = gtk_table_new (3, 2, FALSE);
2870 gtk_widget_show (ext_table);
2871 gtk_container_add (GTK_CONTAINER (ext_frame), ext_table);
2872 gtk_container_set_border_width (GTK_CONTAINER (ext_table), 8);
2873 gtk_table_set_row_spacings (GTK_TABLE (ext_table), VSPACING_NARROW);
2874 gtk_table_set_col_spacings (GTK_TABLE (ext_table), 8);
2876 uri_label = gtk_label_new (_("Web browser"));
2877 gtk_widget_show(uri_label);
2878 gtk_table_attach (GTK_TABLE (ext_table), uri_label, 0, 1, 0, 1,
2879 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2880 gtk_misc_set_alignment (GTK_MISC (uri_label), 1, 0.5);
2882 uri_combo = gtk_combo_new ();
2883 gtk_widget_show (uri_combo);
2884 gtk_table_attach (GTK_TABLE (ext_table), uri_combo, 1, 2, 0, 1,
2885 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2886 gtkut_combo_set_items (GTK_COMBO (uri_combo),
2888 "mozilla -remote 'openurl(%s,new-window)'",
2889 "netscape -remote 'openURL(%s,raise)'",
2891 "gnome-moz-remote --raise --newwin '%s'",
2892 "kfmclient openURL '%s'",
2893 "opera -newwindow '%s'",
2894 "kterm -e w3m '%s'",
2895 "kterm -e lynx '%s'",
2897 uri_entry = GTK_COMBO (uri_combo)->entry;
2899 printcmd_label = gtk_label_new (_("Print"));
2900 gtk_widget_show (printcmd_label);
2901 gtk_table_attach (GTK_TABLE (ext_table), printcmd_label, 0, 1, 1, 2,
2902 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2903 gtk_misc_set_alignment (GTK_MISC (printcmd_label), 1, 0.5);
2905 printcmd_entry = gtk_entry_new ();
2906 gtk_widget_show (printcmd_entry);
2907 gtk_table_attach (GTK_TABLE (ext_table), printcmd_entry, 1, 2, 1, 2,
2908 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2910 exteditor_label = gtk_label_new (_("Editor"));
2911 gtk_widget_show (exteditor_label);
2912 gtk_table_attach (GTK_TABLE (ext_table), exteditor_label, 0, 1, 2, 3,
2913 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2914 gtk_misc_set_alignment (GTK_MISC (exteditor_label), 1, 0.5);
2916 exteditor_combo = gtk_combo_new ();
2917 gtk_widget_show (exteditor_combo);
2918 gtk_table_attach (GTK_TABLE (ext_table), exteditor_combo, 1, 2, 2, 3,
2919 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2920 gtkut_combo_set_items (GTK_COMBO (exteditor_combo),
2923 "mgedit --no-fork %s",
2929 exteditor_entry = GTK_COMBO (exteditor_combo)->entry;
2931 PACK_FRAME (vbox1, frame_addr, _("Address book"));
2933 vbox_addr = gtk_vbox_new (FALSE, 0);
2934 gtk_widget_show (vbox_addr);
2935 gtk_container_add (GTK_CONTAINER (frame_addr), vbox_addr);
2936 gtk_container_set_border_width (GTK_CONTAINER (vbox_addr), 8);
2939 (vbox_addr, checkbtn_addaddrbyclick,
2940 _("Add address to destination when double-clicked"));
2943 PACK_FRAME (vbox1, frame_cliplog, _("Log Size"));
2945 vbox_cliplog = gtk_vbox_new (FALSE, 0);
2946 gtk_widget_show (vbox_cliplog);
2947 gtk_container_add (GTK_CONTAINER (frame_cliplog), vbox_cliplog);
2948 gtk_container_set_border_width (GTK_CONTAINER (vbox_cliplog), 8);
2949 PACK_CHECK_BUTTON (vbox_cliplog, checkbtn_cliplog,
2950 _("Clip the log size"));
2951 hbox_cliplog = gtk_hbox_new (FALSE, 3);
2952 gtk_container_add (GTK_CONTAINER (vbox_cliplog), hbox_cliplog);
2953 gtk_widget_show (hbox_cliplog);
2955 loglength_label = gtk_label_new (_("Log window length"));
2956 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
2958 gtk_widget_show (GTK_WIDGET (loglength_label));
2959 loglength_entry = gtk_entry_new ();
2960 gtk_widget_set_usize (GTK_WIDGET (loglength_entry), 64, -1);
2961 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_entry,
2963 gtk_widget_show (GTK_WIDGET (loglength_entry));
2964 loglength_label = gtk_label_new (_("(0 to stop logging in the log window)"));
2965 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
2967 SET_TOGGLE_SENSITIVITY(checkbtn_cliplog, loglength_entry);
2971 PACK_FRAME (vbox1, frame_ssl, _("Security"));
2973 vbox_ssl = gtk_vbox_new (FALSE, 0);
2974 gtk_widget_show (vbox_ssl);
2975 gtk_container_add (GTK_CONTAINER (frame_ssl), vbox_ssl);
2976 gtk_container_set_border_width (GTK_CONTAINER (vbox_ssl), 8);
2977 PACK_CHECK_BUTTON (vbox_ssl, checkbtn_ssl_ask_unknown_valid,
2978 _("Ask before accepting SSL certificates"));
2979 hbox_ssl = gtk_hbox_new (FALSE, 3);
2980 gtk_container_add (GTK_CONTAINER (vbox_ssl), hbox_ssl);
2981 gtk_widget_show (hbox_ssl);
2985 PACK_FRAME (vbox1, frame_exit, _("On exit"));
2987 vbox_exit = gtk_vbox_new (FALSE, 0);
2988 gtk_widget_show (vbox_exit);
2989 gtk_container_add (GTK_CONTAINER (frame_exit), vbox_exit);
2990 gtk_container_set_border_width (GTK_CONTAINER (vbox_exit), 8);
2992 PACK_CHECK_BUTTON (vbox_exit, checkbtn_confonexit,
2993 _("Confirm on exit"));
2995 hbox1 = gtk_hbox_new (FALSE, 32);
2996 gtk_widget_show (hbox1);
2997 gtk_box_pack_start (GTK_BOX (vbox_exit), hbox1, FALSE, FALSE, 0);
2999 PACK_CHECK_BUTTON (hbox1, checkbtn_cleanonexit,
3000 _("Empty trash on exit"));
3001 PACK_CHECK_BUTTON (hbox1, checkbtn_askonclean,
3002 _("Ask before emptying"));
3003 SET_TOGGLE_SENSITIVITY (checkbtn_cleanonexit, checkbtn_askonclean);
3005 PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
3006 _("Warn if there are queued messages"));
3008 other.uri_combo = uri_combo;
3009 other.uri_entry = uri_entry;
3010 other.printcmd_entry = printcmd_entry;
3012 other.exteditor_combo = exteditor_combo;
3013 other.exteditor_entry = exteditor_entry;
3015 other.checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
3017 other.checkbtn_cliplog = checkbtn_cliplog;
3018 other.loglength_entry = loglength_entry;
3020 other.checkbtn_confonexit = checkbtn_confonexit;
3021 other.checkbtn_cleanonexit = checkbtn_cleanonexit;
3022 other.checkbtn_askonclean = checkbtn_askonclean;
3023 other.checkbtn_warnqueued = checkbtn_warnqueued;
3026 other.checkbtn_ssl_ask_unknown_valid = checkbtn_ssl_ask_unknown_valid;
3030 static void date_format_ok_btn_clicked(GtkButton *button, GtkWidget **widget)
3032 GtkWidget *datefmt_sample = NULL;
3035 g_return_if_fail(widget != NULL);
3036 g_return_if_fail(*widget != NULL);
3037 g_return_if_fail(display.entry_datefmt != NULL);
3039 datefmt_sample = GTK_WIDGET(gtk_object_get_data
3040 (GTK_OBJECT(*widget), "datefmt_sample"));
3041 g_return_if_fail(datefmt_sample != NULL);
3043 text = gtk_editable_get_chars(GTK_EDITABLE(datefmt_sample), 0, -1);
3044 g_free(prefs_common.date_format);
3045 prefs_common.date_format = text;
3046 gtk_entry_set_text(GTK_ENTRY(display.entry_datefmt), text);
3048 gtk_widget_destroy(*widget);
3052 static void date_format_cancel_btn_clicked(GtkButton *button,
3055 g_return_if_fail(widget != NULL);
3056 g_return_if_fail(*widget != NULL);
3058 gtk_widget_destroy(*widget);
3062 static void date_format_key_pressed(GtkWidget *keywidget, GdkEventKey *event,
3065 if (event && event->keyval == GDK_Escape)
3066 date_format_cancel_btn_clicked(NULL, widget);
3069 static gboolean date_format_on_delete(GtkWidget *dialogwidget,
3070 GdkEventAny *event, GtkWidget **widget)
3072 g_return_val_if_fail(widget != NULL, FALSE);
3073 g_return_val_if_fail(*widget != NULL, FALSE);
3079 static void date_format_entry_on_change(GtkEditable *editable,
3083 struct tm *cal_time;
3087 cur_time = time(NULL);
3088 cal_time = localtime(&cur_time);
3090 text = gtk_editable_get_chars(editable, 0, -1);
3092 strftime(buffer, sizeof buffer, text, cal_time);
3094 gtk_label_set_text(example, buffer);
3097 static void date_format_select_row(GtkWidget *date_format_list, gint row,
3098 gint column, GdkEventButton *event,
3099 GtkWidget *date_format)
3105 GtkWidget *datefmt_sample;
3107 /* only on double click */
3108 if (!event || event->type != GDK_2BUTTON_PRESS) return;
3111 datefmt_sample = GTK_WIDGET(gtk_object_get_data
3112 (GTK_OBJECT(date_format), "datefmt_sample"));
3114 g_return_if_fail(date_format_list != NULL);
3115 g_return_if_fail(date_format != NULL);
3116 g_return_if_fail(datefmt_sample != NULL);
3118 /* get format from clist */
3119 gtk_clist_get_text(GTK_CLIST(date_format_list), row, 0, &format);
3121 cur_pos = gtk_editable_get_position(GTK_EDITABLE(datefmt_sample));
3122 old_format = gtk_entry_get_text(GTK_ENTRY(datefmt_sample));
3124 /* insert the format into the text entry */
3125 new_format = g_malloc(strlen(old_format) + 3);
3127 strncpy(new_format, old_format, cur_pos);
3128 new_format[cur_pos] = '\0';
3129 strcat(new_format, format);
3130 strcat(new_format, &old_format[cur_pos]);
3132 gtk_entry_set_text(GTK_ENTRY(datefmt_sample), new_format);
3133 gtk_editable_set_position(GTK_EDITABLE(datefmt_sample), cur_pos + 2);
3138 static GtkWidget *date_format_create(GtkButton *button, void *data)
3140 static GtkWidget *datefmt_win = NULL;
3142 GtkWidget *scrolledwindow1;
3143 GtkWidget *datefmt_clist;
3148 GtkWidget *confirm_area;
3150 GtkWidget *cancel_btn;
3151 GtkWidget *datefmt_entry;
3180 const gint TIME_FORMAT_ELEMS =
3181 sizeof time_format / sizeof time_format[0];
3183 time_format[0].txt = _("the full abbreviated weekday name");
3184 time_format[1].txt = _("the full weekday name");
3185 time_format[2].txt = _("the abbreviated month name");
3186 time_format[3].txt = _("the full month name");
3187 time_format[4].txt = _("the preferred date and time for the current locale");
3188 time_format[5].txt = _("the century number (year/100)");
3189 time_format[6].txt = _("the day of the month as a decimal number");
3190 time_format[7].txt = _("the hour as a decimal number using a 24-hour clock");
3191 time_format[8].txt = _("the hour as a decimal number using a 12-hour clock");
3192 time_format[9].txt = _("the day of the year as a decimal number");
3193 time_format[10].txt = _("the month as a decimal number");
3194 time_format[11].txt = _("the minute as a decimal number");
3195 time_format[12].txt = _("either AM or PM");
3196 time_format[13].txt = _("the second as a decimal number");
3197 time_format[14].txt = _("the day of the week as a decimal number");
3198 time_format[15].txt = _("the preferred date for the current locale");
3199 time_format[16].txt = _("the last two digits of a year");
3200 time_format[17].txt = _("the year as a decimal number");
3201 time_format[18].txt = _("the time zone or name or abbreviation");
3203 if (datefmt_win) return datefmt_win;
3205 datefmt_win = gtk_window_new(GTK_WINDOW_DIALOG);
3206 gtk_container_set_border_width(GTK_CONTAINER(datefmt_win), 8);
3207 gtk_window_set_title(GTK_WINDOW(datefmt_win), _("Date format"));
3208 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
3209 gtk_widget_set_usize(datefmt_win, 440, 280);
3211 vbox1 = gtk_vbox_new(FALSE, 10);
3212 gtk_widget_show(vbox1);
3213 gtk_container_add(GTK_CONTAINER(datefmt_win), vbox1);
3215 scrolledwindow1 = gtk_scrolled_window_new(NULL, NULL);
3216 gtk_scrolled_window_set_policy
3217 (GTK_SCROLLED_WINDOW(scrolledwindow1),
3218 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
3219 gtk_widget_show(scrolledwindow1);
3220 gtk_box_pack_start(GTK_BOX(vbox1), scrolledwindow1, TRUE, TRUE, 0);
3222 titles[0] = _("Specifier");
3223 titles[1] = _("Description");
3224 datefmt_clist = gtk_clist_new_with_titles(2, titles);
3225 gtk_widget_show(datefmt_clist);
3226 gtk_container_add(GTK_CONTAINER(scrolledwindow1), datefmt_clist);
3227 /* gtk_clist_set_column_width(GTK_CLIST(datefmt_clist), 0, 80); */
3228 gtk_clist_set_selection_mode(GTK_CLIST(datefmt_clist),
3229 GTK_SELECTION_BROWSE);
3231 for (i = 0; i < TIME_FORMAT_ELEMS; i++) {
3233 /* phoney casting necessary because of gtk... */
3234 text[0] = (gchar *)time_format[i].fmt;
3235 text[1] = (gchar *)time_format[i].txt;
3236 gtk_clist_append(GTK_CLIST(datefmt_clist), text);
3239 table = gtk_table_new(2, 2, FALSE);
3240 gtk_widget_show(table);
3241 gtk_box_pack_start(GTK_BOX(vbox1), table, FALSE, FALSE, 0);
3242 gtk_table_set_row_spacings(GTK_TABLE(table), 4);
3243 gtk_table_set_col_spacings(GTK_TABLE(table), 8);
3245 label1 = gtk_label_new(_("Date format"));
3246 gtk_widget_show(label1);
3247 gtk_table_attach(GTK_TABLE(table), label1, 0, 1, 0, 1,
3249 gtk_label_set_justify(GTK_LABEL(label1), GTK_JUSTIFY_LEFT);
3250 gtk_misc_set_alignment(GTK_MISC(label1), 0, 0.5);
3252 datefmt_entry = gtk_entry_new_with_max_length(256);
3253 gtk_widget_show(datefmt_entry);
3254 gtk_table_attach(GTK_TABLE(table), datefmt_entry, 1, 2, 0, 1,
3255 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3257 /* we need the "sample" entry box; add it as data so callbacks can
3258 * get the entry box */
3259 gtk_object_set_data(GTK_OBJECT(datefmt_win), "datefmt_sample",
3262 label2 = gtk_label_new(_("Example"));
3263 gtk_widget_show(label2);
3264 gtk_table_attach(GTK_TABLE(table), label2, 0, 1, 1, 2,
3266 gtk_label_set_justify(GTK_LABEL(label2), GTK_JUSTIFY_LEFT);
3267 gtk_misc_set_alignment(GTK_MISC(label2), 0, 0.5);
3269 label3 = gtk_label_new("");
3270 gtk_widget_show(label3);
3271 gtk_table_attach(GTK_TABLE(table), label3, 1, 2, 1, 2,
3272 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3273 gtk_label_set_justify(GTK_LABEL(label3), GTK_JUSTIFY_LEFT);
3274 gtk_misc_set_alignment(GTK_MISC(label3), 0, 0.5);
3276 gtkut_button_set_create(&confirm_area, &ok_btn, _("OK"),
3277 &cancel_btn, _("Cancel"), NULL, NULL);
3278 gtk_widget_grab_default(ok_btn);
3279 gtk_widget_show(confirm_area);
3281 gtk_box_pack_start(GTK_BOX(vbox1), confirm_area, FALSE, FALSE, 0);
3283 /* set the current format */
3284 gtk_entry_set_text(GTK_ENTRY(datefmt_entry), prefs_common.date_format);
3285 date_format_entry_on_change(GTK_EDITABLE(datefmt_entry),
3288 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
3289 GTK_SIGNAL_FUNC(date_format_ok_btn_clicked),
3291 gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
3292 GTK_SIGNAL_FUNC(date_format_cancel_btn_clicked),
3294 gtk_signal_connect(GTK_OBJECT(datefmt_win), "key_press_event",
3295 GTK_SIGNAL_FUNC(date_format_key_pressed),
3297 gtk_signal_connect(GTK_OBJECT(datefmt_win), "delete_event",
3298 GTK_SIGNAL_FUNC(date_format_on_delete),
3300 gtk_signal_connect(GTK_OBJECT(datefmt_entry), "changed",
3301 GTK_SIGNAL_FUNC(date_format_entry_on_change),
3304 gtk_signal_connect(GTK_OBJECT(datefmt_clist), "select_row",
3305 GTK_SIGNAL_FUNC(date_format_select_row),
3308 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
3309 gtk_window_set_modal(GTK_WINDOW(datefmt_win), TRUE);
3311 gtk_widget_show(datefmt_win);
3312 manage_window_set_transient(GTK_WINDOW(datefmt_win));
3314 gtk_widget_grab_focus(ok_btn);
3319 void prefs_quote_colors_dialog(void)
3321 if (!quote_color_win)
3322 prefs_quote_colors_dialog_create();
3323 gtk_widget_show(quote_color_win);
3324 manage_window_set_transient(GTK_WINDOW(quote_color_win));
3327 gtk_widget_hide(quote_color_win);
3329 textview_update_message_colors();
3330 main_window_reflect_prefs_all();
3333 static void prefs_quote_colors_dialog_create(void)
3338 GtkWidget *quotelevel1_label;
3339 GtkWidget *quotelevel2_label;
3340 GtkWidget *quotelevel3_label;
3341 GtkWidget *uri_label;
3342 GtkWidget *signature_label;
3343 GtkWidget *tgt_folder_label;
3346 GtkWidget *recycle_colors_btn;
3347 GtkWidget *frame_colors;
3349 window = gtk_window_new(GTK_WINDOW_DIALOG);
3350 gtk_container_set_border_width(GTK_CONTAINER(window), 2);
3351 gtk_window_set_title(GTK_WINDOW(window), _("Set message colors"));
3352 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
3353 gtk_window_set_modal(GTK_WINDOW(window), TRUE);
3354 gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
3356 vbox = gtk_vbox_new (FALSE, VSPACING);
3357 gtk_container_add (GTK_CONTAINER (window), vbox);
3358 gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
3359 PACK_FRAME(vbox, frame_colors, _("Colors"));
3361 table = gtk_table_new (5, 2, FALSE);
3362 gtk_container_add (GTK_CONTAINER (frame_colors), table);
3363 gtk_container_set_border_width (GTK_CONTAINER (table), 8);
3364 gtk_table_set_row_spacings (GTK_TABLE (table), 2);
3365 gtk_table_set_col_spacings (GTK_TABLE (table), 5);
3368 color_buttons.quote_level1_btn = gtk_button_new();
3369 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level1_btn,
3370 0, 1, 0, 1, 0, 0, 0, 0);
3371 gtk_widget_set_usize (color_buttons.quote_level1_btn, 40, 30);
3372 gtk_container_set_border_width
3373 (GTK_CONTAINER (color_buttons.quote_level1_btn), 5);
3375 color_buttons.quote_level2_btn = gtk_button_new();
3376 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level2_btn,
3377 0, 1, 1, 2, 0, 0, 0, 0);
3378 gtk_widget_set_usize (color_buttons.quote_level2_btn, 40, 30);
3379 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.quote_level2_btn), 5);
3381 color_buttons.quote_level3_btn = gtk_button_new_with_label ("");
3382 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level3_btn,
3383 0, 1, 2, 3, 0, 0, 0, 0);
3384 gtk_widget_set_usize (color_buttons.quote_level3_btn, 40, 30);
3385 gtk_container_set_border_width
3386 (GTK_CONTAINER (color_buttons.quote_level3_btn), 5);
3388 color_buttons.uri_btn = gtk_button_new_with_label ("");
3389 gtk_table_attach (GTK_TABLE (table), color_buttons.uri_btn,
3390 0, 1, 3, 4, 0, 0, 0, 0);
3391 gtk_widget_set_usize (color_buttons.uri_btn, 40, 30);
3392 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.uri_btn), 5);
3394 color_buttons.tgt_folder_btn = gtk_button_new_with_label ("");
3395 gtk_table_attach (GTK_TABLE (table), color_buttons.tgt_folder_btn,
3396 0, 1, 4, 5, 0, 0, 0, 0);
3397 gtk_widget_set_usize (color_buttons.tgt_folder_btn, 40, 30);
3398 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.tgt_folder_btn), 5);
3400 color_buttons.signature_btn = gtk_button_new_with_label ("");
3401 gtk_table_attach (GTK_TABLE (table), color_buttons.signature_btn,
3402 0, 1, 5, 6, 0, 0, 0, 0);
3403 gtk_widget_set_usize (color_buttons.signature_btn, 40, 30);
3404 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.signature_btn), 5);
3406 quotelevel1_label = gtk_label_new (_("Quoted Text - First Level"));
3407 gtk_table_attach (GTK_TABLE (table), quotelevel1_label, 1, 2, 0, 1,
3408 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3409 gtk_label_set_justify (GTK_LABEL (quotelevel1_label), GTK_JUSTIFY_LEFT);
3410 gtk_misc_set_alignment (GTK_MISC (quotelevel1_label), 0, 0.5);
3412 quotelevel2_label = gtk_label_new (_("Quoted Text - Second Level"));
3413 gtk_table_attach (GTK_TABLE (table), quotelevel2_label, 1, 2, 1, 2,
3414 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3415 gtk_label_set_justify (GTK_LABEL (quotelevel2_label), GTK_JUSTIFY_LEFT);
3416 gtk_misc_set_alignment (GTK_MISC (quotelevel2_label), 0, 0.5);
3418 quotelevel3_label = gtk_label_new (_("Quoted Text - Third Level"));
3419 gtk_table_attach (GTK_TABLE (table), quotelevel3_label, 1, 2, 2, 3,
3420 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3421 gtk_label_set_justify (GTK_LABEL (quotelevel3_label), GTK_JUSTIFY_LEFT);
3422 gtk_misc_set_alignment (GTK_MISC (quotelevel3_label), 0, 0.5);
3424 uri_label = gtk_label_new (_("URI link"));
3425 gtk_table_attach (GTK_TABLE (table), uri_label, 1, 2, 3, 4,
3426 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3427 gtk_label_set_justify (GTK_LABEL (uri_label), GTK_JUSTIFY_LEFT);
3428 gtk_misc_set_alignment (GTK_MISC (uri_label), 0, 0.5);
3430 tgt_folder_label = gtk_label_new (_("Target folder"));
3431 gtk_table_attach (GTK_TABLE (table), tgt_folder_label, 1, 2, 4, 5,
3432 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3433 gtk_label_set_justify (GTK_LABEL (tgt_folder_label), GTK_JUSTIFY_LEFT);
3434 gtk_misc_set_alignment (GTK_MISC (tgt_folder_label), 0, 0.5);
3436 signature_label = gtk_label_new (_("Signatures"));
3437 gtk_table_attach (GTK_TABLE (table), signature_label, 1, 2, 5, 6,
3438 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3439 gtk_label_set_justify (GTK_LABEL (signature_label), GTK_JUSTIFY_LEFT);
3440 gtk_misc_set_alignment (GTK_MISC (signature_label), 0, 0.5);
3442 PACK_CHECK_BUTTON (vbox, recycle_colors_btn,
3443 _("Recycle quote colors"));
3445 gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
3446 NULL, NULL, NULL, NULL);
3447 gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
3449 gtk_widget_grab_default(ok_btn);
3450 MANAGE_WINDOW_SIGNALS_CONNECT(window);
3451 gtk_signal_connect(GTK_OBJECT(window), "delete_event",
3452 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3453 gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
3454 GTK_SIGNAL_FUNC(prefs_quote_colors_key_pressed),
3457 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level1_btn), "clicked",
3458 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL1");
3459 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level2_btn), "clicked",
3460 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL2");
3461 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level3_btn), "clicked",
3462 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL3");
3463 gtk_signal_connect(GTK_OBJECT(color_buttons.uri_btn), "clicked",
3464 GTK_SIGNAL_FUNC(quote_color_set_dialog), "URI");
3465 gtk_signal_connect(GTK_OBJECT(color_buttons.tgt_folder_btn), "clicked",
3466 GTK_SIGNAL_FUNC(quote_color_set_dialog), "TGTFLD");
3467 gtk_signal_connect(GTK_OBJECT(color_buttons.signature_btn), "clicked",
3468 GTK_SIGNAL_FUNC(quote_color_set_dialog), "SIGNATURE");
3469 gtk_signal_connect(GTK_OBJECT(recycle_colors_btn), "toggled",
3470 GTK_SIGNAL_FUNC(prefs_recycle_colors_toggled), NULL);
3471 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
3472 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3474 /* show message button colors and recycle options */
3475 set_button_bg_color(color_buttons.quote_level1_btn,
3476 prefs_common.quote_level1_col);
3477 set_button_bg_color(color_buttons.quote_level2_btn,
3478 prefs_common.quote_level2_col);
3479 set_button_bg_color(color_buttons.quote_level3_btn,
3480 prefs_common.quote_level3_col);
3481 set_button_bg_color(color_buttons.uri_btn,
3482 prefs_common.uri_col);
3483 set_button_bg_color(color_buttons.tgt_folder_btn,
3484 prefs_common.tgt_folder_col);
3485 set_button_bg_color(color_buttons.signature_btn,
3486 prefs_common.signature_col);
3487 gtk_toggle_button_set_active((GtkToggleButton *)recycle_colors_btn,
3488 prefs_common.recycle_quote_colors);
3490 gtk_widget_show_all(vbox);
3491 quote_color_win = window;
3494 static void prefs_quote_colors_key_pressed(GtkWidget *widget,
3495 GdkEventKey *event, gpointer data)
3497 if (event && event->keyval == GDK_Escape)
3501 static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
3503 gchar *type = (gchar *)data;
3504 gchar *title = NULL;
3505 gdouble color[4] = {0.0, 0.0, 0.0, 0.0};
3507 GtkColorSelectionDialog *dialog;
3509 if(g_strcasecmp(type, "LEVEL1") == 0) {
3510 title = _("Pick color for quotation level 1");
3511 rgbvalue = prefs_common.quote_level1_col;
3512 } else if(g_strcasecmp(type, "LEVEL2") == 0) {
3513 title = _("Pick color for quotation level 2");
3514 rgbvalue = prefs_common.quote_level2_col;
3515 } else if(g_strcasecmp(type, "LEVEL3") == 0) {
3516 title = _("Pick color for quotation level 3");
3517 rgbvalue = prefs_common.quote_level3_col;
3518 } else if(g_strcasecmp(type, "URI") == 0) {
3519 title = _("Pick color for URI");
3520 rgbvalue = prefs_common.uri_col;
3521 } else if(g_strcasecmp(type, "TGTFLD") == 0) {
3522 title = _("Pick color for target folder");
3523 rgbvalue = prefs_common.tgt_folder_col;
3524 } else if(g_strcasecmp(type, "SIGNATURE") == 0) {
3525 title = _("Pick color for signatures");
3526 rgbvalue = prefs_common.signature_col;
3528 } else if(g_strcasecmp(type, "Misspelled word") == 0) {
3529 title = _("Pick color for misspelled word");
3530 rgbvalue = prefs_common.misspelled_col;
3532 } else { /* Should never be called */
3533 g_warning("Unrecognized datatype '%s' in quote_color_set_dialog\n", type);
3537 color_dialog = gtk_color_selection_dialog_new(title);
3538 gtk_window_set_position(GTK_WINDOW(color_dialog), GTK_WIN_POS_CENTER);
3539 gtk_window_set_modal(GTK_WINDOW(color_dialog), TRUE);
3540 gtk_window_set_policy(GTK_WINDOW(color_dialog), FALSE, FALSE, FALSE);
3541 manage_window_set_transient(GTK_WINDOW(color_dialog));
3543 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->ok_button),
3544 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_ok), data);
3545 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->cancel_button),
3546 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_cancel), data);
3547 gtk_signal_connect(GTK_OBJECT(color_dialog), "key_press_event",
3548 GTK_SIGNAL_FUNC(quote_colors_set_dialog_key_pressed),
3551 /* preselect the previous color in the color selection dialog */
3552 color[0] = (gdouble) ((rgbvalue & 0xff0000) >> 16) / 255.0;
3553 color[1] = (gdouble) ((rgbvalue & 0x00ff00) >> 8) / 255.0;
3554 color[2] = (gdouble) (rgbvalue & 0x0000ff) / 255.0;
3555 dialog = GTK_COLOR_SELECTION_DIALOG(color_dialog);
3556 gtk_color_selection_set_color
3557 (GTK_COLOR_SELECTION(dialog->colorsel), color);
3559 gtk_widget_show(color_dialog);
3562 static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
3564 GtkColorSelection *colorsel = (GtkColorSelection *)
3565 ((GtkColorSelectionDialog *)color_dialog)->colorsel;
3567 gint red, green, blue, rgbvalue;
3568 gchar *type = (gchar *)data;
3570 gtk_color_selection_get_color(colorsel, color);
3572 red = (gint) (color[0] * 255.0);
3573 green = (gint) (color[1] * 255.0);
3574 blue = (gint) (color[2] * 255.0);
3575 rgbvalue = (gint) ((red * 0x10000) | (green * 0x100) | blue);
3578 fprintf(stderr, "redc = %f, greenc = %f, bluec = %f\n", color[0], color[1], color[2]);
3579 fprintf(stderr, "red = %d, green = %d, blue = %d\n", red, green, blue);
3580 fprintf(stderr, "Color is %x\n", rgbvalue);
3583 if (g_strcasecmp(type, "LEVEL1") == 0) {
3584 prefs_common.quote_level1_col = rgbvalue;
3585 set_button_bg_color(color_buttons.quote_level1_btn, rgbvalue);
3586 } else if (g_strcasecmp(type, "LEVEL2") == 0) {
3587 prefs_common.quote_level2_col = rgbvalue;
3588 set_button_bg_color(color_buttons.quote_level2_btn, rgbvalue);
3589 } else if (g_strcasecmp(type, "LEVEL3") == 0) {
3590 prefs_common.quote_level3_col = rgbvalue;
3591 set_button_bg_color(color_buttons.quote_level3_btn, rgbvalue);
3592 } else if (g_strcasecmp(type, "URI") == 0) {
3593 prefs_common.uri_col = rgbvalue;
3594 set_button_bg_color(color_buttons.uri_btn, rgbvalue);
3595 } else if (g_strcasecmp(type, "TGTFLD") == 0) {
3596 prefs_common.tgt_folder_col = rgbvalue;
3597 set_button_bg_color(color_buttons.tgt_folder_btn, rgbvalue);
3598 folderview_set_target_folder_color(prefs_common.tgt_folder_col);
3599 } else if (g_strcasecmp(type, "SIGNATURE") == 0) {
3600 prefs_common.signature_col = rgbvalue;
3601 set_button_bg_color(color_buttons.signature_btn, rgbvalue);
3603 } else if (g_strcasecmp(type, "Misspelled word") == 0) {
3604 prefs_common.misspelled_col = rgbvalue;
3605 set_button_bg_color(spelling.misspelled_btn, rgbvalue);
3608 fprintf( stderr, "Unrecognized datatype '%s' in quote_color_set_dialog_ok\n", type );
3610 gtk_widget_destroy(color_dialog);
3613 static void quote_colors_set_dialog_cancel(GtkWidget *widget, gpointer data)
3615 gtk_widget_destroy(color_dialog);
3618 static void quote_colors_set_dialog_key_pressed(GtkWidget *widget,
3622 gtk_widget_destroy(color_dialog);
3625 static void set_button_bg_color(GtkWidget *widget, gint rgbvalue)
3630 gtkut_convert_int_to_gdk_color(rgbvalue, &color);
3631 newstyle = gtk_style_copy(gtk_widget_get_default_style());
3632 newstyle->bg[GTK_STATE_NORMAL] = color;
3633 newstyle->bg[GTK_STATE_PRELIGHT] = color;
3634 newstyle->bg[GTK_STATE_ACTIVE] = color;
3636 gtk_widget_set_style(GTK_WIDGET(widget), newstyle);
3639 static void prefs_enable_message_color_toggled(void)
3643 is_active = gtk_toggle_button_get_active
3644 (GTK_TOGGLE_BUTTON(message.chkbtn_enablecol));
3645 gtk_widget_set_sensitive(message.button_edit_col, is_active);
3646 prefs_common.enable_color = is_active;
3649 static void prefs_recycle_colors_toggled(GtkWidget *widget)
3653 is_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
3654 prefs_common.recycle_quote_colors = is_active;
3657 static void prefs_font_select(GtkButton *button, GtkEntry *entry)
3661 g_return_if_fail(entry != NULL);
3663 if (!font_sel_win) {
3664 font_sel_win = gtk_font_selection_dialog_new
3665 (_("Font selection"));
3666 gtk_window_position(GTK_WINDOW(font_sel_win),
3667 GTK_WIN_POS_CENTER);
3668 gtk_signal_connect(GTK_OBJECT(font_sel_win), "delete_event",
3669 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3672 (GTK_OBJECT(font_sel_win), "key_press_event",
3673 GTK_SIGNAL_FUNC(prefs_font_selection_key_pressed),
3675 gtk_signal_connect_object
3676 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->cancel_button),
3678 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3679 GTK_OBJECT(font_sel_win));
3682 if(font_sel_conn_id) {
3683 gtk_signal_disconnect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button), font_sel_conn_id);
3685 font_sel_conn_id = gtk_signal_connect
3686 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button),
3688 GTK_SIGNAL_FUNC(prefs_font_selection_ok),
3690 printf("%i\n", font_sel_conn_id);
3692 font_name = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
3693 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(font_sel_win), font_name);
3695 manage_window_set_transient(GTK_WINDOW(font_sel_win));
3696 gtk_window_set_modal(GTK_WINDOW(font_sel_win), TRUE);
3697 gtk_widget_grab_focus
3698 (GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button);
3699 gtk_widget_show(font_sel_win);
3702 static void prefs_font_selection_key_pressed(GtkWidget *widget,
3706 if (event && event->keyval == GDK_Escape)
3707 gtk_widget_hide(font_sel_win);
3710 static void prefs_font_selection_ok(GtkButton *button, GtkEntry *entry)
3714 fontname = gtk_font_selection_dialog_get_font_name
3715 (GTK_FONT_SELECTION_DIALOG(font_sel_win));
3718 gtk_entry_set_text(entry, fontname);
3723 gtk_widget_hide(font_sel_win);
3726 static void prefs_keybind_select(void)
3733 GtkWidget *confirm_area;
3735 GtkWidget *cancel_btn;
3737 window = gtk_window_new (GTK_WINDOW_DIALOG);
3738 gtk_container_set_border_width (GTK_CONTAINER (window), 8);
3739 gtk_window_set_title (GTK_WINDOW (window), _("Key bindings"));
3740 gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
3741 gtk_window_set_modal (GTK_WINDOW (window), TRUE);
3742 gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, FALSE);
3743 manage_window_set_transient (GTK_WINDOW (window));
3745 vbox1 = gtk_vbox_new (FALSE, VSPACING);
3746 gtk_container_add (GTK_CONTAINER (window), vbox1);
3747 gtk_container_set_border_width (GTK_CONTAINER (vbox1), 2);
3749 hbox1 = gtk_hbox_new (FALSE, 8);
3750 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3752 label = gtk_label_new
3753 (_("Select preset:"));
3754 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
3755 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
3757 hbox1 = gtk_hbox_new (FALSE, 8);
3758 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3760 combo = gtk_combo_new ();
3761 gtk_box_pack_start (GTK_BOX (hbox1), combo, TRUE, TRUE, 0);
3762 gtkut_combo_set_items (GTK_COMBO (combo),
3768 gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE);
3770 hbox1 = gtk_hbox_new (FALSE, 8);
3771 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3773 label = gtk_label_new
3774 (_("You can also modify each menu shortcut by pressing\n"
3775 "any key(s) when placing the mouse pointer on the item."));
3776 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
3777 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
3779 hbox1 = gtk_hbox_new (FALSE, 8);
3780 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3782 gtkut_button_set_create (&confirm_area, &ok_btn, _("OK"),
3783 &cancel_btn, _("Cancel"), NULL, NULL);
3784 gtk_box_pack_end (GTK_BOX (hbox1), confirm_area, FALSE, FALSE, 0);
3785 gtk_widget_grab_default (ok_btn);
3787 MANAGE_WINDOW_SIGNALS_CONNECT(window);
3788 gtk_signal_connect (GTK_OBJECT (window), "delete_event",
3789 GTK_SIGNAL_FUNC (prefs_keybind_deleted), NULL);
3790 gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
3791 GTK_SIGNAL_FUNC (prefs_keybind_key_pressed), NULL);
3792 gtk_signal_connect (GTK_OBJECT (ok_btn), "clicked",
3793 GTK_SIGNAL_FUNC (prefs_keybind_apply_clicked),
3795 gtk_signal_connect (GTK_OBJECT (cancel_btn), "clicked",
3796 GTK_SIGNAL_FUNC (prefs_keybind_cancel),
3799 gtk_widget_show_all(window);
3801 keybind.window = window;
3802 keybind.combo = combo;
3805 static void prefs_keybind_key_pressed(GtkWidget *widget, GdkEventKey *event,
3808 if (event && event->keyval == GDK_Escape)
3809 prefs_keybind_cancel();
3812 static gint prefs_keybind_deleted(GtkWidget *widget, GdkEventAny *event,
3815 prefs_keybind_cancel();
3819 static void prefs_keybind_cancel(void)
3821 gtk_widget_destroy(keybind.window);
3822 keybind.window = NULL;
3823 keybind.combo = NULL;
3826 static void prefs_keybind_apply_clicked(GtkWidget *widget)
3828 GtkEntry *entry = GTK_ENTRY(GTK_COMBO(keybind.combo)->entry);
3832 static gchar *default_menurc =
3833 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3834 "(menu-path \"<Main>/File/Save as...\" \"<control>S\")\n"
3835 "(menu-path \"<Main>/File/Print...\" \"\")\n"
3836 "(menu-path \"<Main>/File/Exit\" \"<control>Q\")\n"
3838 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3839 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3840 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3841 "(menu-path \"<Main>/Edit/Search folder...\" \"<shift><control>F\")\n"
3843 "(menu-path \"<Main>/View/Expand Summary View\" \"V\")\n"
3844 "(menu-path \"<Main>/View/Expand Message View\" \"<shift>V\")\n"
3845 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3846 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3847 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3848 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3849 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3850 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3851 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3852 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3853 "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
3854 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3856 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3857 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3858 "(menu-path \"<Main>/Message/Compose an email message\" \"<control>M\")\n"
3859 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3860 "(menu-path \"<Main>/Message/Reply to/all\" \"<shift><control>R\")\n"
3861 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
3862 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
3863 "(menu-path \"<Main>/Message/Forward\" \"<control><alt>F\")\n"
3864 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
3865 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3866 "(menu-path \"<Main>/Message/Copy...\" \"<shift><control>O\")\n"
3867 "(menu-path \"<Main>/Message/Delete\" \"<control>D\")\n"
3868 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3869 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3870 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3871 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3873 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3874 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3875 "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
3877 "(menu-path \"<Compose>/File/Close\" \"<control>W\")\n"
3878 "(menu-path \"<Compose>/Edit/Select all\" \"<control>A\")\n"
3879 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
3880 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
3881 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
3882 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
3883 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
3885 static gchar *mew_wl_menurc =
3886 "(menu-path \"<Main>/File/Empty trash\" \"<shift>D\")\n"
3887 "(menu-path \"<Main>/File/Save as...\" \"Y\")\n"
3888 "(menu-path \"<Main>/File/Print...\" \"<shift>numbersign\")\n"
3889 "(menu-path \"<Main>/File/Exit\" \"<shift>Q\")\n"
3891 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3892 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3893 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3894 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
3896 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
3897 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
3898 "(menu-path \"<Main>/View/Thread view\" \"<shift>T\")\n"
3899 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3900 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3901 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3902 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3903 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3904 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3905 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3906 "(menu-path \"<Main>/View/Show all headers\" \"<shift>H\")\n"
3907 "(menu-path \"<Main>/View/Update\" \"<shift>S\")\n"
3909 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3910 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3911 "(menu-path \"<Main>/Message/Compose an email message\" \"W\")\n"
3912 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3913 "(menu-path \"<Main>/Message/Reply to/all\" \"<shift>A\")\n"
3914 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
3915 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
3916 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3917 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift>F\")\n" */
3918 "(menu-path \"<Main>/Message/Move...\" \"O\")\n"
3919 "(menu-path \"<Main>/Message/Copy...\" \"<shift>O\")\n"
3920 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3921 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3922 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3923 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3924 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"<shift>R\")\n"
3926 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3927 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3928 "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
3930 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3931 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3932 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3933 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3934 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3935 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3936 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3938 static gchar *mutt_menurc =
3939 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3940 "(menu-path \"<Main>/File/Save as...\" \"S\")\n"
3941 "(menu-path \"<Main>/File/Print...\" \"P\")\n"
3942 "(menu-path \"<Main>/File/Exit\" \"Q\")\n"
3944 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3945 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3946 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3947 "(menu-path \"<Main>/Edit/Search messages...\" \"slash\")\n"
3949 "(menu-path \"<Main>/View/Toggle summary view\" \"V\")\n"
3950 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3951 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
3952 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
3953 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
3954 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
3955 "(menu-path \"<Main>/View/Go to/Other folder...\" \"C\")\n"
3956 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3957 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3958 "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
3959 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3961 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3962 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3963 "(menu-path \"<Main>/Message/Compose new message\" \"M\")\n"
3964 "(menu-path \"<Main>/Message/Reply\" \"R\")\n"
3965 "(menu-path \"<Main>/Message/Reply to/all\" \"G\")\n"
3966 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
3967 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
3968 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3969 "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n"
3970 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3971 "(menu-path \"<Main>/Message/Copy...\" \"<shift>C\")\n"
3972 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3973 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>F\")\n"
3974 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3975 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>N\")\n"
3976 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3978 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3979 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3980 "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
3982 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3983 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3984 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3985 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3986 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3987 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3988 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3990 static gchar *old_sylpheed_menurc =
3991 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3992 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
3993 "(menu-path \"<Main>/File/Print...\" \"<alt>P\")\n"
3994 "(menu-path \"<Main>/File/Exit\" \"<alt>Q\")\n"
3996 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3997 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3998 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3999 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
4001 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
4002 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
4003 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
4004 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
4005 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
4006 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
4007 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
4008 "(menu-path \"<Main>/View/Go to/Other folder...\" \"<alt>G\")\n"
4009 "(menu-path \"<Main>/View/Open in new window\" \"<shift><control>N\")\n"
4010 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
4011 "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
4012 "(menu-path \"<Main>/View/Update\" \"<alt>U\")\n"
4014 "(menu-path \"<Main>/Message/Get new mail\" \"<alt>I\")\n"
4015 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><alt>I\")\n"
4016 "(menu-path \"<Main>/Message/Compose an email message\" \"<alt>N\")\n"
4017 "(menu-path \"<Main>/Message/Reply\" \"<alt>R\")\n"
4018 "(menu-path \"<Main>/Message/Reply to/all\" \"<shift><alt>R\")\n"
4019 "(menu-path \"<Main>/Message/Reply to/sender\" \"<control><alt>R\")\n"
4020 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
4021 "(menu-path \"<Main>/Message/Forward\" \"<shift><alt>F\")\n"
4022 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift><control>F\")\n" */
4023 "(menu-path \"<Main>/Message/Move...\" \"<alt>O\")\n"
4024 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
4025 "(menu-path \"<Main>/Message/Delete\" \"<alt>D\")\n"
4026 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
4027 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
4028 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
4029 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
4031 "(menu-path \"<Main>/Tools/Address book\" \"<alt>A\")\n"
4032 "(menu-path \"<Main>/Tools/Execute\" \"<alt>X\")\n"
4033 "(menu-path \"<Main>/Tools/Log window\" \"<alt>L\")\n"
4035 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
4036 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
4037 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
4038 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
4039 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
4040 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
4041 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
4043 static gchar *empty_menurc =
4044 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
4045 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
4046 "(menu-path \"<Main>/File/Print...\" \"\")\n"
4047 "(menu-path \"<Main>/File/Exit\" \"\")\n"
4049 "(menu-path \"<Main>/Edit/Copy\" \"\")\n"
4050 "(menu-path \"<Main>/Edit/Select all\" \"\")\n"
4051 "(menu-path \"<Main>/Edit/Find in current message...\" \"\")\n"
4052 "(menu-path \"<Main>/Edit/Search folder...\" \"\")\n"
4054 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
4055 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
4056 "(menu-path \"<Main>/View/Thread view\" \"\")\n"
4057 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
4058 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
4059 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
4060 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
4061 "(menu-path \"<Main>/View/Go to/Other folder...\" \"\")\n"
4062 "(menu-path \"<Main>/View/Open in new window\" \"\")\n"
4063 "(menu-path \"<Main>/View/View source\" \"\")\n"
4064 "(menu-path \"<Main>/View/Show all headers\" \"\")\n"
4065 "(menu-path \"<Main>/View/Update\" \"\")\n"
4067 "(menu-path \"<Main>/Message/Get new mail\" \"\")\n"
4068 "(menu-path \"<Main>/Message/Get from all accounts\" \"\")\n"
4069 "(menu-path \"<Main>/Message/Compose an email message\" \"\")\n"
4070 "(menu-path \"<Main>/Message/Reply\" \"\")\n"
4071 "(menu-path \"<Main>/Message/Reply to/all\" \"\")\n"
4072 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
4073 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"\")\n"
4074 "(menu-path \"<Main>/Message/Forward\" \"\")\n"
4075 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
4076 "(menu-path \"<Main>/Message/Move...\" \"\")\n"
4077 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
4078 "(menu-path \"<Main>/Message/Delete\" \"\")\n"
4079 "(menu-path \"<Main>/Message/Mark/Mark\" \"\")\n"
4080 "(menu-path \"<Main>/Message/Mark/Unmark\" \"\")\n"
4081 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"\")\n"
4082 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
4084 "(menu-path \"<Main>/Tools/Address book\" \"\")\n"
4085 "(menu-path \"<Main>/Tools/Execute\" \"\")\n"
4086 "(menu-path \"<Main>/Tools/Log window\" \"\")\n"
4088 "(menu-path \"<Compose>/File/Close\" \"\")\n"
4089 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
4090 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
4091 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
4092 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
4093 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
4094 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
4096 text = gtk_entry_get_text(entry);
4098 if (!strcmp(text, _("Default")))
4099 rc_str = default_menurc;
4100 else if (!strcmp(text, "Mew / Wanderlust"))
4101 rc_str = mew_wl_menurc;
4102 else if (!strcmp(text, "Mutt"))
4103 rc_str = mutt_menurc;
4104 else if (!strcmp(text, _("Old Sylpheed")))
4105 rc_str = old_sylpheed_menurc;
4109 gtk_item_factory_parse_rc_string(empty_menurc);
4110 gtk_item_factory_parse_rc_string(rc_str);
4112 gtk_widget_destroy(keybind.window);
4113 keybind.window = NULL;
4114 keybind.combo = NULL;
4117 static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam)
4120 GtkWidget *menuitem;
4123 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4124 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4125 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
4126 g_free(*((gchar **)pparam->data));
4127 *((gchar **)pparam->data) = g_strdup(charset);
4130 static void prefs_common_charset_set_optmenu(PrefParam *pparam)
4132 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4135 g_return_if_fail(optmenu != NULL);
4136 g_return_if_fail(*((gchar **)pparam->data) != NULL);
4138 index = menu_find_option_menu_index(optmenu, *((gchar **)pparam->data),
4139 (GCompareFunc)strcmp);
4141 gtk_option_menu_set_history(optmenu, index);
4143 gtk_option_menu_set_history(optmenu, 0);
4144 prefs_common_charset_set_data_from_optmenu(pparam);
4148 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam)
4151 GtkWidget *menuitem;
4153 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4154 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4155 *((RecvDialogMode *)pparam->data) = GPOINTER_TO_INT
4156 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4159 static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
4161 RecvDialogMode mode = *((RecvDialogMode *)pparam->data);
4162 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4164 GtkWidget *menuitem;
4167 case RECV_DIALOG_ALWAYS:
4168 gtk_option_menu_set_history(optmenu, 0);
4170 case RECV_DIALOG_ACTIVE:
4171 gtk_option_menu_set_history(optmenu, 1);
4173 case RECV_DIALOG_NEVER:
4174 gtk_option_menu_set_history(optmenu, 2);
4180 menu = gtk_option_menu_get_menu(optmenu);
4181 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4182 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4185 static void prefs_common_send_dialog_set_data_from_optmenu(PrefParam *pparam)
4188 GtkWidget *menuitem;
4190 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4191 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4192 *((SendDialogMode *)pparam->data) = GPOINTER_TO_INT
4193 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4196 static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam)
4198 SendDialogMode mode = *((SendDialogMode *)pparam->data);
4199 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4201 GtkWidget *menuitem;
4204 case SEND_DIALOG_ALWAYS:
4205 gtk_option_menu_set_history(optmenu, 0);
4207 case SEND_DIALOG_NEVER:
4208 gtk_option_menu_set_history(optmenu, 1);
4214 menu = gtk_option_menu_get_menu(optmenu);
4215 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4216 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4219 static gint prefs_common_deleted(GtkWidget *widget, GdkEventAny *event,
4222 prefs_common_cancel();
4226 static void prefs_common_key_pressed(GtkWidget *widget, GdkEventKey *event,
4229 if (event && event->keyval == GDK_Escape)
4230 prefs_common_cancel();
4233 static void prefs_common_ok(void)
4235 prefs_common_apply();
4236 gtk_widget_hide(dialog.window);
4241 static void prefs_common_apply(void)
4243 gchar *entry_pixmap_theme_str;
4244 gboolean update_pixmap_theme;
4246 entry_pixmap_theme_str = gtk_entry_get_text(GTK_ENTRY(interface.entry_pixmap_theme));
4247 if (entry_pixmap_theme_str &&
4248 (strcmp(prefs_common.pixmap_theme_path, entry_pixmap_theme_str) != 0) )
4249 update_pixmap_theme = TRUE;
4251 update_pixmap_theme = FALSE;
4253 prefs_set_data_from_dialog(param);
4255 if (update_pixmap_theme)
4257 main_window_reflect_prefs_all_real(TRUE);
4258 compose_reflect_prefs_pixmap_theme();
4260 main_window_reflect_prefs_all_real(FALSE);
4262 prefs_common_save_config();
4264 inc_autocheck_timer_remove();
4265 inc_autocheck_timer_set();
4268 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam)
4271 GtkWidget *menuitem;
4273 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4274 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4275 *((NextUnreadMsgDialogShow *)pparam->data) = GPOINTER_TO_INT
4276 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4279 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam)
4281 NextUnreadMsgDialogShow dialog_show;
4282 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4284 GtkWidget *menuitem;
4286 dialog_show = *((NextUnreadMsgDialogShow *)pparam->data);
4288 switch (dialog_show) {
4289 case NEXTUNREADMSGDIALOG_ALWAYS:
4290 gtk_option_menu_set_history(optmenu, 0);
4292 case NEXTUNREADMSGDIALOG_ASSUME_YES:
4293 gtk_option_menu_set_history(optmenu, 1);
4295 case NEXTUNREADMSGDIALOG_ASSUME_NO:
4296 gtk_option_menu_set_history(optmenu, 2);
4300 menu = gtk_option_menu_get_menu(optmenu);
4301 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4302 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4305 static void prefs_common_cancel(void)
4307 gtk_widget_hide(dialog.window);
4312 /* static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
4315 GtkWidget *menuitem;
4317 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4318 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4319 *((RecvDialogShow *)pparam->data) = GPOINTER_TO_INT
4320 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4323 /* static void prefs_recvdialog_set_optmenu(PrefParam *pparam)
4325 RecvDialogShow dialog_show;
4326 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4328 GtkWidget *menuitem;
4330 dialog_show = *((RecvDialogShow *)pparam->data);
4332 switch (dialog_show) {
4333 case RECVDIALOG_ALWAYS:
4334 gtk_option_menu_set_history(optmenu, 0);
4336 case RECVDIALOG_WINDOW_ACTIVE:
4337 gtk_option_menu_set_history(optmenu, 1);
4339 case RECVDIALOG_NEVER:
4340 gtk_option_menu_set_history(optmenu, 2);
4345 menu = gtk_option_menu_get_menu(optmenu);
4346 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4347 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));