ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CV/bin/cv
(Generate patch)

Comparing CV/bin/cv (file contents):
Revision 1.69 by root, Thu Nov 2 00:09:15 2006 UTC vs.
Revision 1.76 by root, Sat Mar 15 11:02:17 2008 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2 2
3use Cwd (); 3use Cwd ();
4use Encode (); 4use Encode ();
5use File::Glob ();
5 6
6use Gtk2 -init; 7use Gtk2 -init;
7use Gtk2::Gdk::Keysyms; 8use Gtk2::Gdk::Keysyms;
8 9
9use Gtk2::CV; 10use Gtk2::CV;
36 my $s = new Gtk2::CV::Schnauzer; 37 my $s = new Gtk2::CV::Schnauzer;
37 38
38 $s->signal_connect_after (key_press_event => \&std_keys); 39 $s->signal_connect_after (key_press_event => \&std_keys);
39 $s->signal_connect (activate => sub { 40 $s->signal_connect (activate => sub {
40 my $label = sprintf "%s (%d)", 41 my $label = sprintf "%s (%d)",
41 (File::Spec->splitpath ($_[1]))[2], 42 (Glib::filename_display_name +(File::Spec->splitpath ($_[1]))[2]),
42 -s $_[1]; 43 -s $_[1];
43 $info->set_label ($label); 44 $info->set_label ($label);
44 $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
45 }); 46 });
46 47
112 $s->set_geometry_hints; 113 $s->set_geometry_hints;
113 $w->show_all; 114 $w->show_all;
114 115
115 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{h}) { 116 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{h}) {
116 unless ($help) { 117 unless ($help) {
117 require Gtk2::PodViewer; 118 require Gtk2::Ex::PodViewer;
118 119
119 $help = new Gtk2::Window; 120 $help = new Gtk2::Window;
120 $help->set_role ("help"); 121 $help->set_role ("help");
121 $help->set_title ("CV: Help"); 122 $help->set_title ("CV: Help");
122 $help->set_default_size (500, 300); 123 $help->set_default_size (500, 300);
123 $help->signal_connect (delete_event => sub { $help->hide; 1 }); 124 $help->signal_connect (delete_event => sub { $help->hide; 1 });
124 125
125 $help->add (my $sw = new Gtk2::ScrolledWindow); 126 $help->add (my $sw = new Gtk2::ScrolledWindow);
126 $sw->add (my $h = new Gtk2::PodViewer); 127 $sw->add (my $h = new Gtk2::Ex::PodViewer);
127 128
128 #binmode DATA, ":utf8"; 129 #binmode DATA, ":utf8";
129 $h->load_string (do { local $/; <DATA> }); 130 $h->load_string (do { local $/; <DATA> });
130 } 131 }
131 132
166 $schnauzer->show_all; 167 $schnauzer->show_all;
167 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []); 168 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []);
168 $viewer->show_all; 169 $viewer->show_all;
169 }; 170 };
170 171
172 if (@ARGV == 1 && $ARGV[0] eq "-0r") {
173 local $/;
174 $schnauzer->set_paths ([split /\x00/, <STDIN>], 1, $show_first);
171 @ARGV == 1 && -d $ARGV[0] 175 } elsif (@ARGV == 1 && -d $ARGV[0]) {
172 ? $schnauzer->set_dir (Glib::filename_to_unicode shift, $show_first) 176 $schnauzer->set_dir (shift, $show_first);
177 } else {
178 if ($ARGV[0] eq "-g") {
179 shift @ARGV;
180 @ARGV = map +(File::Glob::bsd_glob $_, File::Glob::GLOB_BRACE | File::Glob::GLOB_QUOTE), @ARGV;
181 }
173 : $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV], 1, $show_first); 182 $schnauzer->set_paths ([@ARGV], 1, $show_first);
183 }
174} else { 184} else {
175 $schnauzer->set_dir (File::Spec->curdir, sub { 185 $schnauzer->set_dir (File::Spec->curdir, sub {
176 $mainwin->show_all; 186 $mainwin->show_all;
177 $viewer->show_all; 187 $viewer->show_all;
178 }); 188 });
359 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
360 ctrl-d delete selected files WITHOUT ASKING AGAIN 370 ctrl-d delete selected files WITHOUT ASKING AGAIN
361 ctrl-g force generation of thumbnais for the selected files 371 ctrl-g force generation of thumbnais for the selected files
362 ctrl-s rescan current direcory or files updates/deletes etc. 372 ctrl-s rescan current direcory or files updates/deletes etc.
363 ctrl-u update selected (or all) icons if neccessary 373 ctrl-u update selected (or all) icons if neccessary
364 ctrl-l don't use, will become a plug-in eventually 374 ctrl-- unselected thumbnailed images
375 ctrl-+ keep only thumbnailed images, deselect others
365 376
366 ^ go to parent directory (caret). 377 ^ go to parent directory (caret).
367 378
368 0-9, 379 0-9,
369 a-z find the first filename beginning with this letter 380 a-z find the first filename beginning with this letter
428=item CV_EDITOR 439=item CV_EDITOR
429 440
430The program that gets executed when the user presses C<CTRL-e> in the 441The program that gets executed when the user presses C<CTRL-e> in the
431Schnauzer or image window. The default is C<gimp>. 442Schnauzer or image window. The default is C<gimp>.
432 443
444=item CV_AUDIO_PLAYER
445
446Program used to play all sorts of audio (wav, aif, mp3, ogg...), default "play".
447Will be called like C<< $CV_AUDIO_PLAYER -- <path> >>.
448
433=item CV_PRINT_DESTINATION 449=item CV_PRINT_DESTINATION
434 450
435The default (perl-style) destination to use in the print dialog. 451The default (perl-style) destination to use in the print dialog.
436 452
437=item CV_TRASHCAN 453=item CV_TRASHCAN

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines