diff options
author | B Stack <bgstack15@gmail.com> | 2020-03-16 14:03:08 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-03-16 14:03:08 -0400 |
commit | b4360f58ea0b82e70c8db8ce2f365f756e32f2cf (patch) | |
tree | 1369bea8fcb83c6d52f69031d7032a1d2290d954 | |
parent | add working searchbox to app view (diff) | |
download | mime_types_editor-b4360f58ea0b82e70c8db8ce2f365f756e32f2cf.tar.gz mime_types_editor-b4360f58ea0b82e70c8db8ce2f365f756e32f2cf.tar.bz2 mime_types_editor-b4360f58ea0b82e70c8db8ce2f365f756e32f2cf.zip |
-rw-r--r-- | src/mime_editor.py | 9 | ||||
-rw-r--r-- | src/ui_main_window.glade | 37 |
2 files changed, 45 insertions, 1 deletions
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 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.22.2 --> <interface> <requires lib="gtk+" version="3.12"/> + <object class="GtkAboutDialog" id="about_window"> + <property name="can_focus">False</property> + <property name="type_hint">dialog</property> + <property name="copyright" translatable="yes">(C) 2017 i026e</property> + <property name="authors">Pavel Klevakin</property> + <property name="logo_icon_name">image-missing</property> + <property name="license_type">gpl-2-0</property> + <child type="titlebar"> + <placeholder/> + </child> + <child internal-child="vbox"> + <object class="GtkBox"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <placeholder/> + </child> + </object> + </child> + </object> <object class="GtkAccelGroup" id="accelgroup"/> <object class="GtkApplicationWindow" id="main_window"> <property name="width_request">640</property> @@ -9,6 +41,9 @@ <property name="can_focus">False</property> <property name="border_width">5</property> <property name="has_resize_grip">True</property> + <child type="titlebar"> + <placeholder/> + </child> <child> <object class="GtkBox" id="main_box"> <property name="visible">True</property> |