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

Implement clear global variable

parent 300b9bfa
...@@ -100,6 +100,13 @@ void SieveGlobalVariableActionWidget::initWidget() ...@@ -100,6 +100,13 @@ void SieveGlobalVariableActionWidget::initWidget()
connect(mRemove, &QPushButton::clicked, this, &SieveGlobalVariableActionWidget::slotRemoveWidget); connect(mRemove, &QPushButton::clicked, this, &SieveGlobalVariableActionWidget::slotRemoveWidget);
} }
void SieveGlobalVariableActionWidget::clear()
{
mVariableName->clear();
mSetValueTo->setChecked(false);
mVariableValue->clear();
}
bool SieveGlobalVariableActionWidget::isInitialized() const bool SieveGlobalVariableActionWidget::isInitialized() const
{ {
return !mVariableName->text().isEmpty(); return !mVariableName->text().isEmpty();
...@@ -274,8 +281,10 @@ void SieveGlobalVariableLister::reconnectWidget(SieveGlobalVariableActionWidget ...@@ -274,8 +281,10 @@ void SieveGlobalVariableLister::reconnectWidget(SieveGlobalVariableActionWidget
void SieveGlobalVariableLister::clearWidget(QWidget *aWidget) void SieveGlobalVariableLister::clearWidget(QWidget *aWidget)
{ {
Q_UNUSED(aWidget); if (aWidget) {
//TODO SieveGlobalVariableActionWidget *widget = static_cast<SieveGlobalVariableActionWidget *>(aWidget);
widget->clear();
}
Q_EMIT valueChanged(); Q_EMIT valueChanged();
} }
......
...@@ -47,6 +47,7 @@ public: ...@@ -47,6 +47,7 @@ public:
void setVariableValue(const QString &name); void setVariableValue(const QString &name);
QString variableName() const; QString variableName() const;
void clear();
private Q_SLOTS: private Q_SLOTS:
void slotAddWidget(); void slotAddWidget();
void slotRemoveWidget(); 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