From: Unknown Date: Sat, 23 Feb 2008 15:17:37 +0000 (+0000) Subject: Cleaning up the svn repo, removing obsolete files, updated READMEs. X-Git-Tag: 0.2.0-alpha2~24 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=84ba80a6fa4f93a45c8d48f0c467076baec06e0e;ds=sidebyside Cleaning up the svn repo, removing obsolete files, updated READMEs. Renaming 0.2.0-alpha1 tag to quassel-0.2.0-alpha1. --- diff --git a/INSTALL b/INSTALL index 5c822d6c..112bd62c 100644 --- a/INSTALL +++ b/INSTALL @@ -27,11 +27,10 @@ anyway, since there are no installable files other than the binaries. Though this might change in later releases. On first run of the Quassel core, it will wait for a client to connect -and present a (preliminary) first-run wizard. This will allow you to -create the database and one admin user for the core-side storage. Note -that Quassel does not support the administration of user accounts yet, -this includes adding more users, changing passwords and so on. This is -high on our TODO list, of course. +and present a wizard that will allow you to create the database and one +admin user for the core-side storage. Note that Quassel does not support +the administration of user accounts yet, this includes adding more users, +changing passwords and so on. Please also do read the README file. diff --git a/README b/README index dd8324ad..f998504d 100644 --- a/README +++ b/README @@ -1,24 +1,16 @@ Quassel IRC - Release Notes =========================== -This is a pre-release version. This means that a lot of stuff is not -working yet, that copyright notices and licensing information are not -always correct, and that stuff generally breaks. We kindly ask you -that you don't give out the source code or svn account information -before the first public release. If you know interested persons, -please point them to us and we will gladly make the source code -available to them. - -Please don't hesitate to inform us about bugs you encounter (but you -probably don't need to report obviously missing features such as a -working topic bar or nicklist, we know that ourselves ;-) +This is an alpha version. This means that a lot of stuff is not +working yet, many features are still missing and things generally +break. Please refer to for current +issues. On first run of the Quassel core, it will wait for a client to connect -and present a (preliminary) first-run wizard. This will allow you to -create the database and one admin user for the core-side storage. Note -that Quassel does not support the administration of user accounts yet, -this includes adding more users, changing passwords and so on. This is -high on our TODO list, of course. +and present a first-run wizard that will allow you to create the database +and one admin user for the core-side storage. Note that Quassel does not +support the administration of user accounts yet, this includes adding +more users, changing passwords and so on. The Quassel IRC Team can be contacted on Freenode/#quassel (or #quassel.de). We always welcome new users in our channels! @@ -27,7 +19,5 @@ Our homepage is The bugtracker can be found at The dev team can be reached by email: -Thanks, +Thanks for reading, ~ The Quassel IRC Team - - (Manuel Nickschas, Marcus Eggenberger, Marco Genise) diff --git a/dev-notes/obsolete/channelwidget.ui b/dev-notes/obsolete/channelwidget.ui deleted file mode 100644 index 3dd865e9..00000000 --- a/dev-notes/obsolete/channelwidget.ui +++ /dev/null @@ -1,286 +0,0 @@ - - ChannelWidget - - - - 0 - 0 - 713 - 519 - - - - - 0 - 0 - - - - - 200 - 100 - - - - Qt::DefaultContextMenu - - - - - - - 6 - - - 1 - - - 1 - - - 1 - - - 1 - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - Qt::ClickFocus - - - true - - - - - - - Qt::NonModal - - - - 0 - 0 - - - - Qt::LeftToRight - - - ... - - - - - - - - - - 0 - 0 - - - - 1 - - - Qt::Horizontal - - - - - 4 - 0 - - - - - Bitstream Vera Sans Mono - 8 - 50 - false - - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Bitstream Vera Sans Mono'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Nimbus Mono L';"></p></body></html> - - - - - - 1 - 0 - - - - Qt::LeftToRight - - - true - - - Qt::ElideRight - - - true - - - false - - - false - - - 1 - - - - 32 Users - - - - - @ Operators - - - - New Sub Item - - - - - New Item - - - - - New Item - - - - - - 4 Voiced - - - - New Item - - - - - New Item - - - - - New Item - - - - - - 19 Users - - - - New Sub Item - - - - - New Item - - - - - New Item - - - - - New Item - - - - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - QComboBox::AdjustToContents - - - - - - - - 0 - 0 - - - - - - - - - - - ChannelWidgetInput - QLineEdit -
channelwidgetinput.h
-
-
- - inputEdit - ownNick - nickTree - topicEdit - chanSettingsButton - chatWidget - - - -
diff --git a/dev-notes/obsolete/coreconnectdlgold.cpp b/dev-notes/obsolete/coreconnectdlgold.cpp deleted file mode 100644 index 643b0fff..00000000 --- a/dev-notes/obsolete/coreconnectdlgold.cpp +++ /dev/null @@ -1,336 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-08 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 -#include "coreconnectdlg.h" -#include "client.h" -#include "clientsettings.h" -#include "configwizard.h" -#include "global.h" - -CoreConnectDlg::CoreConnectDlg(QWidget *parent, bool /*doAutoConnect*/) : QDialog(parent) { - ui.setupUi(this); //qDebug() << "new dlg"; - - setAttribute(Qt::WA_DeleteOnClose); - - coreState = 0; - /* We show ui.internalCore in any case, because we might want to run as monolithic client anyway at another time - if(Global::runMode == Global::Monolithic) { - connect(ui.internalCore, SIGNAL(toggled(bool)), ui.hostEdit, SLOT(setDisabled(bool))); - connect(ui.internalCore, SIGNAL(toggled(bool)), ui.port, SLOT(setDisabled(bool))); - ui.internalCore->setChecked(true); - } else { - //ui.internalCore->hide(); - } - */ - connect(ui.newAccount, SIGNAL(clicked()), this, SLOT(createAccount())); - connect(ui.delAccount, SIGNAL(clicked()), this, SLOT(removeAccount())); - connect(ui.buttonBox1, SIGNAL(accepted()), this, SLOT(doConnect())); - connect(ui.hostEdit, SIGNAL(textChanged(const QString &)), this, SLOT(checkInputValid())); - connect(ui.userEdit, SIGNAL(textChanged(const QString &)), this, SLOT(checkInputValid())); - connect(ui.internalCore, SIGNAL(toggled(bool)), this, SLOT(checkInputValid())); - connect(ui.internalCore, SIGNAL(toggled(bool)), ui.hostEdit, SLOT(setDisabled(bool))); - connect(ui.internalCore, SIGNAL(toggled(bool)), ui.port, SLOT(setDisabled(bool))); - connect(ui.accountList, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(accountChanged(const QString &))); - connect(ui.autoConnect, SIGNAL(clicked(bool)), this, SLOT(autoConnectToggled(bool))); - - connect(Client::instance(), SIGNAL(coreConnectionMsg(const QString &)), ui.connectionStatus, SLOT(setText(const QString &))); - connect(Client::instance(), SIGNAL(coreConnectionProgress(uint, uint)), this, SLOT(updateProgressBar(uint, uint))); - connect(Client::instance(), SIGNAL(coreConnectionError(QString)), this, SLOT(coreConnectionError(QString))); - connect(Client::instance(), SIGNAL(connected()), this, SLOT(coreConnected())); - - connect(Client::instance(), SIGNAL(showConfigWizard(const QVariantMap &)), this, SLOT(showConfigWizard(const QVariantMap &))); - - AccountSettings s; - QString lastacc = s.lastAccount(); - ui.accountList->addItems(s.knownAccounts()); - if(!ui.accountList->count()) { - //if(doAutoConnect) reject(); - - setAccountEditEnabled(false); - QString newacc = QInputDialog::getText(this, tr("Create Account"), tr( - "In order to connect to a Quassel Core, you need to create an account.
" - "Please enter a name for this account now:"), QLineEdit::Normal, tr("Default")); - if(!newacc.isEmpty()) { - ui.accountList->addItem(newacc); - ui.hostEdit->setText("localhost"); - ui.port->setValue(Global::defaultPort); - ui.internalCore->setChecked(false); - setAccountEditEnabled(true); - } - /* - // FIXME We create a default account here that just connects to the internal core - curacc = "Default"; - ui.accountList->addItem("Default"); - ui.internalCore->setChecked(true); - ui.userEdit->setText("Default"); - ui.passwdEdit->setText("password"); - ui.rememberPasswd->setChecked(true); - accountChanged(curacc); - ui.passwdEdit->setText("password"); - ui.accountList->setCurrentIndex(0); - ui.autoConnect->setChecked(true); - autoConnectToggled(true); - */ - } else { - if(!lastacc.isEmpty()) { - //if(doAutoConnect) { qDebug() << "auto"; - // AccountSettings s; - // int idx = ui.accountList->findText(s.autoConnectAccount()); - // if(idx < 0) reject(); - // else { - // ui.accountList->setCurrentIndex(idx); - // doConnect(); - // } - //} else { - int idx = ui.accountList->findText(lastacc); - ui.accountList->setCurrentIndex(idx); - //} - } - } -} - -CoreConnectDlg::~CoreConnectDlg() { - //qDebug() << "destroy"; -} - -void CoreConnectDlg::setAccountEditEnabled(bool en) { - ui.accountList->setEnabled(en); - ui.hostEdit->setEnabled(en && !ui.internalCore->isChecked()); - ui.userEdit->setEnabled(en); - ui.passwdEdit->setEnabled(en); - ui.port->setEnabled(en && !ui.internalCore->isChecked()); - ui.editAccount->setEnabled(en); - ui.delAccount->setEnabled(en); - ui.internalCore->setEnabled(en); - ui.rememberPasswd->setEnabled(en); - ui.autoConnect->setEnabled(en); - ui.buttonBox1->button(QDialogButtonBox::Ok)->setEnabled(en && checkInputValid()); -} - -void CoreConnectDlg::accountChanged(const QString &text) { - AccountSettings s; - if(!curacc.isEmpty()) { - QVariantMap oldAcc; - oldAcc["User"] = ui.userEdit->text(); - oldAcc["Host"] = ui.hostEdit->text(); - oldAcc["Port"] = ui.port->value(); - oldAcc["InternalCore"] = ui.internalCore->isChecked(); - if(ui.rememberPasswd->isChecked()) oldAcc["Password"] = ui.passwdEdit->text(); - s.setValue(curacc, "AccountData", oldAcc); - } - ui.autoConnect->setChecked(false); - if(!text.isEmpty()) { // empty text: just save stuff - curacc = text; - s.setLastAccount(curacc); - QVariantMap newAcc = s.value(curacc, "AccountData").toMap(); - ui.userEdit->setText(newAcc["User"].toString()); - ui.hostEdit->setText(newAcc["Host"].toString()); - ui.port->setValue(newAcc["Port"].toInt()); - ui.internalCore->setChecked(newAcc["InternalCore"].toBool()); - if(newAcc.contains("Password")) { - ui.passwdEdit->setText(newAcc["Password"].toString()); - ui.rememberPasswd->setChecked(true); - } else ui.rememberPasswd->setChecked(false); - if(s.autoConnectAccount() == curacc) ui.autoConnect->setChecked(true); - } -} - -void CoreConnectDlg::autoConnectToggled(bool autoConnect) { - AccountSettings s; - if(autoConnect) s.setAutoConnectAccount(curacc); - else s.setAutoConnectAccount(""); -} - -bool CoreConnectDlg::checkInputValid() { - bool res = (ui.internalCore->isChecked() || ui.hostEdit->text().count()) && ui.userEdit->text().count(); - ui.buttonBox1->button(QDialogButtonBox::Ok)->setEnabled(res); - return res; -} - -void CoreConnectDlg::createAccount() { - QString accname = QInputDialog::getText(this, tr("Create Account"), tr("Please enter a name for the new account:")); - if(accname.isEmpty()) return; - if(ui.accountList->findText(accname) >= 0) { - QMessageBox::warning(this, tr("Account name already exists!"), tr("An account named '%1' already exists, and account names must be unique!").arg(accname)); - return; - } - QVariantMap defdata; - ui.accountList->addItem(accname); - ui.accountList->setCurrentIndex(ui.accountList->findText(accname)); - setAccountEditEnabled(true); -} - -void CoreConnectDlg::removeAccount() { - QString acc = ui.accountList->currentText(); - int res = QMessageBox::warning(this, tr("Delete account?"), tr("Do you really want to delete the data for the account '%1'?
" - "Note that this only affects your local account settings and will not remove " - "any data from the core.").arg(acc), - QMessageBox::Yes|QMessageBox::No, QMessageBox::No); - if(res == QMessageBox::Yes) { - AccountSettings s; - s.removeAccount(acc); - curacc = ""; - ui.accountList->removeItem(ui.accountList->findText(acc)); - if(!ui.accountList->count()) setAccountEditEnabled(false); - } -} - -bool CoreConnectDlg::willDoInternalAutoConnect() { - AccountSettings s; - if(Global::runMode != Global::Monolithic) return false; - if(ui.autoConnect->isChecked() && s.autoConnectAccount() == curacc && ui.internalCore->isChecked()) { - return true; - } - return false; -} - -void CoreConnectDlg::doAutoConnect() { - AccountSettings s; - if(s.autoConnectAccount() == curacc) { - doConnect(); - } -} - -void CoreConnectDlg::doConnect() { - accountChanged(); // save current account info - QVariantMap conninfo; - ui.stackedWidget->setCurrentIndex(1); - if(ui.internalCore->isChecked()) { - // FIXME - coreConnectionError(tr("Can't connect to internal core at the moment [serious breakage due to switch to dynamic signals]. Please check back later.")); - return; - if(Global::runMode != Global::Monolithic) { - coreConnectionError(tr("Can't connect to internal core, since we are running as a standalone GUI!")); - return; - } - ui.connectionGroupBox->setTitle(tr("Connecting to internal core")); - ui.connectionProgress->hide(); - } else { - ui.connectionGroupBox->setTitle(tr("Connecting to %1").arg(ui.hostEdit->text())); - conninfo["Host"] = ui.hostEdit->text(); - conninfo["Port"] = ui.port->value(); - } - conninfo["User"] = ui.userEdit->text(); - conninfo["Password"] = ui.passwdEdit->text(); - ui.profileLabel->hide(); ui.guiProfile->hide(); - ui.newGuiProfile->hide(); ui.alwaysUseProfile->hide(); - ui.connectionProgress->show(); - try { - Client::instance()->connectToCore(conninfo); - } catch(Exception e) { - QString msg; - //if(!e.msg().isEmpty()) msg = tr("
%1").arg(e.msg()); // FIXME throw more detailed (vulgo: any) error msg - coreConnectionError(tr("Invalid user or password. Pleasy try again.%1").arg(msg)); - //QMessageBox::warning(this, tr("Unknown account"), tr("Invalid user or password. Pleasy try again.%1").arg(msg)); - //cancelConnect(); - return; - } -} - -void CoreConnectDlg::cancelConnect() { - ui.stackedWidget->setCurrentIndex(0); -} - -void CoreConnectDlg::setStartState() { /* - ui.hostName->show(); ui.hostPort->show(); ui.hostLabel->show(); ui.portLabel->show(); - ui.statusText->setText(tr("Connect to Quassel Core running on:")); - ui.buttonBox->button(QDialogButtonBox::Ok)->show(); - ui.hostName->setEnabled(true); ui.hostPort->setEnabled(true); - ui.hostName->setSelection(0, ui.hostName->text().length()); */ - ui.stackedWidget->setCurrentIndex(0); -} - -void CoreConnectDlg::hostEditChanged(QString /*txt*/) { - //ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(txt.length()); -} - -void CoreConnectDlg::hostSelected() { /* - ui.hostName->hide(); ui.hostPort->hide(); ui.hostLabel->hide(); ui.portLabel->hide(); - ui.statusText->setText(tr("Connecting to %1:%2" ).arg(ui.hostName->text()).arg(ui.hostPort->value())); - ui.buttonBox->button(QDialogButtonBox::Ok)->hide(); - connect(ClientProxy::instance(), SIGNAL(coreConnected()), this, SLOT(coreConnected())); - connect(ClientProxy::instance(), SIGNAL(coreConnectionError(QString)), this, SLOT(coreConnectionError(QString))); - Client::instance()->connectToCore(ui.hostName->text(), ui.hostPort->value()); -*/ -} - -void CoreConnectDlg::coreConnected() { /* - ui.hostLabel->hide(); ui.hostName->hide(); ui.portLabel->hide(); ui.hostPort->hide(); - ui.statusText->setText(tr("Synchronizing...")); - QSettings s; - s.setValue("GUI/CoreHost", ui.hostName->text()); - s.setValue("GUI/CorePort", ui.hostPort->value()); - s.setValue("GUI/CoreAutoConnect", ui.autoConnect->isChecked()); - connect(ClientProxy::instance(), SIGNAL(recvPartialItem(quint32, quint32)), this, SLOT(updateProgressBar(quint32, quint32))); - connect(ClientProxy::instance(), SIGNAL(csCoreState(QVariant)), this, SLOT(recvCoreState(QVariant))); - ui.progressBar->show(); - QVariantMap initmsg; - initmsg["GUIProtocol"] = GUI_PROTOCOL; - // FIXME guiProxy->send(GS_CLIENT_INIT, QVariant(initmsg)); */ - ui.connectionStatus->setText(tr("Connected to core.")); - accept(); -} - -void CoreConnectDlg::coreConnectionError(QString err) { - ui.stackedWidget->setCurrentIndex(0); - show(); // just in case we started hidden - QMessageBox::warning(this, tr("Connection Error"), tr("Could not connect to Quassel Core!
\n") + err, QMessageBox::Retry); - //disconnect(ClientProxy::instance(), 0, this, 0); FIXME? - //ui.autoConnect->setChecked(false); - setStartState(); -} - -void CoreConnectDlg::updateProgressBar(uint partial, uint total) { - ui.connectionProgress->setMaximum(total); - ui.connectionProgress->setValue(partial); - //qDebug() << "progress:" << partial << total; -} - -void CoreConnectDlg::recvCoreState(QVariant state) { - //ui.progressBar->hide(); - coreState = state; - accept(); -} - -QVariant CoreConnectDlg::getCoreState() { - return coreState; -} - -void CoreConnectDlg::showConfigWizard(const QVariantMap &coredata) { - QStringList storageProviders = coredata["StorageProviders"].toStringList(); - ConfigWizard *wizard = new ConfigWizard(storageProviders, this); - wizard->exec(); - QVariantMap reply; - reply["GuiProtocol"] = GUI_PROTOCOL; - reply["HasSettings"] = true; - reply["User"] = wizard->field("adminuser.name").toString(); - reply["Password"] = wizard->field("adminuser.password").toString(); - QString sp = storageProviders.value(wizard->field("storage.provider").toInt()); - reply["Type"] = sp; - if (sp.compare("Sqlite", Qt::CaseInsensitive)) { - reply["Host"] = wizard->field("storage.host").toString(); - reply["Port"] = wizard->field("storage.port").toString(); - reply["Database"] = wizard->field("storage.database").toString(); - reply["User"] = wizard->field("storage.user").toString(); - reply["Password"] = wizard->field("storage.password").toString(); - } - Client::instance()->setCoreConfiguration(reply); -} diff --git a/dev-notes/obsolete/coreconnectdlgold.h b/dev-notes/obsolete/coreconnectdlgold.h deleted file mode 100644 index 3b6f5847..00000000 --- a/dev-notes/obsolete/coreconnectdlgold.h +++ /dev/null @@ -1,69 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-08 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 _CORECONNECTDLG_H -#define _CORECONNECTDLG_H - -#include "ui_coreconnectdlg.h" - -class CoreConnectDlg: public QDialog { - Q_OBJECT - - public: - CoreConnectDlg(QWidget *parent, bool doAutoConnect = false); - ~CoreConnectDlg(); - QVariant getCoreState(); - - bool willDoInternalAutoConnect(); - - public slots: - void doAutoConnect(); - - private slots: - void createAccount(); - void removeAccount(); - void accountChanged(const QString & = ""); - void setAccountEditEnabled(bool); - void autoConnectToggled(bool); - bool checkInputValid(); - void hostEditChanged(QString); - void hostSelected(); - void doConnect(); - - void coreConnected(); - void coreConnectionError(QString); - //void coreConnectionMsg(const QString &); - //void coreConnectionProgress(uint partial, uint total); - void updateProgressBar(uint partial, uint total); - void recvCoreState(QVariant); - - void showConfigWizard(const QVariantMap &coredata); - - private: - Ui::CoreConnectDlg ui; - QVariant coreState; - - void cancelConnect(); - void setStartState(); - QVariantMap accountData; - QString curacc; -}; - -#endif diff --git a/dev-notes/obsolete/identities.cpp b/dev-notes/obsolete/identities.cpp deleted file mode 100644 index d8eb9441..00000000 --- a/dev-notes/obsolete/identities.cpp +++ /dev/null @@ -1,444 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005/06 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 "identities.h" -#include "client.h" - -IdentitiesDlg::IdentitiesDlg(QWidget *parent, QString selected) : QDialog(parent) { - ui.setupUi(this); - connect(Client::instance(), SIGNAL(sessionDataChanged(const QString &)), this, SLOT(globalDataUpdated(QString))); - - connect(ui.enableAutoAway, SIGNAL(stateChanged(int)), this, SLOT(autoAwayChecked())); - - identities = Client::retrieveSessionData("Identities").toMap(); - foreach(QString name, identities.keys()) { - nameMapping[name] = name; - } - if(identities.size() == 0) { - QVariantMap id = createDefaultIdentity(); - id["IdName"] = "Default"; - identities["Default"] = id; - nameMapping["Default"] = "Default"; - } - ui.identityList->addItem(tr("Default Identity")); - - foreach(QString id, identities.keys()) { - if(id != "Default") ui.identityList->addItem(id); - if(id == selected) ui.identityList->setCurrentIndex(ui.identityList->count()-1); - } - updateWidgets(); - lastIdentity = getCurIdentity(); - connect(ui.identityList, SIGNAL(activated(QString)), this, SLOT(identityChanged(QString))); - connect(ui.editIdentitiesButton, SIGNAL(clicked()), this, SLOT(editIdentities())); - connect(ui.nickList, SIGNAL(itemSelectionChanged()), this, SLOT(nickSelectionChanged())); - connect(ui.addNickButton, SIGNAL(clicked()), this, SLOT(addNick())); - connect(ui.editNickButton, SIGNAL(clicked()), this, SLOT(editNick())); - connect(ui.delNickButton, SIGNAL(clicked()), this, SLOT(delNick())); - connect(ui.upNickButton, SIGNAL(clicked()), this, SLOT(upNick())); - connect(ui.downNickButton, SIGNAL(clicked()), this, SLOT(downNick())); -} - -/* this needs more work! mapping? */ -void IdentitiesDlg::globalDataUpdated(QString key) { - if(key == "Identities") { - if(QMessageBox::warning(this, tr("Data changed remotely!"), tr("Some other GUI client changed the identities data!
" - "Apply updated settings, losing all changes done locally?"), - QMessageBox::Apply|QMessageBox::Discard) == QMessageBox::Apply) { - //identities = global->getData(key).toMap(); - //updateWidgets(); - reject(); - } - } -} - -QVariantMap IdentitiesDlg::createDefaultIdentity() { - QVariantMap id; - id["RealName"] = "foo"; - id["Ident"] = ""; - id["NickList"] = QStringList(); - id["enableAwayNick"] = false; - id["AwayNick"] = ""; - id["enableAwayReason"] = false; - id["AwayReason"] = ""; - id["enableReturnMessage"] = false; - id["ReturnMessage"] = ""; - id["enableAutoAway"] = false; - id["AutoAwayTime"] = 10; - id["enableAutoAwayReason"] = false; - id["AutoAwayReason"] = ""; - id["enableAutoAwayReturn"] = false; - id["AutoAwayReturn"] = ""; - id["PartReason"] = "Quasseling elsewhere."; - id["QuitReason"] = "Every Quassel comes to its end."; - id["KickReason"] = "No more quasseling for you!"; - - return id; -} - -QString IdentitiesDlg::getCurIdentity() { - if(ui.identityList->currentIndex() == 0) return "Default"; - return ui.identityList->currentText(); -} - -void IdentitiesDlg::updateWidgets() { - QVariantMap id = identities[getCurIdentity()].toMap(); - ui.realNameEdit->setText(id["RealName"].toString()); - ui.identEdit->setText(id["Ident"].toString()); - ui.nickList->clear(); - ui.nickList->addItems(id["NickList"].toStringList()); - if(ui.nickList->count()>0) ui.nickList->setCurrentRow(0); - ui.enableAwayNick->setChecked(id["enableAwayNick"].toBool()); - ui.awayNickEdit->setText(id["AwayNick"].toString()); - ui.awayNickEdit->setEnabled(ui.enableAwayNick->isChecked()); - ui.enableAwayReason->setChecked(id["enableAwayReason"].toBool()); - ui.awayReasonEdit->setText(id["AwayReason"].toString()); - ui.awayReasonEdit->setEnabled(ui.enableAwayReason->isChecked()); - ui.enableReturnMessage->setChecked(id["enableReturnMessage"].toBool()); - ui.returnMessageEdit->setText(id["ReturnMessage"].toString()); - ui.returnMessageEdit->setEnabled(ui.enableReturnMessage->isChecked()); - ui.enableAutoAway->setChecked(id["enableAutoAway"].toBool()); - ui.autoAwayTime->setValue(id["AutoAwayTime"].toInt()); - ui.enableAutoAwayReason->setChecked(id["enableAutoAwayReason"].toBool()); - ui.autoAwayReasonEdit->setText(id["AutoAwayReason"].toString()); - ui.enableAutoAwayReturn->setChecked(id["enableAutoAwayReturn"].toBool()); - ui.autoAwayReturnEdit->setText(id["AutoAwayReturn"].toString()); - ui.partReasonEdit->setText(id["PartReason"].toString()); - ui.kickReasonEdit->setText(id["KickReason"].toString()); - ui.quitReasonEdit->setText(id["QuitReason"].toString()); - // set enabled states correctly - autoAwayChecked(); - nickSelectionChanged(); -} - -void IdentitiesDlg::updateIdentity(QString idName) { - QVariantMap id; - id["RealName"] = ui.realNameEdit->text(); - id["Ident"] = ui.identEdit->text(); - QStringList nicks; - for(int i = 0; i < ui.nickList->count(); i++) nicks << ui.nickList->item(i)->text(); - id["NickList"] = nicks; - id["enableAwayNick"] = ui.enableAwayNick->isChecked(); - id["AwayNick"] = ui.awayNickEdit->text(); - id["enableAwayReason"] = ui.enableAwayReason->isChecked(); - id["AwayReason"] = ui.awayReasonEdit->text(); - id["enableReturnMessage"] = ui.enableReturnMessage->isChecked(); - id["ReturnMessage"] = ui.returnMessageEdit->text(); - id["enableAutoAway"] = ui.enableAutoAway->isChecked(); - id["AutoAwayTime"] = ui.autoAwayTime->value(); - id["enableAutoAwayReason"] = ui.enableAutoAwayReason->isChecked(); - id["AutoAwayReason"] = ui.autoAwayReasonEdit->text(); - id["enableAutoAwayReturn"] = ui.enableAutoAwayReturn->isChecked(); - id["AutoAwayReturn"] = ui.autoAwayReturnEdit->text(); - id["PartReason"] = ui.partReasonEdit->text(); - id["KickReason"] = ui.kickReasonEdit->text(); - id["QuitReason"] = ui.quitReasonEdit->text(); - - id["IdName"] = idName; - identities[idName] = id; -} - -void IdentitiesDlg::identityChanged(QString) { - updateIdentity(lastIdentity); - lastIdentity = getCurIdentity(); - updateWidgets(); -} - -void IdentitiesDlg::autoAwayChecked() { - if(ui.enableAutoAway->isChecked()) { - ui.autoAwayLabel_1->setEnabled(1); - ui.autoAwayLabel_2->setEnabled(1); - ui.autoAwayTime->setEnabled(1); - ui.enableAutoAwayReason->setEnabled(1); - ui.enableAutoAwayReturn->setEnabled(1); - ui.autoAwayReasonEdit->setEnabled(ui.enableAutoAwayReason->isChecked()); - ui.autoAwayReturnEdit->setEnabled(ui.enableAutoAwayReturn->isChecked()); - } else { - ui.autoAwayLabel_1->setEnabled(0); - ui.autoAwayLabel_2->setEnabled(0); - ui.autoAwayTime->setEnabled(0); - ui.enableAutoAwayReason->setEnabled(0); - ui.enableAutoAwayReturn->setEnabled(0); - ui.autoAwayReasonEdit->setEnabled(0); - ui.autoAwayReturnEdit->setEnabled(0); - } -} - -void IdentitiesDlg::nickSelectionChanged() { - Q_ASSERT(ui.nickList->selectedItems().size() <= 1); - int curidx; - if(ui.nickList->selectedItems().isEmpty()) curidx = -1; - else curidx = ui.nickList->row(ui.nickList->selectedItems()[0]); - ui.editNickButton->setEnabled(curidx >= 0); - ui.delNickButton->setEnabled(curidx >= 0); - ui.upNickButton->setEnabled(curidx > 0); - ui.downNickButton->setEnabled(curidx >= 0 && curidx < ui.nickList->count() - 1); -} - -void IdentitiesDlg::addNick() { - NickEditDlg dlg(this); - if(dlg.exec() == QDialog::Accepted) { - QListWidgetItem *item = new QListWidgetItem(ui.nickList); - item->setText(dlg.getNick()); - item->setFlags(item->flags() | Qt::ItemIsEditable); - ui.nickList->setCurrentItem(item); - nickSelectionChanged(); - } -} - -void IdentitiesDlg::editNick() { - NickEditDlg dlg(this, ui.nickList->currentItem()->text()); - if(dlg.exec() == QDialog::Accepted) { - ui.nickList->currentItem()->setText(dlg.getNick()); - } -} - -void IdentitiesDlg::delNick() { - int row = ui.nickList->currentRow(); - delete ui.nickList->takeItem(row); - if(row <= ui.nickList->count() - 1) ui.nickList->setCurrentRow(row); - else if(row > 0) ui.nickList->setCurrentRow(ui.nickList->count()-1); - nickSelectionChanged(); -} - -void IdentitiesDlg::upNick() { - int row = ui.nickList->currentRow(); - QListWidgetItem *item = ui.nickList->takeItem(row); - ui.nickList->insertItem(row-1, item); - ui.nickList->setCurrentRow(row-1); - nickSelectionChanged(); -} - -void IdentitiesDlg::downNick() { - int row = ui.nickList->currentRow(); - QListWidgetItem *item = ui.nickList->takeItem(row); - ui.nickList->insertItem(row+1, item); - ui.nickList->setCurrentRow(row+1); - nickSelectionChanged(); -} - -void IdentitiesDlg::accept() { - updateIdentity(getCurIdentity()); - QString result = checkValidity(); - if(result.length() == 0) { - Client::storeSessionData("Identities", identities); - // We have to care about renamed identities and update the network list appropriately... - QVariantMap networks = Client::retrieveSessionData("Networks").toMap(); - foreach(QString netname, networks.keys()) { - QVariantMap net = networks[netname].toMap(); - if(nameMapping.contains(net["Identity"].toString())) { - net["Identity"] = nameMapping[net["Identity"].toString()]; - } else net["Identity"] = "Default"; - networks[netname] = net; - } - Client::storeSessionData("Networks", networks); - QDialog::accept(); - } else { - QMessageBox::warning(this, tr("Invalid Identity!"), - tr("One or more of your identities do not contain all necessary information:\n\n%1\n" - "Please fill in any missing information.").arg(result)); - } -} - -QString IdentitiesDlg::checkValidity() { - QString reason; - foreach(QString name, identities.keys()) { - QString r; - QVariantMap id = identities[name].toMap(); - if(name == "Default") name = tr("Default Identity"); - if(id["RealName"].toString().isEmpty()) { - r += tr(" You have not set a real name."); - } - if(id["Ident"].toString().isEmpty()) { - r += tr(" You have to specify an Ident."); - } - if(id["NickList"].toStringList().size() == 0) { - r += tr(" You haven't entered any nicknames."); - } - if(r.length()>0) { - reason += tr("[%1]%2\n").arg(name).arg(r); - } - } - return reason; -} - -void IdentitiesDlg::editIdentities() { - updateIdentity(getCurIdentity()); - IdentitiesEditDlg dlg(this, identities, nameMapping, createDefaultIdentity(), getCurIdentity()); - if(dlg.exec() == QDialog::Accepted) { - identities = dlg.getIdentities(); - nameMapping = dlg.getMapping(); - ui.identityList->clear(); - ui.identityList->addItem(tr("Default Identity")); - foreach(QString id, identities.keys()) { - if(id != "Default") ui.identityList->addItem(id); - if(id == dlg.getSelectedIdentity()) ui.identityList->setCurrentIndex(ui.identityList->count()-1); - } - lastIdentity = getCurIdentity(); - updateWidgets(); - } -} - -/******************************************************************************/ - -IdentitiesEditDlg::IdentitiesEditDlg(QWidget *parent, QVariantMap _identities, QMap _mapping, QVariantMap templ, QString selected) - : QDialog(parent) { - ui.setupUi(this); - identities = _identities; - mapping = _mapping; - identTemplate = templ; - - foreach(QString name, identities.keys()) { - if(name == "Default") continue; - ui.identList->addItem(name); - if(name == selected) ui.identList->setCurrentRow(ui.identList->count()-1); - } - ui.identList->sortItems(); - ui.identList->insertItem(0, tr("Default Identity")); - if(ui.identList->selectedItems().count()!=1) ui.identList->setCurrentRow(0); - selectionChanged(); - connect(ui.identList, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged())); - connect(ui.addButton, SIGNAL(clicked()), this, SLOT(addIdentity())); - connect(ui.duplicateButton, SIGNAL(clicked()), this, SLOT(duplicateIdentity())); - connect(ui.renameButton, SIGNAL(clicked()), this, SLOT(renameIdentity())); - connect(ui.deleteButton, SIGNAL(clicked()), this, SLOT(deleteIdentity())); - } - - void IdentitiesEditDlg::selectionChanged() { - Q_ASSERT(ui.identList->selectedItems().size() == 1); - int idx = ui.identList->row(ui.identList->selectedItems()[0]); - ui.duplicateButton->setEnabled(idx >= 0); - ui.renameButton->setEnabled(idx > 0); - ui.deleteButton->setEnabled(idx > 0); - } - - void IdentitiesEditDlg::addIdentity() { - RenameIdentityDlg dlg(this, identities.keys()); - if(dlg.exec() == QDialog::Accepted) { - QVariantMap id = identTemplate; - identities[dlg.getName()] = id; - Q_ASSERT(!mapping.contains(dlg.getName())); - mapping[dlg.getName()] = dlg.getName(); - QListWidgetItem *item = new QListWidgetItem(dlg.getName(), ui.identList); - sortList(); - ui.identList->setCurrentItem(item); - selectionChanged(); - } - } - - void IdentitiesEditDlg::duplicateIdentity() { - RenameIdentityDlg dlg(this, identities.keys()); - if(dlg.exec() == QDialog::Accepted) { - QString curname = ui.identList->currentRow() == 0 ? "Default" : ui.identList->currentItem()->text(); - QVariant id = identities[curname]; - identities[dlg.getName()] = id; - Q_ASSERT(!mapping.contains(dlg.getName())); - mapping[dlg.getName()] = dlg.getName(); - QListWidgetItem *item = new QListWidgetItem(dlg.getName(), ui.identList); - sortList(); - ui.identList->setCurrentItem(item); - selectionChanged(); - } - } - - void IdentitiesEditDlg::renameIdentity() { - QList names; - QString curname = ui.identList->currentItem()->text(); - foreach(QString n, identities.keys()) { - if(n != curname) names.append(n); - } - RenameIdentityDlg dlg(this, names, curname); - if(dlg.exec() == QDialog::Accepted) { - QString newname = dlg.getName(); - foreach(QString key, mapping.keys()) { - if(mapping[key] == curname) { - mapping[key] = newname; - break; - } - } - QVariant id = identities.take(curname); - identities[newname] = id; - QListWidgetItem *item = ui.identList->currentItem(); - item->setText(newname); - sortList(); - ui.identList->setCurrentItem(item); - selectionChanged(); - } - } - - void IdentitiesEditDlg::deleteIdentity() { - QString curname = ui.identList->currentItem()->text(); - if(QMessageBox::question(this, tr("Delete Identity?"), - tr("Do you really want to delete identity \"%1\"?\nNetworks using this identity " - "will be reset to use the default identity.").arg(curname), - tr("&Delete"), tr("&Cancel"), QString(), 1, 1) == 0) { - delete ui.identList->takeItem(ui.identList->currentRow()); - foreach(QString key, mapping.keys()) { - if(mapping[key] == curname) { - mapping.remove(key); break; - } - } - identities.remove(curname); - selectionChanged(); - } - } - - void IdentitiesEditDlg::sortList() { - QListWidgetItem *def = ui.identList->takeItem(0); - ui.identList->sortItems(); - ui.identList->insertItem(0, def); - } - - /******************************************************************************/ - - NickEditDlg::NickEditDlg(QWidget *parent, QString nick) : QDialog(parent) { - ui.setupUi(this); - ui.lineEdit->setText(nick); - connect(ui.lineEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString))); - textChanged(nick); - } - - void NickEditDlg::textChanged(QString text) { - ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(text.isEmpty() || text == ""); - } - - QString NickEditDlg::getNick() { - return ui.lineEdit->text(); - } - - /*******************************************************************************/ - - RenameIdentityDlg::RenameIdentityDlg(QWidget *parent, QList _reserved, QString name) : QDialog(parent) { - ui.setupUi(this); - reserved = _reserved; - setWindowTitle(tr("Edit Identity Name")); - ui.label->setText(tr("Identity:")); - ui.lineEdit->setText(name); - connect(ui.lineEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString))); - textChanged(name); - } - - void RenameIdentityDlg::textChanged(QString text) { - if(text.length() == 0) { ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(true); return; } - ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(reserved.contains(text)); - } - - QString RenameIdentityDlg::getName() { - return ui.lineEdit->text(); - } diff --git a/dev-notes/obsolete/identities.h b/dev-notes/obsolete/identities.h deleted file mode 100644 index 0e5004f5..00000000 --- a/dev-notes/obsolete/identities.h +++ /dev/null @@ -1,133 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005/06 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 _IDENTITIES_H_ -#define _IDENTITIES_H_ - -#include -#include - -#include "ui_identitiesdlg.h" -#include "ui_identitieseditdlg.h" -#include "ui_nickeditdlg.h" - -class IdentitiesDlg : public QDialog { - Q_OBJECT - - public: - IdentitiesDlg(QWidget *parent, QString selectedId = QString()); - - QVariantMap getIdentities() { return identities; } - QMap getNameMapping() { return nameMapping; } - - public slots: - virtual void accept(); - - private slots: - void autoAwayChecked(); - void identityChanged(QString); - void nickSelectionChanged(); - - void addNick(); - void editNick(); - void delNick(); - void upNick(); - void downNick(); - - void editIdentities(); - - void globalDataUpdated(QString); - - private: - Ui::IdentitiesDlg ui; - QVariantMap identities; - QMap nameMapping; - QString lastIdentity; - - QString checkValidity(); - QVariantMap createDefaultIdentity(); - QString getCurIdentity(); - void updateWidgets(); - void updateIdentity(QString); -}; - -class NickEditDlg : public QDialog { - Q_OBJECT - - public: - NickEditDlg(QWidget *parent, QString nick = QString()); - - QString getNick(); - - private slots: - void textChanged(QString); - - private: - Ui::NickEditDlg ui; - -}; - -class IdentitiesEditDlg : public QDialog { - Q_OBJECT - - public: - IdentitiesEditDlg(QWidget *parent, QVariantMap identities, QMap mapping, QVariantMap templ, QString selected = QString()); - - QVariantMap getIdentities() { return identities; } - QMap getMapping() { return mapping; } - QString getSelectedIdentity() { return ui.identList->currentItem()->text(); } - - //virtual void accept(); - - private slots: - void selectionChanged(); - - void addIdentity(); - void duplicateIdentity(); - void renameIdentity(); - void deleteIdentity(); - - private: - Ui::IdentitiesEditDlg ui; - - QVariantMap identities; - QVariantMap identTemplate; - QMap mapping; - - void sortList(); -}; - -class RenameIdentityDlg : public QDialog { - Q_OBJECT - - public: - RenameIdentityDlg(QWidget *parent, QList reserved, QString name = QString()); - - QString getName(); - - private slots: - void textChanged(QString); - - private: - Ui::NickEditDlg ui; - QList reserved; -}; - -#endif diff --git a/dev-notes/obsolete/identitiesdlg.ui b/dev-notes/obsolete/identitiesdlg.ui deleted file mode 100644 index a05a8afc..00000000 --- a/dev-notes/obsolete/identitiesdlg.ui +++ /dev/null @@ -1,666 +0,0 @@ - - IdentitiesDlg - - - - 0 - 0 - 454 - 442 - - - - - 5 - 5 - 0 - 0 - - - - Edit Identity - - - :/default/identity.png - - - true - - - - 8 - - - 6 - - - - - 0 - - - 6 - - - - - - 3 - 0 - 0 - 0 - - - - QComboBox::NoInsert - - - - - - - Edit... - - - :/default/edit_user.png - - - - - - - - - 0 - - - - &General - - - - 8 - - - 6 - - - - - 0 - - - 6 - - - - - Real Name - - - - - - - - - - - - - Ident - - - - - - - - - Nicknames - - - - 8 - - - 6 - - - - - - 7 - 7 - 1 - 0 - - - - - - - - 0 - - - 6 - - - - - - 5 - 0 - 0 - 0 - - - - &Add... - - - :/default/edit_add.png - - - - 16 - 16 - - - - - - - - - 5 - 0 - 0 - 0 - - - - &Edit... - - - :/default/edit.png - - - - - - - - 5 - 0 - 0 - 0 - - - - De&lete - - - :/default/edit_remove.png - - - - - - - 0 - - - 6 - - - - - Qt::Horizontal - - - - 0 - 20 - - - - - - - - ... - - - :/default/1uparrow.png - - - - - - - ... - - - :/default/1downarrow.png - - - - - - - Qt::Horizontal - - - - 0 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 0 - - - - - - - - - - - - - - 10 - 0 - 395 - 83 - - - - - - - &Away - - - - 8 - - - 6 - - - - - 0 - - - 6 - - - - - - - - Away Reason - - - - - - - - - - Return Message - - - - - - - - - - Away Nick - - - - - - - - - Auto Away - - - - 8 - - - 6 - - - - - Enable Auto Away - - - - - - - 0 - - - 6 - - - - - Auto away after - - - - - - - - - - minutes - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 0 - - - 6 - - - - - Return Message - - - - - - - Away Reason - - - - - - - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - &Messages - - - - 8 - - - 6 - - - - - 0 - - - 6 - - - - - Part Reason - - - - - - - - - - - - - Quit Reason - - - - - - - - - - Kick Reason - - - - - - - - - Qt::Vertical - - - - 20 - 141 - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok - - - - - - - - - - - enableAwayNick - clicked(bool) - awayNickEdit - setEnabled(bool) - - - 71 - 84 - - - 212 - 84 - - - - - enableAwayReason - clicked(bool) - awayReasonEdit - setEnabled(bool) - - - 111 - 117 - - - 153 - 116 - - - - - enableReturnMessage - clicked(bool) - returnMessageEdit - setEnabled(bool) - - - 120 - 145 - - - 166 - 145 - - - - - enableAutoAway - clicked(bool) - autoAwayTime - setEnabled(bool) - - - 79 - 202 - - - 144 - 230 - - - - - enableAutoAwayReturn - clicked(bool) - autoAwayReturnEdit - setEnabled(bool) - - - 121 - 284 - - - 202 - 291 - - - - - enableAutoAwayReason - clicked(bool) - autoAwayReasonEdit - setEnabled(bool) - - - 140 - 261 - - - 169 - 261 - - - - - buttonBox - rejected() - IdentitiesDlg - reject() - - - 226 - 420 - - - 226 - 220 - - - - - buttonBox - accepted() - IdentitiesDlg - accept() - - - 226 - 420 - - - 226 - 220 - - - - - diff --git a/dev-notes/obsolete/identitieseditdlg.ui b/dev-notes/obsolete/identitieseditdlg.ui deleted file mode 100644 index 05714b89..00000000 --- a/dev-notes/obsolete/identitieseditdlg.ui +++ /dev/null @@ -1,136 +0,0 @@ - - IdentitiesEditDlg - - - - 0 - 0 - 382 - 235 - - - - Edit Identities - - - true - - - - 8 - - - 6 - - - - - 0 - - - 6 - - - - - - - - 0 - - - 6 - - - - - &Add... - - - - - - - &Duplicate... - - - - - - - &Rename... - - - - - - - De&lete - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - IdentitiesEditDlg - accept() - - - 190 - 213 - - - 190 - 117 - - - - - buttonBox - rejected() - IdentitiesEditDlg - reject() - - - 190 - 213 - - - 190 - 117 - - - - - diff --git a/dev-notes/obsolete/networkeditdlg.ui b/dev-notes/obsolete/networkeditdlg.ui deleted file mode 100644 index d7633d04..00000000 --- a/dev-notes/obsolete/networkeditdlg.ui +++ /dev/null @@ -1,359 +0,0 @@ - - NetworkEditDlg - - - - 0 - 0 - 385 - 456 - - - - Edit Network Settings - - - - 6 - - - 9 - - - 9 - - - 9 - - - 9 - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 6 - - - 6 - - - - - Identity: - - - - - - - Network: - - - - - - - Group: - - - - - - - true - - - QComboBox::NoInsert - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - false - - - - - - - false - - - - 0 - 0 - - - - Edit... - - - - - - - - - - - - - - - Comment: - - - - - - - - - Auto-connect on startup - - - - - - - true - - - 0 - - - - true - - - Servers - - - - 6 - - - 9 - - - 9 - - - 9 - - - 9 - - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - &Add... - - - - - - - &Edit... - - - - - - - De&lete - - - - - - - Move &Up - - - - - - - Move &Down - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - Perform - - - - 6 - - - 8 - - - 8 - - - 8 - - - 8 - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - false - - - QTextEdit::NoWrap - - - - - - - These commands are executed after connect. - - - - - - - - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok - - - - - - - - - buttonBox - rejected() - NetworkEditDlg - reject() - - - 216 - 435 - - - 216 - 228 - - - - - buttonBox - accepted() - NetworkEditDlg - accept() - - - 216 - 435 - - - 216 - 228 - - - - - diff --git a/dev-notes/obsolete/nickeditdlg.ui b/dev-notes/obsolete/nickeditdlg.ui deleted file mode 100644 index 8189f793..00000000 --- a/dev-notes/obsolete/nickeditdlg.ui +++ /dev/null @@ -1,113 +0,0 @@ - - NickEditDlg - - - - 0 - 0 - 309 - 113 - - - - - 0 - 0 - - - - Edit Nick - - - true - - - - 6 - - - 9 - - - 9 - - - 9 - - - 9 - - - - - Nickname: - - - - - - - - - - - - - Qt::Vertical - - - - 291 - 16 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok - - - - - - - - - buttonBox - rejected() - NickEditDlg - reject() - - - 153 - 77 - - - 153 - 47 - - - - - buttonBox - accepted() - NickEditDlg - accept() - - - 153 - 77 - - - 153 - 47 - - - - - diff --git a/dev-notes/obsolete/servereditdlg.ui b/dev-notes/obsolete/servereditdlg.ui deleted file mode 100644 index df7ccced..00000000 --- a/dev-notes/obsolete/servereditdlg.ui +++ /dev/null @@ -1,131 +0,0 @@ - - ServerEditDlg - - - - 0 - 0 - 320 - 110 - - - - Enter Server Details - - - - 9 - - - 6 - - - - - 0 - - - 6 - - - - - - 7 - 0 - 0 - 0 - - - - - - - - 65535 - - - 1024 - - - 6667 - - - - - - - Server address: - - - - - - - Port: - - - - - - - - - Qt::Vertical - - - - 302 - 16 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - ServerEditDlg - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - ServerEditDlg - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/dev-notes/obsolete/serverlist.cpp b/dev-notes/obsolete/serverlist.cpp deleted file mode 100644 index 7f8e233a..00000000 --- a/dev-notes/obsolete/serverlist.cpp +++ /dev/null @@ -1,386 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-08 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 "serverlist.h" -#include "identities.h" -#include "client.h" -#include "signalproxy.h" - -/* NOTE: This dialog holds not only the server list, but also the identities. - * This makes perfect sense given the fact that connections are initiated from - * this dialog, and that the dialog exists during the lifetime of the program. - */ - -ServerListDlg::ServerListDlg(QWidget *parent) : QDialog(parent) { - ui.setupUi(this); - - QSettings settings; - settings.beginGroup("GUI"); - ui.showOnStartup->setChecked(settings.value("ShowServerListOnStartup", false).toBool()); - - updateNetworkTree(); - connect(ui.networkTree, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons())); - connect(Client::instance(), SIGNAL(sessionDataChanged(const QString &)), this, SLOT(updateNetworkTree())); - - settings.endGroup(); - - Client::signalProxy()->attachSignal(this, SIGNAL(requestConnect(QString))); - - // Autoconnect - /* Should not be the client's task... :-P - QStringList list; - QVariantMap networks = Client::retrieveSessionData("Networks").toMap(); - foreach(QString net, networks.keys()) { - if(networks[net].toMap()["AutoConnect"].toBool()) { - list << net; - } - } - if(!list.isEmpty()) emit requestConnect(list); - */ -} - -ServerListDlg::~ServerListDlg() { - -} - -void ServerListDlg::updateNetworkTree() { - QVariantMap networks = Client::retrieveSessionData("Networks").toMap(); - //QStringList headers; - //headers << "Network" << "Autoconnect"; - ui.networkTree->clear(); - //ui.networkTree->setHeaderLabels(headers); - ui.networkTree->setHeaderLabel(tr("Networks")); - QHash groups; - foreach(QString net, networks.keys()) { - QVariantMap s = networks[net].toMap(); - QString gr = s["Group"].toString(); - QTreeWidgetItem *item = 0; - if(gr.isEmpty()) { - item = new QTreeWidgetItem(ui.networkTree); - } else { - if(groups.contains(gr)) { - item = new QTreeWidgetItem(groups[gr]); - } else { - QTreeWidgetItem *newgr = new QTreeWidgetItem(ui.networkTree); - //ui.networkTree->addTopLevelItem(newgr); - newgr->setText(0, gr); - newgr->setFlags(newgr->flags() & ~Qt::ItemIsSelectable); - groups[gr] = newgr; - item = new QTreeWidgetItem(newgr); - newgr->setExpanded(true); - ui.networkTree->addTopLevelItem(newgr); - //ui.networkTree->expandItem(newgr); //<-- buggy Qt? - } - } - item->setText(0, net); - item->setToolTip(0, s["Description"].toString()); - //item->setFlags(item->flags() | Qt::ItemIsUserCheckable); - //item->setCheckState(1, Qt::Unchecked); - } - ui.networkTree->sortItems(0, Qt::AscendingOrder); - updateButtons(); -} - -void ServerListDlg::updateButtons() { - QList selected = ui.networkTree->selectedItems(); - ui.editButton->setEnabled(selected.size() == 1); - ui.deleteButton->setEnabled(selected.size() >= 1); - ui.connectButton->setEnabled(selected.size() >= 1); - -} - -bool ServerListDlg::showOnStartup() { - return ui.showOnStartup->isChecked(); -} - -void ServerListDlg::on_addButton_clicked() { - NetworkEditDlg dlg(this, QVariantMap()); - if(dlg.exec() == QDialog::Accepted) { - QVariantMap networks = Client::retrieveSessionData("Networks").toMap(); - QVariantMap net = dlg.getNetwork(); - networks[net["Name"].toString()] = net; - Client::storeSessionData("Networks", networks); - updateNetworkTree(); - } -} - -void ServerListDlg::on_editButton_clicked() { - QString curnet = ui.networkTree->currentItem()->text(0); - QVariantMap networks = Client::retrieveSessionData("Networks").toMap(); - NetworkEditDlg dlg(this, networks[curnet].toMap()); - if(dlg.exec() == QDialog::Accepted) { - QVariantMap net = dlg.getNetwork(); - networks.remove(curnet); - networks[net["Name"].toString()] = net; - Client::storeSessionData("Networks", networks); - updateNetworkTree(); - } -} - -void ServerListDlg::on_deleteButton_clicked() { - if(QMessageBox::warning(this, tr("Remove Network?"), tr("Are you sure you want to delete the selected network(s)?"), - QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { - QVariantMap networks = Client::retrieveSessionData("Networks").toMap(); - QList sel = ui.networkTree->selectedItems(); - foreach(QTreeWidgetItem *item, sel) { - networks.remove(item->text(0)); - } - Client::storeSessionData("Networks", networks); - updateNetworkTree(); - } -} - -void ServerListDlg::editIdentities(bool end) { - IdentitiesDlg dlg(this); - if(dlg.exec() == QDialog::Accepted) { - /* Should now all be handled within the dialog class. Global settings rulez0rs. */ - //identities = dlg.getIdentities(); - //QMap mapping = dlg.getNameMapping(); - // add mapping here <-- well, I don't fucking know anymore what I meant by this back in 2005... - - // - //storeIdentities(); - //storeNetworks(); // ? how to treat mapping and NOT save changes not yet applied to the server list? - } - else if(end) exit(0); -} - -void ServerListDlg::on_showOnStartup_stateChanged(int) { - //QSettings s; - //s.setValue("GUI/ShowServerListOnStartup", ui.showOnStartup->isChecked()); -} - -void ServerListDlg::accept() { - QStringList nets; - QList list = ui.networkTree->selectedItems(); - foreach(QTreeWidgetItem *item, list) { - nets << item->text(0); - } - emit requestConnect(nets[0]); // FIXME - QDialog::accept(); -} - -/***************************************************************************/ - -NetworkEditDlg::NetworkEditDlg(QWidget *parent, QVariantMap _network) : QDialog(parent) { - ui.setupUi(this); - network = _network; - oldName = network["Name"].toString(); - - connect(ui.serverList, SIGNAL(itemSelectionChanged()), this, SLOT(updateServerButtons())); - - QVariantMap identities = Client::retrieveSessionData("Identities").toMap(); - - ui.identityList->addItem(tr("Default Identity")); - foreach(QString id, identities.keys()) { - if(id != "Default") ui.identityList->addItem(id); - } - QStringList groups; groups << ""; - QVariantMap nets = Client::retrieveSessionData("Networks").toMap(); - foreach(QString net, nets.keys()) { - QString gr = nets[net].toMap()["Group"].toString(); - if(!groups.contains(gr) && !gr.isEmpty()) { - groups.append(gr); - } - } - ui.networkGroup->addItems(groups); - if(network.size() == 0) network = createDefaultNetwork(); - - ui.networkName->setText(network["Name"].toString()); - if(network["Group"].toString().isEmpty()) ui.networkGroup->setCurrentIndex(0); - else ui.networkGroup->setCurrentIndex(ui.networkGroup->findText(network["Group"].toString())); - if(network["Identity"].toString().isEmpty() || network["Identity"].toString() == "Default") ui.identityList->setCurrentIndex(0); - else ui.identityList->setCurrentIndex(ui.identityList->findText(network["Identity"].toString())); - ui.enableAutoConnect->setChecked(network["AutoConnect"].toBool()); - updateWidgets(); - - on_networkName_textChanged(ui.networkName->text()); - ui.networkName->setFocus(); -} - -QVariantMap NetworkEditDlg::createDefaultNetwork() { - QVariantMap net; - - net["Name"] = QString(); - net["Group"] = QString(); - net["Identity"] = QString("Default"); - - return net; -} - -void NetworkEditDlg::updateWidgets() { - ui.serverList->clear(); - foreach(QVariant s, network["Servers"].toList()) { - QVariantMap server = s.toMap(); - QString entry = QString("%1:%2").arg(server["Address"].toString()).arg(server["Port"].toInt()); - QListWidgetItem *item = new QListWidgetItem(entry); - //if(server["Exclude"].toBool()) item->setCheckState(Qt::Checked); - ui.serverList->addItem(item); - } - ui.performEdit->clear(); - ui.performEdit->setText( network["Perform"].toString() ); - updateServerButtons(); -} - -void NetworkEditDlg::updateServerButtons() { - Q_ASSERT(ui.serverList->selectedItems().size() <= 1); - int curidx; - if(ui.serverList->selectedItems().isEmpty()) curidx = -1; - else curidx = ui.serverList->row(ui.serverList->selectedItems()[0]); - ui.editServer->setEnabled(curidx >= 0); - ui.deleteServer->setEnabled(curidx >= 0); - ui.upServer->setEnabled(curidx > 0); - ui.downServer->setEnabled(curidx >= 0 && curidx < ui.serverList->count() - 1); - -} - -void NetworkEditDlg::on_networkName_textChanged(QString text) { - ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!text.isEmpty()); -} - -void NetworkEditDlg::accept() { - QString reason = checkValidity(); - if(reason.isEmpty()) { - network["Name"] = ui.networkName->text(); - network["Description"] = ui.networkDesc->text(); - /*if(ui.networkGroup->currentText() == "") network["Group"] = ""; - else */ network["Group"] = ui.networkGroup->currentText(); - network["AutoConnect"] = ui.enableAutoConnect->isChecked(); - network["Perform"] = ui.performEdit->toPlainText(); - if(ui.identityList->currentIndex()) network["Identity"] = ui.identityList->currentText(); - else network["Identity"] = "Default"; - QDialog::accept(); - } else { - QMessageBox::warning(this, tr("Invalid Network Settings!"), - tr("Your network settings are invalid!
%1").arg(reason)); - } - -} - -QString NetworkEditDlg::checkValidity() { - QString r; - QVariantMap nets = Client::retrieveSessionData("Networks").toMap(); - if(ui.networkName->text() != oldName && nets.keys().contains(ui.networkName->text())) { - r += tr(" Network name already exists."); - } - if(network["Servers"].toList().isEmpty()) { - r += tr(" You need to enter at least one server for this network."); - } - return r; -} - -void NetworkEditDlg::on_addServer_clicked() { - ServerEditDlg dlg(this); - if(dlg.exec() == QDialog::Accepted) { - QList list = network["Servers"].toList(); - list.append(dlg.getServer()); - network["Servers"] = list; - updateWidgets(); - } -} - -void NetworkEditDlg::on_editServer_clicked() { - int idx = ui.serverList->currentRow(); - ServerEditDlg dlg(this, network["Servers"].toList()[idx].toMap()); - if(dlg.exec() == QDialog::Accepted) { - QList list = network["Servers"].toList(); - list[idx] = dlg.getServer(); - network["Servers"] = list; - updateWidgets(); - } -} - -void NetworkEditDlg::on_deleteServer_clicked() { - int idx = ui.serverList->currentRow(); - QList list = network["Servers"].toList(); - list.removeAt(idx); - network["Servers"] = list; - updateWidgets(); - if(idx < ui.serverList->count()) ui.serverList->setCurrentRow(idx); - else if(ui.serverList->count()) ui.serverList->setCurrentRow(ui.serverList->count()-1); -} - -void NetworkEditDlg::on_upServer_clicked() { - int idx = ui.serverList->currentRow(); - QList list = network["Servers"].toList(); - list.swap(idx, idx-1); - network["Servers"] = list; - updateWidgets(); - ui.serverList->setCurrentRow(idx-1); -} - -void NetworkEditDlg::on_downServer_clicked() { - int idx = ui.serverList->currentRow(); - QList list = network["Servers"].toList(); - list.swap(idx, idx+1); - network["Servers"] = list; - updateWidgets(); - ui.serverList->setCurrentRow(idx+1); -} - -void NetworkEditDlg::on_editIdentities_clicked() { - QString id; - if(ui.identityList->currentIndex() > 0) id = ui.identityList->currentText(); - else id = "Default"; - IdentitiesDlg dlg(this, id); - if(dlg.exec() == QDialog::Accepted) { - QVariantMap identities = Client::retrieveSessionData("Identities").toMap(); - ui.identityList->clear(); - ui.identityList->addItem(tr("Default Identity")); - foreach(QString i, identities.keys()) { - if(i != "Default") ui.identityList->addItem(i); - } - QMap mapping = dlg.getNameMapping(); - if(mapping.contains(id)) id = mapping[id]; - else id = "Default"; - if(id != "Default") ui.identityList->setCurrentIndex(ui.identityList->findText(id)); - else ui.identityList->setCurrentIndex(0); - network["Identity"] = id; - } -} - -/***************************************************************************/ - -ServerEditDlg::ServerEditDlg(QWidget *parent, QVariantMap server) : QDialog(parent) { - ui.setupUi(this); - - if(!server.isEmpty()) { - ui.serverAddress->setText(server["Address"].toString()); - ui.serverPort->setValue(server["Port"].toInt()); - } else { - ui.serverAddress->setText(QString()); - ui.serverPort->setValue(6667); - } - on_serverAddress_textChanged(); -} - -void ServerEditDlg::on_serverAddress_textChanged() { - ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!ui.serverAddress->text().isEmpty()); -} - -QVariantMap ServerEditDlg::getServer() { - QVariantMap s; - s["Address"] = ui.serverAddress->text(); - s["Port"] = ui.serverPort->text(); - return s; -} - - -/***************************************************************************/ diff --git a/dev-notes/obsolete/serverlist.h b/dev-notes/obsolete/serverlist.h deleted file mode 100644 index 1e0ad973..00000000 --- a/dev-notes/obsolete/serverlist.h +++ /dev/null @@ -1,113 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005 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 _SERVERLIST_H_ -#define _SERVERLIST_H_ - -#include -#include -#include -#include - -#include "ui_serverlistdlg.h" -#include "ui_networkeditdlg.h" -#include "ui_servereditdlg.h" - -class ServerListDlg : public QDialog { - Q_OBJECT - - public: - ServerListDlg(QWidget *parent); - virtual ~ServerListDlg(); - - bool showOnStartup(); - - public slots: - void editIdentities(bool end = false); - //virtual void reject() { exit(0); } - virtual void accept(); - - signals: - void requestConnect(QString network); - - private slots: - void updateButtons(); - void updateNetworkTree(); - void on_showOnStartup_stateChanged(int); - void on_addButton_clicked(); - void on_editButton_clicked(); - void on_deleteButton_clicked(); - - private: - Ui::ServerListDlg ui; - - //QVariantMap networks; - //QVariantMap identities; <-- this is now stored in global -}; - -class NetworkEditDlg : public QDialog { - Q_OBJECT - - public: - NetworkEditDlg(QWidget *parent, QVariantMap network); - - QVariantMap getNetwork() { return network; } - public slots: - virtual void accept(); - - private slots: - void on_networkName_textChanged(QString); - void on_addServer_clicked(); - void on_editServer_clicked(); - void on_deleteServer_clicked(); - void on_upServer_clicked(); - void on_downServer_clicked(); - void on_editIdentities_clicked(); - - void updateWidgets(); - void updateServerButtons(); - private: - Ui::NetworkEditDlg ui; - - QVariantMap network; - //QVariantMap identities; - QString oldName; - - QVariantMap createDefaultNetwork(); - QString checkValidity(); -}; - -class ServerEditDlg : public QDialog { - Q_OBJECT - - public: - ServerEditDlg(QWidget *parent, QVariantMap server = QVariantMap()); - - QVariantMap getServer(); - - private slots: - void on_serverAddress_textChanged(); - - private: - Ui::ServerEditDlg ui; - -}; - -#endif diff --git a/dev-notes/obsolete/serverlistdlg.ui b/dev-notes/obsolete/serverlistdlg.ui deleted file mode 100644 index dbc3b465..00000000 --- a/dev-notes/obsolete/serverlistdlg.ui +++ /dev/null @@ -1,301 +0,0 @@ - - ServerListDlg - - - - 0 - 0 - 465 - 482 - - - - Server List - - - - - - false - - - false - - - - 6 - - - 8 - - - 8 - - - 8 - - - 8 - - - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'DejaVu Sans'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:600; color:#ff0000;">Big Fat Warning: </span><span style=" font-size:14pt; color:#000000;">The settings in here now need a Core restart in order to take effect! This dialog is doomed and will go away as soon as its replacement is finished.</span></p></body></html> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - false - - - false - - - QAbstractItemView::ExtendedSelection - - - false - - - - 1 - - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - &Add... - - - - - - - - - - false - - - &Edit... - - - - - - - - - - false - - - &Delete - - - - - - - - - - Qt::Vertical - - - - 85 - 296 - - - - - - - - - - - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - &Show this dialog on startup - - - - - - - Qt::Horizontal - - - - 291 - 25 - - - - - - - - false - - - &Connect - - - - - - false - - - - - - - C&lose - - - - - - true - - - - - - - - - - 9 - 9 - 739 - 393 - - - - - - - 9 - 408 - 739 - 27 - - - - - - - 660 - 10 - 87 - 391 - - - - - - - - - - connectButton - clicked() - ServerListDlg - accept() - - - 278 - 253 - - - 96 - 254 - - - - - closeButton - clicked() - ServerListDlg - reject() - - - 369 - 253 - - - 179 - 282 - - - - - diff --git a/dev-notes/obsolete/settingspages.cpp b/dev-notes/obsolete/settingspages.cpp deleted file mode 100644 index e52bb8f5..00000000 --- a/dev-notes/obsolete/settingspages.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-08 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 "mainwin.h" -#include "settingspages.h" - -void MainWin::setupSettingsDlg() { - settingsDlg = new SettingsDlg(this); - settingsDlg->setVisible(false); - - settingsDlg->registerSettingsPage(new BufferManagementSettingsPage()); - settingsDlg->registerSettingsPage(new ConnectionSettingsPage()); - settingsDlg->registerSettingsPage(new AccountManagementSettingsPage()); - -} - - -BufferManagementSettingsPage::BufferManagementSettingsPage() { - ui.setupUi(this); - - ui.tree->headerItem()->setText(0, tr("Buffers")); - setEnabled(false); -} - -void BufferManagementSettingsPage::applyChanges() { - - -} - -ConnectionSettingsPage::ConnectionSettingsPage() { - ui.setupUi(this); - -} - -void ConnectionSettingsPage::applyChanges() { - - -} - -AccountManagementSettingsPage::AccountManagementSettingsPage() { - ui.setupUi(this); - -} - -void AccountManagementSettingsPage::applyChanges() { - -} diff --git a/dev-notes/obsolete/settingspages.h b/dev-notes/obsolete/settingspages.h deleted file mode 100644 index ce99bff3..00000000 --- a/dev-notes/obsolete/settingspages.h +++ /dev/null @@ -1,90 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-08 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 _SETTINGSPAGES_H_ -#define _SETTINGSPAGES_H_ - -#include -#include - -#include "settingspage.h" -#include "ui_buffermgmntsettingspage.h" -#include "ui_connectionsettingspage.h" -#include "ui_usermgmtsettingspage.h" - -class BufferManagementSettingsPage : public QWidget, public SettingsInterface { - Q_OBJECT - Q_INTERFACES(SettingsInterface); - - public: - QString category() { return tr("Buffers"); } - QString title() { return tr("Buffer Management"); } - QWidget *settingsWidget() { return this; } - - BufferManagementSettingsPage(); - - void applyChanges(); - - - private: - Ui::BufferManagementSettingsPage ui; - -}; - -class ConnectionSettingsPage : public QWidget, public SettingsInterface { - Q_OBJECT - Q_INTERFACES(SettingsInterface); - - public: - QString category() { return tr("Behavior"); } - QString title() { return tr("Connection"); } - QWidget *settingsWidget() { return this; } - - ConnectionSettingsPage(); - - void applyChanges(); - - private: - Ui::ConnectionSettingsPage ui; - -}; - -class AccountManagementSettingsPage : public QWidget, public SettingsInterface { - Q_OBJECT - Q_INTERFACES(SettingsInterface); - - public: - QString category() { return tr("Administration"); } - QString title() { return tr("Account Management"); } - QWidget *settingsWidget() { return this; } - - AccountManagementSettingsPage(); - - void applyChanges(); - - private: - Ui::AccountManagementSettingsPage ui; - -}; - - - - -#endif