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"));
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 alternate dictionary makes switching\nwith the last used dictionary faster."));
1613 gtk_widget_show(help_label);
1614 gtk_box_pack_start(GTK_BOX(vbox_spell), help_label, FALSE, TRUE, 0);
1616 spell_table = gtk_table_new(4, 3, FALSE);
1617 gtk_container_set_border_width (GTK_CONTAINER (spell_table), VSPACING);
1618 gtk_table_set_row_spacings(GTK_TABLE(spell_table), 8);
1619 gtk_table_set_col_spacings(GTK_TABLE(spell_table), 8);
1621 gtk_box_pack_start(GTK_BOX(vbox_spell), spell_table, TRUE, TRUE, 0);
1623 label_aspell_path = gtk_label_new (_("Dictionaries path:"));
1624 gtk_misc_set_alignment(GTK_MISC(label_aspell_path), 1.0, 0.5);
1625 gtk_widget_show(label_aspell_path);
1626 gtk_table_attach (GTK_TABLE (spell_table), label_aspell_path, 0, 1, 0,
1627 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1629 hbox_aspell_path = gtk_hbox_new (FALSE, 8);
1630 gtk_table_attach (GTK_TABLE (spell_table), hbox_aspell_path, 1, 2, 0,
1631 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1632 gtk_widget_show(hbox_aspell_path);
1634 entry_aspell_path = gtk_entry_new();
1635 gtk_widget_show(entry_aspell_path);
1636 gtk_box_pack_start(GTK_BOX(hbox_aspell_path), entry_aspell_path, TRUE,
1639 gtk_widget_set_sensitive(entry_aspell_path, prefs_common.enable_aspell);
1641 btn_aspell_path = gtk_button_new_with_label(" ... ");
1642 gtk_widget_show(btn_aspell_path);
1643 gtk_box_pack_start(GTK_BOX(hbox_aspell_path), btn_aspell_path, FALSE, FALSE, 0);
1644 gtk_widget_set_sensitive(btn_aspell_path, prefs_common.enable_aspell);
1646 gtk_signal_connect(GTK_OBJECT(btn_aspell_path), "clicked",
1647 GTK_SIGNAL_FUNC(prefs_spelling_btn_aspell_path_clicked_cb),
1650 label_dictionary = gtk_label_new(_("Default dictionary:"));
1651 gtk_misc_set_alignment(GTK_MISC(label_dictionary), 1.0, 0.5);
1652 gtk_widget_show(label_dictionary);
1653 gtk_table_attach (GTK_TABLE (spell_table), label_dictionary, 0, 1, 1, 2,
1654 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1656 optmenu_dictionary = gtk_option_menu_new();
1657 gtk_widget_show(optmenu_dictionary);
1658 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_dictionary),
1659 gtkaspell_dictionary_option_menu_new(
1660 prefs_common.aspell_path));
1661 gtk_table_attach (GTK_TABLE (spell_table), optmenu_dictionary, 1, 2, 1,
1662 2, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1663 gtk_widget_set_sensitive(optmenu_dictionary, prefs_common.enable_aspell);
1665 /* Suggestion mode */
1666 sugmode_label = gtk_label_new(_("Default suggestion mode"));
1667 gtk_misc_set_alignment(GTK_MISC(sugmode_label), 1.0, 0.5);
1668 gtk_widget_show(sugmode_label);
1669 gtk_table_attach(GTK_TABLE (spell_table), sugmode_label, 0, 1, 2, 3,
1670 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1672 sugmode_optmenu = gtk_option_menu_new();
1673 gtk_widget_show(sugmode_optmenu);
1674 gtk_option_menu_set_menu(GTK_OPTION_MENU(sugmode_optmenu),
1675 gtkaspell_sugmode_option_menu_new(prefs_common.aspell_sugmode));
1676 gtk_table_attach(GTK_TABLE(spell_table), sugmode_optmenu, 1, 2, 2, 3,
1677 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1678 gtk_widget_set_sensitive(sugmode_optmenu, prefs_common.enable_aspell);
1681 color_label = gtk_label_new(_("Misspelled word color:"));
1682 gtk_misc_set_alignment(GTK_MISC(color_label), 1.0, 0.5);
1683 gtk_table_attach (GTK_TABLE (spell_table), color_label, 0, 1, 3, 4,
1684 GTK_FILL, GTK_SHRINK, 0, 0);
1685 gtk_widget_show(color_label);
1687 col_align = gtk_alignment_new(0.0, 0.5, 0, 0);
1688 gtk_widget_show(col_align);
1689 gtk_table_attach (GTK_TABLE (spell_table), col_align, 1, 2, 3, 4,
1690 GTK_FILL, GTK_SHRINK, 0, 0);
1692 spelling.misspelled_btn = gtk_button_new_with_label ("");
1693 set_button_bg_color(spelling.misspelled_btn,
1694 prefs_common.misspelled_col);
1695 gtk_widget_set_usize (spelling.misspelled_btn, 30, 20);
1696 gtk_widget_set_sensitive(spelling.misspelled_btn, prefs_common.enable_aspell);
1697 gtk_signal_connect (GTK_OBJECT (spelling.misspelled_btn), "clicked",
1698 GTK_SIGNAL_FUNC(quote_color_set_dialog), "Misspelled word");
1699 gtk_container_add(GTK_CONTAINER(col_align), spelling.misspelled_btn);
1702 spelling.checkbtn_enable_aspell = checkbtn_enable_aspell;
1703 spelling.entry_aspell_path = entry_aspell_path;
1704 spelling.btn_aspell_path = btn_aspell_path;
1705 spelling.optmenu_dictionary = optmenu_dictionary;
1706 spelling.optmenu_sugmode = sugmode_optmenu;
1707 spelling.checkbtn_use_alternate = checkbtn_use_alternate;
1708 spelling.checkbtn_check_while_typing = checkbtn_check_while_typing;
1714 static void prefs_compose_create(void)
1720 GtkWidget *frame_sig;
1721 GtkWidget *vbox_sig;
1722 GtkWidget *checkbtn_autosig;
1723 GtkWidget *label_sigsep;
1724 GtkWidget *entry_sigsep;
1726 GtkWidget *checkbtn_autoextedit;
1728 GtkWidget *frame_autosel;
1729 GtkWidget *hbox_autosel;
1730 GtkWidget *checkbtn_reply_account_autosel;
1731 GtkWidget *checkbtn_forward_account_autosel;
1732 GtkWidget *checkbtn_reedit_account_autosel;
1734 GtkWidget *hbox_undolevel;
1735 GtkWidget *label_undolevel;
1736 GtkObject *spinbtn_undolevel_adj;
1737 GtkWidget *spinbtn_undolevel;
1739 GtkWidget *vbox_linewrap;
1744 GtkWidget *label_linewrap;
1745 GtkObject *spinbtn_linewrap_adj;
1746 GtkWidget *spinbtn_linewrap;
1747 GtkWidget *checkbtn_wrapquote;
1748 GtkWidget *checkbtn_autowrap;
1749 GtkWidget *checkbtn_wrapatsend;
1751 GtkWidget *checkbtn_default_reply_list;
1753 GtkWidget *checkbtn_forward_as_attachment;
1754 GtkWidget *checkbtn_redirect_keep_from;
1755 GtkWidget *checkbtn_smart_wrapping;
1756 GtkWidget *checkbtn_block_cursor;
1757 GtkWidget *frame_msgwrap;
1759 GtkWidget *hbox_autosave;
1760 GtkWidget *checkbtn_autosave;
1761 GtkWidget *entry_autosave_length;
1762 GtkWidget *label_autosave_length;
1764 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1765 gtk_widget_show (vbox1);
1766 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1767 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1769 PACK_FRAME(vbox1, frame_sig, _("Signature"));
1771 vbox_sig = gtk_vbox_new (FALSE, VSPACING_NARROW);
1772 gtk_widget_show (vbox_sig);
1773 gtk_container_add (GTK_CONTAINER (frame_sig), vbox_sig);
1774 gtk_container_set_border_width (GTK_CONTAINER (vbox_sig), 8);
1776 PACK_CHECK_BUTTON (vbox_sig, checkbtn_autosig,
1777 _("Insert signature automatically"));
1779 hbox1 = gtk_hbox_new (FALSE, 8);
1780 gtk_widget_show (hbox1);
1781 gtk_box_pack_start (GTK_BOX (vbox_sig), hbox1, TRUE, TRUE, 0);
1782 label_sigsep = gtk_label_new (_("Signature separator"));
1783 gtk_widget_show (label_sigsep);
1784 gtk_box_pack_start (GTK_BOX (hbox1), label_sigsep, FALSE, FALSE, 0);
1786 entry_sigsep = gtk_entry_new ();
1787 gtk_widget_show (entry_sigsep);
1788 gtk_box_pack_start (GTK_BOX (hbox1), entry_sigsep, FALSE, FALSE, 0);
1790 gtk_widget_set_usize (entry_sigsep, 64, -1);
1792 /* Account autoselection */
1793 PACK_FRAME(vbox1, frame_autosel, _("Automatic account selection"));
1795 hbox_autosel = gtk_hbox_new (FALSE, VSPACING_NARROW);
1796 gtk_widget_show (hbox_autosel);
1797 gtk_container_add (GTK_CONTAINER (frame_autosel), hbox_autosel);
1798 gtk_container_set_border_width (GTK_CONTAINER (hbox_autosel), 8);
1800 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reply_account_autosel,
1801 _("when replying"));
1802 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_forward_account_autosel,
1803 _("when forwarding"));
1804 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reedit_account_autosel,
1805 _("when re-editing"));
1807 vbox2 = gtk_vbox_new (FALSE, 0);
1808 gtk_widget_show (vbox2);
1809 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1811 PACK_CHECK_BUTTON (vbox2, checkbtn_default_reply_list,
1812 _("Reply button invokes mailing list reply"));
1814 PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
1815 _("Automatically launch the external editor"));
1817 hbox5 = gtk_hbox_new (FALSE, 8);
1818 gtk_widget_show (hbox5);
1819 gtk_box_pack_start (GTK_BOX (vbox2), hbox5, FALSE, FALSE, 0);
1821 PACK_CHECK_BUTTON (hbox5, checkbtn_forward_as_attachment,
1822 _("Forward as attachment"));
1824 PACK_CHECK_BUTTON (hbox5, checkbtn_block_cursor,
1827 PACK_CHECK_BUTTON (vbox2, checkbtn_redirect_keep_from,
1828 _("Keep the original 'From' header when redirecting"));
1831 hbox_autosave = gtk_hbox_new (FALSE, 8);
1832 gtk_widget_show (hbox_autosave);
1833 gtk_box_pack_start (GTK_BOX (vbox1), hbox_autosave, FALSE, FALSE, 0);
1835 PACK_CHECK_BUTTON (hbox_autosave, checkbtn_autosave,
1836 _("Autosave to drafts every "));
1838 entry_autosave_length = gtk_entry_new();
1839 gtk_widget_set_usize (entry_autosave_length, 64, -1);
1840 gtk_widget_show (entry_autosave_length);
1841 gtk_box_pack_start (GTK_BOX (hbox_autosave), entry_autosave_length, FALSE, FALSE, 0);
1843 label_autosave_length = gtk_label_new(_("characters"));
1844 gtk_widget_show (label_autosave_length);
1845 gtk_box_pack_start (GTK_BOX (hbox_autosave), label_autosave_length, FALSE, FALSE, 0);
1847 hbox_undolevel = gtk_hbox_new (FALSE, 8);
1848 gtk_widget_show (hbox_undolevel);
1849 gtk_box_pack_start (GTK_BOX (vbox1), hbox_undolevel, FALSE, FALSE, 0);
1851 label_undolevel = gtk_label_new (_("Undo level"));
1852 gtk_widget_show (label_undolevel);
1853 gtk_box_pack_start (GTK_BOX (hbox_undolevel), label_undolevel, FALSE, FALSE, 0);
1855 spinbtn_undolevel_adj = gtk_adjustment_new (50, 0, 100, 1, 10, 10);
1856 spinbtn_undolevel = gtk_spin_button_new
1857 (GTK_ADJUSTMENT (spinbtn_undolevel_adj), 1, 0);
1858 gtk_widget_show (spinbtn_undolevel);
1859 gtk_box_pack_start (GTK_BOX (hbox_undolevel), spinbtn_undolevel, FALSE, FALSE, 0);
1860 gtk_widget_set_usize (spinbtn_undolevel, 64, -1);
1861 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevel), TRUE);
1864 PACK_FRAME(vbox1, frame_msgwrap, _("Message wrapping"));
1866 vbox_linewrap = gtk_vbox_new (FALSE, VSPACING_NARROW);
1867 gtk_widget_show (vbox_linewrap);
1868 gtk_container_add (GTK_CONTAINER (frame_msgwrap), vbox_linewrap);
1869 gtk_container_set_border_width (GTK_CONTAINER (vbox_linewrap), 8);
1871 hbox3 = gtk_hbox_new (FALSE, 8);
1872 gtk_widget_show (hbox3);
1873 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox3, FALSE, FALSE, 0);
1876 label_linewrap = gtk_label_new (_("Wrap messages at"));
1877 gtk_widget_show (label_linewrap);
1878 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1880 spinbtn_linewrap_adj = gtk_adjustment_new (72, 20, 1024, 1, 10, 10);
1881 spinbtn_linewrap = gtk_spin_button_new
1882 (GTK_ADJUSTMENT (spinbtn_linewrap_adj), 1, 0);
1883 gtk_widget_show (spinbtn_linewrap);
1884 gtk_box_pack_start (GTK_BOX (hbox3), spinbtn_linewrap, FALSE, FALSE, 0);
1885 gtk_widget_set_usize (spinbtn_linewrap, 64, -1);
1886 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linewrap), TRUE);
1888 label_linewrap = gtk_label_new (_("characters"));
1889 gtk_widget_show (label_linewrap);
1890 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1892 hbox4 = gtk_hbox_new (FALSE, VSPACING);
1893 gtk_widget_show (hbox4);
1894 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox4, FALSE, FALSE, 0);
1896 PACK_CHECK_BUTTON (hbox4, checkbtn_wrapquote, _("Wrap quotation"));
1898 PACK_CHECK_BUTTON (hbox4, checkbtn_autowrap, _("Wrap on input"));
1901 (hbox4, checkbtn_wrapatsend, _("Wrap before sending"));
1903 PACK_CHECK_BUTTON (vbox_linewrap, checkbtn_smart_wrapping,
1904 _("Smart wrapping (EXPERIMENTAL)"));
1907 compose.checkbtn_quote = checkbtn_quote;
1908 compose.entry_quotemark = entry_quotemark;
1909 compose.text_quotefmt = text_quotefmt;
1911 compose.checkbtn_autosig = checkbtn_autosig;
1912 compose.entry_sigsep = entry_sigsep;
1914 compose.checkbtn_autoextedit = checkbtn_autoextedit;
1916 compose.checkbtn_reply_account_autosel = checkbtn_reply_account_autosel;
1917 compose.checkbtn_forward_account_autosel = checkbtn_forward_account_autosel;
1918 compose.checkbtn_reedit_account_autosel = checkbtn_reedit_account_autosel;
1920 compose.spinbtn_undolevel = spinbtn_undolevel;
1921 compose.spinbtn_undolevel_adj = spinbtn_undolevel_adj;
1923 compose.spinbtn_linewrap = spinbtn_linewrap;
1924 compose.spinbtn_linewrap_adj = spinbtn_linewrap_adj;
1925 compose.checkbtn_wrapquote = checkbtn_wrapquote;
1926 compose.checkbtn_autowrap = checkbtn_autowrap;
1927 compose.checkbtn_wrapatsend = checkbtn_wrapatsend;
1929 compose.checkbtn_autosave = checkbtn_autosave;
1930 compose.entry_autosave_length = entry_autosave_length;
1932 compose.checkbtn_forward_as_attachment =
1933 checkbtn_forward_as_attachment;
1934 compose.checkbtn_redirect_keep_from =
1935 checkbtn_redirect_keep_from;
1936 compose.checkbtn_smart_wrapping =
1937 checkbtn_smart_wrapping;
1938 compose.checkbtn_block_cursor =
1939 checkbtn_block_cursor;
1940 compose.checkbtn_default_reply_list = checkbtn_default_reply_list;
1943 static void prefs_quote_create(void)
1946 GtkWidget *frame_quote;
1947 GtkWidget *vbox_quote;
1950 GtkWidget *label_quotemark;
1951 GtkWidget *entry_quotemark;
1952 GtkWidget *scrolledwin_quotefmt;
1953 GtkWidget *text_quotefmt;
1955 GtkWidget *entry_fw_quotemark;
1956 GtkWidget *text_fw_quotefmt;
1958 GtkWidget *entry_quote_chars;
1959 GtkWidget *label_quote_chars;
1961 GtkWidget *btn_quotedesc;
1963 GtkWidget *checkbtn_reply_with_quote;
1965 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1966 gtk_widget_show (vbox1);
1967 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1968 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1972 PACK_CHECK_BUTTON (vbox1, checkbtn_reply_with_quote, _("Reply will quote by default"));
1974 PACK_FRAME (vbox1, frame_quote, _("Reply format"));
1976 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
1977 gtk_widget_show (vbox_quote);
1978 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
1979 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
1981 hbox1 = gtk_hbox_new (FALSE, 32);
1982 gtk_widget_show (hbox1);
1983 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
1985 hbox2 = gtk_hbox_new (FALSE, 8);
1986 gtk_widget_show (hbox2);
1987 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
1989 label_quotemark = gtk_label_new (_("Quotation mark"));
1990 gtk_widget_show (label_quotemark);
1991 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
1993 entry_quotemark = gtk_entry_new ();
1994 gtk_widget_show (entry_quotemark);
1995 gtk_box_pack_start (GTK_BOX (hbox2), entry_quotemark, FALSE, FALSE, 0);
1996 gtk_widget_set_usize (entry_quotemark, 64, -1);
1998 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
1999 gtk_widget_show (scrolledwin_quotefmt);
2000 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
2001 gtk_scrolled_window_set_policy
2002 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
2003 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
2005 text_quotefmt = gtk_text_new (NULL, NULL);
2006 gtk_widget_show (text_quotefmt);
2007 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt), text_quotefmt);
2008 gtk_text_set_editable (GTK_TEXT (text_quotefmt), TRUE);
2009 gtk_widget_set_usize(text_quotefmt, -1, 60);
2013 PACK_FRAME (vbox1, frame_quote, _("Forward format"));
2015 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
2016 gtk_widget_show (vbox_quote);
2017 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
2018 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
2020 hbox1 = gtk_hbox_new (FALSE, 32);
2021 gtk_widget_show (hbox1);
2022 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
2024 hbox2 = gtk_hbox_new (FALSE, 8);
2025 gtk_widget_show (hbox2);
2026 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
2028 label_quotemark = gtk_label_new (_("Quotation mark"));
2029 gtk_widget_show (label_quotemark);
2030 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
2032 entry_fw_quotemark = gtk_entry_new ();
2033 gtk_widget_show (entry_fw_quotemark);
2034 gtk_box_pack_start (GTK_BOX (hbox2), entry_fw_quotemark,
2036 gtk_widget_set_usize (entry_fw_quotemark, 64, -1);
2038 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
2039 gtk_widget_show (scrolledwin_quotefmt);
2040 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
2041 gtk_scrolled_window_set_policy
2042 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
2043 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
2045 text_fw_quotefmt = gtk_text_new (NULL, NULL);
2046 gtk_widget_show (text_fw_quotefmt);
2047 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt),
2049 gtk_text_set_editable (GTK_TEXT (text_fw_quotefmt), TRUE);
2050 gtk_widget_set_usize(text_fw_quotefmt, -1, 60);
2052 hbox1 = gtk_hbox_new (FALSE, 32);
2053 gtk_widget_show (hbox1);
2054 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2057 gtk_button_new_with_label (_(" Description of symbols "));
2058 gtk_widget_show (btn_quotedesc);
2059 gtk_box_pack_start (GTK_BOX (hbox1), btn_quotedesc, FALSE, FALSE, 0);
2060 gtk_signal_connect(GTK_OBJECT(btn_quotedesc), "clicked",
2061 GTK_SIGNAL_FUNC(quote_fmt_quote_description), NULL);
2065 PACK_FRAME (vbox1, frame_quote, _("Quoting characters"));
2067 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
2068 gtk_widget_show (vbox_quote);
2069 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
2070 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
2072 hbox1 = gtk_hbox_new (FALSE, 32);
2073 gtk_widget_show (hbox1);
2074 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
2076 hbox2 = gtk_hbox_new (FALSE, 8);
2077 gtk_widget_show (hbox2);
2078 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
2080 label_quote_chars = gtk_label_new (_("Treat these characters as quotation marks: "));
2081 gtk_widget_show (label_quote_chars);
2082 gtk_box_pack_start (GTK_BOX (hbox2), label_quote_chars, FALSE, FALSE, 0);
2084 entry_quote_chars = gtk_entry_new ();
2085 gtk_widget_show (entry_quote_chars);
2086 gtk_box_pack_start (GTK_BOX (hbox2), entry_quote_chars,
2088 gtk_widget_set_usize (entry_quote_chars, 64, -1);
2091 compose.checkbtn_reply_with_quote= checkbtn_reply_with_quote;
2092 quote.entry_quotemark = entry_quotemark;
2093 quote.text_quotefmt = text_quotefmt;
2094 quote.entry_fw_quotemark = entry_fw_quotemark;
2095 quote.text_fw_quotefmt = text_fw_quotefmt;
2096 quote.entry_quote_chars = entry_quote_chars;
2099 static void prefs_display_create(void)
2102 GtkWidget *frame_font;
2104 GtkWidget *label_textfont;
2105 GtkWidget *entry_textfont;
2106 GtkWidget *button_textfont;
2107 GtkWidget *chkbtn_transhdr;
2108 GtkWidget *chkbtn_folder_unread;
2110 GtkWidget *label_ng_abbrev;
2111 GtkWidget *spinbtn_ng_abbrev_len;
2112 GtkObject *spinbtn_ng_abbrev_len_adj;
2113 GtkWidget *frame_summary;
2115 GtkWidget *chkbtn_swapfrom;
2116 GtkWidget *chkbtn_useaddrbook;
2117 GtkWidget *chkbtn_expand_thread;
2119 GtkWidget *label_datefmt;
2120 GtkWidget *button_datefmt;
2121 GtkWidget *entry_datefmt;
2122 GtkWidget *button_dispitem;
2123 GtkWidget *tmplabel, *tmpbutton, *tmpentry;
2125 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2126 gtk_widget_show (vbox1);
2127 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2128 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2130 PACK_FRAME(vbox1, frame_font, _("Font"));
2132 table1 = gtk_table_new (4, 3, FALSE);
2134 gtk_widget_show (table1);
2135 gtk_container_add (GTK_CONTAINER (frame_font), table1);
2136 gtk_container_set_border_width (GTK_CONTAINER (table1), 8);
2137 gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
2138 gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
2140 label_textfont = gtk_label_new (_("Text"));
2141 gtk_misc_set_alignment(GTK_MISC(label_textfont), 0, 0.5);
2142 gtk_widget_show (label_textfont);
2143 gtk_table_attach (GTK_TABLE (table1), label_textfont, 0, 1, 0, 1,
2144 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2146 entry_textfont = gtk_entry_new ();
2147 gtk_widget_show (entry_textfont);
2148 gtk_table_attach (GTK_TABLE (table1), entry_textfont, 1, 2, 0, 1,
2149 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2151 button_textfont = gtk_button_new_with_label (" ... ");
2153 gtk_widget_show (button_textfont);
2154 gtk_table_attach (GTK_TABLE (table1), button_textfont, 2, 3, 0, 1,
2156 gtk_signal_connect (GTK_OBJECT (button_textfont), "clicked",
2157 GTK_SIGNAL_FUNC (prefs_font_select), entry_textfont);
2159 tmplabel = gtk_label_new (_("Small"));
2160 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2161 gtk_widget_show (tmplabel);
2162 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 1, 2,
2163 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2165 tmpentry = gtk_entry_new ();
2166 gtk_widget_show (tmpentry);
2167 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 1, 2,
2168 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2170 tmpbutton = gtk_button_new_with_label (" ... ");
2171 gtk_widget_show (tmpbutton);
2172 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 1, 2,
2174 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2175 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2176 display.entry_smallfont = tmpentry;
2178 tmplabel = gtk_label_new (_("Normal"));
2179 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2180 gtk_widget_show (tmplabel);
2181 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 2, 3,
2182 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2184 tmpentry = gtk_entry_new ();
2185 gtk_widget_show (tmpentry);
2186 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 2, 3,
2187 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2189 tmpbutton = gtk_button_new_with_label (" ... ");
2190 gtk_widget_show (tmpbutton);
2191 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 2, 3,
2193 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2194 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2195 display.entry_normalfont = tmpentry;
2197 tmplabel = gtk_label_new (_("Bold"));
2198 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2199 gtk_widget_show (tmplabel);
2200 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 3, 4,
2201 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2203 tmpentry = gtk_entry_new ();
2204 gtk_widget_show (tmpentry);
2205 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 3, 4,
2206 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2208 tmpbutton = gtk_button_new_with_label (" ... ");
2209 gtk_widget_show (tmpbutton);
2210 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 3, 4,
2212 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2213 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2214 display.entry_boldfont = tmpentry;
2216 vbox2 = gtk_vbox_new (FALSE, 0);
2217 gtk_widget_show (vbox2);
2218 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, TRUE, 0);
2221 (vbox2, chkbtn_transhdr,
2222 _("Translate header name (such as `From:', `Subject:')"));
2224 PACK_CHECK_BUTTON (vbox2, chkbtn_folder_unread,
2225 _("Display unread number next to folder name"));
2227 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2229 hbox1 = gtk_hbox_new (FALSE, 8);
2230 gtk_widget_show (hbox1);
2231 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2233 label_ng_abbrev = gtk_label_new
2234 (_("Abbreviate newsgroups longer than"));
2235 gtk_widget_show (label_ng_abbrev);
2236 gtk_box_pack_start (GTK_BOX (hbox1), label_ng_abbrev, FALSE, FALSE, 0);
2238 spinbtn_ng_abbrev_len_adj = gtk_adjustment_new (16, 0, 999, 1, 10, 10);
2239 spinbtn_ng_abbrev_len = gtk_spin_button_new
2240 (GTK_ADJUSTMENT (spinbtn_ng_abbrev_len_adj), 1, 0);
2241 gtk_widget_show (spinbtn_ng_abbrev_len);
2242 gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_ng_abbrev_len,
2244 gtk_widget_set_usize (spinbtn_ng_abbrev_len, 56, -1);
2245 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_ng_abbrev_len),
2248 label_ng_abbrev = gtk_label_new
2250 gtk_widget_show (label_ng_abbrev);
2251 gtk_box_pack_start (GTK_BOX (hbox1), label_ng_abbrev, FALSE, FALSE, 0);
2253 /* ---- Summary ---- */
2255 PACK_FRAME(vbox1, frame_summary, _("Summary View"));
2257 vbox2 = gtk_vbox_new (FALSE, 0);
2258 gtk_widget_show (vbox2);
2259 gtk_container_add (GTK_CONTAINER (frame_summary), vbox2);
2260 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
2263 (vbox2, chkbtn_swapfrom,
2264 _("Display recipient on `From' column if sender is yourself"));
2266 (vbox2, chkbtn_useaddrbook,
2267 _("Display sender using address book"));
2269 (vbox2, chkbtn_expand_thread, _("Expand threads"));
2271 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2273 hbox1 = gtk_hbox_new (FALSE, 8);
2274 gtk_widget_show (hbox1);
2275 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2277 label_datefmt = gtk_label_new (_("Date format"));
2278 gtk_widget_show (label_datefmt);
2279 gtk_box_pack_start (GTK_BOX (hbox1), label_datefmt, FALSE, FALSE, 0);
2281 entry_datefmt = gtk_entry_new ();
2282 gtk_widget_show (entry_datefmt);
2283 gtk_box_pack_start (GTK_BOX (hbox1), entry_datefmt, TRUE, TRUE, 0);
2285 button_datefmt = gtk_button_new_with_label (" ... ");
2287 gtk_widget_show (button_datefmt);
2288 gtk_box_pack_start (GTK_BOX (hbox1), button_datefmt, FALSE, FALSE, 0);
2289 gtk_signal_connect (GTK_OBJECT (button_datefmt), "clicked",
2290 GTK_SIGNAL_FUNC (date_format_create), NULL);
2292 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
2294 hbox1 = gtk_hbox_new (FALSE, 8);
2295 gtk_widget_show (hbox1);
2296 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2298 button_dispitem = gtk_button_new_with_label
2299 (_(" Set displayed items of summary... "));
2300 gtk_widget_show (button_dispitem);
2301 gtk_box_pack_start (GTK_BOX (hbox1), button_dispitem, FALSE, TRUE, 0);
2302 gtk_signal_connect (GTK_OBJECT (button_dispitem), "clicked",
2303 GTK_SIGNAL_FUNC (prefs_summary_column_open),
2306 display.entry_textfont = entry_textfont;
2307 display.button_textfont = button_textfont;
2309 display.chkbtn_transhdr = chkbtn_transhdr;
2310 display.chkbtn_folder_unread = chkbtn_folder_unread;
2311 display.spinbtn_ng_abbrev_len = spinbtn_ng_abbrev_len;
2312 display.spinbtn_ng_abbrev_len_adj = spinbtn_ng_abbrev_len_adj;
2314 display.chkbtn_swapfrom = chkbtn_swapfrom;
2315 display.chkbtn_expand_thread = chkbtn_expand_thread;
2316 display.chkbtn_useaddrbook = chkbtn_useaddrbook;
2317 display.entry_datefmt = entry_datefmt;
2320 static void prefs_message_create(void)
2326 GtkWidget *chkbtn_enablecol;
2327 GtkWidget *button_edit_col;
2328 GtkWidget *chkbtn_mbalnum;
2329 GtkWidget *chkbtn_disphdrpane;
2330 GtkWidget *chkbtn_disphdr;
2331 GtkWidget *button_edit_disphdr;
2332 GtkWidget *hbox_linespc;
2333 GtkWidget *label_linespc;
2334 GtkObject *spinbtn_linespc_adj;
2335 GtkWidget *spinbtn_linespc;
2336 GtkWidget *chkbtn_headspc;
2338 GtkWidget *frame_scr;
2339 GtkWidget *vbox_scr;
2340 GtkWidget *chkbtn_smoothscroll;
2341 GtkWidget *hbox_scr;
2342 GtkWidget *label_scr;
2343 GtkObject *spinbtn_scrollstep_adj;
2344 GtkWidget *spinbtn_scrollstep;
2345 GtkWidget *chkbtn_halfpage;
2347 GtkWidget *chkbtn_display_img;
2348 GtkWidget *chkbtn_resize_image;
2350 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2351 gtk_widget_show (vbox1);
2352 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2353 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2355 vbox2 = gtk_vbox_new (FALSE, 0);
2356 gtk_widget_show (vbox2);
2357 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2359 hbox1 = gtk_hbox_new (FALSE, 8);
2360 gtk_widget_show (hbox1);
2361 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2363 PACK_CHECK_BUTTON (hbox1, chkbtn_enablecol,
2364 _("Enable coloration of message"));
2365 gtk_signal_connect (GTK_OBJECT (chkbtn_enablecol), "toggled",
2366 GTK_SIGNAL_FUNC (prefs_enable_message_color_toggled),
2369 button_edit_col = gtk_button_new_with_label (_(" Edit... "));
2370 gtk_widget_show (button_edit_col);
2371 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_col, FALSE, TRUE, 0);
2372 gtk_signal_connect (GTK_OBJECT (button_edit_col), "clicked",
2373 GTK_SIGNAL_FUNC (prefs_quote_colors_dialog), NULL);
2375 SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, button_edit_col);
2378 (vbox2, chkbtn_mbalnum,
2379 _("Display multi-byte alphabet and numeric as\n"
2380 "ASCII character (Japanese only)"));
2381 gtk_label_set_justify (GTK_LABEL (GTK_BIN(chkbtn_mbalnum)->child),
2384 PACK_CHECK_BUTTON(vbox2, chkbtn_disphdrpane,
2385 _("Display header pane above message view"));
2387 hbox1 = gtk_hbox_new (FALSE, 8);
2388 gtk_widget_show (hbox1);
2389 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2391 PACK_CHECK_BUTTON(hbox1, chkbtn_disphdr,
2392 _("Display short headers on message view"));
2394 button_edit_disphdr = gtk_button_new_with_label (_(" Edit... "));
2395 gtk_widget_show (button_edit_disphdr);
2396 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_disphdr,
2398 gtk_signal_connect (GTK_OBJECT (button_edit_disphdr), "clicked",
2399 GTK_SIGNAL_FUNC (prefs_display_header_open),
2402 SET_TOGGLE_SENSITIVITY(chkbtn_disphdr, button_edit_disphdr);
2404 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2406 hbox1 = gtk_hbox_new (FALSE, 32);
2407 gtk_widget_show (hbox1);
2408 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2410 hbox_linespc = gtk_hbox_new (FALSE, 8);
2411 gtk_widget_show (hbox1);
2412 gtk_box_pack_start (GTK_BOX (hbox1), hbox_linespc, FALSE, TRUE, 0);
2414 label_linespc = gtk_label_new (_("Line space"));
2415 gtk_widget_show (label_linespc);
2416 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2419 spinbtn_linespc_adj = gtk_adjustment_new (2, 0, 16, 1, 1, 16);
2420 spinbtn_linespc = gtk_spin_button_new
2421 (GTK_ADJUSTMENT (spinbtn_linespc_adj), 1, 0);
2422 gtk_widget_show (spinbtn_linespc);
2423 gtk_box_pack_start (GTK_BOX (hbox_linespc), spinbtn_linespc,
2425 gtk_widget_set_usize (spinbtn_linespc, 64, -1);
2426 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linespc), TRUE);
2428 label_linespc = gtk_label_new (_("pixel(s)"));
2429 gtk_widget_show (label_linespc);
2430 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2433 PACK_CHECK_BUTTON(hbox1, chkbtn_headspc, _("Leave space on head"));
2435 PACK_FRAME(vbox1, frame_scr, _("Scroll"));
2437 vbox_scr = gtk_vbox_new (FALSE, 0);
2438 gtk_widget_show (vbox_scr);
2439 gtk_container_add (GTK_CONTAINER (frame_scr), vbox_scr);
2440 gtk_container_set_border_width (GTK_CONTAINER (vbox_scr), 8);
2442 PACK_CHECK_BUTTON(vbox_scr, chkbtn_halfpage, _("Half page"));
2444 hbox1 = gtk_hbox_new (FALSE, 32);
2445 gtk_widget_show (hbox1);
2446 gtk_box_pack_start (GTK_BOX (vbox_scr), hbox1, FALSE, TRUE, 0);
2448 PACK_CHECK_BUTTON(hbox1, chkbtn_smoothscroll, _("Smooth scroll"));
2450 hbox_scr = gtk_hbox_new (FALSE, 8);
2451 gtk_widget_show (hbox_scr);
2452 gtk_box_pack_start (GTK_BOX (hbox1), hbox_scr, FALSE, FALSE, 0);
2454 label_scr = gtk_label_new (_("Step"));
2455 gtk_widget_show (label_scr);
2456 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2458 spinbtn_scrollstep_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 10);
2459 spinbtn_scrollstep = gtk_spin_button_new
2460 (GTK_ADJUSTMENT (spinbtn_scrollstep_adj), 1, 0);
2461 gtk_widget_show (spinbtn_scrollstep);
2462 gtk_box_pack_start (GTK_BOX (hbox_scr), spinbtn_scrollstep,
2464 gtk_widget_set_usize (spinbtn_scrollstep, 64, -1);
2465 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_scrollstep),
2468 label_scr = gtk_label_new (_("pixel(s)"));
2469 gtk_widget_show (label_scr);
2470 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2472 SET_TOGGLE_SENSITIVITY (chkbtn_smoothscroll, hbox_scr)
2474 vbox3 = gtk_vbox_new (FALSE, 0);
2475 gtk_widget_show (vbox3);
2476 gtk_box_pack_start (GTK_BOX (vbox1), vbox3, FALSE, FALSE, 0);
2478 PACK_CHECK_BUTTON(vbox3, chkbtn_display_img,
2479 _("Automatically display attached images"));
2481 PACK_CHECK_BUTTON(vbox3, chkbtn_resize_image,
2482 _("Resize attached images"));
2484 message.chkbtn_enablecol = chkbtn_enablecol;
2485 message.button_edit_col = button_edit_col;
2486 message.chkbtn_mbalnum = chkbtn_mbalnum;
2487 message.chkbtn_disphdrpane = chkbtn_disphdrpane;
2488 message.chkbtn_disphdr = chkbtn_disphdr;
2489 message.spinbtn_linespc = spinbtn_linespc;
2490 message.chkbtn_headspc = chkbtn_headspc;
2492 message.chkbtn_smoothscroll = chkbtn_smoothscroll;
2493 message.spinbtn_scrollstep = spinbtn_scrollstep;
2494 message.spinbtn_scrollstep_adj = spinbtn_scrollstep_adj;
2495 message.chkbtn_halfpage = chkbtn_halfpage;
2497 message.chkbtn_display_img = chkbtn_display_img;
2498 message.chkbtn_resize_image = chkbtn_resize_image;
2502 static void prefs_privacy_create(void)
2508 GtkWidget *hbox_spc;
2510 GtkWidget *checkbtn_auto_check_signatures;
2511 GtkWidget *checkbtn_gpg_signature_popup;
2512 GtkWidget *checkbtn_store_passphrase;
2513 GtkObject *spinbtn_store_passphrase_adj;
2514 GtkWidget *spinbtn_store_passphrase;
2515 GtkWidget *checkbtn_passphrase_grab;
2516 GtkWidget *checkbtn_gpg_warning;
2518 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2519 gtk_widget_show (vbox1);
2520 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2521 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2523 vbox2 = gtk_vbox_new (FALSE, 0);
2524 gtk_widget_show (vbox2);
2525 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2527 PACK_CHECK_BUTTON (vbox2, checkbtn_auto_check_signatures,
2528 _("Automatically check signatures"));
2530 PACK_CHECK_BUTTON (vbox2, checkbtn_gpg_signature_popup,
2531 _("Show signature check result in a popup window"));
2533 PACK_CHECK_BUTTON (vbox2, checkbtn_store_passphrase,
2534 _("Store passphrase in memory temporarily"));
2536 vbox3 = gtk_vbox_new (FALSE, 0);
2537 gtk_widget_show (vbox3);
2538 gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
2540 hbox1 = gtk_hbox_new (FALSE, 8);
2541 gtk_widget_show (hbox1);
2542 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2544 hbox_spc = gtk_hbox_new (FALSE, 0);
2545 gtk_widget_show (hbox_spc);
2546 gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
2547 gtk_widget_set_usize (hbox_spc, 12, -1);
2549 label = gtk_label_new (_("Expire after"));
2550 gtk_widget_show (label);
2551 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2553 spinbtn_store_passphrase_adj = gtk_adjustment_new (0, 0, 1440, 1, 5, 5);
2554 spinbtn_store_passphrase = gtk_spin_button_new
2555 (GTK_ADJUSTMENT (spinbtn_store_passphrase_adj), 1, 0);
2556 gtk_widget_show (spinbtn_store_passphrase);
2557 gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_store_passphrase, FALSE, FALSE, 0);
2558 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_store_passphrase),
2560 gtk_widget_set_usize (spinbtn_store_passphrase, 64, -1);
2562 label = gtk_label_new (_("minute(s) "));
2563 gtk_widget_show (label);
2564 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2566 hbox1 = gtk_hbox_new (FALSE, 8);
2567 gtk_widget_show (hbox1);
2568 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2570 hbox_spc = gtk_hbox_new (FALSE, 0);
2571 gtk_widget_show (hbox_spc);
2572 gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
2573 gtk_widget_set_usize (hbox_spc, 12, -1);
2575 label = gtk_label_new (_("(Setting to '0' will store the passphrase\n"
2576 " for the whole session)"));
2577 gtk_widget_show (label);
2578 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2579 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
2581 SET_TOGGLE_SENSITIVITY (checkbtn_store_passphrase, vbox3);
2584 PACK_CHECK_BUTTON (vbox2, checkbtn_passphrase_grab,
2585 _("Grab input while entering a passphrase"));
2589 (vbox2, checkbtn_gpg_warning,
2590 _("Display warning on startup if GnuPG doesn't work"));
2592 hbox1 = gtk_hbox_new (FALSE, 8);
2593 gtk_widget_show (hbox1);
2594 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2596 privacy.checkbtn_auto_check_signatures
2597 = checkbtn_auto_check_signatures;
2598 privacy.checkbtn_gpg_signature_popup
2599 = checkbtn_gpg_signature_popup;
2600 privacy.checkbtn_store_passphrase = checkbtn_store_passphrase;
2601 privacy.spinbtn_store_passphrase = spinbtn_store_passphrase;
2602 privacy.spinbtn_store_passphrase_adj = spinbtn_store_passphrase_adj;
2603 privacy.checkbtn_passphrase_grab = checkbtn_passphrase_grab;
2604 privacy.checkbtn_gpg_warning = checkbtn_gpg_warning;
2606 #endif /* USE_GPGME */
2608 static void prefs_interface_create(void)
2613 /* GtkWidget *checkbtn_emacs; */
2614 GtkWidget *checkbtn_show_msg_with_cursor;
2615 GtkWidget *checkbtn_openunread;
2616 GtkWidget *checkbtn_mark_as_read_on_newwin;
2617 GtkWidget *checkbtn_openinbox;
2618 GtkWidget *checkbtn_immedexec;
2619 GtkWidget *frame_dialogs;
2620 GtkWidget *vbox_dialogs;
2623 GtkWidget *dialogs_table;
2624 GtkWidget *optmenu_recvdialog;
2625 GtkWidget *optmenu_senddialog;
2627 GtkWidget *menuitem;
2628 GtkWidget *checkbtn_no_recv_err_panel;
2629 GtkWidget *checkbtn_close_recv_dialog;
2631 GtkWidget *button_keybind;
2634 GtkWidget *optmenu_nextunreadmsgdialog;
2635 GtkWidget *optmenu_nextunreadmsgdialog_menu;
2636 GtkWidget *nextunreadmsgdialog_menuitem;
2638 GtkWidget *frame_pixmap_theme;
2639 GtkWidget *vbox_pixmap_theme;
2640 GtkWidget *entry_pixmap_theme;
2641 GtkWidget *combo_pixmap_theme;
2642 GList *avail_pixmap_themes = NULL;
2644 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2645 gtk_widget_show (vbox1);
2646 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2647 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2649 vbox2 = gtk_vbox_new (FALSE, 0);
2650 gtk_widget_show (vbox2);
2651 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2653 /* PACK_CHECK_BUTTON (vbox2, checkbtn_emacs,
2654 _("Emulate the behavior of mouse operation of\n"
2655 "Emacs-based mailer"));
2656 gtk_label_set_justify (GTK_LABEL (GTK_BIN (checkbtn_emacs)->child),
2657 GTK_JUSTIFY_LEFT); */
2660 (vbox2, checkbtn_show_msg_with_cursor,
2661 _("Open message when cursor keys are pressed on summary"));
2664 (vbox2, checkbtn_openunread,
2665 _("Open first unread message when entering a folder"));
2668 (vbox2, checkbtn_mark_as_read_on_newwin,
2669 _("Only mark message as read when opened in new window"));
2672 (vbox2, checkbtn_openinbox,
2673 _("Go to inbox after receiving new mail"));
2675 vbox3 = gtk_vbox_new (FALSE, 0);
2676 gtk_widget_show (vbox3);
2677 gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
2680 (vbox3, checkbtn_immedexec,
2681 _("Execute immediately when moving or deleting messages"));
2683 hbox1 = gtk_hbox_new (FALSE, 0);
2684 gtk_widget_show (hbox1);
2685 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2687 label = gtk_label_new
2688 (_("(Messages will be marked until execution\n"
2689 " if this is turned off)"));
2690 gtk_widget_show (label);
2691 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 8);
2692 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
2694 PACK_FRAME (vbox1, frame_dialogs, _("Dialogs"));
2695 vbox_dialogs = gtk_vbox_new (FALSE, 0);
2696 gtk_widget_show (vbox_dialogs);
2697 gtk_container_add (GTK_CONTAINER (frame_dialogs), vbox_dialogs);
2698 gtk_container_set_border_width (GTK_CONTAINER (vbox_dialogs), 8);
2700 dialogs_table = gtk_table_new (2, 2, FALSE);
2701 gtk_widget_show (dialogs_table);
2702 gtk_container_add (GTK_CONTAINER (vbox_dialogs), dialogs_table);
2703 gtk_container_set_border_width (GTK_CONTAINER (dialogs_table), 4);
2704 gtk_table_set_row_spacings (GTK_TABLE (dialogs_table), VSPACING_NARROW);
2705 gtk_table_set_col_spacings (GTK_TABLE (dialogs_table), 8);
2707 /* Next Unread Message Dialog */
2708 label = gtk_label_new (_("Show no-unread-message dialog"));
2709 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2710 gtk_widget_show (label);
2711 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 0, 1,
2712 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2715 optmenu_nextunreadmsgdialog = gtk_option_menu_new ();
2716 gtk_widget_show (optmenu_nextunreadmsgdialog);
2717 gtk_table_attach (GTK_TABLE (dialogs_table),
2718 optmenu_nextunreadmsgdialog, 1, 2, 0, 1,
2719 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2721 menu = gtk_menu_new ();
2722 MENUITEM_ADD (menu, menuitem, _("Always"), NEXTUNREADMSGDIALOG_ALWAYS);
2723 MENUITEM_ADD (menu, menuitem, _("Assume 'Yes'"),
2724 NEXTUNREADMSGDIALOG_ASSUME_YES);
2725 MENUITEM_ADD (menu, menuitem, _("Assume 'No'"),
2726 NEXTUNREADMSGDIALOG_ASSUME_NO);
2728 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_nextunreadmsgdialog), menu);
2730 label = gtk_label_new (_("Show send dialog"));
2731 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2732 gtk_widget_show (label);
2733 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 1, 2,
2734 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2736 optmenu_senddialog = gtk_option_menu_new ();
2737 gtk_widget_show (optmenu_senddialog);
2738 gtk_table_attach (GTK_TABLE (dialogs_table),
2739 optmenu_senddialog, 1, 2, 1, 2,
2740 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2742 menu = gtk_menu_new ();
2743 MENUITEM_ADD (menu, menuitem, _("Always"), SEND_DIALOG_ALWAYS);
2744 MENUITEM_ADD (menu, menuitem, _("Never"), SEND_DIALOG_NEVER);
2746 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_senddialog), menu);
2748 label = gtk_label_new (_("Show receive dialog"));
2749 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2750 gtk_widget_show (label);
2751 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 2, 3,
2752 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2754 optmenu_recvdialog = gtk_option_menu_new ();
2755 gtk_widget_show (optmenu_recvdialog);
2756 gtk_table_attach (GTK_TABLE (dialogs_table), optmenu_recvdialog, 1, 2, 2, 3,
2757 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2759 menu = gtk_menu_new ();
2760 MENUITEM_ADD (menu, menuitem, _("Always"), RECV_DIALOG_ALWAYS);
2761 MENUITEM_ADD (menu, menuitem, _("Only if a window is active"),
2762 RECV_DIALOG_ACTIVE);
2763 MENUITEM_ADD (menu, menuitem, _("Never"), RECV_DIALOG_NEVER);
2765 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
2767 PACK_CHECK_BUTTON (vbox_dialogs, checkbtn_no_recv_err_panel,
2768 _("Don't popup error dialog on receive error"));
2770 PACK_CHECK_BUTTON (vbox_dialogs, checkbtn_close_recv_dialog,
2771 _("Close receive dialog when finished"));
2774 hbox1 = gtk_hbox_new (FALSE, 8);
2775 gtk_widget_show (hbox1);
2776 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2778 button_keybind = gtk_button_new_with_label (_(" Set key bindings... "));
2779 gtk_widget_show (button_keybind);
2780 gtk_box_pack_start (GTK_BOX (hbox1), button_keybind, FALSE, FALSE, 0);
2781 gtk_signal_connect (GTK_OBJECT (button_keybind), "clicked",
2782 GTK_SIGNAL_FUNC (prefs_keybind_select), NULL);
2784 PACK_FRAME(vbox1, frame_pixmap_theme, _("Icon theme"));
2786 vbox_pixmap_theme = gtk_vbox_new(FALSE, 0);
2787 gtk_widget_show(vbox_pixmap_theme);
2788 gtk_container_add(GTK_CONTAINER(frame_pixmap_theme), vbox_pixmap_theme);
2789 gtk_container_set_border_width(GTK_CONTAINER(vbox_pixmap_theme), 8);
2791 avail_pixmap_themes = stock_pixmap_themes_list_new();
2793 combo_pixmap_theme = gtk_combo_new ();
2794 gtk_widget_show (combo_pixmap_theme);
2795 gtk_box_pack_start (GTK_BOX (vbox_pixmap_theme), combo_pixmap_theme, TRUE, TRUE, 0);
2796 gtk_combo_set_popdown_strings(GTK_COMBO(combo_pixmap_theme), avail_pixmap_themes);
2797 entry_pixmap_theme = GTK_COMBO (combo_pixmap_theme)->entry;
2799 stock_pixmap_themes_list_free(avail_pixmap_themes);
2801 /* interface.checkbtn_emacs = checkbtn_emacs; */
2802 interface.checkbtn_show_msg_with_cursor
2803 = checkbtn_show_msg_with_cursor;
2804 interface.checkbtn_openunread = checkbtn_openunread;
2805 interface.checkbtn_mark_as_read_on_newwin
2806 = checkbtn_mark_as_read_on_newwin;
2807 interface.checkbtn_openinbox = checkbtn_openinbox;
2808 interface.checkbtn_immedexec = checkbtn_immedexec;
2809 interface.optmenu_recvdialog = optmenu_recvdialog;
2810 interface.optmenu_senddialog = optmenu_senddialog;
2811 interface.checkbtn_no_recv_err_panel = checkbtn_no_recv_err_panel;
2812 interface.checkbtn_close_recv_dialog = checkbtn_close_recv_dialog;
2813 interface.optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
2814 interface.combo_pixmap_theme = combo_pixmap_theme;
2815 interface.entry_pixmap_theme = entry_pixmap_theme;
2818 static void prefs_other_create(void)
2821 GtkWidget *ext_frame;
2822 GtkWidget *ext_table;
2825 GtkWidget *uri_label;
2826 GtkWidget *uri_combo;
2827 GtkWidget *uri_entry;
2829 GtkWidget *printcmd_label;
2830 GtkWidget *printcmd_entry;
2832 GtkWidget *exteditor_label;
2833 GtkWidget *exteditor_combo;
2834 GtkWidget *exteditor_entry;
2836 GtkWidget *frame_addr;
2837 GtkWidget *vbox_addr;
2838 GtkWidget *checkbtn_addaddrbyclick;
2840 GtkWidget *frame_cliplog;
2841 GtkWidget *vbox_cliplog;
2842 GtkWidget *hbox_cliplog;
2843 GtkWidget *checkbtn_cliplog;
2844 GtkWidget *loglength_label;
2845 GtkWidget *loglength_entry;
2847 GtkWidget *frame_exit;
2848 GtkWidget *vbox_exit;
2849 GtkWidget *checkbtn_confonexit;
2850 GtkWidget *checkbtn_cleanonexit;
2851 GtkWidget *checkbtn_askonclean;
2852 GtkWidget *checkbtn_warnqueued;
2854 GtkWidget *frame_ssl;
2855 GtkWidget *vbox_ssl;
2856 GtkWidget *hbox_ssl;
2857 GtkWidget *checkbtn_ssl_ask_unknown_valid;
2859 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2860 gtk_widget_show (vbox1);
2861 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2862 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2864 PACK_FRAME(vbox1, ext_frame,
2865 _("External commands (%s will be replaced with file name / URI)"));
2867 ext_table = gtk_table_new (3, 2, FALSE);
2868 gtk_widget_show (ext_table);
2869 gtk_container_add (GTK_CONTAINER (ext_frame), ext_table);
2870 gtk_container_set_border_width (GTK_CONTAINER (ext_table), 8);
2871 gtk_table_set_row_spacings (GTK_TABLE (ext_table), VSPACING_NARROW);
2872 gtk_table_set_col_spacings (GTK_TABLE (ext_table), 8);
2874 uri_label = gtk_label_new (_("Web browser"));
2875 gtk_widget_show(uri_label);
2876 gtk_table_attach (GTK_TABLE (ext_table), uri_label, 0, 1, 0, 1,
2877 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2878 gtk_misc_set_alignment (GTK_MISC (uri_label), 1, 0.5);
2880 uri_combo = gtk_combo_new ();
2881 gtk_widget_show (uri_combo);
2882 gtk_table_attach (GTK_TABLE (ext_table), uri_combo, 1, 2, 0, 1,
2883 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2884 gtkut_combo_set_items (GTK_COMBO (uri_combo),
2886 "mozilla -remote 'openurl(%s,new-window)'",
2887 "netscape -remote 'openURL(%s,raise)'",
2889 "gnome-moz-remote --raise --newwin '%s'",
2890 "kfmclient openURL '%s'",
2891 "opera -newwindow '%s'",
2892 "kterm -e w3m '%s'",
2893 "kterm -e lynx '%s'",
2895 uri_entry = GTK_COMBO (uri_combo)->entry;
2897 printcmd_label = gtk_label_new (_("Print"));
2898 gtk_widget_show (printcmd_label);
2899 gtk_table_attach (GTK_TABLE (ext_table), printcmd_label, 0, 1, 1, 2,
2900 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2901 gtk_misc_set_alignment (GTK_MISC (printcmd_label), 1, 0.5);
2903 printcmd_entry = gtk_entry_new ();
2904 gtk_widget_show (printcmd_entry);
2905 gtk_table_attach (GTK_TABLE (ext_table), printcmd_entry, 1, 2, 1, 2,
2906 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2908 exteditor_label = gtk_label_new (_("Editor"));
2909 gtk_widget_show (exteditor_label);
2910 gtk_table_attach (GTK_TABLE (ext_table), exteditor_label, 0, 1, 2, 3,
2911 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2912 gtk_misc_set_alignment (GTK_MISC (exteditor_label), 1, 0.5);
2914 exteditor_combo = gtk_combo_new ();
2915 gtk_widget_show (exteditor_combo);
2916 gtk_table_attach (GTK_TABLE (ext_table), exteditor_combo, 1, 2, 2, 3,
2917 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2918 gtkut_combo_set_items (GTK_COMBO (exteditor_combo),
2921 "mgedit --no-fork %s",
2927 exteditor_entry = GTK_COMBO (exteditor_combo)->entry;
2929 PACK_FRAME (vbox1, frame_addr, _("Address book"));
2931 vbox_addr = gtk_vbox_new (FALSE, 0);
2932 gtk_widget_show (vbox_addr);
2933 gtk_container_add (GTK_CONTAINER (frame_addr), vbox_addr);
2934 gtk_container_set_border_width (GTK_CONTAINER (vbox_addr), 8);
2937 (vbox_addr, checkbtn_addaddrbyclick,
2938 _("Add address to destination when double-clicked"));
2941 PACK_FRAME (vbox1, frame_cliplog, _("Log Size"));
2943 vbox_cliplog = gtk_vbox_new (FALSE, 0);
2944 gtk_widget_show (vbox_cliplog);
2945 gtk_container_add (GTK_CONTAINER (frame_cliplog), vbox_cliplog);
2946 gtk_container_set_border_width (GTK_CONTAINER (vbox_cliplog), 8);
2947 PACK_CHECK_BUTTON (vbox_cliplog, checkbtn_cliplog,
2948 _("Clip the log size"));
2949 hbox_cliplog = gtk_hbox_new (FALSE, 3);
2950 gtk_container_add (GTK_CONTAINER (vbox_cliplog), hbox_cliplog);
2951 gtk_widget_show (hbox_cliplog);
2953 loglength_label = gtk_label_new (_("Log window length"));
2954 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
2956 gtk_widget_show (GTK_WIDGET (loglength_label));
2957 loglength_entry = gtk_entry_new ();
2958 gtk_widget_set_usize (GTK_WIDGET (loglength_entry), 64, -1);
2959 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_entry,
2961 gtk_widget_show (GTK_WIDGET (loglength_entry));
2962 loglength_label = gtk_label_new (_("(0 to stop logging in the log window)"));
2963 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
2965 SET_TOGGLE_SENSITIVITY(checkbtn_cliplog, loglength_entry);
2969 PACK_FRAME (vbox1, frame_ssl, _("Security"));
2971 vbox_ssl = gtk_vbox_new (FALSE, 0);
2972 gtk_widget_show (vbox_ssl);
2973 gtk_container_add (GTK_CONTAINER (frame_ssl), vbox_ssl);
2974 gtk_container_set_border_width (GTK_CONTAINER (vbox_ssl), 8);
2975 PACK_CHECK_BUTTON (vbox_ssl, checkbtn_ssl_ask_unknown_valid,
2976 _("Confirm acception of all SSL certificates"));
2977 hbox_ssl = gtk_hbox_new (FALSE, 3);
2978 gtk_container_add (GTK_CONTAINER (vbox_ssl), hbox_ssl);
2979 gtk_widget_show (hbox_ssl);
2983 PACK_FRAME (vbox1, frame_exit, _("On exit"));
2985 vbox_exit = gtk_vbox_new (FALSE, 0);
2986 gtk_widget_show (vbox_exit);
2987 gtk_container_add (GTK_CONTAINER (frame_exit), vbox_exit);
2988 gtk_container_set_border_width (GTK_CONTAINER (vbox_exit), 8);
2990 PACK_CHECK_BUTTON (vbox_exit, checkbtn_confonexit,
2991 _("Confirm on exit"));
2993 hbox1 = gtk_hbox_new (FALSE, 32);
2994 gtk_widget_show (hbox1);
2995 gtk_box_pack_start (GTK_BOX (vbox_exit), hbox1, FALSE, FALSE, 0);
2997 PACK_CHECK_BUTTON (hbox1, checkbtn_cleanonexit,
2998 _("Empty trash on exit"));
2999 PACK_CHECK_BUTTON (hbox1, checkbtn_askonclean,
3000 _("Ask before emptying"));
3001 SET_TOGGLE_SENSITIVITY (checkbtn_cleanonexit, checkbtn_askonclean);
3003 PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
3004 _("Warn if there are queued messages"));
3006 other.uri_combo = uri_combo;
3007 other.uri_entry = uri_entry;
3008 other.printcmd_entry = printcmd_entry;
3010 other.exteditor_combo = exteditor_combo;
3011 other.exteditor_entry = exteditor_entry;
3013 other.checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
3015 other.checkbtn_cliplog = checkbtn_cliplog;
3016 other.loglength_entry = loglength_entry;
3018 other.checkbtn_confonexit = checkbtn_confonexit;
3019 other.checkbtn_cleanonexit = checkbtn_cleanonexit;
3020 other.checkbtn_askonclean = checkbtn_askonclean;
3021 other.checkbtn_warnqueued = checkbtn_warnqueued;
3024 other.checkbtn_ssl_ask_unknown_valid = checkbtn_ssl_ask_unknown_valid;
3028 static void date_format_ok_btn_clicked(GtkButton *button, GtkWidget **widget)
3030 GtkWidget *datefmt_sample = NULL;
3033 g_return_if_fail(widget != NULL);
3034 g_return_if_fail(*widget != NULL);
3035 g_return_if_fail(display.entry_datefmt != NULL);
3037 datefmt_sample = GTK_WIDGET(gtk_object_get_data
3038 (GTK_OBJECT(*widget), "datefmt_sample"));
3039 g_return_if_fail(datefmt_sample != NULL);
3041 text = gtk_editable_get_chars(GTK_EDITABLE(datefmt_sample), 0, -1);
3042 g_free(prefs_common.date_format);
3043 prefs_common.date_format = text;
3044 gtk_entry_set_text(GTK_ENTRY(display.entry_datefmt), text);
3046 gtk_widget_destroy(*widget);
3050 static void date_format_cancel_btn_clicked(GtkButton *button,
3053 g_return_if_fail(widget != NULL);
3054 g_return_if_fail(*widget != NULL);
3056 gtk_widget_destroy(*widget);
3060 static void date_format_key_pressed(GtkWidget *keywidget, GdkEventKey *event,
3063 if (event && event->keyval == GDK_Escape)
3064 date_format_cancel_btn_clicked(NULL, widget);
3067 static gboolean date_format_on_delete(GtkWidget *dialogwidget,
3068 GdkEventAny *event, GtkWidget **widget)
3070 g_return_val_if_fail(widget != NULL, FALSE);
3071 g_return_val_if_fail(*widget != NULL, FALSE);
3077 static void date_format_entry_on_change(GtkEditable *editable,
3081 struct tm *cal_time;
3085 cur_time = time(NULL);
3086 cal_time = localtime(&cur_time);
3088 text = gtk_editable_get_chars(editable, 0, -1);
3090 strftime(buffer, sizeof buffer, text, cal_time);
3092 gtk_label_set_text(example, buffer);
3095 static void date_format_select_row(GtkWidget *date_format_list, gint row,
3096 gint column, GdkEventButton *event,
3097 GtkWidget *date_format)
3103 GtkWidget *datefmt_sample;
3105 /* only on double click */
3106 if (!event || event->type != GDK_2BUTTON_PRESS) return;
3109 datefmt_sample = GTK_WIDGET(gtk_object_get_data
3110 (GTK_OBJECT(date_format), "datefmt_sample"));
3112 g_return_if_fail(date_format_list != NULL);
3113 g_return_if_fail(date_format != NULL);
3114 g_return_if_fail(datefmt_sample != NULL);
3116 /* get format from clist */
3117 gtk_clist_get_text(GTK_CLIST(date_format_list), row, 0, &format);
3119 cur_pos = gtk_editable_get_position(GTK_EDITABLE(datefmt_sample));
3120 old_format = gtk_entry_get_text(GTK_ENTRY(datefmt_sample));
3122 /* insert the format into the text entry */
3123 new_format = g_malloc(strlen(old_format) + 3);
3125 strncpy(new_format, old_format, cur_pos);
3126 new_format[cur_pos] = '\0';
3127 strcat(new_format, format);
3128 strcat(new_format, &old_format[cur_pos]);
3130 gtk_entry_set_text(GTK_ENTRY(datefmt_sample), new_format);
3131 gtk_editable_set_position(GTK_EDITABLE(datefmt_sample), cur_pos + 2);
3136 static GtkWidget *date_format_create(GtkButton *button, void *data)
3138 static GtkWidget *datefmt_win = NULL;
3140 GtkWidget *scrolledwindow1;
3141 GtkWidget *datefmt_clist;
3146 GtkWidget *confirm_area;
3148 GtkWidget *cancel_btn;
3149 GtkWidget *datefmt_entry;
3178 const gint TIME_FORMAT_ELEMS =
3179 sizeof time_format / sizeof time_format[0];
3181 time_format[0].txt = _("the full abbreviated weekday name");
3182 time_format[1].txt = _("the full weekday name");
3183 time_format[2].txt = _("the abbreviated month name");
3184 time_format[3].txt = _("the full month name");
3185 time_format[4].txt = _("the preferred date and time for the current locale");
3186 time_format[5].txt = _("the century number (year/100)");
3187 time_format[6].txt = _("the day of the month as a decimal number");
3188 time_format[7].txt = _("the hour as a decimal number using a 24-hour clock");
3189 time_format[8].txt = _("the hour as a decimal number using a 12-hour clock");
3190 time_format[9].txt = _("the day of the year as a decimal number");
3191 time_format[10].txt = _("the month as a decimal number");
3192 time_format[11].txt = _("the minute as a decimal number");
3193 time_format[12].txt = _("either AM or PM");
3194 time_format[13].txt = _("the second as a decimal number");
3195 time_format[14].txt = _("the day of the week as a decimal number");
3196 time_format[15].txt = _("the preferred date for the current locale");
3197 time_format[16].txt = _("the last two digits of a year");
3198 time_format[17].txt = _("the year as a decimal number");
3199 time_format[18].txt = _("the time zone or name or abbreviation");
3201 if (datefmt_win) return datefmt_win;
3203 datefmt_win = gtk_window_new(GTK_WINDOW_DIALOG);
3204 gtk_container_set_border_width(GTK_CONTAINER(datefmt_win), 8);
3205 gtk_window_set_title(GTK_WINDOW(datefmt_win), _("Date format"));
3206 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
3207 gtk_widget_set_usize(datefmt_win, 440, 280);
3209 vbox1 = gtk_vbox_new(FALSE, 10);
3210 gtk_widget_show(vbox1);
3211 gtk_container_add(GTK_CONTAINER(datefmt_win), vbox1);
3213 scrolledwindow1 = gtk_scrolled_window_new(NULL, NULL);
3214 gtk_scrolled_window_set_policy
3215 (GTK_SCROLLED_WINDOW(scrolledwindow1),
3216 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
3217 gtk_widget_show(scrolledwindow1);
3218 gtk_box_pack_start(GTK_BOX(vbox1), scrolledwindow1, TRUE, TRUE, 0);
3220 titles[0] = _("Specifier");
3221 titles[1] = _("Description");
3222 datefmt_clist = gtk_clist_new_with_titles(2, titles);
3223 gtk_widget_show(datefmt_clist);
3224 gtk_container_add(GTK_CONTAINER(scrolledwindow1), datefmt_clist);
3225 /* gtk_clist_set_column_width(GTK_CLIST(datefmt_clist), 0, 80); */
3226 gtk_clist_set_selection_mode(GTK_CLIST(datefmt_clist),
3227 GTK_SELECTION_BROWSE);
3229 for (i = 0; i < TIME_FORMAT_ELEMS; i++) {
3231 /* phoney casting necessary because of gtk... */
3232 text[0] = (gchar *)time_format[i].fmt;
3233 text[1] = (gchar *)time_format[i].txt;
3234 gtk_clist_append(GTK_CLIST(datefmt_clist), text);
3237 table = gtk_table_new(2, 2, FALSE);
3238 gtk_widget_show(table);
3239 gtk_box_pack_start(GTK_BOX(vbox1), table, FALSE, FALSE, 0);
3240 gtk_table_set_row_spacings(GTK_TABLE(table), 4);
3241 gtk_table_set_col_spacings(GTK_TABLE(table), 8);
3243 label1 = gtk_label_new(_("Date format"));
3244 gtk_widget_show(label1);
3245 gtk_table_attach(GTK_TABLE(table), label1, 0, 1, 0, 1,
3247 gtk_label_set_justify(GTK_LABEL(label1), GTK_JUSTIFY_LEFT);
3248 gtk_misc_set_alignment(GTK_MISC(label1), 0, 0.5);
3250 datefmt_entry = gtk_entry_new_with_max_length(256);
3251 gtk_widget_show(datefmt_entry);
3252 gtk_table_attach(GTK_TABLE(table), datefmt_entry, 1, 2, 0, 1,
3253 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3255 /* we need the "sample" entry box; add it as data so callbacks can
3256 * get the entry box */
3257 gtk_object_set_data(GTK_OBJECT(datefmt_win), "datefmt_sample",
3260 label2 = gtk_label_new(_("Example"));
3261 gtk_widget_show(label2);
3262 gtk_table_attach(GTK_TABLE(table), label2, 0, 1, 1, 2,
3264 gtk_label_set_justify(GTK_LABEL(label2), GTK_JUSTIFY_LEFT);
3265 gtk_misc_set_alignment(GTK_MISC(label2), 0, 0.5);
3267 label3 = gtk_label_new("");
3268 gtk_widget_show(label3);
3269 gtk_table_attach(GTK_TABLE(table), label3, 1, 2, 1, 2,
3270 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3271 gtk_label_set_justify(GTK_LABEL(label3), GTK_JUSTIFY_LEFT);
3272 gtk_misc_set_alignment(GTK_MISC(label3), 0, 0.5);
3274 gtkut_button_set_create(&confirm_area, &ok_btn, _("OK"),
3275 &cancel_btn, _("Cancel"), NULL, NULL);
3276 gtk_widget_grab_default(ok_btn);
3277 gtk_widget_show(confirm_area);
3279 gtk_box_pack_start(GTK_BOX(vbox1), confirm_area, FALSE, FALSE, 0);
3281 /* set the current format */
3282 gtk_entry_set_text(GTK_ENTRY(datefmt_entry), prefs_common.date_format);
3283 date_format_entry_on_change(GTK_EDITABLE(datefmt_entry),
3286 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
3287 GTK_SIGNAL_FUNC(date_format_ok_btn_clicked),
3289 gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
3290 GTK_SIGNAL_FUNC(date_format_cancel_btn_clicked),
3292 gtk_signal_connect(GTK_OBJECT(datefmt_win), "key_press_event",
3293 GTK_SIGNAL_FUNC(date_format_key_pressed),
3295 gtk_signal_connect(GTK_OBJECT(datefmt_win), "delete_event",
3296 GTK_SIGNAL_FUNC(date_format_on_delete),
3298 gtk_signal_connect(GTK_OBJECT(datefmt_entry), "changed",
3299 GTK_SIGNAL_FUNC(date_format_entry_on_change),
3302 gtk_signal_connect(GTK_OBJECT(datefmt_clist), "select_row",
3303 GTK_SIGNAL_FUNC(date_format_select_row),
3306 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
3307 gtk_window_set_modal(GTK_WINDOW(datefmt_win), TRUE);
3309 gtk_widget_show(datefmt_win);
3310 manage_window_set_transient(GTK_WINDOW(datefmt_win));
3312 gtk_widget_grab_focus(ok_btn);
3317 void prefs_quote_colors_dialog(void)
3319 if (!quote_color_win)
3320 prefs_quote_colors_dialog_create();
3321 gtk_widget_show(quote_color_win);
3322 manage_window_set_transient(GTK_WINDOW(quote_color_win));
3325 gtk_widget_hide(quote_color_win);
3327 textview_update_message_colors();
3328 main_window_reflect_prefs_all();
3331 static void prefs_quote_colors_dialog_create(void)
3336 GtkWidget *quotelevel1_label;
3337 GtkWidget *quotelevel2_label;
3338 GtkWidget *quotelevel3_label;
3339 GtkWidget *uri_label;
3340 GtkWidget *signature_label;
3341 GtkWidget *tgt_folder_label;
3344 GtkWidget *recycle_colors_btn;
3345 GtkWidget *frame_colors;
3347 window = gtk_window_new(GTK_WINDOW_DIALOG);
3348 gtk_container_set_border_width(GTK_CONTAINER(window), 2);
3349 gtk_window_set_title(GTK_WINDOW(window), _("Set message colors"));
3350 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
3351 gtk_window_set_modal(GTK_WINDOW(window), TRUE);
3352 gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
3354 vbox = gtk_vbox_new (FALSE, VSPACING);
3355 gtk_container_add (GTK_CONTAINER (window), vbox);
3356 gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
3357 PACK_FRAME(vbox, frame_colors, _("Colors"));
3359 table = gtk_table_new (5, 2, FALSE);
3360 gtk_container_add (GTK_CONTAINER (frame_colors), table);
3361 gtk_container_set_border_width (GTK_CONTAINER (table), 8);
3362 gtk_table_set_row_spacings (GTK_TABLE (table), 2);
3363 gtk_table_set_col_spacings (GTK_TABLE (table), 5);
3366 color_buttons.quote_level1_btn = gtk_button_new();
3367 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level1_btn,
3368 0, 1, 0, 1, 0, 0, 0, 0);
3369 gtk_widget_set_usize (color_buttons.quote_level1_btn, 40, 30);
3370 gtk_container_set_border_width
3371 (GTK_CONTAINER (color_buttons.quote_level1_btn), 5);
3373 color_buttons.quote_level2_btn = gtk_button_new();
3374 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level2_btn,
3375 0, 1, 1, 2, 0, 0, 0, 0);
3376 gtk_widget_set_usize (color_buttons.quote_level2_btn, 40, 30);
3377 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.quote_level2_btn), 5);
3379 color_buttons.quote_level3_btn = gtk_button_new_with_label ("");
3380 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level3_btn,
3381 0, 1, 2, 3, 0, 0, 0, 0);
3382 gtk_widget_set_usize (color_buttons.quote_level3_btn, 40, 30);
3383 gtk_container_set_border_width
3384 (GTK_CONTAINER (color_buttons.quote_level3_btn), 5);
3386 color_buttons.uri_btn = gtk_button_new_with_label ("");
3387 gtk_table_attach (GTK_TABLE (table), color_buttons.uri_btn,
3388 0, 1, 3, 4, 0, 0, 0, 0);
3389 gtk_widget_set_usize (color_buttons.uri_btn, 40, 30);
3390 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.uri_btn), 5);
3392 color_buttons.tgt_folder_btn = gtk_button_new_with_label ("");
3393 gtk_table_attach (GTK_TABLE (table), color_buttons.tgt_folder_btn,
3394 0, 1, 4, 5, 0, 0, 0, 0);
3395 gtk_widget_set_usize (color_buttons.tgt_folder_btn, 40, 30);
3396 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.tgt_folder_btn), 5);
3398 color_buttons.signature_btn = gtk_button_new_with_label ("");
3399 gtk_table_attach (GTK_TABLE (table), color_buttons.signature_btn,
3400 0, 1, 5, 6, 0, 0, 0, 0);
3401 gtk_widget_set_usize (color_buttons.signature_btn, 40, 30);
3402 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.signature_btn), 5);
3404 quotelevel1_label = gtk_label_new (_("Quoted Text - First Level"));
3405 gtk_table_attach (GTK_TABLE (table), quotelevel1_label, 1, 2, 0, 1,
3406 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3407 gtk_label_set_justify (GTK_LABEL (quotelevel1_label), GTK_JUSTIFY_LEFT);
3408 gtk_misc_set_alignment (GTK_MISC (quotelevel1_label), 0, 0.5);
3410 quotelevel2_label = gtk_label_new (_("Quoted Text - Second Level"));
3411 gtk_table_attach (GTK_TABLE (table), quotelevel2_label, 1, 2, 1, 2,
3412 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3413 gtk_label_set_justify (GTK_LABEL (quotelevel2_label), GTK_JUSTIFY_LEFT);
3414 gtk_misc_set_alignment (GTK_MISC (quotelevel2_label), 0, 0.5);
3416 quotelevel3_label = gtk_label_new (_("Quoted Text - Third Level"));
3417 gtk_table_attach (GTK_TABLE (table), quotelevel3_label, 1, 2, 2, 3,
3418 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3419 gtk_label_set_justify (GTK_LABEL (quotelevel3_label), GTK_JUSTIFY_LEFT);
3420 gtk_misc_set_alignment (GTK_MISC (quotelevel3_label), 0, 0.5);
3422 uri_label = gtk_label_new (_("URI link"));
3423 gtk_table_attach (GTK_TABLE (table), uri_label, 1, 2, 3, 4,
3424 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3425 gtk_label_set_justify (GTK_LABEL (uri_label), GTK_JUSTIFY_LEFT);
3426 gtk_misc_set_alignment (GTK_MISC (uri_label), 0, 0.5);
3428 tgt_folder_label = gtk_label_new (_("Target folder"));
3429 gtk_table_attach (GTK_TABLE (table), tgt_folder_label, 1, 2, 4, 5,
3430 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3431 gtk_label_set_justify (GTK_LABEL (tgt_folder_label), GTK_JUSTIFY_LEFT);
3432 gtk_misc_set_alignment (GTK_MISC (tgt_folder_label), 0, 0.5);
3434 signature_label = gtk_label_new (_("Signatures"));
3435 gtk_table_attach (GTK_TABLE (table), signature_label, 1, 2, 5, 6,
3436 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3437 gtk_label_set_justify (GTK_LABEL (signature_label), GTK_JUSTIFY_LEFT);
3438 gtk_misc_set_alignment (GTK_MISC (signature_label), 0, 0.5);
3440 PACK_CHECK_BUTTON (vbox, recycle_colors_btn,
3441 _("Recycle quote colors"));
3443 gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
3444 NULL, NULL, NULL, NULL);
3445 gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
3447 gtk_widget_grab_default(ok_btn);
3448 MANAGE_WINDOW_SIGNALS_CONNECT(window);
3449 gtk_signal_connect(GTK_OBJECT(window), "delete_event",
3450 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3451 gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
3452 GTK_SIGNAL_FUNC(prefs_quote_colors_key_pressed),
3455 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level1_btn), "clicked",
3456 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL1");
3457 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level2_btn), "clicked",
3458 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL2");
3459 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level3_btn), "clicked",
3460 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL3");
3461 gtk_signal_connect(GTK_OBJECT(color_buttons.uri_btn), "clicked",
3462 GTK_SIGNAL_FUNC(quote_color_set_dialog), "URI");
3463 gtk_signal_connect(GTK_OBJECT(color_buttons.tgt_folder_btn), "clicked",
3464 GTK_SIGNAL_FUNC(quote_color_set_dialog), "TGTFLD");
3465 gtk_signal_connect(GTK_OBJECT(color_buttons.signature_btn), "clicked",
3466 GTK_SIGNAL_FUNC(quote_color_set_dialog), "SIGNATURE");
3467 gtk_signal_connect(GTK_OBJECT(recycle_colors_btn), "toggled",
3468 GTK_SIGNAL_FUNC(prefs_recycle_colors_toggled), NULL);
3469 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
3470 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3472 /* show message button colors and recycle options */
3473 set_button_bg_color(color_buttons.quote_level1_btn,
3474 prefs_common.quote_level1_col);
3475 set_button_bg_color(color_buttons.quote_level2_btn,
3476 prefs_common.quote_level2_col);
3477 set_button_bg_color(color_buttons.quote_level3_btn,
3478 prefs_common.quote_level3_col);
3479 set_button_bg_color(color_buttons.uri_btn,
3480 prefs_common.uri_col);
3481 set_button_bg_color(color_buttons.tgt_folder_btn,
3482 prefs_common.tgt_folder_col);
3483 set_button_bg_color(color_buttons.signature_btn,
3484 prefs_common.signature_col);
3485 gtk_toggle_button_set_active((GtkToggleButton *)recycle_colors_btn,
3486 prefs_common.recycle_quote_colors);
3488 gtk_widget_show_all(vbox);
3489 quote_color_win = window;
3492 static void prefs_quote_colors_key_pressed(GtkWidget *widget,
3493 GdkEventKey *event, gpointer data)
3495 if (event && event->keyval == GDK_Escape)
3499 static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
3501 gchar *type = (gchar *)data;
3502 gchar *title = NULL;
3503 gdouble color[4] = {0.0, 0.0, 0.0, 0.0};
3505 GtkColorSelectionDialog *dialog;
3507 if(g_strcasecmp(type, "LEVEL1") == 0) {
3508 title = _("Pick color for quotation level 1");
3509 rgbvalue = prefs_common.quote_level1_col;
3510 } else if(g_strcasecmp(type, "LEVEL2") == 0) {
3511 title = _("Pick color for quotation level 2");
3512 rgbvalue = prefs_common.quote_level2_col;
3513 } else if(g_strcasecmp(type, "LEVEL3") == 0) {
3514 title = _("Pick color for quotation level 3");
3515 rgbvalue = prefs_common.quote_level3_col;
3516 } else if(g_strcasecmp(type, "URI") == 0) {
3517 title = _("Pick color for URI");
3518 rgbvalue = prefs_common.uri_col;
3519 } else if(g_strcasecmp(type, "TGTFLD") == 0) {
3520 title = _("Pick color for target folder");
3521 rgbvalue = prefs_common.tgt_folder_col;
3522 } else if(g_strcasecmp(type, "SIGNATURE") == 0) {
3523 title = _("Pick color for signatures");
3524 rgbvalue = prefs_common.signature_col;
3526 } else if(g_strcasecmp(type, "Misspelled word") == 0) {
3527 title = _("Pick color for misspelled word");
3528 rgbvalue = prefs_common.misspelled_col;
3530 } else { /* Should never be called */
3531 g_warning("Unrecognized datatype '%s' in quote_color_set_dialog\n", type);
3535 color_dialog = gtk_color_selection_dialog_new(title);
3536 gtk_window_set_position(GTK_WINDOW(color_dialog), GTK_WIN_POS_CENTER);
3537 gtk_window_set_modal(GTK_WINDOW(color_dialog), TRUE);
3538 gtk_window_set_policy(GTK_WINDOW(color_dialog), FALSE, FALSE, FALSE);
3539 manage_window_set_transient(GTK_WINDOW(color_dialog));
3541 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->ok_button),
3542 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_ok), data);
3543 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->cancel_button),
3544 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_cancel), data);
3545 gtk_signal_connect(GTK_OBJECT(color_dialog), "key_press_event",
3546 GTK_SIGNAL_FUNC(quote_colors_set_dialog_key_pressed),
3549 /* preselect the previous color in the color selection dialog */
3550 color[0] = (gdouble) ((rgbvalue & 0xff0000) >> 16) / 255.0;
3551 color[1] = (gdouble) ((rgbvalue & 0x00ff00) >> 8) / 255.0;
3552 color[2] = (gdouble) (rgbvalue & 0x0000ff) / 255.0;
3553 dialog = GTK_COLOR_SELECTION_DIALOG(color_dialog);
3554 gtk_color_selection_set_color
3555 (GTK_COLOR_SELECTION(dialog->colorsel), color);
3557 gtk_widget_show(color_dialog);
3560 static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
3562 GtkColorSelection *colorsel = (GtkColorSelection *)
3563 ((GtkColorSelectionDialog *)color_dialog)->colorsel;
3565 gint red, green, blue, rgbvalue;
3566 gchar *type = (gchar *)data;
3568 gtk_color_selection_get_color(colorsel, color);
3570 red = (gint) (color[0] * 255.0);
3571 green = (gint) (color[1] * 255.0);
3572 blue = (gint) (color[2] * 255.0);
3573 rgbvalue = (gint) ((red * 0x10000) | (green * 0x100) | blue);
3576 fprintf(stderr, "redc = %f, greenc = %f, bluec = %f\n", color[0], color[1], color[2]);
3577 fprintf(stderr, "red = %d, green = %d, blue = %d\n", red, green, blue);
3578 fprintf(stderr, "Color is %x\n", rgbvalue);
3581 if (g_strcasecmp(type, "LEVEL1") == 0) {
3582 prefs_common.quote_level1_col = rgbvalue;
3583 set_button_bg_color(color_buttons.quote_level1_btn, rgbvalue);
3584 } else if (g_strcasecmp(type, "LEVEL2") == 0) {
3585 prefs_common.quote_level2_col = rgbvalue;
3586 set_button_bg_color(color_buttons.quote_level2_btn, rgbvalue);
3587 } else if (g_strcasecmp(type, "LEVEL3") == 0) {
3588 prefs_common.quote_level3_col = rgbvalue;
3589 set_button_bg_color(color_buttons.quote_level3_btn, rgbvalue);
3590 } else if (g_strcasecmp(type, "URI") == 0) {
3591 prefs_common.uri_col = rgbvalue;
3592 set_button_bg_color(color_buttons.uri_btn, rgbvalue);
3593 } else if (g_strcasecmp(type, "TGTFLD") == 0) {
3594 prefs_common.tgt_folder_col = rgbvalue;
3595 set_button_bg_color(color_buttons.tgt_folder_btn, rgbvalue);
3596 folderview_set_target_folder_color(prefs_common.tgt_folder_col);
3597 } else if (g_strcasecmp(type, "SIGNATURE") == 0) {
3598 prefs_common.signature_col = rgbvalue;
3599 set_button_bg_color(color_buttons.signature_btn, rgbvalue);
3601 } else if (g_strcasecmp(type, "Misspelled word") == 0) {
3602 prefs_common.misspelled_col = rgbvalue;
3603 set_button_bg_color(spelling.misspelled_btn, rgbvalue);
3606 fprintf( stderr, "Unrecognized datatype '%s' in quote_color_set_dialog_ok\n", type );
3608 gtk_widget_destroy(color_dialog);
3611 static void quote_colors_set_dialog_cancel(GtkWidget *widget, gpointer data)
3613 gtk_widget_destroy(color_dialog);
3616 static void quote_colors_set_dialog_key_pressed(GtkWidget *widget,
3620 gtk_widget_destroy(color_dialog);
3623 static void set_button_bg_color(GtkWidget *widget, gint rgbvalue)
3628 gtkut_convert_int_to_gdk_color(rgbvalue, &color);
3629 newstyle = gtk_style_copy(gtk_widget_get_default_style());
3630 newstyle->bg[GTK_STATE_NORMAL] = color;
3631 newstyle->bg[GTK_STATE_PRELIGHT] = color;
3632 newstyle->bg[GTK_STATE_ACTIVE] = color;
3634 gtk_widget_set_style(GTK_WIDGET(widget), newstyle);
3637 static void prefs_enable_message_color_toggled(void)
3641 is_active = gtk_toggle_button_get_active
3642 (GTK_TOGGLE_BUTTON(message.chkbtn_enablecol));
3643 gtk_widget_set_sensitive(message.button_edit_col, is_active);
3644 prefs_common.enable_color = is_active;
3647 static void prefs_recycle_colors_toggled(GtkWidget *widget)
3651 is_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
3652 prefs_common.recycle_quote_colors = is_active;
3655 static void prefs_font_select(GtkButton *button, GtkEntry *entry)
3659 g_return_if_fail(entry != NULL);
3661 if (!font_sel_win) {
3662 font_sel_win = gtk_font_selection_dialog_new
3663 (_("Font selection"));
3664 gtk_window_position(GTK_WINDOW(font_sel_win),
3665 GTK_WIN_POS_CENTER);
3666 gtk_signal_connect(GTK_OBJECT(font_sel_win), "delete_event",
3667 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3670 (GTK_OBJECT(font_sel_win), "key_press_event",
3671 GTK_SIGNAL_FUNC(prefs_font_selection_key_pressed),
3673 gtk_signal_connect_object
3674 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->cancel_button),
3676 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3677 GTK_OBJECT(font_sel_win));
3680 if(font_sel_conn_id) {
3681 gtk_signal_disconnect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button), font_sel_conn_id);
3683 font_sel_conn_id = gtk_signal_connect
3684 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button),
3686 GTK_SIGNAL_FUNC(prefs_font_selection_ok),
3688 printf("%i\n", font_sel_conn_id);
3690 font_name = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
3691 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(font_sel_win), font_name);
3693 manage_window_set_transient(GTK_WINDOW(font_sel_win));
3694 gtk_window_set_modal(GTK_WINDOW(font_sel_win), TRUE);
3695 gtk_widget_grab_focus
3696 (GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button);
3697 gtk_widget_show(font_sel_win);
3700 static void prefs_font_selection_key_pressed(GtkWidget *widget,
3704 if (event && event->keyval == GDK_Escape)
3705 gtk_widget_hide(font_sel_win);
3708 static void prefs_font_selection_ok(GtkButton *button, GtkEntry *entry)
3712 fontname = gtk_font_selection_dialog_get_font_name
3713 (GTK_FONT_SELECTION_DIALOG(font_sel_win));
3716 gtk_entry_set_text(entry, fontname);
3721 gtk_widget_hide(font_sel_win);
3724 static void prefs_keybind_select(void)
3731 GtkWidget *confirm_area;
3733 GtkWidget *cancel_btn;
3735 window = gtk_window_new (GTK_WINDOW_DIALOG);
3736 gtk_container_set_border_width (GTK_CONTAINER (window), 8);
3737 gtk_window_set_title (GTK_WINDOW (window), _("Key bindings"));
3738 gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
3739 gtk_window_set_modal (GTK_WINDOW (window), TRUE);
3740 gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, FALSE);
3741 manage_window_set_transient (GTK_WINDOW (window));
3743 vbox1 = gtk_vbox_new (FALSE, VSPACING);
3744 gtk_container_add (GTK_CONTAINER (window), vbox1);
3745 gtk_container_set_border_width (GTK_CONTAINER (vbox1), 2);
3747 hbox1 = gtk_hbox_new (FALSE, 8);
3748 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3750 label = gtk_label_new
3751 (_("Select the preset of key bindings.\n"
3752 "You can also modify each menu's shortcuts by pressing\n"
3753 "any key(s) when placing the mouse pointer on the item."));
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 gtkut_button_set_create (&confirm_area, &ok_btn, _("OK"),
3774 &cancel_btn, _("Cancel"), NULL, NULL);
3775 gtk_box_pack_end (GTK_BOX (hbox1), confirm_area, FALSE, FALSE, 0);
3776 gtk_widget_grab_default (ok_btn);
3778 MANAGE_WINDOW_SIGNALS_CONNECT(window);
3779 gtk_signal_connect (GTK_OBJECT (window), "delete_event",
3780 GTK_SIGNAL_FUNC (prefs_keybind_deleted), NULL);
3781 gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
3782 GTK_SIGNAL_FUNC (prefs_keybind_key_pressed), NULL);
3783 gtk_signal_connect (GTK_OBJECT (ok_btn), "clicked",
3784 GTK_SIGNAL_FUNC (prefs_keybind_apply_clicked),
3786 gtk_signal_connect (GTK_OBJECT (cancel_btn), "clicked",
3787 GTK_SIGNAL_FUNC (prefs_keybind_cancel),
3790 gtk_widget_show_all(window);
3792 keybind.window = window;
3793 keybind.combo = combo;
3796 static void prefs_keybind_key_pressed(GtkWidget *widget, GdkEventKey *event,
3799 if (event && event->keyval == GDK_Escape)
3800 prefs_keybind_cancel();
3803 static gint prefs_keybind_deleted(GtkWidget *widget, GdkEventAny *event,
3806 prefs_keybind_cancel();
3810 static void prefs_keybind_cancel(void)
3812 gtk_widget_destroy(keybind.window);
3813 keybind.window = NULL;
3814 keybind.combo = NULL;
3817 static void prefs_keybind_apply_clicked(GtkWidget *widget)
3819 GtkEntry *entry = GTK_ENTRY(GTK_COMBO(keybind.combo)->entry);
3823 static gchar *default_menurc =
3824 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3825 "(menu-path \"<Main>/File/Save as...\" \"<control>S\")\n"
3826 "(menu-path \"<Main>/File/Print...\" \"\")\n"
3827 "(menu-path \"<Main>/File/Exit\" \"<control>Q\")\n"
3829 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3830 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3831 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3832 "(menu-path \"<Main>/Edit/Search folder...\" \"<shift><control>F\")\n"
3834 "(menu-path \"<Main>/View/Expand Summary View\" \"V\")\n"
3835 "(menu-path \"<Main>/View/Expand Message View\" \"<shift>V\")\n"
3836 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3837 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3838 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3839 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3840 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3841 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3842 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3843 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3844 "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
3845 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3847 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3848 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3849 "(menu-path \"<Main>/Message/Compose an email message\" \"<control>M\")\n"
3850 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3851 "(menu-path \"<Main>/Message/Reply to/all\" \"<shift><control>R\")\n"
3852 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
3853 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
3854 "(menu-path \"<Main>/Message/Forward\" \"<control><alt>F\")\n"
3855 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
3856 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3857 "(menu-path \"<Main>/Message/Copy...\" \"<shift><control>O\")\n"
3858 "(menu-path \"<Main>/Message/Delete\" \"<control>D\")\n"
3859 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3860 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3861 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3862 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3864 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3865 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3866 "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
3868 "(menu-path \"<Compose>/File/Close\" \"<control>W\")\n"
3869 "(menu-path \"<Compose>/Edit/Select all\" \"<control>A\")\n"
3870 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
3871 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
3872 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
3873 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
3874 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
3876 static gchar *mew_wl_menurc =
3877 "(menu-path \"<Main>/File/Empty trash\" \"<shift>D\")\n"
3878 "(menu-path \"<Main>/File/Save as...\" \"Y\")\n"
3879 "(menu-path \"<Main>/File/Print...\" \"<shift>numbersign\")\n"
3880 "(menu-path \"<Main>/File/Exit\" \"<shift>Q\")\n"
3882 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3883 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3884 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3885 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
3887 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
3888 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
3889 "(menu-path \"<Main>/View/Thread view\" \"<shift>T\")\n"
3890 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3891 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3892 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3893 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3894 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3895 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3896 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3897 "(menu-path \"<Main>/View/Show all headers\" \"<shift>H\")\n"
3898 "(menu-path \"<Main>/View/Update\" \"<shift>S\")\n"
3900 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3901 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3902 "(menu-path \"<Main>/Message/Compose an email message\" \"W\")\n"
3903 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3904 "(menu-path \"<Main>/Message/Reply to/all\" \"<shift>A\")\n"
3905 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
3906 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
3907 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3908 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift>F\")\n" */
3909 "(menu-path \"<Main>/Message/Move...\" \"O\")\n"
3910 "(menu-path \"<Main>/Message/Copy...\" \"<shift>O\")\n"
3911 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3912 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3913 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3914 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3915 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"<shift>R\")\n"
3917 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3918 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3919 "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
3921 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3922 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3923 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3924 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3925 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3926 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3927 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3929 static gchar *mutt_menurc =
3930 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3931 "(menu-path \"<Main>/File/Save as...\" \"S\")\n"
3932 "(menu-path \"<Main>/File/Print...\" \"P\")\n"
3933 "(menu-path \"<Main>/File/Exit\" \"Q\")\n"
3935 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3936 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3937 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3938 "(menu-path \"<Main>/Edit/Search messages...\" \"slash\")\n"
3940 "(menu-path \"<Main>/View/Toggle summary view\" \"V\")\n"
3941 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3942 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
3943 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
3944 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
3945 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
3946 "(menu-path \"<Main>/View/Go to/Other folder...\" \"C\")\n"
3947 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3948 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3949 "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
3950 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3952 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3953 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3954 "(menu-path \"<Main>/Message/Compose new message\" \"M\")\n"
3955 "(menu-path \"<Main>/Message/Reply\" \"R\")\n"
3956 "(menu-path \"<Main>/Message/Reply to/all\" \"G\")\n"
3957 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
3958 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
3959 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3960 "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n"
3961 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3962 "(menu-path \"<Main>/Message/Copy...\" \"<shift>C\")\n"
3963 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3964 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>F\")\n"
3965 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3966 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>N\")\n"
3967 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3969 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3970 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3971 "(menu-path \"<Main>/Tools/Log window\" \"<shift><control>L\")\n"
3973 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3974 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3975 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3976 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3977 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3978 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3979 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3981 static gchar *old_sylpheed_menurc =
3982 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3983 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
3984 "(menu-path \"<Main>/File/Print...\" \"<alt>P\")\n"
3985 "(menu-path \"<Main>/File/Exit\" \"<alt>Q\")\n"
3987 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3988 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3989 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3990 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
3992 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
3993 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
3994 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3995 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3996 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3997 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3998 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3999 "(menu-path \"<Main>/View/Go to/Other folder...\" \"<alt>G\")\n"
4000 "(menu-path \"<Main>/View/Open in new window\" \"<shift><control>N\")\n"
4001 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
4002 "(menu-path \"<Main>/View/Show all headers\" \"<control>H\")\n"
4003 "(menu-path \"<Main>/View/Update\" \"<alt>U\")\n"
4005 "(menu-path \"<Main>/Message/Get new mail\" \"<alt>I\")\n"
4006 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><alt>I\")\n"
4007 "(menu-path \"<Main>/Message/Compose an email message\" \"<alt>N\")\n"
4008 "(menu-path \"<Main>/Message/Reply\" \"<alt>R\")\n"
4009 "(menu-path \"<Main>/Message/Reply to/all\" \"<shift><alt>R\")\n"
4010 "(menu-path \"<Main>/Message/Reply to/sender\" \"<control><alt>R\")\n"
4011 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"<control>L\")\n"
4012 "(menu-path \"<Main>/Message/Forward\" \"<shift><alt>F\")\n"
4013 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift><control>F\")\n" */
4014 "(menu-path \"<Main>/Message/Move...\" \"<alt>O\")\n"
4015 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
4016 "(menu-path \"<Main>/Message/Delete\" \"<alt>D\")\n"
4017 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
4018 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
4019 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
4020 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
4022 "(menu-path \"<Main>/Tools/Address book\" \"<alt>A\")\n"
4023 "(menu-path \"<Main>/Tools/Execute\" \"<alt>X\")\n"
4024 "(menu-path \"<Main>/Tools/Log window\" \"<alt>L\")\n"
4026 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
4027 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
4028 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
4029 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
4030 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
4031 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
4032 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
4034 static gchar *empty_menurc =
4035 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
4036 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
4037 "(menu-path \"<Main>/File/Print...\" \"\")\n"
4038 "(menu-path \"<Main>/File/Exit\" \"\")\n"
4040 "(menu-path \"<Main>/Edit/Copy\" \"\")\n"
4041 "(menu-path \"<Main>/Edit/Select all\" \"\")\n"
4042 "(menu-path \"<Main>/Edit/Find in current message...\" \"\")\n"
4043 "(menu-path \"<Main>/Edit/Search folder...\" \"\")\n"
4045 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
4046 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
4047 "(menu-path \"<Main>/View/Thread view\" \"\")\n"
4048 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
4049 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
4050 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
4051 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
4052 "(menu-path \"<Main>/View/Go to/Other folder...\" \"\")\n"
4053 "(menu-path \"<Main>/View/Open in new window\" \"\")\n"
4054 "(menu-path \"<Main>/View/View source\" \"\")\n"
4055 "(menu-path \"<Main>/View/Show all headers\" \"\")\n"
4056 "(menu-path \"<Main>/View/Update\" \"\")\n"
4058 "(menu-path \"<Main>/Message/Get new mail\" \"\")\n"
4059 "(menu-path \"<Main>/Message/Get from all accounts\" \"\")\n"
4060 "(menu-path \"<Main>/Message/Compose an email message\" \"\")\n"
4061 "(menu-path \"<Main>/Message/Reply\" \"\")\n"
4062 "(menu-path \"<Main>/Message/Reply to/all\" \"\")\n"
4063 "(menu-path \"<Main>/Message/Reply to/sender\" \"\")\n"
4064 "(menu-path \"<Main>/Message/Reply to/mailing list\" \"\")\n"
4065 "(menu-path \"<Main>/Message/Forward\" \"\")\n"
4066 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
4067 "(menu-path \"<Main>/Message/Move...\" \"\")\n"
4068 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
4069 "(menu-path \"<Main>/Message/Delete\" \"\")\n"
4070 "(menu-path \"<Main>/Message/Mark/Mark\" \"\")\n"
4071 "(menu-path \"<Main>/Message/Mark/Unmark\" \"\")\n"
4072 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"\")\n"
4073 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
4075 "(menu-path \"<Main>/Tools/Address book\" \"\")\n"
4076 "(menu-path \"<Main>/Tools/Execute\" \"\")\n"
4077 "(menu-path \"<Main>/Tools/Log window\" \"\")\n"
4079 "(menu-path \"<Compose>/File/Close\" \"\")\n"
4080 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
4081 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
4082 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
4083 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
4084 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
4085 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
4087 text = gtk_entry_get_text(entry);
4089 if (!strcmp(text, _("Default")))
4090 rc_str = default_menurc;
4091 else if (!strcmp(text, "Mew / Wanderlust"))
4092 rc_str = mew_wl_menurc;
4093 else if (!strcmp(text, "Mutt"))
4094 rc_str = mutt_menurc;
4095 else if (!strcmp(text, _("Old Sylpheed")))
4096 rc_str = old_sylpheed_menurc;
4100 gtk_item_factory_parse_rc_string(empty_menurc);
4101 gtk_item_factory_parse_rc_string(rc_str);
4103 gtk_widget_destroy(keybind.window);
4104 keybind.window = NULL;
4105 keybind.combo = NULL;
4108 static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam)
4111 GtkWidget *menuitem;
4114 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4115 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4116 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
4117 g_free(*((gchar **)pparam->data));
4118 *((gchar **)pparam->data) = g_strdup(charset);
4121 static void prefs_common_charset_set_optmenu(PrefParam *pparam)
4123 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4126 g_return_if_fail(optmenu != NULL);
4127 g_return_if_fail(*((gchar **)pparam->data) != NULL);
4129 index = menu_find_option_menu_index(optmenu, *((gchar **)pparam->data),
4130 (GCompareFunc)strcmp);
4132 gtk_option_menu_set_history(optmenu, index);
4134 gtk_option_menu_set_history(optmenu, 0);
4135 prefs_common_charset_set_data_from_optmenu(pparam);
4139 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam)
4142 GtkWidget *menuitem;
4144 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4145 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4146 *((RecvDialogMode *)pparam->data) = GPOINTER_TO_INT
4147 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4150 static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
4152 RecvDialogMode mode = *((RecvDialogMode *)pparam->data);
4153 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4155 GtkWidget *menuitem;
4158 case RECV_DIALOG_ALWAYS:
4159 gtk_option_menu_set_history(optmenu, 0);
4161 case RECV_DIALOG_ACTIVE:
4162 gtk_option_menu_set_history(optmenu, 1);
4164 case RECV_DIALOG_NEVER:
4165 gtk_option_menu_set_history(optmenu, 2);
4171 menu = gtk_option_menu_get_menu(optmenu);
4172 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4173 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4176 static void prefs_common_send_dialog_set_data_from_optmenu(PrefParam *pparam)
4179 GtkWidget *menuitem;
4181 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4182 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4183 *((SendDialogMode *)pparam->data) = GPOINTER_TO_INT
4184 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4187 static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam)
4189 SendDialogMode mode = *((SendDialogMode *)pparam->data);
4190 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4192 GtkWidget *menuitem;
4195 case SEND_DIALOG_ALWAYS:
4196 gtk_option_menu_set_history(optmenu, 0);
4198 case SEND_DIALOG_NEVER:
4199 gtk_option_menu_set_history(optmenu, 1);
4205 menu = gtk_option_menu_get_menu(optmenu);
4206 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4207 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4210 static gint prefs_common_deleted(GtkWidget *widget, GdkEventAny *event,
4213 prefs_common_cancel();
4217 static void prefs_common_key_pressed(GtkWidget *widget, GdkEventKey *event,
4220 if (event && event->keyval == GDK_Escape)
4221 prefs_common_cancel();
4224 static void prefs_common_ok(void)
4226 prefs_common_apply();
4227 gtk_widget_hide(dialog.window);
4232 static void prefs_common_apply(void)
4234 gchar *entry_pixmap_theme_str;
4235 gboolean update_pixmap_theme;
4237 entry_pixmap_theme_str = gtk_entry_get_text(GTK_ENTRY(interface.entry_pixmap_theme));
4238 if (entry_pixmap_theme_str &&
4239 (strcmp(prefs_common.pixmap_theme_path, entry_pixmap_theme_str) != 0) )
4240 update_pixmap_theme = TRUE;
4242 update_pixmap_theme = FALSE;
4244 prefs_set_data_from_dialog(param);
4246 if (update_pixmap_theme)
4248 main_window_reflect_prefs_all_real(TRUE);
4249 compose_reflect_prefs_pixmap_theme();
4251 main_window_reflect_prefs_all_real(FALSE);
4253 prefs_common_save_config();
4255 inc_autocheck_timer_remove();
4256 inc_autocheck_timer_set();
4259 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam)
4262 GtkWidget *menuitem;
4264 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4265 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4266 *((NextUnreadMsgDialogShow *)pparam->data) = GPOINTER_TO_INT
4267 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4270 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam)
4272 NextUnreadMsgDialogShow dialog_show;
4273 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4275 GtkWidget *menuitem;
4277 dialog_show = *((NextUnreadMsgDialogShow *)pparam->data);
4279 switch (dialog_show) {
4280 case NEXTUNREADMSGDIALOG_ALWAYS:
4281 gtk_option_menu_set_history(optmenu, 0);
4283 case NEXTUNREADMSGDIALOG_ASSUME_YES:
4284 gtk_option_menu_set_history(optmenu, 1);
4286 case NEXTUNREADMSGDIALOG_ASSUME_NO:
4287 gtk_option_menu_set_history(optmenu, 2);
4291 menu = gtk_option_menu_get_menu(optmenu);
4292 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4293 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4296 static void prefs_common_cancel(void)
4298 gtk_widget_hide(dialog.window);
4303 /* static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
4306 GtkWidget *menuitem;
4308 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4309 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4310 *((RecvDialogShow *)pparam->data) = GPOINTER_TO_INT
4311 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4314 /* static void prefs_recvdialog_set_optmenu(PrefParam *pparam)
4316 RecvDialogShow dialog_show;
4317 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4319 GtkWidget *menuitem;
4321 dialog_show = *((RecvDialogShow *)pparam->data);
4323 switch (dialog_show) {
4324 case RECVDIALOG_ALWAYS:
4325 gtk_option_menu_set_history(optmenu, 0);
4327 case RECVDIALOG_WINDOW_ACTIVE:
4328 gtk_option_menu_set_history(optmenu, 1);
4330 case RECVDIALOG_NEVER:
4331 gtk_option_menu_set_history(optmenu, 2);
4336 menu = gtk_option_menu_get_menu(optmenu);
4337 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4338 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));