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()
|
||||
|
||||
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:
|
||||
action = Gio.SimpleAction.new(name, None)
|
||||
action.connect('activate', callback)
|
||||
|
@ -52,3 +54,7 @@ class Application(Gtk.Application):
|
|||
windows = self.get_windows()
|
||||
for window in windows:
|
||||
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"?>
|
||||
<interface>
|
||||
<menu id="primary-menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label">Help</attribute>
|
||||
<attribute name="action">app.help</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label">About</attribute>
|
||||
<attribute name="action">app.about</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
</interface>
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue