From 770fde78b559064469b6ca2c08ed2d06f1d47db2 Mon Sep 17 00:00:00 2001 From: Vladislav Nepogodin Date: Thu, 1 Aug 2024 04:08:25 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20add=20additional=20btn=20to=20me?= =?UTF-8?q?ssage=20dialog=20to=20close=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.rs | 3 +++ src/pages.rs | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/main.rs b/src/main.rs index b2ee7d3..df66f28 100644 --- a/src/main.rs +++ b/src/main.rs @@ -57,7 +57,10 @@ fn quick_message(message: String) { .text(fl!("offline-error")) .title(message) .modal(true) + .buttons(gtk::ButtonsType::Ok) .build(); + errordialog.connect_response(|dialog, _| dialog.close()); + errordialog.show(); return; } diff --git a/src/pages.rs b/src/pages.rs index 8f68a49..fcaf962 100644 --- a/src/pages.rs +++ b/src/pages.rs @@ -390,7 +390,10 @@ fn create_fixes_section(builder: &Builder) -> gtk::Box { .text(msg.msg) .title(msg.msg_type.to_string()) .modal(true) + .buttons(gtk::ButtonsType::Ok) .build(); + dialog.connect_response(|dialog, _| dialog.close()); + dialog.show(); glib::ControlFlow::Continue }); @@ -715,7 +718,10 @@ fn create_connections_section() -> gtk::Box { .text(msg.msg) .title(msg.msg_type.to_string()) .modal(true) + .buttons(gtk::ButtonsType::Ok) .build(); + dialog.connect_response(|dialog, _| dialog.close()); + dialog.show(); glib::ControlFlow::Continue }); @@ -978,7 +984,10 @@ fn on_servbtn_clicked(button: >k::CheckButton) { .text(fl!("package-not-installed", package_name = alpm_package_name)) .title("Error") .modal(true) + .buttons(gtk::ButtonsType::Ok) .build(); + dialog.connect_response(|dialog, _| dialog.close()); + dialog.show(); } glib::ControlFlow::Continue