release 0.6.0
[clawsker.git] / clawsker
index 06ff51e789ef175a89e4315e0b794e947702f3ea..222736b1238465ec31aac72e219a29e836a85acc 100755 (executable)
--- a/clawsker
+++ b/clawsker
@@ -59,7 +59,7 @@ Ricardo Mones E<lt>ricardo@mones.orgE<gt>
 
 =head1 LICENSE
 
-Copyright (c) 2007-2008 by Ricardo Mones Lastra
+Copyright (c) 2007-2009 by Ricardo Mones Lastra
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -154,7 +154,7 @@ sub _ {
     h_gui_dot_lines => _('Use the old dotted line look in the main window tree views (Folder, Message and other lists) instead of the modern lineless look.'),
     l_gui_h_scroll => _('Enable horizontal scrollbar'),
     h_gui_h_scroll => _('Enable the horizontal scrollbar in the Message List.'),
-    l_gui_swp_from => _('Dislay To column instead From column in Sent folder'),
+    l_gui_swp_from => _('Display To column instead From column in Sent folder'),
     h_gui_swp_from => _('Display the recipient\'s email address in a To column of the Sent folder instead of the originator\'s one in a From column.'),
     l_gui_v_scroll => _('Folder List scrollbar behaviour'),
     h_gui_v_scroll => _('Specify the policy of vertical scrollbar of Folder List: show always, automatic or hide always.'),
@@ -246,7 +246,7 @@ use constant PAGE_SPC => 5;
 
 # version functions
 
-sub version_greater() {
+sub version_greater_or_equal() {
   my ($version, $refvers) = @_;
   my @version = split (/\./, $version);
   my @refvers = split (/\./, $refvers);
@@ -259,7 +259,7 @@ sub version_greater() {
     ++$idx;
   }
   return TRUE if (($idx > $#refvers) 
-               or (int ($version[$idx]) > int ($refvers[$idx])));
+               or (int ($version[$idx]) >= int ($refvers[$idx])));
   return FALSE;
 }
 
@@ -413,6 +413,11 @@ sub set_widget_hint() {
     }
 }
 
+sub set_widget_sens() {
+    my ($wdgt, $minver) = @_;
+    $wdgt->set_sensitive (&version_greater_or_equal ($CLAWSV, $minver));
+}
+
 # graphic element creation 
 
 sub new_check_button_for {
@@ -431,6 +436,7 @@ sub new_check_button_for {
            &handle_bool_value($w, $e, \$HPVALUE{$name});
         });
     &set_widget_hint ($cb, $$hash{$key}[DESC]);
+    &set_widget_sens ($cb, $$hash{$key}[CMVER]);
     $hbox->pack_start ($cb, FALSE, FALSE, HBOX_SPC);
     #
     return $hbox;
@@ -457,6 +463,8 @@ sub new_text_box_for_int {
            &handle_int_value($w, $e, \$HPVALUE{$name});
         });
     &set_widget_hint ($gentry, $$hash{$key}[DESC]);
+    &set_widget_sens ($gentry, $$hash{$key}[CMVER]);
+    $glabel->set_sensitive ($gentry->sensitive);
     $hbox->pack_start ($glabel, FALSE, FALSE, HBOX_SPC);
     $hbox->pack_start ($gentry, FALSE, FALSE, HBOX_SPC);
     #
@@ -480,6 +488,8 @@ sub new_color_button_for {
            &handle_color_value($w, $e, \$HPVALUE{$name}); 
         });
     &set_widget_hint ($button, $$hash{$key}[DESC]);
+    &set_widget_sens ($button, $$hash{$key}[CMVER]);
+    $glabel->set_sensitive ($button->sensitive);
     $hbox->pack_start ($button, FALSE, FALSE, HBOX_SPC);
     $hbox->pack_start ($glabel, FALSE, FALSE, HBOX_SPC);
     #
@@ -506,6 +516,8 @@ sub new_selection_box_for {
         });
     $combo->set_active ($HPVALUE{$name});
     &set_widget_hint ($combo, $$hash{$key}[DESC]);
+    &set_widget_sens ($combo, $$hash{$key}[CMVER]);
+    $glabel->set_sensitive ($combo->sensitive);
     $hbox->pack_start ($glabel, FALSE, FALSE, HBOX_SPC);
     $hbox->pack_start ($combo, FALSE, FALSE, HBOX_SPC);
     #
@@ -1074,6 +1086,7 @@ sub parse_command_line() {
                &command_line_fatal ("required a dotted numeric value")
                    unless ($ARGV[$arg] =~ /[\d\.]+/);
                $CLAWSV = $ARGV[$arg];
+               last;
            };
            /--alternate-config-dir/ && do {
                ++$arg;
@@ -1192,7 +1205,7 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.";
-    my $year = "2007";
+    my $year = "2007-2009";
     my $holder = "Ricardo Mones &lt;ricardo\@mones.org&gt;";
 
     my $dialog = Gtk2::MessageDialog->new_with_markup ($parent,