--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel IRC Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Blank Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * 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 Blank Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Blank 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 "blanksettingspage.h"
+
+#include "qtui.h"
+#include "uisettings.h"
+
+
+BlankSettingsPage::BlankSettingsPage(QWidget *parent)
+ : SettingsPage(tr("Behaviour"), tr("Blank"), parent) {
+ ui.setupUi(this);
+
+ connect(ui.exampleCheckbox, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+}
+
+bool BlankSettingsPage::hasDefaults() const {
+ return true;
+}
+
+void BlankSettingsPage::defaults() {
+ ui.exampleCheckbox->setChecked(true);
+
+ widgetHasChanged();
+}
+
+void BlankSettingsPage::load() {
+ UiSettings uiSettings;
+
+ settings["exampleCheckbox"] = uiSettings.value("exampleCheckbox", QVariant(false));
+ ui.exampleCheckbox->setChecked(settings["exampleCheckbox"].toBool());
+
+ setChangedState(false);
+}
+
+void BlankSettingsPage::save() {
+ UiSettings uiSettings;
+ uiSettings.setValue("exampleCheckbox", ui.exampleCheckbox->isChecked());
+
+ load();
+ setChangedState(false);
+}
+
+void BlankSettingsPage::widgetHasChanged() {
+ bool changed = testHasChanged();
+ if(changed != hasChanged()) setChangedState(changed);
+}
+
+bool BlankSettingsPage::testHasChanged() {
+ if(settings["exampleCheckbox"].toBool() != ui.exampleCheckbox->isChecked()) return true;
+
+ return false;
+}
+
+
+
+
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel IRC Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Blank Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * 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 Blank Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Blank 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 _BLANKSETTINGSPAGE_H_
+#define _BLANKSETTINGSPAGE_H_
+
+#include <QHash>
+
+#include "settingspage.h"
+#include "ui_blanksettingspage.h"
+
+class BlankSettingsPage : public SettingsPage {
+ Q_OBJECT
+
+ public:
+ BlankSettingsPage(QWidget *parent = 0);
+
+ bool hasDefaults() const;
+
+ public slots:
+ void save();
+ void load();
+ void defaults();
+
+ private slots:
+ void widgetHasChanged();
+
+ private:
+ Ui::BlankSettingsPage ui;
+ QHash<QString, QVariant> settings;
+
+ bool testHasChanged();
+};
+
+#endif
#include "selectionmodelsynchronizer.h"
#include "mappedselectionmodel.h"
+#include "settingspages/appearancesettingspage.h"
#include "settingspages/bufferviewsettingspage.h"
#include "settingspages/colorsettingspage.h"
#include "settingspages/fontssettingspage.h"
statusBar()->showMessage(tr("Waiting for core..."));
installEventFilter(new JumpKeyHandler(this));
-
+
UiSettings uiSettings;
QString style = uiSettings.value("Style", QString("")).toString();
if(style != "") {
//Category: Behaviour
settingsDlg->registerSettingsPage(new GeneralSettingsPage(settingsDlg));
//Category: General
+ settingsDlg->registerSettingsPage(new AppearanceSettingsPage(settingsDlg));
settingsDlg->registerSettingsPage(new IdentitiesSettingsPage(settingsDlg));
settingsDlg->registerSettingsPage(new NetworksSettingsPage(settingsDlg));
// settingsDlg->registerSettingsPage(new BufferViewSettingsPage(settingsDlg));
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel IRC Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Appearance Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * 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 Appearance Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Appearance 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 "appearancesettingspage.h"
+
+#include "qtui.h"
+#include "uisettings.h"
+
+#include <QStyleFactory>
+
+AppearanceSettingsPage::AppearanceSettingsPage(QWidget *parent)
+ : SettingsPage(tr("General"), tr("Appearance"), parent) {
+ ui.setupUi(this);
+ initStyleComboBox();
+
+ connect(ui.styleComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(widgetHasChanged()));
+}
+
+void AppearanceSettingsPage::initStyleComboBox() {
+ QStringList styleList = QStyleFactory::keys();
+ ui.styleComboBox->addItem("<default>");
+ foreach(QString style, styleList) {
+ ui.styleComboBox->addItem(style);
+ }
+}
+
+bool AppearanceSettingsPage::hasDefaults() const {
+ return true;
+}
+
+void AppearanceSettingsPage::defaults() {
+ ui.styleComboBox->setCurrentIndex(0);
+
+ widgetHasChanged();
+}
+
+void AppearanceSettingsPage::load() {
+ UiSettings uiSettings;
+
+ settings["Style"] = uiSettings.value("Style", QString(""));
+ if(settings["Style"].toString() == "") {
+ ui.styleComboBox->setCurrentIndex(0);
+ } else {
+ ui.styleComboBox->setCurrentIndex(ui.styleComboBox->findText(settings["Style"].toString(), Qt::MatchExactly));
+ QApplication::setStyle(settings["Style"].toString());
+ }
+
+ setChangedState(false);
+}
+
+void AppearanceSettingsPage::save() {
+ UiSettings uiSettings;
+
+ if(ui.styleComboBox->currentIndex() < 1) {
+ uiSettings.setValue("Style", QString(""));
+ } else {
+ uiSettings.setValue("Style", ui.styleComboBox->currentText());
+ }
+
+ load();
+ setChangedState(false);
+}
+
+void AppearanceSettingsPage::widgetHasChanged() {
+ bool changed = testHasChanged();
+ if(changed != hasChanged()) setChangedState(changed);
+}
+
+bool AppearanceSettingsPage::testHasChanged() {
+ if(settings["Style"].toString() != ui.styleComboBox->currentText()) return true;
+
+ return false;
+}
+
+
+
+
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel IRC Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU Appearance Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * 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 Appearance Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Appearance 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 _APPEARANCESETTINGSPAGE_H_
+#define _APPEARANCESETTINGSPAGE_H_
+
+#include <QHash>
+
+#include "settingspage.h"
+#include "ui_appearancesettingspage.h"
+
+class AppearanceSettingsPage : public SettingsPage {
+ Q_OBJECT
+
+ public:
+ AppearanceSettingsPage(QWidget *parent = 0);
+
+ bool hasDefaults() const;
+
+ public slots:
+ void save();
+ void load();
+ void defaults();
+
+ private slots:
+ void widgetHasChanged();
+
+ private:
+ Ui::AppearanceSettingsPage ui;
+ QHash<QString, QVariant> settings;
+
+ bool testHasChanged();
+ void initStyleComboBox();
+};
+
+#endif
--- /dev/null
+<ui version="4.0" >
+ <class>AppearanceSettingsPage</class>
+ <widget class="QWidget" name="AppearanceSettingsPage" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Client style:</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QComboBox" name="styleComboBox" />
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
#include "uisettings.h"
#include "buffersettings.h"
-#include <QStyleFactory>
-
GeneralSettingsPage::GeneralSettingsPage(QWidget *parent)
: SettingsPage(tr("Behaviour"), tr("General"), parent) {
ui.setupUi(this);
- initStyleComboBox();
#ifdef Q_WS_MAC
ui.useSystemTrayIcon->hide();
connect(ui.displayTopicInTooltip, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
connect(ui.mouseWheelChangesBuffers, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
-
- connect(ui.styleComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(widgetHasChanged()));
-}
-
-void GeneralSettingsPage::initStyleComboBox() {
- QStringList styleList = QStyleFactory::keys();
- ui.styleComboBox->addItem("<default>");
- foreach(QString style, styleList) {
- ui.styleComboBox->addItem(style);
- }
}
bool GeneralSettingsPage::hasDefaults() const {
ui.displayTopicInTooltip->setChecked(false);
ui.mouseWheelChangesBuffers->setChecked(true);
- ui.styleComboBox->setCurrentIndex(0);
-
widgetHasChanged();
}
settings["DisplayPopupMessages"] = uiSettings.value("DisplayPopupMessages", QVariant(true));
ui.displayPopupMessages->setChecked(settings["DisplayPopupMessages"].toBool());
- settings["Style"] = uiSettings.value("Style", QString(""));
- if(settings["Style"].toString() == "") {
- ui.styleComboBox->setCurrentIndex(0);
- } else {
- ui.styleComboBox->setCurrentIndex(ui.styleComboBox->findText(settings["Style"].toString(), Qt::MatchExactly));
- QApplication::setStyle(settings["Style"].toString());
- }
-
// bufferSettings:
BufferSettings bufferSettings;
settings["UserMessagesInStatusBuffer"] = bufferSettings.value("UserMessagesInStatusBuffer", QVariant(true));
uiSettings.setValue("AnimateTrayIcon", ui.animateTrayIcon->isChecked());
uiSettings.setValue("DisplayPopupMessages", ui.displayPopupMessages->isChecked());
- if(ui.styleComboBox->currentIndex() < 1) {
- uiSettings.setValue("Style", QString(""));
- } else {
- uiSettings.setValue("Style", ui.styleComboBox->currentText());
- }
-
BufferSettings bufferSettings;
bufferSettings.setValue("UserMessagesInStatusBuffer", ui.userMessagesInStatusBuffer->isChecked());
bufferSettings.setValue("UserMessagesInQueryBuffer", ui.userMessagesInQueryBuffer->isChecked());
if(settings["DisplayTopicInTooltip"].toBool() != ui.displayTopicInTooltip->isChecked()) return true;
if(settings["MouseWheelChangesBuffers"].toBool() != ui.mouseWheelChangesBuffers->isChecked()) return true;
- if(settings["Style"].toString() != ui.styleComboBox->currentText()) return true;
-
return false;
}
QHash<QString, QVariant> settings;
bool testHasChanged();
- void initStyleComboBox();
};
#endif
</layout>
</widget>
</item>
- <item>
- <widget class="QGroupBox" name="groupBox_4" >
- <property name="title" >
- <string>Client style:</string>
- </property>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QComboBox" name="styleComboBox" />
- </item>
- </layout>
- </widget>
- </item>
<item>
<spacer>
<property name="orientation" >
# Putting $FOO in SETTINGSPAGES automatically includes
# $FOOsettingspage.cpp, $FOOsettingspage.h and $FOOsettingspage.ui
-SETTINGSPAGES = color fonts general identities networks bufferview
+SETTINGSPAGES = appearance bufferview color fonts general identities networks
# Specify additional files (e.g. for subdialogs) here!
SP_SRCS =
quasselVersion = "0.2.0-alpha5-pre";
quasselDate = "2008-03-31";
- quasselBuild = 676;
+ quasselBuild = 677;
//! Minimum client build number the core needs
clientBuildNeeded = 642;