From 49c3eb37cb713234f2cf1d45693a52fda7ffe75c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Mon, 6 Jul 2015 12:05:03 -0500 Subject: [PATCH] enable documentation in the help menu --- src/controller/mainController.py | 9 +++++++++ src/wxUI/view.py | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/controller/mainController.py b/src/controller/mainController.py index 362f0f2d..d8a205be 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -35,6 +35,8 @@ import pygeocoder from pygeolib import GeocoderError import logging import webbrowser +from mysc import localization +import os log = logging.getLogger("mainController") @@ -165,6 +167,7 @@ class Controller(object): if widgetUtils.toolkit == "wx": widgetUtils.connect_event(self.view.nb, widgetUtils.NOTEBOOK_PAGE_CHANGED, self.buffer_changed) widgetUtils.connect_event(self.view, widgetUtils.MENU, self.report_error, self.view.reportError) + widgetUtils.connect_event(self.view, widgetUtils.MENU, self.view_documentation, self.view.doc) def set_systray_icon(self): self.systrayIcon = sysTrayIcon.SysTrayIcon() @@ -1315,5 +1318,11 @@ class Controller(object): buffer.session.settings["other_buffers"]["muted_buffers"].remove(buffer.name) output.speak(_(u"Buffer mute off"), True) + def view_documentation(self, *args, **kwargs): + lang = localization.get("documentation") + os.chdir("documentation/%s" % (lang,)) + webbrowser.open("manual.html") + os.chdir("../../") + def __del__(self): config.app.write() diff --git a/src/wxUI/view.py b/src/wxUI/view.py index 155d61d0..cdffd173 100644 --- a/src/wxUI/view.py +++ b/src/wxUI/view.py @@ -61,7 +61,6 @@ class mainFrame(wx.Frame): # Help Menu help = wx.Menu() self.doc = help.Append(-1, _(u"&Documentation")) - self.doc.Enable(False) self.sounds_tutorial = help.Append(wx.NewId(), _(u"Sounds &tutorial")) self.changelog = help.Append(wx.NewId(), _(u"&What's new in this version?")) self.changelog.Enable(False)