Skip to content

Commit

Permalink
Add Help button and connect it to user manual
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ authored and m-kuhn committed Sep 2, 2017
1 parent 8e12757 commit f51244c
Show file tree
Hide file tree
Showing 51 changed files with 250 additions and 62 deletions.
1 change: 0 additions & 1 deletion python/gui/symbology/qgssymbollevelsdialog.sip
Expand Up @@ -8,7 +8,6 @@




class QgsSymbolLevelsDialog : QDialog
{

Expand Down
6 changes: 6 additions & 0 deletions src/app/openstreetmap/qgsosmexportdialog.cpp
Expand Up @@ -36,6 +36,7 @@ QgsOSMExportDialog::QgsOSMExportDialog( QWidget *parent )
connect( btnBrowseDb, &QAbstractButton::clicked, this, &QgsOSMExportDialog::onBrowse );
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsOSMExportDialog::onOK );
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsOSMExportDialog::onClose );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsOSMExportDialog::showHelp );
connect( editDbFileName, &QLineEdit::textChanged, this, &QgsOSMExportDialog::updateLayerName );
connect( radPoints, &QAbstractButton::clicked, this, &QgsOSMExportDialog::updateLayerName );
connect( radPolylines, &QAbstractButton::clicked, this, &QgsOSMExportDialog::updateLayerName );
Expand Down Expand Up @@ -212,3 +213,8 @@ void QgsOSMExportDialog::onDeselectAll()
mTagsModel->item( i, 0 )->setCheckState( Qt::Unchecked );
}
}

void QgsOSMExportDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "managing_data_source/opening_data.html#importing-openstreetmap-vectors" ) );
}
2 changes: 2 additions & 0 deletions src/app/openstreetmap/qgsosmexportdialog.h
Expand Up @@ -19,6 +19,7 @@
#include <QDialog>

#include "ui_qgsosmexportdialog.h"
#include "qgshelp.h"

class QgsOSMDatabase;

Expand All @@ -43,6 +44,7 @@ class QgsOSMExportDialog : public QDialog, private Ui::QgsOSMExportDialog

void onOK();
void onClose();
void showHelp();

private:
QgsOSMDatabase *mDatabase = nullptr;
Expand Down
6 changes: 6 additions & 0 deletions src/app/openstreetmap/qgsosmimportdialog.cpp
Expand Up @@ -34,6 +34,7 @@ QgsOSMImportDialog::QgsOSMImportDialog( QWidget *parent )
connect( editDbFileName, &QLineEdit::textChanged, this, &QgsOSMImportDialog::dbFileNameChanged );
connect( buttonBox, &QDialogButtonBox::accepted, this, &QgsOSMImportDialog::onOK );
connect( buttonBox, &QDialogButtonBox::rejected, this, &QgsOSMImportDialog::onClose );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsOSMImportDialog::showHelp );

connect( mImport, &QgsOSMXmlImport::progress, this, &QgsOSMImportDialog::onProgress );
}
Expand Down Expand Up @@ -130,3 +131,8 @@ void QgsOSMImportDialog::onProgress( int percent )
progressBar->setValue( percent );
qApp->processEvents( QEventLoop::ExcludeSocketNotifiers );
}

void QgsOSMImportDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "managing_data_source/opening_data.html#importing-openstreetmap-vectors" ) );
}
2 changes: 2 additions & 0 deletions src/app/openstreetmap/qgsosmimportdialog.h
Expand Up @@ -19,6 +19,7 @@
#include <QDialog>

#include "ui_qgsosmimportdialog.h"
#include "qgshelp.h"

class QgsOSMXmlImport;

Expand All @@ -38,6 +39,7 @@ class QgsOSMImportDialog : public QDialog, private Ui::QgsOSMImportDialog

void onOK();
void onClose();
void showHelp();

void onProgress( int percent );

Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsaddtaborgroup.cpp
Expand Up @@ -51,6 +51,7 @@ QgsAddTabOrGroup::QgsAddTabOrGroup( QgsVectorLayer *lyr, const QList < TabPair >

connect( mTabButton, &QAbstractButton::toggled, this, &QgsAddTabOrGroup::on_mTabButton_toggled );
connect( mGroupButton, &QAbstractButton::toggled, this, &QgsAddTabOrGroup::on_mGroupButton_toggled );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsAddTabOrGroup::showHelp );

mColumnCountSpinBox->setValue( QgsSettings().value( QStringLiteral( "/qgis/attributeForm/defaultTabColumnCount" ), 1 ).toInt() );

Expand Down Expand Up @@ -115,3 +116,8 @@ void QgsAddTabOrGroup::on_mTabButton_toggled( bool checked )
if ( checked )
mColumnCountSpinBox->setValue( QgsSettings().value( QStringLiteral( "/qgis/attributeForm/defaultTabColumnCount" ), 1 ).toInt() );
}

void QgsAddTabOrGroup::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#customize-a-form-for-your-data" ) );
}
2 changes: 2 additions & 0 deletions src/app/qgsaddtaborgroup.h
Expand Up @@ -22,6 +22,7 @@
#include "ui_qgsaddtaborgroupbase.h"
#include "qgsguiutils.h"
#include "qgis_app.h"
#include "qgshelp.h"

class QTreeWidgetItem;
class QgsVectorLayer;
Expand Down Expand Up @@ -50,6 +51,7 @@ class APP_EXPORT QgsAddTabOrGroup : public QDialog, private Ui::QgsAddTabOrGroup
private slots:
void on_mGroupButton_toggled( bool checked );
void on_mTabButton_toggled( bool checked );
void showHelp();

protected:
QgsVectorLayer *mLayer = nullptr;
Expand Down
8 changes: 7 additions & 1 deletion src/app/qgsdiagramproperties.cpp
Expand Up @@ -950,9 +950,15 @@ void QgsDiagramProperties::showSizeLegendDialog()
dlg.setLayout( new QVBoxLayout() );
dlg.setWindowTitle( panel->panelTitle() );
dlg.layout()->addWidget( panel );
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok );
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Help | QDialogButtonBox::Ok );
connect( buttonBox, &QDialogButtonBox::accepted, &dlg, &QDialog::accept );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDiagramProperties::showHelp );
dlg.layout()->addWidget( buttonBox );
if ( dlg.exec() )
mSizeLegend.reset( panel->dataDefinedSizeLegend() );
}

void QgsDiagramProperties::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#legend" ) );
}
1 change: 1 addition & 0 deletions src/app/qgsdiagramproperties.h
Expand Up @@ -90,6 +90,7 @@ class APP_EXPORT QgsDiagramProperties : public QWidget, private Ui::QgsDiagramPr
private slots:

void updateProperty();
void showHelp();
};

class EditBlockerDelegate: public QStyledItemDelegate
Expand Down
7 changes: 7 additions & 0 deletions src/app/qgssavestyletodbdialog.cpp
Expand Up @@ -34,6 +34,8 @@ QgsSaveStyleToDbDialog::QgsSaveStyleToDbDialog( QWidget *parent )

QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/saveStyleToDb/geometry" ) ).toByteArray() );

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

QgsSaveStyleToDbDialog::~QgsSaveStyleToDbDialog()
Expand Down Expand Up @@ -103,3 +105,8 @@ void QgsSaveStyleToDbDialog::on_mFilePickButton_clicked()
mFileNameLabel->setText( myFI.fileName() );
}
}

void QgsSaveStyleToDbDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#save-and-share-layer-properties" ) );
}
5 changes: 5 additions & 0 deletions src/app/qgssavestyletodbdialog.h
Expand Up @@ -19,6 +19,7 @@
#include "ui_qgssavetodbdialog.h"
#include "qgsguiutils.h"
#include "qgis_app.h"
#include "qgshelp.h"

class APP_EXPORT QgsSaveStyleToDbDialog : public QDialog, private Ui::QgsSaveToDBDialog
{
Expand All @@ -38,6 +39,10 @@ class APP_EXPORT QgsSaveStyleToDbDialog : public QDialog, private Ui::QgsSaveToD
bool isDefault();
void on_mFilePickButton_clicked();
void accept() override;

private slots:
void showHelp();

};

#endif // QGSSAVESTYLETODBDIALOG_H
6 changes: 6 additions & 0 deletions src/gui/qgscolordialog.cpp
Expand Up @@ -57,6 +57,7 @@ QgsColorDialog::QgsColorDialog( QWidget *parent, Qt::WindowFlags fl, const QColo

connect( mColorWidget, &QgsCompoundColorWidget::currentColorChanged, this, &QgsColorDialog::currentColorChanged );
connect( this, &QDialog::rejected, this, &QgsColorDialog::discardColor );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsColorDialog::showHelp );
}

QColor QgsColorDialog::color() const
Expand Down Expand Up @@ -205,3 +206,8 @@ void QgsColorDialog::closeEvent( QCloseEvent *e )
saveSettings();
QDialog::closeEvent( e );
}

void QgsColorDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#color-selector" ) );
}
2 changes: 2 additions & 0 deletions src/gui/qgscolordialog.h
Expand Up @@ -21,6 +21,7 @@
#include "ui_qgscolordialog.h"
#include "qgis_gui.h"
#include "qgis.h"
#include "qgshelp.h"

class QColor;

Expand Down Expand Up @@ -113,6 +114,7 @@ class GUI_EXPORT QgsColorDialog : public QDialog, private Ui::QgsColorDialogBase
void on_mButtonBox_rejected();
void on_mButtonBox_clicked( QAbstractButton *button );
void discardColor();
void showHelp();

private:

Expand Down
7 changes: 7 additions & 0 deletions src/gui/qgsexpressionbuilderdialog.cpp
Expand Up @@ -33,6 +33,8 @@ QgsExpressionBuilderDialog::QgsExpressionBuilderDialog( QgsVectorLayer *layer, c

QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/ExpressionBuilderDialog/geometry" ) ).toByteArray() );

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

QgsExpressionBuilderWidget *QgsExpressionBuilderDialog::expressionBuilder()
Expand Down Expand Up @@ -79,3 +81,8 @@ void QgsExpressionBuilderDialog::setGeomCalculator( const QgsDistanceArea &da )
// Store in child widget only.
builder->setGeomCalculator( da );
}

void QgsExpressionBuilderDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/expression.html" ) );
}
5 changes: 5 additions & 0 deletions src/gui/qgsexpressionbuilderdialog.h
Expand Up @@ -18,6 +18,7 @@

#include <QDialog>
#include "ui_qgsexpressionbuilderdialogbase.h"
#include "qgshelp.h"
#include "qgis_gui.h"


Expand Down Expand Up @@ -75,6 +76,10 @@ class GUI_EXPORT QgsExpressionBuilderDialog : public QDialog, private Ui::QgsExp

private:
QString mRecentKey;

private slots:
void showHelp();

};

#endif
7 changes: 7 additions & 0 deletions src/gui/qgsexpressionselectiondialog.cpp
Expand Up @@ -57,6 +57,8 @@ QgsExpressionSelectionDialog::QgsExpressionSelectionDialog( QgsVectorLayer *laye

QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/ExpressionSelectionDialog/geometry" ) ).toByteArray() );

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

QgsExpressionBuilderWidget *QgsExpressionSelectionDialog::expressionBuilder()
Expand Down Expand Up @@ -194,3 +196,8 @@ void QgsExpressionSelectionDialog::saveRecent()
{
mExpressionBuilder->saveToRecent( QStringLiteral( "Selection" ) );
}

void QgsExpressionSelectionDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#automatic-selection" ) );
}
2 changes: 2 additions & 0 deletions src/gui/qgsexpressionselectiondialog.h
Expand Up @@ -21,6 +21,7 @@

#include "qgsmapcanvas.h"
#include "qgsmessagebar.h"
#include "qgshelp.h"

#include <QDialog>
#include "qgis_gui.h"
Expand Down Expand Up @@ -88,6 +89,7 @@ class GUI_EXPORT QgsExpressionSelectionDialog : public QDialog, private Ui::QgsE
void on_mActionSelectIntersect_triggered();
void on_mButtonZoomToFeatures_clicked();
void on_mPbnClose_clicked();
void showHelp();

protected:

Expand Down
7 changes: 7 additions & 0 deletions src/gui/qgsgradientcolorrampdialog.cpp
Expand Up @@ -146,6 +146,8 @@ QgsGradientColorRampDialog::QgsGradientColorRampDialog( const QgsGradientColorRa

connect( mStopEditor, &QgsGradientStopEditor::selectedStopChanged, this, &QgsGradientColorRampDialog::selectedStopChanged );
mStopEditor->selectStop( 0 );

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

QgsGradientColorRampDialog::~QgsGradientColorRampDialog()
Expand Down Expand Up @@ -563,6 +565,11 @@ void QgsGradientColorRampDialog::setColor2( const QColor &color )
updateColorButtons();
}

void QgsGradientColorRampDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/style_library.html#color-ramp" ) );
}


/// @cond PRIVATE

Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgsgradientcolorrampdialog.h
Expand Up @@ -20,6 +20,7 @@
#include "qgis.h"

#include "ui_qgsgradientcolorrampdialogbase.h"
#include "qgshelp.h"
#include "qgis_gui.h"

class QgsGradientColorRamp;
Expand Down Expand Up @@ -91,6 +92,7 @@ class GUI_EXPORT QgsGradientColorRampDialog : public QDialog, private Ui::QgsGra
void plotMousePress( QPointF point );
void plotMouseRelease( QPointF point );
void plotMouseMove( QPointF point );
void showHelp();

private:

Expand Down
7 changes: 7 additions & 0 deletions src/gui/qgsnewmemorylayerdialog.cpp
Expand Up @@ -56,6 +56,8 @@ QgsNewMemoryLayerDialog::QgsNewMemoryLayerDialog( QWidget *parent, Qt::WindowFla

mPointRadioButton->setChecked( true );
mNameLineEdit->setText( tr( "New scratch layer" ) );

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

QgsNewMemoryLayerDialog::~QgsNewMemoryLayerDialog()
Expand Down Expand Up @@ -116,3 +118,8 @@ QString QgsNewMemoryLayerDialog::layerName() const
{
return mNameLineEdit->text();
}

void QgsNewMemoryLayerDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "managing_data_source/create_layers.html#creating-a-new-temporary-scratch-layer" ) );
}
5 changes: 5 additions & 0 deletions src/gui/qgsnewmemorylayerdialog.h
Expand Up @@ -20,6 +20,7 @@
#include "ui_qgsnewmemorylayerdialogbase.h"
#include "qgsguiutils.h"
#include "qgis.h"
#include "qgshelp.h"
#include "qgis_gui.h"

class QgsVectorLayer;
Expand Down Expand Up @@ -65,6 +66,10 @@ class GUI_EXPORT QgsNewMemoryLayerDialog: public QDialog, private Ui::QgsNewMemo
private:

QString mCrsId;

private slots:

void showHelp();
};

#endif //QGSNEWMEMORYLAYERDIALOG_H
6 changes: 6 additions & 0 deletions src/gui/qgsorderbydialog.cpp
Expand Up @@ -34,6 +34,8 @@ QgsOrderByDialog::QgsOrderByDialog( QgsVectorLayer *layer, QWidget *parent )
mOrderByTableWidget->horizontalHeader()->setResizeMode( 2, QHeaderView::ResizeToContents );

mOrderByTableWidget->installEventFilter( this );

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

void QgsOrderByDialog::setOrderBy( const QgsFeatureRequest::OrderBy &orderBy )
Expand Down Expand Up @@ -150,3 +152,7 @@ bool QgsOrderByDialog::eventFilter( QObject *obj, QEvent *e )
return false;
}

void QgsOrderByDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#layer-rendering" ) );
}
2 changes: 2 additions & 0 deletions src/gui/qgsorderbydialog.h
Expand Up @@ -22,6 +22,7 @@

#include "ui_qgsorderbydialogbase.h"
#include "qgsfeaturerequest.h"
#include "qgshelp.h"
#include "qgis_gui.h"

class QgsVectorLayer;
Expand Down Expand Up @@ -62,6 +63,7 @@ class GUI_EXPORT QgsOrderByDialog : public QDialog, private Ui::OrderByDialogBas

private slots:
void onExpressionChanged( const QString &expression );
void showHelp();

private:

Expand Down
6 changes: 6 additions & 0 deletions src/gui/qgsrasterlayersaveasdialog.cpp
Expand Up @@ -137,6 +137,8 @@ QgsRasterLayerSaveAsDialog::QgsRasterLayerSaveAsDialog( QgsRasterLayer *rasterLa
okButton->setEnabled( false );
}

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

mExtentGroupBox->setOutputCrs( outputCrs() );
mExtentGroupBox->setOriginalExtent( mDataProvider->extent(), mLayerCrs );
mExtentGroupBox->setCurrentExtent( mCurrentExtent, mCurrentCrs );
Expand Down Expand Up @@ -737,3 +739,7 @@ bool QgsRasterLayerSaveAsDialog::validate() const
return true;
}

void QgsRasterLayerSaveAsDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "managing_data_source/create_layers.html#save-layer-from-an-existing-file" ) );
}

0 comments on commit f51244c

Please sign in to comment.