tab_winpos => _('Windows'),
tab_accounts => _('Accounts'),
tab_plugins => _('Plugins'),
+ tab_info => _('Info'),
ab_frame => _('Addressbook'),
mem_frame => _('Memory'),
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.'),
+ l_beh_rewrite_ff => _('Rewrite first \'From\' using QP encoding'),
+ h_beh_rewrite_ff => _('Workaround some servers which convert first \'From\' to \'>From\' by using Quoted-Printable transfer encoding instead of 7bit/8bit encoding.'),
l_col_emphasis => _('X-Mailer header'),
h_col_emphasis => _('The colour used for the X-Mailer line when its value is Claws Mail.'),
h_acc_gtls_pri => _('Value to use as GnuTLS priority string if custom priority check is enabled. Otherwise this value is ignored.'),
l_plu_gpg_alimit => _('Autocompletion limit'),
- h_plu_gpg_alimit => _('Limits the number of addresses obtained from from keyring through autocompletion. Use 0 to get all matches.'),
+ h_plu_gpg_alimit => _('Limits the number of addresses obtained from keyring through autocompletion. Use 0 to get all matches.'),
l_plu_lav_burl => _('Base URL'),
h_plu_lav_burl => _('This is the URL where avatar requests are sent. You can use the one of your own libravatar server, if available.'),
l_plu_prl_flvb => _('Log level'),
# supported and available plugins lists
my @PLUGINS = qw(AttRemover GPG ManageSieve Libravatar PerlPlugin);
my @AVPLUGINS = ();
+# loaded icons
+my @APPICONS = ();
# index constants for preference arrays
use constant NAME => 0; # the name on the rc file
'3.9.3.18',
'0',
],
+ rewrite_ff => [
+ 'rewrite_first_from',
+ $xl::s{l_beh_rewrite_ff},
+ $xl::s{h_beh_rewrite_ff},
+ 'bool',
+ '3.14.0.94',
+ '0',
+ ],
);
sub new_behaviour_page() {
new_check_button_for (\%pr::beh, 'dangerous', \%HPVALUE),
new_check_button_for (\%pr::beh, 'out_ascii', \%HPVALUE),
new_check_button_for (\%pr::beh, 'pp_unsel', \%HPVALUE),
- new_check_button_for (\%pr::beh, 'inline_at', \%HPVALUE)),
+ new_check_button_for (\%pr::beh, 'inline_at', \%HPVALUE),
+ new_check_button_for (\%pr::beh, 'rewrite_ff', \%HPVALUE)),
$xl::s{msgs_frame}, 'not-packed'),
FALSE, FALSE, FRAME_SPC);
$bf->pack_start (new_subpage_frame (
sub new_accounts_page() {
my $accbook = Gtk2::Notebook->new;
$accbook->set_tab_pos ('right');
- foreach (keys %ACPREFS) {
+ my @akeys = sort {
+ $ACPREFS{$a}{'account_name'} cmp $ACPREFS{$b}{'account_name'}
+ } keys %ACPREFS;
+ foreach (@akeys) {
my $name = $ACPREFS{$_}{'account_name'};
- $accbook->append_page (new_account_subpage ($_), $name);
+ my $isdef = ($ACPREFS{$_}{'is_default'} eq '1');
+ my $page = new_account_subpage ($_);
+ $accbook->append_page ($page, $isdef? '<b>' . $name . '</b>': $name);
+ if ($isdef) {
+ my $label = $accbook->get_tab_label ($page);
+ $label->set_use_markup (TRUE);
+ }
}
return $accbook;
}
$frame{'PerlPlugin'});
}
+sub new_info_page() {
+ my $t0 = Gtk2::Table->new (7, 2, FALSE);
+ my $v = get_toolkit_versions ();
+ my %labels = (
+ 'glib' => 'Perl-GLib',
+ 'glib-r' => _('GLib runtime'),
+ 'glib-b' => _('GLib built'),
+ 'gtk2' => 'Perl-GTK2',
+ 'gtk2-r' => _('GTK2 runtime'),
+ 'gtk2-b' => _('GTK2 built'),
+ );
+ my $row = 0;
+ foreach (sort keys %$v) {
+ if (defined $v->{$_}) {
+ my $label = Gtk2::Label->new ($labels{$_});
+ my $value = Gtk2::Label->new ('<b>' . $v->{$_} . '</b>');
+ $label->set_alignment (0, 0.5);
+ $value->set_alignment (0, 0.5);
+ $value->set_use_markup (TRUE);
+ $t0->attach ($label, 0, 1, $row, $row + 1, 'fill', 'shrink', 8, 6);
+ $t0->attach ($value, 1, 2, $row, $row + 1, 'fill', 'shrink', 8, 6);
+ ++$row;
+ }
+ }
+ my $t1 = Gtk2::Table->new (2, 2, FALSE);
+ my @lbl = map { $_->set_alignment (0, 0.5); $_ } (
+ Gtk2::Label->new (_('Binary')),
+ Gtk2::Label->new (_('Configuration'))
+ );
+ my $cfgv = $CONFIGDATA->{'Common'}{'config_version'};
+ $cfgv //= '';
+ my @val = map { $_->set_alignment (0, 0.5); $_->set_use_markup (TRUE); $_ } (
+ Gtk2::Label->new ('<b>' . $CLAWSV . '</b>'),
+ Gtk2::Label->new ('<b>' . $cfgv . '</b>')
+ );
+ for (my $i = 0; $i <= $#lbl; ++$i) {
+ $t1->attach ($lbl[$i], 0, 1, $i, $i + 1, 'fill', 'shrink', 8, 6);
+ $t1->attach ($val[$i], 1, 2, $i, $i + 1, 'fill', 'shrink', 8, 6);
+ }
+ return new_vbox_pack (
+ new_subpage_frame ($t0, _('Library versions'), 'not-packed'),
+ new_subpage_frame ($t1, _('Claws Mail versions'), 'not-packed'));
+}
+
# version info
-sub print_version() {
- print $xl::s{about_title} . "\n";
- print $xl::s{about_version} . " $VERSION\n";
- print "Perl-GLib " . $Glib::VERSION;
+sub get_toolkit_versions {
+ my %versions = ();
+ $versions{'glib'} = $Glib::VERSION;
# version info stuff appeared in 1.040
if ($Glib::VERSION >= 1.040) {
- print _(", built for ") . join(".", Glib->GET_VERSION_INFO)
- . _(", running with ") . join(".", &Glib::major_version,
- &Glib::minor_version, &Glib::micro_version);
+ $versions{'glib-b'} = join('.', Glib->GET_VERSION_INFO);
+ $versions{'glib-r'} = join('.',
+ &Glib::major_version, &Glib::minor_version, &Glib::micro_version);
}
- print "\n";
- print "Perl-GTK2 " . $Gtk2::VERSION;
+ $versions{'gtk2'} = $Gtk2::VERSION;
if ($Gtk2::VERSION >= 1.040) {
- print _(", built for ") . join(".", Gtk2->GET_VERSION_INFO)
- . _(", running with ") . join(".", &Gtk2::major_version,
- &Gtk2::minor_version, &Gtk2::micro_version);
+ $versions{'gtk2-b'} = join('.', Gtk2->GET_VERSION_INFO);
+ $versions{'gtk2-r'} = join('.',
+ &Gtk2::major_version, &Gtk2::minor_version, &Gtk2::micro_version);
}
+ return \%versions;
+}
+
+sub print_version() {
+ print $xl::s{about_title} . "\n";
+ print $xl::s{about_version} . " $VERSION\n";
+ my $v = get_toolkit_versions ();
+ print "Perl-GLib " . $v->{'glib'};
+ print _(", built for ") . $v->{'glib-b'}
+ . _(", running with ") . $v->{'glib-r'} if $v->{'glib-b'};
+ print "\n";
+ print "Perl-GTK2 " . $v->{'gtk2'};
+ print _(", built for ") . $v->{'gtk2-b'}
+ . _(", running with ") . $v->{'gtk2-r'} if $v->{'gtk2-b'};
print "\n";
my $clawsver = ($CLAWSV eq "") ?
_("was not found!") :
my %meta = ();
my $line = 0;
open (RCF, '<:encoding(utf8)', $rc)
- or die _("Error: opening '{file}' for reading", file => $rc) . ": $!";
+ or die _("Error: opening '{file}' for reading", file => $rc) . ": $!\n";
my $section = '_'; # default unnamed section
while (<RCF>) {
chomp;
sub save_resource {
my ($rc, $data, $meta) = @_;
open (RCF, '>:utf8', $rc)
- or die _("Error: opening '{file}' for writing", file => $rc) . ": $!";
+ or die _("Error: opening '{file}' for writing", file => $rc) . ": $!\n";
my @sections = keys %$data;
if (defined $meta) {
@sections = sort {
$nb->append_page (new_winpos_page (), $xl::s{tab_winpos});
$nb->append_page (new_accounts_page (), $xl::s{tab_accounts});
$nb->append_page (new_plugins_page (), $xl::s{tab_plugins});
+ $nb->append_page (new_info_page (), $xl::s{tab_info});
return $nb;
}
. "<span size=\"large\">$lic</span>\n\n"
. "<span size=\"small\">$license</span>");
$dialog->set_title ($xl::s{about});
+ if (Gtk2->CHECK_VERSION (2, 10, 0)) {
+ my @icons = get_app_icons ();
+ my $image = Gtk2::Image->new_from_pixbuf ($icons[1]);
+ $image->show ();
+ $image->set_alignment (0, 0);
+ $dialog->set_image ($image);
+ }
#
return $dialog;
}
}
sub get_app_icons {
- my $dir = $DATADIR . '/icons/hicolor';
- my @names = map {
- join ('/', ($dir, , $_ . 'x' . $_, 'apps', $NAME . '.png'))
- } (64, 128);
- my @icons = ();
+ return @APPICONS if (@APPICONS);
+ my @names;
+ if (-d $DATADIR) { # installed
+ my $dir = $DATADIR . '/icons/hicolor';
+ @names = map {
+ join ('/', ($dir, $_ . 'x' . $_, 'apps', $NAME . '.png'))
+ } (64, 128);
+ } else { # unpacked tarball or git clone
+ @names = map {
+ join ('/', ('./icons', $NAME . '-' . $_ . '.png'));
+ } (64, 128);
+ }
foreach (@names) {
my $icon = undef;
$icon = Gtk2::Gdk::Pixbuf->new_from_file($_) if (-f $_);
- push @icons, $icon if ($icon);
+ push @APPICONS, $icon if ($icon);
}
- return @icons;
+ return @APPICONS;
}
# initialise