summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-02-19 13:54:53 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-02-19 13:54:53 +0000
commit57499a60e78b61f5acd5c6ef5c00ee117b54950a (patch)
tree051833213a58a4ec0a10da2c0039d4e346646b1a /perl-install
parente6ca5aa275b8e33f1e32ee0a8bed7c7701637910 (diff)
downloaddrakx-57499a60e78b61f5acd5c6ef5c00ee117b54950a.tar
drakx-57499a60e78b61f5acd5c6ef5c00ee117b54950a.tar.gz
drakx-57499a60e78b61f5acd5c6ef5c00ee117b54950a.tar.bz2
drakx-57499a60e78b61f5acd5c6ef5c00ee117b54950a.tar.xz
drakx-57499a60e78b61f5acd5c6ef5c00ee117b54950a.zip
fix _ask_file (tested in wizard, normal and embedded)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/ugtk2.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/perl-install/ugtk2.pm b/perl-install/ugtk2.pm
index 5d5808465..88756f5b1 100644
--- a/perl-install/ugtk2.pm
+++ b/perl-install/ugtk2.pm
@@ -1088,11 +1088,16 @@ sub _ask_okcancel($@) {
sub _ask_file {
my ($o, $title, $path) = @_;
- my ($modality, $position) = ($o->{rwindow}->get_modal, $o->{rwindow}->get('window-position'));
- my $f = $o->{rwindow} = $o->{window} = Gtk2::FileSelection->new($title);
- $f->set_modal($modality);
- $f->set_position($position);
- $path and $f->set_filename($path);
+ my $f = Gtk2::FileSelection->new($title);
+ if ($o->{rwindow}->isa('Gtk2::Window')) {
+ my ($modality, $position) = ($o->{rwindow}->get_modal, $o->{rwindow}->get('window-position'));
+ $f->set_modal($modality);
+ $f->set_position($position);
+ }
+ my $bg = $o->{window};
+ $o->{rwindow} = $o->{window} = $f;
+ $f->set_filename($path) if $path;
+ $f->signal_connect(destroy => sub { eval { $bg->destroy } });
$f->ok_button->signal_connect(clicked => sub { $o->{retval} = $f->get_filename; Gtk2->main_quit });
$f->cancel_button->signal_connect(clicked => sub { Gtk2->main_quit });
$f->grab_focus;