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

Comparing CV/bin/cv (file contents):
Revision 1.65 by root, Fri Jan 13 01:08:06 2006 UTC vs.
Revision 1.71 by root, Thu Oct 4 10:30:12 2007 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) {
162 @ARGV == 1 && -d $ARGV[0] 165 my $show_first = sub {
163 ? $schnauzer->set_dir (Glib::filename_to_unicode shift)
164 : $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV], 1);
165 $schnauzer->show_all; 166 $schnauzer->show_all;
166 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []); 167 $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []);
168 $viewer->show_all;
169 };
170
171 if (@ARGV == 1 && $ARGV[0] eq "-0r") {
172 local $/;
173 $schnauzer->set_paths ([map Glib::filename_to_unicode $_, split /\x00/, <STDIN>], 1, $show_first);
174 } elsif (@ARGV == 1 && -d $ARGV[0]) {
175 $schnauzer->set_dir (Glib::filename_to_unicode shift, $show_first);
176 } else {
177 $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV], 1, $show_first);
178 }
167} else { 179} else {
168 $schnauzer->set_dir (File::Spec->curdir); 180 $schnauzer->set_dir (File::Spec->curdir, sub {
169 $mainwin->show_all; 181 $mainwin->show_all;
170}
171
172$viewer->show_all; 182 $viewer->show_all;
183 });
184}
173 185
174main Gtk2; 186main Gtk2;
187
188Gtk2::CV::flush_aio;
175 189
176__DATA__ 190__DATA__
177 191
178=encoding utf-8 192=encoding utf-8
179 193
419=item CV_EDITOR 433=item CV_EDITOR
420 434
421The program that gets executed when the user presses C<CTRL-e> in the 435The program that gets executed when the user presses C<CTRL-e> in the
422Schnauzer or image window. The default is C<gimp>. 436Schnauzer or image window. The default is C<gimp>.
423 437
438=item CV_AUDIO_PLAYER
439
440Program used to play all sorts of audio (wav, aif, mp3, ogg...), default "play".
441Will be called like C<< $CV_AUDIO_PLAYER -- <path> >>.
442
424=item CV_PRINT_DESTINATION 443=item CV_PRINT_DESTINATION
425 444
426The default (perl-style) destination to use in the print dialog. 445The default (perl-style) destination to use in the print dialog.
427 446
428=item CV_TRASHCAN 447=item CV_TRASHCAN

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines