From 57535763d76c9f4b8aa39ef93a0430b72d927b51 Mon Sep 17 00:00:00 2001
From: Alexander Bruy <alexander.bruy@gmail.com>
Date: Thu, 19 Jan 2017 11:57:35 +0200
Subject: [PATCH] use new QgsHelp where possible instead of builtin context
 help

---
 src/app/ogr/qgsopenvectorlayerdialog.h                |  4 ++--
 src/app/pluginmanager/qgspluginmanager.h              |  4 ++--
 src/app/qgisapp.cpp                                   | 11 ++---------
 src/app/qgscustomprojectiondialog.h                   |  4 ++--
 src/app/qgsdecorationcopyrightdialog.cpp              |  4 ++--
 src/app/qgsdecorationgriddialog.cpp                   |  4 ++--
 src/app/qgsdecorationnortharrowdialog.cpp             |  4 ++--
 src/app/qgsdecorationscalebardialog.cpp               |  4 ++--
 src/app/qgsidentifyresultsdialog.h                    |  4 ++--
 src/app/qgsmeasuredialog.cpp                          |  1 -
 src/app/qgsmeasuredialog.h                            |  4 ++--
 src/app/qgsnewspatialitelayerdialog.h                 |  4 ++--
 src/app/qgsoptions.h                                  |  4 ++--
 src/app/qgsprojectproperties.h                        |  4 ++--
 src/app/qgsrasterlayerproperties.h                    |  4 ++--
 src/app/qgsvectorlayerproperties.h                    |  4 ++--
 src/gui/qgsquerybuilder.h                             |  4 ++--
 src/gui/symbology-ng/qgsstylemanagerdialog.h          |  4 ++--
 src/plugins/coordinate_capture/coordinatecapturegui.h |  4 ++--
 .../databaseconnection/evisdatabaseconnectiongui.h    |  4 ++--
 src/plugins/gps_importer/qgsgpsplugingui.h            |  4 ++--
 .../offline_editing/offline_editing_plugin_gui.cpp    |  4 ++--
 src/providers/db2/qgsdb2newconnection.h               |  4 ++--
 src/providers/db2/qgsdb2sourceselect.h                |  4 ++--
 .../delimitedtext/qgsdelimitedtextsourceselect.h      |  4 ++--
 src/providers/mssql/qgsmssqlnewconnection.h           |  4 ++--
 src/providers/mssql/qgsmssqlsourceselect.h            |  4 ++--
 src/providers/oracle/qgsoraclenewconnection.h         |  4 ++--
 src/providers/oracle/qgsoraclesourceselect.h          |  4 ++--
 src/providers/postgres/qgspgnewconnection.h           |  4 ++--
 src/providers/postgres/qgspgsourceselect.h            |  4 ++--
 src/providers/spatialite/qgsspatialitesourceselect.h  |  4 ++--
 src/providers/wms/qgswmssourceselect.h                |  4 ++--
 33 files changed, 64 insertions(+), 72 deletions(-)

diff --git a/src/app/ogr/qgsopenvectorlayerdialog.h b/src/app/ogr/qgsopenvectorlayerdialog.h
index 0c33b3dd786..1a2cab7cc56 100644
--- a/src/app/ogr/qgsopenvectorlayerdialog.h
+++ b/src/app/ogr/qgsopenvectorlayerdialog.h
@@ -21,7 +21,7 @@
 
 #include <ui_qgsopenvectorlayerdialogbase.h>
 #include <QDialog>
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 /**
  *  Class for a  dialog to select the type and source for ogr vectors, supports
@@ -84,7 +84,7 @@ class QgsOpenVectorLayerDialog : public QDialog, private Ui::QgsOpenVectorLayerD
     void on_btnDelete_clicked();
     void on_cmbDatabaseTypes_currentIndexChanged( const QString & text );
     void on_cmbConnections_currentIndexChanged( const QString & text );
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/supported_data.html#loading-a-layer-from-a-file" ) ); }
 };
 
 #endif // QGSOPENVECTORDIALOG_H
diff --git a/src/app/pluginmanager/qgspluginmanager.h b/src/app/pluginmanager/qgspluginmanager.h
index e16c2749925..bdc707d2d4d 100644
--- a/src/app/pluginmanager/qgspluginmanager.h
+++ b/src/app/pluginmanager/qgspluginmanager.h
@@ -26,7 +26,7 @@
 #include "ui_qgspluginmanagerbase.h"
 #include "qgsoptionsdialogbase.h"
 #include "qgisgui.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgsmessagebar.h"
 #include "qgspythonutils.h"
 
@@ -156,7 +156,7 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag
     void on_ckbDeprecated_toggled( bool state );
 
     //! Open help browser
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "plugins/plugins.html#the-plugins-dialog" ) ); }
 
     //! Reimplement QgsOptionsDialogBase method to prevent modifying the tab list by signals from the stacked widget
     void optionsStackedWidget_CurrentChanged( int indx ) { Q_UNUSED( indx ) }
diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp
index 20f87a7c9fd..9b2d0b9083a 100644
--- a/src/app/qgisapp.cpp
+++ b/src/app/qgisapp.cpp
@@ -246,6 +246,7 @@
 #include "qgstransaction.h"
 #include "qgstransactiongroup.h"
 #include "qgsvectorlayerutils.h"
+#include "qgshelp.h"
 
 #include "qgssublayersdialog.h"
 #include "ogr/qgsopenvectorlayerdialog.h"
@@ -9311,15 +9312,7 @@ void QgisApp::adjustBrightnessContrast( int delta, bool updateBrightness )
 
 void QgisApp::helpContents()
 {
-  QSettings settings;
-  QString helpUrl = settings.value( QStringLiteral( "Qgis/docsUserManualUrl" ),
-                                    QStringLiteral( "https://docs.qgis.org/%1.%2/%3/docs/user_manual/" ) ).toString();
-  // We should really ship the HTML version of the docs local too.
-  openURL( helpUrl
-           .arg( Qgis::QGIS_VERSION_INT / 10000 )
-           .arg( Qgis::QGIS_VERSION_INT / 100 % 100 )
-           .arg( tr( "en", "documentation language" ) ),
-           false );
+  QgsHelp::openHelp( QStringLiteral( "index.html" ) );
 }
 
 void QgisApp::apiDocumentation()
diff --git a/src/app/qgscustomprojectiondialog.h b/src/app/qgscustomprojectiondialog.h
index aac3b268cba..6a5aa7ef571 100644
--- a/src/app/qgscustomprojectiondialog.h
+++ b/src/app/qgscustomprojectiondialog.h
@@ -19,7 +19,7 @@
 #define QGSCUSTOMCRSDIALOG_H
 
 #include "ui_qgscustomprojectiondialogbase.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgscoordinatereferencesystem.h"
 #include "qgis_app.h"
 
@@ -44,7 +44,7 @@ class APP_EXPORT QgsCustomProjectionDialog : public QDialog, private Ui::QgsCust
     void on_pbnCopyCRS_clicked();
     void on_leNameList_currentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *prev );
 
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_projections/working_with_projections.html#custom-coordinate-reference-system" ) ); }
     void on_buttonBox_accepted();
 
   private:
diff --git a/src/app/qgsdecorationcopyrightdialog.cpp b/src/app/qgsdecorationcopyrightdialog.cpp
index 45bae8d3435..a81d44c1500 100644
--- a/src/app/qgsdecorationcopyrightdialog.cpp
+++ b/src/app/qgsdecorationcopyrightdialog.cpp
@@ -13,7 +13,7 @@
 #include "qgsdecorationcopyrightdialog.h"
 #include "qgsdecorationcopyright.h"
 
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 //qt includes
 #include <QColorDialog>
@@ -100,5 +100,5 @@ void QgsDecorationCopyrightDialog::apply()
 
 void QgsDecorationCopyrightDialog::on_buttonBox_helpRequested()
 {
-  QgsContextHelp::run( metaObject()->className() );
+  QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#id57" ) );
 }
diff --git a/src/app/qgsdecorationgriddialog.cpp b/src/app/qgsdecorationgriddialog.cpp
index cbb80dd3493..75c5a49601a 100644
--- a/src/app/qgsdecorationgriddialog.cpp
+++ b/src/app/qgsdecorationgriddialog.cpp
@@ -20,7 +20,7 @@
 #include "qgsdecorationgrid.h"
 
 #include "qgslogger.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgsstyle.h"
 #include "qgssymbol.h"
 #include "qgssymbolselectordialog.h"
@@ -178,7 +178,7 @@ QgsDecorationGridDialog::~QgsDecorationGridDialog()
 
 void QgsDecorationGridDialog::on_buttonBox_helpRequested()
 {
-  QgsContextHelp::run( metaObject()->className() );
+  QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#id56" ) );
 }
 
 void QgsDecorationGridDialog::on_buttonBox_accepted()
diff --git a/src/app/qgsdecorationnortharrowdialog.cpp b/src/app/qgsdecorationnortharrowdialog.cpp
index 5194bba3ed1..b520535001b 100644
--- a/src/app/qgsdecorationnortharrowdialog.cpp
+++ b/src/app/qgsdecorationnortharrowdialog.cpp
@@ -13,7 +13,7 @@
 #include "qgsdecorationnortharrowdialog.h"
 #include "qgsdecorationnortharrow.h"
 #include "qgslogger.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 #include <QPainter>
 #include <QSettings>
@@ -65,7 +65,7 @@ QgsDecorationNorthArrowDialog::~QgsDecorationNorthArrowDialog()
 
 void QgsDecorationNorthArrowDialog::on_buttonBox_helpRequested()
 {
-  QgsContextHelp::run( metaObject()->className() );
+  QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#north-arrow" ) );
 }
 
 void QgsDecorationNorthArrowDialog::on_buttonBox_accepted()
diff --git a/src/app/qgsdecorationscalebardialog.cpp b/src/app/qgsdecorationscalebardialog.cpp
index 6a204f84ecc..cfb27a154cb 100644
--- a/src/app/qgsdecorationscalebardialog.cpp
+++ b/src/app/qgsdecorationscalebardialog.cpp
@@ -13,7 +13,7 @@
 #include "qgsdecorationscalebardialog.h"
 #include "qgsdecorationscalebar.h"
 #include "qgslogger.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 #include <QColorDialog>
 #include <QSettings>
@@ -84,7 +84,7 @@ QgsDecorationScaleBarDialog::~QgsDecorationScaleBarDialog()
 
 void QgsDecorationScaleBarDialog::on_buttonBox_helpRequested()
 {
-  QgsContextHelp::run( metaObject()->className() );
+  QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#scale-bar" ) );
 }
 
 void QgsDecorationScaleBarDialog::apply()
diff --git a/src/app/qgsidentifyresultsdialog.h b/src/app/qgsidentifyresultsdialog.h
index 3ecb79056b4..ea507590bc1 100644
--- a/src/app/qgsidentifyresultsdialog.h
+++ b/src/app/qgsidentifyresultsdialog.h
@@ -19,7 +19,7 @@
 #define QGSIDENTIFYRESULTSDIALOG_H
 
 #include "ui_qgsidentifyresultsbase.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgsfeature.h"
 #include "qgsfields.h"
 #include "qgscoordinatereferencesystem.h"
@@ -205,7 +205,7 @@ class APP_EXPORT QgsIdentifyResultsDialog: public QDialog, private Ui::QgsIdenti
 
     QTreeWidgetItem *retrieveAttributes( QTreeWidgetItem *item, QgsAttributeMap &attributes, int &currentIdx );
 
-    void helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void helpRequested() { QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#identify" ) ); }
 
     void on_cmbIdentifyMode_currentIndexChanged( int index );
 
diff --git a/src/app/qgsmeasuredialog.cpp b/src/app/qgsmeasuredialog.cpp
index 2ae1d0eab70..0c9a92ba0b6 100644
--- a/src/app/qgsmeasuredialog.cpp
+++ b/src/app/qgsmeasuredialog.cpp
@@ -19,7 +19,6 @@
 #include "qgsmeasuretool.h"
 
 #include "qgslogger.h"
-#include "qgscontexthelp.h"
 #include "qgsdistancearea.h"
 #include "qgsmapcanvas.h"
 #include "qgsproject.h"
diff --git a/src/app/qgsmeasuredialog.h b/src/app/qgsmeasuredialog.h
index 620aeecc7f9..cc2ae298ca5 100644
--- a/src/app/qgsmeasuredialog.h
+++ b/src/app/qgsmeasuredialog.h
@@ -21,7 +21,7 @@
 
 #include "qgspoint.h"
 #include "qgsdistancearea.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgis_app.h"
 
 class QCloseEvent;
@@ -61,7 +61,7 @@ class APP_EXPORT QgsMeasureDialog : public QDialog, private Ui::QgsMeasureBase
     void closeEvent( QCloseEvent *e ) override;
 
     //! Show the help for the dialog
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#id38" ) ); }
 
     //! When any external settings change
     void updateSettings();
diff --git a/src/app/qgsnewspatialitelayerdialog.h b/src/app/qgsnewspatialitelayerdialog.h
index 8417b90aa8b..08b2679d4d8 100644
--- a/src/app/qgsnewspatialitelayerdialog.h
+++ b/src/app/qgsnewspatialitelayerdialog.h
@@ -19,7 +19,7 @@
 
 #include "ui_qgsnewspatialitelayerdialogbase.h"
 #include "qgisgui.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 #include "qgis.h"
 
@@ -48,7 +48,7 @@ class APP_EXPORT QgsNewSpatialiteLayerDialog: public QDialog, private Ui::QgsNew
     void selectionChanged();
     void checkOk();
 
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/editing_geometry_attributes.html#vector-create-spatialite" ) ); }
     void on_buttonBox_accepted();
     void on_buttonBox_rejected();
 
diff --git a/src/app/qgsoptions.h b/src/app/qgsoptions.h
index 995464fdc58..502f9db5a7f 100644
--- a/src/app/qgsoptions.h
+++ b/src/app/qgsoptions.h
@@ -22,7 +22,7 @@
 #include "ui_qgsoptionsbase.h"
 #include "qgisgui.h"
 #include "qgisapp.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 #include <qgscoordinatereferencesystem.h>
 
@@ -176,7 +176,7 @@ class APP_EXPORT QgsOptions : public QgsOptionsDialogBase, private Ui::QgsOption
     void on_mBtnRemoveHiddenPath_clicked();
 
 
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "introduction/qgis_configuration.html#options" ) ); }
 
     void on_mBrowseCacheDirectory_clicked();
     void on_mClearCache_clicked();
diff --git a/src/app/qgsprojectproperties.h b/src/app/qgsprojectproperties.h
index a47e1b763c4..d700893f15e 100644
--- a/src/app/qgsprojectproperties.h
+++ b/src/app/qgsprojectproperties.h
@@ -22,7 +22,7 @@
 #include "qgis.h"
 #include "qgsunittypes.h"
 #include "qgisgui.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgis_app.h"
 
 class QgsMapCanvas;
@@ -141,7 +141,7 @@ class APP_EXPORT QgsProjectProperties : public QgsOptionsDialogBase, private Ui:
     /*!
      * Slot to show the context help for this dialog
      */
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "introduction/qgis_configuration.html#project-properties" ) ); }
 
     void on_cbxProjectionEnabled_toggled( bool onFlyEnabled );
 
diff --git a/src/app/qgsrasterlayerproperties.h b/src/app/qgsrasterlayerproperties.h
index 08a003f0764..ff2bdaa719b 100644
--- a/src/app/qgsrasterlayerproperties.h
+++ b/src/app/qgsrasterlayerproperties.h
@@ -22,7 +22,7 @@
 #include "qgsoptionsdialogbase.h"
 #include "ui_qgsrasterlayerpropertiesbase.h"
 #include "qgisgui.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgsmaplayerstylemanager.h"
 #include "qgis_app.h"
 
@@ -100,7 +100,7 @@ class APP_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private
     //! Save a style when appriate button is pressed.
     void saveStyleAs_clicked();
     //! Help button
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_raster/raster_properties.html" ) ); }
 
     //! Slot to reset all color rendering options to default
     void on_mResetColorRenderingBtn_clicked();
diff --git a/src/app/qgsvectorlayerproperties.h b/src/app/qgsvectorlayerproperties.h
index 066c8d46e34..bff552f46e8 100644
--- a/src/app/qgsvectorlayerproperties.h
+++ b/src/app/qgsvectorlayerproperties.h
@@ -22,7 +22,7 @@
 #include "qgsoptionsdialogbase.h"
 #include "ui_qgsvectorlayerpropertiesbase.h"
 #include "qgisgui.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgsmaplayerstylemanager.h"
 #include "qgsvectorlayer.h"
 #include "layertree/qgslayertreemodel.h"
@@ -104,7 +104,7 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
     void loadStyle_clicked();
     void saveStyleAs_clicked();
     void mOptionsStackedWidget_CurrentChanged( int indx );
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html" ) ); }
     void on_pbnUpdateExtents_clicked();
 
     void on_mButtonAddJoin_clicked();
diff --git a/src/gui/qgsquerybuilder.h b/src/gui/qgsquerybuilder.h
index 048fdd3de5a..4031d68e33e 100644
--- a/src/gui/qgsquerybuilder.h
+++ b/src/gui/qgsquerybuilder.h
@@ -21,7 +21,7 @@
 #include <QModelIndex>
 #include "ui_qgsquerybuilderbase.h"
 #include "qgisgui.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgis_gui.h"
 
 class QgsVectorLayer;
@@ -79,7 +79,7 @@ class GUI_EXPORT QgsQueryBuilder : public QDialog, private Ui::QgsQueryBuilderBa
     void on_btnNot_clicked();
     void on_btnOr_clicked();
 
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#query-builder" ) ); }
 
     /** Test the constructed sql statement to see if the vector layer data provider likes it.
      * The number of rows that would be returned is displayed in a message box.
diff --git a/src/gui/symbology-ng/qgsstylemanagerdialog.h b/src/gui/symbology-ng/qgsstylemanagerdialog.h
index fb18a3da883..aef23c57972 100644
--- a/src/gui/symbology-ng/qgsstylemanagerdialog.h
+++ b/src/gui/symbology-ng/qgsstylemanagerdialog.h
@@ -22,7 +22,7 @@
 #include <QMenu>
 
 #include "ui_qgsstylemanagerdialogbase.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgis_gui.h"
 
 class QgsStyle;
@@ -58,7 +58,7 @@ class GUI_EXPORT QgsStyleManagerDialog : public QDialog, private Ui::QgsStyleMan
     //! called when the dialog is going to be closed
     void onFinished();
 
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/style_library.html#id2" ) ); }
 
     void itemChanged( QStandardItem* item );
 
diff --git a/src/plugins/coordinate_capture/coordinatecapturegui.h b/src/plugins/coordinate_capture/coordinatecapturegui.h
index be9c26802cc..58ea0ba8c66 100644
--- a/src/plugins/coordinate_capture/coordinatecapturegui.h
+++ b/src/plugins/coordinate_capture/coordinatecapturegui.h
@@ -13,7 +13,7 @@
 #define CoordinateCaptureGUI_H
 
 #include <QDialog>
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 /**
 @author Tim Sutton
@@ -29,7 +29,7 @@ class CoordinateCaptureGui : public QDialog
   private slots:
     void on_buttonBox_accepted();
     void on_buttonBox_rejected();
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "plugins/plugins_coordinate_capture.html" ) ); }
 };
 
 #endif
diff --git a/src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.h b/src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.h
index 8e0d5861e13..ecf8b6898fe 100644
--- a/src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.h
+++ b/src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.h
@@ -31,7 +31,7 @@
 #include "evisdatabaseconnection.h"
 #include "evisdatabaselayerfieldselectiongui.h"
 #include "evisquerydefinition.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 #include <QTemporaryFile>
 #include <QDialog>
@@ -72,7 +72,7 @@ class eVisDatabaseConnectionGui : public QDialog, private Ui::eVisDatabaseConnec
     void drawNewVectorLayer( const QString&, const QString&, const QString& );
 
     void on_buttonBox_accepted();
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "plugins/plugins_evis.html#id11" ) ); }
 
     void on_cboxDatabaseType_currentIndexChanged( int );
     void on_cboxPredefinedQueryList_currentIndexChanged( int );
diff --git a/src/plugins/gps_importer/qgsgpsplugingui.h b/src/plugins/gps_importer/qgsgpsplugingui.h
index fb9bff7cd76..cd1fb99ed20 100644
--- a/src/plugins/gps_importer/qgsgpsplugingui.h
+++ b/src/plugins/gps_importer/qgsgpsplugingui.h
@@ -21,7 +21,7 @@
 #include "ui_qgsgpspluginguibase.h"
 #include "qgsbabelformat.h"
 #include "qgsgpsdevice.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 #include <vector>
 
@@ -80,7 +80,7 @@ class QgsGPSPluginGui : public QDialog, private Ui::QgsGPSPluginGuiBase
     void on_pbnRefresh_clicked();
     void on_buttonBox_accepted();
     void on_buttonBox_rejected();
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_gps/plugins_gps.html" ) ); }
 
   signals:
     void drawRasterLayer( const QString& );
diff --git a/src/plugins/offline_editing/offline_editing_plugin_gui.cpp b/src/plugins/offline_editing/offline_editing_plugin_gui.cpp
index 9f7d8beb631..e57960b71a0 100644
--- a/src/plugins/offline_editing/offline_editing_plugin_gui.cpp
+++ b/src/plugins/offline_editing/offline_editing_plugin_gui.cpp
@@ -18,7 +18,7 @@
 
 #include "offline_editing_plugin_gui.h"
 
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgslayertree.h"
 #include "qgslayertreemodel.h"
 #include "qgsmaplayer.h"
@@ -167,7 +167,7 @@ void QgsOfflineEditingPluginGui::on_buttonBox_rejected()
 // TODO: help
 void QgsOfflineEditingPluginGui::on_buttonBox_helpRequested()
 {
-  QgsContextHelp::run( metaObject()->className() );
+  QgsHelp::openHelp( QStringLiteral( "plugins/plugins_offline_editing.html" ) );
 }
 
 void QgsOfflineEditingPluginGui::restoreState()
diff --git a/src/providers/db2/qgsdb2newconnection.h b/src/providers/db2/qgsdb2newconnection.h
index 1288e4033bb..10976e706b1 100644
--- a/src/providers/db2/qgsdb2newconnection.h
+++ b/src/providers/db2/qgsdb2newconnection.h
@@ -19,7 +19,7 @@
 #define QGSDB2NEWCONNECTION_H
 #include "ui_qgsdb2newconnectionbase.h"
 #include "qgisgui.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgsauthconfigselect.h"
 
 /** \class QgsDb2NewConnection
@@ -48,7 +48,7 @@ class QgsDb2NewConnection : public QDialog, private Ui::QgsDb2NewConnectionBase
     void on_btnListDatabase_clicked();
     void on_btnConnect_clicked();
     void on_cb_trustedConnection_clicked();
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/supported_data.html#id33" ) ); }
   private:
     QString mOriginalConnName; //store initial name to delete entry in case of rename
     QgsAuthConfigSelect * mAuthConfigSelect;
diff --git a/src/providers/db2/qgsdb2sourceselect.h b/src/providers/db2/qgsdb2sourceselect.h
index 65bc6e82103..35900502960 100644
--- a/src/providers/db2/qgsdb2sourceselect.h
+++ b/src/providers/db2/qgsdb2sourceselect.h
@@ -23,7 +23,7 @@
 #include "qgisgui.h"
 #include "qgsdbfilterproxymodel.h"
 #include "qgsdb2tablemodel.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 #include <QMap>
 #include <QPair>
@@ -146,7 +146,7 @@ class QgsDb2SourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
     //!Sets a new regular expression to the model
     void setSearchExpression( const QString& regexp );
 
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/supported_data.html#id33" ) ); }
 
     void columnThreadFinished();
 
diff --git a/src/providers/delimitedtext/qgsdelimitedtextsourceselect.h b/src/providers/delimitedtext/qgsdelimitedtextsourceselect.h
index c66e028d77a..f65c6bb170d 100644
--- a/src/providers/delimitedtext/qgsdelimitedtextsourceselect.h
+++ b/src/providers/delimitedtext/qgsdelimitedtextsourceselect.h
@@ -16,7 +16,7 @@
 #include "ui_qgsdelimitedtextsourceselectbase.h"
 
 #include <QTextStream>
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgisgui.h"
 
 class QButtonGroup;
@@ -62,7 +62,7 @@ class QgsDelimitedTextSourceSelect : public QDialog, private Ui::QgsDelimitedTex
     void on_buttonBox_rejected();
     void on_buttonBox_helpRequested()
     {
-      QgsContextHelp::run( metaObject()->className() );
+      QgsHelp::openHelp( QStringLiteral( "working_with_vector/supported_data.html#id8" ) );
     }
     void on_btnBrowseForFile_clicked();
 
diff --git a/src/providers/mssql/qgsmssqlnewconnection.h b/src/providers/mssql/qgsmssqlnewconnection.h
index 972f42c48ca..1299dc729d8 100644
--- a/src/providers/mssql/qgsmssqlnewconnection.h
+++ b/src/providers/mssql/qgsmssqlnewconnection.h
@@ -18,7 +18,7 @@
 #define QGSMSSQLNEWCONNECTION_H
 #include "ui_qgsmssqlnewconnectionbase.h"
 #include "qgisgui.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 
 /** \class QgsMssqlNewConnection
@@ -47,7 +47,7 @@ class QgsMssqlNewConnection : public QDialog, private Ui::QgsMssqlNewConnectionB
     void on_btnListDatabase_clicked();
     void on_btnConnect_clicked();
     void on_cb_trustedConnection_clicked();
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/supported_data.html#mssql-spatial-layers" ) ); }
   private:
     QString mOriginalConnName; //store initial name to delete entry in case of rename
 };
diff --git a/src/providers/mssql/qgsmssqlsourceselect.h b/src/providers/mssql/qgsmssqlsourceselect.h
index 09973e2f5be..b4969d5de38 100644
--- a/src/providers/mssql/qgsmssqlsourceselect.h
+++ b/src/providers/mssql/qgsmssqlsourceselect.h
@@ -21,7 +21,7 @@
 #include "qgisgui.h"
 #include "qgsdbfilterproxymodel.h"
 #include "qgsmssqltablemodel.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 #include <QMap>
 #include <QPair>
@@ -144,7 +144,7 @@ class QgsMssqlSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
     //!Sets a new regular expression to the model
     void setSearchExpression( const QString& regexp );
 
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/supported_data.html#mssql-spatial-layers" ) ); }
 
     void columnThreadFinished();
 
diff --git a/src/providers/oracle/qgsoraclenewconnection.h b/src/providers/oracle/qgsoraclenewconnection.h
index 3ac22abab89..b77e2a5ae27 100644
--- a/src/providers/oracle/qgsoraclenewconnection.h
+++ b/src/providers/oracle/qgsoraclenewconnection.h
@@ -18,7 +18,7 @@
 #define QGSORACLENEWCONNECTION_H
 #include "ui_qgsoraclenewconnectionbase.h"
 #include "qgisgui.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 /** \class QgsOracleNewConnection
  * \brief Dialog to allow the user to configure and save connection
@@ -39,7 +39,7 @@ class QgsOracleNewConnection : public QDialog, private Ui::QgsOracleNewConnectio
   public slots:
     void accept();
     void on_btnConnect_clicked();
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/supported_data.html#id2" ) ); }
   private:
     QString mOriginalConnName; //store initial name to delete entry in case of rename
 };
diff --git a/src/providers/oracle/qgsoraclesourceselect.h b/src/providers/oracle/qgsoraclesourceselect.h
index 351a6944087..a83cd993ce4 100644
--- a/src/providers/oracle/qgsoraclesourceselect.h
+++ b/src/providers/oracle/qgsoraclesourceselect.h
@@ -21,7 +21,7 @@
 #include "qgisgui.h"
 #include "qgsdbfilterproxymodel.h"
 #include "qgsoracletablemodel.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgsoracleconnpool.h"
 
 #include <QMap>
@@ -134,7 +134,7 @@ class QgsOracleSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
     //!Sets a new regular expression to the model
     void setSearchExpression( const QString& regexp );
 
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/supported_data.html#id2" ) ); }
 
     void columnThreadFinished();
 
diff --git a/src/providers/postgres/qgspgnewconnection.h b/src/providers/postgres/qgspgnewconnection.h
index 6a2373f34a0..7dbf1410392 100644
--- a/src/providers/postgres/qgspgnewconnection.h
+++ b/src/providers/postgres/qgspgnewconnection.h
@@ -18,7 +18,7 @@
 #define QGSPGNEWCONNECTION_H
 #include "ui_qgspgnewconnectionbase.h"
 #include "qgisgui.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 #include "qgsauthconfigselect.h"
 
 /** \class QgsPgNewConnection
@@ -39,7 +39,7 @@ class QgsPgNewConnection : public QDialog, private Ui::QgsPgNewConnectionBase
     void accept() override;
     void on_btnConnect_clicked();
     void on_cb_geometryColumnsOnly_clicked();
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/supported_data.html#id14" ) ); }
   private:
     QString mOriginalConnName; //store initial name to delete entry in case of rename
     QgsAuthConfigSelect * mAuthConfigSelect;
diff --git a/src/providers/postgres/qgspgsourceselect.h b/src/providers/postgres/qgspgsourceselect.h
index 02f70811ec3..0fcfe48f794 100644
--- a/src/providers/postgres/qgspgsourceselect.h
+++ b/src/providers/postgres/qgspgsourceselect.h
@@ -22,7 +22,7 @@
 #include "qgsdatasourceuri.h"
 #include "qgsdbfilterproxymodel.h"
 #include "qgspgtablemodel.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 #include <QMap>
 #include <QPair>
@@ -116,7 +116,7 @@ class QgsPgSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
     //!Sets a new regular expression to the model
     void setSearchExpression( const QString& regexp );
 
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/supported_data.html#id14" ) ); }
 
     void columnThreadFinished();
 
diff --git a/src/providers/spatialite/qgsspatialitesourceselect.h b/src/providers/spatialite/qgsspatialitesourceselect.h
index 5dc4f1643b2..b15ccddf1de 100644
--- a/src/providers/spatialite/qgsspatialitesourceselect.h
+++ b/src/providers/spatialite/qgsspatialitesourceselect.h
@@ -20,7 +20,7 @@
 #include "qgisgui.h"
 #include "qgsdbfilterproxymodel.h"
 #include "qgsspatialitetablemodel.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 #include <QThread>
 #include <QMap>
@@ -91,7 +91,7 @@ class QgsSpatiaLiteSourceSelect: public QDialog, private Ui::QgsDbSourceSelectBa
     //!Sets a new regular expression to the model
     void setSearchExpression( const QString & regexp );
 
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/supported_data.html#spatialite-layers" ) ); }
 
   signals:
     void connectionsChanged();
diff --git a/src/providers/wms/qgswmssourceselect.h b/src/providers/wms/qgswmssourceselect.h
index 343218b64fc..6979a831522 100644
--- a/src/providers/wms/qgswmssourceselect.h
+++ b/src/providers/wms/qgswmssourceselect.h
@@ -20,7 +20,7 @@
 #include "ui_qgswmssourceselectbase.h"
 #include "qgsdatasourceuri.h"
 #include "qgisgui.h"
-#include "qgscontexthelp.h"
+#include "qgshelp.h"
 
 #include "qgswmsprovider.h"
 
@@ -95,7 +95,7 @@ class QgsWMSSourceSelect : public QDialog, private Ui::QgsWMSSourceSelectBase
     //! Add some default wms servers to the list
     void on_btnAddDefault_clicked();
 
-    void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
+    void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_ogc/ogc_client_support.html#id5" ) ); }
 
   private:
     //! Populate the connection list combo box