src/qtui/ui/topicwidget.ui
src/qtui/ui/usermgmtpage.ui
src/uisupport
+src/uisupport/action.cpp
+src/uisupport/action.h
+src/uisupport/actioncollection.cpp
+src/uisupport/actioncollection.h
src/uisupport/bufferview.cpp
src/uisupport/bufferview.h
src/uisupport/bufferviewfilter.cpp
src/uisupport/inputline.h
src/uisupport/nickview.cpp
src/uisupport/nickview.h
+src/uisupport/settingspage.cpp
src/uisupport/tabcompleter.cpp
src/uisupport/tabcompleter.h
src/uisupport/uistyle.cpp
connect(ui.buttonBox, SIGNAL(clicked(QAbstractButton *)), this, SLOT(buttonClicked(QAbstractButton *)));
}
-/*
+
void SettingsDlg::registerSettingsPage(SettingsPage *sp) {
- QWidget *w = sp->widget();
- w->setParent(this);
- ui.settingsStack->addWidget(w);
+ sp->setParent(this);
+ ui.settingsStack->addWidget(sp);
QTreeWidgetItem *cat;
QList<QTreeWidgetItem *> cats = ui.settingsTree->findItems(sp->category(), Qt::MatchExactly);
cat->setFlags(Qt::ItemIsEnabled);
} else cat = cats[0];
QTreeWidgetItem *p = new QTreeWidgetItem(cat, QStringList(sp->title()));
- pages[QString("%1$%2").arg(sp->category()).arg(sp->title())] = sp;
+ pages[QString("%1$%2").arg(sp->category(), sp->title())] = sp;
}
void SettingsDlg::selectPage(const QString &cat, const QString &title) {
- QWidget *w = pages[QString("%1$%2").arg(cat).arg(title)]->widget();
+ QWidget *w = pages[QString("%1$%2").arg(cat, title)];
Q_ASSERT(w);
ui.settingsStack->setCurrentWidget(w);
}
//SettingsInterface *sp = qobject_cast<SettingsInterface *>(ui.settingsStack->currentWidget());
//if(sp) sp->applyChanges();
}
-*/
+
SettingsDlg(QWidget *parent = 0);
void registerSettingsPage(SettingsPage *);
void unregisterSettingsPage(SettingsPage *);
-/*
+
public slots:
void selectPage(const QString &category, const QString &title);
void itemSelected();
void buttonClicked(QAbstractButton *);
void applyChanges();
-*/
+
private:
Ui::SettingsDlg ui;
</property>
<widget class="QTreeWidget" name="settingsTree" >
<property name="sizePolicy" >
- <sizepolicy vsizetype="Expanding" hsizetype="MinimumExpanding" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
- <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok|QDialogButtonBox::Reset</set>
</property>
</widget>
</item>
--- /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 General 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 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 "settingspage.h"
+
+SettingsPage::SettingsPage(const QString &category, const QString &title, QWidget *parent) : QWidget(parent),
+ _category(category), _title(title) {
+
+}
+
+QString SettingsPage::category() const {
+ return _category;
+}
+
+QString SettingsPage::title() const {
+ return _title;
+}
+
+void SettingsPage::changed() {
+ emit changed(true);
+}
+
+void SettingsPage::changeState(bool hasChanged) {
+ emit changed(hasChanged);
+}
SettingsPage(const QString &category, const QString &name, QWidget *parent = 0);
virtual ~SettingsPage() {};
virtual QString category() const;
- virtual QString name() const;
+ virtual QString title() const;
virtual bool hasChanged() const = 0;
virtual void load() = 0;
virtual void defaults() = 0;
+ protected slots:
+ //! Calling this slot is equivalent to emitting changed(true).
+ void changed();
+
+ protected:
+ //! This should be called whenever the widget state changes from unchanged to change or the other way round.
+ void changeState(bool hasChanged = true);
+
signals:
- void changed(bool hasChanged = true);
+ void changed(bool hasChanged);
+ private:
+ QString _category, _title;
};
#endif
DEPMOD = common client
QT_MOD = core gui network
-SRCS += bufferview.cpp bufferviewfilter.cpp inputline.cpp nickview.cpp tabcompleter.cpp uisettings.cpp uistyle.cpp
-HDRS += bufferview.h bufferviewfilter.h inputline.h nickview.h tabcompleter.h uisettings.h uistyle.h
+SRCS += bufferview.cpp bufferviewfilter.cpp inputline.cpp nickview.cpp settingspage.cpp tabcompleter.cpp uisettings.cpp uistyle.cpp
+HDRS += bufferview.h bufferviewfilter.h inputline.h nickview.h settingspage.h tabcompleter.h uisettings.h uistyle.h
FORMNAMES =