view keymap/keymap.pl @ 1622:9e6cdef3bc3d

changed selection behavior as requested at http://sourceforge.net/tracker/?func=detail&aid=2789933&group_id=222125&atid=1054680 file view - sidecars are added to the selection if they were expicitly selected or if the entry is collapsed icon view - selection always contains sidecars file operations splits partially selected groups - selected files have disabled grouping
author nadvornik
date Tue, 02 Jun 2009 22:33:53 +0000
parents 113d8329cbd6
children
line wrap: on
line source

#!/usr/bin/perl
use strict;

my %funcs;

open(ACCELS, "<$ENV{HOME}/.geeqie/accels") or die "No accel file";
while (<ACCELS>)
	{
	if (/gtk_accel_path "([^"]*)" *"([^"]*)"/) 
		{
		my $name = $1;
		my $key = $2;
		$name =~ s/.*\///;
		$key =~ s/</&lt;/g;
		$key =~ s/>/&gt;/g;
		$funcs{uc($key)} = $name;
		}
		
	}
close(ACCELS);

open(ACCELS, "<hardcoded_keys") or die "No hardcoded_keys file";
while (<ACCELS>)
	{
	if (/"([^"]*)" *"([^"]*)"/) 
		{
		my $name = $1;
		my $key = $2;
		$name =~ s/.*\///;
		$key =~ s/</&lt;/g;
		$key =~ s/>/&gt;/g;
		$funcs{uc($key)} = $name;
		}
		
	}
close(ACCELS);

open(IN, "<keymap_template.svg") or die "No svg file";
open(OUT, ">keymap.svg") or die "Can't write output file";

while (<IN>)
	{
	if (/>key:([^<]*)</) 
		{
		my $key = uc($1);
		my $name = $funcs{$key};
		s/>key:([^<]*)</>$name</;
		delete $funcs{$key};
		}
	print OUT;
	}

close(IN);
close(OUT);

for my $key (keys %funcs)
	{
	if ($key)
		{
		print STDERR "not found: '$key'\n";
		}
	}