#!/usr/bin/perl -w
#
# Clawsker :: A Claws Mail Tweaker
-# Copyright 2007-2015 Ricardo Mones <ricardo@mones.org>
+# Copyright 2007-2016 Ricardo Mones <ricardo@mones.org>
#
# 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
binmode STDOUT, ":encoding(utf8)";
+use 5.010_000;
use strict;
use utf8;
use Glib qw(TRUE FALSE);
l_beh_inline_at => _('Show inline attachments'),
h_beh_inline_at => _('Allows hiding inline attachments already shown in mail structure view.'),
l_beh_addr_swc => _('Address search in compose window matches any'),
- h_beh_addr_swc => _('On Tab-key completion, address text will match any part of the string or only the from the start.'),
+ h_beh_addr_swc => _('On Tab-key completion, address text will match any part of the string or only from the start.'),
l_beh_fold_swc => _('Folder search in folder selector matches any'),
h_beh_fold_swc => _('On folder name completion text will match any part of the string or only from the start.'),
sub check_claws_not_running {
my $tmpdir = (defined $ENV{TMPDIR})? $ENV{TMPDIR}: '/tmp';
$tmpdir = '/tmp' if ($tmpdir eq '');
- my $socket = (not $ALTCONFIGDIR)? $tmpdir: $CONFIGDIR;
- $socket .= "/claws-mail-$<";
- -S $socket and return claws_is_running ();
- # since 3.9.0cvs36
my $lockdir = "$tmpdir/claws-mail-$<";
-d $lockdir and do {
- $_ = $CONFIGDIR;
- s/\/$//;
- $socket = "$lockdir/" . md5_hex ($_);
- -S $socket and return claws_is_running ();
+ $_ = $CONFIGDIR;
+ s/\/$//;
+ my $socket = "$lockdir/" . md5_hex ($_);
+ -S $socket and return claws_is_running ();
};
return TRUE;
}
my $hbox = Gtk2::HBox->new (FALSE, 5);
my $cb = Gtk2::CheckButton->new ($label);
$$hash{$key}[GUI] = $cb;
- if (defined ($HPVALUE{$name})) {
- $cb->set_active ($HPVALUE{$name} eq '1');
- }
+ my $value = $HPVALUE{$name};
+ $value //= $$hash{$key}[CMDEF];
+ $cb->set_active ($value eq '1');
$cb->signal_connect (clicked => sub {
my ($w, $e) = @_;
handle_bool_value ($w, $e, \$HPVALUE{$name});
my $glabel = Gtk2::Label->new ($label);
my $pagei = int (($type[2] - $type[1]) / 10);
my $gentry = Gtk2::SpinButton->new_with_range ($type[1], $type[2], $pagei);
+ my $value = $HPVALUE{$name};
+ $value //= $$hash{$key}[CMDEF];
$gentry->set_numeric (TRUE);
- $gentry->set_value ($HPVALUE{$name});
+ $gentry->set_value ($value);
$$hash{$key}[GUI] = $gentry;
$gentry->signal_connect('value-changed' => sub {
my ($w, $e) = @_;
my $gentry = Gtk2::Entry->new ();
$gentry->set_max_length($type[2]) if defined ($type[2]);
$gentry->set_width_chars(int ($type[2]) + 2) if defined ($type[2]);
- $gentry->set_text ($HPVALUE{$name});
+ my $value = $HPVALUE{$name};
+ $value //= $$hash{$key}[CMDEF];
+ $gentry->set_text ($value);
$$hash{$key}[GUI] = $gentry;
$gentry->signal_connect('key-release-event' => sub {
my ($w, $e) = @_;
my $name = $$hash{$key}[NAME];
my $label = $$hash{$key}[LABEL];
#
- my $col = gdk_color_from_str ($HPVALUE{$name});
+ my $value = $HPVALUE{$name};
+ $value //= $$hash{$key}[CMDEF];
+ my $col = gdk_color_from_str ($value);
my $hbox = Gtk2::HBox->new (FALSE, 5);
my $glabel = Gtk2::Label->new ($label);
my $button = Gtk2::ColorButton->new_with_color ($col);
my ($w, $e) = @_;
handle_selection_value ($w, $e, \$HPVALUE{$name});
});
- $combo->set_active ($HPVALUE{$name});
+ my $value = $HPVALUE{$name};
+ $value //= $$hash{$key}[CMDEF];
+ $combo->set_active ($value);
set_widget_hint ($combo, $$hash{$key}[DESC]);
set_widget_sens ($combo, $$hash{$key}[CMVER]);
$glabel->set_sensitive ($combo->sensitive);
addr_swc => [
'address_search_wildcard',
$xl::s{l_beh_addr_swc},
- $xl::s{h_beh_addr_sw1},
+ $xl::s{h_beh_addr_swc},
'bool',
'3.9.3.18',
'0',
fold_swc => [
'folder_search_wildcard',
$xl::s{l_beh_fold_swc},
- $xl::s{h_beh_fold_sw1},
+ $xl::s{h_beh_fold_swc},
'bool',
'3.9.3.18',
'0',
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.";
- my $year = "2007-2015";
+ my $year = "2007-2016";
my $holder = "Ricardo Mones <ricardo\@mones.org>";
my $url = "http://www.claws-mail.org/clawsker.php";