From 92640bf4e5ff215b9e83e64d78777c7b163409db Mon Sep 17 00:00:00 2001 From: Kevin Smith Date: Sun, 31 Mar 2013 17:14:06 +0100 Subject: Hide spell checking options when it's not hunspell Change-Id: Ia127b744e70c46495c45b8976501b7a5e52a93e8 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 #include #include +#include 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))); diff --git a/Swift/QtUI/QtSpellCheckerWindow.h b/Swift/QtUI/QtSpellCheckerWindow.h index ad94907..7b63318 100644 --- a/Swift/QtUI/QtSpellCheckerWindow.h +++ b/Swift/QtUI/QtSpellCheckerWindow.h @@ -22,7 +22,8 @@ namespace Swift { void handlePathButton(); void handlePersonalPathButton(); void handleApply(); - + private slots: + void shrinkWindow(); private: void setEnabled(bool state); void setFromSettings(); diff --git a/Swift/QtUI/QtSpellCheckerWindow.ui b/Swift/QtUI/QtSpellCheckerWindow.ui index b98bb6d..b7f5161 100644 --- a/Swift/QtUI/QtSpellCheckerWindow.ui +++ b/Swift/QtUI/QtSpellCheckerWindow.ui @@ -6,15 +6,81 @@ 0 0 - 353 - 207 + 399 + 265 Dialog - - + + + + + Spell Checker Enabled + + + + + + + + + + + + Dictionary Path: + + + + + + + + + + Change + + + + + + + + + + + Current Language: + + + + + + + + + + + + + + + + + + Language: + + + + + + + + + + + + @@ -32,54 +98,6 @@ - - - - Spell Checker Enabled - - - - - - - Dictionary Path: - - - - - - - - - - Change - - - - - - - Current Language: - - - - - - - - - - - - - - - - - Language: - - - -- cgit v0.10.2-6-g49f6