if (ECM_FOUND)
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
- endif()
-
- if (WITH_KDE)
- find_package(KF5 COMPONENTS ConfigWidgets CoreAddons Notifications NotifyConfig TextWidgets WidgetsAddons XmlGui QUIET)
- set_package_properties(KF5 PROPERTIES TYPE REQUIRED
- URL "http://www.kde.org"
- DESCRIPTION "KDE Frameworks"
- PURPOSE "Required for integration into the Plasma desktop"
- )
-
- endif()
+ if (WITH_KDE)
+ find_package(KF5 COMPONENTS ConfigWidgets CoreAddons Notifications NotifyConfig TextWidgets WidgetsAddons XmlGui QUIET)
+ set_package_properties(KF5 PROPERTIES TYPE REQUIRED
+ URL "http://www.kde.org"
+ DESCRIPTION "KDE Frameworks"
+ PURPOSE "Required for integration into the Plasma desktop"
+ )
+ else(WITH_KDE)
+ find_package(KF5Sonnet QUIET)
+ set_package_properties(KF5Sonnet PROPERTIES TYPE RECOMMENDED
+ URL "http://api.kde.org/frameworks-api/frameworks5-apidocs/sonnet/html"
+ DESCRIPTION "framework for providing spell-checking capabilities"
+ PURPOSE "Enables spell-checking support in input widgets"
+ )
+ endif(WITH_KDE)
+ endif(ECM_FOUND)
endif(BUILD_GUI)
list(APPEND LIBS "/System/Library/Frameworks/Foundation.framework")
endif()
+if (KF5Sonnet_FOUND)
+ add_definitions(-DHAVE_SONNET)
+ list(APPEND SOURCES settingspages/sonnetsettingspage.cpp)
+ list(APPEND LIBS KF5::SonnetUi)
+endif()
+
foreach(FORM ${FORMS})
set(FORMPATH ${FORMPATH} ui/${FORM})
endforeach(FORM ${FORMS})
# include "settingspages/shortcutssettingspage.h"
#endif
+#ifdef HAVE_SONNET
+# include "settingspages/sonnetsettingspage.h"
+#endif
+
+
MainWin::MainWin(QWidget *parent)
#ifdef HAVE_KDE
: KMainWindow(parent), _kHelpMenu(new KHelpMenu(this)),
dlg->registerSettingsPage(new BufferViewSettingsPage(dlg));
dlg->registerSettingsPage(new InputWidgetSettingsPage(dlg));
dlg->registerSettingsPage(new TopicWidgetSettingsPage(dlg));
+#ifdef HAVE_SONNET
+ dlg->registerSettingsPage(new SonnetSettingsPage(dlg));
+#endif
dlg->registerSettingsPage(new HighlightSettingsPage(dlg));
dlg->registerSettingsPage(new NotificationsSettingsPage(dlg));
dlg->registerSettingsPage(new BacklogSettingsPage(dlg));
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-2014 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#include "sonnetsettingspage.h"
+
+#include <QVBoxLayout>
+
+#include "qtui.h"
+
+SonnetSettingsPage::SonnetSettingsPage(QWidget *parent)
+ : SettingsPage(tr("Interface"), tr("Spell Checking"), parent)
+{
+ QVBoxLayout *layout = new QVBoxLayout(this);
+ _configWidget = new Sonnet::ConfigWidget(this);
+ layout->addWidget(_configWidget);
+ connect(_configWidget, SIGNAL(configChanged()), SLOT(widgetHasChanged()));
+}
+
+
+bool SonnetSettingsPage::hasDefaults() const
+{
+ return true;
+}
+
+
+void SonnetSettingsPage::defaults()
+{
+ _configWidget->slotDefault();
+ widgetHasChanged();
+}
+
+
+void SonnetSettingsPage::load()
+{
+
+}
+
+
+void SonnetSettingsPage::save()
+{
+ _configWidget->save();
+ setChangedState(false);
+}
+
+
+void SonnetSettingsPage::widgetHasChanged()
+{
+ if (!hasChanged())
+ setChangedState(true);
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-2014 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#pragma once
+
+#include <Sonnet/ConfigWidget>
+
+#include "settingspage.h"
+
+//! A settings page for configuring the Sonnet spell-checking engine
+class SonnetSettingsPage : public SettingsPage
+{
+ Q_OBJECT
+
+public:
+ SonnetSettingsPage(QWidget *parent = 0);
+
+ bool hasDefaults() const;
+
+public slots:
+ void save();
+ void load();
+ void defaults();
+
+private slots:
+ void widgetHasChanged();
+
+private:
+ Sonnet::ConfigWidget *_configWidget;
+};
if (WITH_KF5)
target_link_libraries(mod_uisupport KF5::CoreAddons KF5::TextWidgets KF5::XmlGui)
+elseif (KF5Sonnet_FOUND)
+ add_definitions(-DHAVE_SONNET)
+ target_link_libraries(mod_uisupport KF5::SonnetUi)
endif()
***************************************************************************/
#include <QApplication>
-#include <QMenu>
#include <QMessageBox>
#include <QScrollBar>
+#ifdef HAVE_SONNET
+# include <Sonnet/SpellCheckDecorator>
+#endif
+
#include "actioncollection.h"
#include "bufferview.h"
#include "graphicalui.h"
enableFindReplace(false);
#endif
+#ifdef HAVE_SONNET
+ new Sonnet::SpellCheckDecorator(this);
+#endif
+
setMode(SingleLine);
setLineWrapEnabled(false);
reset();