Add a settingspage for configuring the input widget
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 18 Aug 2009 21:19:20 +0000 (23:19 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 18 Aug 2009 21:19:20 +0000 (23:19 +0200)
Centralize the now-scattered input-line related settings in their own settingspage;
also add some new options.

15 files changed:
src/qtui/inputwidget.cpp
src/qtui/inputwidget.h
src/qtui/mainwin.cpp
src/qtui/settingspages/appearancesettingspage.cpp
src/qtui/settingspages/appearancesettingspage.h
src/qtui/settingspages/appearancesettingspage.ui
src/qtui/settingspages/generalsettingspage.cpp
src/qtui/settingspages/generalsettingspage.ui
src/qtui/settingspages/inputwidgetsettingspage.cpp [new file with mode: 0644]
src/qtui/settingspages/inputwidgetsettingspage.h [new file with mode: 0644]
src/qtui/settingspages/inputwidgetsettingspage.ui [new file with mode: 0644]
src/qtui/settingspages/itemviewsettingspage.h
src/qtui/settingspages/settingspages.inc
src/uisupport/multilineedit.cpp
src/uisupport/multilineedit.h

index dc8b6a6..7534ab6 100644 (file)
@@ -56,9 +56,25 @@ InputWidget::InputWidget(QWidget *parent)
 
   new TabCompleter(ui.inputEdit);
 
-  QtUiStyleSettings s("Fonts");
-  s.notify("InputLine", this, SLOT(setCustomFont(QVariant)));
-  setCustomFont(s.value("InputLine", QFont()));
+  UiStyleSettings fs("Fonts");
+  fs.notify("InputWidget", this, SLOT(setCustomFont(QVariant)));
+  setCustomFont(fs.value("InputWidget", QFont()));
+
+  UiSettings s("InputWidget");
+
+#ifdef HAVE_KDE
+  s.notify("EnableSpellCheck", this, SLOT(setEnableSpellCheck(QVariant)));
+  setEnableSpellCheck(s.value("EnableSpellCheck", false));
+#endif
+
+  s.notify("ShowNickSelector", this, SLOT(setShowNickSelector(QVariant)));
+  setShowNickSelector(s.value("ShowNickSelector", true));
+
+  s.notify("MaxNumLines", this, SLOT(setMaxLines(QVariant)));
+  setMaxLines(s.value("MaxNumLines", 5));
+
+  s.notify("EnableScrollBars", this, SLOT(setEnableScrollBars(QVariant)));
+  setEnableScrollBars(s.value("EnableScrollBars", true));
 
   ActionCollection *coll = QtUi::actionCollection();
 
@@ -78,6 +94,22 @@ void InputWidget::setCustomFont(const QVariant &v) {
   ui.inputEdit->setCustomFont(font);
 }
 
+void InputWidget::setEnableSpellCheck(const QVariant &v) {
+  ui.inputEdit->enableSpellCheck(v.toBool());
+}
+
+void InputWidget::setShowNickSelector(const QVariant &v) {
+  ui.ownNick->setVisible(v.toBool());
+}
+
+void InputWidget::setMaxLines(const QVariant &v) {
+  ui.inputEdit->setMaxHeight(v.toInt());
+}
+
+void InputWidget::setEnableScrollBars(const QVariant &v) {
+  ui.inputEdit->enableScrollBars(v.toBool());
+}
+
 bool InputWidget::eventFilter(QObject *watched, QEvent *event) {
   if(event->type() != QEvent::KeyPress)
     return false;
index d60ee34..aeb63f8 100644 (file)
@@ -53,6 +53,11 @@ protected slots:
 
 private slots:
   void setCustomFont(const QVariant &font);
+  void setEnableSpellCheck(const QVariant &);
+  void setShowNickSelector(const QVariant &);
+  void setMaxLines(const QVariant &);
+  void setEnableScrollBars(const QVariant &);
+
   void sendText(const QString &text) const;
   void changeNick(const QString &newNick) const;
 
index 07d2bae..b56c794 100644 (file)
 #include "settingspages/generalsettingspage.h"
 #include "settingspages/highlightsettingspage.h"
 #include "settingspages/identitiessettingspage.h"
+#include "settingspages/inputwidgetsettingspage.h"
 #include "settingspages/itemviewsettingspage.h"
 #include "settingspages/networkssettingspage.h"
 #include "settingspages/notificationssettingspage.h"
@@ -807,10 +808,11 @@ void MainWin::awayLogDestroyed() {
 void MainWin::showSettingsDlg() {
   SettingsDlg *dlg = new SettingsDlg();
 
-  //Category: Appearance
+  //Category: Interface
   dlg->registerSettingsPage(new AppearanceSettingsPage(dlg));
   dlg->registerSettingsPage(new ChatViewSettingsPage(dlg));
   dlg->registerSettingsPage(new ItemViewSettingsPage(dlg));
+  dlg->registerSettingsPage(new InputWidgetSettingsPage(dlg));
   dlg->registerSettingsPage(new HighlightSettingsPage(dlg));
   dlg->registerSettingsPage(new NotificationsSettingsPage(dlg));
   dlg->registerSettingsPage(new BacklogSettingsPage(dlg));
index ab39344..228fe40 100644 (file)
 
 #include "appearancesettingspage.h"
 
-#include "buffersettings.h"
-#include "chatviewsettings.h"
 #include "qtui.h"
 #include "qtuisettings.h"
 #include "qtuistyle.h"
-#include "util.h"
 
 #include <QCheckBox>
-#include <QDir>
 #include <QFileDialog>
-#include <QFontDialog>
-#include <QSignalMapper>
 #include <QStyleFactory>
 
 AppearanceSettingsPage::AppearanceSettingsPage(QWidget *parent)
-  : SettingsPage(tr("Interface"), QString(), parent),
-  _fontsChanged(false)
+  : SettingsPage(tr("Interface"), QString(), parent)
 {
   ui.setupUi(this);
   initAutoWidgets();
@@ -50,13 +43,6 @@ AppearanceSettingsPage::AppearanceSettingsPage(QWidget *parent)
     connect(checkBox, SIGNAL(clicked()), this, SLOT(widgetHasChanged()));
   }
 
-  mapper = new QSignalMapper(this);
-  connect(mapper, SIGNAL(mapped(QWidget *)), this, SLOT(chooseFont(QWidget *)));
-
-  connect(ui.chooseInputLine, SIGNAL(clicked()), mapper, SLOT(map()));
-
-  mapper->setMapping(ui.chooseInputLine, ui.demoInputLine);
-
   connect(ui.chooseStyleSheet, SIGNAL(clicked()), SLOT(chooseStyleSheet()));
 }
 
@@ -83,9 +69,6 @@ void AppearanceSettingsPage::initLanguageComboBox() {
 void AppearanceSettingsPage::defaults() {
   ui.styleComboBox->setCurrentIndex(0);
 
-  loadFonts(Settings::Default);
-  _fontsChanged = true;
-
   SettingsPage::defaults();
   widgetHasChanged();
 }
@@ -114,23 +97,10 @@ void AppearanceSettingsPage::load() {
   ui.languageComboBox->setProperty("storedValue", ui.languageComboBox->currentIndex());
   Quassel::loadTranslation(selectedLocale());
 
-  loadFonts(Settings::Custom);
-
   SettingsPage::load();
   setChangedState(false);
 }
 
-void AppearanceSettingsPage::loadFonts(Settings::Mode mode) {
-  QtUiStyleSettings s("Fonts");
-
-  QFont inputLineFont;
-  if(mode == Settings::Custom)
-    inputLineFont = s.value("InputLine", QFont()).value<QFont>();
-  setFont(ui.demoInputLine, inputLineFont);
-
-  _fontsChanged = false;
-}
-
 void AppearanceSettingsPage::save() {
   QtUiSettings uiSettings;
 
@@ -146,15 +116,6 @@ void AppearanceSettingsPage::save() {
     uiSettings.setValue("Locale", selectedLocale());
   }
 
-  // Fonts
-  QtUiStyleSettings fontSettings("Fonts");
-  if(ui.demoInputLine->font() != QApplication::font())
-    fontSettings.setValue("InputLine", ui.demoInputLine->font());
-  else
-    fontSettings.setValue("InputLine", "");
-
-  _fontsChanged = false;
-
   bool needsStyleReload =
         ui.useCustomStyleSheet->isChecked() != ui.useCustomStyleSheet->property("storedValue").toBool()
     || (ui.useCustomStyleSheet->isChecked() && ui.customStyleSheetPath->text() != ui.customStyleSheetPath->property("storedValue").toString());
@@ -178,26 +139,6 @@ QLocale AppearanceSettingsPage::selectedLocale() const {
   return locale;
 }
 
-void AppearanceSettingsPage::setFont(QLabel *label, const QFont &font_) {
-  QFont font = font_;
-  if(font.family().isEmpty())
-    font = QApplication::font();
-  label->setFont(font);
-  label->setText(QString("%1 %2").arg(font.family()).arg(font.pointSize()));
-  widgetHasChanged();
-}
-
-void AppearanceSettingsPage::chooseFont(QWidget *widget) {
-  QLabel *label = qobject_cast<QLabel *>(widget);
-  Q_ASSERT(label);
-  bool ok;
-  QFont font = QFontDialog::getFont(&ok, label->font());
-  if(ok) {
-    _fontsChanged = true;
-    setFont(label, font);
-  }
-}
-
 void AppearanceSettingsPage::chooseStyleSheet() {
   QString name = QFileDialog::getOpenFileName(this, tr("Please choose a stylesheet file"), QString(), "*.qss");
   if(!name.isEmpty())
@@ -209,8 +150,6 @@ void AppearanceSettingsPage::widgetHasChanged() {
 }
 
 bool AppearanceSettingsPage::testHasChanged() {
-  if(_fontsChanged) return true; // comparisons are nasty for now
-
   if(ui.styleComboBox->currentIndex() != ui.styleComboBox->property("storedValue").toInt()) return true;
 
   if(selectedLocale() != QLocale()) return true; // QLocale() returns the default locale (manipulated via loadTranslation())
index 302d78b..a6fffa2 100644 (file)
@@ -30,8 +30,6 @@
 #include "settingspage.h"
 #include "ui_appearancesettingspage.h"
 
-class QSignalMapper;
-
 class AppearanceSettingsPage : public SettingsPage {
   Q_OBJECT
 
@@ -48,10 +46,6 @@ public slots:
 private slots:
   void widgetHasChanged();
 
-  void loadFonts(Settings::Mode mode);
-  void setFont(QLabel *label, const QFont &font);
-  void chooseFont(QWidget *label);
-
   void chooseStyleSheet();
 
 private:
@@ -59,13 +53,10 @@ private:
   void initStyleComboBox();
   void initLanguageComboBox();
   QLocale selectedLocale() const;
-  void clearFontFromFormat(QTextCharFormat &fmt);
 
   Ui::AppearanceSettingsPage ui;
   QHash<QString, QVariant> settings;
   QList<QLocale> _locales;
-  QSignalMapper *mapper;
-  bool _fontsChanged;
 };
 
 #endif
index 9c48419..2bc0409 100644 (file)
      </layout>
     </widget>
    </item>
-   <item>
-    <widget class="QGroupBox" name="groupBox_4">
-     <property name="enabled">
-      <bool>true</bool>
-     </property>
-     <property name="title">
-      <string>Fonts</string>
-     </property>
-     <layout class="QGridLayout" name="gridLayout">
-      <item row="0" column="0">
-       <widget class="QLabel" name="label_3">
-        <property name="toolTip">
-         <string>Set font for the input line</string>
-        </property>
-        <property name="text">
-         <string>Input line:</string>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="1">
-       <widget class="QLabel" name="demoInputLine">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="toolTip">
-         <string>Set font for the input line</string>
-        </property>
-        <property name="frameShape">
-         <enum>QFrame::StyledPanel</enum>
-        </property>
-        <property name="frameShadow">
-         <enum>QFrame::Sunken</enum>
-        </property>
-        <property name="text">
-         <string>Font</string>
-        </property>
-        <property name="alignment">
-         <set>Qt::AlignCenter</set>
-        </property>
-       </widget>
-      </item>
-      <item row="0" column="2">
-       <widget class="QPushButton" name="chooseInputLine">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="text">
-         <string>Choose...</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
    <item>
     <spacer name="verticalSpacer">
      <property name="orientation">
index 9888235..a16e1b6 100644 (file)
@@ -49,8 +49,6 @@ GeneralSettingsPage::GeneralSettingsPage(QWidget *parent)
   connect(ui.errorMsgsInDefaultBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
   connect(ui.errorMsgsInStatusBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
   connect(ui.errorMsgsInCurrentBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
-
-  connect(ui.completionSuffix, SIGNAL(textEdited(const QString&)), this, SLOT(widgetHasChanged()));
 }
 
 bool GeneralSettingsPage::hasDefaults() const {
@@ -74,8 +72,6 @@ void GeneralSettingsPage::defaults() {
   ui.errorMsgsInStatusBuffer->setChecked(false);
   ui.errorMsgsInCurrentBuffer->setChecked(false);
 
-  ui.completionSuffix->setText(": ");
-
   widgetHasChanged();
 }
 
@@ -107,11 +103,6 @@ void GeneralSettingsPage::load() {
   SettingsPage::load(ui.errorMsgsInStatusBuffer, redirectTarget & BufferSettings::StatusBuffer);
   SettingsPage::load(ui.errorMsgsInCurrentBuffer, redirectTarget & BufferSettings::CurrentBuffer);
 
-  // completion settings
-  TabCompletionSettings completionSettings;
-  settings["CompletionSuffix"] = completionSettings.completionSuffix();
-  ui.completionSuffix->setText(settings["CompletionSuffix"].toString());
-
   setChangedState(false);
 }
 
@@ -152,10 +143,6 @@ void GeneralSettingsPage::save() {
     redirectTarget |= BufferSettings::CurrentBuffer;
   bufferSettings.setErrorMsgsTarget(redirectTarget);
 
-  TabCompletionSettings completionSettings;
-  completionSettings.setCompletionSuffix(ui.completionSuffix->text());
-
-
   load();
   setChangedState(false);
 }
@@ -185,7 +172,5 @@ bool GeneralSettingsPage::testHasChanged() {
   if(SettingsPage::hasChanged(ui.errorMsgsInDefaultBuffer)) return true;
   if(SettingsPage::hasChanged(ui.errorMsgsInCurrentBuffer)) return true;
 
-  if(settings["CompletionSuffix"].toString() != ui.completionSuffix->text()) return true;
-
   return false;
 }
index cca69d4..45103dc 100644 (file)
      </layout>
     </widget>
    </item>
-   <item>
-    <widget class="QGroupBox" name="inputLineGroup">
-     <property name="toolTip">
-      <string>The suffix appended to a nick on completion via TAB. Default is &quot;: &quot;</string>
-     </property>
-     <property name="title">
-      <string>Input Line</string>
-     </property>
-     <layout class="QVBoxLayout" name="verticalLayout">
-      <item>
-       <layout class="QHBoxLayout" name="horizontalLayout">
-        <item>
-         <widget class="QLabel" name="completionSuffixDesc">
-          <property name="text">
-           <string>Completion suffix:</string>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <widget class="QLineEdit" name="completionSuffix">
-          <property name="sizePolicy">
-           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-            <horstretch>0</horstretch>
-            <verstretch>0</verstretch>
-           </sizepolicy>
-          </property>
-         </widget>
-        </item>
-        <item>
-         <spacer name="horizontalSpacer">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeType">
-           <enum>QSizePolicy::MinimumExpanding</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>157</width>
-            <height>27</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
-       </layout>
-      </item>
-     </layout>
-    </widget>
-   </item>
    <item>
     <spacer name="verticalSpacer">
      <property name="orientation">
diff --git a/src/qtui/settingspages/inputwidgetsettingspage.cpp b/src/qtui/settingspages/inputwidgetsettingspage.cpp
new file mode 100644 (file)
index 0000000..02f4c25
--- /dev/null
@@ -0,0 +1,32 @@
+/***************************************************************************
+ *   Copyright (C) 2005-09 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.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+#include "inputwidgetsettingspage.h"
+
+InputWidgetSettingsPage::InputWidgetSettingsPage(QWidget *parent)
+  : SettingsPage(tr("Interface"), tr("Input Widget"), parent)
+{
+  ui.setupUi(this);
+
+#ifndef HAVE_KDE
+  ui.enableSpellCheck->hide();
+#endif
+
+  initAutoWidgets();
+}
diff --git a/src/qtui/settingspages/inputwidgetsettingspage.h b/src/qtui/settingspages/inputwidgetsettingspage.h
new file mode 100644 (file)
index 0000000..a42a591
--- /dev/null
@@ -0,0 +1,41 @@
+/***************************************************************************
+ *   Copyright (C) 2005-09 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.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef INPUTLINESETTINGSPAGE_H_
+#define INPUTLINESETTINGSPAGE_H_
+
+#include "settingspage.h"
+#include "ui_inputwidgetsettingspage.h"
+
+class InputWidgetSettingsPage : public SettingsPage {
+  Q_OBJECT
+
+public:
+  InputWidgetSettingsPage(QWidget *parent = 0);
+
+  inline bool hasDefaults() const { return true; }
+
+private:
+  Ui::InputWidgetSettingsPage ui;
+
+  inline QString settingsKey() const { return QString("InputWidget"); }
+};
+
+#endif
diff --git a/src/qtui/settingspages/inputwidgetsettingspage.ui b/src/qtui/settingspages/inputwidgetsettingspage.ui
new file mode 100644 (file)
index 0000000..92aea26
--- /dev/null
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>InputWidgetSettingsPage</class>
+ <widget class="QWidget" name="InputWidgetSettingsPage">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>507</width>
+    <height>514</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QCheckBox" name="customFont">
+       <property name="text">
+        <string>Custom font:</string>
+       </property>
+       <property name="settingsKey" stdset="0">
+        <string>/UiStyle/Fonts/UseCustomInputWidgetFont</string>
+       </property>
+       <property name="defaultValue" stdset="0">
+        <bool>false</bool>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="FontSelector" name="inputLineFont" native="true">
+       <property name="enabled">
+        <bool>false</bool>
+       </property>
+       <property name="settingsKey" stdset="0">
+        <string>/UiStyle/Fonts/InputWidget</string>
+       </property>
+       <property name="defaultValue" stdset="0">
+        <font/>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="enableSpellCheck">
+     <property name="text">
+      <string>Enable spell check</string>
+     </property>
+     <property name="settingsKey" stdset="0">
+      <string>EnableSpellCheck</string>
+     </property>
+     <property name="defaultValue" stdset="0">
+      <bool>false</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="showNickSelector">
+     <property name="text">
+      <string>Show nick selector</string>
+     </property>
+     <property name="checked">
+      <bool>true</bool>
+     </property>
+     <property name="settingsKey" stdset="0">
+      <string>ShowNickSelector</string>
+     </property>
+     <property name="defaultValue" stdset="0">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Multi-Line Editing</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout">
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
+        <item>
+         <widget class="QLabel" name="label">
+          <property name="text">
+           <string>Show at most</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QSpinBox" name="maxNumLines">
+          <property name="minimum">
+           <number>1</number>
+          </property>
+          <property name="maximum">
+           <number>19</number>
+          </property>
+          <property name="value">
+           <number>5</number>
+          </property>
+          <property name="settingsKey" stdset="0">
+           <string>MaxNumLines</string>
+          </property>
+          <property name="defaultValue" stdset="0">
+           <number>5</number>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLabel" name="label_2">
+          <property name="text">
+           <string>lines</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer_2">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <widget class="QCheckBox" name="enableScrollBars">
+        <property name="text">
+         <string>Enable scrollbars</string>
+        </property>
+        <property name="checked">
+         <bool>true</bool>
+        </property>
+        <property name="settingsKey" stdset="0">
+         <string>EnableScrollBars</string>
+        </property>
+        <property name="defaultValue" stdset="0">
+         <bool>true</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>Tab Completion</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_3">
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_3">
+        <item>
+         <widget class="QLabel" name="completionSuffixDesc">
+          <property name="text">
+           <string>Completion suffix:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLineEdit" name="completionSuffix">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="settingsKey" stdset="0">
+           <string>/TabCompletion/CompletionSuffix</string>
+          </property>
+          <property name="defaultValue" stdset="0">
+           <string>: </string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeType">
+           <enum>QSizePolicy::MinimumExpanding</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>157</width>
+            <height>27</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>233</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>FontSelector</class>
+   <extends>QWidget</extends>
+   <header>fontselector.h</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <tabstops>
+  <tabstop>customFont</tabstop>
+  <tabstop>enableSpellCheck</tabstop>
+  <tabstop>showNickSelector</tabstop>
+  <tabstop>maxNumLines</tabstop>
+  <tabstop>enableScrollBars</tabstop>
+  <tabstop>completionSuffix</tabstop>
+ </tabstops>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>customFont</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>inputLineFont</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>165</x>
+     <y>18</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>305</x>
+     <y>17</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
index 4b184c4..0eed0a9 100644 (file)
@@ -48,7 +48,7 @@ private:
   QTreeWidgetItem *_networkItem, *_defaultBufferItem, *_inactiveBufferItem,
                   *_activeBufferItem, *_unreadBufferItem, *_highlightedBufferItem;
 
-  inline QString settingsKey() const { return QString("ItemViews"); }
+  inline QString settingsKey() const { return QString("InputLine"); }
 };
 
 #endif
index 3e0fb19..66ca1f2 100644 (file)
@@ -1,7 +1,7 @@
 # Putting $FOO in SETTINGSPAGES automatically includes
 # $FOOsettingspage.cpp, $FOOsettingspage.h and $FOOsettingspage.ui
 
-set(SETTINGSPAGES aliases appearance backlog bufferview chatview connection chatmonitor general highlight identities itemview networks)
+set(SETTINGSPAGES aliases appearance backlog bufferview chatview connection chatmonitor general highlight identities inputwidget itemview networks)
 
 # Specify additional files (e.g. for subdialogs) here!
 set(SP_SOURCES aliasesmodel.cpp identityeditwidget.cpp notificationssettingspage.cpp)
index 77e2cc6..a79ef28 100644 (file)
@@ -151,6 +151,14 @@ QSize MultiLineEdit::minimumSizeHint() const {
   return sizeHint();
 }
 
+void MultiLineEdit::enableSpellCheck(bool enable) {
+#ifdef HAVE_KDE
+  setCheckSpellingEnabled(enable);
+#else
+  Q_UNUSED(enable)
+#endif
+}
+
 void MultiLineEdit::historyMoveBack() {
   addToHistory(text(), true);
 
index 4a578fa..67264dd 100644 (file)
@@ -68,6 +68,7 @@ public slots:
   void setMinHeight(int numLines);
   void setMaxHeight(int numLines);
   void enableScrollBars(bool enable = true);
+  void enableSpellCheck(bool enable = true);
 
 signals:
   void textEntered(const QString &text);