From caaf88d28016a70abd2a76c464b8cada9358ee8c Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 1 Aug 2024 22:57:18 +0300 Subject: [PATCH] use internal preset for default response --- src/Entity/Browser/Menu/Tab/Clean.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Entity/Browser/Menu/Tab/Clean.php b/src/Entity/Browser/Menu/Tab/Clean.php index 7e99b8a5..0e9e36c0 100644 --- a/src/Entity/Browser/Menu/Tab/Clean.php +++ b/src/Entity/Browser/Menu/Tab/Clean.php @@ -25,6 +25,7 @@ class Clean public const TOOLTIP = 'Close all tabs'; public const DIALOG_MESSAGE_FORMAT = 'Clean session'; public const DIALOG_FORMAT_SECONDARY_TEXT = 'Close all tabs and start new session?'; + public const DIALOG_DEFAULT_RESPONSE = GtkResponseType::CANCEL; public function __construct( Tab $tab @@ -57,14 +58,14 @@ class Clean _($this::DIALOG_MESSAGE_FORMAT) ); - $dialog->set_default_response( - GtkResponseType::CANCEL - ); - $dialog->format_secondary_text( _($this::DIALOG_FORMAT_SECONDARY_TEXT) ); + $dialog->set_default_response( + $this::DIALOG_DEFAULT_RESPONSE + ); + if (GtkResponseType::OK == $dialog->run()) { $this->tab->menu->browser->container->tab->clean();