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_forward_as_attachment;
125 GtkWidget *checkbtn_redirect_keep_from;
126 GtkWidget *checkbtn_smart_wrapping;
127 GtkWidget *checkbtn_block_cursor;
128 GtkWidget *checkbtn_reply_with_quote;
130 GtkWidget *checkbtn_autosave;
131 GtkWidget *entry_autosave_length;
136 static struct Spelling {
137 GtkWidget *checkbtn_enable_aspell;
138 GtkWidget *entry_aspell_path;
139 GtkWidget *btn_aspell_path;
140 GtkWidget *optmenu_dictionary;
141 GtkWidget *optmenu_sugmode;
142 GtkWidget *misspelled_btn;
143 GtkWidget *checkbtn_use_alternate;
144 GtkWidget *checkbtn_check_while_typing;
148 static struct Quote {
149 GtkWidget *entry_quotemark;
150 GtkWidget *text_quotefmt;
152 GtkWidget *entry_fw_quotemark;
153 GtkWidget *text_fw_quotefmt;
155 GtkWidget *entry_quote_chars;
158 static struct Display {
159 GtkWidget *entry_textfont;
160 GtkWidget *button_textfont;
162 GtkWidget *entry_smallfont;
163 GtkWidget *entry_normalfont;
164 GtkWidget *entry_boldfont;
166 GtkWidget *chkbtn_folder_unread;
167 GtkWidget *chkbtn_display_img;
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_hscrollbar;
176 GtkWidget *chkbtn_useaddrbook;
177 GtkWidget *chkbtn_expand_thread;
178 GtkWidget *chkbtn_bold_unread;
179 GtkWidget *entry_datefmt;
182 static struct Message {
183 GtkWidget *chkbtn_enablecol;
184 GtkWidget *button_edit_col;
185 GtkWidget *chkbtn_mbalnum;
186 GtkWidget *chkbtn_disphdrpane;
187 GtkWidget *chkbtn_disphdr;
188 GtkWidget *spinbtn_linespc;
189 GtkObject *spinbtn_linespc_adj;
190 GtkWidget *chkbtn_headspc;
192 GtkWidget *chkbtn_smoothscroll;
193 GtkWidget *spinbtn_scrollstep;
194 GtkObject *spinbtn_scrollstep_adj;
195 GtkWidget *chkbtn_halfpage;
199 static struct Privacy {
200 GtkWidget *checkbtn_auto_check_signatures;
201 GtkWidget *checkbtn_gpg_signature_popup;
202 GtkWidget *checkbtn_store_passphrase;
203 GtkWidget *spinbtn_store_passphrase;
204 GtkObject *spinbtn_store_passphrase_adj;
205 GtkWidget *checkbtn_passphrase_grab;
206 GtkWidget *checkbtn_gpg_warning;
210 static struct Interface {
211 /* GtkWidget *checkbtn_emacs; */
212 GtkWidget *checkbtn_show_msg_with_cursor;
213 GtkWidget *checkbtn_openunread;
214 GtkWidget *checkbtn_mark_as_read_on_newwin;
215 GtkWidget *checkbtn_openinbox;
216 GtkWidget *checkbtn_immedexec;
217 GtkWidget *checkbtn_addaddrbyclick;
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_confonexit;
234 GtkWidget *checkbtn_cleanonexit;
235 GtkWidget *checkbtn_askonclean;
236 GtkWidget *checkbtn_warnqueued;
237 GtkWidget *checkbtn_cliplog;
238 GtkWidget *loglength_entry;
242 static struct MessageColorButtons {
243 GtkWidget *quote_level1_btn;
244 GtkWidget *quote_level2_btn;
245 GtkWidget *quote_level3_btn;
247 GtkWidget *tgt_folder_btn;
248 GtkWidget *signature_btn;
251 static struct KeybindDialog {
256 static GtkWidget *font_sel_win;
257 static guint font_sel_conn_id;
258 static GtkWidget *quote_color_win;
259 static GtkWidget *color_dialog;
261 static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam);
262 static void prefs_common_charset_set_optmenu (PrefParam *pparam);
263 static void prefs_common_recv_dialog_newmail_notify_toggle_cb (GtkWidget *w,
265 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam);
266 static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam);
267 static void prefs_common_send_dialog_set_data_from_optmenu(PrefParam *pparam);
268 static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam);
269 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam);
270 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam);
273 static void prefs_dictionary_set_data_from_optmenu (PrefParam *param);
274 static void prefs_dictionary_set_optmenu (PrefParam *pparam);
275 static void prefs_speller_sugmode_set_data_from_optmenu (PrefParam *pparam);
276 static void prefs_speller_sugmode_set_optmenu (PrefParam *pparam);
281 parameter name, default value, pointer to the prefs variable, data type,
282 pointer to the widget pointer,
283 pointer to the function for data setting,
284 pointer to the function for widget setting
287 static PrefParam param[] = {
289 {"use_ext_inc", "FALSE", &prefs_common.use_extinc, P_BOOL,
290 &receive.checkbtn_incext,
291 prefs_set_data_from_toggle, prefs_set_toggle},
292 {"ext_inc_path", DEFAULT_INC_PATH, &prefs_common.extinc_cmd, P_STRING,
293 &receive.entry_incext,
294 prefs_set_data_from_entry, prefs_set_entry},
296 {"inc_local", "TRUE", &prefs_common.inc_local, P_BOOL,
297 &receive.checkbtn_local,
298 prefs_set_data_from_toggle, prefs_set_toggle},
299 {"filter_on_inc_local", "FALSE", &prefs_common.filter_on_inc, P_BOOL,
300 &receive.checkbtn_filter_on_inc,
301 prefs_set_data_from_toggle, prefs_set_toggle},
302 {"spool_path", DEFAULT_SPOOL_PATH, &prefs_common.spool_path, P_STRING,
303 &receive.entry_spool,
304 prefs_set_data_from_entry, prefs_set_entry},
306 {"autochk_newmail", "FALSE", &prefs_common.autochk_newmail, P_BOOL,
307 &receive.checkbtn_autochk,
308 prefs_set_data_from_toggle, prefs_set_toggle},
309 {"autochk_interval", "10", &prefs_common.autochk_itv, P_INT,
310 &receive.spinbtn_autochk,
311 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
312 {"check_on_startup", "FALSE", &prefs_common.chk_on_startup, P_BOOL,
313 &receive.checkbtn_chkonstartup,
314 prefs_set_data_from_toggle, prefs_set_toggle},
315 {"scan_all_after_inc", "FALSE", &prefs_common.scan_all_after_inc,
316 P_BOOL, &receive.checkbtn_scan_after_inc,
317 prefs_set_data_from_toggle, prefs_set_toggle},
318 {"newmail_notify_manu", "FALSE", &prefs_common.newmail_notify_manu,
319 P_BOOL, &receive.checkbtn_newmail_manu,
320 prefs_set_data_from_toggle, prefs_set_toggle},
321 {"newmail_notify_auto", "FALSE", &prefs_common.newmail_notify_auto,
322 P_BOOL, &receive.checkbtn_newmail_auto,
323 prefs_set_data_from_toggle, prefs_set_toggle},
324 {"newmail_notify_cmd", "", &prefs_common.newmail_notify_cmd, P_STRING,
325 &receive.entry_newmail_notify_cmd,
326 prefs_set_data_from_entry, prefs_set_entry},
328 {"max_news_articles", "300", &prefs_common.max_articles, P_INT,
329 &receive.spinbtn_maxarticle,
330 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
333 {"use_ext_sendmail", "FALSE", &prefs_common.use_extsend, P_BOOL,
334 &p_send.checkbtn_extsend,
335 prefs_set_data_from_toggle, prefs_set_toggle},
336 {"ext_sendmail_cmd", DEFAULT_SENDMAIL_CMD,
337 &prefs_common.extsend_cmd, P_STRING,
338 &p_send.entry_extsend, prefs_set_data_from_entry, prefs_set_entry},
339 {"save_message", "TRUE", &prefs_common.savemsg, P_BOOL,
340 &p_send.checkbtn_savemsg,
341 prefs_set_data_from_toggle, prefs_set_toggle},
342 {"queue_message", "FALSE", &prefs_common.queue_msg, P_BOOL,
343 &p_send.checkbtn_queuemsg,
344 prefs_set_data_from_toggle, prefs_set_toggle},
346 {"outgoing_charset", CS_AUTO, &prefs_common.outgoing_charset, P_STRING,
347 &p_send.optmenu_charset,
348 prefs_common_charset_set_data_from_optmenu,
349 prefs_common_charset_set_optmenu},
352 {"auto_signature", "TRUE", &prefs_common.auto_sig, P_BOOL,
353 &compose.checkbtn_autosig,
354 prefs_set_data_from_toggle, prefs_set_toggle},
355 {"signature_separator", "-- ", &prefs_common.sig_sep, P_STRING,
356 &compose.entry_sigsep, prefs_set_data_from_entry, prefs_set_entry},
358 {"auto_ext_editor", "FALSE", &prefs_common.auto_exteditor, P_BOOL,
359 &compose.checkbtn_autoextedit,
360 prefs_set_data_from_toggle, prefs_set_toggle},
361 {"forward_as_attachment", "FALSE", &prefs_common.forward_as_attachment,
362 P_BOOL, &compose.checkbtn_forward_as_attachment,
363 prefs_set_data_from_toggle, prefs_set_toggle},
364 {"redirect_keep_from", "FALSE",
365 &prefs_common.redirect_keep_from, P_BOOL,
366 &compose.checkbtn_redirect_keep_from,
367 prefs_set_data_from_toggle, prefs_set_toggle},
368 {"undo_level", "50", &prefs_common.undolevels, P_INT,
369 &compose.spinbtn_undolevel,
370 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
371 {"block_cursor", "FALSE", &prefs_common.block_cursor,
372 P_BOOL, &compose.checkbtn_block_cursor,
373 prefs_set_data_from_toggle, prefs_set_toggle},
375 {"linewrap_length", "72", &prefs_common.linewrap_len, P_INT,
376 &compose.spinbtn_linewrap,
377 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
378 {"linewrap_quotation", "FALSE", &prefs_common.linewrap_quote, P_BOOL,
379 &compose.checkbtn_wrapquote,
380 prefs_set_data_from_toggle, prefs_set_toggle},
381 {"linewrap_auto", "FALSE", &prefs_common.autowrap, P_BOOL,
382 &compose.checkbtn_autowrap,
383 prefs_set_data_from_toggle, prefs_set_toggle},
384 {"linewrap_before_sending", "FALSE",
385 &prefs_common.linewrap_at_send, P_BOOL,
386 &compose.checkbtn_wrapatsend,
387 prefs_set_data_from_toggle, prefs_set_toggle},
388 {"smart_wrapping", "TRUE", &prefs_common.smart_wrapping,
389 P_BOOL, &compose.checkbtn_smart_wrapping,
390 prefs_set_data_from_toggle, prefs_set_toggle},
391 {"autosave", "FALSE", &prefs_common.autosave,
392 P_BOOL, &compose.checkbtn_autosave,
393 prefs_set_data_from_toggle, prefs_set_toggle},
394 {"autosave_length", "50", &prefs_common.autosave_length,
395 P_INT, &compose.entry_autosave_length,
396 prefs_set_data_from_entry, prefs_set_entry},
398 {"enable_aspell", "TRUE", &prefs_common.enable_aspell,
399 P_BOOL, &spelling.checkbtn_enable_aspell,
400 prefs_set_data_from_toggle, prefs_set_toggle},
401 {"aspell_path", ASPELL_PATH, &prefs_common.aspell_path,
402 P_STRING, &spelling.entry_aspell_path,
403 prefs_set_data_from_entry, prefs_set_entry},
404 {"dictionary", "", &prefs_common.dictionary,
405 P_STRING, &spelling.optmenu_dictionary,
406 prefs_dictionary_set_data_from_optmenu, prefs_dictionary_set_optmenu },
407 {"aspell_sugmode", "1", &prefs_common.aspell_sugmode,
408 P_INT, &spelling.optmenu_sugmode,
409 prefs_speller_sugmode_set_data_from_optmenu, prefs_speller_sugmode_set_optmenu },
410 {"use_alternate_dict", "FALSE", &prefs_common.use_alternate,
411 P_BOOL, &spelling.checkbtn_use_alternate,
412 prefs_set_data_from_toggle, prefs_set_toggle},
413 {"check_while_typing", "TRUE", &prefs_common.check_while_typing,
414 P_BOOL, &spelling.checkbtn_check_while_typing,
415 prefs_set_data_from_toggle, prefs_set_toggle},
416 {"misspelled_color", "16711680", &prefs_common.misspelled_col, P_INT,
419 {"reply_with_quote", "TRUE", &prefs_common.reply_with_quote, P_BOOL,
420 &compose.checkbtn_reply_with_quote, prefs_set_data_from_toggle, prefs_set_toggle},
422 /* Account autoselection */
423 {"reply_account_autoselect", "TRUE",
424 &prefs_common.reply_account_autosel, P_BOOL,
425 &compose.checkbtn_reply_account_autosel,
426 prefs_set_data_from_toggle, prefs_set_toggle},
427 {"forward_account_autoselect", "TRUE",
428 &prefs_common.forward_account_autosel, P_BOOL,
429 &compose.checkbtn_forward_account_autosel,
430 prefs_set_data_from_toggle, prefs_set_toggle},
431 {"reedit_account_autoselect", "TRUE",
432 &prefs_common.reedit_account_autosel, P_BOOL,
433 &compose.checkbtn_reedit_account_autosel,
434 prefs_set_data_from_toggle, prefs_set_toggle},
436 {"show_ruler", "TRUE", &prefs_common.show_ruler, P_BOOL,
440 {"reply_quote_mark", "> ", &prefs_common.quotemark, P_STRING,
441 "e.entry_quotemark, prefs_set_data_from_entry, prefs_set_entry},
442 {"reply_quote_format", "On %d\\n%f wrote:\\n\\n%Q",
443 &prefs_common.quotefmt, P_STRING, "e.text_quotefmt,
444 prefs_set_data_from_text, prefs_set_text},
446 {"forward_quote_mark", "> ", &prefs_common.fw_quotemark, P_STRING,
447 "e.entry_fw_quotemark,
448 prefs_set_data_from_entry, prefs_set_entry},
449 {"forward_quote_format",
450 "\\n\\nBegin forwarded message:\\n\\n"
451 "?d{Date: %d\\n}?f{From: %f\\n}?t{To: %t\\n}?c{Cc: %c\\n}"
452 "?n{Newsgroups: %n\\n}?s{Subject: %s\\n}\\n\\n%M",
453 &prefs_common.fw_quotefmt, P_STRING, "e.text_fw_quotefmt,
454 prefs_set_data_from_text, prefs_set_text},
455 {"quote_chars", ">", &prefs_common.quote_chars, P_STRING,
456 "e.entry_quote_chars, prefs_set_data_from_entry, prefs_set_entry},
459 {"widget_font", NULL, &prefs_common.widgetfont, P_STRING,
461 {"message_font", "-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*",
462 &prefs_common.textfont, P_STRING,
463 &display.entry_textfont,
464 prefs_set_data_from_entry, prefs_set_entry},
465 {"small_font", "-*-helvetica-medium-r-normal--10-*-*-*-*-*-*-*",
466 &prefs_common.smallfont, P_STRING,
467 &display.entry_smallfont,
468 prefs_set_data_from_entry, prefs_set_entry},
469 {"bold_font", "-*-helvetica-bold-r-normal--12-*-*-*-*-*-*-*",
470 &prefs_common.boldfont, P_STRING,
471 &display.entry_boldfont,
472 prefs_set_data_from_entry, prefs_set_entry},
473 {"normal_font", "-*-helvetica-medium-r-normal--12-*-*-*-*-*-*-*",
474 &prefs_common.normalfont, P_STRING,
475 &display.entry_normalfont,
476 prefs_set_data_from_entry, prefs_set_entry},
479 {"display_folder_unread_num", "TRUE",
480 &prefs_common.display_folder_unread, P_BOOL,
481 &display.chkbtn_folder_unread,
482 prefs_set_data_from_toggle, prefs_set_toggle},
484 {"display_img", "TRUE",
485 &prefs_common.display_img, P_BOOL,
486 &display.chkbtn_display_img,
487 prefs_set_data_from_toggle, prefs_set_toggle},
488 {"newsgroup_abbrev_len", "16",
489 &prefs_common.ng_abbrev_len, P_INT,
490 &display.spinbtn_ng_abbrev_len,
491 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
493 {"translate_header", "TRUE", &prefs_common.trans_hdr, P_BOOL,
494 &display.chkbtn_transhdr,
495 prefs_set_data_from_toggle, prefs_set_toggle},
497 /* Display: Summary View */
498 {"enable_swap_from", "FALSE", &prefs_common.swap_from, P_BOOL,
499 &display.chkbtn_swapfrom,
500 prefs_set_data_from_toggle, prefs_set_toggle},
501 {"enable_hscrollbar", "TRUE", &prefs_common.enable_hscrollbar, P_BOOL,
502 &display.chkbtn_hscrollbar,
503 prefs_set_data_from_toggle, prefs_set_toggle},
504 {"use_address_book", "TRUE", &prefs_common.use_addr_book, P_BOOL,
505 &display.chkbtn_useaddrbook,
506 prefs_set_data_from_toggle, prefs_set_toggle},
507 {"date_format", "%y/%m/%d(%a) %H:%M", &prefs_common.date_format,
508 P_STRING, &display.entry_datefmt,
509 prefs_set_data_from_entry, prefs_set_entry},
510 {"expand_thread", "TRUE", &prefs_common.expand_thread, P_BOOL,
511 &display.chkbtn_expand_thread,
512 prefs_set_data_from_toggle, prefs_set_toggle},
513 {"bold_unread", "TRUE", &prefs_common.bold_unread, P_BOOL,
514 &display.chkbtn_bold_unread,
515 prefs_set_data_from_toggle, prefs_set_toggle},
517 {"enable_thread", "TRUE", &prefs_common.enable_thread, P_BOOL,
519 {"toolbar_style", "3", &prefs_common.toolbar_style, P_ENUM,
521 {"show_statusbar", "TRUE", &prefs_common.show_statusbar, P_BOOL,
523 {"show_searchbar", "TRUE", &prefs_common.show_searchbar, P_BOOL,
526 {"folderview_vscrollbar_policy", "0",
527 &prefs_common.folderview_vscrollbar_policy, P_ENUM,
530 {"summary_col_show_mark", "TRUE",
531 &prefs_common.summary_col_visible[S_COL_MARK], P_BOOL, NULL, NULL, NULL},
532 {"summary_col_show_unread", "TRUE",
533 &prefs_common.summary_col_visible[S_COL_UNREAD], P_BOOL, NULL, NULL, NULL},
534 {"summary_col_show_mime", "TRUE",
535 &prefs_common.summary_col_visible[S_COL_MIME], P_BOOL, NULL, NULL, NULL},
536 {"summary_col_show_subject", "TRUE",
537 &prefs_common.summary_col_visible[S_COL_SUBJECT], P_BOOL, NULL, NULL, NULL},
538 {"summary_col_show_from", "TRUE",
539 &prefs_common.summary_col_visible[S_COL_FROM], P_BOOL, NULL, NULL, NULL},
540 {"summary_col_show_date", "TRUE",
541 &prefs_common.summary_col_visible[S_COL_DATE], P_BOOL, NULL, NULL, NULL},
542 {"summary_col_show_size", "TRUE",
543 &prefs_common.summary_col_visible[S_COL_SIZE], P_BOOL, NULL, NULL, NULL},
544 {"summary_col_show_number", "FALSE",
545 &prefs_common.summary_col_visible[S_COL_NUMBER], P_BOOL, NULL, NULL, NULL},
546 {"summary_col_show_score", "FALSE",
547 &prefs_common.summary_col_visible[S_COL_SCORE], P_BOOL, NULL, NULL, NULL},
548 {"summary_col_show_locked", "FALSE",
549 &prefs_common.summary_col_visible[S_COL_LOCKED], P_BOOL, NULL, NULL, NULL},
551 {"summary_col_pos_mark", "0",
552 &prefs_common.summary_col_pos[S_COL_MARK], P_INT, NULL, NULL, NULL},
553 {"summary_col_pos_unread", "1",
554 &prefs_common.summary_col_pos[S_COL_UNREAD], P_INT, NULL, NULL, NULL},
555 {"summary_col_pos_mime", "2",
556 &prefs_common.summary_col_pos[S_COL_MIME], P_INT, NULL, NULL, NULL},
557 {"summary_col_pos_subject", "3",
558 &prefs_common.summary_col_pos[S_COL_SUBJECT], P_INT, NULL, NULL, NULL},
559 {"summary_col_pos_from", "4",
560 &prefs_common.summary_col_pos[S_COL_FROM], P_INT, NULL, NULL, NULL},
561 {"summary_col_pos_date", "5",
562 &prefs_common.summary_col_pos[S_COL_DATE], P_INT, NULL, NULL, NULL},
563 {"summary_col_pos_size", "6",
564 &prefs_common.summary_col_pos[S_COL_SIZE], P_INT, NULL, NULL, NULL},
565 {"summary_col_pos_number", "7",
566 &prefs_common.summary_col_pos[S_COL_NUMBER], P_INT, NULL, NULL, NULL},
567 {"summary_col_pos_score", "8",
568 &prefs_common.summary_col_pos[S_COL_SCORE], P_INT, NULL, NULL, NULL},
569 {"summary_col_pos_locked", "9",
570 &prefs_common.summary_col_pos[S_COL_LOCKED], P_INT, NULL, NULL, NULL},
572 {"summary_col_size_mark", "10",
573 &prefs_common.summary_col_size[S_COL_MARK], P_INT, NULL, NULL, NULL},
574 {"summary_col_size_unread", "13",
575 &prefs_common.summary_col_size[S_COL_UNREAD], P_INT, NULL, NULL, NULL},
576 {"summary_col_size_mime", "10",
577 &prefs_common.summary_col_size[S_COL_MIME], P_INT, NULL, NULL, NULL},
578 {"summary_col_size_subject", "200",
579 &prefs_common.summary_col_size[S_COL_SUBJECT], P_INT, NULL, NULL, NULL},
580 {"summary_col_size_from", "120",
581 &prefs_common.summary_col_size[S_COL_FROM], P_INT, NULL, NULL, NULL},
582 {"summary_col_size_date", "118",
583 &prefs_common.summary_col_size[S_COL_DATE], P_INT, NULL, NULL, NULL},
584 {"summary_col_size_size", "45",
585 &prefs_common.summary_col_size[S_COL_SIZE], P_INT, NULL, NULL, NULL},
586 {"summary_col_size_number", "40",
587 &prefs_common.summary_col_size[S_COL_NUMBER], P_INT, NULL, NULL, NULL},
588 {"summary_col_size_score", "40",
589 &prefs_common.summary_col_size[S_COL_SCORE], P_INT, NULL, NULL, NULL},
590 {"summary_col_size_locked", "13",
591 &prefs_common.summary_col_size[S_COL_LOCKED], P_INT, NULL, NULL, NULL},
594 {"folderview_width", "179", &prefs_common.folderview_width, P_INT,
596 {"folderview_height", "600", &prefs_common.folderview_height, P_INT,
598 {"folder_col_folder", "150", &prefs_common.folder_col_folder, P_INT,
600 {"folder_col_new", "32", &prefs_common.folder_col_new, P_INT,
602 {"folder_col_unread", "32", &prefs_common.folder_col_unread, P_INT,
604 {"folder_col_total", "32", &prefs_common.folder_col_total, P_INT,
607 {"summaryview_width", "600", &prefs_common.summaryview_width, P_INT,
609 {"summaryview_height", "173", &prefs_common.summaryview_height, P_INT,
612 {"mainview_x", "64", &prefs_common.mainview_x, P_INT,
614 {"mainview_y", "64", &prefs_common.mainview_y, P_INT,
616 {"mainview_width", "600", &prefs_common.mainview_width, P_INT,
618 {"mainview_height", "600", &prefs_common.mainview_height, P_INT,
620 {"mainwin_x", "64", &prefs_common.mainwin_x, P_INT,
622 {"mainwin_y", "64", &prefs_common.mainwin_y, P_INT,
624 {"mainwin_width", "800", &prefs_common.mainwin_width, P_INT,
626 {"mainwin_height", "600", &prefs_common.mainwin_height, P_INT,
628 {"messagewin_width", "600", &prefs_common.msgwin_width, P_INT,
630 {"messagewin_height", "540", &prefs_common.msgwin_height, P_INT,
632 {"compose_width", "600", &prefs_common.compose_width, P_INT,
634 {"compose_height", "560", &prefs_common.compose_height, P_INT,
638 {"enable_color", "TRUE", &prefs_common.enable_color, P_BOOL,
639 &message.chkbtn_enablecol,
640 prefs_set_data_from_toggle, prefs_set_toggle},
642 {"quote_level1_color", "179", &prefs_common.quote_level1_col, P_INT,
644 {"quote_level2_color", "179", &prefs_common.quote_level2_col, P_INT,
646 {"quote_level3_color", "179", &prefs_common.quote_level3_col, P_INT,
648 {"uri_color", "32512", &prefs_common.uri_col, P_INT,
650 {"target_folder_color", "14294218", &prefs_common.tgt_folder_col, P_INT,
652 {"signature_color", "7960953", &prefs_common.signature_col, P_INT,
654 {"recycle_quote_colors", "FALSE", &prefs_common.recycle_quote_colors,
655 P_BOOL, NULL, NULL, NULL},
657 {"convert_mb_alnum", "FALSE", &prefs_common.conv_mb_alnum, P_BOOL,
658 &message.chkbtn_mbalnum,
659 prefs_set_data_from_toggle, prefs_set_toggle},
660 {"display_header_pane", "TRUE", &prefs_common.display_header_pane,
661 P_BOOL, &message.chkbtn_disphdrpane,
662 prefs_set_data_from_toggle, prefs_set_toggle},
663 {"display_header", "TRUE", &prefs_common.display_header, P_BOOL,
664 &message.chkbtn_disphdr,
665 prefs_set_data_from_toggle, prefs_set_toggle},
666 {"line_space", "2", &prefs_common.line_space, P_INT,
667 &message.spinbtn_linespc,
668 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
669 {"enable_head_space", "FALSE", &prefs_common.head_space, P_BOOL,
670 &message.chkbtn_headspc,
671 prefs_set_data_from_toggle, prefs_set_toggle},
673 {"enable_smooth_scroll", "FALSE",
674 &prefs_common.enable_smooth_scroll, P_BOOL,
675 &message.chkbtn_smoothscroll,
676 prefs_set_data_from_toggle, prefs_set_toggle},
677 {"scroll_step", "1", &prefs_common.scroll_step, P_INT,
678 &message.spinbtn_scrollstep,
679 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
680 {"scroll_half_page", "FALSE", &prefs_common.scroll_halfpage, P_BOOL,
681 &message.chkbtn_halfpage,
682 prefs_set_data_from_toggle, prefs_set_toggle},
684 {"show_other_header", "FALSE", &prefs_common.show_other_header, P_BOOL,
688 {"mime_image_viewer", "display '%s'",
689 &prefs_common.mime_image_viewer, P_STRING, NULL, NULL, NULL},
690 {"mime_audio_player", "play '%s'",
691 &prefs_common.mime_audio_player, P_STRING, NULL, NULL, NULL},
692 {"mime_open_command", "gedit '%s'",
693 &prefs_common.mime_open_cmd, P_STRING, NULL, NULL, NULL},
697 {"auto_check_signatures", "TRUE",
698 &prefs_common.auto_check_signatures, P_BOOL,
699 &privacy.checkbtn_auto_check_signatures,
700 prefs_set_data_from_toggle, prefs_set_toggle},
701 {"gpg_signature_popup", "FALSE",
702 &prefs_common.gpg_signature_popup, P_BOOL,
703 &privacy.checkbtn_gpg_signature_popup,
704 prefs_set_data_from_toggle, prefs_set_toggle},
705 {"store_passphrase", "FALSE", &prefs_common.store_passphrase, P_BOOL,
706 &privacy.checkbtn_store_passphrase,
707 prefs_set_data_from_toggle, prefs_set_toggle},
708 {"store_passphrase_timeout", "0",
709 &prefs_common.store_passphrase_timeout, P_INT,
710 &privacy.spinbtn_store_passphrase,
711 prefs_set_data_from_spinbtn, prefs_set_spinbtn},
713 {"passphrase_grab", "FALSE", &prefs_common.passphrase_grab, P_BOOL,
714 &privacy.checkbtn_passphrase_grab,
715 prefs_set_data_from_toggle, prefs_set_toggle},
716 #endif /* __MINGW32__ */
717 {"gpg_warning", "TRUE", &prefs_common.gpg_warning, P_BOOL,
718 &privacy.checkbtn_gpg_warning,
719 prefs_set_data_from_toggle, prefs_set_toggle},
720 #endif /* USE_GPGME */
723 {"separate_folder", "FALSE", &prefs_common.sep_folder, P_BOOL,
725 {"separate_message", "FALSE", &prefs_common.sep_msg, P_BOOL,
728 /* {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
729 NULL, NULL, NULL}, */
730 {"show_message_with_cursor_key", "FALSE",
731 &prefs_common.show_msg_with_cursor_key,
732 P_BOOL, &interface.checkbtn_show_msg_with_cursor,
733 prefs_set_data_from_toggle, prefs_set_toggle},
734 {"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
735 P_BOOL, &interface.checkbtn_openunread,
736 prefs_set_data_from_toggle, prefs_set_toggle},
737 {"mark_as_read_on_new_window", "FALSE",
738 &prefs_common.mark_as_read_on_new_window,
739 P_BOOL, &interface.checkbtn_mark_as_read_on_newwin,
740 prefs_set_data_from_toggle, prefs_set_toggle},
741 {"open_inbox_on_inc", "FALSE", &prefs_common.open_inbox_on_inc,
742 P_BOOL, &interface.checkbtn_openinbox,
743 prefs_set_data_from_toggle, prefs_set_toggle},
744 {"immediate_execution", "TRUE", &prefs_common.immediate_exec, P_BOOL,
745 &interface.checkbtn_immedexec,
746 prefs_set_data_from_toggle, prefs_set_toggle},
747 {"receive_dialog_mode", "1", &prefs_common.recv_dialog_mode, P_ENUM,
748 &interface.optmenu_recvdialog,
749 prefs_common_recv_dialog_set_data_from_optmenu,
750 prefs_common_recv_dialog_set_optmenu},
751 {"send_dialog_mode", "0", &prefs_common.send_dialog_mode, P_ENUM,
752 &interface.optmenu_senddialog,
753 prefs_common_send_dialog_set_data_from_optmenu,
754 prefs_common_send_dialog_set_optmenu},
755 {"no_receive_error_panel", "FALSE", &prefs_common.no_recv_err_panel,
756 P_BOOL, &interface.checkbtn_no_recv_err_panel,
757 prefs_set_data_from_toggle, prefs_set_toggle},
758 {"close_receive_dialog", "TRUE", &prefs_common.close_recv_dialog,
759 P_BOOL, &interface.checkbtn_close_recv_dialog,
760 prefs_set_data_from_toggle, prefs_set_toggle},
761 {"nextunreadmsg_dialog", NULL, &prefs_common.next_unread_msg_dialog, P_ENUM,
762 &interface.optmenu_nextunreadmsgdialog,
763 prefs_nextunreadmsgdialog_set_data_from_optmenu,
764 prefs_nextunreadmsgdialog_set_optmenu},
766 {"add_address_by_click", "FALSE", &prefs_common.add_address_by_click,
767 P_BOOL, &interface.checkbtn_addaddrbyclick,
768 prefs_set_data_from_toggle, prefs_set_toggle},
769 {"pixmap_theme_path", DEFAULT_PIXMAP_THEME,
770 &prefs_common.pixmap_theme_path, P_STRING,
771 &interface.entry_pixmap_theme, prefs_set_data_from_entry, prefs_set_entry},
774 {"uri_open_command", "netscape -remote 'openURL(%s,raise)'",
775 &prefs_common.uri_cmd, P_STRING,
776 &other.uri_entry, prefs_set_data_from_entry, prefs_set_entry},
777 {"print_command", "lpr %s", &prefs_common.print_cmd, P_STRING,
778 &other.printcmd_entry, prefs_set_data_from_entry, prefs_set_entry},
779 {"ext_editor_command", "gedit %s",
780 &prefs_common.ext_editor_cmd, P_STRING,
781 &other.exteditor_entry, prefs_set_data_from_entry, prefs_set_entry},
783 {"confirm_on_exit", "TRUE", &prefs_common.confirm_on_exit, P_BOOL,
784 &other.checkbtn_confonexit,
785 prefs_set_data_from_toggle, prefs_set_toggle},
786 {"clean_trash_on_exit", "FALSE", &prefs_common.clean_on_exit, P_BOOL,
787 &other.checkbtn_cleanonexit,
788 prefs_set_data_from_toggle, prefs_set_toggle},
789 {"ask_on_cleaning", "TRUE", &prefs_common.ask_on_clean, P_BOOL,
790 &other.checkbtn_askonclean,
791 prefs_set_data_from_toggle, prefs_set_toggle},
792 {"warn_queued_on_exit", "TRUE", &prefs_common.warn_queued_on_exit,
793 P_BOOL, &other.checkbtn_warnqueued,
794 prefs_set_data_from_toggle, prefs_set_toggle},
795 {"work_offline", "FALSE", &prefs_common.work_offline, P_BOOL,
798 {"hide_score", "-9999", &prefs_common.kill_score, P_INT,
800 {"important_score", "1", &prefs_common.important_score, P_INT,
802 {"clip_log", "FALSE", &prefs_common.cliplog, P_BOOL,
803 &other.checkbtn_cliplog,
804 prefs_set_data_from_toggle, prefs_set_toggle},
805 {"log_length", "1000", &prefs_common.loglength, P_INT,
806 &other.loglength_entry,
807 prefs_set_data_from_entry, prefs_set_entry},
809 {"cache_max_mem_usage", "4096", &prefs_common.cache_max_mem_usage, P_INT,
811 {"cache_min_keep_time", "15", &prefs_common.cache_min_keep_time, P_INT,
814 {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
817 /* widget creating functions */
818 static void prefs_common_create (void);
819 static void prefs_receive_create (void);
820 static void prefs_send_create (void);
821 static void prefs_compose_create (void);
822 static void prefs_spelling_create (void);
823 static void prefs_quote_create (void);
824 static void prefs_display_create (void);
825 static void prefs_message_create (void);
827 static void prefs_privacy_create (void);
829 static void prefs_interface_create (void);
830 static void prefs_other_create (void);
832 static void date_format_ok_btn_clicked (GtkButton *button,
834 static void date_format_cancel_btn_clicked (GtkButton *button,
836 static void date_format_key_pressed (GtkWidget *keywidget,
839 static gboolean date_format_on_delete (GtkWidget *dialogwidget,
842 static void date_format_entry_on_change (GtkEditable *editable,
844 static void date_format_select_row (GtkWidget *date_format_list,
847 GdkEventButton *event,
848 GtkWidget *date_format);
849 static GtkWidget *date_format_create (GtkButton *button,
852 static void prefs_quote_colors_dialog (void);
853 static void prefs_quote_colors_dialog_create (void);
854 static void prefs_quote_colors_key_pressed (GtkWidget *widget,
857 static void quote_color_set_dialog (GtkWidget *widget,
859 static void quote_colors_set_dialog_ok (GtkWidget *widget,
861 static void quote_colors_set_dialog_cancel (GtkWidget *widget,
863 static void quote_colors_set_dialog_key_pressed (GtkWidget *widget,
866 static void set_button_bg_color (GtkWidget *widget,
868 static void prefs_enable_message_color_toggled (void);
869 static void prefs_recycle_colors_toggled (GtkWidget *widget);
871 static void prefs_font_select (GtkButton *button, GtkEntry *entry);
873 static void prefs_font_selection_key_pressed (GtkWidget *widget,
876 static void prefs_font_selection_ok (GtkButton *button, GtkEntry *entry);
878 static void prefs_keybind_select (void);
879 static gint prefs_keybind_deleted (GtkWidget *widget,
882 static void prefs_keybind_key_pressed (GtkWidget *widget,
885 static void prefs_keybind_cancel (void);
886 static void prefs_keybind_apply_clicked (GtkWidget *widget);
888 static gint prefs_common_deleted (GtkWidget *widget,
891 static void prefs_common_key_pressed (GtkWidget *widget,
894 static void prefs_common_ok (void);
895 static void prefs_common_apply (void);
896 static void prefs_common_cancel (void);
898 void prefs_common_init() {
899 prefs_common.fltlist = NULL;
900 prefs_common.disphdr_list = NULL;
903 void prefs_common_read_config(void)
907 gchar buf[PREFSBUFSIZE];
909 prefs_read_config(param, "Common", COMMON_RC);
911 path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
913 if ((fp = fopen(path, "rb")) == NULL) {
914 if (ENOENT != errno) FILE_OP_ERROR(path, "fopen");
919 while (fgets(buf, sizeof(buf), fp) != NULL) {
921 if (buf[0] == '\0') continue;
922 prefs_common.mime_open_cmd_history =
923 add_history(prefs_common.mime_open_cmd_history, buf);
927 prefs_common.mime_open_cmd_history =
928 g_list_reverse(prefs_common.mime_open_cmd_history);
931 void prefs_common_save_config(void)
937 prefs_save_config(param, "Common", COMMON_RC);
939 path = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, COMMAND_HISTORY,
941 if ((fp = fopen(path, "wb")) == NULL) {
942 FILE_OP_ERROR(path, "fopen");
947 for (cur = prefs_common.mime_open_cmd_history;
948 cur != NULL; cur = cur->next) {
949 fputs((gchar *)cur->data, fp);
957 void prefs_common_open(void)
959 if (prefs_rc_is_readonly(COMMON_RC))
964 if (!dialog.window) {
965 prefs_common_create();
968 manage_window_set_transient(GTK_WINDOW(dialog.window));
969 gtk_notebook_set_page(GTK_NOTEBOOK(dialog.notebook), 0);
970 gtk_widget_grab_focus(dialog.ok_btn);
972 prefs_set_dialog(param);
974 gtk_widget_show(dialog.window);
977 static void prefs_common_create(void)
981 debug_print("Creating common preferences window...\n");
983 prefs_dialog_create(&dialog);
984 gtk_window_set_title (GTK_WINDOW(dialog.window),
985 _("Common Preferences"));
986 gtk_signal_connect (GTK_OBJECT(dialog.window), "delete_event",
987 GTK_SIGNAL_FUNC(prefs_common_deleted), NULL);
988 gtk_signal_connect (GTK_OBJECT(dialog.window), "key_press_event",
989 GTK_SIGNAL_FUNC(prefs_common_key_pressed), NULL);
990 MANAGE_WINDOW_SIGNALS_CONNECT(dialog.window);
992 gtk_signal_connect (GTK_OBJECT(dialog.ok_btn), "clicked",
993 GTK_SIGNAL_FUNC(prefs_common_ok), NULL);
994 gtk_signal_connect (GTK_OBJECT(dialog.apply_btn), "clicked",
995 GTK_SIGNAL_FUNC(prefs_common_apply), NULL);
996 gtk_signal_connect_object (GTK_OBJECT(dialog.cancel_btn), "clicked",
997 GTK_SIGNAL_FUNC(prefs_common_cancel),
998 GTK_OBJECT(dialog.window));
1000 /* create all widgets on notebook */
1001 prefs_receive_create();
1002 SET_NOTEBOOK_LABEL(dialog.notebook, _("Receive"), page++);
1003 prefs_send_create();
1004 SET_NOTEBOOK_LABEL(dialog.notebook, _("Send"), page++);
1005 prefs_compose_create();
1006 SET_NOTEBOOK_LABEL(dialog.notebook, _("Compose"), page++);
1008 prefs_spelling_create();
1009 SET_NOTEBOOK_LABEL(dialog.notebook, _("Spell Checker"), page++);
1011 prefs_quote_create();
1012 SET_NOTEBOOK_LABEL(dialog.notebook, _("Quote"), page++);
1013 prefs_display_create();
1014 SET_NOTEBOOK_LABEL(dialog.notebook, _("Display"), page++);
1015 prefs_message_create();
1016 SET_NOTEBOOK_LABEL(dialog.notebook, _("Message"), page++);
1018 prefs_privacy_create();
1019 SET_NOTEBOOK_LABEL(dialog.notebook, _("Privacy"), page++);
1021 prefs_interface_create();
1022 SET_NOTEBOOK_LABEL(dialog.notebook, _("Interface"), page++);
1023 prefs_other_create();
1024 SET_NOTEBOOK_LABEL(dialog.notebook, _("Other"), page++);
1026 gtk_widget_show_all(dialog.window);
1029 static void prefs_receive_create(void)
1033 GtkWidget *frame_incext;
1034 GtkWidget *checkbtn_incext;
1036 GtkWidget *label_incext;
1037 GtkWidget *entry_incext;
1038 /* GtkWidget *button_incext; */
1040 GtkWidget *frame_spool;
1041 GtkWidget *checkbtn_local;
1042 GtkWidget *checkbtn_filter_on_inc;
1043 GtkWidget *label_spool;
1044 GtkWidget *entry_spool;
1046 GtkWidget *hbox_autochk;
1047 GtkWidget *checkbtn_autochk;
1048 GtkWidget *label_autochk1;
1049 GtkObject *spinbtn_autochk_adj;
1050 GtkWidget *spinbtn_autochk;
1051 GtkWidget *label_autochk2;
1052 GtkWidget *checkbtn_chkonstartup;
1053 GtkWidget *checkbtn_scan_after_inc;
1056 GtkWidget *frame_newmail;
1057 GtkWidget *hbox_newmail_notify;
1058 GtkWidget *checkbtn_newmail_auto;
1059 GtkWidget *checkbtn_newmail_manu;
1060 GtkWidget *entry_newmail_notify_cmd;
1061 GtkWidget *label_newmail_notify_cmd;
1063 GtkWidget *frame_news;
1064 GtkWidget *label_maxarticle;
1065 GtkWidget *spinbtn_maxarticle;
1066 GtkObject *spinbtn_maxarticle_adj;
1068 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1069 gtk_widget_show (vbox1);
1070 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1071 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1073 PACK_FRAME(vbox1, frame_incext, _("External program"));
1075 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1076 gtk_widget_show (vbox2);
1077 gtk_container_add (GTK_CONTAINER (frame_incext), vbox2);
1078 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1080 /* Use of external incorporation program */
1081 PACK_CHECK_BUTTON (vbox2, checkbtn_incext,
1082 _("Use external program for incorporation"));
1084 hbox = gtk_hbox_new (FALSE, 8);
1085 gtk_widget_show (hbox);
1086 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1087 SET_TOGGLE_SENSITIVITY (checkbtn_incext, hbox);
1089 label_incext = gtk_label_new (_("Command"));
1090 gtk_widget_show (label_incext);
1091 gtk_box_pack_start (GTK_BOX (hbox), label_incext, FALSE, FALSE, 0);
1093 entry_incext = gtk_entry_new ();
1094 gtk_widget_show (entry_incext);
1095 gtk_box_pack_start (GTK_BOX (hbox), entry_incext, TRUE, TRUE, 0);
1098 button_incext = gtk_button_new_with_label ("... ");
1099 gtk_widget_show (button_incext);
1100 gtk_box_pack_start (GTK_BOX (hbox), button_incext, FALSE, FALSE, 0);
1103 PACK_FRAME(vbox1, frame_spool, _("Local spool"));
1105 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1106 gtk_widget_show (vbox2);
1107 gtk_container_add (GTK_CONTAINER (frame_spool), vbox2);
1108 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1110 hbox = gtk_hbox_new (FALSE, 32);
1111 gtk_widget_show (hbox);
1112 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1114 PACK_CHECK_BUTTON (hbox, checkbtn_local, _("Incorporate from spool"));
1115 PACK_CHECK_BUTTON (hbox, checkbtn_filter_on_inc,
1116 _("Filter on incorporation"));
1117 SET_TOGGLE_SENSITIVITY (checkbtn_local, checkbtn_filter_on_inc);
1119 hbox = gtk_hbox_new (FALSE, 8);
1120 gtk_widget_show (hbox);
1121 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
1122 SET_TOGGLE_SENSITIVITY (checkbtn_local, hbox);
1124 label_spool = gtk_label_new (_("Spool directory"));
1125 gtk_widget_show (label_spool);
1126 gtk_box_pack_start (GTK_BOX (hbox), label_spool, FALSE, FALSE, 0);
1128 entry_spool = gtk_entry_new ();
1129 gtk_widget_show (entry_spool);
1130 gtk_box_pack_start (GTK_BOX (hbox), entry_spool, TRUE, TRUE, 0);
1132 vbox2 = gtk_vbox_new (FALSE, 0);
1133 gtk_widget_show (vbox2);
1134 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1137 hbox_autochk = gtk_hbox_new (FALSE, 8);
1138 gtk_widget_show (hbox_autochk);
1139 gtk_box_pack_start (GTK_BOX (vbox2), hbox_autochk, FALSE, FALSE, 0);
1141 PACK_CHECK_BUTTON (hbox_autochk, checkbtn_autochk,
1142 _("Auto-check new mail"));
1144 label_autochk1 = gtk_label_new (_("every"));
1145 gtk_widget_show (label_autochk1);
1146 gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk1, FALSE, FALSE, 0);
1148 spinbtn_autochk_adj = gtk_adjustment_new (5, 1, 100, 1, 10, 10);
1149 spinbtn_autochk = gtk_spin_button_new
1150 (GTK_ADJUSTMENT (spinbtn_autochk_adj), 1, 0);
1151 gtk_widget_show (spinbtn_autochk);
1152 gtk_box_pack_start (GTK_BOX (hbox_autochk), spinbtn_autochk, FALSE, FALSE, 0);
1153 gtk_widget_set_usize (spinbtn_autochk, 64, -1);
1154 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_autochk), TRUE);
1156 label_autochk2 = gtk_label_new (_("minute(s)"));
1157 gtk_widget_show (label_autochk2);
1158 gtk_box_pack_start (GTK_BOX (hbox_autochk), label_autochk2, FALSE, FALSE, 0);
1160 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk1);
1161 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, spinbtn_autochk);
1162 SET_TOGGLE_SENSITIVITY(checkbtn_autochk, label_autochk2);
1164 PACK_CHECK_BUTTON (vbox2, checkbtn_chkonstartup,
1165 _("Check new mail on startup"));
1166 PACK_CHECK_BUTTON (vbox2, checkbtn_scan_after_inc,
1167 _("Update all local folders after incorporation"));
1170 PACK_FRAME(vbox1, frame_newmail, _("Run command when new mail "
1172 vbox2 = gtk_vbox_new (FALSE, VSPACING_NARROW);
1173 gtk_widget_show (vbox2);
1174 gtk_container_add (GTK_CONTAINER (frame_newmail), vbox2);
1175 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
1177 hbox = gtk_hbox_new (TRUE, 8);
1178 gtk_widget_show (hbox);
1179 PACK_CHECK_BUTTON (hbox, checkbtn_newmail_auto,
1180 _("after autochecking"));
1181 PACK_CHECK_BUTTON (hbox, checkbtn_newmail_manu,
1182 _("after manual checking"));
1183 gtk_box_pack_start (GTK_BOX(vbox2), hbox, FALSE, FALSE, 0);
1184 gtk_signal_connect(GTK_OBJECT(checkbtn_newmail_auto), "toggled",
1185 GTK_SIGNAL_FUNC(prefs_common_recv_dialog_newmail_notify_toggle_cb),
1187 gtk_signal_connect(GTK_OBJECT(checkbtn_newmail_manu), "toggled",
1188 GTK_SIGNAL_FUNC(prefs_common_recv_dialog_newmail_notify_toggle_cb),
1191 hbox_newmail_notify = gtk_hbox_new (FALSE, 8);
1192 gtk_widget_show (hbox);
1193 gtk_box_pack_start (GTK_BOX (vbox2), hbox_newmail_notify, FALSE,
1196 label_newmail_notify_cmd = gtk_label_new (_("Command to execute:\n"
1197 "(use %d as number of new "
1199 gtk_label_set_justify(GTK_LABEL(label_newmail_notify_cmd),
1201 gtk_widget_show (label_newmail_notify_cmd);
1202 gtk_box_pack_start (GTK_BOX (hbox_newmail_notify),
1203 label_newmail_notify_cmd, FALSE, FALSE, 0);
1205 entry_newmail_notify_cmd = gtk_entry_new ();
1206 gtk_widget_show (entry_newmail_notify_cmd);
1207 gtk_box_pack_start (GTK_BOX (hbox_newmail_notify),
1208 entry_newmail_notify_cmd, TRUE, TRUE, 0);
1210 gtk_widget_set_sensitive(hbox_newmail_notify,
1211 prefs_common.newmail_notify_auto ||
1212 prefs_common.newmail_notify_manu);
1214 PACK_FRAME(vbox1, frame_news, _("News"));
1216 hbox = gtk_hbox_new (FALSE, 8);
1217 gtk_widget_show (hbox);
1218 gtk_container_add (GTK_CONTAINER (frame_news), hbox);
1219 gtk_container_set_border_width (GTK_CONTAINER (hbox), 8);
1221 label_maxarticle = gtk_label_new
1222 (_("Maximum number of articles to download\n"
1223 "(unlimited if 0 is specified)"));
1224 gtk_widget_show (label_maxarticle);
1225 gtk_box_pack_start (GTK_BOX (hbox), label_maxarticle, FALSE, FALSE, 0);
1226 gtk_label_set_justify (GTK_LABEL (label_maxarticle), GTK_JUSTIFY_LEFT);
1228 spinbtn_maxarticle_adj =
1229 gtk_adjustment_new (300, 0, 10000, 10, 100, 100);
1230 spinbtn_maxarticle = gtk_spin_button_new
1231 (GTK_ADJUSTMENT (spinbtn_maxarticle_adj), 10, 0);
1232 gtk_widget_show (spinbtn_maxarticle);
1233 gtk_box_pack_start (GTK_BOX (hbox), spinbtn_maxarticle,
1235 gtk_widget_set_usize (spinbtn_maxarticle, 64, -1);
1236 gtk_spin_button_set_numeric
1237 (GTK_SPIN_BUTTON (spinbtn_maxarticle), TRUE);
1239 receive.checkbtn_incext = checkbtn_incext;
1240 receive.entry_incext = entry_incext;
1241 /* receive.button_incext = button_incext; */
1243 receive.checkbtn_local = checkbtn_local;
1244 receive.checkbtn_filter_on_inc = checkbtn_filter_on_inc;
1245 receive.entry_spool = entry_spool;
1247 receive.checkbtn_autochk = checkbtn_autochk;
1248 receive.spinbtn_autochk = spinbtn_autochk;
1249 receive.spinbtn_autochk_adj = spinbtn_autochk_adj;
1251 receive.checkbtn_chkonstartup = checkbtn_chkonstartup;
1252 receive.checkbtn_scan_after_inc = checkbtn_scan_after_inc;
1255 receive.checkbtn_newmail_auto = checkbtn_newmail_auto;
1256 receive.checkbtn_newmail_manu = checkbtn_newmail_manu;
1257 receive.hbox_newmail_notify = hbox_newmail_notify;
1258 receive.entry_newmail_notify_cmd = entry_newmail_notify_cmd;
1260 receive.spinbtn_maxarticle = spinbtn_maxarticle;
1261 receive.spinbtn_maxarticle_adj = spinbtn_maxarticle_adj;
1264 static void prefs_send_create(void)
1268 GtkWidget *frame_extsend;
1269 GtkWidget *vbox_extsend;
1270 GtkWidget *checkbtn_extsend;
1272 GtkWidget *label_extsend;
1273 GtkWidget *entry_extsend;
1274 /* GtkWidget *button_extsend; */
1275 GtkWidget *checkbtn_savemsg;
1276 GtkWidget *checkbtn_queuemsg;
1277 GtkWidget *label_outcharset;
1279 GtkWidget *optmenu_menu;
1280 GtkWidget *menuitem;
1281 GtkWidget *label_charset_desc;
1283 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1284 gtk_widget_show (vbox1);
1285 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1286 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1288 PACK_FRAME(vbox1, frame_extsend, _("External program"));
1290 vbox_extsend = gtk_vbox_new (FALSE, VSPACING_NARROW);
1291 gtk_widget_show (vbox_extsend);
1292 gtk_container_add (GTK_CONTAINER (frame_extsend), vbox_extsend);
1293 gtk_container_set_border_width (GTK_CONTAINER (vbox_extsend), 8);
1295 PACK_CHECK_BUTTON (vbox_extsend, checkbtn_extsend,
1296 _("Use external program for sending"));
1298 hbox1 = gtk_hbox_new (FALSE, 8);
1299 gtk_widget_show (hbox1);
1300 gtk_box_pack_start (GTK_BOX (vbox_extsend), hbox1, FALSE, FALSE, 0);
1301 SET_TOGGLE_SENSITIVITY(checkbtn_extsend, hbox1);
1303 label_extsend = gtk_label_new (_("Command"));
1304 gtk_widget_show (label_extsend);
1305 gtk_box_pack_start (GTK_BOX (hbox1), label_extsend, FALSE, FALSE, 0);
1307 entry_extsend = gtk_entry_new ();
1308 gtk_widget_show (entry_extsend);
1309 gtk_box_pack_start (GTK_BOX (hbox1), entry_extsend, TRUE, TRUE, 0);
1312 button_extsend = gtk_button_new_with_label ("... ");
1313 gtk_widget_show (button_extsend);
1314 gtk_box_pack_start (GTK_BOX (hbox1), button_extsend, FALSE, FALSE, 0);
1317 vbox2 = gtk_vbox_new (FALSE, 0);
1318 gtk_widget_show (vbox2);
1319 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1321 PACK_CHECK_BUTTON (vbox2, checkbtn_savemsg,
1322 _("Save sent messages to Sent"));
1323 PACK_CHECK_BUTTON (vbox2, checkbtn_queuemsg,
1324 _("Queue messages that fail to send"));
1326 hbox1 = gtk_hbox_new (FALSE, 8);
1327 gtk_widget_show (hbox1);
1328 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1330 label_outcharset = gtk_label_new (_("Outgoing codeset"));
1331 gtk_widget_show (label_outcharset);
1332 gtk_box_pack_start (GTK_BOX (hbox1), label_outcharset, FALSE, FALSE, 0);
1334 optmenu = gtk_option_menu_new ();
1335 gtk_widget_show (optmenu);
1336 gtk_box_pack_start (GTK_BOX (hbox1), optmenu, FALSE, FALSE, 0);
1338 optmenu_menu = gtk_menu_new ();
1340 #define SET_MENUITEM(str, charset) \
1342 MENUITEM_ADD(optmenu_menu, menuitem, str, charset); \
1345 SET_MENUITEM(_("Automatic (Recommended)"), CS_AUTO);
1346 SET_MENUITEM(_("7bit ascii (US-ASCII)"), CS_US_ASCII);
1348 SET_MENUITEM(_("Unicode (UTF-8)"), CS_UTF_8);
1350 SET_MENUITEM(_("Western European (ISO-8859-1)"), CS_ISO_8859_1);
1351 SET_MENUITEM(_("Western European (ISO-8859-15)"), CS_ISO_8859_15);
1352 SET_MENUITEM(_("Central European (ISO-8859-2)"), CS_ISO_8859_2);
1353 SET_MENUITEM(_("Baltic (ISO-8859-13)"), CS_ISO_8859_13);
1354 SET_MENUITEM(_("Baltic (ISO-8859-4)"), CS_ISO_8859_4);
1355 SET_MENUITEM(_("Greek (ISO-8859-7)"), CS_ISO_8859_7);
1356 SET_MENUITEM(_("Turkish (ISO-8859-9)"), CS_ISO_8859_9);
1358 SET_MENUITEM(_("Cyrillic (ISO-8859-5)"), CS_ISO_8859_5);
1360 SET_MENUITEM(_("Cyrillic (KOI8-R)"), CS_KOI8_R);
1362 SET_MENUITEM(_("Cyrillic (Windows-1251)"), CS_WINDOWS_1251);
1363 SET_MENUITEM(_("Cyrillic (KOI8-U)"), CS_KOI8_U);
1365 SET_MENUITEM(_("Japanese (ISO-2022-JP)"), CS_ISO_2022_JP);
1367 SET_MENUITEM(_("Japanese (EUC-JP)"), CS_EUC_JP);
1368 SET_MENUITEM(_("Japanese (Shift_JIS)"), CS_SHIFT_JIS);
1370 SET_MENUITEM(_("Simplified Chinese (GB2312)"), CS_GB2312);
1371 SET_MENUITEM(_("Traditional Chinese (Big5)"), CS_BIG5);
1373 SET_MENUITEM(_("Traditional Chinese (EUC-TW)"), CS_EUC_TW);
1374 SET_MENUITEM(_("Chinese (ISO-2022-CN)"), CS_ISO_2022_CN);
1376 SET_MENUITEM(_("Korean (EUC-KR)"), CS_EUC_KR);
1377 SET_MENUITEM(_("Thai (TIS-620)"), CS_TIS_620);
1378 SET_MENUITEM(_("Thai (Windows-874)"), CS_WINDOWS_874);
1380 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu), optmenu_menu);
1382 hbox1 = gtk_hbox_new (FALSE, 8);
1383 gtk_widget_show (hbox1);
1384 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
1386 label_charset_desc = gtk_label_new
1387 (_("If `Automatic' is selected, the optimal encoding\n"
1388 "for the current locale will be used."));
1389 gtk_widget_show (label_charset_desc);
1390 gtk_box_pack_start (GTK_BOX (hbox1), label_charset_desc,
1392 gtk_label_set_justify(GTK_LABEL (label_charset_desc), GTK_JUSTIFY_LEFT);
1394 p_send.checkbtn_extsend = checkbtn_extsend;
1395 p_send.entry_extsend = entry_extsend;
1396 /* p_send.button_extsend = button_extsend; */
1398 p_send.checkbtn_savemsg = checkbtn_savemsg;
1399 p_send.checkbtn_queuemsg = checkbtn_queuemsg;
1401 p_send.optmenu_charset = optmenu;
1404 static void prefs_common_recv_dialog_newmail_notify_toggle_cb(GtkWidget *w, gpointer data)
1408 toggled = gtk_toggle_button_get_active
1409 (GTK_TOGGLE_BUTTON(receive.checkbtn_newmail_manu)) ||
1410 gtk_toggle_button_get_active
1411 (GTK_TOGGLE_BUTTON(receive.checkbtn_newmail_auto));
1412 gtk_widget_set_sensitive(receive.hbox_newmail_notify, toggled);
1416 static void prefs_dictionary_set_data_from_optmenu(PrefParam *param)
1419 gchar *dict_fullname;
1421 g_return_if_fail(param);
1422 g_return_if_fail(param->data);
1423 g_return_if_fail(param->widget);
1424 g_return_if_fail(*(param->widget));
1426 dict_fullname = gtkaspell_get_dictionary_menu_active_item
1427 (gtk_option_menu_get_menu(GTK_OPTION_MENU(*(param->widget))));
1428 str = *((gchar **) param->data);
1431 *((gchar **) param->data) = dict_fullname;
1434 static void prefs_dictionary_set_optmenu(PrefParam *pparam)
1437 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
1439 GtkWidget *menuitem;
1443 g_return_if_fail(optmenu != NULL);
1444 g_return_if_fail(pparam->data != NULL);
1446 if (*(gchar **) pparam->data) {
1447 menu = gtk_option_menu_get_menu(optmenu);
1448 for (cur = GTK_MENU_SHELL(menu)->children;
1449 cur != NULL; cur = cur->next) {
1450 menuitem = GTK_WIDGET(cur->data);
1451 dict_name = gtk_object_get_data(GTK_OBJECT(menuitem),
1453 if (!strcmp2(dict_name, *((gchar **)pparam->data))) {
1454 gtk_option_menu_set_history(optmenu, n);
1461 gtk_option_menu_set_history(optmenu, 0);
1462 prefs_dictionary_set_data_from_optmenu(pparam);
1465 static void prefs_speller_sugmode_set_data_from_optmenu(PrefParam *param)
1468 g_return_if_fail(param);
1469 g_return_if_fail(param->data);
1470 g_return_if_fail(param->widget);
1471 g_return_if_fail(*(param->widget));
1473 sugmode = gtkaspell_get_sugmode_from_option_menu
1474 (GTK_OPTION_MENU(*(param->widget)));
1475 *((gint *) param->data) = sugmode;
1478 static void prefs_speller_sugmode_set_optmenu(PrefParam *pparam)
1480 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
1483 g_return_if_fail(optmenu != NULL);
1484 g_return_if_fail(pparam->data != NULL);
1486 sugmode = *(gint *) pparam->data;
1487 gtkaspell_sugmode_option_menu_set(optmenu, sugmode);
1491 static void prefs_spelling_checkbtn_enable_aspell_toggle_cb
1497 toggled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
1499 gtk_widget_set_sensitive(spelling.entry_aspell_path, toggled);
1500 gtk_widget_set_sensitive(spelling.optmenu_dictionary, toggled);
1501 gtk_widget_set_sensitive(spelling.optmenu_sugmode, toggled);
1502 gtk_widget_set_sensitive(spelling.btn_aspell_path, toggled);
1503 gtk_widget_set_sensitive(spelling.misspelled_btn, toggled);
1504 gtk_widget_set_sensitive(spelling.checkbtn_use_alternate, toggled);
1505 gtk_widget_set_sensitive(spelling.checkbtn_check_while_typing, toggled);
1508 static void prefs_spelling_btn_aspell_path_clicked_cb(GtkWidget *widget,
1511 gchar *file_path, *tmp;
1512 GtkWidget *new_menu;
1514 file_path = filesel_select_file(_("Select dictionaries location"),
1515 prefs_common.aspell_path);
1516 if (file_path == NULL) {
1520 tmp=g_dirname(file_path);
1522 if (prefs_common.aspell_path)
1523 g_free(prefs_common.aspell_path);
1524 prefs_common.aspell_path = g_strdup_printf("%s%s",tmp,
1527 new_menu = gtkaspell_dictionary_option_menu_new(prefs_common.aspell_path);
1528 gtk_option_menu_set_menu(GTK_OPTION_MENU(spelling.optmenu_dictionary),
1531 gtk_entry_set_text(GTK_ENTRY(spelling.entry_aspell_path),
1532 prefs_common.aspell_path);
1533 /* select first one */
1534 gtk_option_menu_set_history(GTK_OPTION_MENU(
1535 spelling.optmenu_dictionary), 0);
1537 if (prefs_common.dictionary)
1538 g_free(prefs_common.dictionary);
1540 prefs_common.dictionary =
1541 gtkaspell_get_dictionary_menu_active_item(
1542 gtk_option_menu_get_menu(
1544 spelling.optmenu_dictionary)));
1550 static void prefs_spelling_create()
1553 GtkWidget *frame_spell;
1554 GtkWidget *vbox_spell;
1555 GtkWidget *hbox_aspell_path;
1556 GtkWidget *checkbtn_enable_aspell;
1557 GtkWidget *label_aspell_path;
1558 GtkWidget *entry_aspell_path;
1559 GtkWidget *btn_aspell_path;
1560 GtkWidget *spell_table;
1561 GtkWidget *label_dictionary;
1562 GtkWidget *optmenu_dictionary;
1563 GtkWidget *sugmode_label;
1564 GtkWidget *sugmode_optmenu;
1565 GtkWidget *checkbtn_use_alternate;
1566 GtkWidget *help_label;
1567 GtkWidget *checkbtn_check_while_typing;
1568 GtkWidget *color_label;
1569 GtkWidget *col_align;
1571 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1572 gtk_widget_show (vbox1);
1573 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1574 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1576 /* spell checker defaults */
1577 PACK_FRAME(vbox1, frame_spell, _("Global spelling checker settings"));
1578 vbox_spell = gtk_vbox_new(FALSE, VSPACING_NARROW);
1579 gtk_widget_show (vbox_spell);
1580 gtk_container_add(GTK_CONTAINER(frame_spell), vbox_spell);
1581 gtk_container_set_border_width(GTK_CONTAINER(vbox_spell), 8);
1583 PACK_CHECK_BUTTON(vbox_spell, checkbtn_enable_aspell,
1584 _("Enable spell checker"));
1586 gtk_signal_connect(GTK_OBJECT(checkbtn_enable_aspell), "toggled",
1587 GTK_SIGNAL_FUNC(prefs_spelling_checkbtn_enable_aspell_toggle_cb),
1590 /* Check while typing */
1591 PACK_CHECK_BUTTON(vbox_spell, checkbtn_check_while_typing,
1592 _("Check while typing"));
1594 PACK_CHECK_BUTTON(vbox_spell, checkbtn_use_alternate,
1595 _("Enable alternate dictionary"));
1597 help_label = gtk_label_new(_("Enabling alternate dictionary makes switching\nwith the last used dictionary faster."));
1598 gtk_widget_show(help_label);
1599 gtk_box_pack_start(GTK_BOX(vbox_spell), help_label, FALSE, TRUE, 0);
1601 spell_table = gtk_table_new(4, 3, FALSE);
1602 gtk_container_set_border_width (GTK_CONTAINER (spell_table), VSPACING);
1603 gtk_table_set_row_spacings(GTK_TABLE(spell_table), 8);
1604 gtk_table_set_col_spacings(GTK_TABLE(spell_table), 8);
1606 gtk_box_pack_start(GTK_BOX(vbox_spell), spell_table, TRUE, TRUE, 0);
1608 label_aspell_path = gtk_label_new (_("Dictionaries path:"));
1609 gtk_misc_set_alignment(GTK_MISC(label_aspell_path), 1.0, 0.5);
1610 gtk_widget_show(label_aspell_path);
1611 gtk_table_attach (GTK_TABLE (spell_table), label_aspell_path, 0, 1, 0,
1612 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1614 hbox_aspell_path = gtk_hbox_new (FALSE, 8);
1615 gtk_table_attach (GTK_TABLE (spell_table), hbox_aspell_path, 1, 2, 0,
1616 1, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1617 gtk_widget_show(hbox_aspell_path);
1619 entry_aspell_path = gtk_entry_new();
1620 gtk_widget_show(entry_aspell_path);
1621 gtk_box_pack_start(GTK_BOX(hbox_aspell_path), entry_aspell_path, TRUE,
1624 gtk_widget_set_sensitive(entry_aspell_path, prefs_common.enable_aspell);
1626 btn_aspell_path = gtk_button_new_with_label(" ... ");
1627 gtk_widget_show(btn_aspell_path);
1628 gtk_box_pack_start(GTK_BOX(hbox_aspell_path), btn_aspell_path, FALSE, FALSE, 0);
1629 gtk_widget_set_sensitive(btn_aspell_path, prefs_common.enable_aspell);
1631 gtk_signal_connect(GTK_OBJECT(btn_aspell_path), "clicked",
1632 GTK_SIGNAL_FUNC(prefs_spelling_btn_aspell_path_clicked_cb),
1635 label_dictionary = gtk_label_new(_("Default dictionary:"));
1636 gtk_misc_set_alignment(GTK_MISC(label_dictionary), 1.0, 0.5);
1637 gtk_widget_show(label_dictionary);
1638 gtk_table_attach (GTK_TABLE (spell_table), label_dictionary, 0, 1, 1, 2,
1639 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1641 optmenu_dictionary = gtk_option_menu_new();
1642 gtk_widget_show(optmenu_dictionary);
1643 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu_dictionary),
1644 gtkaspell_dictionary_option_menu_new(
1645 prefs_common.aspell_path));
1646 gtk_table_attach (GTK_TABLE (spell_table), optmenu_dictionary, 1, 2, 1,
1647 2, GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1648 gtk_widget_set_sensitive(optmenu_dictionary, prefs_common.enable_aspell);
1650 /* Suggestion mode */
1651 sugmode_label = gtk_label_new(_("Default suggestion mode"));
1652 gtk_misc_set_alignment(GTK_MISC(sugmode_label), 1.0, 0.5);
1653 gtk_widget_show(sugmode_label);
1654 gtk_table_attach(GTK_TABLE (spell_table), sugmode_label, 0, 1, 2, 3,
1655 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1657 sugmode_optmenu = gtk_option_menu_new();
1658 gtk_widget_show(sugmode_optmenu);
1659 gtk_option_menu_set_menu(GTK_OPTION_MENU(sugmode_optmenu),
1660 gtkaspell_sugmode_option_menu_new(prefs_common.aspell_sugmode));
1661 gtk_table_attach(GTK_TABLE(spell_table), sugmode_optmenu, 1, 2, 2, 3,
1662 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
1663 gtk_widget_set_sensitive(sugmode_optmenu, prefs_common.enable_aspell);
1666 color_label = gtk_label_new(_("Misspelled word color:"));
1667 gtk_misc_set_alignment(GTK_MISC(color_label), 1.0, 0.5);
1668 gtk_table_attach (GTK_TABLE (spell_table), color_label, 0, 1, 3, 4,
1669 GTK_FILL, GTK_SHRINK, 0, 0);
1670 gtk_widget_show(color_label);
1672 col_align = gtk_alignment_new(0.0, 0.5, 0, 0);
1673 gtk_widget_show(col_align);
1674 gtk_table_attach (GTK_TABLE (spell_table), col_align, 1, 2, 3, 4,
1675 GTK_FILL, GTK_SHRINK, 0, 0);
1677 spelling.misspelled_btn = gtk_button_new_with_label ("");
1678 set_button_bg_color(spelling.misspelled_btn,
1679 prefs_common.misspelled_col);
1680 gtk_widget_set_usize (spelling.misspelled_btn, 30, 20);
1681 gtk_widget_set_sensitive(spelling.misspelled_btn, prefs_common.enable_aspell);
1682 gtk_signal_connect (GTK_OBJECT (spelling.misspelled_btn), "clicked",
1683 GTK_SIGNAL_FUNC(quote_color_set_dialog), "Misspelled word");
1684 gtk_container_add(GTK_CONTAINER(col_align), spelling.misspelled_btn);
1687 spelling.checkbtn_enable_aspell = checkbtn_enable_aspell;
1688 spelling.entry_aspell_path = entry_aspell_path;
1689 spelling.btn_aspell_path = btn_aspell_path;
1690 spelling.optmenu_dictionary = optmenu_dictionary;
1691 spelling.optmenu_sugmode = sugmode_optmenu;
1692 spelling.checkbtn_use_alternate = checkbtn_use_alternate;
1693 spelling.checkbtn_check_while_typing = checkbtn_check_while_typing;
1699 static void prefs_compose_create(void)
1705 GtkWidget *frame_sig;
1706 GtkWidget *vbox_sig;
1707 GtkWidget *checkbtn_autosig;
1708 GtkWidget *label_sigsep;
1709 GtkWidget *entry_sigsep;
1711 GtkWidget *checkbtn_autoextedit;
1713 GtkWidget *frame_autosel;
1714 GtkWidget *hbox_autosel;
1715 GtkWidget *checkbtn_reply_account_autosel;
1716 GtkWidget *checkbtn_forward_account_autosel;
1717 GtkWidget *checkbtn_reedit_account_autosel;
1719 GtkWidget *hbox_undolevel;
1720 GtkWidget *label_undolevel;
1721 GtkObject *spinbtn_undolevel_adj;
1722 GtkWidget *spinbtn_undolevel;
1724 GtkWidget *vbox_linewrap;
1729 GtkWidget *label_linewrap;
1730 GtkObject *spinbtn_linewrap_adj;
1731 GtkWidget *spinbtn_linewrap;
1732 GtkWidget *checkbtn_wrapquote;
1733 GtkWidget *checkbtn_autowrap;
1734 GtkWidget *checkbtn_wrapatsend;
1736 GtkWidget *checkbtn_forward_as_attachment;
1737 GtkWidget *checkbtn_redirect_keep_from;
1738 GtkWidget *checkbtn_smart_wrapping;
1739 GtkWidget *checkbtn_block_cursor;
1740 GtkWidget *frame_msgwrap;
1742 GtkWidget *hbox_autosave;
1743 GtkWidget *checkbtn_autosave;
1744 GtkWidget *entry_autosave_length;
1745 GtkWidget *label_autosave_length;
1747 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1748 gtk_widget_show (vbox1);
1749 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1750 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1752 PACK_FRAME(vbox1, frame_sig, _("Signature"));
1754 vbox_sig = gtk_vbox_new (FALSE, VSPACING_NARROW);
1755 gtk_widget_show (vbox_sig);
1756 gtk_container_add (GTK_CONTAINER (frame_sig), vbox_sig);
1757 gtk_container_set_border_width (GTK_CONTAINER (vbox_sig), 8);
1759 PACK_CHECK_BUTTON (vbox_sig, checkbtn_autosig,
1760 _("Insert signature automatically"));
1762 hbox1 = gtk_hbox_new (FALSE, 8);
1763 gtk_widget_show (hbox1);
1764 gtk_box_pack_start (GTK_BOX (vbox_sig), hbox1, TRUE, TRUE, 0);
1765 label_sigsep = gtk_label_new (_("Signature separator"));
1766 gtk_widget_show (label_sigsep);
1767 gtk_box_pack_start (GTK_BOX (hbox1), label_sigsep, FALSE, FALSE, 0);
1769 entry_sigsep = gtk_entry_new ();
1770 gtk_widget_show (entry_sigsep);
1771 gtk_box_pack_start (GTK_BOX (hbox1), entry_sigsep, FALSE, FALSE, 0);
1773 gtk_widget_set_usize (entry_sigsep, 64, -1);
1775 /* Account autoselection */
1776 PACK_FRAME(vbox1, frame_autosel, _("Automatic account selection"));
1778 hbox_autosel = gtk_hbox_new (FALSE, VSPACING_NARROW);
1779 gtk_widget_show (hbox_autosel);
1780 gtk_container_add (GTK_CONTAINER (frame_autosel), hbox_autosel);
1781 gtk_container_set_border_width (GTK_CONTAINER (hbox_autosel), 8);
1783 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reply_account_autosel,
1784 _("when replying"));
1785 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_forward_account_autosel,
1786 _("when forwarding"));
1787 PACK_CHECK_BUTTON (hbox_autosel, checkbtn_reedit_account_autosel,
1788 _("when re-editing"));
1790 vbox2 = gtk_vbox_new (FALSE, 0);
1791 gtk_widget_show (vbox2);
1792 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
1794 PACK_CHECK_BUTTON (vbox2, checkbtn_autoextedit,
1795 _("Automatically launch the external editor"));
1797 hbox5 = gtk_hbox_new (FALSE, 8);
1798 gtk_widget_show (hbox5);
1799 gtk_box_pack_start (GTK_BOX (vbox2), hbox5, FALSE, FALSE, 0);
1801 PACK_CHECK_BUTTON (hbox5, checkbtn_forward_as_attachment,
1802 _("Forward as attachment"));
1804 PACK_CHECK_BUTTON (hbox5, checkbtn_block_cursor,
1807 PACK_CHECK_BUTTON (vbox2, checkbtn_redirect_keep_from,
1808 _("Keep the original 'From' header when redirecting"));
1811 hbox_autosave = gtk_hbox_new (FALSE, 8);
1812 gtk_widget_show (hbox_autosave);
1813 gtk_box_pack_start (GTK_BOX (vbox1), hbox_autosave, FALSE, FALSE, 0);
1815 PACK_CHECK_BUTTON (hbox_autosave, checkbtn_autosave,
1816 _("Autosave to drafts every "));
1818 entry_autosave_length = gtk_entry_new();
1819 gtk_widget_set_usize (entry_autosave_length, 64, -1);
1820 gtk_widget_show (entry_autosave_length);
1821 gtk_box_pack_start (GTK_BOX (hbox_autosave), entry_autosave_length, FALSE, FALSE, 0);
1823 label_autosave_length = gtk_label_new(_("characters"));
1824 gtk_widget_show (label_autosave_length);
1825 gtk_box_pack_start (GTK_BOX (hbox_autosave), label_autosave_length, FALSE, FALSE, 0);
1827 hbox_undolevel = gtk_hbox_new (FALSE, 8);
1828 gtk_widget_show (hbox_undolevel);
1829 gtk_box_pack_start (GTK_BOX (vbox1), hbox_undolevel, FALSE, FALSE, 0);
1831 label_undolevel = gtk_label_new (_("Undo level"));
1832 gtk_widget_show (label_undolevel);
1833 gtk_box_pack_start (GTK_BOX (hbox_undolevel), label_undolevel, FALSE, FALSE, 0);
1835 spinbtn_undolevel_adj = gtk_adjustment_new (50, 0, 100, 1, 10, 10);
1836 spinbtn_undolevel = gtk_spin_button_new
1837 (GTK_ADJUSTMENT (spinbtn_undolevel_adj), 1, 0);
1838 gtk_widget_show (spinbtn_undolevel);
1839 gtk_box_pack_start (GTK_BOX (hbox_undolevel), spinbtn_undolevel, FALSE, FALSE, 0);
1840 gtk_widget_set_usize (spinbtn_undolevel, 64, -1);
1841 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_undolevel), TRUE);
1844 PACK_FRAME(vbox1, frame_msgwrap, _("Message wrapping"));
1846 vbox_linewrap = gtk_vbox_new (FALSE, VSPACING_NARROW);
1847 gtk_widget_show (vbox_linewrap);
1848 gtk_container_add (GTK_CONTAINER (frame_msgwrap), vbox_linewrap);
1849 gtk_container_set_border_width (GTK_CONTAINER (vbox_linewrap), 8);
1851 hbox3 = gtk_hbox_new (FALSE, 8);
1852 gtk_widget_show (hbox3);
1853 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox3, FALSE, FALSE, 0);
1856 label_linewrap = gtk_label_new (_("Wrap messages at"));
1857 gtk_widget_show (label_linewrap);
1858 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1860 spinbtn_linewrap_adj = gtk_adjustment_new (72, 20, 1024, 1, 10, 10);
1861 spinbtn_linewrap = gtk_spin_button_new
1862 (GTK_ADJUSTMENT (spinbtn_linewrap_adj), 1, 0);
1863 gtk_widget_show (spinbtn_linewrap);
1864 gtk_box_pack_start (GTK_BOX (hbox3), spinbtn_linewrap, FALSE, FALSE, 0);
1865 gtk_widget_set_usize (spinbtn_linewrap, 64, -1);
1866 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linewrap), TRUE);
1868 label_linewrap = gtk_label_new (_("characters"));
1869 gtk_widget_show (label_linewrap);
1870 gtk_box_pack_start (GTK_BOX (hbox3), label_linewrap, FALSE, FALSE, 0);
1872 hbox4 = gtk_hbox_new (FALSE, VSPACING);
1873 gtk_widget_show (hbox4);
1874 gtk_box_pack_start (GTK_BOX (vbox_linewrap), hbox4, FALSE, FALSE, 0);
1876 PACK_CHECK_BUTTON (hbox4, checkbtn_wrapquote, _("Wrap quotation"));
1878 PACK_CHECK_BUTTON (hbox4, checkbtn_autowrap, _("Wrap on input"));
1881 (hbox4, checkbtn_wrapatsend, _("Wrap before sending"));
1883 PACK_CHECK_BUTTON (vbox_linewrap, checkbtn_smart_wrapping,
1884 _("Smart wrapping (EXPERIMENTAL)"));
1887 compose.checkbtn_quote = checkbtn_quote;
1888 compose.entry_quotemark = entry_quotemark;
1889 compose.text_quotefmt = text_quotefmt;
1891 compose.checkbtn_autosig = checkbtn_autosig;
1892 compose.entry_sigsep = entry_sigsep;
1894 compose.checkbtn_autoextedit = checkbtn_autoextedit;
1896 compose.checkbtn_reply_account_autosel = checkbtn_reply_account_autosel;
1897 compose.checkbtn_forward_account_autosel = checkbtn_forward_account_autosel;
1898 compose.checkbtn_reedit_account_autosel = checkbtn_reedit_account_autosel;
1900 compose.spinbtn_undolevel = spinbtn_undolevel;
1901 compose.spinbtn_undolevel_adj = spinbtn_undolevel_adj;
1903 compose.spinbtn_linewrap = spinbtn_linewrap;
1904 compose.spinbtn_linewrap_adj = spinbtn_linewrap_adj;
1905 compose.checkbtn_wrapquote = checkbtn_wrapquote;
1906 compose.checkbtn_autowrap = checkbtn_autowrap;
1907 compose.checkbtn_wrapatsend = checkbtn_wrapatsend;
1909 compose.checkbtn_autosave = checkbtn_autosave;
1910 compose.entry_autosave_length = entry_autosave_length;
1912 compose.checkbtn_forward_as_attachment =
1913 checkbtn_forward_as_attachment;
1914 compose.checkbtn_redirect_keep_from =
1915 checkbtn_redirect_keep_from;
1916 compose.checkbtn_smart_wrapping =
1917 checkbtn_smart_wrapping;
1918 compose.checkbtn_block_cursor =
1919 checkbtn_block_cursor;
1923 static void prefs_quote_create(void)
1926 GtkWidget *frame_quote;
1927 GtkWidget *vbox_quote;
1930 GtkWidget *label_quotemark;
1931 GtkWidget *entry_quotemark;
1932 GtkWidget *scrolledwin_quotefmt;
1933 GtkWidget *text_quotefmt;
1935 GtkWidget *entry_fw_quotemark;
1936 GtkWidget *text_fw_quotefmt;
1938 GtkWidget *entry_quote_chars;
1939 GtkWidget *label_quote_chars;
1941 GtkWidget *btn_quotedesc;
1943 GtkWidget *checkbtn_reply_with_quote;
1945 vbox1 = gtk_vbox_new (FALSE, VSPACING);
1946 gtk_widget_show (vbox1);
1947 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
1948 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
1952 PACK_CHECK_BUTTON (vbox1, checkbtn_reply_with_quote, _("Reply will quote by default"));
1954 PACK_FRAME (vbox1, frame_quote, _("Reply format"));
1956 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
1957 gtk_widget_show (vbox_quote);
1958 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
1959 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
1961 hbox1 = gtk_hbox_new (FALSE, 32);
1962 gtk_widget_show (hbox1);
1963 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
1965 hbox2 = gtk_hbox_new (FALSE, 8);
1966 gtk_widget_show (hbox2);
1967 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
1969 label_quotemark = gtk_label_new (_("Quotation mark"));
1970 gtk_widget_show (label_quotemark);
1971 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
1973 entry_quotemark = gtk_entry_new ();
1974 gtk_widget_show (entry_quotemark);
1975 gtk_box_pack_start (GTK_BOX (hbox2), entry_quotemark, FALSE, FALSE, 0);
1976 gtk_widget_set_usize (entry_quotemark, 64, -1);
1978 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
1979 gtk_widget_show (scrolledwin_quotefmt);
1980 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
1981 gtk_scrolled_window_set_policy
1982 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
1983 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
1985 text_quotefmt = gtk_text_new (NULL, NULL);
1986 gtk_widget_show (text_quotefmt);
1987 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt), text_quotefmt);
1988 gtk_text_set_editable (GTK_TEXT (text_quotefmt), TRUE);
1989 gtk_widget_set_usize(text_quotefmt, -1, 60);
1993 PACK_FRAME (vbox1, frame_quote, _("Forward format"));
1995 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
1996 gtk_widget_show (vbox_quote);
1997 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
1998 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
2000 hbox1 = gtk_hbox_new (FALSE, 32);
2001 gtk_widget_show (hbox1);
2002 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
2004 hbox2 = gtk_hbox_new (FALSE, 8);
2005 gtk_widget_show (hbox2);
2006 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
2008 label_quotemark = gtk_label_new (_("Quotation mark"));
2009 gtk_widget_show (label_quotemark);
2010 gtk_box_pack_start (GTK_BOX (hbox2), label_quotemark, FALSE, FALSE, 0);
2012 entry_fw_quotemark = gtk_entry_new ();
2013 gtk_widget_show (entry_fw_quotemark);
2014 gtk_box_pack_start (GTK_BOX (hbox2), entry_fw_quotemark,
2016 gtk_widget_set_usize (entry_fw_quotemark, 64, -1);
2018 scrolledwin_quotefmt = gtk_scrolled_window_new (NULL, NULL);
2019 gtk_widget_show (scrolledwin_quotefmt);
2020 gtk_box_pack_start (GTK_BOX (vbox_quote), scrolledwin_quotefmt, TRUE, TRUE, 0);
2021 gtk_scrolled_window_set_policy
2022 (GTK_SCROLLED_WINDOW (scrolledwin_quotefmt),
2023 GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
2025 text_fw_quotefmt = gtk_text_new (NULL, NULL);
2026 gtk_widget_show (text_fw_quotefmt);
2027 gtk_container_add(GTK_CONTAINER(scrolledwin_quotefmt),
2029 gtk_text_set_editable (GTK_TEXT (text_fw_quotefmt), TRUE);
2030 gtk_widget_set_usize(text_fw_quotefmt, -1, 60);
2032 hbox1 = gtk_hbox_new (FALSE, 32);
2033 gtk_widget_show (hbox1);
2034 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2037 gtk_button_new_with_label (_(" Description of symbols "));
2038 gtk_widget_show (btn_quotedesc);
2039 gtk_box_pack_start (GTK_BOX (hbox1), btn_quotedesc, FALSE, FALSE, 0);
2040 gtk_signal_connect(GTK_OBJECT(btn_quotedesc), "clicked",
2041 GTK_SIGNAL_FUNC(quote_fmt_quote_description), NULL);
2045 PACK_FRAME (vbox1, frame_quote, _("Quoting characters"));
2047 vbox_quote = gtk_vbox_new (FALSE, VSPACING_NARROW);
2048 gtk_widget_show (vbox_quote);
2049 gtk_container_add (GTK_CONTAINER (frame_quote), vbox_quote);
2050 gtk_container_set_border_width (GTK_CONTAINER (vbox_quote), 8);
2052 hbox1 = gtk_hbox_new (FALSE, 32);
2053 gtk_widget_show (hbox1);
2054 gtk_box_pack_start (GTK_BOX (vbox_quote), hbox1, FALSE, FALSE, 0);
2056 hbox2 = gtk_hbox_new (FALSE, 8);
2057 gtk_widget_show (hbox2);
2058 gtk_box_pack_start (GTK_BOX (hbox1), hbox2, FALSE, FALSE, 0);
2060 label_quote_chars = gtk_label_new (_("Treat these characters as quotation marks: "));
2061 gtk_widget_show (label_quote_chars);
2062 gtk_box_pack_start (GTK_BOX (hbox2), label_quote_chars, FALSE, FALSE, 0);
2064 entry_quote_chars = gtk_entry_new ();
2065 gtk_widget_show (entry_quote_chars);
2066 gtk_box_pack_start (GTK_BOX (hbox2), entry_quote_chars,
2068 gtk_widget_set_usize (entry_quote_chars, 64, -1);
2071 compose.checkbtn_reply_with_quote= checkbtn_reply_with_quote;
2072 quote.entry_quotemark = entry_quotemark;
2073 quote.text_quotefmt = text_quotefmt;
2074 quote.entry_fw_quotemark = entry_fw_quotemark;
2075 quote.text_fw_quotefmt = text_fw_quotefmt;
2076 quote.entry_quote_chars = entry_quote_chars;
2079 static void prefs_display_create(void)
2082 GtkWidget *frame_font;
2084 GtkWidget *label_textfont;
2085 GtkWidget *entry_textfont;
2086 GtkWidget *button_textfont;
2087 GtkWidget *chkbtn_display_img;
2088 GtkWidget *chkbtn_transhdr;
2089 GtkWidget *chkbtn_folder_unread;
2091 GtkWidget *label_ng_abbrev;
2092 GtkWidget *spinbtn_ng_abbrev_len;
2093 GtkObject *spinbtn_ng_abbrev_len_adj;
2094 GtkWidget *frame_summary;
2096 GtkWidget *chkbtn_swapfrom;
2097 GtkWidget *chkbtn_hscrollbar;
2098 GtkWidget *chkbtn_useaddrbook;
2099 GtkWidget *chkbtn_expand_thread;
2100 GtkWidget *chkbtn_bold_unread;
2102 GtkWidget *label_datefmt;
2103 GtkWidget *button_datefmt;
2104 GtkWidget *entry_datefmt;
2105 GtkWidget *button_dispitem;
2106 GtkWidget *tmplabel, *tmpbutton, *tmpentry;
2108 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2109 gtk_widget_show (vbox1);
2110 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2111 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2113 PACK_FRAME(vbox1, frame_font, _("Font"));
2115 table1 = gtk_table_new (4, 3, FALSE);
2117 gtk_widget_show (table1);
2118 gtk_container_add (GTK_CONTAINER (frame_font), table1);
2119 gtk_container_set_border_width (GTK_CONTAINER (table1), 8);
2120 gtk_table_set_row_spacings (GTK_TABLE (table1), 8);
2121 gtk_table_set_col_spacings (GTK_TABLE (table1), 8);
2123 label_textfont = gtk_label_new (_("Text"));
2124 gtk_misc_set_alignment(GTK_MISC(label_textfont), 0, 0.5);
2125 gtk_widget_show (label_textfont);
2126 gtk_table_attach (GTK_TABLE (table1), label_textfont, 0, 1, 0, 1,
2127 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2129 entry_textfont = gtk_entry_new ();
2130 gtk_widget_show (entry_textfont);
2131 gtk_table_attach (GTK_TABLE (table1), entry_textfont, 1, 2, 0, 1,
2132 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2134 button_textfont = gtk_button_new_with_label (" ... ");
2136 gtk_widget_show (button_textfont);
2137 gtk_table_attach (GTK_TABLE (table1), button_textfont, 2, 3, 0, 1,
2139 gtk_signal_connect (GTK_OBJECT (button_textfont), "clicked",
2140 GTK_SIGNAL_FUNC (prefs_font_select), entry_textfont);
2142 tmplabel = gtk_label_new (_("Small"));
2143 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2144 gtk_widget_show (tmplabel);
2145 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 1, 2,
2146 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2148 tmpentry = gtk_entry_new ();
2149 gtk_widget_show (tmpentry);
2150 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 1, 2,
2151 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2153 tmpbutton = gtk_button_new_with_label (" ... ");
2154 gtk_widget_show (tmpbutton);
2155 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 1, 2,
2157 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2158 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2159 display.entry_smallfont = tmpentry;
2161 tmplabel = gtk_label_new (_("Normal"));
2162 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2163 gtk_widget_show (tmplabel);
2164 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 2, 3,
2165 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2167 tmpentry = gtk_entry_new ();
2168 gtk_widget_show (tmpentry);
2169 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 2, 3,
2170 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2172 tmpbutton = gtk_button_new_with_label (" ... ");
2173 gtk_widget_show (tmpbutton);
2174 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 2, 3,
2176 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2177 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2178 display.entry_normalfont = tmpentry;
2180 tmplabel = gtk_label_new (_("Bold"));
2181 gtk_misc_set_alignment(GTK_MISC(tmplabel), 0, 0.5);
2182 gtk_widget_show (tmplabel);
2183 gtk_table_attach (GTK_TABLE (table1), tmplabel, 0, 1, 3, 4,
2184 GTK_FILL, (GTK_EXPAND | GTK_FILL), 0, 0);
2186 tmpentry = gtk_entry_new ();
2187 gtk_widget_show (tmpentry);
2188 gtk_table_attach (GTK_TABLE (table1), tmpentry, 1, 2, 3, 4,
2189 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
2191 tmpbutton = gtk_button_new_with_label (" ... ");
2192 gtk_widget_show (tmpbutton);
2193 gtk_table_attach (GTK_TABLE (table1), tmpbutton, 2, 3, 3, 4,
2195 gtk_signal_connect (GTK_OBJECT(tmpbutton), "clicked",
2196 GTK_SIGNAL_FUNC(prefs_font_select), tmpentry);
2197 display.entry_boldfont = tmpentry;
2199 vbox2 = gtk_vbox_new (FALSE, 0);
2200 gtk_widget_show (vbox2);
2201 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, TRUE, 0);
2204 (vbox2, chkbtn_transhdr,
2205 _("Translate header name (such as `From:', `Subject:')"));
2207 PACK_CHECK_BUTTON (vbox2, chkbtn_folder_unread,
2208 _("Display unread number next to folder name"));
2210 PACK_CHECK_BUTTON (vbox2, chkbtn_display_img,
2211 _("Automatically display images"));
2213 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2215 hbox1 = gtk_hbox_new (FALSE, 8);
2216 gtk_widget_show (hbox1);
2217 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2219 label_ng_abbrev = gtk_label_new
2220 (_("Abbreviate newsgroups longer than"));
2221 gtk_widget_show (label_ng_abbrev);
2222 gtk_box_pack_start (GTK_BOX (hbox1), label_ng_abbrev, FALSE, FALSE, 0);
2224 spinbtn_ng_abbrev_len_adj = gtk_adjustment_new (16, 0, 999, 1, 10, 10);
2225 spinbtn_ng_abbrev_len = gtk_spin_button_new
2226 (GTK_ADJUSTMENT (spinbtn_ng_abbrev_len_adj), 1, 0);
2227 gtk_widget_show (spinbtn_ng_abbrev_len);
2228 gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_ng_abbrev_len,
2230 gtk_widget_set_usize (spinbtn_ng_abbrev_len, 56, -1);
2231 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_ng_abbrev_len),
2234 label_ng_abbrev = gtk_label_new
2236 gtk_widget_show (label_ng_abbrev);
2237 gtk_box_pack_start (GTK_BOX (hbox1), label_ng_abbrev, FALSE, FALSE, 0);
2239 /* ---- Summary ---- */
2241 PACK_FRAME(vbox1, frame_summary, _("Summary View"));
2243 vbox2 = gtk_vbox_new (FALSE, 0);
2244 gtk_widget_show (vbox2);
2245 gtk_container_add (GTK_CONTAINER (frame_summary), vbox2);
2246 gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8);
2249 (vbox2, chkbtn_swapfrom,
2250 _("Display recipient on `From' column if sender is yourself"));
2252 (vbox2, chkbtn_useaddrbook,
2253 _("Display sender using address book"));
2255 (vbox2, chkbtn_hscrollbar, _("Enable horizontal scroll bar"));
2257 (vbox2, chkbtn_expand_thread, _("Expand threads"));
2259 (vbox2, chkbtn_bold_unread,
2260 _("Display unread messages with bold font"));
2262 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2264 hbox1 = gtk_hbox_new (FALSE, 8);
2265 gtk_widget_show (hbox1);
2266 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2268 label_datefmt = gtk_label_new (_("Date format"));
2269 gtk_widget_show (label_datefmt);
2270 gtk_box_pack_start (GTK_BOX (hbox1), label_datefmt, FALSE, FALSE, 0);
2272 entry_datefmt = gtk_entry_new ();
2273 gtk_widget_show (entry_datefmt);
2274 gtk_box_pack_start (GTK_BOX (hbox1), entry_datefmt, TRUE, TRUE, 0);
2276 button_datefmt = gtk_button_new_with_label (" ... ");
2278 gtk_widget_show (button_datefmt);
2279 gtk_box_pack_start (GTK_BOX (hbox1), button_datefmt, FALSE, FALSE, 0);
2280 gtk_signal_connect (GTK_OBJECT (button_datefmt), "clicked",
2281 GTK_SIGNAL_FUNC (date_format_create), NULL);
2283 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
2285 hbox1 = gtk_hbox_new (FALSE, 8);
2286 gtk_widget_show (hbox1);
2287 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2289 button_dispitem = gtk_button_new_with_label
2290 (_(" Set display item of summary... "));
2291 gtk_widget_show (button_dispitem);
2292 gtk_box_pack_start (GTK_BOX (hbox1), button_dispitem, FALSE, TRUE, 0);
2293 gtk_signal_connect (GTK_OBJECT (button_dispitem), "clicked",
2294 GTK_SIGNAL_FUNC (prefs_summary_column_open),
2297 display.entry_textfont = entry_textfont;
2298 display.button_textfont = button_textfont;
2300 display.chkbtn_display_img = chkbtn_display_img;
2301 display.chkbtn_transhdr = chkbtn_transhdr;
2302 display.chkbtn_folder_unread = chkbtn_folder_unread;
2303 display.spinbtn_ng_abbrev_len = spinbtn_ng_abbrev_len;
2304 display.spinbtn_ng_abbrev_len_adj = spinbtn_ng_abbrev_len_adj;
2306 display.chkbtn_swapfrom = chkbtn_swapfrom;
2307 display.chkbtn_hscrollbar = chkbtn_hscrollbar;
2308 display.chkbtn_expand_thread = chkbtn_expand_thread;
2309 display.chkbtn_bold_unread = chkbtn_bold_unread;
2310 display.chkbtn_useaddrbook = chkbtn_useaddrbook;
2311 display.entry_datefmt = entry_datefmt;
2314 static void prefs_message_create(void)
2320 GtkWidget *chkbtn_enablecol;
2321 GtkWidget *button_edit_col;
2322 GtkWidget *chkbtn_mbalnum;
2323 GtkWidget *chkbtn_disphdrpane;
2324 GtkWidget *chkbtn_disphdr;
2325 GtkWidget *button_edit_disphdr;
2326 GtkWidget *hbox_linespc;
2327 GtkWidget *label_linespc;
2328 GtkObject *spinbtn_linespc_adj;
2329 GtkWidget *spinbtn_linespc;
2330 GtkWidget *chkbtn_headspc;
2332 GtkWidget *frame_scr;
2333 GtkWidget *vbox_scr;
2334 GtkWidget *chkbtn_smoothscroll;
2335 GtkWidget *hbox_scr;
2336 GtkWidget *label_scr;
2337 GtkObject *spinbtn_scrollstep_adj;
2338 GtkWidget *spinbtn_scrollstep;
2339 GtkWidget *chkbtn_halfpage;
2341 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2342 gtk_widget_show (vbox1);
2343 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2344 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2346 hbox1 = gtk_hbox_new (FALSE, 8);
2347 gtk_widget_show (hbox1);
2348 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, TRUE, 0);
2350 PACK_CHECK_BUTTON (hbox1, chkbtn_enablecol,
2351 _("Enable coloration of message"));
2352 gtk_signal_connect (GTK_OBJECT (chkbtn_enablecol), "toggled",
2353 GTK_SIGNAL_FUNC (prefs_enable_message_color_toggled),
2356 button_edit_col = gtk_button_new_with_label (_(" Edit... "));
2357 gtk_widget_show (button_edit_col);
2358 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_col, FALSE, TRUE, 0);
2359 gtk_signal_connect (GTK_OBJECT (button_edit_col), "clicked",
2360 GTK_SIGNAL_FUNC (prefs_quote_colors_dialog), NULL);
2362 SET_TOGGLE_SENSITIVITY(chkbtn_enablecol, button_edit_col);
2364 vbox2 = gtk_vbox_new (FALSE, 0);
2365 gtk_widget_show (vbox2);
2366 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2369 (vbox2, chkbtn_mbalnum,
2370 _("Display 2-byte alphabet and numeric with 1-byte character"));
2371 PACK_CHECK_BUTTON(vbox2, chkbtn_disphdrpane,
2372 _("Display header pane above message view"));
2374 hbox1 = gtk_hbox_new (FALSE, 8);
2375 gtk_widget_show (hbox1);
2376 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2378 PACK_CHECK_BUTTON(hbox1, chkbtn_disphdr,
2379 _("Display short headers on message view"));
2381 button_edit_disphdr = gtk_button_new_with_label (_(" Edit... "));
2382 gtk_widget_show (button_edit_disphdr);
2383 gtk_box_pack_end (GTK_BOX (hbox1), button_edit_disphdr,
2385 gtk_signal_connect (GTK_OBJECT (button_edit_disphdr), "clicked",
2386 GTK_SIGNAL_FUNC (prefs_display_header_open),
2389 SET_TOGGLE_SENSITIVITY(chkbtn_disphdr, button_edit_disphdr);
2391 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
2393 hbox1 = gtk_hbox_new (FALSE, 32);
2394 gtk_widget_show (hbox1);
2395 gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, TRUE, 0);
2397 hbox_linespc = gtk_hbox_new (FALSE, 8);
2398 gtk_widget_show (hbox1);
2399 gtk_box_pack_start (GTK_BOX (hbox1), hbox_linespc, FALSE, TRUE, 0);
2401 label_linespc = gtk_label_new (_("Line space"));
2402 gtk_widget_show (label_linespc);
2403 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2406 spinbtn_linespc_adj = gtk_adjustment_new (2, 0, 16, 1, 1, 16);
2407 spinbtn_linespc = gtk_spin_button_new
2408 (GTK_ADJUSTMENT (spinbtn_linespc_adj), 1, 0);
2409 gtk_widget_show (spinbtn_linespc);
2410 gtk_box_pack_start (GTK_BOX (hbox_linespc), spinbtn_linespc,
2412 gtk_widget_set_usize (spinbtn_linespc, 64, -1);
2413 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_linespc), TRUE);
2415 label_linespc = gtk_label_new (_("pixel(s)"));
2416 gtk_widget_show (label_linespc);
2417 gtk_box_pack_start (GTK_BOX (hbox_linespc), label_linespc,
2420 PACK_CHECK_BUTTON(hbox1, chkbtn_headspc, _("Leave space on head"));
2422 PACK_FRAME(vbox1, frame_scr, _("Scroll"));
2424 vbox_scr = gtk_vbox_new (FALSE, 0);
2425 gtk_widget_show (vbox_scr);
2426 gtk_container_add (GTK_CONTAINER (frame_scr), vbox_scr);
2427 gtk_container_set_border_width (GTK_CONTAINER (vbox_scr), 8);
2429 PACK_CHECK_BUTTON(vbox_scr, chkbtn_halfpage, _("Half page"));
2431 hbox1 = gtk_hbox_new (FALSE, 32);
2432 gtk_widget_show (hbox1);
2433 gtk_box_pack_start (GTK_BOX (vbox_scr), hbox1, FALSE, TRUE, 0);
2435 PACK_CHECK_BUTTON(hbox1, chkbtn_smoothscroll, _("Smooth scroll"));
2437 hbox_scr = gtk_hbox_new (FALSE, 8);
2438 gtk_widget_show (hbox_scr);
2439 gtk_box_pack_start (GTK_BOX (hbox1), hbox_scr, FALSE, FALSE, 0);
2441 label_scr = gtk_label_new (_("Step"));
2442 gtk_widget_show (label_scr);
2443 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2445 spinbtn_scrollstep_adj = gtk_adjustment_new (1, 1, 100, 1, 10, 10);
2446 spinbtn_scrollstep = gtk_spin_button_new
2447 (GTK_ADJUSTMENT (spinbtn_scrollstep_adj), 1, 0);
2448 gtk_widget_show (spinbtn_scrollstep);
2449 gtk_box_pack_start (GTK_BOX (hbox_scr), spinbtn_scrollstep,
2451 gtk_widget_set_usize (spinbtn_scrollstep, 64, -1);
2452 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_scrollstep),
2455 label_scr = gtk_label_new (_("pixel(s)"));
2456 gtk_widget_show (label_scr);
2457 gtk_box_pack_start (GTK_BOX (hbox_scr), label_scr, FALSE, FALSE, 0);
2459 SET_TOGGLE_SENSITIVITY (chkbtn_smoothscroll, hbox_scr)
2461 message.chkbtn_enablecol = chkbtn_enablecol;
2462 message.button_edit_col = button_edit_col;
2463 message.chkbtn_mbalnum = chkbtn_mbalnum;
2464 message.chkbtn_disphdrpane = chkbtn_disphdrpane;
2465 message.chkbtn_disphdr = chkbtn_disphdr;
2466 message.spinbtn_linespc = spinbtn_linespc;
2467 message.chkbtn_headspc = chkbtn_headspc;
2469 message.chkbtn_smoothscroll = chkbtn_smoothscroll;
2470 message.spinbtn_scrollstep = spinbtn_scrollstep;
2471 message.spinbtn_scrollstep_adj = spinbtn_scrollstep_adj;
2472 message.chkbtn_halfpage = chkbtn_halfpage;
2476 static void prefs_privacy_create(void)
2482 GtkWidget *hbox_spc;
2484 GtkWidget *checkbtn_auto_check_signatures;
2485 GtkWidget *checkbtn_gpg_signature_popup;
2486 GtkWidget *checkbtn_store_passphrase;
2487 GtkObject *spinbtn_store_passphrase_adj;
2488 GtkWidget *spinbtn_store_passphrase;
2489 GtkWidget *checkbtn_passphrase_grab;
2490 GtkWidget *checkbtn_gpg_warning;
2492 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2493 gtk_widget_show (vbox1);
2494 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2495 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2497 vbox2 = gtk_vbox_new (FALSE, 0);
2498 gtk_widget_show (vbox2);
2499 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2501 PACK_CHECK_BUTTON (vbox2, checkbtn_auto_check_signatures,
2502 _("Automatically check signatures"));
2504 PACK_CHECK_BUTTON (vbox2, checkbtn_gpg_signature_popup,
2505 _("Show signature check result in a popup window"));
2507 PACK_CHECK_BUTTON (vbox2, checkbtn_store_passphrase,
2508 _("Store passphrase in memory temporarily"));
2510 vbox3 = gtk_vbox_new (FALSE, 0);
2511 gtk_widget_show (vbox3);
2512 gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
2514 hbox1 = gtk_hbox_new (FALSE, 8);
2515 gtk_widget_show (hbox1);
2516 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2518 hbox_spc = gtk_hbox_new (FALSE, 0);
2519 gtk_widget_show (hbox_spc);
2520 gtk_box_pack_start (GTK_BOX (hbox1), hbox_spc, FALSE, FALSE, 0);
2521 gtk_widget_set_usize (hbox_spc, 12, -1);
2523 label = gtk_label_new (_("Expire after"));
2524 gtk_widget_show (label);
2525 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2527 spinbtn_store_passphrase_adj = gtk_adjustment_new (0, 0, 1440, 1, 5, 5);
2528 spinbtn_store_passphrase = gtk_spin_button_new
2529 (GTK_ADJUSTMENT (spinbtn_store_passphrase_adj), 1, 0);
2530 gtk_widget_show (spinbtn_store_passphrase);
2531 gtk_box_pack_start (GTK_BOX (hbox1), spinbtn_store_passphrase, FALSE, FALSE, 0);
2532 gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbtn_store_passphrase),
2534 gtk_widget_set_usize (spinbtn_store_passphrase, 64, -1);
2536 label = gtk_label_new (_("minute(s) "));
2537 gtk_widget_show (label);
2538 gtk_box_pack_start (GTK_BOX (hbox1), label, 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 (_("(Setting to '0' will store the passphrase\n"
2550 " for the whole session)"));
2551 gtk_widget_show (label);
2552 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
2553 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
2555 SET_TOGGLE_SENSITIVITY (checkbtn_store_passphrase, vbox3);
2558 PACK_CHECK_BUTTON (vbox2, checkbtn_passphrase_grab,
2559 _("Grab input while entering a passphrase"));
2563 (vbox2, checkbtn_gpg_warning,
2564 _("Display warning on startup if GnuPG doesn't work"));
2566 hbox1 = gtk_hbox_new (FALSE, 8);
2567 gtk_widget_show (hbox1);
2568 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2570 privacy.checkbtn_auto_check_signatures
2571 = checkbtn_auto_check_signatures;
2572 privacy.checkbtn_gpg_signature_popup
2573 = checkbtn_gpg_signature_popup;
2574 privacy.checkbtn_store_passphrase = checkbtn_store_passphrase;
2575 privacy.spinbtn_store_passphrase = spinbtn_store_passphrase;
2576 privacy.spinbtn_store_passphrase_adj = spinbtn_store_passphrase_adj;
2577 privacy.checkbtn_passphrase_grab = checkbtn_passphrase_grab;
2578 privacy.checkbtn_gpg_warning = checkbtn_gpg_warning;
2580 #endif /* USE_GPGME */
2582 static void prefs_interface_create(void)
2587 /* GtkWidget *checkbtn_emacs; */
2588 GtkWidget *checkbtn_show_msg_with_cursor;
2589 GtkWidget *checkbtn_openunread;
2590 GtkWidget *checkbtn_mark_as_read_on_newwin;
2591 GtkWidget *checkbtn_openinbox;
2592 GtkWidget *checkbtn_immedexec;
2595 GtkWidget *dialogs_table;
2596 GtkWidget *optmenu_recvdialog;
2597 GtkWidget *optmenu_senddialog;
2599 GtkWidget *menuitem;
2600 GtkWidget *checkbtn_no_recv_err_panel;
2601 GtkWidget *checkbtn_close_recv_dialog;
2603 GtkWidget *frame_addr;
2604 GtkWidget *vbox_addr;
2605 GtkWidget *checkbtn_addaddrbyclick;
2607 GtkWidget *button_keybind;
2610 GtkWidget *optmenu_nextunreadmsgdialog;
2611 GtkWidget *optmenu_nextunreadmsgdialog_menu;
2612 GtkWidget *nextunreadmsgdialog_menuitem;
2614 GtkWidget *frame_pixmap_theme;
2615 GtkWidget *vbox_pixmap_theme;
2616 GtkWidget *entry_pixmap_theme;
2617 GtkWidget *combo_pixmap_theme;
2618 GList *avail_pixmap_themes = NULL;
2620 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2621 gtk_widget_show (vbox1);
2622 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2623 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2625 vbox2 = gtk_vbox_new (FALSE, 0);
2626 gtk_widget_show (vbox2);
2627 gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
2629 /* PACK_CHECK_BUTTON (vbox2, checkbtn_emacs,
2630 _("Emulate the behavior of mouse operation of\n"
2631 "Emacs-based mailer"));
2632 gtk_label_set_justify (GTK_LABEL (GTK_BIN (checkbtn_emacs)->child),
2633 GTK_JUSTIFY_LEFT); */
2636 (vbox2, checkbtn_show_msg_with_cursor,
2637 _("Open message when cursor keys are pressed on summary"));
2640 (vbox2, checkbtn_openunread,
2641 _("Open first unread message when entering a folder"));
2644 (vbox2, checkbtn_mark_as_read_on_newwin,
2645 _("Only mark message as read when opened in new window"));
2648 (vbox2, checkbtn_openinbox,
2649 _("Go to inbox after receiving new mail"));
2651 vbox3 = gtk_vbox_new (FALSE, 0);
2652 gtk_widget_show (vbox3);
2653 gtk_box_pack_start (GTK_BOX (vbox2), vbox3, FALSE, FALSE, 0);
2656 (vbox3, checkbtn_immedexec,
2657 _("Execute immediately when moving or deleting messages"));
2659 hbox1 = gtk_hbox_new (FALSE, 0);
2660 gtk_widget_show (hbox1);
2661 gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
2663 label = gtk_label_new
2664 (_("(Messages will be marked until execution\n"
2665 " if this is turned off)"));
2666 gtk_widget_show (label);
2667 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 8);
2668 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
2670 PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW);
2672 dialogs_table = gtk_table_new (2, 2, FALSE);
2673 gtk_widget_show (dialogs_table);
2674 gtk_container_add (GTK_CONTAINER (vbox2), dialogs_table);
2675 gtk_container_set_border_width (GTK_CONTAINER (dialogs_table), 8);
2676 gtk_table_set_row_spacings (GTK_TABLE (dialogs_table), VSPACING_NARROW);
2677 gtk_table_set_col_spacings (GTK_TABLE (dialogs_table), 8);
2679 label = gtk_label_new (_("Show send dialog"));
2680 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2681 gtk_widget_show (label);
2682 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 0, 1,
2683 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2686 optmenu_senddialog = gtk_option_menu_new ();
2687 gtk_widget_show (optmenu_senddialog);
2688 gtk_table_attach (GTK_TABLE (dialogs_table), optmenu_senddialog, 1, 2, 0, 1,
2689 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2691 menu = gtk_menu_new ();
2692 MENUITEM_ADD (menu, menuitem, _("Always"), SEND_DIALOG_ALWAYS);
2693 MENUITEM_ADD (menu, menuitem, _("Never"), SEND_DIALOG_NEVER);
2695 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_senddialog), menu);
2697 label = gtk_label_new (_("Show receive dialog"));
2698 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
2699 gtk_widget_show (label);
2700 gtk_table_attach (GTK_TABLE (dialogs_table), label, 0, 1, 1, 2,
2701 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2703 optmenu_recvdialog = gtk_option_menu_new ();
2704 gtk_widget_show (optmenu_recvdialog);
2705 gtk_table_attach (GTK_TABLE (dialogs_table), optmenu_recvdialog, 1, 2, 1, 2,
2706 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2708 menu = gtk_menu_new ();
2709 MENUITEM_ADD (menu, menuitem, _("Always"), RECV_DIALOG_ALWAYS);
2710 MENUITEM_ADD (menu, menuitem, _("Only if a window is active"),
2711 RECV_DIALOG_ACTIVE);
2712 MENUITEM_ADD (menu, menuitem, _("Never"), RECV_DIALOG_NEVER);
2714 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
2716 PACK_CHECK_BUTTON (vbox2, checkbtn_no_recv_err_panel,
2717 _("Don't popup error dialog on receive error"));
2719 PACK_CHECK_BUTTON (vbox2, checkbtn_close_recv_dialog,
2720 _("Close receive dialog when finished"));
2722 PACK_FRAME (vbox1, frame_addr, _("Address book"));
2724 vbox_addr = gtk_vbox_new (FALSE, 0);
2725 gtk_widget_show (vbox_addr);
2726 gtk_container_add (GTK_CONTAINER (frame_addr), vbox_addr);
2727 gtk_container_set_border_width (GTK_CONTAINER (vbox_addr), 8);
2730 (vbox_addr, checkbtn_addaddrbyclick,
2731 _("Add address to destination when double-clicked"));
2733 /* Next Unread Message Dialog */
2734 hbox2 = gtk_hbox_new (FALSE, 8);
2735 gtk_widget_show (hbox2);
2736 gtk_box_pack_start (GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
2738 label = gtk_label_new (_("Show no-unread-message dialog"));
2739 gtk_widget_show (label);
2740 gtk_box_pack_start (GTK_BOX (hbox2), label, FALSE, FALSE, 0);
2742 optmenu_nextunreadmsgdialog = gtk_option_menu_new ();
2743 gtk_widget_show (optmenu_nextunreadmsgdialog);
2744 gtk_box_pack_start (GTK_BOX (hbox2), optmenu_nextunreadmsgdialog,
2747 optmenu_nextunreadmsgdialog_menu = gtk_menu_new ();
2748 MENUITEM_ADD (optmenu_nextunreadmsgdialog_menu, nextunreadmsgdialog_menuitem,
2749 _("Always"), NEXTUNREADMSGDIALOG_ALWAYS);
2750 MENUITEM_ADD (optmenu_nextunreadmsgdialog_menu, nextunreadmsgdialog_menuitem,
2751 _("Assume 'Yes'"), NEXTUNREADMSGDIALOG_ASSUME_YES);
2752 MENUITEM_ADD (optmenu_nextunreadmsgdialog_menu, nextunreadmsgdialog_menuitem,
2753 _("Assume 'No'"), NEXTUNREADMSGDIALOG_ASSUME_NO);
2755 gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_nextunreadmsgdialog),
2756 optmenu_nextunreadmsgdialog_menu);
2759 /* Receive Dialog */
2760 /* hbox = gtk_hbox_new (FALSE, 8);
2761 gtk_widget_show (hbox);
2762 gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
2764 label = gtk_label_new (_("Show receive Dialog"));
2765 gtk_widget_show (label);
2766 gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
2768 recvdialog_optmenu = gtk_option_menu_new ();
2769 gtk_widget_show (recvdialog_optmenu);
2770 gtk_box_pack_start (GTK_BOX (hbox), recvdialog_optmenu, FALSE, FALSE, 0);
2772 recvdialog_optmenu_menu = gtk_menu_new ();
2774 MENUITEM_ADD (recvdialog_optmenu_menu, recvdialog_menuitem, _("Always"), RECVDIALOG_ALWAYS);
2775 MENUITEM_ADD (recvdialog_optmenu_menu, recvdialog_menuitem, _("Only if a sylpheed window is active"), RECVDIALOG_WINDOW_ACTIVE);
2776 MENUITEM_ADD (recvdialog_optmenu_menu, recvdialog_menuitem, _("Never"), RECVDIALOG_NEVER);
2778 gtk_option_menu_set_menu (GTK_OPTION_MENU (recvdialog_optmenu), recvdialog_optmenu_menu); */
2780 hbox1 = gtk_hbox_new (FALSE, 8);
2781 gtk_widget_show (hbox1);
2782 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
2784 button_keybind = gtk_button_new_with_label (_(" Set key bindings... "));
2785 gtk_widget_show (button_keybind);
2786 gtk_box_pack_start (GTK_BOX (hbox1), button_keybind, FALSE, FALSE, 0);
2787 gtk_signal_connect (GTK_OBJECT (button_keybind), "clicked",
2788 GTK_SIGNAL_FUNC (prefs_keybind_select), NULL);
2790 PACK_FRAME(vbox1, frame_pixmap_theme, _("Icon theme"));
2792 vbox_pixmap_theme = gtk_vbox_new(FALSE, 0);
2793 gtk_widget_show(vbox_pixmap_theme);
2794 gtk_container_add(GTK_CONTAINER(frame_pixmap_theme), vbox_pixmap_theme);
2795 gtk_container_set_border_width(GTK_CONTAINER(vbox_pixmap_theme), 8);
2797 avail_pixmap_themes = stock_pixmap_themes_list_new();
2799 combo_pixmap_theme = gtk_combo_new ();
2800 gtk_widget_show (combo_pixmap_theme);
2801 gtk_box_pack_start (GTK_BOX (vbox_pixmap_theme), combo_pixmap_theme, TRUE, TRUE, 0);
2802 gtk_combo_set_popdown_strings(GTK_COMBO(combo_pixmap_theme), avail_pixmap_themes);
2803 entry_pixmap_theme = GTK_COMBO (combo_pixmap_theme)->entry;
2805 stock_pixmap_themes_list_free(avail_pixmap_themes);
2807 /* interface.checkbtn_emacs = checkbtn_emacs; */
2808 interface.checkbtn_show_msg_with_cursor
2809 = checkbtn_show_msg_with_cursor;
2810 interface.checkbtn_openunread = checkbtn_openunread;
2811 interface.checkbtn_mark_as_read_on_newwin
2812 = checkbtn_mark_as_read_on_newwin;
2813 interface.checkbtn_openinbox = checkbtn_openinbox;
2814 interface.checkbtn_immedexec = checkbtn_immedexec;
2815 interface.optmenu_recvdialog = optmenu_recvdialog;
2816 interface.optmenu_senddialog = optmenu_senddialog;
2817 interface.checkbtn_no_recv_err_panel = checkbtn_no_recv_err_panel;
2818 interface.checkbtn_close_recv_dialog = checkbtn_close_recv_dialog;
2819 interface.checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
2820 interface.optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
2821 interface.combo_pixmap_theme = combo_pixmap_theme;
2822 interface.entry_pixmap_theme = entry_pixmap_theme;
2825 static void prefs_other_create(void)
2828 GtkWidget *ext_frame;
2829 GtkWidget *ext_table;
2832 GtkWidget *uri_label;
2833 GtkWidget *uri_combo;
2834 GtkWidget *uri_entry;
2836 GtkWidget *printcmd_label;
2837 GtkWidget *printcmd_entry;
2839 GtkWidget *exteditor_label;
2840 GtkWidget *exteditor_combo;
2841 GtkWidget *exteditor_entry;
2843 GtkWidget *frame_cliplog;
2844 GtkWidget *vbox_cliplog;
2845 GtkWidget *hbox_cliplog;
2846 GtkWidget *checkbtn_cliplog;
2847 GtkWidget *loglength_label;
2848 GtkWidget *loglength_entry;
2850 GtkWidget *frame_exit;
2851 GtkWidget *vbox_exit;
2852 GtkWidget *checkbtn_confonexit;
2853 GtkWidget *checkbtn_cleanonexit;
2854 GtkWidget *checkbtn_askonclean;
2855 GtkWidget *checkbtn_warnqueued;
2857 vbox1 = gtk_vbox_new (FALSE, VSPACING);
2858 gtk_widget_show (vbox1);
2859 gtk_container_add (GTK_CONTAINER (dialog.notebook), vbox1);
2860 gtk_container_set_border_width (GTK_CONTAINER (vbox1), VBOX_BORDER);
2862 PACK_FRAME(vbox1, ext_frame,
2863 _("External commands (%s will be replaced with file name / URI)"));
2865 ext_table = gtk_table_new (3, 2, FALSE);
2866 gtk_widget_show (ext_table);
2867 gtk_container_add (GTK_CONTAINER (ext_frame), ext_table);
2868 gtk_container_set_border_width (GTK_CONTAINER (ext_table), 8);
2869 gtk_table_set_row_spacings (GTK_TABLE (ext_table), VSPACING_NARROW);
2870 gtk_table_set_col_spacings (GTK_TABLE (ext_table), 8);
2872 uri_label = gtk_label_new (_("Web browser"));
2873 gtk_widget_show(uri_label);
2874 gtk_table_attach (GTK_TABLE (ext_table), uri_label, 0, 1, 0, 1,
2875 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2876 gtk_misc_set_alignment (GTK_MISC (uri_label), 1, 0.5);
2878 uri_combo = gtk_combo_new ();
2879 gtk_widget_show (uri_combo);
2880 gtk_table_attach (GTK_TABLE (ext_table), uri_combo, 1, 2, 0, 1,
2881 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2882 gtkut_combo_set_items (GTK_COMBO (uri_combo),
2884 "mozilla -remote 'openurl(%s,new-window)'",
2885 "netscape -remote 'openURL(%s,raise)'",
2887 "gnome-moz-remote --raise --newwin '%s'",
2888 "kfmclient openURL '%s'",
2889 "opera -newwindow '%s'",
2890 "kterm -e w3m '%s'",
2891 "kterm -e lynx '%s'",
2893 uri_entry = GTK_COMBO (uri_combo)->entry;
2895 printcmd_label = gtk_label_new (_("Print"));
2896 gtk_widget_show (printcmd_label);
2897 gtk_table_attach (GTK_TABLE (ext_table), printcmd_label, 0, 1, 1, 2,
2898 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2899 gtk_misc_set_alignment (GTK_MISC (printcmd_label), 1, 0.5);
2901 printcmd_entry = gtk_entry_new ();
2902 gtk_widget_show (printcmd_entry);
2903 gtk_table_attach (GTK_TABLE (ext_table), printcmd_entry, 1, 2, 1, 2,
2904 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2906 exteditor_label = gtk_label_new (_("Editor"));
2907 gtk_widget_show (exteditor_label);
2908 gtk_table_attach (GTK_TABLE (ext_table), exteditor_label, 0, 1, 2, 3,
2909 GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
2910 gtk_misc_set_alignment (GTK_MISC (exteditor_label), 1, 0.5);
2912 exteditor_combo = gtk_combo_new ();
2913 gtk_widget_show (exteditor_combo);
2914 gtk_table_attach (GTK_TABLE (ext_table), exteditor_combo, 1, 2, 2, 3,
2915 GTK_EXPAND | GTK_FILL, 0, 0, 0);
2916 gtkut_combo_set_items (GTK_COMBO (exteditor_combo),
2919 "mgedit --no-fork %s",
2925 exteditor_entry = GTK_COMBO (exteditor_combo)->entry;
2928 PACK_FRAME (vbox1, frame_cliplog, _("Log Size"));
2930 vbox_cliplog = gtk_vbox_new (FALSE, 0);
2931 gtk_widget_show (vbox_cliplog);
2932 gtk_container_add (GTK_CONTAINER (frame_cliplog), vbox_cliplog);
2933 gtk_container_set_border_width (GTK_CONTAINER (vbox_cliplog), 8);
2934 PACK_CHECK_BUTTON (vbox_cliplog, checkbtn_cliplog,
2935 _("Clip the log size"));
2936 hbox_cliplog = gtk_hbox_new (FALSE, 3);
2937 gtk_container_add (GTK_CONTAINER (vbox_cliplog), hbox_cliplog);
2938 gtk_widget_show (hbox_cliplog);
2940 loglength_label = gtk_label_new (_("Log window length"));
2941 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_label,
2943 gtk_widget_show (GTK_WIDGET (loglength_label));
2944 loglength_entry = gtk_entry_new ();
2945 gtk_widget_set_usize (GTK_WIDGET (loglength_entry), 64, -1);
2946 gtk_box_pack_start (GTK_BOX (hbox_cliplog), loglength_entry,
2948 gtk_widget_show (GTK_WIDGET (loglength_entry));
2949 SET_TOGGLE_SENSITIVITY(checkbtn_cliplog, loglength_entry);
2952 PACK_FRAME (vbox1, frame_exit, _("On exit"));
2954 vbox_exit = gtk_vbox_new (FALSE, 0);
2955 gtk_widget_show (vbox_exit);
2956 gtk_container_add (GTK_CONTAINER (frame_exit), vbox_exit);
2957 gtk_container_set_border_width (GTK_CONTAINER (vbox_exit), 8);
2959 PACK_CHECK_BUTTON (vbox_exit, checkbtn_confonexit,
2960 _("Confirm on exit"));
2962 hbox1 = gtk_hbox_new (FALSE, 32);
2963 gtk_widget_show (hbox1);
2964 gtk_box_pack_start (GTK_BOX (vbox_exit), hbox1, FALSE, FALSE, 0);
2966 PACK_CHECK_BUTTON (hbox1, checkbtn_cleanonexit,
2967 _("Empty trash on exit"));
2968 PACK_CHECK_BUTTON (hbox1, checkbtn_askonclean,
2969 _("Ask before emptying"));
2970 SET_TOGGLE_SENSITIVITY (checkbtn_cleanonexit, checkbtn_askonclean);
2972 PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
2973 _("Warn if there are queued messages"));
2975 other.uri_combo = uri_combo;
2976 other.uri_entry = uri_entry;
2977 other.printcmd_entry = printcmd_entry;
2979 other.exteditor_combo = exteditor_combo;
2980 other.exteditor_entry = exteditor_entry;
2982 other.checkbtn_cliplog = checkbtn_cliplog;
2983 other.loglength_entry = loglength_entry;
2985 other.checkbtn_confonexit = checkbtn_confonexit;
2986 other.checkbtn_cleanonexit = checkbtn_cleanonexit;
2987 other.checkbtn_askonclean = checkbtn_askonclean;
2988 other.checkbtn_warnqueued = checkbtn_warnqueued;
2991 static void date_format_ok_btn_clicked(GtkButton *button, GtkWidget **widget)
2993 GtkWidget *datefmt_sample = NULL;
2996 g_return_if_fail(widget != NULL);
2997 g_return_if_fail(*widget != NULL);
2998 g_return_if_fail(display.entry_datefmt != NULL);
3000 datefmt_sample = GTK_WIDGET(gtk_object_get_data
3001 (GTK_OBJECT(*widget), "datefmt_sample"));
3002 g_return_if_fail(datefmt_sample != NULL);
3004 text = gtk_editable_get_chars(GTK_EDITABLE(datefmt_sample), 0, -1);
3005 g_free(prefs_common.date_format);
3006 prefs_common.date_format = text;
3007 gtk_entry_set_text(GTK_ENTRY(display.entry_datefmt), text);
3009 gtk_widget_destroy(*widget);
3013 static void date_format_cancel_btn_clicked(GtkButton *button,
3016 g_return_if_fail(widget != NULL);
3017 g_return_if_fail(*widget != NULL);
3019 gtk_widget_destroy(*widget);
3023 static void date_format_key_pressed(GtkWidget *keywidget, GdkEventKey *event,
3026 if (event && event->keyval == GDK_Escape)
3027 date_format_cancel_btn_clicked(NULL, widget);
3030 static gboolean date_format_on_delete(GtkWidget *dialogwidget,
3031 GdkEventAny *event, GtkWidget **widget)
3033 g_return_val_if_fail(widget != NULL, FALSE);
3034 g_return_val_if_fail(*widget != NULL, FALSE);
3040 static void date_format_entry_on_change(GtkEditable *editable,
3044 struct tm *cal_time;
3048 cur_time = time(NULL);
3049 cal_time = localtime(&cur_time);
3051 text = gtk_editable_get_chars(editable, 0, -1);
3053 strftime(buffer, sizeof buffer, text, cal_time);
3055 gtk_label_set_text(example, buffer);
3058 static void date_format_select_row(GtkWidget *date_format_list, gint row,
3059 gint column, GdkEventButton *event,
3060 GtkWidget *date_format)
3066 GtkWidget *datefmt_sample;
3068 /* only on double click */
3069 if (!event || event->type != GDK_2BUTTON_PRESS) return;
3072 datefmt_sample = GTK_WIDGET(gtk_object_get_data
3073 (GTK_OBJECT(date_format), "datefmt_sample"));
3075 g_return_if_fail(date_format_list != NULL);
3076 g_return_if_fail(date_format != NULL);
3077 g_return_if_fail(datefmt_sample != NULL);
3079 /* get format from clist */
3080 gtk_clist_get_text(GTK_CLIST(date_format_list), row, 0, &format);
3082 cur_pos = gtk_editable_get_position(GTK_EDITABLE(datefmt_sample));
3083 old_format = gtk_entry_get_text(GTK_ENTRY(datefmt_sample));
3085 /* insert the format into the text entry */
3086 new_format = g_malloc(strlen(old_format) + 3);
3088 strncpy(new_format, old_format, cur_pos);
3089 new_format[cur_pos] = '\0';
3090 strcat(new_format, format);
3091 strcat(new_format, &old_format[cur_pos]);
3093 gtk_entry_set_text(GTK_ENTRY(datefmt_sample), new_format);
3094 gtk_editable_set_position(GTK_EDITABLE(datefmt_sample), cur_pos + 2);
3099 static GtkWidget *date_format_create(GtkButton *button, void *data)
3101 static GtkWidget *datefmt_win = NULL;
3103 GtkWidget *scrolledwindow1;
3104 GtkWidget *datefmt_clist;
3109 GtkWidget *confirm_area;
3111 GtkWidget *cancel_btn;
3112 GtkWidget *datefmt_entry;
3141 const gint TIME_FORMAT_ELEMS =
3142 sizeof time_format / sizeof time_format[0];
3144 time_format[0].txt = _("the full abbreviated weekday name");
3145 time_format[1].txt = _("the full weekday name");
3146 time_format[2].txt = _("the abbreviated month name");
3147 time_format[3].txt = _("the full month name");
3148 time_format[4].txt = _("the preferred date and time for the current locale");
3149 time_format[5].txt = _("the century number (year/100)");
3150 time_format[6].txt = _("the day of the month as a decimal number");
3151 time_format[7].txt = _("the hour as a decimal number using a 24-hour clock");
3152 time_format[8].txt = _("the hour as a decimal number using a 12-hour clock");
3153 time_format[9].txt = _("the day of the year as a decimal number");
3154 time_format[10].txt = _("the month as a decimal number");
3155 time_format[11].txt = _("the minute as a decimal number");
3156 time_format[12].txt = _("either AM or PM");
3157 time_format[13].txt = _("the second as a decimal number");
3158 time_format[14].txt = _("the day of the week as a decimal number");
3159 time_format[15].txt = _("the preferred date for the current locale");
3160 time_format[16].txt = _("the last two digits of a year");
3161 time_format[17].txt = _("the year as a decimal number");
3162 time_format[18].txt = _("the time zone or name or abbreviation");
3164 if (datefmt_win) return datefmt_win;
3166 datefmt_win = gtk_window_new(GTK_WINDOW_DIALOG);
3167 gtk_container_set_border_width(GTK_CONTAINER(datefmt_win), 8);
3168 gtk_window_set_title(GTK_WINDOW(datefmt_win), _("Date format"));
3169 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
3170 gtk_widget_set_usize(datefmt_win, 440, 280);
3172 vbox1 = gtk_vbox_new(FALSE, 10);
3173 gtk_widget_show(vbox1);
3174 gtk_container_add(GTK_CONTAINER(datefmt_win), vbox1);
3176 scrolledwindow1 = gtk_scrolled_window_new(NULL, NULL);
3177 gtk_scrolled_window_set_policy
3178 (GTK_SCROLLED_WINDOW(scrolledwindow1),
3179 GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
3180 gtk_widget_show(scrolledwindow1);
3181 gtk_box_pack_start(GTK_BOX(vbox1), scrolledwindow1, TRUE, TRUE, 0);
3183 titles[0] = _("Specifier");
3184 titles[1] = _("Description");
3185 datefmt_clist = gtk_clist_new_with_titles(2, titles);
3186 gtk_widget_show(datefmt_clist);
3187 gtk_container_add(GTK_CONTAINER(scrolledwindow1), datefmt_clist);
3188 /* gtk_clist_set_column_width(GTK_CLIST(datefmt_clist), 0, 80); */
3189 gtk_clist_set_selection_mode(GTK_CLIST(datefmt_clist),
3190 GTK_SELECTION_BROWSE);
3192 for (i = 0; i < TIME_FORMAT_ELEMS; i++) {
3194 /* phoney casting necessary because of gtk... */
3195 text[0] = (gchar *)time_format[i].fmt;
3196 text[1] = (gchar *)time_format[i].txt;
3197 gtk_clist_append(GTK_CLIST(datefmt_clist), text);
3200 table = gtk_table_new(2, 2, FALSE);
3201 gtk_widget_show(table);
3202 gtk_box_pack_start(GTK_BOX(vbox1), table, FALSE, FALSE, 0);
3203 gtk_table_set_row_spacings(GTK_TABLE(table), 4);
3204 gtk_table_set_col_spacings(GTK_TABLE(table), 8);
3206 label1 = gtk_label_new(_("Date format"));
3207 gtk_widget_show(label1);
3208 gtk_table_attach(GTK_TABLE(table), label1, 0, 1, 0, 1,
3210 gtk_label_set_justify(GTK_LABEL(label1), GTK_JUSTIFY_LEFT);
3211 gtk_misc_set_alignment(GTK_MISC(label1), 0, 0.5);
3213 datefmt_entry = gtk_entry_new_with_max_length(256);
3214 gtk_widget_show(datefmt_entry);
3215 gtk_table_attach(GTK_TABLE(table), datefmt_entry, 1, 2, 0, 1,
3216 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3218 /* we need the "sample" entry box; add it as data so callbacks can
3219 * get the entry box */
3220 gtk_object_set_data(GTK_OBJECT(datefmt_win), "datefmt_sample",
3223 label2 = gtk_label_new(_("Example"));
3224 gtk_widget_show(label2);
3225 gtk_table_attach(GTK_TABLE(table), label2, 0, 1, 1, 2,
3227 gtk_label_set_justify(GTK_LABEL(label2), GTK_JUSTIFY_LEFT);
3228 gtk_misc_set_alignment(GTK_MISC(label2), 0, 0.5);
3230 label3 = gtk_label_new("");
3231 gtk_widget_show(label3);
3232 gtk_table_attach(GTK_TABLE(table), label3, 1, 2, 1, 2,
3233 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3234 gtk_label_set_justify(GTK_LABEL(label3), GTK_JUSTIFY_LEFT);
3235 gtk_misc_set_alignment(GTK_MISC(label3), 0, 0.5);
3237 gtkut_button_set_create(&confirm_area, &ok_btn, _("OK"),
3238 &cancel_btn, _("Cancel"), NULL, NULL);
3239 gtk_widget_grab_default(ok_btn);
3240 gtk_widget_show(confirm_area);
3242 gtk_box_pack_start(GTK_BOX(vbox1), confirm_area, FALSE, FALSE, 0);
3244 /* set the current format */
3245 gtk_entry_set_text(GTK_ENTRY(datefmt_entry), prefs_common.date_format);
3246 date_format_entry_on_change(GTK_EDITABLE(datefmt_entry),
3249 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
3250 GTK_SIGNAL_FUNC(date_format_ok_btn_clicked),
3252 gtk_signal_connect(GTK_OBJECT(cancel_btn), "clicked",
3253 GTK_SIGNAL_FUNC(date_format_cancel_btn_clicked),
3255 gtk_signal_connect(GTK_OBJECT(datefmt_win), "key_press_event",
3256 GTK_SIGNAL_FUNC(date_format_key_pressed),
3258 gtk_signal_connect(GTK_OBJECT(datefmt_win), "delete_event",
3259 GTK_SIGNAL_FUNC(date_format_on_delete),
3261 gtk_signal_connect(GTK_OBJECT(datefmt_entry), "changed",
3262 GTK_SIGNAL_FUNC(date_format_entry_on_change),
3265 gtk_signal_connect(GTK_OBJECT(datefmt_clist), "select_row",
3266 GTK_SIGNAL_FUNC(date_format_select_row),
3269 gtk_window_set_position(GTK_WINDOW(datefmt_win), GTK_WIN_POS_CENTER);
3270 gtk_window_set_modal(GTK_WINDOW(datefmt_win), TRUE);
3272 gtk_widget_show(datefmt_win);
3273 manage_window_set_transient(GTK_WINDOW(datefmt_win));
3275 gtk_widget_grab_focus(ok_btn);
3280 void prefs_quote_colors_dialog(void)
3282 if (!quote_color_win)
3283 prefs_quote_colors_dialog_create();
3284 gtk_widget_show(quote_color_win);
3285 manage_window_set_transient(GTK_WINDOW(quote_color_win));
3288 gtk_widget_hide(quote_color_win);
3290 textview_update_message_colors();
3291 main_window_reflect_prefs_all();
3294 static void prefs_quote_colors_dialog_create(void)
3299 GtkWidget *quotelevel1_label;
3300 GtkWidget *quotelevel2_label;
3301 GtkWidget *quotelevel3_label;
3302 GtkWidget *uri_label;
3303 GtkWidget *signature_label;
3304 GtkWidget *tgt_folder_label;
3307 GtkWidget *recycle_colors_btn;
3308 GtkWidget *frame_colors;
3310 window = gtk_window_new(GTK_WINDOW_DIALOG);
3311 gtk_container_set_border_width(GTK_CONTAINER(window), 2);
3312 gtk_window_set_title(GTK_WINDOW(window), _("Set message colors"));
3313 gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
3314 gtk_window_set_modal(GTK_WINDOW(window), TRUE);
3315 gtk_window_set_policy(GTK_WINDOW(window), FALSE, FALSE, FALSE);
3317 vbox = gtk_vbox_new (FALSE, VSPACING);
3318 gtk_container_add (GTK_CONTAINER (window), vbox);
3319 gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
3320 PACK_FRAME(vbox, frame_colors, _("Colors"));
3322 table = gtk_table_new (5, 2, FALSE);
3323 gtk_container_add (GTK_CONTAINER (frame_colors), table);
3324 gtk_container_set_border_width (GTK_CONTAINER (table), 8);
3325 gtk_table_set_row_spacings (GTK_TABLE (table), 2);
3326 gtk_table_set_col_spacings (GTK_TABLE (table), 5);
3329 color_buttons.quote_level1_btn = gtk_button_new();
3330 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level1_btn,
3331 0, 1, 0, 1, 0, 0, 0, 0);
3332 gtk_widget_set_usize (color_buttons.quote_level1_btn, 40, 30);
3333 gtk_container_set_border_width
3334 (GTK_CONTAINER (color_buttons.quote_level1_btn), 5);
3336 color_buttons.quote_level2_btn = gtk_button_new();
3337 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level2_btn,
3338 0, 1, 1, 2, 0, 0, 0, 0);
3339 gtk_widget_set_usize (color_buttons.quote_level2_btn, 40, 30);
3340 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.quote_level2_btn), 5);
3342 color_buttons.quote_level3_btn = gtk_button_new_with_label ("");
3343 gtk_table_attach (GTK_TABLE (table), color_buttons.quote_level3_btn,
3344 0, 1, 2, 3, 0, 0, 0, 0);
3345 gtk_widget_set_usize (color_buttons.quote_level3_btn, 40, 30);
3346 gtk_container_set_border_width
3347 (GTK_CONTAINER (color_buttons.quote_level3_btn), 5);
3349 color_buttons.uri_btn = gtk_button_new_with_label ("");
3350 gtk_table_attach (GTK_TABLE (table), color_buttons.uri_btn,
3351 0, 1, 3, 4, 0, 0, 0, 0);
3352 gtk_widget_set_usize (color_buttons.uri_btn, 40, 30);
3353 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.uri_btn), 5);
3355 color_buttons.tgt_folder_btn = gtk_button_new_with_label ("");
3356 gtk_table_attach (GTK_TABLE (table), color_buttons.tgt_folder_btn,
3357 0, 1, 4, 5, 0, 0, 0, 0);
3358 gtk_widget_set_usize (color_buttons.tgt_folder_btn, 40, 30);
3359 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.tgt_folder_btn), 5);
3361 color_buttons.signature_btn = gtk_button_new_with_label ("");
3362 gtk_table_attach (GTK_TABLE (table), color_buttons.signature_btn,
3363 0, 1, 5, 6, 0, 0, 0, 0);
3364 gtk_widget_set_usize (color_buttons.signature_btn, 40, 30);
3365 gtk_container_set_border_width (GTK_CONTAINER (color_buttons.signature_btn), 5);
3367 quotelevel1_label = gtk_label_new (_("Quoted Text - First Level"));
3368 gtk_table_attach (GTK_TABLE (table), quotelevel1_label, 1, 2, 0, 1,
3369 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3370 gtk_label_set_justify (GTK_LABEL (quotelevel1_label), GTK_JUSTIFY_LEFT);
3371 gtk_misc_set_alignment (GTK_MISC (quotelevel1_label), 0, 0.5);
3373 quotelevel2_label = gtk_label_new (_("Quoted Text - Second Level"));
3374 gtk_table_attach (GTK_TABLE (table), quotelevel2_label, 1, 2, 1, 2,
3375 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3376 gtk_label_set_justify (GTK_LABEL (quotelevel2_label), GTK_JUSTIFY_LEFT);
3377 gtk_misc_set_alignment (GTK_MISC (quotelevel2_label), 0, 0.5);
3379 quotelevel3_label = gtk_label_new (_("Quoted Text - Third Level"));
3380 gtk_table_attach (GTK_TABLE (table), quotelevel3_label, 1, 2, 2, 3,
3381 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3382 gtk_label_set_justify (GTK_LABEL (quotelevel3_label), GTK_JUSTIFY_LEFT);
3383 gtk_misc_set_alignment (GTK_MISC (quotelevel3_label), 0, 0.5);
3385 uri_label = gtk_label_new (_("URI link"));
3386 gtk_table_attach (GTK_TABLE (table), uri_label, 1, 2, 3, 4,
3387 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3388 gtk_label_set_justify (GTK_LABEL (uri_label), GTK_JUSTIFY_LEFT);
3389 gtk_misc_set_alignment (GTK_MISC (uri_label), 0, 0.5);
3391 tgt_folder_label = gtk_label_new (_("Target folder"));
3392 gtk_table_attach (GTK_TABLE (table), tgt_folder_label, 1, 2, 4, 5,
3393 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3394 gtk_label_set_justify (GTK_LABEL (tgt_folder_label), GTK_JUSTIFY_LEFT);
3395 gtk_misc_set_alignment (GTK_MISC (tgt_folder_label), 0, 0.5);
3397 signature_label = gtk_label_new (_("Signatures"));
3398 gtk_table_attach (GTK_TABLE (table), signature_label, 1, 2, 5, 6,
3399 (GTK_EXPAND | GTK_FILL), 0, 0, 0);
3400 gtk_label_set_justify (GTK_LABEL (signature_label), GTK_JUSTIFY_LEFT);
3401 gtk_misc_set_alignment (GTK_MISC (signature_label), 0, 0.5);
3403 PACK_CHECK_BUTTON (vbox, recycle_colors_btn,
3404 _("Recycle quote colors"));
3406 gtkut_button_set_create(&hbbox, &ok_btn, _("OK"),
3407 NULL, NULL, NULL, NULL);
3408 gtk_box_pack_end(GTK_BOX(vbox), hbbox, FALSE, FALSE, 0);
3410 gtk_widget_grab_default(ok_btn);
3411 MANAGE_WINDOW_SIGNALS_CONNECT(window);
3412 gtk_signal_connect(GTK_OBJECT(window), "delete_event",
3413 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3414 gtk_signal_connect(GTK_OBJECT(window), "key_press_event",
3415 GTK_SIGNAL_FUNC(prefs_quote_colors_key_pressed),
3418 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level1_btn), "clicked",
3419 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL1");
3420 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level2_btn), "clicked",
3421 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL2");
3422 gtk_signal_connect(GTK_OBJECT(color_buttons.quote_level3_btn), "clicked",
3423 GTK_SIGNAL_FUNC(quote_color_set_dialog), "LEVEL3");
3424 gtk_signal_connect(GTK_OBJECT(color_buttons.uri_btn), "clicked",
3425 GTK_SIGNAL_FUNC(quote_color_set_dialog), "URI");
3426 gtk_signal_connect(GTK_OBJECT(color_buttons.tgt_folder_btn), "clicked",
3427 GTK_SIGNAL_FUNC(quote_color_set_dialog), "TGTFLD");
3428 gtk_signal_connect(GTK_OBJECT(color_buttons.signature_btn), "clicked",
3429 GTK_SIGNAL_FUNC(quote_color_set_dialog), "SIGNATURE");
3430 gtk_signal_connect(GTK_OBJECT(recycle_colors_btn), "toggled",
3431 GTK_SIGNAL_FUNC(prefs_recycle_colors_toggled), NULL);
3432 gtk_signal_connect(GTK_OBJECT(ok_btn), "clicked",
3433 GTK_SIGNAL_FUNC(gtk_main_quit), NULL);
3435 /* show message button colors and recycle options */
3436 set_button_bg_color(color_buttons.quote_level1_btn,
3437 prefs_common.quote_level1_col);
3438 set_button_bg_color(color_buttons.quote_level2_btn,
3439 prefs_common.quote_level2_col);
3440 set_button_bg_color(color_buttons.quote_level3_btn,
3441 prefs_common.quote_level3_col);
3442 set_button_bg_color(color_buttons.uri_btn,
3443 prefs_common.uri_col);
3444 set_button_bg_color(color_buttons.tgt_folder_btn,
3445 prefs_common.tgt_folder_col);
3446 set_button_bg_color(color_buttons.signature_btn,
3447 prefs_common.signature_col);
3448 gtk_toggle_button_set_active((GtkToggleButton *)recycle_colors_btn,
3449 prefs_common.recycle_quote_colors);
3451 gtk_widget_show_all(vbox);
3452 quote_color_win = window;
3455 static void prefs_quote_colors_key_pressed(GtkWidget *widget,
3456 GdkEventKey *event, gpointer data)
3458 if (event && event->keyval == GDK_Escape)
3462 static void quote_color_set_dialog(GtkWidget *widget, gpointer data)
3464 gchar *type = (gchar *)data;
3465 gchar *title = NULL;
3466 gdouble color[4] = {0.0, 0.0, 0.0, 0.0};
3468 GtkColorSelectionDialog *dialog;
3470 if(g_strcasecmp(type, "LEVEL1") == 0) {
3471 title = _("Pick color for quotation level 1");
3472 rgbvalue = prefs_common.quote_level1_col;
3473 } else if(g_strcasecmp(type, "LEVEL2") == 0) {
3474 title = _("Pick color for quotation level 2");
3475 rgbvalue = prefs_common.quote_level2_col;
3476 } else if(g_strcasecmp(type, "LEVEL3") == 0) {
3477 title = _("Pick color for quotation level 3");
3478 rgbvalue = prefs_common.quote_level3_col;
3479 } else if(g_strcasecmp(type, "URI") == 0) {
3480 title = _("Pick color for URI");
3481 rgbvalue = prefs_common.uri_col;
3482 } else if(g_strcasecmp(type, "TGTFLD") == 0) {
3483 title = _("Pick color for target folder");
3484 rgbvalue = prefs_common.tgt_folder_col;
3485 } else if(g_strcasecmp(type, "SIGNATURE") == 0) {
3486 title = _("Pick color for signatures");
3487 rgbvalue = prefs_common.signature_col;
3489 } else if(g_strcasecmp(type, "Misspelled word") == 0) {
3490 title = _("Pick color for misspelled word");
3491 rgbvalue = prefs_common.misspelled_col;
3493 } else { /* Should never be called */
3494 g_warning("Unrecognized datatype '%s' in quote_color_set_dialog\n", type);
3498 color_dialog = gtk_color_selection_dialog_new(title);
3499 gtk_window_set_position(GTK_WINDOW(color_dialog), GTK_WIN_POS_CENTER);
3500 gtk_window_set_modal(GTK_WINDOW(color_dialog), TRUE);
3501 gtk_window_set_policy(GTK_WINDOW(color_dialog), FALSE, FALSE, FALSE);
3502 manage_window_set_transient(GTK_WINDOW(color_dialog));
3504 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->ok_button),
3505 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_ok), data);
3506 gtk_signal_connect(GTK_OBJECT(GTK_COLOR_SELECTION_DIALOG(color_dialog)->cancel_button),
3507 "clicked", GTK_SIGNAL_FUNC(quote_colors_set_dialog_cancel), data);
3508 gtk_signal_connect(GTK_OBJECT(color_dialog), "key_press_event",
3509 GTK_SIGNAL_FUNC(quote_colors_set_dialog_key_pressed),
3512 /* preselect the previous color in the color selection dialog */
3513 color[0] = (gdouble) ((rgbvalue & 0xff0000) >> 16) / 255.0;
3514 color[1] = (gdouble) ((rgbvalue & 0x00ff00) >> 8) / 255.0;
3515 color[2] = (gdouble) (rgbvalue & 0x0000ff) / 255.0;
3516 dialog = GTK_COLOR_SELECTION_DIALOG(color_dialog);
3517 gtk_color_selection_set_color
3518 (GTK_COLOR_SELECTION(dialog->colorsel), color);
3520 gtk_widget_show(color_dialog);
3523 static void quote_colors_set_dialog_ok(GtkWidget *widget, gpointer data)
3525 GtkColorSelection *colorsel = (GtkColorSelection *)
3526 ((GtkColorSelectionDialog *)color_dialog)->colorsel;
3528 gint red, green, blue, rgbvalue;
3529 gchar *type = (gchar *)data;
3531 gtk_color_selection_get_color(colorsel, color);
3533 red = (gint) (color[0] * 255.0);
3534 green = (gint) (color[1] * 255.0);
3535 blue = (gint) (color[2] * 255.0);
3536 rgbvalue = (gint) ((red * 0x10000) | (green * 0x100) | blue);
3539 fprintf(stderr, "redc = %f, greenc = %f, bluec = %f\n", color[0], color[1], color[2]);
3540 fprintf(stderr, "red = %d, green = %d, blue = %d\n", red, green, blue);
3541 fprintf(stderr, "Color is %x\n", rgbvalue);
3544 if (g_strcasecmp(type, "LEVEL1") == 0) {
3545 prefs_common.quote_level1_col = rgbvalue;
3546 set_button_bg_color(color_buttons.quote_level1_btn, rgbvalue);
3547 } else if (g_strcasecmp(type, "LEVEL2") == 0) {
3548 prefs_common.quote_level2_col = rgbvalue;
3549 set_button_bg_color(color_buttons.quote_level2_btn, rgbvalue);
3550 } else if (g_strcasecmp(type, "LEVEL3") == 0) {
3551 prefs_common.quote_level3_col = rgbvalue;
3552 set_button_bg_color(color_buttons.quote_level3_btn, rgbvalue);
3553 } else if (g_strcasecmp(type, "URI") == 0) {
3554 prefs_common.uri_col = rgbvalue;
3555 set_button_bg_color(color_buttons.uri_btn, rgbvalue);
3556 } else if (g_strcasecmp(type, "TGTFLD") == 0) {
3557 prefs_common.tgt_folder_col = rgbvalue;
3558 set_button_bg_color(color_buttons.tgt_folder_btn, rgbvalue);
3559 folderview_set_target_folder_color(prefs_common.tgt_folder_col);
3560 } else if (g_strcasecmp(type, "SIGNATURE") == 0) {
3561 prefs_common.signature_col = rgbvalue;
3562 set_button_bg_color(color_buttons.signature_btn, rgbvalue);
3564 } else if (g_strcasecmp(type, "Misspelled word") == 0) {
3565 prefs_common.misspelled_col = rgbvalue;
3566 set_button_bg_color(spelling.misspelled_btn, rgbvalue);
3569 fprintf( stderr, "Unrecognized datatype '%s' in quote_color_set_dialog_ok\n", type );
3571 gtk_widget_destroy(color_dialog);
3574 static void quote_colors_set_dialog_cancel(GtkWidget *widget, gpointer data)
3576 gtk_widget_destroy(color_dialog);
3579 static void quote_colors_set_dialog_key_pressed(GtkWidget *widget,
3583 gtk_widget_destroy(color_dialog);
3586 static void set_button_bg_color(GtkWidget *widget, gint rgbvalue)
3591 gtkut_convert_int_to_gdk_color(rgbvalue, &color);
3592 newstyle = gtk_style_copy(gtk_widget_get_default_style());
3593 newstyle->bg[GTK_STATE_NORMAL] = color;
3594 newstyle->bg[GTK_STATE_PRELIGHT] = color;
3595 newstyle->bg[GTK_STATE_ACTIVE] = color;
3597 gtk_widget_set_style(GTK_WIDGET(widget), newstyle);
3600 static void prefs_enable_message_color_toggled(void)
3604 is_active = gtk_toggle_button_get_active
3605 (GTK_TOGGLE_BUTTON(message.chkbtn_enablecol));
3606 gtk_widget_set_sensitive(message.button_edit_col, is_active);
3607 prefs_common.enable_color = is_active;
3610 static void prefs_recycle_colors_toggled(GtkWidget *widget)
3614 is_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
3615 prefs_common.recycle_quote_colors = is_active;
3618 static void prefs_font_select(GtkButton *button, GtkEntry *entry)
3622 g_return_if_fail(entry != NULL);
3624 if (!font_sel_win) {
3625 font_sel_win = gtk_font_selection_dialog_new
3626 (_("Font selection"));
3627 gtk_window_position(GTK_WINDOW(font_sel_win),
3628 GTK_WIN_POS_CENTER);
3629 gtk_signal_connect(GTK_OBJECT(font_sel_win), "delete_event",
3630 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3633 (GTK_OBJECT(font_sel_win), "key_press_event",
3634 GTK_SIGNAL_FUNC(prefs_font_selection_key_pressed),
3636 gtk_signal_connect_object
3637 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->cancel_button),
3639 GTK_SIGNAL_FUNC(gtk_widget_hide_on_delete),
3640 GTK_OBJECT(font_sel_win));
3643 if(font_sel_conn_id) {
3644 gtk_signal_disconnect(GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button), font_sel_conn_id);
3646 font_sel_conn_id = gtk_signal_connect
3647 (GTK_OBJECT(GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button),
3649 GTK_SIGNAL_FUNC(prefs_font_selection_ok),
3651 printf("%i\n", font_sel_conn_id);
3653 font_name = gtk_editable_get_chars(GTK_EDITABLE(entry), 0, -1);
3654 gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(font_sel_win), font_name);
3656 manage_window_set_transient(GTK_WINDOW(font_sel_win));
3657 gtk_window_set_modal(GTK_WINDOW(font_sel_win), TRUE);
3658 gtk_widget_grab_focus
3659 (GTK_FONT_SELECTION_DIALOG(font_sel_win)->ok_button);
3660 gtk_widget_show(font_sel_win);
3663 static void prefs_font_selection_key_pressed(GtkWidget *widget,
3667 if (event && event->keyval == GDK_Escape)
3668 gtk_widget_hide(font_sel_win);
3671 static void prefs_font_selection_ok(GtkButton *button, GtkEntry *entry)
3675 fontname = gtk_font_selection_dialog_get_font_name
3676 (GTK_FONT_SELECTION_DIALOG(font_sel_win));
3679 gtk_entry_set_text(entry, fontname);
3684 gtk_widget_hide(font_sel_win);
3687 static void prefs_keybind_select(void)
3694 GtkWidget *confirm_area;
3696 GtkWidget *cancel_btn;
3698 window = gtk_window_new (GTK_WINDOW_DIALOG);
3699 gtk_container_set_border_width (GTK_CONTAINER (window), 8);
3700 gtk_window_set_title (GTK_WINDOW (window), _("Key bindings"));
3701 gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
3702 gtk_window_set_modal (GTK_WINDOW (window), TRUE);
3703 gtk_window_set_policy (GTK_WINDOW (window), FALSE, FALSE, FALSE);
3704 manage_window_set_transient (GTK_WINDOW (window));
3706 vbox1 = gtk_vbox_new (FALSE, VSPACING);
3707 gtk_container_add (GTK_CONTAINER (window), vbox1);
3708 gtk_container_set_border_width (GTK_CONTAINER (vbox1), 2);
3710 hbox1 = gtk_hbox_new (FALSE, 8);
3711 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3713 label = gtk_label_new
3714 (_("Select the preset of key bindings.\n"
3715 "You can also modify each menu's shortcuts by pressing\n"
3716 "any key(s) when placing the mouse pointer on the item."));
3717 gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
3718 gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
3720 hbox1 = gtk_hbox_new (FALSE, 8);
3721 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3723 combo = gtk_combo_new ();
3724 gtk_box_pack_start (GTK_BOX (hbox1), combo, TRUE, TRUE, 0);
3725 gtkut_combo_set_items (GTK_COMBO (combo),
3731 gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (combo)->entry), FALSE);
3733 hbox1 = gtk_hbox_new (FALSE, 8);
3734 gtk_box_pack_start (GTK_BOX (vbox1), hbox1, FALSE, FALSE, 0);
3736 gtkut_button_set_create (&confirm_area, &ok_btn, _("OK"),
3737 &cancel_btn, _("Cancel"), NULL, NULL);
3738 gtk_box_pack_end (GTK_BOX (hbox1), confirm_area, FALSE, FALSE, 0);
3739 gtk_widget_grab_default (ok_btn);
3741 MANAGE_WINDOW_SIGNALS_CONNECT(window);
3742 gtk_signal_connect (GTK_OBJECT (window), "delete_event",
3743 GTK_SIGNAL_FUNC (prefs_keybind_deleted), NULL);
3744 gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
3745 GTK_SIGNAL_FUNC (prefs_keybind_key_pressed), NULL);
3746 gtk_signal_connect (GTK_OBJECT (ok_btn), "clicked",
3747 GTK_SIGNAL_FUNC (prefs_keybind_apply_clicked),
3749 gtk_signal_connect (GTK_OBJECT (cancel_btn), "clicked",
3750 GTK_SIGNAL_FUNC (prefs_keybind_cancel),
3753 gtk_widget_show_all(window);
3755 keybind.window = window;
3756 keybind.combo = combo;
3759 static void prefs_keybind_key_pressed(GtkWidget *widget, GdkEventKey *event,
3762 if (event && event->keyval == GDK_Escape)
3763 prefs_keybind_cancel();
3766 static gint prefs_keybind_deleted(GtkWidget *widget, GdkEventAny *event,
3769 prefs_keybind_cancel();
3773 static void prefs_keybind_cancel(void)
3775 gtk_widget_destroy(keybind.window);
3776 keybind.window = NULL;
3777 keybind.combo = NULL;
3780 static void prefs_keybind_apply_clicked(GtkWidget *widget)
3782 GtkEntry *entry = GTK_ENTRY(GTK_COMBO(keybind.combo)->entry);
3786 static gchar *default_menurc =
3787 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3788 "(menu-path \"<Main>/File/Save as...\" \"<control>S\")\n"
3789 "(menu-path \"<Main>/File/Print...\" \"\")\n"
3790 "(menu-path \"<Main>/File/Exit\" \"<control>Q\")\n"
3792 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3793 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3794 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3795 "(menu-path \"<Main>/Edit/Search folder...\" \"<shift><control>F\")\n"
3797 "(menu-path \"<Main>/View/Expand Summary View\" \"V\")\n"
3798 "(menu-path \"<Main>/View/Expand Message View\" \"<shift>V\")\n"
3799 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3800 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3801 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3802 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3803 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3804 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3805 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3806 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3807 "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
3808 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3810 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3811 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3812 "(menu-path \"<Main>/Message/Compose an email message\" \"<control>M\")\n"
3813 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3814 "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
3815 "(menu-path \"<Main>/Message/Reply to all\" \"<shift><control>R\")\n"
3816 "(menu-path \"<Main>/Message/Forward\" \"<control><alt>F\")\n"
3817 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
3818 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3819 "(menu-path \"<Main>/Message/Copy...\" \"<shift><control>O\")\n"
3820 "(menu-path \"<Main>/Message/Delete\" \"<control>D\")\n"
3821 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3822 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3823 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3824 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3826 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3827 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3828 "(menu-path \"<Main>/Tools/Log window\" \"<control>L\")\n"
3830 "(menu-path \"<Compose>/File/Close\" \"<control>W\")\n"
3831 "(menu-path \"<Compose>/Edit/Select all\" \"<control>A\")\n"
3832 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
3833 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
3834 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
3835 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
3836 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
3838 static gchar *mew_wl_menurc =
3839 "(menu-path \"<Main>/File/Empty trash\" \"<shift>D\")\n"
3840 "(menu-path \"<Main>/File/Save as...\" \"Y\")\n"
3841 "(menu-path \"<Main>/File/Print...\" \"<shift>numbersign\")\n"
3842 "(menu-path \"<Main>/File/Exit\" \"<shift>Q\")\n"
3844 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3845 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3846 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3847 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
3849 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
3850 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
3851 "(menu-path \"<Main>/View/Thread view\" \"<shift>T\")\n"
3852 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3853 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3854 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3855 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3856 "(menu-path \"<Main>/View/Go to/Other folder...\" \"G\")\n"
3857 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3858 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3859 "(menu-path \"<Main>/View/Show all header\" \"<shift>H\")\n"
3860 "(menu-path \"<Main>/View/Update\" \"<shift>S\")\n"
3862 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3863 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3864 "(menu-path \"<Main>/Message/Compose an email message\" \"W\")\n"
3865 "(menu-path \"<Main>/Message/Reply\" \"<control>R\")\n"
3866 "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
3867 "(menu-path \"<Main>/Message/Reply to all\" \"<shift>A\")\n"
3868 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3869 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift>F\")\n" */
3870 "(menu-path \"<Main>/Message/Move...\" \"O\")\n"
3871 "(menu-path \"<Main>/Message/Copy...\" \"<shift>O\")\n"
3872 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3873 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3874 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3875 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3876 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"<shift>R\")\n"
3878 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3879 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3880 "(menu-path \"<Main>/Tools/Log window\" \"<control>L\")\n"
3882 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3883 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3884 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3885 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3886 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3887 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3888 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3890 static gchar *mutt_menurc =
3891 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3892 "(menu-path \"<Main>/File/Save as...\" \"S\")\n"
3893 "(menu-path \"<Main>/File/Print...\" \"P\")\n"
3894 "(menu-path \"<Main>/File/Exit\" \"Q\")\n"
3896 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3897 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3898 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3899 "(menu-path \"<Main>/Edit/Search messages...\" \"slash\")\n"
3901 "(menu-path \"<Main>/View/Toggle summary view\" \"V\")\n"
3902 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3903 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
3904 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
3905 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
3906 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
3907 "(menu-path \"<Main>/View/Go to/Other folder...\" \"C\")\n"
3908 "(menu-path \"<Main>/View/Open in new window\" \"<control><alt>N\")\n"
3909 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3910 "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
3911 "(menu-path \"<Main>/View/Update\" \"<control><alt>U\")\n"
3913 "(menu-path \"<Main>/Message/Get new mail\" \"<control>I\")\n"
3914 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><control>I\")\n"
3915 "(menu-path \"<Main>/Message/Compose new message\" \"M\")\n"
3916 "(menu-path \"<Main>/Message/Reply\" \"R\")\n"
3917 "(menu-path \"<Main>/Message/Reply to all\" \"G\")\n"
3918 "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
3919 "(menu-path \"<Main>/Message/Forward\" \"F\")\n"
3920 "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n"
3921 "(menu-path \"<Main>/Message/Move...\" \"<control>O\")\n"
3922 "(menu-path \"<Main>/Message/Copy...\" \"<shift>C\")\n"
3923 "(menu-path \"<Main>/Message/Delete\" \"D\")\n"
3924 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>F\")\n"
3925 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3926 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>N\")\n"
3927 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3929 "(menu-path \"<Main>/Tools/Address book\" \"<shift><control>A\")\n"
3930 "(menu-path \"<Main>/Tools/Execute\" \"X\")\n"
3931 "(menu-path \"<Main>/Tools/Log window\" \"<control>L\")\n"
3933 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3934 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3935 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3936 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3937 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3938 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3939 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3941 static gchar *old_sylpheed_menurc =
3942 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3943 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
3944 "(menu-path \"<Main>/File/Print...\" \"<alt>P\")\n"
3945 "(menu-path \"<Main>/File/Exit\" \"<alt>Q\")\n"
3947 "(menu-path \"<Main>/Edit/Copy\" \"<control>C\")\n"
3948 "(menu-path \"<Main>/Edit/Select all\" \"<control>A\")\n"
3949 "(menu-path \"<Main>/Edit/Find in current message...\" \"<control>F\")\n"
3950 "(menu-path \"<Main>/Edit/Search folder...\" \"<control>S\")\n"
3952 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
3953 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
3954 "(menu-path \"<Main>/View/Thread view\" \"<control>T\")\n"
3955 "(menu-path \"<Main>/View/Go to/Prev message\" \"P\")\n"
3956 "(menu-path \"<Main>/View/Go to/Next message\" \"N\")\n"
3957 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"<shift>P\")\n"
3958 "(menu-path \"<Main>/View/Go to/Next unread message\" \"<shift>N\")\n"
3959 "(menu-path \"<Main>/View/Go to/Other folder...\" \"<alt>G\")\n"
3960 "(menu-path \"<Main>/View/Open in new window\" \"<shift><control>N\")\n"
3961 "(menu-path \"<Main>/View/View source\" \"<control>U\")\n"
3962 "(menu-path \"<Main>/View/Show all header\" \"<control>H\")\n"
3963 "(menu-path \"<Main>/View/Update\" \"<alt>U\")\n"
3965 "(menu-path \"<Main>/Message/Get new mail\" \"<alt>I\")\n"
3966 "(menu-path \"<Main>/Message/Get from all accounts\" \"<shift><alt>I\")\n"
3967 "(menu-path \"<Main>/Message/Compose an email message\" \"<alt>N\")\n"
3968 "(menu-path \"<Main>/Message/Reply\" \"<alt>R\")\n"
3969 "(menu-path \"<Main>/Message/Reply to sender\" \"<control><alt>R\")\n"
3970 "(menu-path \"<Main>/Message/Reply to all\" \"<shift><alt>R\")\n"
3971 "(menu-path \"<Main>/Message/Forward\" \"<shift><alt>F\")\n"
3972 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"<shift><control>F\")\n" */
3973 "(menu-path \"<Main>/Message/Move...\" \"<alt>O\")\n"
3974 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
3975 "(menu-path \"<Main>/Message/Delete\" \"<alt>D\")\n"
3976 "(menu-path \"<Main>/Message/Mark/Mark\" \"<shift>asterisk\")\n"
3977 "(menu-path \"<Main>/Message/Mark/Unmark\" \"U\")\n"
3978 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"<shift>exclam\")\n"
3979 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
3981 "(menu-path \"<Main>/Tools/Address book\" \"<alt>A\")\n"
3982 "(menu-path \"<Main>/Tools/Execute\" \"<alt>X\")\n"
3983 "(menu-path \"<Main>/Tools/Log window\" \"<alt>L\")\n"
3985 "(menu-path \"<Compose>/File/Close\" \"<alt>W\")\n"
3986 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
3987 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"<alt>B\")\n"
3988 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"<alt>F\")\n"
3989 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"<control>A\")\n"
3990 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"<control>W\")\n"
3991 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"<alt>D\")";
3993 static gchar *empty_menurc =
3994 "(menu-path \"<Main>/File/Empty trash\" \"\")\n"
3995 "(menu-path \"<Main>/File/Save as...\" \"\")\n"
3996 "(menu-path \"<Main>/File/Print...\" \"\")\n"
3997 "(menu-path \"<Main>/File/Exit\" \"\")\n"
3999 "(menu-path \"<Main>/Edit/Copy\" \"\")\n"
4000 "(menu-path \"<Main>/Edit/Select all\" \"\")\n"
4001 "(menu-path \"<Main>/Edit/Find in current message...\" \"\")\n"
4002 "(menu-path \"<Main>/Edit/Search folder...\" \"\")\n"
4004 "(menu-path \"<Main>/View/Expand Summary View\" \"\")\n"
4005 "(menu-path \"<Main>/View/Expand Message View\" \"\")\n"
4006 "(menu-path \"<Main>/View/Thread view\" \"\")\n"
4007 "(menu-path \"<Main>/View/Go to/Prev message\" \"\")\n"
4008 "(menu-path \"<Main>/View/Go to/Next message\" \"\")\n"
4009 "(menu-path \"<Main>/View/Go to/Prev unread message\" \"\")\n"
4010 "(menu-path \"<Main>/View/Go to/Next unread message\" \"\")\n"
4011 "(menu-path \"<Main>/View/Go to/Other folder...\" \"\")\n"
4012 "(menu-path \"<Main>/View/Open in new window\" \"\")\n"
4013 "(menu-path \"<Main>/View/View source\" \"\")\n"
4014 "(menu-path \"<Main>/View/Show all header\" \"\")\n"
4015 "(menu-path \"<Main>/View/Update\" \"\")\n"
4017 "(menu-path \"<Main>/Message/Get new mail\" \"\")\n"
4018 "(menu-path \"<Main>/Message/Get from all accounts\" \"\")\n"
4019 "(menu-path \"<Main>/Message/Compose an email message\" \"\")\n"
4020 "(menu-path \"<Main>/Message/Reply\" \"\")\n"
4021 "(menu-path \"<Main>/Message/Reply to sender\" \"\")\n"
4022 "(menu-path \"<Main>/Message/Reply to all\" \"\")\n"
4023 "(menu-path \"<Main>/Message/Forward\" \"\")\n"
4024 /* "(menu-path \"<Main>/Message/Forward as attachment\" \"\")\n" */
4025 "(menu-path \"<Main>/Message/Move...\" \"\")\n"
4026 "(menu-path \"<Main>/Message/Copy...\" \"\")\n"
4027 "(menu-path \"<Main>/Message/Delete\" \"\")\n"
4028 "(menu-path \"<Main>/Message/Mark/Mark\" \"\")\n"
4029 "(menu-path \"<Main>/Message/Mark/Unmark\" \"\")\n"
4030 "(menu-path \"<Main>/Message/Mark/Mark as unread\" \"\")\n"
4031 "(menu-path \"<Main>/Message/Mark/Mark as read\" \"\")\n"
4033 "(menu-path \"<Main>/Tools/Address book\" \"\")\n"
4034 "(menu-path \"<Main>/Tools/Execute\" \"\")\n"
4035 "(menu-path \"<Main>/Tools/Log window\" \"\")\n"
4037 "(menu-path \"<Compose>/File/Close\" \"\")\n"
4038 "(menu-path \"<Compose>/Edit/Select all\" \"\")\n"
4039 "(menu-path \"<Compose>/Edit/Advanced/Move a word backward\" \"\")\n"
4040 "(menu-path \"<Compose>/Edit/Advanced/Move a word forward\" \"\")\n"
4041 "(menu-path \"<Compose>/Edit/Advanced/Move to beginning of line\" \"\")\n"
4042 "(menu-path \"<Compose>/Edit/Advanced/Delete a word backward\" \"\")\n"
4043 "(menu-path \"<Compose>/Edit/Advanced/Delete a word forward\" \"\")";
4045 text = gtk_entry_get_text(entry);
4047 if (!strcmp(text, _("Default")))
4048 rc_str = default_menurc;
4049 else if (!strcmp(text, "Mew / Wanderlust"))
4050 rc_str = mew_wl_menurc;
4051 else if (!strcmp(text, "Mutt"))
4052 rc_str = mutt_menurc;
4053 else if (!strcmp(text, _("Old Sylpheed")))
4054 rc_str = old_sylpheed_menurc;
4058 gtk_item_factory_parse_rc_string(empty_menurc);
4059 gtk_item_factory_parse_rc_string(rc_str);
4061 gtk_widget_destroy(keybind.window);
4062 keybind.window = NULL;
4063 keybind.combo = NULL;
4066 static void prefs_common_charset_set_data_from_optmenu(PrefParam *pparam)
4069 GtkWidget *menuitem;
4072 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4073 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4074 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
4075 g_free(*((gchar **)pparam->data));
4076 *((gchar **)pparam->data) = g_strdup(charset);
4079 static void prefs_common_charset_set_optmenu(PrefParam *pparam)
4082 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4084 GtkWidget *menuitem;
4088 g_return_if_fail(optmenu != NULL);
4089 g_return_if_fail(*((gchar **)pparam->data) != NULL);
4091 menu = gtk_option_menu_get_menu(optmenu);
4092 for (cur = GTK_MENU_SHELL(menu)->children;
4093 cur != NULL; cur = cur->next) {
4094 menuitem = GTK_WIDGET(cur->data);
4095 charset = gtk_object_get_user_data(GTK_OBJECT(menuitem));
4096 if (!strcmp(charset, *((gchar **)pparam->data))) {
4097 gtk_option_menu_set_history(optmenu, n);
4103 gtk_option_menu_set_history(optmenu, 0);
4104 prefs_common_charset_set_data_from_optmenu(pparam);
4107 static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam)
4110 GtkWidget *menuitem;
4112 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4113 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4114 *((RecvDialogMode *)pparam->data) = GPOINTER_TO_INT
4115 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4118 static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
4120 RecvDialogMode mode = *((RecvDialogMode *)pparam->data);
4121 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4123 GtkWidget *menuitem;
4126 case RECV_DIALOG_ALWAYS:
4127 gtk_option_menu_set_history(optmenu, 0);
4129 case RECV_DIALOG_ACTIVE:
4130 gtk_option_menu_set_history(optmenu, 1);
4132 case RECV_DIALOG_NEVER:
4133 gtk_option_menu_set_history(optmenu, 2);
4139 menu = gtk_option_menu_get_menu(optmenu);
4140 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4141 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4144 static void prefs_common_send_dialog_set_data_from_optmenu(PrefParam *pparam)
4147 GtkWidget *menuitem;
4149 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4150 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4151 *((SendDialogMode *)pparam->data) = GPOINTER_TO_INT
4152 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4155 static void prefs_common_send_dialog_set_optmenu(PrefParam *pparam)
4157 SendDialogMode mode = *((SendDialogMode *)pparam->data);
4158 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4160 GtkWidget *menuitem;
4163 case SEND_DIALOG_ALWAYS:
4164 gtk_option_menu_set_history(optmenu, 0);
4166 case SEND_DIALOG_NEVER:
4167 gtk_option_menu_set_history(optmenu, 1);
4173 menu = gtk_option_menu_get_menu(optmenu);
4174 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4175 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4178 static gint prefs_common_deleted(GtkWidget *widget, GdkEventAny *event,
4181 prefs_common_cancel();
4185 static void prefs_common_key_pressed(GtkWidget *widget, GdkEventKey *event,
4188 if (event && event->keyval == GDK_Escape)
4189 prefs_common_cancel();
4192 static void prefs_common_ok(void)
4194 prefs_common_apply();
4195 gtk_widget_hide(dialog.window);
4200 static void prefs_common_apply(void)
4202 gchar *entry_pixmap_theme_str;
4203 gboolean update_pixmap_theme;
4205 entry_pixmap_theme_str = gtk_entry_get_text(GTK_ENTRY(interface.entry_pixmap_theme));
4206 if (entry_pixmap_theme_str &&
4207 (strcmp(prefs_common.pixmap_theme_path, entry_pixmap_theme_str) != 0) )
4208 update_pixmap_theme = TRUE;
4210 update_pixmap_theme = FALSE;
4212 prefs_set_data_from_dialog(param);
4214 if (update_pixmap_theme)
4216 main_window_reflect_prefs_all_real(TRUE);
4217 compose_reflect_prefs_pixmap_theme();
4219 main_window_reflect_prefs_all_real(FALSE);
4221 prefs_common_save_config();
4223 inc_autocheck_timer_remove();
4224 inc_autocheck_timer_set();
4227 static void prefs_nextunreadmsgdialog_set_data_from_optmenu(PrefParam *pparam)
4230 GtkWidget *menuitem;
4232 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4233 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4234 *((NextUnreadMsgDialogShow *)pparam->data) = GPOINTER_TO_INT
4235 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4238 static void prefs_nextunreadmsgdialog_set_optmenu(PrefParam *pparam)
4240 NextUnreadMsgDialogShow dialog_show;
4241 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4243 GtkWidget *menuitem;
4245 dialog_show = *((NextUnreadMsgDialogShow *)pparam->data);
4247 switch (dialog_show) {
4248 case NEXTUNREADMSGDIALOG_ALWAYS:
4249 gtk_option_menu_set_history(optmenu, 0);
4251 case NEXTUNREADMSGDIALOG_ASSUME_YES:
4252 gtk_option_menu_set_history(optmenu, 1);
4254 case NEXTUNREADMSGDIALOG_ASSUME_NO:
4255 gtk_option_menu_set_history(optmenu, 2);
4259 menu = gtk_option_menu_get_menu(optmenu);
4260 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4261 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
4264 static void prefs_common_cancel(void)
4266 gtk_widget_hide(dialog.window);
4271 /* static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
4274 GtkWidget *menuitem;
4276 menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
4277 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4278 *((RecvDialogShow *)pparam->data) = GPOINTER_TO_INT
4279 (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
4282 /* static void prefs_recvdialog_set_optmenu(PrefParam *pparam)
4284 RecvDialogShow dialog_show;
4285 GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
4287 GtkWidget *menuitem;
4289 dialog_show = *((RecvDialogShow *)pparam->data);
4291 switch (dialog_show) {
4292 case RECVDIALOG_ALWAYS:
4293 gtk_option_menu_set_history(optmenu, 0);
4295 case RECVDIALOG_WINDOW_ACTIVE:
4296 gtk_option_menu_set_history(optmenu, 1);
4298 case RECVDIALOG_NEVER:
4299 gtk_option_menu_set_history(optmenu, 2);
4304 menu = gtk_option_menu_get_menu(optmenu);
4305 menuitem = gtk_menu_get_active(GTK_MENU(menu));
4306 gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));