File tree 2 files changed +18
-2
lines changed
python/plugins/MetaSearch
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 29
29
from PyQt4 .QtGui import QAction , QIcon
30
30
31
31
from MetaSearch .dialogs .maindialog import MetaSearchDialog
32
- from MetaSearch .util import StaticContext , open_url
32
+ from MetaSearch .util import get_help_url , open_url , StaticContext
33
33
34
34
LOGGER = logging .getLogger ('MetaSearch' )
35
35
@@ -94,4 +94,4 @@ def run(self):
94
94
def help (self ):
95
95
"""open help in user's default web browser"""
96
96
97
- open_url (self . context . metadata . get ( 'general' , 'homepage' ))
97
+ open_url (get_help_url ( ))
Original file line number Diff line number Diff line change 36
36
from pygments import highlight
37
37
from pygments .lexers import XmlLexer
38
38
from pygments .formatters import HtmlFormatter
39
+ from PyQt4 .QtCore import QSettings
39
40
from PyQt4 .QtGui import QMessageBox
40
41
from PyQt4 .uic import loadUiType
41
42
43
+ from qgis .core import QGis
44
+
45
+
42
46
LOGGER = logging .getLogger ('MetaSearch' )
43
47
44
48
@@ -121,6 +125,18 @@ def highlight_xml(context, xml):
121
125
return template .render (css = css , body = body )
122
126
123
127
128
+ def get_help_url ():
129
+ """return QGIS MetaSearch help documentation link"""
130
+
131
+ locale_name = QSettings ().value ('locale/userLocale' )[0 :2 ]
132
+ version = QGis .QGIS_VERSION [:3 ]
133
+
134
+ path = '%s/%s/docs/user_manual/plugins/plugins_metasearch.html' % \
135
+ (version , locale_name )
136
+
137
+ return '/' .join (['http://docs.qgis.org' , path ])
138
+
139
+
124
140
def open_url (url ):
125
141
"""open URL in web browser"""
126
142
You can’t perform that action at this time.
0 commit comments