File tree 3 files changed +49
-9
lines changed
3 files changed +49
-9
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,19 @@ class QgsOptionsPageWidget : QWidget
25
25
Constructor for QgsOptionsPageWidget.
26
26
%End
27
27
28
+ virtual QString helpKey() const;
29
+ %Docstring
30
+ Returns the optional help key for the options page. The default implementation
31
+ returns an empty string.
32
+
33
+ If a non-empty string is returned by this method, it will be used as the help key
34
+ retrieved when the "help" button is clicked while this options page is active.
35
+
36
+ If an empty string is returned by this method the default QGIS options
37
+ help will be retrieved.
38
+ :rtype: str
39
+ %End
40
+
28
41
public slots:
29
42
30
43
virtual void apply() = 0;
Original file line number Diff line number Diff line change @@ -2355,19 +2355,34 @@ void QgsOptions::setZoomFactorValue()
2355
2355
void QgsOptions::showHelp ()
2356
2356
{
2357
2357
QWidget *activeTab = mOptionsStackedWidget ->currentWidget ();
2358
- QString link = QStringLiteral ( " introduction/qgis_configuration.html " ) ;
2358
+ QString link ;
2359
2359
2360
- if ( activeTab == mOptionsPageAuth )
2360
+ // give first priority to created pages which have specified a help key
2361
+ for ( const QgsOptionsPageWidget *widget : qgsAsConst ( mAdditionalOptionWidgets ) )
2361
2362
{
2362
- link = QStringLiteral ( " auth_system/index.html " );
2363
- }
2364
- else if ( activeTab == mOptionsPageVariables )
2365
- {
2366
- link = QStringLiteral ( " introduction/general_tools.html#variables " );
2363
+ if ( widget == activeTab )
2364
+ {
2365
+ link = widget-> helpKey ();
2366
+ break ;
2367
+ }
2367
2368
}
2368
- else if ( activeTab == mOptionsPageCRS )
2369
+
2370
+ if ( link .isEmpty () )
2369
2371
{
2370
- link = QStringLiteral ( " working_with_projections/working_with_projections.html" );
2372
+ link = QStringLiteral ( " introduction/qgis_configuration.html" );
2373
+
2374
+ if ( activeTab == mOptionsPageAuth )
2375
+ {
2376
+ link = QStringLiteral ( " auth_system/index.html" );
2377
+ }
2378
+ else if ( activeTab == mOptionsPageVariables )
2379
+ {
2380
+ link = QStringLiteral ( " introduction/general_tools.html#variables" );
2381
+ }
2382
+ else if ( activeTab == mOptionsPageCRS )
2383
+ {
2384
+ link = QStringLiteral ( " working_with_projections/working_with_projections.html" );
2385
+ }
2371
2386
}
2372
2387
QgsHelp::openHelp ( link );
2373
2388
}
Original file line number Diff line number Diff line change @@ -38,6 +38,18 @@ class GUI_EXPORT QgsOptionsPageWidget : public QWidget
38
38
: QWidget( parent )
39
39
{}
40
40
41
+ /* *
42
+ * Returns the optional help key for the options page. The default implementation
43
+ * returns an empty string.
44
+ *
45
+ * If a non-empty string is returned by this method, it will be used as the help key
46
+ * retrieved when the "help" button is clicked while this options page is active.
47
+ *
48
+ * If an empty string is returned by this method the default QGIS options
49
+ * help will be retrieved.
50
+ */
51
+ virtual QString helpKey () const { return QString (); }
52
+
41
53
public slots:
42
54
43
55
/* *
You can’t perform that action at this time.
0 commit comments