[Commits] [SCM] clawsker branch, master, updated. 1.0.1-23-g9ab4919
mones at claws-mail.org
mones at claws-mail.org
Fri Mar 10 00:13:58 CET 2017
The branch, master has been updated
via 9ab4919736afcb8d90d1550fc250084bc3472ffe (commit)
from e91c92cfd031640f6a0b013a907cd0cd2deca9a0 (commit)
Summary of changes:
clawsker | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
- Log -----------------------------------------------------------------
commit 9ab4919736afcb8d90d1550fc250084bc3472ffe
Author: Ricardo Mones <ricardo at mones.org>
Date: Fri Mar 10 00:11:57 2017 +0100
Enable parsing menurc
diff --git a/clawsker b/clawsker
index 9ecb797..5735635 100755
--- a/clawsker
+++ b/clawsker
@@ -401,6 +401,10 @@ sub get_ac_rc_filename {
return $CONFIGDIR . $ACCOUNTRC;
}
+sub get_menurc_filename {
+ return $CONFIGDIR . "menurc";
+}
+
sub set_rc_filename {
my ($fullname) = @_;
my @parts = split ('/', $fullname);
@@ -2362,6 +2366,31 @@ sub save_resource {
close (RCF);
}
+# specific loaders
+sub load_menurc {
+ my $rc = shift;
+ open (RCF, '<:encoding(utf8)', $rc)
+ or die _("Error: opening '{file}' for reading", file => $rc) . ": $!\n";
+ my %groups = ();
+ my $line = 0;
+ while (<RCF>) {
+ chomp;
+ ++$line;
+ if (/^; \(gtk_accel_path "<([A-Za-z]+)>([^"]+)" ([^\)]+)\)$/) {
+ my %data = ('key' => $3, 'enabled' => FALSE);
+ $groups{$1}{$2} = \%data;
+ # say "group -> $1 | path -> $2 | key -> $3";
+ }
+ if (/^\(gtk_accel_path "<([A-Za-z]+)>([^"]+)" ([^\)]+)\)$/) {
+ my %data = ('key' => $3, 'enabled' => TRUE);
+ $groups{$1}{$2} = \%data;
+ # say "group -> $1 | path -> $2 | key -> $3";
+ }
+ }
+ close (RCF);
+ return \%groups;
+}
+
# load current status from disc
sub load_rc_preferences {
my $rc = get_rc_filename ();
-----------------------------------------------------------------------
hooks/post-receive
--
Hidden preferences editor for Claws Mail
More information about the Commits
mailing list