Skip to content
Permalink
Browse files
Connect help buttons to docs (#43941)
  • Loading branch information
DelazJ committed Jun 28, 2021
1 parent 19eaec7 commit cf0d673c9c77c746a344f572f0ae5ae925721f81
@@ -18,6 +18,7 @@
#include "qgs3dsymbolregistry.h"
#include "qgsabstract3dsymbol.h"
#include "qgsgui.h"
#include "qgshelp.h"
#include <QVBoxLayout>
#include <QDialogButtonBox>

@@ -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 );
@@ -23,6 +23,7 @@
#include "qgsvectorlayerjoininfo.h"
#include "qgsmaplayercombobox.h"
#include "qgsfieldcombobox.h"
#include "qgshelp.h"

#include <QStandardItemModel>
#include <QPushButton>
@@ -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 )
{
@@ -16,6 +16,7 @@
#include "qgsarcgisvectortileconnectiondialog.h"
#include "qgsvectortileconnection.h"
#include "qgsgui.h"
#include "qgshelp.h"

#include <QMessageBox>
#include <QPushButton>
@@ -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 );
}
@@ -16,6 +16,7 @@
#include "qgsvectortileconnectiondialog.h"
#include "qgsvectortileconnection.h"
#include "qgsgui.h"
#include "qgshelp.h"

#include <QMessageBox>
#include <QPushButton>
@@ -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 );
}
@@ -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();
}

@@ -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
@@ -16,6 +16,7 @@
#include "qgsxyzconnectiondialog.h"
#include "qgsxyzconnection.h"
#include "qgsgui.h"
#include "qgshelp.h"
#include "qgsxyzsourcewidget.h"

#include <QMessageBox>
@@ -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 );
}
@@ -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>
@@ -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>
@@ -1812,7 +1812,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>0</height>
</size>
</property>
</spacer>
@@ -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>
@@ -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>

0 comments on commit cf0d673

Please sign in to comment.