Commit 3fcca363 authored by Laurent Montel's avatar Laurent Montel 😁

Implement clear global variable

parent 300b9bfa
......@@ -100,6 +100,13 @@ void SieveGlobalVariableActionWidget::initWidget()
connect(mRemove, &QPushButton::clicked, this, &SieveGlobalVariableActionWidget::slotRemoveWidget);
}
void SieveGlobalVariableActionWidget::clear()
{
mVariableName->clear();
mSetValueTo->setChecked(false);
mVariableValue->clear();
}
bool SieveGlobalVariableActionWidget::isInitialized() const
{
return !mVariableName->text().isEmpty();
......@@ -274,8 +281,10 @@ void SieveGlobalVariableLister::reconnectWidget(SieveGlobalVariableActionWidget
void SieveGlobalVariableLister::clearWidget(QWidget *aWidget)
{
Q_UNUSED(aWidget);
//TODO
if (aWidget) {
SieveGlobalVariableActionWidget *widget = static_cast<SieveGlobalVariableActionWidget *>(aWidget);
widget->clear();
}
Q_EMIT valueChanged();
}
......
......@@ -47,6 +47,7 @@ public:
void setVariableValue(const QString &name);
QString variableName() const;
void clear();
private Q_SLOTS:
void slotAddWidget();
void slotRemoveWidget();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment