mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
MetaSearch: fix help link
This commit is contained in:
parent
3fa6f91e1a
commit
9798c92e49
@ -29,7 +29,7 @@ from PyQt4.QtCore import QCoreApplication
|
||||
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 @@ class MetaSearchPlugin(object):
|
||||
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 jinja2 import Environment, FileSystemLoader
|
||||
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"""
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user