commit 9199ac087e25fe75d596d7d89acabd4685b922aa
parent c51c35e451fd8f46c8d9fb77d57edb0dffd6d5e2
Author: Carlosokumu <carlosokumu254@gmail.com>
Date: Fri, 6 Mar 2026 10:47:09 +0300
update message dialogs
Diffstat:
2 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/dummy/usawa/gui/views/create_entry_view.py b/dummy/usawa/gui/views/create_entry_view.py
@@ -518,11 +518,13 @@ class CreateEntryView(Gtk.Box):
def _show_error_dialog(self, title, message):
- """Show error dialog"""
dialog = Adw.MessageDialog(
transient_for=self.get_root(),
heading=title,
body=message
)
dialog.add_response("ok", "OK")
+ dialog.set_response_appearance("ok", Adw.ResponseAppearance.DESTRUCTIVE)
+ dialog.connect("response", lambda d, response: d.close())
+
dialog.present()
\ No newline at end of file
diff --git a/dummy/usawa/gui/views/entry_details_view.py b/dummy/usawa/gui/views/entry_details_view.py
@@ -461,18 +461,15 @@ def _show_unsupported_dialog(parent, filename, mime):
dialog.set_detail(f"No viewer available for type: {mime}")
dialog.show(parent)
-def _show_error_dialog(parent_window, title, message):
- dialog = Gtk.Dialog(transient_for=parent_window, modal=True)
- dialog.set_title(title)
- content = dialog.get_content_area()
- content.set_spacing(12)
- content.set_margin_top(12)
- content.set_margin_bottom(12)
- content.set_margin_start(12)
- content.set_margin_end(12)
- label = Gtk.Label(label=message)
- label.set_wrap(True)
- content.append(label)
- dialog.add_button("OK", Gtk.ResponseType.OK)
- dialog.connect("response", lambda d, _: d.destroy())
+
+def _show_error_dialog(self, title, message):
+ dialog = Adw.MessageDialog(
+ transient_for=self.get_root(),
+ heading=title,
+ body=message
+ )
+ dialog.add_response("ok", "OK")
+ dialog.set_response_appearance("ok", Adw.ResponseAppearance.DESTRUCTIVE)
+ dialog.connect("response", lambda d, response: d.close())
+
dialog.present()
\ No newline at end of file