Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use new QgsHelp where possible instead of builtin context help
  • Loading branch information
alexbruy committed Jan 23, 2017
1 parent 6c55e68 commit 5753576
Show file tree
Hide file tree
Showing 33 changed files with 64 additions and 72 deletions.
4 changes: 2 additions & 2 deletions src/app/ogr/qgsopenvectorlayerdialog.h
Expand Up @@ -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
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/app/pluginmanager/qgspluginmanager.h
Expand Up @@ -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"

Expand Down Expand Up @@ -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 ) }
Expand Down
11 changes: 2 additions & 9 deletions src/app/qgisapp.cpp
Expand Up @@ -246,6 +246,7 @@
#include "qgstransaction.h"
#include "qgstransactiongroup.h"
#include "qgsvectorlayerutils.h"
#include "qgshelp.h"

#include "qgssublayersdialog.h"
#include "ogr/qgsopenvectorlayerdialog.h"
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgscustomprojectiondialog.h
Expand Up @@ -19,7 +19,7 @@
#define QGSCUSTOMCRSDIALOG_H

#include "ui_qgscustomprojectiondialogbase.h"
#include "qgscontexthelp.h"
#include "qgshelp.h"
#include "qgscoordinatereferencesystem.h"
#include "qgis_app.h"

Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsdecorationcopyrightdialog.cpp
Expand Up @@ -13,7 +13,7 @@
#include "qgsdecorationcopyrightdialog.h"
#include "qgsdecorationcopyright.h"

#include "qgscontexthelp.h"
#include "qgshelp.h"

//qt includes
#include <QColorDialog>
Expand Down Expand Up @@ -100,5 +100,5 @@ void QgsDecorationCopyrightDialog::apply()

void QgsDecorationCopyrightDialog::on_buttonBox_helpRequested()
{
QgsContextHelp::run( metaObject()->className() );
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#id57" ) );
}
4 changes: 2 additions & 2 deletions src/app/qgsdecorationgriddialog.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsdecorationnortharrowdialog.cpp
Expand Up @@ -13,7 +13,7 @@
#include "qgsdecorationnortharrowdialog.h"
#include "qgsdecorationnortharrow.h"
#include "qgslogger.h"
#include "qgscontexthelp.h"
#include "qgshelp.h"

#include <QPainter>
#include <QSettings>
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsdecorationscalebardialog.cpp
Expand Up @@ -13,7 +13,7 @@
#include "qgsdecorationscalebardialog.h"
#include "qgsdecorationscalebar.h"
#include "qgslogger.h"
#include "qgscontexthelp.h"
#include "qgshelp.h"

#include <QColorDialog>
#include <QSettings>
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsidentifyresultsdialog.h
Expand Up @@ -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"
Expand Down Expand Up @@ -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 );

Expand Down
1 change: 0 additions & 1 deletion src/app/qgsmeasuredialog.cpp
Expand Up @@ -19,7 +19,6 @@
#include "qgsmeasuretool.h"

#include "qgslogger.h"
#include "qgscontexthelp.h"
#include "qgsdistancearea.h"
#include "qgsmapcanvas.h"
#include "qgsproject.h"
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsmeasuredialog.h
Expand Up @@ -21,7 +21,7 @@

#include "qgspoint.h"
#include "qgsdistancearea.h"
#include "qgscontexthelp.h"
#include "qgshelp.h"
#include "qgis_app.h"

class QCloseEvent;
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsnewspatialitelayerdialog.h
Expand Up @@ -19,7 +19,7 @@

#include "ui_qgsnewspatialitelayerdialogbase.h"
#include "qgisgui.h"
#include "qgscontexthelp.h"
#include "qgshelp.h"

#include "qgis.h"

Expand Down Expand Up @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsoptions.h
Expand Up @@ -22,7 +22,7 @@
#include "ui_qgsoptionsbase.h"
#include "qgisgui.h"
#include "qgisapp.h"
#include "qgscontexthelp.h"
#include "qgshelp.h"

#include <qgscoordinatereferencesystem.h>

Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsprojectproperties.h
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );

Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsrasterlayerproperties.h
Expand Up @@ -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"

Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsvectorlayerproperties.h
Expand Up @@ -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"
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsquerybuilder.h
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/gui/symbology-ng/qgsstylemanagerdialog.h
Expand Up @@ -22,7 +22,7 @@
#include <QMenu>

#include "ui_qgsstylemanagerdialogbase.h"
#include "qgscontexthelp.h"
#include "qgshelp.h"
#include "qgis_gui.h"

class QgsStyle;
Expand Down Expand Up @@ -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 );

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/coordinate_capture/coordinatecapturegui.h
Expand Up @@ -13,7 +13,7 @@
#define CoordinateCaptureGUI_H

#include <QDialog>
#include "qgscontexthelp.h"
#include "qgshelp.h"

/**
@author Tim Sutton
Expand All @@ -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
Expand Up @@ -31,7 +31,7 @@
#include "evisdatabaseconnection.h"
#include "evisdatabaselayerfieldselectiongui.h"
#include "evisquerydefinition.h"
#include "qgscontexthelp.h"
#include "qgshelp.h"

#include <QTemporaryFile>
#include <QDialog>
Expand Down Expand Up @@ -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 );
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/gps_importer/qgsgpsplugingui.h
Expand Up @@ -21,7 +21,7 @@
#include "ui_qgsgpspluginguibase.h"
#include "qgsbabelformat.h"
#include "qgsgpsdevice.h"
#include "qgscontexthelp.h"
#include "qgshelp.h"

#include <vector>

Expand Down Expand Up @@ -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& );
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/offline_editing/offline_editing_plugin_gui.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 5753576

Please sign in to comment.