Skip to content
Permalink
Browse files

Add Cancel and Help buttons to Property assistant dialog

because sometimes opening this dialog is a mistake and you want to close it
Also enable the Help capability
  • Loading branch information
DelazJ authored and nyalldawson committed Nov 26, 2017
1 parent 54b5165 commit 731b57c8a7d6deee9a4f9b031d8f2e499af13f78
Showing with 9 additions and 2 deletions.
  1. +8 −1 src/gui/qgspropertyoverridebutton.cpp
  2. +1 −1 src/gui/qgspropertyoverridebutton.h
@@ -634,8 +634,10 @@ void QgsPropertyOverrideButton::showAssistant()
dlg->setWindowTitle( widget->panelTitle() );
dlg->setLayout( new QVBoxLayout() );
dlg->layout()->addWidget( widget );
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Ok );
QDialogButtonBox *buttonBox = new QDialogButtonBox( QDialogButtonBox::Cancel | QDialogButtonBox::Help | QDialogButtonBox::Ok );
connect( buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept );
connect( buttonBox, &QDialogButtonBox::rejected, dlg, &QDialog::reject );
connect( buttonBox, &QDialogButtonBox::helpRequested, this, &QgsPropertyOverrideButton::showHelp );
dlg->layout()->addWidget( buttonBox );
dlg->exec();
settings.setValue( key, dlg->saveGeometry() );
@@ -817,3 +819,8 @@ void QgsPropertyOverrideButton::registerExpressionContextGenerator( QgsExpressio
{
mExpressionContextGenerator = generator;
}

void QgsPropertyOverrideButton::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#data-defined" ) );
}
@@ -300,7 +300,7 @@ class GUI_EXPORT QgsPropertyOverrideButton: public QToolButton
private slots:
void aboutToShowMenu();
void menuActionTriggered( QAction *action );

void showHelp();
void updateSiblingWidgets( bool state );
};

0 comments on commit 731b57c

Please sign in to comment.
You can’t perform that action at this time.