Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DelazJ authored and m-kuhn committed Aug 24, 2017
1 parent 0dbf432 commit 9f18050
Show file tree
Hide file tree
Showing 33 changed files with 185 additions and 96 deletions.
6 changes: 6 additions & 0 deletions src/app/dwg/qgsdwgimportdialog.cpp
Expand Up @@ -64,6 +64,7 @@ QgsDwgImportDialog::QgsDwgImportDialog( QWidget *parent, Qt::WindowFlags f )
: QDialog( parent, f )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDwgImportDialog::showHelp );

QgsSettings s;
leDatabase->setText( s.value( "/DwgImport/lastDatabase", "" ).toString() );
Expand Down Expand Up @@ -478,3 +479,8 @@ void QgsDwgImportDialog::on_buttonBox_accepted()
dwgGroup->setExpanded( false );
}
}

void QgsDwgImportDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "managing_data_source/opening_data.html#importing-a-dxf-or-dwg-file" ) );
}
2 changes: 2 additions & 0 deletions src/app/dwg/qgsdwgimportdialog.h
Expand Up @@ -19,6 +19,7 @@
#define QGSDWGIMPORTDIALOG_H

#include "ui_qgsdwgimportbase.h"
#include "qgshelp.h"

class QgsVectorLayer;
class QgsLayerTreeGroup;
Expand All @@ -40,6 +41,7 @@ class QgsDwgImportDialog : public QDialog, private Ui::QgsDwgImportBase
void on_pbDeselectAll_clicked();
void on_leDatabase_textChanged( const QString &text );
void on_leLayerGroup_textChanged( const QString &text );
void showHelp();

private:
QgsVectorLayer *layer( QgsLayerTreeGroup *layerGroup, QString layer, QString table );
Expand Down
7 changes: 7 additions & 0 deletions src/app/qgsalignrasterdialog.cpp
Expand Up @@ -108,6 +108,7 @@ QgsAlignRasterDialog::QgsAlignRasterDialog( QWidget *parent )
// TODO: auto-detect reference layer

connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsAlignRasterDialog::runAlign );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsAlignRasterDialog::showHelp );

populateLayersView();

Expand All @@ -122,6 +123,12 @@ QgsAlignRasterDialog::~QgsAlignRasterDialog()
}


void QgsAlignRasterDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_raster/raster_analysis.html#raster-alignment" ) );
}


void QgsAlignRasterDialog::populateLayersView()
{
mCboReferenceLayer->clear();
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsalignrasterdialog.h
Expand Up @@ -17,6 +17,7 @@

#include <QDialog>
#include "qgsalignraster.h"
#include "qgshelp.h"
#include "ui_qgsalignrasterdialog.h"

class QgsAlignRaster;
Expand Down Expand Up @@ -49,6 +50,7 @@ class QgsAlignRasterDialog : public QDialog, private Ui::QgsAlignRasterDialog
void updateCustomGridOffset();

void updateParametersFromReferenceLayer();
void showHelp();

protected:
void populateLayersView();
Expand Down
7 changes: 7 additions & 0 deletions src/app/qgsattributeactionpropertiesdialog.cpp
Expand Up @@ -212,5 +212,12 @@ void QgsAttributeActionPropertiesDialog::init( const QSet<QString> &actionScopes
connect( mActionText, &QsciScintilla::textChanged, this, &QgsAttributeActionPropertiesDialog::updateButtons );
connect( mChooseIconButton, &QAbstractButton::clicked, this, &QgsAttributeActionPropertiesDialog::chooseIcon );

connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsAttributeActionPropertiesDialog::showHelp );

updateButtons();
}

void QgsAttributeActionPropertiesDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#actions-properties" ) );
}
2 changes: 2 additions & 0 deletions src/app/qgsattributeactionpropertiesdialog.h
Expand Up @@ -19,6 +19,7 @@
#include "ui_qgsattributeactionpropertiesdialogbase.h"

#include "qgsaction.h"
#include "qgshelp.h"

#include <QDialog>

Expand Down Expand Up @@ -52,6 +53,7 @@ class QgsAttributeActionPropertiesDialog: public QDialog, private Ui::QgsAttribu
void insertExpressionOrField();
void chooseIcon();
void updateButtons();
void showHelp();

private:
void init( const QSet<QString> &actionScopes );
Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsattributetypedialog.cpp
Expand Up @@ -93,6 +93,7 @@ QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl, int fieldIdx
restoreGeometry( settings.value( QStringLiteral( "Windows/QgsAttributeTypeDialog/geometry" ) ).toByteArray() );

constraintExpressionWidget->setLayer( vl );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsAttributeTypeDialog::showHelp );
}

QgsAttributeTypeDialog::~QgsAttributeTypeDialog()
Expand Down Expand Up @@ -371,3 +372,8 @@ void QgsAttributeTypeDialog::defaultExpressionChanged()

mDefaultPreviewLabel->setText( "<i>" + previewText + "</i>" );
}

void QgsAttributeTypeDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#configure-the-field-behavior" ) );
}
3 changes: 3 additions & 0 deletions src/app/qgsattributetypedialog.h
Expand Up @@ -22,6 +22,7 @@
#include "qgseditorconfigwidget.h"
#include "qgsfeature.h"
#include "qgsvectordataprovider.h"
#include "qgshelp.h"
#include "qgis_app.h"

class QDialog;
Expand Down Expand Up @@ -175,6 +176,8 @@ class APP_EXPORT QgsAttributeTypeDialog: public QDialog, private Ui::QgsAttribut

void defaultExpressionChanged();

void showHelp();

private:
QgsVectorLayer *mLayer = nullptr;
int mFieldIdx;
Expand Down
7 changes: 7 additions & 0 deletions src/app/qgscustomization.cpp
Expand Up @@ -62,6 +62,7 @@ QgsCustomizationDialog::QgsCustomizationDialog( QWidget * parent, QSettings * se
connect( buttonBox->button( QDialogButtonBox::Apply ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::apply );
connect( buttonBox->button( QDialogButtonBox::Cancel ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::cancel );
connect( buttonBox->button( QDialogButtonBox::Reset ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::reset );
connect( buttonBox->button( QDialogButtonBox::Help ), &QAbstractButton::clicked, this, &QgsCustomizationDialog::showHelp );

}

Expand Down Expand Up @@ -483,6 +484,12 @@ bool QgsCustomizationDialog::catchOn()
return actionCatch->isChecked();
}

void QgsCustomizationDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/qgis_configuration.html#customization" ) );
}


void QgsCustomization::addTreeItemActions( QTreeWidgetItem *parentItem, const QList<QAction *> &actions )
{
Q_FOREACH ( QAction *action, actions )
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgscustomization.h
Expand Up @@ -18,6 +18,7 @@
#define QGSCUSTOMIZATION_H

#include "ui_qgscustomizationdialogbase.h"
#include "qgshelp.h"

#include <QDialog>
#include <QDomNode>
Expand Down Expand Up @@ -77,6 +78,8 @@ class APP_EXPORT QgsCustomizationDialog : public QMainWindow, private Ui::QgsCus

void cancel();

void showHelp();

// Reset values from settings
void reset();

Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsdecorationlayoutextentdialog.cpp
Expand Up @@ -42,6 +42,7 @@ QgsDecorationLayoutExtentDialog::QgsDecorationLayoutExtentDialog( QgsDecorationL

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

mSymbolButton->setMapCanvas( QgisApp::instance()->mapCanvas() );
}
Expand Down Expand Up @@ -84,3 +85,8 @@ void QgsDecorationLayoutExtentDialog::on_buttonBox_rejected()
{
reject();
}

void QgsDecorationLayoutExtentDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#decorations" ) );
}
2 changes: 2 additions & 0 deletions src/app/qgsdecorationlayoutextentdialog.h
Expand Up @@ -21,6 +21,7 @@
#include <QDialog>
#include "qgis_app.h"
#include "qgstextrenderer.h"
#include "qgshelp.h"
#include <memory>

class QgsDecorationLayoutExtent;
Expand All @@ -38,6 +39,7 @@ class APP_EXPORT QgsDecorationLayoutExtentDialog : public QDialog, private Ui::Q
void apply();
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void showHelp();


private:
Expand Down
5 changes: 5 additions & 0 deletions src/app/qgsdxfexportdialog.cpp
Expand Up @@ -444,6 +444,7 @@ QgsDxfExportDialog::QgsDxfExportDialog( QWidget *parent, Qt::WindowFlags f )
connect( this, &QDialog::accepted, this, &QgsDxfExportDialog::saveSettings );
connect( mSelectAllButton, &QAbstractButton::clicked, this, &QgsDxfExportDialog::selectAll );
connect( mDeselectAllButton, &QAbstractButton::clicked, this, &QgsDxfExportDialog::deSelectAll );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDxfExportDialog::showHelp );

mFileLineEdit->setFocus();

Expand Down Expand Up @@ -647,3 +648,7 @@ QString QgsDxfExportDialog::mapTheme() const
{
return mVisibilityPresets->currentText();
}
void QgsDxfExportDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "managing_data_source/create_layers.html#create-dxf-files" ) );
}
2 changes: 2 additions & 0 deletions src/app/qgsdxfexportdialog.h
Expand Up @@ -21,6 +21,7 @@
#include "ui_qgsdxfexportdialogbase.h"
#include "qgslayertreemodel.h"
#include "qgsdxfexport.h"
#include "qgshelp.h"

#include <QList>
#include <QPair>
Expand Down Expand Up @@ -102,6 +103,7 @@ class QgsDxfExportDialog : public QDialog, private Ui::QgsDxfExportDialogBase
void saveSettings();
void on_mVisibilityPresets_currentIndexChanged( int index );
void on_mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
void showHelp();

private:
void cleanGroup( QgsLayerTreeNode *node );
Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsmapsavedialog.cpp
Expand Up @@ -119,6 +119,7 @@ QgsMapSaveDialog::QgsMapSaveDialog( QWidget *parent, QgsMapCanvas *mapCanvas, QL
}

connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsMapSaveDialog::accepted );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsMapSaveDialog::showHelp );
}

void QgsMapSaveDialog::updateDpi( int dpi )
Expand Down Expand Up @@ -459,3 +460,8 @@ void QgsMapSaveDialog::accepted()
}
}
}

void QgsMapSaveDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/getting_started.html#output" ) );
}
4 changes: 4 additions & 0 deletions src/app/qgsmapsavedialog.h
Expand Up @@ -24,6 +24,7 @@
#include "qgsmapcanvas.h"
#include "qgsmapdecoration.h"
#include "qgsrectangle.h"
#include "qgshelp.h"

#include <QDialog>
#include <QSize>
Expand Down Expand Up @@ -97,6 +98,9 @@ class APP_EXPORT QgsMapSaveDialog: public QDialog, private Ui::QgsMapSaveDialog
int mDpi;
QSize mSize;

private slots:

void showHelp();
};

#endif // QGSMAPSAVEDIALOG_H
7 changes: 7 additions & 0 deletions src/app/qgsprojectlayergroupdialog.cpp
Expand Up @@ -47,6 +47,7 @@ QgsProjectLayerGroupDialog::QgsProjectLayerGroupDialog( QWidget *parent, const Q
}

connect( mButtonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsProjectLayerGroupDialog::showHelp );
}

QgsProjectLayerGroupDialog::~QgsProjectLayerGroupDialog()
Expand Down Expand Up @@ -233,3 +234,9 @@ void QgsProjectLayerGroupDialog::on_mButtonBox_accepted()
}
accept();
}

void QgsProjectLayerGroupDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#nesting-projects" ) );

}
2 changes: 2 additions & 0 deletions src/app/qgsprojectlayergroupdialog.h
Expand Up @@ -17,6 +17,7 @@

#include "QDialog"
#include "ui_qgsprojectlayergroupdialogbase.h"
#include "qgshelp.h"
#include "qgis_app.h"

class QDomElement;
Expand Down Expand Up @@ -44,6 +45,7 @@ class APP_EXPORT QgsProjectLayerGroupDialog: public QDialog, private Ui::QgsProj
void on_mProjectFileLineEdit_editingFinished();
void onTreeViewSelectionChanged();
void on_mButtonBox_accepted();
void showHelp();

private:
void changeProjectFile();
Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsrastercalcdialog.cpp
Expand Up @@ -30,6 +30,7 @@
QgsRasterCalcDialog::QgsRasterCalcDialog( QWidget *parent, Qt::WindowFlags f ): QDialog( parent, f )
{
setupUi( this );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsRasterCalcDialog::showHelp );

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

void QgsRasterCalcDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_raster/raster_analysis.html#raster-calculator" ) );
}

void QgsRasterCalcDialog::on_mOutputLayerPushButton_clicked()
{
QgsSettings s;
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgsrastercalcdialog.h
Expand Up @@ -20,6 +20,7 @@

#include "ui_qgsrastercalcdialogbase.h"
#include "qgsrastercalculator.h"
#include "qgshelp.h"
#include "qgis_app.h"

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

//calculator buttons
void on_mPlusPushButton_clicked();
Expand Down
6 changes: 6 additions & 0 deletions src/gui/qgsconfigureshortcutsdialog.cpp
Expand Up @@ -41,6 +41,7 @@ QgsConfigureShortcutsDialog::QgsConfigureShortcutsDialog( QWidget *parent, QgsSh
if ( !mManager )
mManager = QgsGui::shortcutsManager();

connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsConfigureShortcutsDialog::showHelp ); // Vérifier nommage des boutons
connect( btnChangeShortcut, &QAbstractButton::clicked, this, &QgsConfigureShortcutsDialog::changeShortcut );
connect( btnResetShortcut, &QAbstractButton::clicked, this, &QgsConfigureShortcutsDialog::resetShortcut );
connect( btnSetNoShortcut, &QAbstractButton::clicked, this, &QgsConfigureShortcutsDialog::setNoShortcut );
Expand Down Expand Up @@ -491,3 +492,8 @@ void QgsConfigureShortcutsDialog::on_mLeFilter_textChanged( const QString &text
}
}
}

void QgsConfigureShortcutsDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/qgis_configuration.html#keyboard-shortcuts" ) );
}
4 changes: 4 additions & 0 deletions src/gui/qgsconfigureshortcutsdialog.h
Expand Up @@ -20,6 +20,7 @@
#include "qgis.h"

#include "ui_qgsconfigureshortcutsdialog.h"
#include "qgshelp.h"
#include "qgis_gui.h"

class QShortcut;
Expand Down Expand Up @@ -60,6 +61,9 @@ class GUI_EXPORT QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsCo

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

//! Open the associated help
void showHelp();

private:

//! Saves the dialog window state
Expand Down

0 comments on commit 9f18050

Please sign in to comment.