Skip to content

Commit 5753576

Browse files
committedJan 23, 2017
use new QgsHelp where possible instead of builtin context help
1 parent 6c55e68 commit 5753576

33 files changed

+64
-72
lines changed
 

‎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"

‎src/app/qgsmeasuredialog.h

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

2222
#include "qgspoint.h"
2323
#include "qgsdistancearea.h"
24-
#include "qgscontexthelp.h"
24+
#include "qgshelp.h"
2525
#include "qgis_app.h"
2626

2727
class QCloseEvent;
@@ -61,7 +61,7 @@ class APP_EXPORT QgsMeasureDialog : public QDialog, private Ui::QgsMeasureBase
6161
void closeEvent( QCloseEvent *e ) override;
6262

6363
//! Show the help for the dialog
64-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
64+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#id38" ) ); }
6565

6666
//! When any external settings change
6767
void updateSettings();

‎src/app/qgsnewspatialitelayerdialog.h

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

2020
#include "ui_qgsnewspatialitelayerdialogbase.h"
2121
#include "qgisgui.h"
22-
#include "qgscontexthelp.h"
22+
#include "qgshelp.h"
2323

2424
#include "qgis.h"
2525

@@ -48,7 +48,7 @@ class APP_EXPORT QgsNewSpatialiteLayerDialog: public QDialog, private Ui::QgsNew
4848
void selectionChanged();
4949
void checkOk();
5050

51-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
51+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/editing_geometry_attributes.html#vector-create-spatialite" ) ); }
5252
void on_buttonBox_accepted();
5353
void on_buttonBox_rejected();
5454

‎src/app/qgsoptions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "ui_qgsoptionsbase.h"
2323
#include "qgisgui.h"
2424
#include "qgisapp.h"
25-
#include "qgscontexthelp.h"
25+
#include "qgshelp.h"
2626

2727
#include <qgscoordinatereferencesystem.h>
2828

@@ -176,7 +176,7 @@ class APP_EXPORT QgsOptions : public QgsOptionsDialogBase, private Ui::QgsOption
176176
void on_mBtnRemoveHiddenPath_clicked();
177177

178178

179-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
179+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "introduction/qgis_configuration.html#options" ) ); }
180180

181181
void on_mBrowseCacheDirectory_clicked();
182182
void on_mClearCache_clicked();

‎src/app/qgsprojectproperties.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "qgis.h"
2323
#include "qgsunittypes.h"
2424
#include "qgisgui.h"
25-
#include "qgscontexthelp.h"
25+
#include "qgshelp.h"
2626
#include "qgis_app.h"
2727

2828
class QgsMapCanvas;
@@ -141,7 +141,7 @@ class APP_EXPORT QgsProjectProperties : public QgsOptionsDialogBase, private Ui:
141141
/*!
142142
* Slot to show the context help for this dialog
143143
*/
144-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
144+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "introduction/qgis_configuration.html#project-properties" ) ); }
145145

146146
void on_cbxProjectionEnabled_toggled( bool onFlyEnabled );
147147

‎src/app/qgsrasterlayerproperties.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "qgsoptionsdialogbase.h"
2323
#include "ui_qgsrasterlayerpropertiesbase.h"
2424
#include "qgisgui.h"
25-
#include "qgscontexthelp.h"
25+
#include "qgshelp.h"
2626
#include "qgsmaplayerstylemanager.h"
2727
#include "qgis_app.h"
2828

@@ -100,7 +100,7 @@ class APP_EXPORT QgsRasterLayerProperties : public QgsOptionsDialogBase, private
100100
//! Save a style when appriate button is pressed.
101101
void saveStyleAs_clicked();
102102
//! Help button
103-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
103+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_raster/raster_properties.html" ) ); }
104104

105105
//! Slot to reset all color rendering options to default
106106
void on_mResetColorRenderingBtn_clicked();

‎src/app/qgsvectorlayerproperties.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "qgsoptionsdialogbase.h"
2323
#include "ui_qgsvectorlayerpropertiesbase.h"
2424
#include "qgisgui.h"
25-
#include "qgscontexthelp.h"
25+
#include "qgshelp.h"
2626
#include "qgsmaplayerstylemanager.h"
2727
#include "qgsvectorlayer.h"
2828
#include "layertree/qgslayertreemodel.h"
@@ -104,7 +104,7 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
104104
void loadStyle_clicked();
105105
void saveStyleAs_clicked();
106106
void mOptionsStackedWidget_CurrentChanged( int indx );
107-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
107+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html" ) ); }
108108
void on_pbnUpdateExtents_clicked();
109109

110110
void on_mButtonAddJoin_clicked();

‎src/gui/qgsquerybuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <QModelIndex>
2222
#include "ui_qgsquerybuilderbase.h"
2323
#include "qgisgui.h"
24-
#include "qgscontexthelp.h"
24+
#include "qgshelp.h"
2525
#include "qgis_gui.h"
2626

2727
class QgsVectorLayer;
@@ -79,7 +79,7 @@ class GUI_EXPORT QgsQueryBuilder : public QDialog, private Ui::QgsQueryBuilderBa
7979
void on_btnNot_clicked();
8080
void on_btnOr_clicked();
8181

82-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
82+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#query-builder" ) ); }
8383

8484
/** Test the constructed sql statement to see if the vector layer data provider likes it.
8585
* The number of rows that would be returned is displayed in a message box.

‎src/gui/symbology-ng/qgsstylemanagerdialog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <QMenu>
2323

2424
#include "ui_qgsstylemanagerdialogbase.h"
25-
#include "qgscontexthelp.h"
25+
#include "qgshelp.h"
2626
#include "qgis_gui.h"
2727

2828
class QgsStyle;
@@ -58,7 +58,7 @@ class GUI_EXPORT QgsStyleManagerDialog : public QDialog, private Ui::QgsStyleMan
5858
//! called when the dialog is going to be closed
5959
void onFinished();
6060

61-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
61+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_vector/style_library.html#id2" ) ); }
6262

6363
void itemChanged( QStandardItem* item );
6464

‎src/plugins/coordinate_capture/coordinatecapturegui.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define CoordinateCaptureGUI_H
1414

1515
#include <QDialog>
16-
#include "qgscontexthelp.h"
16+
#include "qgshelp.h"
1717

1818
/**
1919
@author Tim Sutton
@@ -29,7 +29,7 @@ class CoordinateCaptureGui : public QDialog
2929
private slots:
3030
void on_buttonBox_accepted();
3131
void on_buttonBox_rejected();
32-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
32+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "plugins/plugins_coordinate_capture.html" ) ); }
3333
};
3434

3535
#endif

‎src/plugins/evis/databaseconnection/evisdatabaseconnectiongui.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "evisdatabaseconnection.h"
3232
#include "evisdatabaselayerfieldselectiongui.h"
3333
#include "evisquerydefinition.h"
34-
#include "qgscontexthelp.h"
34+
#include "qgshelp.h"
3535

3636
#include <QTemporaryFile>
3737
#include <QDialog>
@@ -72,7 +72,7 @@ class eVisDatabaseConnectionGui : public QDialog, private Ui::eVisDatabaseConnec
7272
void drawNewVectorLayer( const QString&, const QString&, const QString& );
7373

7474
void on_buttonBox_accepted();
75-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
75+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "plugins/plugins_evis.html#id11" ) ); }
7676

7777
void on_cboxDatabaseType_currentIndexChanged( int );
7878
void on_cboxPredefinedQueryList_currentIndexChanged( int );

‎src/plugins/gps_importer/qgsgpsplugingui.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "ui_qgsgpspluginguibase.h"
2222
#include "qgsbabelformat.h"
2323
#include "qgsgpsdevice.h"
24-
#include "qgscontexthelp.h"
24+
#include "qgshelp.h"
2525

2626
#include <vector>
2727

@@ -80,7 +80,7 @@ class QgsGPSPluginGui : public QDialog, private Ui::QgsGPSPluginGuiBase
8080
void on_pbnRefresh_clicked();
8181
void on_buttonBox_accepted();
8282
void on_buttonBox_rejected();
83-
void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
83+
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_gps/plugins_gps.html" ) ); }
8484

8585
signals:
8686
void drawRasterLayer( const QString& );

‎src/plugins/offline_editing/offline_editing_plugin_gui.cpp

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

1919
#include "offline_editing_plugin_gui.h"
2020

21-
#include "qgscontexthelp.h"
21+
#include "qgshelp.h"
2222
#include "qgslayertree.h"
2323
#include "qgslayertreemodel.h"
2424
#include "qgsmaplayer.h"
@@ -167,7 +167,7 @@ void QgsOfflineEditingPluginGui::on_buttonBox_rejected()
167167
// TODO: help
168168
void QgsOfflineEditingPluginGui::on_buttonBox_helpRequested()
169169
{
170-
QgsContextHelp::run( metaObject()->className() );
170+
QgsHelp::openHelp( QStringLiteral( "plugins/plugins_offline_editing.html" ) );
171171
}
172172

173173
void QgsOfflineEditingPluginGui::restoreState()

0 commit comments

Comments
 (0)
Please sign in to comment.