Skip to content

Commit 9f18050

Browse files
DelazJm-kuhn
authored andcommitted
Filling the help infrastructure (#5064)
* Filling the help infrastructure Add missing help button and links to user manual * Remove unneeded comment * remove unneeded comment * Remove unneeded comment
1 parent 0dbf432 commit 9f18050

33 files changed

+185
-96
lines changed

src/app/dwg/qgsdwgimportdialog.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ QgsDwgImportDialog::QgsDwgImportDialog( QWidget *parent, Qt::WindowFlags f )
6464
: QDialog( parent, f )
6565
{
6666
setupUi( this );
67+
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDwgImportDialog::showHelp );
6768

6869
QgsSettings s;
6970
leDatabase->setText( s.value( "/DwgImport/lastDatabase", "" ).toString() );
@@ -478,3 +479,8 @@ void QgsDwgImportDialog::on_buttonBox_accepted()
478479
dwgGroup->setExpanded( false );
479480
}
480481
}
482+
483+
void QgsDwgImportDialog::showHelp()
484+
{
485+
QgsHelp::openHelp( QStringLiteral( "managing_data_source/opening_data.html#importing-a-dxf-or-dwg-file" ) );
486+
}

src/app/dwg/qgsdwgimportdialog.h

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#define QGSDWGIMPORTDIALOG_H
2020

2121
#include "ui_qgsdwgimportbase.h"
22+
#include "qgshelp.h"
2223

2324
class QgsVectorLayer;
2425
class QgsLayerTreeGroup;
@@ -40,6 +41,7 @@ class QgsDwgImportDialog : public QDialog, private Ui::QgsDwgImportBase
4041
void on_pbDeselectAll_clicked();
4142
void on_leDatabase_textChanged( const QString &text );
4243
void on_leLayerGroup_textChanged( const QString &text );
44+
void showHelp();
4345

4446
private:
4547
QgsVectorLayer *layer( QgsLayerTreeGroup *layerGroup, QString layer, QString table );

src/app/qgsalignrasterdialog.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ QgsAlignRasterDialog::QgsAlignRasterDialog( QWidget *parent )
108108
// TODO: auto-detect reference layer
109109

110110
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsAlignRasterDialog::runAlign );
111+
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsAlignRasterDialog::showHelp );
111112

112113
populateLayersView();
113114

@@ -122,6 +123,12 @@ QgsAlignRasterDialog::~QgsAlignRasterDialog()
122123
}
123124

124125

126+
void QgsAlignRasterDialog::showHelp()
127+
{
128+
QgsHelp::openHelp( QStringLiteral( "working_with_raster/raster_analysis.html#raster-alignment" ) );
129+
}
130+
131+
125132
void QgsAlignRasterDialog::populateLayersView()
126133
{
127134
mCboReferenceLayer->clear();

src/app/qgsalignrasterdialog.h

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include <QDialog>
1919
#include "qgsalignraster.h"
20+
#include "qgshelp.h"
2021
#include "ui_qgsalignrasterdialog.h"
2122

2223
class QgsAlignRaster;
@@ -49,6 +50,7 @@ class QgsAlignRasterDialog : public QDialog, private Ui::QgsAlignRasterDialog
4950
void updateCustomGridOffset();
5051

5152
void updateParametersFromReferenceLayer();
53+
void showHelp();
5254

5355
protected:
5456
void populateLayersView();

src/app/qgsattributeactionpropertiesdialog.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -212,5 +212,12 @@ void QgsAttributeActionPropertiesDialog::init( const QSet<QString> &actionScopes
212212
connect( mActionText, &QsciScintilla::textChanged, this, &QgsAttributeActionPropertiesDialog::updateButtons );
213213
connect( mChooseIconButton, &QAbstractButton::clicked, this, &QgsAttributeActionPropertiesDialog::chooseIcon );
214214

215+
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsAttributeActionPropertiesDialog::showHelp );
216+
215217
updateButtons();
216218
}
219+
220+
void QgsAttributeActionPropertiesDialog::showHelp()
221+
{
222+
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#actions-properties" ) );
223+
}

src/app/qgsattributeactionpropertiesdialog.h

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "ui_qgsattributeactionpropertiesdialogbase.h"
2020

2121
#include "qgsaction.h"
22+
#include "qgshelp.h"
2223

2324
#include <QDialog>
2425

@@ -52,6 +53,7 @@ class QgsAttributeActionPropertiesDialog: public QDialog, private Ui::QgsAttribu
5253
void insertExpressionOrField();
5354
void chooseIcon();
5455
void updateButtons();
56+
void showHelp();
5557

5658
private:
5759
void init( const QSet<QString> &actionScopes );

src/app/qgsattributetypedialog.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl, int fieldIdx
9393
restoreGeometry( settings.value( QStringLiteral( "Windows/QgsAttributeTypeDialog/geometry" ) ).toByteArray() );
9494

9595
constraintExpressionWidget->setLayer( vl );
96+
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsAttributeTypeDialog::showHelp );
9697
}
9798

9899
QgsAttributeTypeDialog::~QgsAttributeTypeDialog()
@@ -371,3 +372,8 @@ void QgsAttributeTypeDialog::defaultExpressionChanged()
371372

372373
mDefaultPreviewLabel->setText( "<i>" + previewText + "</i>" );
373374
}
375+
376+
void QgsAttributeTypeDialog::showHelp()
377+
{
378+
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#configure-the-field-behavior" ) );
379+
}

src/app/qgsattributetypedialog.h

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "qgseditorconfigwidget.h"
2323
#include "qgsfeature.h"
2424
#include "qgsvectordataprovider.h"
25+
#include "qgshelp.h"
2526
#include "qgis_app.h"
2627

2728
class QDialog;
@@ -175,6 +176,8 @@ class APP_EXPORT QgsAttributeTypeDialog: public QDialog, private Ui::QgsAttribut
175176

176177
void defaultExpressionChanged();
177178

179+
void showHelp();
180+
178181
private:
179182
QgsVectorLayer *mLayer = nullptr;
180183
int mFieldIdx;

src/app/qgscustomization.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ QgsCustomizationDialog::QgsCustomizationDialog( QWidget * parent, QSettings * se
6262
connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::apply );
6363
connect( buttonBox->button( QDialogButtonBox::Cancel ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::cancel );
6464
connect( buttonBox->button( QDialogButtonBox::Reset ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::reset );
65+
connect( buttonBox->button( QDialogButtonBox::Help ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::showHelp );
6566

6667
}
6768

@@ -483,6 +484,12 @@ bool QgsCustomizationDialog::catchOn()
483484
return actionCatch->isChecked();
484485
}
485486

487+
void QgsCustomizationDialog::showHelp()
488+
{
489+
QgsHelp::openHelp( QStringLiteral( "introduction/qgis_configuration.html#customization" ) );
490+
}
491+
492+
486493
void QgsCustomization::addTreeItemActions( QTreeWidgetItem *parentItem, const QList<QAction *> &actions )
487494
{
488495
Q_FOREACH ( QAction *action, actions )

src/app/qgscustomization.h

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define QGSCUSTOMIZATION_H
1919

2020
#include "ui_qgscustomizationdialogbase.h"
21+
#include "qgshelp.h"
2122

2223
#include <QDialog>
2324
#include <QDomNode>
@@ -77,6 +78,8 @@ class APP_EXPORT QgsCustomizationDialog : public QMainWindow, private Ui::QgsCus
7778

7879
void cancel();
7980

81+
void showHelp();
82+
8083
// Reset values from settings
8184
void reset();
8285

src/app/qgsdecorationlayoutextentdialog.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ QgsDecorationLayoutExtentDialog::QgsDecorationLayoutExtentDialog( QgsDecorationL
4242

4343
updateGuiElements();
4444
connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsDecorationLayoutExtentDialog::apply );
45+
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDecorationLayoutExtentDialog::showHelp );
4546

4647
mSymbolButton->setMapCanvas( QgisApp::instance()->mapCanvas() );
4748
}
@@ -84,3 +85,8 @@ void QgsDecorationLayoutExtentDialog::on_buttonBox_rejected()
8485
{
8586
reject();
8687
}
88+
89+
void QgsDecorationLayoutExtentDialog::showHelp()
90+
{
91+
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#decorations" ) );
92+
}

src/app/qgsdecorationlayoutextentdialog.h

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <QDialog>
2222
#include "qgis_app.h"
2323
#include "qgstextrenderer.h"
24+
#include "qgshelp.h"
2425
#include <memory>
2526

2627
class QgsDecorationLayoutExtent;
@@ -38,6 +39,7 @@ class APP_EXPORT QgsDecorationLayoutExtentDialog : public QDialog, private Ui::Q
3839
void apply();
3940
void on_buttonBox_accepted();
4041
void on_buttonBox_rejected();
42+
void showHelp();
4143

4244

4345
private:

src/app/qgsdxfexportdialog.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ QgsDxfExportDialog::QgsDxfExportDialog( QWidget *parent, Qt::WindowFlags f )
444444
connect( this, &QDialog::accepted, this, &QgsDxfExportDialog::saveSettings );
445445
connect( mSelectAllButton, &QAbstractButton::clicked, this, &QgsDxfExportDialog::selectAll );
446446
connect( mDeselectAllButton, &QAbstractButton::clicked, this, &QgsDxfExportDialog::deSelectAll );
447+
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDxfExportDialog::showHelp );
447448

448449
mFileLineEdit->setFocus();
449450

@@ -647,3 +648,7 @@ QString QgsDxfExportDialog::mapTheme() const
647648
{
648649
return mVisibilityPresets->currentText();
649650
}
651+
void QgsDxfExportDialog::showHelp()
652+
{
653+
QgsHelp::openHelp( QStringLiteral( "managing_data_source/create_layers.html#create-dxf-files" ) );
654+
}

src/app/qgsdxfexportdialog.h

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "ui_qgsdxfexportdialogbase.h"
2222
#include "qgslayertreemodel.h"
2323
#include "qgsdxfexport.h"
24+
#include "qgshelp.h"
2425

2526
#include <QList>
2627
#include <QPair>
@@ -102,6 +103,7 @@ class QgsDxfExportDialog : public QDialog, private Ui::QgsDxfExportDialogBase
102103
void saveSettings();
103104
void on_mVisibilityPresets_currentIndexChanged( int index );
104105
void on_mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
106+
void showHelp();
105107

106108
private:
107109
void cleanGroup( QgsLayerTreeNode *node );

src/app/qgsmapsavedialog.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ QgsMapSaveDialog::QgsMapSaveDialog( QWidget *parent, QgsMapCanvas *mapCanvas, QL
119119
}
120120

121121
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsMapSaveDialog::accepted );
122+
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsMapSaveDialog::showHelp );
122123
}
123124

124125
void QgsMapSaveDialog::updateDpi( int dpi )
@@ -459,3 +460,8 @@ void QgsMapSaveDialog::accepted()
459460
}
460461
}
461462
}
463+
464+
void QgsMapSaveDialog::showHelp()
465+
{
466+
QgsHelp::openHelp( QStringLiteral( "introduction/getting_started.html#output" ) );
467+
}

src/app/qgsmapsavedialog.h

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "qgsmapcanvas.h"
2525
#include "qgsmapdecoration.h"
2626
#include "qgsrectangle.h"
27+
#include "qgshelp.h"
2728

2829
#include <QDialog>
2930
#include <QSize>
@@ -97,6 +98,9 @@ class APP_EXPORT QgsMapSaveDialog: public QDialog, private Ui::QgsMapSaveDialog
9798
int mDpi;
9899
QSize mSize;
99100

101+
private slots:
102+
103+
void showHelp();
100104
};
101105

102106
#endif // QGSMAPSAVEDIALOG_H

src/app/qgsprojectlayergroupdialog.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ QgsProjectLayerGroupDialog::QgsProjectLayerGroupDialog( QWidget *parent, const Q
4747
}
4848

4949
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
50+
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsProjectLayerGroupDialog::showHelp );
5051
}
5152

5253
QgsProjectLayerGroupDialog::~QgsProjectLayerGroupDialog()
@@ -233,3 +234,9 @@ void QgsProjectLayerGroupDialog::on_mButtonBox_accepted()
233234
}
234235
accept();
235236
}
237+
238+
void QgsProjectLayerGroupDialog::showHelp()
239+
{
240+
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#nesting-projects" ) );
241+
242+
}

src/app/qgsprojectlayergroupdialog.h

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include "QDialog"
1919
#include "ui_qgsprojectlayergroupdialogbase.h"
20+
#include "qgshelp.h"
2021
#include "qgis_app.h"
2122

2223
class QDomElement;
@@ -44,6 +45,7 @@ class APP_EXPORT QgsProjectLayerGroupDialog: public QDialog, private Ui::QgsProj
4445
void on_mProjectFileLineEdit_editingFinished();
4546
void onTreeViewSelectionChanged();
4647
void on_mButtonBox_accepted();
48+
void showHelp();
4749

4850
private:
4951
void changeProjectFile();

src/app/qgsrastercalcdialog.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
QgsRasterCalcDialog::QgsRasterCalcDialog( QWidget *parent, Qt::WindowFlags f ): QDialog( parent, f )
3131
{
3232
setupUi( this );
33+
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsRasterCalcDialog::showHelp );
3334

3435
QgsSettings settings;
3536
restoreGeometry( settings.value( QStringLiteral( "Windows/RasterCalc/geometry" ) ).toByteArray() );
@@ -224,6 +225,11 @@ void QgsRasterCalcDialog::on_mButtonBox_accepted()
224225
s.setValue( QStringLiteral( "/RasterCalculator/lastOutputDir" ), QVariant( QFileInfo( mOutputLayerLineEdit->text() ).absolutePath() ) );
225226
}
226227

228+
void QgsRasterCalcDialog::showHelp()
229+
{
230+
QgsHelp::openHelp( QStringLiteral( "working_with_raster/raster_analysis.html#raster-calculator" ) );
231+
}
232+
227233
void QgsRasterCalcDialog::on_mOutputLayerPushButton_clicked()
228234
{
229235
QgsSettings s;

src/app/qgsrastercalcdialog.h

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#include "ui_qgsrastercalcdialogbase.h"
2222
#include "qgsrastercalculator.h"
23+
#include "qgshelp.h"
2324
#include "qgis_app.h"
2425

2526
//! A dialog to enter a raster calculation expression
@@ -54,6 +55,7 @@ class APP_EXPORT QgsRasterCalcDialog: public QDialog, private Ui::QgsRasterCalcD
5455
void on_mOutputLayerLineEdit_textChanged( const QString &text );
5556
//! Enables OK button if calculator expression is valid and output file path exists
5657
void setAcceptButtonState();
58+
void showHelp();
5759

5860
//calculator buttons
5961
void on_mPlusPushButton_clicked();

src/gui/qgsconfigureshortcutsdialog.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ QgsConfigureShortcutsDialog::QgsConfigureShortcutsDialog( QWidget *parent, QgsSh
4141
if ( !mManager )
4242
mManager = QgsGui::shortcutsManager();
4343

44+
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsConfigureShortcutsDialog::showHelp ); // Vérifier nommage des boutons
4445
connect( btnChangeShortcut, &QAbstractButton::clicked, this, &QgsConfigureShortcutsDialog::changeShortcut );
4546
connect( btnResetShortcut, &QAbstractButton::clicked, this, &QgsConfigureShortcutsDialog::resetShortcut );
4647
connect( btnSetNoShortcut, &QAbstractButton::clicked, this, &QgsConfigureShortcutsDialog::setNoShortcut );
@@ -491,3 +492,8 @@ void QgsConfigureShortcutsDialog::on_mLeFilter_textChanged( const QString &text
491492
}
492493
}
493494
}
495+
496+
void QgsConfigureShortcutsDialog::showHelp()
497+
{
498+
QgsHelp::openHelp( QStringLiteral( "introduction/qgis_configuration.html#keyboard-shortcuts" ) );
499+
}

src/gui/qgsconfigureshortcutsdialog.h

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "qgis.h"
2121

2222
#include "ui_qgsconfigureshortcutsdialog.h"
23+
#include "qgshelp.h"
2324
#include "qgis_gui.h"
2425

2526
class QShortcut;
@@ -60,6 +61,9 @@ class GUI_EXPORT QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsCo
6061

6162
void actionChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous );
6263

64+
//! Open the associated help
65+
void showHelp();
66+
6367
private:
6468

6569
//! Saves the dialog window state

0 commit comments

Comments
 (0)