Skip to content

Commit

Permalink
Change all ocurrences on_buttonBox_helpRequested to showHelp
Browse files Browse the repository at this point in the history
Add help button to 3 dialogs
Fix missing QStringLiteral
Fix CMakeLists.txt indentation
Fix qhelp.h and qgis_sip.h includes with <>
  • Loading branch information
jgrocha committed Aug 15, 2017
1 parent c07ac6e commit fe59a19
Show file tree
Hide file tree
Showing 97 changed files with 297 additions and 149 deletions.
5 changes: 0 additions & 5 deletions python/gui/qgsnewhttpconnection.sip
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ Constructor
public slots:
virtual void accept();


void helpRequest();
%Docstring
Open the help in a browser
%End
void on_txtName_textChanged( const QString & );
void on_txtUrl_textChanged( const QString & );

Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsnewvectorlayerdialog.sip
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Returns the file format for storage
void on_mRemoveAttributeButton_clicked();
void on_mFileFormatComboBox_currentIndexChanged( int index );
void on_mTypeBox_currentIndexChanged( int index );
void on_buttonBox_helpRequested();
void showHelp();
void nameChanged( const QString & );
void selectionChanged();

Expand Down
2 changes: 0 additions & 2 deletions python/gui/qgsquerybuilder.sip
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ class QgsQueryBuilder : QDialog
void on_btnNot_clicked();
void on_btnOr_clicked();

void on_buttonBox_helpRequested();

void test();
%Docstring
Test the constructed sql statement to see if the vector layer data provider likes it.
Expand Down
5 changes: 0 additions & 5 deletions python/gui/qgssearchquerybuilder.sip
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ change search string shown in text field
are inserted into the values list box.
%End

void helpRequest();
%Docstring
Open the help in a browser
%End

void saveQuery();
void loadQuery();

Expand Down
3 changes: 2 additions & 1 deletion python/gui/symbology/qgsstylemanagerdialog.sip
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ adds symbols of some type to list
called when the dialog is going to be closed
%End

void on_buttonBox_helpRequested();
void onClose();
void showHelp();

void itemChanged( QStandardItem *item );

Expand Down
6 changes: 5 additions & 1 deletion src/app/pluginmanager/qgspluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ QgsPluginManager::QgsPluginManager( QWidget *parent, bool pluginsAreEnabled, Qt:
mPythonUtils = nullptr;

setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsPluginManager::showHelp );

// QgsOptionsDialogBase handles saving/restoring of geometry, splitter and current tab states,
// switching vertical tabs between icon/text to icon-only modes (splitter collapsed to left),
Expand Down Expand Up @@ -1576,4 +1577,7 @@ void QgsPluginManager::pushMessage( const QString &text, QgsMessageBar::MessageL
msgBar->pushMessage( text, level, duration );
}


void QgsPluginManager::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "plugins/plugins.html" ) );
}
2 changes: 1 addition & 1 deletion src/app/pluginmanager/qgspluginmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class QgsPluginManager : public QgsOptionsDialogBase, private Ui::QgsPluginManag
void on_ckbDeprecated_toggled( bool state );

//! Open help browser
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "plugins/plugins.html" ) ); }
void showHelp();

//! 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
5 changes: 5 additions & 0 deletions src/app/qgscustomprojectiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ QgsCustomProjectionDialog::QgsCustomProjectionDialog( QWidget *parent, Qt::Windo
: QDialog( parent, fl )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsCustomProjectionDialog::showHelp );

QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/CustomProjection/geometry" ) ).toByteArray() );
Expand Down Expand Up @@ -531,3 +532,7 @@ QString QgsCustomProjectionDialog::quotedValue( QString value )
return value.prepend( '\'' ).append( '\'' );
}

void QgsCustomProjectionDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "working_with_projections/working_with_projections.html" ) );
}
3 changes: 1 addition & 2 deletions src/app/qgscustomprojectiondialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class APP_EXPORT QgsCustomProjectionDialog : public QDialog, private Ui::QgsCust
void on_pbnRemove_clicked();
void on_pbnCopyCRS_clicked();
void on_leNameList_currentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem *prev );

void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "working_with_projections/working_with_projections.html" ) ); }
void on_buttonBox_accepted();

private:
Expand All @@ -53,6 +51,7 @@ class APP_EXPORT QgsCustomProjectionDialog : public QDialog, private Ui::QgsCust
bool deleteCrs( const QString &id );
bool saveCrs( QgsCoordinateReferenceSystem myParameters, const QString &myName, QString myId, bool newEntry );
void insertProjection( const QString &myProjectionAcronym );
void showHelp();

//These two QMap store the values as they are on the database when loading
QMap <QString, QString> existingCRSparameters;
Expand Down
3 changes: 2 additions & 1 deletion src/app/qgsdecorationcopyrightdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ QgsDecorationCopyrightDialog::QgsDecorationCopyrightDialog( QgsDecorationCopyrig
, mDeco( deco )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDecorationCopyrightDialog::showHelp );

QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/DecorationCopyright/geometry" ) ).toByteArray() );
Expand Down Expand Up @@ -99,7 +100,7 @@ void QgsDecorationCopyrightDialog::apply()
mDeco.update();
}

void QgsDecorationCopyrightDialog::on_buttonBox_helpRequested()
void QgsDecorationCopyrightDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#copyright-label" ) );
}
2 changes: 1 addition & 1 deletion src/app/qgsdecorationcopyrightdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class APP_EXPORT QgsDecorationCopyrightDialog : public QDialog, private Ui::QgsD
private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_buttonBox_helpRequested();
void showHelp();
void on_pbnColorChooser_colorChanged( const QColor &c );
void apply();

Expand Down
3 changes: 2 additions & 1 deletion src/app/qgsdecorationgriddialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ QgsDecorationGridDialog::QgsDecorationGridDialog( QgsDecorationGrid &deco, QWidg
, mDeco( deco )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDecorationGridDialog::showHelp );

mMarkerSymbolButton->setSymbolType( QgsSymbol::Marker );
mLineSymbolButton->setSymbolType( QgsSymbol::Line );
Expand Down Expand Up @@ -157,7 +158,7 @@ QgsDecorationGridDialog::~QgsDecorationGridDialog()
settings.setValue( QStringLiteral( "/Windows/DecorationGrid/geometry" ), saveGeometry() );
}

void QgsDecorationGridDialog::on_buttonBox_helpRequested()
void QgsDecorationGridDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#grid" ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsdecorationgriddialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class APP_EXPORT QgsDecorationGridDialog : public QDialog, private Ui::QgsDecora
void apply();
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_buttonBox_helpRequested();
void showHelp();
void on_mGridTypeComboBox_currentIndexChanged( int index );
void on_mPbtnUpdateFromExtents_clicked();
void on_mPbtnUpdateFromLayer_clicked();
Expand Down
3 changes: 2 additions & 1 deletion src/app/qgsdecorationnortharrowdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ QgsDecorationNorthArrowDialog::QgsDecorationNorthArrowDialog( QgsDecorationNorth

QPushButton *applyButton = buttonBox->button( QDialogButtonBox::Apply );
connect( applyButton, &QAbstractButton::clicked, this, &QgsDecorationNorthArrowDialog::apply );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDecorationNorthArrowDialog::showHelp );

// signal/slot connection defined in 'designer' causes the slider to
// be moved to reflect the change in the spinbox.
Expand Down Expand Up @@ -78,7 +79,7 @@ QgsDecorationNorthArrowDialog::~QgsDecorationNorthArrowDialog()
settings.setValue( QStringLiteral( "Windows/DecorationNorthArrow/geometry" ), saveGeometry() );
}

void QgsDecorationNorthArrowDialog::on_buttonBox_helpRequested()
void QgsDecorationNorthArrowDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#north-arrow" ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsdecorationnortharrowdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class APP_EXPORT QgsDecorationNorthArrowDialog : public QDialog, private Ui::Qgs
private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_buttonBox_helpRequested();
void showHelp();
void on_spinAngle_valueChanged( int spinAngle );
void on_sliderRotation_valueChanged( int rotationValue );
void apply();
Expand Down
3 changes: 2 additions & 1 deletion src/app/qgsdecorationscalebardialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ QgsDecorationScaleBarDialog::QgsDecorationScaleBarDialog( QgsDecorationScaleBar
, mDeco( deco )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsDecorationScaleBarDialog::showHelp );

QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/DecorationScaleBar/geometry" ) ).toByteArray() );
Expand Down Expand Up @@ -88,7 +89,7 @@ QgsDecorationScaleBarDialog::~QgsDecorationScaleBarDialog()
settings.setValue( QStringLiteral( "Windows/DecorationScaleBar/geometry" ), saveGeometry() );
}

void QgsDecorationScaleBarDialog::on_buttonBox_helpRequested()
void QgsDecorationScaleBarDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#scale-bar" ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsdecorationscalebardialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class APP_EXPORT QgsDecorationScaleBarDialog : public QDialog, private Ui::QgsDe
private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
void on_buttonBox_helpRequested();
void showHelp();
void apply();

protected:
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsfieldcalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ QgsFieldCalculator::QgsFieldCalculator( QgsVectorLayer *vl, QWidget *parent )

connect( builder, &QgsExpressionBuilderWidget::expressionParsed, this, &QgsFieldCalculator::setOkButtonState );
connect( mOutputFieldWidthSpinBox, &QAbstractSpinBox::editingFinished, this, &QgsFieldCalculator::setPrecisionMinMax );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsFieldCalculator::helpRequest );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, &QgsFieldCalculator::showHelp );

QgsDistanceArea myDa;
myDa.setSourceCrs( vl->crs() );
Expand Down Expand Up @@ -484,7 +484,7 @@ void QgsFieldCalculator::setPrecisionMinMax()
mOutputFieldPrecisionSpinBox->setMaximum( qMax( minPrecType, qMin( maxPrecType, mOutputFieldWidthSpinBox->value() ) ) );
}

void QgsFieldCalculator::helpRequest()
void QgsFieldCalculator::showHelp()
{
QgsHelp::openHelp( "working_with_vector/attribute_table.html#editing-attribute-values" );
QgsHelp::openHelp( QStringLiteral( "working_with_vector/attribute_table.html#editing-attribute-values" ) );
}
2 changes: 1 addition & 1 deletion src/app/qgsfieldcalculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ class APP_EXPORT QgsFieldCalculator: public QDialog, private Ui::QgsFieldCalcula
void on_mCreateVirtualFieldCheckbox_stateChanged( int state );
void on_mOutputFieldNameLineEdit_textChanged( const QString &text );
void on_mOutputFieldTypeComboBox_activated( int index );
void helpRequest();

private slots:
//! Sets the OK button enabled / disabled
void setOkButtonState();
void setPrecisionMinMax();
void showHelp();

private:
//! default constructor forbidden
Expand Down
7 changes: 6 additions & 1 deletion src/app/qgsidentifyresultsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ QgsIdentifyResultsDialog::QgsIdentifyResultsDialog( QgsMapCanvas *canvas, QWidge
connect( mActionPrint, &QAction::triggered, this, &QgsIdentifyResultsDialog::printCurrentItem );
connect( mOpenFormAction, &QAction::triggered, this, &QgsIdentifyResultsDialog::featureForm );
connect( mClearResultsAction, &QAction::triggered, this, &QgsIdentifyResultsDialog::clear );
connect( mHelpToolButton, &QAbstractButton::clicked, this, &QgsIdentifyResultsDialog::helpRequested );
connect( mHelpToolButton, &QAbstractButton::clicked, this, &QgsIdentifyResultsDialog::showHelp );
}

QgsIdentifyResultsDialog::~QgsIdentifyResultsDialog()
Expand Down Expand Up @@ -1968,3 +1968,8 @@ void QgsIdentifyResultsDialogMapLayerAction::execute()
{
mAction->triggerForFeature( mLayer, mFeature );
}

void QgsIdentifyResultsDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#identify" ) );
}
4 changes: 2 additions & 2 deletions src/app/qgsidentifyresultsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ class APP_EXPORT QgsIdentifyResultsDialog: public QDialog, private Ui::QgsIdenti

QTreeWidgetItem *retrieveAttributes( QTreeWidgetItem *item, QgsAttributeMap &attributes, int &currentIdx );

void helpRequested() { QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#identify" ) ); }

void on_cmbIdentifyMode_currentIndexChanged( int index );

void on_cmbViewMode_currentIndexChanged( int index );
Expand Down Expand Up @@ -261,6 +259,8 @@ class APP_EXPORT QgsIdentifyResultsDialog: public QDialog, private Ui::QgsIdenti
QgsDockWidget *mDock = nullptr;

QVector<QgsIdentifyPlotCurve *> mPlotCurves;

void showHelp();
};

class QgsIdentifyResultsDialogMapLayerAction : public QAction
Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsmeasuredialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ QgsMeasureDialog::QgsMeasureDialog( QgsMeasureTool *tool, Qt::WindowFlags f )
, mTool( tool )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsMeasureDialog::showHelp );

QPushButton *nb = new QPushButton( tr( "&New" ) );
buttonBox->addButton( nb, QDialogButtonBox::ActionRole );
Expand Down Expand Up @@ -564,3 +565,8 @@ void QgsMeasureDialog::reject()
restart();
QDialog::close();
}

void QgsMeasureDialog::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#measuring" ) );
}
5 changes: 2 additions & 3 deletions src/app/qgsmeasuredialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ class APP_EXPORT QgsMeasureDialog : public QDialog, private Ui::QgsMeasureBase
//! Close event
void closeEvent( QCloseEvent *e ) override;

//! Show the help for the dialog
void on_buttonBox_helpRequested() { QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#measuring" ) ); }

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

Expand Down Expand Up @@ -119,6 +116,8 @@ class APP_EXPORT QgsMeasureDialog : public QDialog, private Ui::QgsMeasureBase

QgsPointXY mLastMousePoint;

void showHelp();

friend class TestQgsMeasureTool;
};

Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsnewspatialitelayerdialog.cpp