Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 731b57c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/gui/qgspropertyoverridebutton.cpp
Expand Up @@ -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() );
Expand Down Expand Up @@ -817,3 +819,8 @@ void QgsPropertyOverrideButton::registerExpressionContextGenerator( QgsExpressio
{
mExpressionContextGenerator = generator;
}

void QgsPropertyOverrideButton::showHelp()
{
QgsHelp::openHelp( QStringLiteral( "introduction/general_tools.html#data-defined" ) );
}
2 changes: 1 addition & 1 deletion src/gui/qgspropertyoverridebutton.h
Expand Up @@ -300,7 +300,7 @@ class GUI_EXPORT QgsPropertyOverrideButton: public QToolButton
private slots:
void aboutToShowMenu();
void menuActionTriggered( QAction *action );

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

Expand Down

0 comments on commit 731b57c

Please sign in to comment.