public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 installer 0/1] fix #4643: show a confirmation dialog when clicking abort
@ 2023-06-21  8:55 Maximiliano Sandoval
  2023-06-21  8:55 ` [pve-devel] [PATCH v2 installer 1/1] " Maximiliano Sandoval
  0 siblings, 1 reply; 3+ messages in thread
From: Maximiliano Sandoval @ 2023-06-21  8:55 UTC (permalink / raw)
  To: pve-devel


Differences from v1:

  - The abort dialog now counts with a title and body text that matches the TUI
    installer's dialog.

Unlike the TUI installer the title text does not end in a question mark (`Abort
Installation?`), this is intentional as question marks look odd when set in the
title of a GTK message dialog.
    

Maximiliano Sandoval (1):
  fix #4643: show a confirmation dialog when clicking abort

 proxinstall | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

-- 
2.39.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] [PATCH v2 installer 1/1] fix #4643: show a confirmation dialog when clicking abort
  2023-06-21  8:55 [pve-devel] [PATCH v2 installer 0/1] fix #4643: show a confirmation dialog when clicking abort Maximiliano Sandoval
@ 2023-06-21  8:55 ` Maximiliano Sandoval
  2023-06-21 10:30   ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 3+ messages in thread
From: Maximiliano Sandoval @ 2023-06-21  8:55 UTC (permalink / raw)
  To: pve-devel

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 | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/proxinstall b/proxinstall
index 6d13892..600d5a5 100755
--- a/proxinstall
+++ b/proxinstall
@@ -180,7 +180,19 @@ 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 = 'Abort Installation';
+	my $secondary_text = 'Are you sure you want to abort the installation?';
+	my $dialog = Gtk3::MessageDialog->new($window, 'modal', 'question', 'yes-no', $msg);
+	$dialog->format_secondary_text($secondary_text);
+	$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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] applied: [PATCH v2 installer 1/1] fix #4643: show a confirmation dialog when clicking abort
  2023-06-21  8:55 ` [pve-devel] [PATCH v2 installer 1/1] " Maximiliano Sandoval
@ 2023-06-21 10:30   ` Thomas Lamprecht
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2023-06-21 10:30 UTC (permalink / raw)
  To: Proxmox VE development discussion, Maximiliano Sandoval

Am 21/06/2023 um 10:55 schrieb Maximiliano Sandoval:
> 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 | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-21 10:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-21  8:55 [pve-devel] [PATCH v2 installer 0/1] fix #4643: show a confirmation dialog when clicking abort Maximiliano Sandoval
2023-06-21  8:55 ` [pve-devel] [PATCH v2 installer 1/1] " Maximiliano Sandoval
2023-06-21 10:30   ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal