vcsbase: add "exec command" mechanism to EditorParameterWidget

Based on BaseGitArgumentsWidget, it provides an "arguments changed"
handler that calls executeCommand() by default.
This handler can also further load/save settings

Change-Id: I7182ddfa6323205f2ee57a7ce67122be5b89102e
Merge-request: 331
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Reviewed-on: http://codereview.qt.nokia.com/253
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
This commit is contained in:
cerf
2011-05-31 08:31:25 +00:00
committed by Tobias Hunger
parent edca313d53
commit 6adf2c82a4
2 changed files with 14 additions and 0 deletions

View File

@@ -118,6 +118,7 @@ VCSBaseEditorParameterWidget::VCSBaseEditorParameterWidget(QWidget *parent) :
d->m_layout = new QHBoxLayout(this); d->m_layout = new QHBoxLayout(this);
d->m_layout->setContentsMargins(3, 0, 3, 0); d->m_layout->setContentsMargins(3, 0, 3, 0);
d->m_layout->setSpacing(2); d->m_layout->setSpacing(2);
connect(this, SIGNAL(argumentsChanged()), this, SLOT(handleArgumentsChanged()));
} }
VCSBaseEditorParameterWidget::~VCSBaseEditorParameterWidget() VCSBaseEditorParameterWidget::~VCSBaseEditorParameterWidget()
@@ -186,6 +187,15 @@ QString VCSBaseEditorParameterWidget::msgIgnoreBlankLinesToolTip()
return tr("Ignore changes in blank lines"); return tr("Ignore changes in blank lines");
} }
void VCSBaseEditorParameterWidget::executeCommand()
{
}
void VCSBaseEditorParameterWidget::handleArgumentsChanged()
{
executeCommand();
}
} // namespace VCSBase } // namespace VCSBase
#include "vcsbaseeditorparameterwidget.moc" #include "vcsbaseeditorparameterwidget.moc"

View File

@@ -66,6 +66,10 @@ public:
static QString msgIgnoreBlankLinesLabel(); static QString msgIgnoreBlankLinesLabel();
static QString msgIgnoreBlankLinesToolTip(); static QString msgIgnoreBlankLinesToolTip();
public slots:
virtual void executeCommand();
virtual void handleArgumentsChanged();
signals: signals:
// Trigger a re-run to show changed output according to new argument list. // Trigger a re-run to show changed output according to new argument list.
void argumentsChanged(); void argumentsChanged();