Skip to content

Commit

Permalink
Connect help buttons to docs (#43941)
Browse files Browse the repository at this point in the history
  • Loading branch information
DelazJ committed Jun 28, 2021
1 parent 19eaec7 commit cf0d673
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 9 deletions.
7 changes: 6 additions & 1 deletion src/gui/qgs3dsymbolwidget.cpp
Expand Up @@ -18,6 +18,7 @@
#include "qgs3dsymbolregistry.h"
#include "qgsabstract3dsymbol.h"
#include "qgsgui.h"
#include "qgshelp.h"
#include <QVBoxLayout>
#include <QDialogButtonBox>

Expand All @@ -41,9 +42,13 @@ Qgs3DSymbolDialog::Qgs3DSymbolDialog( const QgsAbstract3DSymbol *symbol, QWidget
mWidget->setSymbol( symbol, nullptr );
}

mButtonBox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Ok, Qt::Horizontal );
mButtonBox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok, Qt::Horizontal );
connect( mButtonBox, &QDialogButtonBox::accepted, this, &QDialog::accept );
connect( mButtonBox, &QDialogButtonBox::rejected, this, &QDialog::reject );
connect( mButtonBox, &QDialogButtonBox::helpRequested, this, [ = ]
{
QgsHelp::openHelp( QStringLiteral( "style_library/3d_symbols.html" ) );
} );
vLayout->addStretch();
vLayout->addWidget( mButtonBox );
setLayout( vLayout );
Expand Down
5 changes: 5 additions & 0 deletions src/gui/vector/qgsjoindialog.cpp
Expand Up @@ -23,6 +23,7 @@
#include "qgsvectorlayerjoininfo.h"
#include "qgsmaplayercombobox.h"
#include "qgsfieldcombobox.h"
#include "qgshelp.h"

#include <QStandardItemModel>
#include <QPushButton>
Expand All @@ -32,6 +33,10 @@ QgsJoinDialog::QgsJoinDialog( QgsVectorLayer *layer, QList<QgsMapLayer *> alread
, mLayer( layer )
{
setupUi( this );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, [ = ]
{
QgsHelp::openHelp( QStringLiteral( "working_with_vector/vector_properties.html#joins-properties" ) );
} );

if ( !mLayer )
{
Expand Down
5 changes: 5 additions & 0 deletions src/gui/vectortile/qgsarcgisvectortileconnectiondialog.cpp
Expand Up @@ -16,6 +16,7 @@
#include "qgsarcgisvectortileconnectiondialog.h"
#include "qgsvectortileconnection.h"
#include "qgsgui.h"
#include "qgshelp.h"

#include <QMessageBox>
#include <QPushButton>
Expand All @@ -34,6 +35,10 @@ QgsArcgisVectorTileConnectionDialog::QgsArcgisVectorTileConnectionDialog( QWidge
mSpinZMax->setClearValue( 14 );

buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, [ = ]
{
QgsHelp::openHelp( QStringLiteral( "managing_data_source/opening_data.html#using-vector-tiles-services" ) );
} );
connect( mEditName, &QLineEdit::textChanged, this, &QgsArcgisVectorTileConnectionDialog::updateOkButtonState );
connect( mEditUrl, &QLineEdit::textChanged, this, &QgsArcgisVectorTileConnectionDialog::updateOkButtonState );
}
Expand Down
5 changes: 5 additions & 0 deletions src/gui/vectortile/qgsvectortileconnectiondialog.cpp
Expand Up @@ -16,6 +16,7 @@
#include "qgsvectortileconnectiondialog.h"
#include "qgsvectortileconnection.h"
#include "qgsgui.h"
#include "qgshelp.h"

#include <QMessageBox>
#include <QPushButton>
Expand All @@ -34,6 +35,10 @@ QgsVectorTileConnectionDialog::QgsVectorTileConnectionDialog( QWidget *parent )
mSpinZMax->setClearValue( 14 );

buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, [ = ]
{
QgsHelp::openHelp( QStringLiteral( "managing_data_source/opening_data.html#using-vector-tiles-services" ) );
} );
connect( mEditName, &QLineEdit::textChanged, this, &QgsVectorTileConnectionDialog::updateOkButtonState );
connect( mEditUrl, &QLineEdit::textChanged, this, &QgsVectorTileConnectionDialog::updateOkButtonState );
}
Expand Down
4 changes: 1 addition & 3 deletions src/gui/vectortile/qgsvectortilesourceselect.cpp
Expand Up @@ -62,9 +62,6 @@ QgsVectorTileSourceSelect::QgsVectorTileSourceSelect( QWidget *parent, Qt::Windo
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsVectorTileSourceSelect::showHelp );
setupButtons( buttonBox );

// disable help button until we got an entry in the docs
buttonBox->button( QDialogButtonBox::Help )->setEnabled( false );

populateConnectionList();
}

Expand Down Expand Up @@ -205,6 +202,7 @@ void QgsVectorTileSourceSelect::cmbConnections_currentTextChanged( const QString

void QgsVectorTileSourceSelect::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "managing_data_source/opening_data.html#using-vector-tiles-services" ) );
}

///@endcond
5 changes: 5 additions & 0 deletions src/providers/wms/qgsxyzconnectiondialog.cpp
Expand Up @@ -16,6 +16,7 @@
#include "qgsxyzconnectiondialog.h"
#include "qgsxyzconnection.h"
#include "qgsgui.h"
#include "qgshelp.h"
#include "qgsxyzsourcewidget.h"

#include <QMessageBox>
Expand All @@ -32,6 +33,10 @@ QgsXyzConnectionDialog::QgsXyzConnectionDialog( QWidget *parent )
mConnectionGroupBox->setLayout( hlayout );

buttonBox->button( QDialogButtonBox::Ok )->setDisabled( true );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, [ = ]
{
QgsHelp::openHelp( QStringLiteral( "managing_data_source/opening_data.html#using-xyz-tile-services" ) );
} );
connect( mEditName, &QLineEdit::textChanged, this, &QgsXyzConnectionDialog::updateOkButtonState );
connect( mSourceWidget, &QgsXyzSourceWidget::validChanged, this, &QgsXyzConnectionDialog::updateOkButtonState );
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsarcgisvectortileconnectiondialog.ui
Expand Up @@ -164,7 +164,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsjoindialogbase.ui
Expand Up @@ -122,7 +122,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsoptionsbase.ui
Expand Up @@ -1812,7 +1812,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>0</height>
</size>
</property>
</spacer>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsvectortileconnectiondialog.ui
Expand Up @@ -164,7 +164,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsxyzconnectiondialog.ui
Expand Up @@ -41,7 +41,7 @@
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
Expand Down

0 comments on commit cf0d673

Please sign in to comment.