Skip to content
Permalink
Browse files

MetaSearch: fix help link

  • Loading branch information
tomkralidis committed Feb 24, 2015
1 parent 3fa6f91 commit 9798c92e498de80ecef9d7f06ad6a774c4d8c712
Showing with 18 additions and 2 deletions.
  1. +2 −2 python/plugins/MetaSearch/plugin.py
  2. +16 −0 python/plugins/MetaSearch/util.py
@@ -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')

@@ -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())
@@ -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')


@@ -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"""

0 comments on commit 9798c92

Please sign in to comment.
You can’t perform that action at this time.