[Commits] [SCM] clawsker branch, master, updated. 1.2.0-40-gcd65b1a

mones at claws-mail.org mones at claws-mail.org
Sun Nov 18 02:58:48 CET 2018


The branch, master has been updated
       via  cd65b1a420865029b16250b2773438128bd445c4 (commit)
       via  3e3f7c463837af6901c6b79240f44a2646dd0e55 (commit)
       via  333f6a96b00b2cbc03beb8a363215f5757da9e63 (commit)
      from  9367d365b6d77c426a92840b61dd5f6f2d4faad5 (commit)

Summary of changes:
 clawsker |  152 +++++++++++++++-----------------------------------------------
 1 file changed, 36 insertions(+), 116 deletions(-)


- Log -----------------------------------------------------------------
commit cd65b1a420865029b16250b2773438128bd445c4
Author: Ricardo Mones <ricardo at mones.org>
Date:   Sun Nov 18 02:52:11 2018 +0100

    Fix alignment of windows page tabs

diff --git a/clawsker b/clawsker
index 9cef429..52a6fd9 100755
--- a/clawsker
+++ b/clawsker
@@ -66,16 +66,6 @@ sub _ {
     exit_fact => _('There are unapplied modifications.'),
     exit_question => _('Do you really want to quit?'),
 
-    tab_colours => _('Colours'),
-    tab_behaviour => _('Behaviour'),
-    tab_gui => _('GUI'),
-    tab_other => _('Other'),
-    tab_winpos => _('Windows'),
-    tab_accounts => _('Accounts'),
-    tab_plugins => _('Plugins'),
-    tab_hotkeys => _('Hotkeys'),
-    tab_info => _('Info'),
-
     l_oth_use_dlg => _('Use detached address book edit dialogue'),
     h_oth_use_dlg => _('If true use a separate dialogue to edit a person\'s details. Otherwise will use a form embedded in the address book\'s main window.'),
     l_oth_max_use => _('Maximum memory for message cache'),
@@ -1922,26 +1912,16 @@ sub new_winpos_subpage_misc() {
 sub new_winpos_page() {
     my $winbook = Gtk3::Notebook->new;
     $winbook->set_tab_pos ('right');
-    $winbook->append_page (new_winpos_subpage_main,
-        Gtk3::Label->new (_('Main')));
-    $winbook->append_page (new_winpos_subpage_msgs,
-        Gtk3::Label->new (_('Message')));
-    $winbook->append_page (new_winpos_subpage_sendrecv,
-        Gtk3::Label->new (_('Send/Receive')));
-    $winbook->append_page (new_winpos_subpage_fold,
-        Gtk3::Label->new (_('Folder')));
-    $winbook->append_page (new_winpos_subpage_addrbook,
-        Gtk3::Label->new (_('Addressbook')));
-    $winbook->append_page (new_winpos_subpage_accounts,
-        Gtk3::Label->new (_('Accounts')));
-    $winbook->append_page (new_winpos_subpage_filtering,
-        Gtk3::Label->new (_('Filtering')));
-    $winbook->append_page (new_winpos_subpage_useractions,
-        Gtk3::Label->new (_('User Actions')));
-    $winbook->append_page (new_winpos_subpage_prefs,
-        Gtk3::Label->new (_('Preferences')));
-    $winbook->append_page (new_winpos_subpage_misc,
-        Gtk3::Label->new (_('Other')));
+    $winbook->append_page (&new_winpos_subpage_main, new_label (_('Main')));
+    $winbook->append_page (&new_winpos_subpage_msgs, new_label (_('Message')));
+    $winbook->append_page (&new_winpos_subpage_sendrecv, new_label (_('Send/Receive')));
+    $winbook->append_page (&new_winpos_subpage_fold, new_label (_('Folder')));
+    $winbook->append_page (&new_winpos_subpage_addrbook, new_label (_('Addressbook')));
+    $winbook->append_page (&new_winpos_subpage_accounts, new_label (_('Accounts')));
+    $winbook->append_page (&new_winpos_subpage_filtering, new_label (_('Filtering')));
+    $winbook->append_page (&new_winpos_subpage_useractions, new_label (_('User Actions')));
+    $winbook->append_page (&new_winpos_subpage_prefs, new_label (_('Preferences')));
+    $winbook->append_page (&new_winpos_subpage_misc, new_label (_('Other')));
     return $winbook;
 }
 
@@ -2618,25 +2598,16 @@ sub save_preferences {
 # create notebook
 sub new_notebook {
     my $nb = Gtk3::Notebook->new;
-    #
-    $nb->append_page (new_behaviour_page (),
-        Gtk3::Label->new ($xl::s{tab_behaviour}));
-    $nb->append_page (new_colours_page (),
-        Gtk3::Label->new ($xl::s{tab_colours}));
-    $nb->append_page (new_gui_page (),
-        Gtk3::Label->new ($xl::s{tab_gui}));
-    $nb->append_page (new_other_page (),
-        Gtk3::Label->new ($xl::s{tab_other}));
-    $nb->append_page (new_winpos_page (),
-        Gtk3::Label->new ($xl::s{tab_winpos}));
-    $nb->append_page (new_accounts_page (),
-        Gtk3::Label->new ($xl::s{tab_accounts}));
-    $nb->append_page (new_plugins_page (),
-        Gtk3::Label->new ($xl::s{tab_plugins}));
-    $nb->append_page (new_hotkeys_page (),
-        Gtk3::Label->new ($xl::s{tab_hotkeys}));
-    $nb->append_page (new_info_page (),
-        Gtk3::Label->new ($xl::s{tab_info}));
+
+    $nb->append_page (&new_behaviour_page, Gtk3::Label->new (_('Behaviour')));
+    $nb->append_page (&new_colours_page, Gtk3::Label->new (_('Colours')));
+    $nb->append_page (&new_gui_page, Gtk3::Label->new (_('GUI')));
+    $nb->append_page (&new_other_page, Gtk3::Label->new (_('Other')));
+    $nb->append_page (&new_winpos_page, Gtk3::Label->new (_('Windows')));
+    $nb->append_page (&new_accounts_page, Gtk3::Label->new (_('Accounts')));
+    $nb->append_page (&new_plugins_page, Gtk3::Label->new (_('Plugins')));
+    $nb->append_page (&new_hotkeys_page, Gtk3::Label->new (_('Hotkeys')));
+    $nb->append_page (&new_info_page, Gtk3::Label->new (_('Info')));
 
     return $nb;
 }

commit 3e3f7c463837af6901c6b79240f44a2646dd0e55
Author: Ricardo Mones <ricardo at mones.org>
Date:   Sun Nov 18 02:49:12 2018 +0100

    Remove unused constants and add another

diff --git a/clawsker b/clawsker
index d24b1e8..9cef429 100755
--- a/clawsker
+++ b/clawsker
@@ -271,19 +271,19 @@ my @APPICONS = ();
 # modification flag
 my $MODIFIED = 0;
 
-# index constants for preference arrays
-use constant NAME  => 0; # the name on the rc file
-use constant LABEL => 1; # the label on the GUI
-use constant DESC  => 2; # the description for the hint/help
-use constant TYPE  => 3; # data type: bool, int, float, string, color
-use constant CMVER => 4; # lowest[,highest] Claws Mail version(s) the feature exists
-use constant CMDEF => 5; # default value for the preference in Claws Mail
-use constant PLUGIN => 6; # plugin section (only in plugin preferences)
-
-# constants for GUI spacing
-use constant HBOX_PAD => 5;
-use constant FRAME_SPC => 2;
-use constant PAGE_SPC => 5;
+use constant {
+    # index constants for preference arrays
+    NAME  => 0, # the name on the rc file
+    LABEL => 1, # the label on the GUI
+    DESC  => 2, # the description for the hint/help
+    TYPE  => 3, # data type: bool, int, float, string, color
+    CMVER => 4, # lowest[,highest] Claws Mail version(s) the feature exists
+    CMDEF => 5, # default value for the preference in Claws Mail
+    PLUGIN => 6, # plugin section (only in plugin preferences)
+    # constants for GUI spacing
+    HBOX_PAD => 5,
+    GRID_SPC => 10,
+};
 
 # for data references indexing
 use constant VALUE => 0;
@@ -646,9 +646,9 @@ sub new_selection_box_for($$$) {
 
 sub new_grid {
     my ($border_w, $row_s, $col_s) = @_;
-    $border_w //= 10;
-    $row_s //= 10;
-    $col_s //= 10;
+    $border_w //= GRID_SPC;
+    $row_s //= GRID_SPC;
+    $col_s //= GRID_SPC;
     my $grid = Gtk3::Grid->new;
     $grid->set_border_width ($border_w);
     $grid->set_row_spacing ($row_s);

commit 333f6a96b00b2cbc03beb8a363215f5757da9e63
Author: Ricardo Mones <ricardo at mones.org>
Date:   Sun Nov 18 02:44:14 2018 +0100

    Remove unused subs
    
    They can be added later if needed… thanks go to:
    http://blogs.perl.org/users/ovid/2012/07/finding-unused-subroutines.html

diff --git a/clawsker b/clawsker
index 8949d35..d24b1e8 100755
--- a/clawsker
+++ b/clawsker
@@ -345,13 +345,6 @@ sub handle_int_value {
         if defined $$dataref->[IVALUE];
 }
 
-sub handle_string_value {
-    my ($widget, $event, $dataref) = @_;
-    $$dataref->[VALUE] = $widget->get_text ();
-    $MODIFIED += $$dataref->[VALUE] ne $$dataref->[IVALUE]? 1: -1
-        if defined $$dataref->[IVALUE];
-}
-
 sub handle_nchar_value {
     my ($widget, $event, $dataref, $minlen, $maxlen) = @_;
     $_ = substr ($widget->get_text (), 0, $maxlen);
@@ -651,50 +644,6 @@ sub new_selection_box_for($$$) {
 
 # more graphic helpers
 
-sub new_hbox_pack {
-    my $hbox = Gtk3::HBox->new (FALSE);
-    $hbox->set_border_width (PAGE_SPC);
-    foreach (@_) {
-        $hbox->pack_start ($_, FALSE, FALSE, 0);
-    }
-    return $hbox;
-}
-
-sub new_hbox_pack_compact {
-    my $hbox = Gtk3::HBox->new (FALSE);
-    $hbox->set_border_width (0);
-    foreach (@_) {
-        $hbox->pack_start ($_, FALSE, FALSE, 0);
-    }
-    return $hbox;
-}
-
-sub new_vbox_pack {
-    my $vbox = Gtk3::VBox->new (FALSE, 5);
-    $vbox->set_border_width (PAGE_SPC);
-    foreach (@_) {
-        $vbox->pack_start ($_, FALSE, FALSE, 0);
-    }
-    return $vbox;
-}
-
-sub new_vbox_pack_compact {
-    my $vbox = Gtk3::VBox->new (FALSE, 0);
-    $vbox->set_border_width (0);
-    foreach (@_) {
-        $vbox->pack_start ($_, FALSE, FALSE, 0);
-    }
-    return $vbox;
-}
-
-sub new_subpage_frame {
-    my ($box, $title, $notpacked) = @_;
-    my $frame = Gtk3::Frame->new ($title);
-    $frame->add ($box);
-    return new_vbox_pack ($frame) unless defined ($notpacked);
-    return $frame;
-}
-
 sub new_grid {
     my ($border_w, $row_s, $col_s) = @_;
     $border_w //= 10;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Hidden preferences editor for Claws Mail


More information about the Commits mailing list