Skip to content

Commit 5753576

Browse files
committed
use new QgsHelp where possible instead of builtin context help
1 parent 6c55e68 commit 5753576

33 files changed

Lines changed: 64 additions & 72 deletions

‎src/app/ogr/qgsopenvectorlayerdialog.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include <ui_qgsopenvectorlayerdialogbase.h>
2323
#include <QDialog>
24-
#include "qgscontexthelp.h"
24+
#include "qgshelp.h"
2525

2626
/**
2727
* 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
8484
void on_btnDelete_clicked();
8585
void on_cmbDatabaseTypes_currentIndexChanged( const QString & text );
8686
void on_cmbConnections_currentIndexChanged( const QString & text );
87-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
87+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/supported_data.html#loading-a-layer-from-a-file" ) ); }
8888
};
8989

9090
#endif // QGSOPENVECTORDIALOG_H

‎src/app/pluginmanager/qgspluginmanager.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "ui_qgspluginmanagerbase.h"
2727
#include "qgsoptionsdialogbase.h"
2828
#include "qgisgui.h"
29-
#include "qgscontexthelp.h"
29+
#include "qgshelp.h"
3030
#include "qgsmessagebar.h"
3131
#include "qgspythonutils.h"
3232

@@ -156,7 +156,7 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag
156156
void on_ckbDeprecated_toggled( bool state );
157157

158158
//! Open help browser
159-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
159+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "plugins/plugins.html#the-plugins-dialog" ) ); }
160160

161161
//! Reimplement QgsOptionsDialogBase method to prevent modifying the tab list by signals from the stacked widget
162162
void optionsStackedWidget_CurrentChanged( int indx ) { Q_UNUSED( indx ) }

‎src/app/qgisapp.cpp‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@
246246
#include "qgstransaction.h"
247247
#include "qgstransactiongroup.h"
248248
#include "qgsvectorlayerutils.h"
249+
#include "qgshelp.h"
249250

250251
#include "qgssublayersdialog.h"
251252
#include "ogr/qgsopenvectorlayerdialog.h"
@@ -9311,15 +9312,7 @@ void QgisApp::adjustBrightnessContrast( int delta, bool updateBrightness )
93119312

93129313
void QgisApp::helpContents()
93139314
{
9314-
QSettings settings;
9315-
QString helpUrl = settings.value( QStringLiteral( "Qgis/docsUserManualUrl" ),
9316-
QStringLiteral( "https://docs.qgis.org/%1.%2/%3/docs/user_manual/" ) ).toString();
9317-
// We should really ship the HTML version of the docs local too.
9318-
openURL( helpUrl
9319-
.arg( Qgis::QGIS_VERSION_INT / 10000 )
9320-
.arg( Qgis::QGIS_VERSION_INT / 100 % 100 )
9321-
.arg( tr( "en", "documentation language" ) ),
9322-
false );
9315+
QgsHelp::openHelp( QStringLiteral( "index.html" ) );
93239316
}
93249317

93259318
void QgisApp::apiDocumentation()

‎src/app/qgscustomprojectiondialog.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define QGSCUSTOMCRSDIALOG_H
2020

2121
#include "ui_qgscustomprojectiondialogbase.h"
22-
#include "qgscontexthelp.h"
22+
#include "qgshelp.h"
2323
#include "qgscoordinatereferencesystem.h"
2424
#include "qgis_app.h"
2525

@@ -44,7 +44,7 @@ class APP_EXPORT QgsCustomProjectionDialog : public QDialog, private Ui::QgsCust
4444
void on_pbnCopyCRS_clicked();
4545
void on_leNameList_currentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *prev );
4646

47-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
47+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_projections/working_with_projections.html#custom-coordinate-reference-system" ) ); }
4848
void on_buttonBox_accepted();
4949

5050
private:

‎src/app/qgsdecorationcopyrightdialog.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "qgsdecorationcopyrightdialog.h"
1414
#include "qgsdecorationcopyright.h"
1515

16-
#include "qgscontexthelp.h"
16+
#include "qgshelp.h"
1717

1818
//qt includes
1919
#include <QColorDialog>
@@ -100,5 +100,5 @@ void QgsDecorationCopyrightDialog::apply()
100100

101101
void QgsDecorationCopyrightDialog::on_buttonBox_helpRequested()
102102
{
103-
QgsContextHelp::run( metaObject()->className() );
103+
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#id57" ) );
104104
}

‎src/app/qgsdecorationgriddialog.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "qgsdecorationgrid.h"
2121

2222
#include "qgslogger.h"
23-
#include "qgscontexthelp.h"
23+
#include "qgshelp.h"
2424
#include "qgsstyle.h"
2525
#include "qgssymbol.h"
2626
#include "qgssymbolselectordialog.h"
@@ -178,7 +178,7 @@ QgsDecorationGridDialog::~QgsDecorationGridDialog()
178178

179179
void QgsDecorationGridDialog::on_buttonBox_helpRequested()
180180
{
181-
QgsContextHelp::run( metaObject()->className() );
181+
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#id56" ) );
182182
}
183183

184184
void QgsDecorationGridDialog::on_buttonBox_accepted()

‎src/app/qgsdecorationnortharrowdialog.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "qgsdecorationnortharrowdialog.h"
1414
#include "qgsdecorationnortharrow.h"
1515
#include "qgslogger.h"
16-
#include "qgscontexthelp.h"
16+
#include "qgshelp.h"
1717

1818
#include <QPainter>
1919
#include <QSettings>
@@ -65,7 +65,7 @@ QgsDecorationNorthArrowDialog::~QgsDecorationNorthArrowDialog()
6565

6666
void QgsDecorationNorthArrowDialog::on_buttonBox_helpRequested()
6767
{
68-
QgsContextHelp::run( metaObject()->className() );
68+
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#north-arrow" ) );
6969
}
7070

7171
void QgsDecorationNorthArrowDialog::on_buttonBox_accepted()

‎src/app/qgsdecorationscalebardialog.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "qgsdecorationscalebardialog.h"
1414
#include "qgsdecorationscalebar.h"
1515
#include "qgslogger.h"
16-
#include "qgscontexthelp.h"
16+
#include "qgshelp.h"
1717

1818
#include <QColorDialog>
1919
#include <QSettings>
@@ -84,7 +84,7 @@ QgsDecorationScaleBarDialog::~QgsDecorationScaleBarDialog()
8484

8585
void QgsDecorationScaleBarDialog::on_buttonBox_helpRequested()
8686
{
87-
QgsContextHelp::run( metaObject()->className() );
87+
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#scale-bar" ) );
8888
}
8989

9090
void QgsDecorationScaleBarDialog::apply()

‎src/app/qgsidentifyresultsdialog.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define QGSIDENTIFYRESULTSDIALOG_H
2020

2121
#include "ui_qgsidentifyresultsbase.h"
22-
#include "qgscontexthelp.h"
22+
#include "qgshelp.h"
2323
#include "qgsfeature.h"
2424
#include "qgsfields.h"
2525
#include "qgscoordinatereferencesystem.h"
@@ -205,7 +205,7 @@ class APP_EXPORT QgsIdentifyResultsDialog: public QDialog, private Ui::QgsIdenti
205205

206206
QTreeWidgetItem *retrieveAttributes( QTreeWidgetItem *item, QgsAttributeMap &attributes, int &currentIdx );
207207

208-
void helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
208+
void helpRequested() { QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#identify" ) ); }
209209

210210
void on_cmbIdentifyMode_currentIndexChanged( int index );
211211

‎src/app/qgsmeasuredialog.cpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "qgsmeasuretool.h"
2020

2121
#include "qgslogger.h"
22-
#include "qgscontexthelp.h"
2322
#include "qgsdistancearea.h"
2423
#include "qgsmapcanvas.h"
2524
#include "qgsproject.h"

0 commit comments

Comments
 (0)