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

Comparing CV/bin/cv (file contents):
Revision 1.63 by root, Tue Oct 4 05:06:39 2005 UTC vs.
Revision 1.68 by root, Mon Oct 23 17:52:37 2006 UTC

103 if ($key == $Gtk2::Gdk::Keysyms{q}) { 103 if ($key == $Gtk2::Gdk::Keysyms{q}) {
104 $viewer->destroy; 104 $viewer->destroy;
105 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{v}) { 105 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{v}) {
106 my $w = new Gtk2::Window; 106 my $w = new Gtk2::Window;
107 107
108 $w->set_role ("schnauzer");
108 $w->set_title ("CV: Schnauzer"); 109 $w->set_title ("CV: Schnauzer");
109 $w->add (my $s = new_schnauzer); 110 $w->add (my $s = new_schnauzer);
110 $s->set_dir (File::Spec->curdir); 111 $s->set_dir (File::Spec->curdir);
111 $s->set_geometry_hints; 112 $s->set_geometry_hints;
112 $w->show_all; 113 $w->show_all;
114 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{h}) { 115 } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{h}) {
115 unless ($help) { 116 unless ($help) {
116 require Gtk2::PodViewer; 117 require Gtk2::PodViewer;
117 118
118 $help = new Gtk2::Window; 119 $help = new Gtk2::Window;
120 $help->set_role ("help");
119 $help->set_title ("CV: Help"); 121 $help->set_title ("CV: Help");
120 $help->set_default_size (500, 300); 122 $help->set_default_size (500, 300);
121 $help->signal_connect (delete_event => sub { $help->hide; 1 }); 123 $help->signal_connect (delete_event => sub { $help->hide; 1 });
122 124
123 $help->add (my $sw = new Gtk2::ScrolledWindow); 125 $help->add (my $sw = new Gtk2::ScrolledWindow);
140 $::cur_viewer = $viewer; 142 $::cur_viewer = $viewer;
141 143
142 $schnauzer = new_schnauzer; 144 $schnauzer = new_schnauzer;
143 145
144 $mainwin = new Gtk2::Window; 146 $mainwin = new Gtk2::Window;
147 $mainwin->set_role ("main");
145 $mainwin->set_title ("CV"); 148 $mainwin->set_title ("CV");
146 $mainwin->add (my $vbox = new Gtk2::VBox); 149 $mainwin->add (my $vbox = new Gtk2::VBox);
147 $mainwin->signal_connect (delete_event => sub { $mainwin->hide; 1 }); 150 $mainwin->signal_connect (delete_event => sub { $mainwin->hide; 1 });
148 151
149 $vbox->add ($schnauzer); 152 $vbox->add ($schnauzer);
157 160
158 $schnauzer->set_geometry_hints; 161 $schnauzer->set_geometry_hints;
159} 162}
160 163
161if (@ARGV) { 164if (@ARGV) {
165 my $show_first = sub {
166 $schnauzer->show_all;
167 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []);
168 $viewer->show_all;
169 };
170
162 @ARGV == 1 && -d $ARGV[0] 171 @ARGV == 1 && -d $ARGV[0]
163 ? $schnauzer->set_dir (Glib::filename_to_unicode shift) 172 ? $schnauzer->set_dir (Glib::filename_to_unicode shift, $show_first)
164 : $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV]); 173 : $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV], 1, $show_first);
165 $schnauzer->show_all;
166 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []);
167} else { 174} else {
168 $schnauzer->set_dir (File::Spec->curdir); 175 $schnauzer->set_dir (File::Spec->curdir, sub {
169 $mainwin->show_all; 176 $mainwin->show_all;
170}
171
172$viewer->show_all; 177 $viewer->show_all;
178 });
179}
173 180
174main Gtk2; 181main Gtk2;
175 182
176__DATA__ 183__DATA__
177 184
296 r set scaling mode to 'nearest' (fastest) 303 r set scaling mode to 'nearest' (fastest)
297 s set scaling mode to 'bilinear' (default) 304 s set scaling mode to 'bilinear' (default)
298 shift-s set scaling mode to 'hyper' (slowest) 305 shift-s set scaling mode to 'hyper' (slowest)
299 t rotate clockwise 90° 306 t rotate clockwise 90°
300 T rotate counterclockwise° 307 T rotate counterclockwise°
308 a apply all rotations loslessly to a jpeg file (using exiftran)
301 ctrl-v open a new visual schnauzer window for the current dir 309 ctrl-v open a new visual schnauzer window for the current dir
302 ctrl-c clone the current image window 310 ctrl-c clone the current image window
303 ctrl-e run an editor ($CV_EDITOR or "gimp") on the current image 311 ctrl-e run an editor ($CV_EDITOR or "gimp") on the current image
304 ctrl-p fire up the print dialog 312 ctrl-p fire up the print dialog
305 escape cancel a crop action 313 escape cancel a crop action

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines