X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingsdlg.cpp;h=422f64dabae685702188ef06988b5dc8bb812a83;hp=420648223536f1ec1b65bc8f9097d0091ee419e2;hb=8b68bdc964968d1d988242c37a598ba88cd0551c;hpb=9fd4619e9aca7d53d7c5df156a0b25956a1bf682 diff --git a/src/qtui/settingsdlg.cpp b/src/qtui/settingsdlg.cpp index 42064822..422f64da 100644 --- a/src/qtui/settingsdlg.cpp +++ b/src/qtui/settingsdlg.cpp @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005-07 by The Quassel Team * + * Copyright (C) 2005-07 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. * + * (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 * @@ -31,10 +31,10 @@ SettingsDlg::SettingsDlg(QWidget *parent) : QDialog(parent) { 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 cats = ui.settingsTree->findItems(sp->category(), Qt::MatchExactly); @@ -44,11 +44,11 @@ void SettingsDlg::registerSettingsPage(SettingsPage *sp) { 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); } @@ -87,3 +87,4 @@ void SettingsDlg::applyChanges() { //SettingsInterface *sp = qobject_cast(ui.settingsStack->currentWidget()); //if(sp) sp->applyChanges(); } +