… | |
… | |
115 | } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{h}) { |
115 | } elsif ($ctrl && $key == $Gtk2::Gdk::Keysyms{h}) { |
116 | unless ($help) { |
116 | unless ($help) { |
117 | require Gtk2::PodViewer; |
117 | require Gtk2::PodViewer; |
118 | |
118 | |
119 | $help = new Gtk2::Window; |
119 | $help = new Gtk2::Window; |
120 | $w->set_role ("help"); |
120 | $help->set_role ("help"); |
121 | $help->set_title ("CV: Help"); |
121 | $help->set_title ("CV: Help"); |
122 | $help->set_default_size (500, 300); |
122 | $help->set_default_size (500, 300); |
123 | $help->signal_connect (delete_event => sub { $help->hide; 1 }); |
123 | $help->signal_connect (delete_event => sub { $help->hide; 1 }); |
124 | |
124 | |
125 | $help->add (my $sw = new Gtk2::ScrolledWindow); |
125 | $help->add (my $sw = new Gtk2::ScrolledWindow); |
… | |
… | |
160 | |
160 | |
161 | $schnauzer->set_geometry_hints; |
161 | $schnauzer->set_geometry_hints; |
162 | } |
162 | } |
163 | |
163 | |
164 | if (@ARGV) { |
164 | if (@ARGV) { |
|
|
165 | my $show_first = sub { |
|
|
166 | $schnauzer->show_all; |
|
|
167 | $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []); |
|
|
168 | $viewer->show_all; |
|
|
169 | }; |
|
|
170 | |
165 | @ARGV == 1 && -d $ARGV[0] |
171 | @ARGV == 1 && -d $ARGV[0] |
166 | ? $schnauzer->set_dir (Glib::filename_to_unicode shift) |
172 | ? $schnauzer->set_dir (Glib::filename_to_unicode shift, $show_first) |
167 | : $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV], 1); |
173 | : $schnauzer->set_paths ([map Glib::filename_to_unicode $_, @ARGV], 1, $show_first); |
168 | $schnauzer->show_all; |
|
|
169 | $schnauzer->handle_key ($Gtk2::Gdk::Keysyms{space}, []); |
|
|
170 | } else { |
174 | } else { |
171 | $schnauzer->set_dir (File::Spec->curdir); |
175 | $schnauzer->set_dir (File::Spec->curdir, sub { |
172 | $mainwin->show_all; |
176 | $mainwin->show_all; |
173 | } |
|
|
174 | |
|
|
175 | $viewer->show_all; |
177 | $viewer->show_all; |
|
|
178 | }); |
|
|
179 | } |
176 | |
180 | |
177 | main Gtk2; |
181 | main Gtk2; |
|
|
182 | |
|
|
183 | Gtk2::CV::flush_aio; |
178 | |
184 | |
179 | __DATA__ |
185 | __DATA__ |
180 | |
186 | |
181 | =encoding utf-8 |
187 | =encoding utf-8 |
182 | |
188 | |
… | |
… | |
422 | =item CV_EDITOR |
428 | =item CV_EDITOR |
423 | |
429 | |
424 | The program that gets executed when the user presses C<CTRL-e> in the |
430 | The program that gets executed when the user presses C<CTRL-e> in the |
425 | Schnauzer or image window. The default is C<gimp>. |
431 | Schnauzer or image window. The default is C<gimp>. |
426 | |
432 | |
|
|
433 | =item CV_AUDIO_PLAYER |
|
|
434 | |
|
|
435 | Program used to play all sorts of audio (wav, aif, mp3, ogg...), default "play". |
|
|
436 | Will be called like C<< $CV_AUDIO_PLAYER -- <path> >>. |
|
|
437 | |
427 | =item CV_PRINT_DESTINATION |
438 | =item CV_PRINT_DESTINATION |
428 | |
439 | |
429 | The default (perl-style) destination to use in the print dialog. |
440 | The default (perl-style) destination to use in the print dialog. |
430 | |
441 | |
431 | =item CV_TRASHCAN |
442 | =item CV_TRASHCAN |