Commit 5546240a authored by Laurent Montel's avatar Laurent Montel 😁

Clear before to translate

parent a0916d0c
......@@ -243,7 +243,7 @@ void TranslatorWidget::init()
hboxLayout->addWidget(label);
d->to = new MinimumComboBox;
d->to->setObjectName(QStringLiteral("to"));
connect(d->to, QOverload<int>::of(&MinimumComboBox::currentIndexChanged), this, &TranslatorWidget::slotConfigChanged);
hboxLayout->addWidget(d->to);
KSeparator *separator = new KSeparator;
......@@ -307,13 +307,14 @@ void TranslatorWidget::init()
layout->addWidget(d->splitter);
d->initLanguage();
connect(d->from, QOverload<int>::of(&MinimumComboBox::currentIndexChanged), this, &TranslatorWidget::slotConfigChanged);
d->from->setCurrentIndex(0); //Fill "to" combobox
slotFromLanguageChanged(0, true);
slotTextChanged();
readConfig();
connect(d->from, SIGNAL(currentIndexChanged(int)), SLOT(slotFromLanguageChanged(int)));
connect(d->from, QOverload<int>::of(&MinimumComboBox::currentIndexChanged), this, &TranslatorWidget::slotConfigChanged);
connect(d->to, QOverload<int>::of(&MinimumComboBox::currentIndexChanged), this, &TranslatorWidget::slotConfigChanged);
connect(d->to, QOverload<int>::of(&MinimumComboBox::currentIndexChanged), this, &TranslatorWidget::slotTranslate);
hide();
......@@ -345,6 +346,7 @@ void TranslatorWidget::slotFromLanguageChanged(int index, bool initialize)
d->to->setCurrentIndex(indexTo);
}
if (!initialize) {
d->translatorResultTextEdit->clear();
slotTranslate();
}
}
......
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