aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mime_editor.py9
-rw-r--r--src/ui_main_window.glade37
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>
bgstack15