summaryrefslogtreecommitdiffstats
path: root/gurpmi
diff options
context:
space:
mode:
Diffstat (limited to 'gurpmi')
-rwxr-xr-xgurpmi15
1 files changed, 8 insertions, 7 deletions
diff --git a/gurpmi b/gurpmi
index a7929588..2fae94e2 100755
--- a/gurpmi
+++ b/gurpmi
@@ -18,7 +18,7 @@ use utf8 'valid';
use Encode '_utf8_on';
use Gtk3;
use gurpmi;
-use urpm::util 'basename';
+use urpm::util qw(basename member);
# For other distros w/o exception support:
eval { Glib->enable_exceptions3 };
@@ -123,19 +123,20 @@ Proceed?", all_descriptions(@all_rpms))
proceed();
});
$save_button and $save_button->signal_connect(clicked => sub {
- my $file_dialog = Gtk3::FileSelection->new(N("Choose location to save file"));
+ my $file_dialog = Gtk3::FileChooserDialog->new(N("Choose location to save file"), $mainw, 'select_folder', N("Cancel") => 'cancel', N("Ok") => 'ok');
$file_dialog->set_modal(1);
$file_dialog->set_position('center');
my $filename = @$srpms > 0 ? $srpms->[0] : $rpms->[0];
$file_dialog->set_filename($filename);
- $file_dialog->hide_fileop_buttons;
- $file_dialog->ok_button->signal_connect(clicked => sub {
+ $file_dialog->show;
+ my $answer = $file_dialog->run;
+ if (member($answer, qw(apply ok yes))) {
my $location = $file_dialog->get_filename;
quit();
$location and exec '/bin/mv', '-f', $filename, $location;
- });
- $file_dialog->cancel_button->signal_connect(clicked => \&quit);
- $file_dialog->show;
+ } elsif (member($answer, qw(cancel delete-event))) {
+ quit();
+ }
});
$ccel_button->signal_connect(clicked => \&cancel_n_quit);
add_button_box($mainbox, grep { defined $_ } $inst_button, $save_button, $ccel_button);