diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2005-04-21 11:37:30 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2005-04-21 11:37:30 +0000 |
commit | 3772f5ba1d182769f27c708586b5fe8039323320 (patch) | |
tree | 66470ec8610624d64016e4891c06f643c2d339eb /perl-install | |
parent | 5dbabd077818372e24c7b6d031b001c97e31a6f9 (diff) | |
download | drakx-3772f5ba1d182769f27c708586b5fe8039323320.tar drakx-3772f5ba1d182769f27c708586b5fe8039323320.tar.gz drakx-3772f5ba1d182769f27c708586b5fe8039323320.tar.bz2 drakx-3772f5ba1d182769f27c708586b5fe8039323320.tar.xz drakx-3772f5ba1d182769f27c708586b5fe8039323320.zip |
(filedialog_generic) switch to gtk+-2.6's new file selector
Diffstat (limited to 'perl-install')
-rwxr-xr-x | perl-install/standalone/drakbackup | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/perl-install/standalone/drakbackup b/perl-install/standalone/drakbackup index 885ad79eb..8ad1797ef 100755 --- a/perl-install/standalone/drakbackup +++ b/perl-install/standalone/drakbackup @@ -1372,10 +1372,14 @@ sub filedialog_generic { #- a more generic file dialog #- a title prompt, the widget to get updated my ($prompt, $widget) = @_; - my $file_dialog; - $file_dialog = gtksignal_connect(Gtk2::FileSelection->new($prompt), destroy => sub { $file_dialog->destroy }); - $file_dialog->ok_button->signal_connect(clicked => sub { + my $file_dialog = Gtk2::FileChooserDialog->new($prompt, $my_win->{real_window}, 'select_folder', N("Cancel") => 'cancel', N("Ok") => 'ok'); + $file_dialog->show; + while (my $answer = $file_dialog->run) { + if (member($answer, qw(cancel delete-event))) { + $file_dialog->destroy; + return; + } elsif ($answer eq 'ok') { if (defined($widget)) { $$widget->set_text($file_dialog->get_filename); } else { @@ -1388,9 +1392,9 @@ sub filedialog_generic { } } $file_dialog->destroy; - }); - $file_dialog->cancel_button->signal_connect(clicked => sub { $file_dialog->destroy }); - $file_dialog->show; + return; + } + } } ################################################ ADVANCED ################################################ |