From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH installer] fix #4643: show a confirmation dialog when clicking abort
Date: Tue, 20 Jun 2023 11:02:40 +0200 [thread overview]
Message-ID: <20230620090240.62615-1-m.sandoval@proxmox.com> (raw)
Note that unlike the rest of the file, we connect to the response signal
instead of using Gtk3::Dialog->run, the reason is that run blocks the
main loop used by GTK and this undesirable to the point where
Gtk3::Dialog->run was removed for GTK 4.
Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
---
proxinstall | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/proxinstall b/proxinstall
index fb365d4..015496b 100755
--- a/proxinstall
+++ b/proxinstall
@@ -1353,7 +1353,17 @@ sub create_main_window {
my $abort = Gtk3::Button->new('_Abort');
$abort->set_can_focus(0);
$cmdbox->pack_start($abort, 0, 0, 10);
- $abort->signal_connect(clicked => sub { app_quit(-1); });
+ $abort->signal_connect(clicked => sub {
+ my $msg = 'Are you sure you want to abort the installation?';
+ my $dialog = Gtk3::MessageDialog->new($window, 'modal', 'question', 'yes-no', $msg);
+ $dialog->signal_connect(response => sub {
+ my ($dialog, $response) = @_;
+
+ $dialog->close();
+ app_quit(-1) if $response eq 'yes';
+ });
+ $dialog->present();
+ });
my $vbox2 = Gtk3::Box->new('vertical', 0);
$hbox->add($vbox2);
--
2.39.2
reply other threads:[~2023-06-20 9:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230620090240.62615-1-m.sandoval@proxmox.com \
--to=m.sandoval@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox