summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-08-04 09:05:04 +0200
committerMontel Laurent <[email protected]>2015-08-04 09:05:04 +0200
commite3da9fbffb36b91b6ba8ca6e5e1de7eea08b02e7 (patch)
tree0a2e428d130e94f6316e8e7fc71e4497c971289b
parent106f8d98cea011fc9ba063c06d4f713cd3d50c8f (diff)
Enable/disable clear button
-rw-r--r--pimcommon/translator/translatorwidget.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/pimcommon/translator/translatorwidget.cpp b/pimcommon/translator/translatorwidget.cpp
index cbd1ca1..7d7e8b7 100644
--- a/pimcommon/translator/translatorwidget.cpp
+++ b/pimcommon/translator/translatorwidget.cpp
@@ -75,6 +75,7 @@ public:
MinimumComboBox *from;
MinimumComboBox *to;
QPushButton *translate;
+ QPushButton *clear;
PimCommon::AbstractTranslator *abstractTranslator;
KPIM::ProgressIndicatorWidget *progressIndictor;
QPushButton *invert;
@@ -258,13 +259,13 @@ void TranslatorWidget::init()
connect(d->invert, &QPushButton::clicked, this, &TranslatorWidget::slotInvertLanguage);
hboxLayout->addWidget(d->invert);
- QPushButton *clear = new QPushButton(i18n("Clear"), this);
- clear->setObjectName(QStringLiteral("clear-button"));
+ d->clear = new QPushButton(i18n("Clear"), this);
+ d->clear->setObjectName(QStringLiteral("clear-button"));
#ifndef QT_NO_ACCESSIBILITY
- clear->setAccessibleName(i18n("Clear"));
+ d->clear->setAccessibleName(i18n("Clear"));
#endif
- connect(clear, &QPushButton::clicked, this, &TranslatorWidget::slotClear);
- hboxLayout->addWidget(clear);
+ connect(d->clear, &QPushButton::clicked, this, &TranslatorWidget::slotClear);
+ hboxLayout->addWidget(d->clear);
d->translate = new QPushButton(i18n("Translate"));
d->translate->setObjectName(QStringLiteral("translate-button"));
@@ -340,6 +341,7 @@ void TranslatorWidget::slotConfigChanged()
void TranslatorWidget::slotTextChanged()
{
d->translate->setEnabled(!d->inputText->document()->isEmpty());
+ d->clear->setEnabled(!d->inputText->document()->isEmpty());
}
void TranslatorWidget::slotFromLanguageChanged(int index, bool initialize)