Add a Help entry in the menu (to point to the wiki)
This commit is contained in:
parent
6c8d586caa
commit
84273a1c83
|
@ -35,7 +35,9 @@ class Application(Gtk.Application):
|
||||||
window.present()
|
window.present()
|
||||||
|
|
||||||
def _build_app_menu(self):
|
def _build_app_menu(self):
|
||||||
actions = [('about', self._about), ('quit', self._quit)]
|
actions = [('about', self._about),
|
||||||
|
('quit', self._quit),
|
||||||
|
('help', self._help)]
|
||||||
for (name, callback) in actions:
|
for (name, callback) in actions:
|
||||||
action = Gio.SimpleAction.new(name, None)
|
action = Gio.SimpleAction.new(name, None)
|
||||||
action.connect('activate', callback)
|
action.connect('activate', callback)
|
||||||
|
@ -52,3 +54,7 @@ class Application(Gtk.Application):
|
||||||
windows = self.get_windows()
|
windows = self.get_windows()
|
||||||
for window in windows:
|
for window in windows:
|
||||||
window.destroy()
|
window.destroy()
|
||||||
|
|
||||||
|
def _help(self, action, param):
|
||||||
|
import time
|
||||||
|
Gtk.show_uri(None, 'https://github.com/tuhiproject/tuhi/wiki', time.time())
|
||||||
|
|
|
@ -29,10 +29,18 @@ MENU_XML = """
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<interface>
|
<interface>
|
||||||
<menu id="primary-menu">
|
<menu id="primary-menu">
|
||||||
|
<section>
|
||||||
|
<item>
|
||||||
|
<attribute name="label">Help</attribute>
|
||||||
|
<attribute name="action">app.help</attribute>
|
||||||
|
</item>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
<item>
|
<item>
|
||||||
<attribute name="label">About</attribute>
|
<attribute name="label">About</attribute>
|
||||||
<attribute name="action">app.about</attribute>
|
<attribute name="action">app.about</attribute>
|
||||||
</item>
|
</item>
|
||||||
|
</section>
|
||||||
</menu>
|
</menu>
|
||||||
</interface>
|
</interface>
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue