Skip to content

Commit

Permalink
MetaSearch: fix help link
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Feb 24, 2015
1 parent 3fa6f91 commit 9798c92
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/plugins/MetaSearch/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from PyQt4.QtGui import QAction, QIcon

from MetaSearch.dialogs.maindialog import MetaSearchDialog
from MetaSearch.util import StaticContext, open_url
from MetaSearch.util import get_help_url, open_url, StaticContext

LOGGER = logging.getLogger('MetaSearch')

Expand Down Expand Up @@ -94,4 +94,4 @@ def run(self):
def help(self):
"""open help in user's default web browser"""

open_url(self.context.metadata.get('general', 'homepage'))
open_url(get_help_url())
16 changes: 16 additions & 0 deletions python/plugins/MetaSearch/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@
from pygments import highlight
from pygments.lexers import XmlLexer
from pygments.formatters import HtmlFormatter
from PyQt4.QtCore import QSettings
from PyQt4.QtGui import QMessageBox
from PyQt4.uic import loadUiType

from qgis.core import QGis


LOGGER = logging.getLogger('MetaSearch')


Expand Down Expand Up @@ -121,6 +125,18 @@ def highlight_xml(context, xml):
return template.render(css=css, body=body)


def get_help_url():
"""return QGIS MetaSearch help documentation link"""

locale_name = QSettings().value('locale/userLocale')[0:2]
version = QGis.QGIS_VERSION[:3]

path = '%s/%s/docs/user_manual/plugins/plugins_metasearch.html' % \
(version, locale_name)

return '/'.join(['http://docs.qgis.org', path])


def open_url(url):
"""open URL in web browser"""

Expand Down

0 comments on commit 9798c92

Please sign in to comment.