summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-12-13 15:21:28 +0000
committerThierry Vignaud <tv@mageia.org>2012-12-13 15:21:28 +0000
commit0833944b0b78527132d7dd14db26f2db8ecf1473 (patch)
tree3a0c5930ddc3b82a8c7cae1ae9a02369b5fea00b /perl-install
parentc9435159e22983c638b2b5e01c8b91ea90e079b2 (diff)
downloaddrakx-0833944b0b78527132d7dd14db26f2db8ecf1473.tar
drakx-0833944b0b78527132d7dd14db26f2db8ecf1473.tar.gz
drakx-0833944b0b78527132d7dd14db26f2db8ecf1473.tar.bz2
drakx-0833944b0b78527132d7dd14db26f2db8ecf1473.tar.xz
drakx-0833944b0b78527132d7dd14db26f2db8ecf1473.zip
(quit_popup) popup a dialog confirming to quit when clicking "X" (mga#1812)
to be manually called from delete_event callback in pure gtk+ cases (eg: mcc)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/NEWS2
-rw-r--r--perl-install/mygtk2.pm16
2 files changed, 17 insertions, 1 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index cc9498bfe..ef6b1fe7b 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,5 +1,7 @@
- interactive layer:
o fix quitting app when closing "advanced" dialog (mga#1812)
+- mygtk2 layer:
+ o popup a dialog confirming to quit when clicking "X" (mga#1812)
Version 15.10 - 11 December 2012
diff --git a/perl-install/mygtk2.pm b/perl-install/mygtk2.pm
index 89bcf33f0..1f97b02d6 100644
--- a/perl-install/mygtk2.pm
+++ b/perl-install/mygtk2.pm
@@ -1212,9 +1212,23 @@ sub mygtk2::MagicWindow::AUTOLOAD {
$w->{$s1}->$meth(@args);
}
+state $in_callback;
+sub quit_popup() {
+ if (!$in_callback) {
+ $in_callback = 1;
+ my $_guard = before_leaving { undef $in_callback };
+ require ugtk2;
+ my $w = ugtk2->new(N("Confirmation"), grab => 1);
+ ugtk2::_ask_okcancel($w, N("Are you sure you want to quit?"), N("Quit"), N("Cancel"));
+ my $ret = ugtk2::main($w);
+ return 1 if !$ret;
+ }
+}
+
sub quit_callback {
my ($w) = @_;
-
+
+ return 1 if quit_popup();
if ($::isWizard) {
$w->destroy;
die 'wizcancel';