diff options
author | Kevin Smith <git@kismith.co.uk> | 2013-03-31 16:14:06 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2013-04-05 08:12:53 (GMT) |
commit | 92640bf4e5ff215b9e83e64d78777c7b163409db (patch) | |
tree | 6e4a9f7c7906acb12169397c5a234de48c5a5638 /Swift/QtUI/QtSpellCheckerWindow.cpp | |
parent | 7f4d4ffc8c656c5125fc3a53e5afdd4a8c5ff4f3 (diff) | |
download | swift-92640bf4e5ff215b9e83e64d78777c7b163409db.zip swift-92640bf4e5ff215b9e83e64d78777c7b163409db.tar.bz2 |
Hide spell checking options when it's not hunspell
Change-Id: Ia127b744e70c46495c45b8976501b7a5e52a93e8
Diffstat (limited to 'Swift/QtUI/QtSpellCheckerWindow.cpp')
-rw-r--r-- | Swift/QtUI/QtSpellCheckerWindow.cpp | 11 |
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))); |