summaryrefslogtreecommitdiffstats
blob: 45aa32f231d15e7ea6dc33b9624219cd0be00ced (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright (c) 2011 Vlad Voicu
 * Licensed under the Simplified BSD license.
 * See Documentation/Licenses/BSD-simplified.txt for more information.
 */

#include "Swift/QtUI/QtSpellCheckerWindow.h"

#include <Swift/Controllers/Settings/SettingsProvider.h>
#include <Swift/Controllers/SettingConstants.h>
#include <Swift/QtUI/QtUISettingConstants.h>

#include <QCoreApplication>
#include <QFileDialog>

namespace Swift {

QtSpellCheckerWindow::QtSpellCheckerWindow(SettingsProvider* settings, QWidget* parent) : QDialog(parent) {
	settings_ = settings;
	ui_.setupUi(this);
	connect(ui_.spellCheckerEnabled, SIGNAL(toggled(bool)), this, SLOT(handleChecker(bool)));
	ui_.spellCheckerEnabled->setChecked(settings_->getSetting(SettingConstants::SPELL_CHECKER));
	//QString filename = QFileDialog::getOpenFileName(this, tr("Select Dictionaries"), "/home", tr("Images (*.aff, *.dic"));
}

void QtSpellCheckerWindow::handleChecker(bool state) {
		settings_->storeSetting(SettingConstants::SPELL_CHECKER, state);
}

}