… | |
… | |
37 | my $s = new Gtk2::CV::Schnauzer; |
37 | my $s = new Gtk2::CV::Schnauzer; |
38 | |
38 | |
39 | $s->signal_connect_after (key_press_event => \&std_keys); |
39 | $s->signal_connect_after (key_press_event => \&std_keys); |
40 | $s->signal_connect (activate => sub { |
40 | $s->signal_connect (activate => sub { |
41 | my $label = sprintf "%s (%d)", |
41 | my $label = sprintf "%s (%d)", |
42 | (File::Spec->splitpath ($_[1]))[2], |
42 | (Glib::filename_display_name +(File::Spec->splitpath ($_[1]))[2]), |
43 | -s $_[1]; |
43 | -s $_[1]; |
44 | $info->set_label ($label); |
44 | $info->set_label ($label); |
45 | $viewer->load_image ($_[1]) if $viewer; # TODO: error, or chose ANY viewer |
45 | $viewer->load_image ($_[1]) if $viewer; # TODO: error, or chose ANY viewer |
46 | }); |
46 | }); |
47 | |
47 | |
… | |
… | |
113 | $s->set_geometry_hints; |
113 | $s->set_geometry_hints; |
114 | $w->show_all; |
114 | $w->show_all; |
115 | |
115 | |
116 | } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{h}) { |
116 | } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{h}) { |
117 | unless ($help) { |
117 | unless ($help) { |
118 | require Gtk2::PodViewer; |
118 | require Gtk2::Ex::PodViewer; |
119 | |
119 | |
120 | $help = new Gtk2::Window; |
120 | $help = new Gtk2::Window; |
121 | $help->set_role ("help"); |
121 | $help->set_role ("help"); |
122 | $help->set_title ("CV: Help"); |
122 | $help->set_title ("CV: Help"); |
123 | $help->set_default_size (500, 300); |
123 | $help->set_default_size (500, 300); |
124 | $help->signal_connect (delete_event => sub { $help->hide; 1 }); |
124 | $help->signal_connect (delete_event => sub { $help->hide; 1 }); |
125 | |
125 | |
126 | $help->add (my $sw = new Gtk2::ScrolledWindow); |
126 | $help->add (my $sw = new Gtk2::ScrolledWindow); |
127 | $sw->add (my $h = new Gtk2::PodViewer); |
127 | $sw->add (my $h = new Gtk2::Ex::PodViewer); |
128 | |
128 | |
129 | #binmode DATA, ":utf8"; |
129 | #binmode DATA, ":utf8"; |
130 | $h->load_string (do { local $/; <DATA> }); |
130 | $h->load_string (do { local $/; <DATA> }); |
131 | } |
131 | } |
132 | |
132 | |
… | |
… | |
169 | $viewer->show_all; |
169 | $viewer->show_all; |
170 | }; |
170 | }; |
171 | |
171 | |
172 | if (@ARGV == 1 && $ARGV[0] eq "-0r") { |
172 | if (@ARGV == 1 && $ARGV[0] eq "-0r") { |
173 | local $/; |
173 | local $/; |
174 | $schnauzer->set_paths ([map Glib::filename_to_unicode $_, split /\x00/, <STDIN>], 1, $show_first); |
174 | $schnauzer->set_paths ([split /\x00/, <STDIN>], 1, $show_first); |
175 | } elsif (@ARGV == 1 && -d $ARGV[0]) { |
175 | } elsif (@ARGV == 1 && -d $ARGV[0]) { |
176 | $schnauzer->set_dir (Glib::filename_to_unicode shift, $show_first); |
176 | $schnauzer->set_dir (shift, $show_first); |
177 | } else { |
177 | } else { |
178 | if ($ARGV[0] eq "-g") { |
178 | if ($ARGV[0] eq "-g") { |
179 | shift @ARGV; |
179 | shift @ARGV; |
180 | @ARGV = map +(File::Glob::bsd_glob $_, File::Glob::GLOB_BRACE | File::Glob::GLOB_QUOTE), @ARGV; |
180 | @ARGV = map +(File::Glob::bsd_glob $_, File::Glob::GLOB_BRACE | File::Glob::GLOB_QUOTE), @ARGV; |
181 | } |
181 | } |
182 | $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV], 1, $show_first); |
182 | $schnauzer->set_paths ([@ARGV], 1, $show_first); |
183 | } |
183 | } |
184 | } else { |
184 | } else { |
185 | $schnauzer->set_dir (File::Spec->curdir, sub { |
185 | $schnauzer->set_dir (File::Spec->curdir, sub { |
186 | $mainwin->show_all; |
186 | $mainwin->show_all; |
187 | $viewer->show_all; |
187 | $viewer->show_all; |
… | |
… | |
369 | ctrl-shift-a select all files currently displayed in the schnauzer window |
369 | ctrl-shift-a select all files currently displayed in the schnauzer window |
370 | ctrl-d delete selected files WITHOUT ASKING AGAIN |
370 | ctrl-d delete selected files WITHOUT ASKING AGAIN |
371 | ctrl-g force generation of thumbnais for the selected files |
371 | ctrl-g force generation of thumbnais for the selected files |
372 | ctrl-s rescan current direcory or files updates/deletes etc. |
372 | ctrl-s rescan current direcory or files updates/deletes etc. |
373 | ctrl-u update selected (or all) icons if neccessary |
373 | ctrl-u update selected (or all) icons if neccessary |
374 | ctrl-l don't use, will become a plug-in eventually |
374 | ctrl-- unselected thumbnailed images |
|
|
375 | ctrl-+ keep only thumbnailed images, deselect others |
375 | |
376 | |
376 | ^ go to parent directory (caret). |
377 | ^ go to parent directory (caret). |
377 | |
378 | |
378 | 0-9, |
379 | 0-9, |
379 | a-z find the first filename beginning with this letter |
380 | a-z find the first filename beginning with this letter |