summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtSpellCheckerWindow.cpp')
-rw-r--r--Swift/QtUI/QtSpellCheckerWindow.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Swift/QtUI/QtSpellCheckerWindow.cpp b/Swift/QtUI/QtSpellCheckerWindow.cpp
index e2c5b0d..db2b1e7 100644
--- a/Swift/QtUI/QtSpellCheckerWindow.cpp
+++ b/Swift/QtUI/QtSpellCheckerWindow.cpp
@@ -15,12 +15,19 @@
#include <QFileDialog>
#include <QDir>
#include <QStringList>
+#include <QTimer>
namespace Swift {
QtSpellCheckerWindow::QtSpellCheckerWindow(SettingsProvider* settings, QWidget* parent) : QDialog(parent) {
settings_ = settings;
ui_.setupUi(this);
+#ifdef HAVE_HUNSPELL
+ ui_.hunspellOptions->show();
+#else
+ ui_.hunspellOptions->hide();
+ QTimer::singleShot(0, this, SLOT(shrinkWindow()));
+#endif
connect(ui_.spellChecker, SIGNAL(toggled(bool)), this, SLOT(handleChecker(bool)));
connect(ui_.cancel, SIGNAL(clicked()), this, SLOT(handleCancel()));
connect(ui_.apply, SIGNAL(clicked()), this, SLOT(handleApply()));
@@ -28,6 +35,10 @@ QtSpellCheckerWindow::QtSpellCheckerWindow(SettingsProvider* settings, QWidget*
setFromSettings();
}
+void QtSpellCheckerWindow::shrinkWindow() {
+ resize(0,0);
+}
+
void QtSpellCheckerWindow::setFromSettings() {
ui_.spellChecker->setChecked(settings_->getSetting(SettingConstants::SPELL_CHECKER));
ui_.pathContent->setText(P2QSTRING(settings_->getSetting(SettingConstants::DICT_PATH)));