10 Clawsker - A Claws Mail Tweaker
18 Clawsker is an applet to edit the so called Claws Mail hidden preferences.
20 Claws Mail is a fast, lightweight and feature-rich MUA with a high number
21 of configurable options. To keep the binary small and fast some of these
22 preferences which not widely used are not provided with a graphical interface
23 for inspection and/or modification.
25 Users wanting to edit such preferences had to face raw edition of their
26 configuration files, now you can do it with a convenient GTK2 interface
31 No options are currently available.
35 Alternate configuration directories are not (yet) supported.
39 Ricardo Mones E<lt>ricardo@mones.orgE<gt>
43 Copyright (c) 2007 by Ricardo Mones
45 This program is free software: you can redistribute it and/or modify
46 it under the terms of the GNU General Public License as published by
47 the Free Software Foundation, either version 3 of the License, or
48 (at your option) any later version.
50 This program is distributed in the hope that it will be useful,
51 but WITHOUT ANY WARRANTY; without even the implied warranty of
52 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53 GNU General Public License for more details.
55 You should have received a copy of the GNU General Public License
56 along with this program. If not, see E<lt>http://www.gnu.org/licenses/E<gt>.
61 use Glib qw(TRUE FALSE);
64 my $PREFIX = '@PREFIX@';
65 my $LIBDIR = '@LIBDIR@';
66 my $VERSION = '@VERSION@';
70 win_title => 'Claws Mail Hidden Preferences',
72 about_title => 'Clawsker ~ A Claws Mail Tweaker',
73 about_license => 'License:',
75 tab_colours => 'Colours',
76 tab_behaviour => 'Behaviour',
80 ab_frame => 'Addressbook',
81 mem_frame => 'Memory',
82 msgview_frame => 'Message view',
83 log_frame => 'Log window',
85 l_oth_use_dlg => 'Use address book dialog',
86 h_oth_use_dlg => 'If true use a separate dialogue to edit a person\'s details. Otherwise will use a form embedded in the addressbook\'s main window.',
87 l_oth_max_use => 'Maximum memory for message cache (Kb)',
88 h_oth_max_use => 'The maximum amount of memory to use to cache messages, in kB.',
89 l_oth_min_time => 'Minimun time for cache elements (minutes)',
90 h_oth_min_time => 'The minimum time in minutes to keep a cache in memory. Caches more recent than this time will not be freed, even if the memory usage is too high.',
92 l_gui_b_unread => 'Show unread messages with bold font',
93 h_gui_b_unread => 'Show unread messages in the Message List using a bold font.',
94 l_gui_no_markup => 'Don\'t use markup in compose window',
95 h_gui_no_markup => 'Don\'t use bold and italic text in Compose dialogue\'s account selector.',
96 l_gui_dot_lines => 'Use dotted lines in tree views',
97 h_gui_dot_lines => 'Use the old dotted line look in the main window tree views (folder and message lists) instead of the modern lineless look.',
98 l_gui_h_scroll => 'Enable horizontal scrollbar',
99 h_gui_h_scroll => 'Enable the horizontal scrollbar in the Message List.',
100 l_gui_swp_from => 'Swap From field in Sent folder',
101 h_gui_swp_from => 'Display the sender\'s email address in the To column of the Sent folder instead of the recipient\'s.',
102 l_gui_v_scroll => 'Folder list scrollbar behaviour',
103 h_gui_v_scroll => 'Specify the policy of vertical scrollbar of Folder List: show always, automatic or hide always.',
104 l_gui_v_scroll_show => 'Show always',
105 l_gui_v_scroll_auto => 'Automatic',
106 l_gui_v_scroll_hide => 'Hide always',
107 l_gui_strip_off => 'Striped lines contrast',
108 h_gui_strip_off => 'Specify the value to use when creating alternately coloured lines in tree view components. The smaller the value, the less visible the difference in the alternating colours of the lines.',
109 l_gui_cursor_v => 'Cursor visible in message view',
110 h_gui_cursor_v => 'Display the cursor in the message view.',
111 l_gui_toolbar_d => 'Detachable toolbars',
112 h_gui_toolbar_d => 'Show handles in the toolbars.',
113 l_gui_strip_all => 'Use stripes in tree view components',
114 h_gui_strip_all => 'Enable alternately coloured lines in all tree view components.',
115 l_gui_strip_sum => 'Use stripes in summary view',
116 h_gui_strip_sum => 'Enable alternately coloured lines in summary view and folder list',
118 l_beh_hover_t => 'Drag and drop hover timeout (ms)',
119 h_beh_hover_t => 'Time in milliseconds that will cause a folder tree to expand when the mouse cursor is held over it during drag and drop.',
120 l_beh_dangerous => 'Don\'t confirm deletions',
121 h_beh_dangerous => 'Don\'t ask for confirmation before definitive deletion of emails.',
122 l_beh_flowed => 'Respect flowed format in messages',
123 h_beh_flowed => 'Respect format=flowed on text/plain message parts. This will cause some mails to have long lines, but will fix some URLs that would otherwise be wrapped.',
124 l_beh_parts_rw => 'Allow writable temporary files',
125 h_beh_parts_rw => 'Saves temporary files when opening attachment with write bit set.',
126 l_beh_skip_ssl => 'Don\'t check SSL certificates',
127 h_beh_skip_ssl => 'Disables the verification of SSL certificates.',
128 l_beh_up_step => 'Progress update step (items)',
129 h_beh_up_step => 'Update stepping in progress bars.',
130 l_beh_thread_a => 'Maximum age in threading by subject (days)',
131 h_beh_thread_a => 'Number of days to include a message in a thread when using "Thread using subject in addition to standard headers".',
132 l_beh_unsafe_ssl => 'Allow unsafe SSL certificates',
133 h_beh_unsafe_ssl => 'Allows Claws Mail to remember multiple SSL certificates for a given server/port.',
134 l_beh_use_utf8 => 'Use UTF-8 in broken mails',
135 h_beh_use_utf8 => 'Use UTF-8 encoding for broken mails instead of current locale.',
136 l_beh_warn_dnd => 'Warning on drag and drop',
137 h_beh_warn_dnd => 'Display a confirmation dialogue on drag \'n\' drop of folders.',
139 l_col_emphasis => 'Emphasised X-Mailer colour',
140 h_col_emphasis => 'The colour used for the X-Mailer line when its value is Claws Mail.',
141 l_col_log_err => 'Errors colour',
142 h_col_log_err => 'Colour for error messages in log window.',
143 l_col_log_in => 'Input colour',
144 h_col_log_in => 'Colour for input messages in log window.',
145 l_col_log_msg => 'Messages colour',
146 h_col_log_msg => 'Colour for messages in log window.',
147 l_col_log_out => 'Output colour',
148 h_col_log_out => 'Colour for output messages in log window.',
149 l_col_log_warn => 'Warnings colour',
150 h_col_log_warn => 'Colour for warning messages in log window.',
152 e_error => 'Error: ',
153 e_noclawsrc => 'no $HOME/.claws-mail/clawsrc file found.',
154 e_running => 'seems Claws Mail is currently running, close it first.',
157 # load i18n messages if available
158 my $pname = "clawsker";
159 my @spp = split('/',$0);
161 my $sps = join('/',@spp);
162 my $lang = (defined($ENV{'LANG'}))? $ENV{'LANG'}: 'en';
165 /es.*/ && do { $langf = "es"; };
168 my $lf = $sps . $pname . "." . $langf . ".pl";
169 -x $lf or print "Warning: cant load $langf translation file\n";
170 do $lf unless ! -x $lf ;
173 # check if claws is running
174 my $socket = "/tmp/claws-mail-$<";
175 -S $socket and die "$xl::s{e_error}$xl::s{e_running}\n";
177 # all preferences read by load_preferences
179 # values of all preferences handled by clawsker
182 # index constants for preference arrays
183 use constant NAME => 0; # the name on the rc file
184 use constant LABEL => 1; # the label on the GUI
185 use constant DESC => 2; # the description for the hint/help
186 use constant TYPE => 3; # data type: bool, int, float, string, color
187 use constant GUI => 4; # GUI element
189 # data handlers and auxiliar functions
191 sub handle_bool_value {
192 my ($widget, $event, $dataref) = @_;
193 $$dataref = ($widget->get_active ())? '1': '0';
196 sub handle_int_value {
197 my ($widget, $event, $dataref) = @_;
198 $_ = $widget->get_text ();
203 $widget->set_text ($_);
206 $widget->set_text ($$dataref);
210 sub handle_string_value {
211 my ($widget, $event, $dataref) = @_;
212 $$dataref = $widget->get_text ();
215 sub gdk_color_from_str {
217 my ($rr, $gg, $bb) = (0, 0 ,0);
219 if (/\#([A-F0-9][A-F0-9])([A-F0-9][A-F0-9])([A-F0-9][A-F0-9])/) {
224 my $color = Gtk2::Gdk::Color->new ($rr, $gg, $bb);
228 sub str_from_gdk_color {
230 my $rr = $color->red / 256;
231 my $gg = $color->green / 256;
232 my $bb = $color->blue / 256;
233 my $str = sprintf ("#%.2x%.2x%.2x", $rr, $gg, $bb);
237 sub handle_color_value {
238 my ($widget, $event, $dataref) = @_;
239 my $newcol = $widget->get_color;
240 $$dataref = &str_from_gdk_color ($newcol);
243 sub handle_selection_value {
244 my ($widget, $event, $dataref) = @_;
245 $$dataref = $widget->get_active;
248 # graphic element creation
250 sub new_check_button_for {
251 my ($hash, $key) = @_;
252 my $name = $$hash{$key}[NAME];
253 my $label = $$hash{$key}[LABEL];
255 my $cb = Gtk2::CheckButton->new ($label);
256 $$hash{$key}[GUI] = $cb;
257 $cb->set_active ($HPVALUE{$name} eq '1');
258 $cb->signal_connect (clicked => sub {
260 &handle_bool_value($w, $e, \$HPVALUE{$name});
266 sub new_text_box_for {
267 my ($hash, $key) = @_;
268 my $name = $$hash{$key}[NAME];
269 my $label = $$hash{$key}[LABEL];
271 my $hbox = Gtk2::HBox->new (FALSE, 5);
272 my $glabel = Gtk2::Label->new ($label);
273 my $gentry = Gtk2::Entry->new;
274 $$hash{$key}[GUI] = $gentry;
275 $gentry->set_text($HPVALUE{$name});
276 $gentry->signal_connect(changed => sub {
278 &handle_int_value($w, $e, \$HPVALUE{$name}); # FIXME int only
280 $hbox->pack_start ($glabel, FALSE, FALSE, 0);
281 $hbox->pack_start ($gentry, FALSE, FALSE, 0);
286 sub new_color_button_for {
287 my ($hash, $key) = @_;
288 my $name = $$hash{$key}[NAME];
289 my $label = $$hash{$key}[LABEL];
291 my $col = &gdk_color_from_str ($HPVALUE{$name});
292 my $hbox = Gtk2::HBox->new (FALSE, 5);
293 my $glabel = Gtk2::Label->new ($label);
294 my $button = Gtk2::ColorButton->new_with_color ($col);
295 $$hash{$key}[GUI] = $button;
296 $button->set_title ($label);
297 $button->signal_connect ('color-set' => sub {
299 &handle_color_value($w, $e, \$HPVALUE{$name});
301 $hbox->pack_start ($button, FALSE, FALSE, 0);
302 $hbox->pack_start ($glabel, FALSE, FALSE, 0);
307 sub new_selection_box_for {
308 my ($hash, $key) = @_;
309 my $name = $$hash{$key}[NAME];
310 my $label = $$hash{$key}[LABEL];
312 my $hbox = Gtk2::HBox->new (FALSE, 5);
313 my $glabel = Gtk2::Label->new ($label);
314 my $combo = Gtk2::ComboBox->new_text;
315 $$hash{$key}[GUI] = $combo;
316 my @options = split (';', $$hash{$key}[TYPE]);
317 foreach my $opt (@options) {
318 my ($index, $textkey) = split ('=', $opt);
319 $combo->insert_text ($index, $xl::s{$textkey});
321 $combo->signal_connect ('changed' => sub {
323 &handle_selection_value($w, $e, \$HPVALUE{$name});
325 $combo->set_active ($HPVALUE{$name});
326 $hbox->pack_start ($glabel, FALSE, FALSE, 0);
327 $hbox->pack_start ($combo, FALSE, FALSE, 0);
332 # preference maps and corresponding page creation subs
334 %pr::oth = ( # other preferences
336 'addressbook_use_editaddress_dialog',
337 $xl::s{l_oth_use_dlg},
338 $xl::s{h_oth_use_dlg},
343 'cache_max_mem_usage',
344 $xl::s{l_oth_max_use},
345 $xl::s{h_oth_max_use},
350 'cache_min_keep_time',
351 $xl::s{l_oth_min_time},
352 $xl::s{h_oth_min_time},
358 sub new_other_page() {
359 my $of = Gtk2::VBox->new (FALSE, 5);
361 my $ab_frame = Gtk2::Frame->new ($xl::s{ab_frame});
362 my $cb_use_dlg = &new_check_button_for(\%pr::oth, 'use_dlg');
363 my $vb1 = Gtk2::VBox->new (FALSE, 5);
364 $vb1->pack_start ($cb_use_dlg, FALSE, FALSE, 0);
365 $ab_frame->add ($vb1);
367 my $mem_frame = Gtk2::Frame->new ($xl::s{mem_frame});
368 my $tb_max_use = &new_text_box_for(\%pr::oth, 'max_use');
369 my $tb_min_time = &new_text_box_for(\%pr::oth, 'min_time');
370 my $vb2 = Gtk2::VBox->new (FALSE, 5);
371 $vb2->pack_start ($tb_max_use, FALSE, FALSE, 0);
372 $vb2->pack_start ($tb_min_time, FALSE, FALSE, 0);
373 $mem_frame->add ($vb2);
375 $of->pack_start ($ab_frame, FALSE, FALSE, 0);
376 $of->pack_start ($mem_frame, FALSE, FALSE, 0);
381 %pr::gui = ( # gui bells and whistles
384 $xl::s{l_gui_b_unread},
385 $xl::s{h_gui_b_unread},
391 $xl::s{l_gui_no_markup},
392 $xl::s{h_gui_no_markup},
397 'enable_dotted_lines',
398 $xl::s{l_gui_dot_lines},
399 $xl::s{h_gui_dot_lines},
405 $xl::s{l_gui_h_scroll},
406 $xl::s{h_gui_h_scroll},
412 $xl::s{l_gui_swp_from},
413 $xl::s{h_gui_swp_from},
418 'folderview_vscrollbar_policy',
419 $xl::s{l_gui_v_scroll},
420 $xl::s{h_gui_v_scroll},
421 '0=l_gui_v_scroll_show;1=l_gui_v_scroll_auto;2=l_gui_v_scroll_hide',
425 'stripes_color_offset',
426 $xl::s{l_gui_strip_off},
427 $xl::s{h_gui_strip_off},
432 'textview_cursor_visible',
433 $xl::s{l_gui_cursor_v},
434 $xl::s{h_gui_cursor_v},
439 'toolbar_detachable',
440 $xl::s{l_gui_toolbar_d},
441 $xl::s{h_gui_toolbar_d},
446 'use_stripes_everywhere',
447 $xl::s{l_gui_strip_all},
448 $xl::s{h_gui_strip_all},
453 'use_stripes_in_summaries',
454 $xl::s{l_gui_strip_sum},
455 $xl::s{h_gui_strip_sum},
462 my $gf = Gtk2::VBox->new (FALSE, 5);
464 my $cb_b_unread = &new_check_button_for (\%pr::gui, 'b_unread');
465 my $cb_no_markup = &new_check_button_for (\%pr::gui, 'no_markup');
466 my $cb_dot_lines = &new_check_button_for (\%pr::gui, 'dot_lines');
467 my $cb_h_scroll = &new_check_button_for (\%pr::gui, 'h_scroll');
468 my $cb_swp_from = &new_check_button_for (\%pr::gui, 'swp_from');
469 my $cb_cursor_v = &new_check_button_for (\%pr::gui, 'cursor_v');
470 my $cb_toolbar_d = &new_check_button_for (\%pr::gui, 'toolbar_d');
471 my $cb_strip_all = &new_check_button_for (\%pr::gui, 'strip_all');
472 my $cb_strip_sum = &new_check_button_for (\%pr::gui, 'strip_sum');
473 my $sb_v_scroll = &new_selection_box_for (\%pr::gui, 'v_scroll');
474 my $tb_strip_off = &new_text_box_for (\%pr::gui, 'strip_off');
476 $gf->pack_start ($cb_b_unread, FALSE, FALSE, 0);
477 $gf->pack_start ($cb_no_markup, FALSE, FALSE, 0);
478 $gf->pack_start ($cb_dot_lines, FALSE, FALSE, 0);
479 $gf->pack_start ($cb_h_scroll, FALSE, FALSE, 0);
480 $gf->pack_start ($cb_swp_from, FALSE, FALSE, 0);
481 $gf->pack_start ($cb_cursor_v, FALSE, FALSE, 0);
482 $gf->pack_start ($cb_toolbar_d, FALSE, FALSE, 0);
483 $gf->pack_start ($cb_strip_all, FALSE, FALSE, 0);
484 $gf->pack_start ($cb_strip_sum, FALSE, FALSE, 0);
485 $gf->pack_start ($sb_v_scroll, FALSE, FALSE, 0);
486 $gf->pack_start ($tb_strip_off, FALSE, FALSE, 0);
490 %pr::beh = ( # tweak some behaviour
493 $xl::s{l_beh_hover_t},
494 $xl::s{h_beh_hover_t},
500 $xl::s{l_beh_dangerous},
501 $xl::s{h_beh_dangerous},
506 'respect_flowed_format',
507 $xl::s{l_beh_flowed},
508 $xl::s{h_beh_flowed},
513 'save_parts_readwrite',
514 $xl::s{l_beh_parts_rw},
515 $xl::s{h_beh_parts_rw},
520 'skip_ssl_cert_check',
521 $xl::s{l_beh_skip_ssl},
522 $xl::s{h_beh_skip_ssl},
527 'statusbar_update_step',
528 $xl::s{l_beh_up_step},
529 $xl::s{h_beh_up_step},
534 'thread_by_subject_max_age',
535 $xl::s{l_beh_thread_a},
536 $xl::s{h_beh_thread_a},
542 $xl::s{l_beh_unsafe_ssl},
543 $xl::s{h_beh_unsafe_ssl},
548 'utf8_instead_of_locale_for_broken_mail',
549 $xl::s{l_beh_use_utf8},
550 $xl::s{h_beh_use_utf8},
556 $xl::s{l_beh_warn_dnd},
557 $xl::s{h_beh_warn_dnd},
563 sub new_behaviour_page() {
564 my $bf = Gtk2::VBox->new (FALSE, 5);
566 my $tb_hoover_t = &new_text_box_for (\%pr::beh, 'hover_t');
567 my $tb_up_step = &new_text_box_for (\%pr::beh, 'up_step');
568 my $tb_thread_a = &new_text_box_for (\%pr::beh, 'thread_a');
569 my $cb_dangerous = &new_check_button_for (\%pr::beh, 'dangerous');
570 my $cb_flowed = &new_check_button_for (\%pr::beh, 'flowed');
571 my $cb_parts_rw = &new_check_button_for (\%pr::beh, 'parts_rw');
572 my $cb_skip_ssl = &new_check_button_for (\%pr::beh, 'skip_ssl');
573 my $cb_unsafe_ssl = &new_check_button_for (\%pr::beh, 'unsafe_ssl');
574 my $cb_use_utf8 = &new_check_button_for (\%pr::beh, 'use_utf8');
575 my $cb_warn_dnd = &new_check_button_for (\%pr::beh, 'warn_dnd');
577 $bf->pack_start ($tb_hoover_t, FALSE, FALSE, 0);
578 $bf->pack_start ($tb_up_step, FALSE, FALSE, 0);
579 $bf->pack_start ($tb_thread_a, FALSE, FALSE, 0);
580 $bf->pack_start ($cb_dangerous, FALSE, FALSE, 0);
581 $bf->pack_start ($cb_flowed, FALSE, FALSE, 0);
582 $bf->pack_start ($cb_parts_rw, FALSE, FALSE, 0);
583 $bf->pack_start ($cb_skip_ssl, FALSE, FALSE, 0);
584 $bf->pack_start ($cb_unsafe_ssl, FALSE, FALSE, 0);
585 $bf->pack_start ($cb_use_utf8, FALSE, FALSE, 0);
586 $bf->pack_start ($cb_warn_dnd, FALSE, FALSE, 0);
590 %pr::col = ( # a variety of colours
593 $xl::s{l_col_emphasis},
594 $xl::s{h_col_emphasis},
600 $xl::s{l_col_log_err},
601 $xl::s{h_col_log_err},
607 $xl::s{l_col_log_in},
608 $xl::s{h_col_log_in},
614 $xl::s{l_col_log_msg},
615 $xl::s{h_col_log_msg},
621 $xl::s{l_col_log_out},
622 $xl::s{h_col_log_out},
628 $xl::s{l_col_log_warn},
629 $xl::s{h_col_log_warn},
635 sub new_colours_page() {
636 my $cf = Gtk2::VBox->new (FALSE, 5);
638 my $msgview_frame = Gtk2::Frame->new ($xl::s{msgview_frame});
639 my $cb_emphasis = &new_color_button_for (\%pr::col, 'emphasis');
640 my $vb1 = Gtk2::VBox->new (FALSE, 5);
641 $vb1->pack_start ($cb_emphasis, FALSE, FALSE, 0);
642 $msgview_frame->add ($vb1);
644 my $log_frame = Gtk2::Frame->new ($xl::s{log_frame});
645 my $cb_log_err = &new_color_button_for (\%pr::col, 'log_err');
646 my $cb_log_in = &new_color_button_for (\%pr::col, 'log_in');
647 my $cb_log_msg = &new_color_button_for (\%pr::col, 'log_msg');
648 my $cb_log_out = &new_color_button_for (\%pr::col, 'log_out');
649 my $cb_log_warn = &new_color_button_for (\%pr::col, 'log_warn');
650 my $vb2 = Gtk2::VBox->new (FALSE, 5);
651 $vb2->pack_start ($cb_log_err, FALSE, FALSE, 0);
652 $vb2->pack_start ($cb_log_in, FALSE, FALSE, 0);
653 $vb2->pack_start ($cb_log_msg, FALSE, FALSE, 0);
654 $vb2->pack_start ($cb_log_out, FALSE, FALSE, 0);
655 $vb2->pack_start ($cb_log_warn, FALSE, FALSE, 0);
656 $log_frame->add ($vb2);
658 $cf->pack_start ($msgview_frame, FALSE, FALSE, 0);
659 $cf->pack_start ($log_frame, FALSE, FALSE, 0);
663 # update the hidden preferences status from loaded values
664 sub init_hidden_preferences() {
665 foreach my $hash (\%pr::beh, \%pr::col, \%pr::gui, \%pr::oth) {
666 foreach my $key (keys %$hash) {
667 $HPVALUE{${$hash}{$key}[NAME]} = $PREFS{${$hash}{$key}[NAME]};
672 # load current status from disc
673 sub load_preferences() {
674 my $rc = $ENV{HOME} . '/.claws-mail/clawsrc';
675 -f $rc or die "$xl::s{e_error}$xl::s{e_noclawsrc}\n";
679 if (/^([8a-z_]+)=(.*)$/) {
686 # save current preferences to disc
687 sub save_preferences() {
688 my $rc = $ENV{HOME} . '/.claws-mail/clawsrc';
689 my $rcbak = "$rc.backup";
690 rename ($rc, $rcbak);
692 open (RCB, "<$rcbak");
695 if (/^([8a-z_]+)=(.*)$/) {
696 if (defined($HPVALUE{$1})) {
697 print RCF $1 . "=" . $HPVALUE{$1} . "\n";
713 my $nb = Gtk2::Notebook->new;
715 $nb->append_page (&new_behaviour_page, $xl::s{tab_behaviour});
716 $nb->append_page (&new_colours_page, $xl::s{tab_colours});
717 $nb->append_page (&new_gui_page, $xl::s{tab_gui});
718 $nb->append_page (&new_other_page, $xl::s{tab_other});
723 # create an about dialog
724 sub new_about_dialog() {
726 my $title = $xl::s{about_title};
727 my $lic = $xl::s{about_license};
729 "This program is free software: you can redistribute it and/or modify
730 it under the terms of the GNU General Public License as published by
731 the Free Software Foundation, either version 3 of the License, or
732 (at your option) any later version.
734 This program is distributed in the hope that it will be useful,
735 but WITHOUT ANY WARRANTY; without even the implied warranty of
736 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
737 GNU General Public License for more details.
739 You should have received a copy of the GNU General Public License
740 along with this program. If not, see <http://www.gnu.org/licenses/>.";
742 my $dialog = Gtk2::MessageDialog->new_with_markup ($parent,
743 [qw/modal destroy-with-parent/],
745 "<span size=\"x-large\" weight=\"bold\">$title</span>\n<span>Copyright 2007 by Ricardo Mones <ricardo\@mones.org></span>\n\n<span size=\"large\">$lic</span>\n\n<span size=\"small\">$license</span>");
746 $dialog->set_title ($xl::s{about});
752 sub new_button_box() {
754 my $b_about = Gtk2::Button->new_from_stock ('gtk-about');
755 my $b_exit = Gtk2::Button->new_from_stock ('gtk-quit');
756 my $b_apply = Gtk2::Button->new_from_stock ('gtk-apply');
757 # disable button until is really implemented
758 # my $b_undo = Gtk2::Button->new_from_stock ('gtk-undo');
759 my $hbox = Gtk2::HBox->new (FALSE, 5);
761 $b_exit->signal_connect (clicked => sub { Gtk2->main_quit });
762 $b_apply->signal_connect (clicked => sub { &save_preferences });
763 # $b_undo->signal_connect (clicked => sub { &undo_current_changes });
764 $b_about->signal_connect (clicked => sub { $adlg->run; $adlg->hide });
766 $hbox->pack_end ($b_exit, FALSE, FALSE, 0);
767 $hbox->pack_end ($b_apply, FALSE, FALSE, 0);
768 # $hbox->pack_end ($b_undo, FALSE, FALSE, 0);
769 $hbox->pack_start ($b_about, FALSE, FALSE, 0);
776 &init_hidden_preferences;
778 my $window = Gtk2::Window->new ('toplevel');
779 my $box = Gtk2::VBox->new (FALSE, 5);
780 my $about = &new_about_dialog;
781 $box->pack_start (&new_notebook, FALSE, FALSE, 0);
782 $box->pack_end (&new_button_box ($about), FALSE, FALSE, 0);
784 $window->set_title ($xl::s{win_title});