From b4360f58ea0b82e70c8db8ce2f365f756e32f2cf Mon Sep 17 00:00:00 2001 From: B Stack Date: Mon, 16 Mar 2020 14:03:08 -0400 Subject: add about dialog --- src/mime_editor.py | 9 +++++++++ src/ui_main_window.glade | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/mime_editor.py b/src/mime_editor.py index a555720..5bb64b2 100644 --- a/src/mime_editor.py +++ b/src/mime_editor.py @@ -71,6 +71,10 @@ class MainWindow: cat_mode_menuitem.connect("activate", self.switch_mode, "cat_mode") app_mode_menuitem.connect("activate", self.switch_mode, "app_mode") + # Help menu + about_menuitem = self.builder.get_object("imagemenuitem10") + about_menuitem.connect("activate", self.about_menu) + def run(self): self.window.show() Gtk.main() @@ -82,6 +86,11 @@ class MainWindow: if new_mode != self.current_mode: os.execl(sys.executable, sys.executable, sys.argv[0], new_mode) + def about_menu(self, widget): + # abused from https://athenajc.gitbooks.io/python-gtk-3-api/content/gtk-group/gtkaboutdialog.html + self.about_window = self.builder.get_object("about_window") + self.about_window.connect('response', lambda dialog, data: self.about_window.hide()) + self.about_window.show() if __name__ == "__main__": mode = "cat_mode" diff --git a/src/ui_main_window.glade b/src/ui_main_window.glade index 4f695f5..dcf875d 100644 --- a/src/ui_main_window.glade +++ b/src/ui_main_window.glade @@ -1,7 +1,39 @@ - + + + False + dialog + (C) 2017 i026e + Pavel Klevakin + image-missing + gpl-2-0 + + + + + + False + vertical + 2 + + + False + end + + + False + False + 0 + + + + + + + + 640 @@ -9,6 +41,9 @@ False 5 True + + + True -- cgit