Renaming 0.2.0-alpha1 tag to quassel-0.2.0-alpha1.
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.
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 <http://quassel-irc.org/faq> 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!
The bugtracker can be found at <http://bugs.quassel-irc.org>
The dev team can be reached by email: <devel@quassel-irc.org>
-Thanks,
+Thanks for reading,
~ The Quassel IRC Team
-
- (Manuel Nickschas, Marcus Eggenberger, Marco Genise)
+++ /dev/null
-<ui version="4.0" >
- <class>ChannelWidget</class>
- <widget class="QWidget" name="ChannelWidget" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>713</width>
- <height>519</height>
- </rect>
- </property>
- <property name="sizePolicy" >
- <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize" >
- <size>
- <width>200</width>
- <height>100</height>
- </size>
- </property>
- <property name="contextMenuPolicy" >
- <enum>Qt::DefaultContextMenu</enum>
- </property>
- <property name="windowTitle" >
- <string/>
- </property>
- <layout class="QVBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>1</number>
- </property>
- <property name="topMargin" >
- <number>1</number>
- </property>
- <property name="rightMargin" >
- <number>1</number>
- </property>
- <property name="bottomMargin" >
- <number>1</number>
- </property>
- <item>
- <layout class="QHBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
- <item>
- <widget class="QLineEdit" name="topicEdit" >
- <property name="focusPolicy" >
- <enum>Qt::ClickFocus</enum>
- </property>
- <property name="readOnly" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="chanSettingsButton" >
- <property name="windowModality" >
- <enum>Qt::NonModal</enum>
- </property>
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="layoutDirection" >
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="text" >
- <string>...</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QSplitter" name="splitter" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="lineWidth" >
- <number>1</number>
- </property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <widget class="QTextBrowser" name="chatWidget" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
- <horstretch>4</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="font" >
- <font>
- <family>Bitstream Vera Sans Mono</family>
- <pointsize>8</pointsize>
- <weight>50</weight>
- <bold>false</bold>
- </font>
- </property>
- <property name="html" >
- <string><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></string>
- </property>
- </widget>
- <widget class="QTreeWidget" name="nickTree" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
- <horstretch>1</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="layoutDirection" >
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="dragEnabled" >
- <bool>true</bool>
- </property>
- <property name="textElideMode" >
- <enum>Qt::ElideRight</enum>
- </property>
- <property name="rootIsDecorated" >
- <bool>true</bool>
- </property>
- <property name="sortingEnabled" >
- <bool>false</bool>
- </property>
- <property name="animated" >
- <bool>false</bool>
- </property>
- <property name="columnCount" >
- <number>1</number>
- </property>
- <column>
- <property name="text" >
- <string>32 Users</string>
- </property>
- </column>
- <item>
- <property name="text" >
- <string>@ Operators</string>
- </property>
- <item>
- <property name="text" >
- <string>New Sub Item</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>New Item</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>New Item</string>
- </property>
- </item>
- </item>
- <item>
- <property name="text" >
- <string>4 Voiced</string>
- </property>
- <item>
- <property name="text" >
- <string>New Item</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>New Item</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>New Item</string>
- </property>
- </item>
- </item>
- <item>
- <property name="text" >
- <string>19 Users</string>
- </property>
- <item>
- <property name="text" >
- <string>New Sub Item</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>New Item</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>New Item</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>New Item</string>
- </property>
- </item>
- </item>
- </widget>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
- <item>
- <widget class="QComboBox" name="ownNick" >
- <property name="sizeAdjustPolicy" >
- <enum>QComboBox::AdjustToContents</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="ChannelWidgetInput" name="inputEdit" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <customwidgets>
- <customwidget>
- <class>ChannelWidgetInput</class>
- <extends>QLineEdit</extends>
- <header>channelwidgetinput.h</header>
- </customwidget>
- </customwidgets>
- <tabstops>
- <tabstop>inputEdit</tabstop>
- <tabstop>ownNick</tabstop>
- <tabstop>nickTree</tabstop>
- <tabstop>topicEdit</tabstop>
- <tabstop>chanSettingsButton</tabstop>
- <tabstop>chatWidget</tabstop>
- </tabstops>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-/***************************************************************************
- * 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 <QtGui>
-#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.<br>"
- "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'?<br>"
- "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("<br>%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("<b>Could not connect to Quassel Core!</b><br>\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);
-}
+++ /dev/null
-/***************************************************************************
- * 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
+++ /dev/null
-/***************************************************************************
- * 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("<b>Some other GUI client changed the identities data!</b><br>"
- "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<QString, QString> _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<QString> 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<QString> _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();
- }
+++ /dev/null
-/***************************************************************************
- * 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 <QtGui>
-#include <QtCore>
-
-#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<QString, QString> 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<QString, QString> 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<QString, QString> mapping, QVariantMap templ, QString selected = QString());
-
- QVariantMap getIdentities() { return identities; }
- QMap<QString, QString> 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<QString, QString> mapping;
-
- void sortList();
-};
-
-class RenameIdentityDlg : public QDialog {
- Q_OBJECT
-
- public:
- RenameIdentityDlg(QWidget *parent, QList<QString> reserved, QString name = QString());
-
- QString getName();
-
- private slots:
- void textChanged(QString);
-
- private:
- Ui::NickEditDlg ui;
- QList<QString> reserved;
-};
-
-#endif
+++ /dev/null
-<ui version="4.0" >
- <class>IdentitiesDlg</class>
- <widget class="QDialog" name="IdentitiesDlg" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>454</width>
- <height>442</height>
- </rect>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="windowTitle" >
- <string>Edit Identity</string>
- </property>
- <property name="windowIcon" >
- <iconset resource="../images/icons.qrc" >:/default/identity.png</iconset>
- </property>
- <property name="modal" >
- <bool>true</bool>
- </property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>8</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QComboBox" name="identityList" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>3</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="insertPolicy" >
- <enum>QComboBox::NoInsert</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="editIdentitiesButton" >
- <property name="text" >
- <string>Edit...</string>
- </property>
- <property name="icon" >
- <iconset resource="../images/icons.qrc" >:/default/edit_user.png</iconset>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QTabWidget" name="tabWidget" >
- <property name="currentIndex" >
- <number>0</number>
- </property>
- <widget class="QWidget" name="generalTab" >
- <attribute name="title" >
- <string>&General</string>
- </attribute>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>8</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="0" column="0" >
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string>Real Name</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QLineEdit" name="identEdit" />
- </item>
- <item rowspan="2" row="0" column="1" >
- <widget class="QLineEdit" name="realNameEdit" />
- </item>
- <item rowspan="2" row="1" column="0" >
- <widget class="QLabel" name="label_2" >
- <property name="text" >
- <string>Ident</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QGroupBox" name="nickGroupBox" >
- <property name="title" >
- <string>Nicknames</string>
- </property>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>8</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QListWidget" name="nickList" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>7</vsizetype>
- <horstretch>1</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QPushButton" name="addNickButton" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>&Add...</string>
- </property>
- <property name="icon" >
- <iconset resource="../images/icons.qrc" >:/default/edit_add.png</iconset>
- </property>
- <property name="iconSize" >
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="editNickButton" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>&Edit...</string>
- </property>
- <property name="icon" >
- <iconset resource="../images/icons.qrc" >:/default/edit.png</iconset>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="delNickButton" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>De&lete</string>
- </property>
- <property name="icon" >
- <iconset resource="../images/icons.qrc" >:/default/edit_remove.png</iconset>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>0</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QToolButton" name="upNickButton" >
- <property name="text" >
- <string>...</string>
- </property>
- <property name="icon" >
- <iconset resource="../images/icons.qrc" >:/default/1uparrow.png</iconset>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="downNickButton" >
- <property name="text" >
- <string>...</string>
- </property>
- <property name="icon" >
- <iconset resource="../images/icons.qrc" >:/default/1downarrow.png</iconset>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>0</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>0</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- <widget class="QWidget" native="1" name="widget" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>0</y>
- <width>395</width>
- <height>83</height>
- </rect>
- </property>
- </widget>
- </widget>
- <widget class="QWidget" name="awayTab" >
- <attribute name="title" >
- <string>&Away</string>
- </attribute>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>8</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="awayNickEdit" />
- </item>
- <item row="1" column="0" >
- <widget class="QCheckBox" name="enableAwayReason" >
- <property name="text" >
- <string>Away Reason</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QLineEdit" name="awayReasonEdit" />
- </item>
- <item row="2" column="0" >
- <widget class="QCheckBox" name="enableReturnMessage" >
- <property name="text" >
- <string>Return Message</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QLineEdit" name="returnMessageEdit" />
- </item>
- <item row="0" column="0" >
- <widget class="QCheckBox" name="enableAwayNick" >
- <property name="text" >
- <string>Away Nick</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QGroupBox" name="groupBox" >
- <property name="title" >
- <string>Auto Away</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>8</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QCheckBox" name="enableAutoAway" >
- <property name="text" >
- <string>Enable Auto Away</string>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLabel" name="autoAwayLabel_1" >
- <property name="text" >
- <string>Auto away after</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QSpinBox" name="autoAwayTime" />
- </item>
- <item>
- <widget class="QLabel" name="autoAwayLabel_2" >
- <property name="text" >
- <string>minutes</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="1" column="0" >
- <widget class="QCheckBox" name="enableAutoAwayReturn" >
- <property name="text" >
- <string>Return Message</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0" >
- <widget class="QCheckBox" name="enableAutoAwayReason" >
- <property name="text" >
- <string>Away Reason</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QLineEdit" name="autoAwayReturnEdit" />
- </item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="autoAwayReasonEdit" />
- </item>
- </layout>
- </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>
- <widget class="QWidget" name="messagesTab" >
- <attribute name="title" >
- <string>&Messages</string>
- </attribute>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>8</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="1" column="0" >
- <widget class="QLabel" name="label_3" >
- <property name="text" >
- <string>Part Reason</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QLineEdit" name="partReasonEdit" />
- </item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="kickReasonEdit" />
- </item>
- <item row="2" column="0" >
- <widget class="QLabel" name="label_5" >
- <property name="text" >
- <string>Quit Reason</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QLineEdit" name="quitReasonEdit" />
- </item>
- <item row="0" column="0" >
- <widget class="QLabel" name="label_4" >
- <property name="text" >
- <string>Kick Reason</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>141</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons" >
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources>
- <include location="../images/icons.qrc" />
- </resources>
- <connections>
- <connection>
- <sender>enableAwayNick</sender>
- <signal>clicked(bool)</signal>
- <receiver>awayNickEdit</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>71</x>
- <y>84</y>
- </hint>
- <hint type="destinationlabel" >
- <x>212</x>
- <y>84</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>enableAwayReason</sender>
- <signal>clicked(bool)</signal>
- <receiver>awayReasonEdit</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>111</x>
- <y>117</y>
- </hint>
- <hint type="destinationlabel" >
- <x>153</x>
- <y>116</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>enableReturnMessage</sender>
- <signal>clicked(bool)</signal>
- <receiver>returnMessageEdit</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>120</x>
- <y>145</y>
- </hint>
- <hint type="destinationlabel" >
- <x>166</x>
- <y>145</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>enableAutoAway</sender>
- <signal>clicked(bool)</signal>
- <receiver>autoAwayTime</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>79</x>
- <y>202</y>
- </hint>
- <hint type="destinationlabel" >
- <x>144</x>
- <y>230</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>enableAutoAwayReturn</sender>
- <signal>clicked(bool)</signal>
- <receiver>autoAwayReturnEdit</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>121</x>
- <y>284</y>
- </hint>
- <hint type="destinationlabel" >
- <x>202</x>
- <y>291</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>enableAutoAwayReason</sender>
- <signal>clicked(bool)</signal>
- <receiver>autoAwayReasonEdit</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>140</x>
- <y>261</y>
- </hint>
- <hint type="destinationlabel" >
- <x>169</x>
- <y>261</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>IdentitiesDlg</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>226</x>
- <y>420</y>
- </hint>
- <hint type="destinationlabel" >
- <x>226</x>
- <y>220</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>IdentitiesDlg</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>226</x>
- <y>420</y>
- </hint>
- <hint type="destinationlabel" >
- <x>226</x>
- <y>220</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
+++ /dev/null
-<ui version="4.0" >
- <class>IdentitiesEditDlg</class>
- <widget class="QDialog" name="IdentitiesEditDlg" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>382</width>
- <height>235</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Edit Identities</string>
- </property>
- <property name="modal" >
- <bool>true</bool>
- </property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>8</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QListWidget" name="identList" />
- </item>
- <item>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QPushButton" name="addButton" >
- <property name="text" >
- <string>&Add...</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="duplicateButton" >
- <property name="text" >
- <string>&Duplicate...</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="renameButton" >
- <property name="text" >
- <string>&Rename...</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="deleteButton" >
- <property name="text" >
- <string>De&lete</string>
- </property>
- </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>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons" >
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>IdentitiesEditDlg</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>190</x>
- <y>213</y>
- </hint>
- <hint type="destinationlabel" >
- <x>190</x>
- <y>117</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>IdentitiesEditDlg</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>190</x>
- <y>213</y>
- </hint>
- <hint type="destinationlabel" >
- <x>190</x>
- <y>117</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
+++ /dev/null
-<ui version="4.0" >
- <class>NetworkEditDlg</class>
- <widget class="QDialog" name="NetworkEditDlg" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>385</width>
- <height>456</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Edit Network Settings</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
- <number>9</number>
- </property>
- <item>
- <layout class="QGridLayout" >
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
- <property name="horizontalSpacing" >
- <number>6</number>
- </property>
- <property name="verticalSpacing" >
- <number>6</number>
- </property>
- <item row="3" column="0" >
- <widget class="QLabel" name="label_3" >
- <property name="text" >
- <string>Identity:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="0" >
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string>Network:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0" >
- <widget class="QLabel" name="label_2" >
- <property name="text" >
- <string>Group:</string>
- </property>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QComboBox" name="networkGroup" >
- <property name="editable" >
- <bool>true</bool>
- </property>
- <property name="insertPolicy" >
- <enum>QComboBox::NoInsert</enum>
- </property>
- </widget>
- </item>
- <item row="3" column="1" >
- <layout class="QHBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
- <item>
- <widget class="QComboBox" name="identityList" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="editIdentities" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Edit...</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item row="0" column="1" >
- <widget class="QLineEdit" name="networkName" />
- </item>
- <item row="1" column="1" >
- <widget class="QLineEdit" name="networkDesc" />
- </item>
- <item row="1" column="0" >
- <widget class="QLabel" name="label_5" >
- <property name="text" >
- <string>Comment:</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QCheckBox" name="enableAutoConnect" >
- <property name="text" >
- <string>Auto-connect on startup</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QTabWidget" name="tabWidget" >
- <property name="enabled" >
- <bool>true</bool>
- </property>
- <property name="currentIndex" >
- <number>0</number>
- </property>
- <widget class="QWidget" name="serversTab" >
- <property name="enabled" >
- <bool>true</bool>
- </property>
- <attribute name="title" >
- <string>Servers</string>
- </attribute>
- <layout class="QHBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
- <number>9</number>
- </property>
- <item>
- <widget class="QListWidget" name="serverList" />
- </item>
- <item>
- <layout class="QVBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
- <item>
- <widget class="QPushButton" name="addServer" >
- <property name="text" >
- <string>&Add...</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="editServer" >
- <property name="text" >
- <string>&Edit...</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="deleteServer" >
- <property name="text" >
- <string>De&lete</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="upServer" >
- <property name="text" >
- <string>Move &Up</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="downServer" >
- <property name="text" >
- <string>Move &Down</string>
- </property>
- </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>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="performTab" >
- <attribute name="title" >
- <string>Perform</string>
- </attribute>
- <layout class="QVBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>8</number>
- </property>
- <property name="topMargin" >
- <number>8</number>
- </property>
- <property name="rightMargin" >
- <number>8</number>
- </property>
- <property name="bottomMargin" >
- <number>8</number>
- </property>
- <item>
- <layout class="QVBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
- <item>
- <widget class="QTextEdit" name="performEdit" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="lineWrapMode" >
- <enum>QTextEdit::NoWrap</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="label_4" >
- <property name="text" >
- <string>These commands are executed after connect.</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </widget>
- </item>
- <item>
- <widget class="QWidget" native="1" name="layoutWidget" />
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons" >
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>NetworkEditDlg</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>216</x>
- <y>435</y>
- </hint>
- <hint type="destinationlabel" >
- <x>216</x>
- <y>228</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>NetworkEditDlg</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>216</x>
- <y>435</y>
- </hint>
- <hint type="destinationlabel" >
- <x>216</x>
- <y>228</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
+++ /dev/null
-<ui version="4.0" >
- <class>NickEditDlg</class>
- <widget class="QDialog" name="NickEditDlg" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>309</width>
- <height>113</height>
- </rect>
- </property>
- <property name="sizePolicy" >
- <sizepolicy vsizetype="MinimumExpanding" hsizetype="MinimumExpanding" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="windowTitle" >
- <string>Edit Nick</string>
- </property>
- <property name="modal" >
- <bool>true</bool>
- </property>
- <layout class="QVBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
- <number>9</number>
- </property>
- <item>
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string>Nickname:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="lineEdit" />
- </item>
- <item>
- <widget class="QWidget" native="1" name="widget" />
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>291</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons" >
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>NickEditDlg</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>153</x>
- <y>77</y>
- </hint>
- <hint type="destinationlabel" >
- <x>153</x>
- <y>47</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>NickEditDlg</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>153</x>
- <y>77</y>
- </hint>
- <hint type="destinationlabel" >
- <x>153</x>
- <y>47</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
+++ /dev/null
-<ui version="4.0" >
- <class>ServerEditDlg</class>
- <widget class="QDialog" name="ServerEditDlg" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>320</width>
- <height>110</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Enter Server Details</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QGridLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="1" column="0" >
- <widget class="QLineEdit" name="serverAddress" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item row="1" column="1" colspan="2" >
- <widget class="QSpinBox" name="serverPort" >
- <property name="maximum" >
- <number>65535</number>
- </property>
- <property name="minimum" >
- <number>1024</number>
- </property>
- <property name="value" >
- <number>6667</number>
- </property>
- </widget>
- </item>
- <item row="0" column="0" >
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string>Server address:</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QLabel" name="label_2" >
- <property name="text" >
- <string>Port:</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>302</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons" >
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>ServerEditDlg</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel" >
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>ServerEditDlg</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel" >
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
+++ /dev/null
-/***************************************************************************
- * 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<QString, QTreeWidgetItem *> 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<QTreeWidgetItem *> 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<QTreeWidgetItem *> 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<QString, QString> 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<QTreeWidgetItem *> 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() == "<none>") 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("<b>Your network settings are invalid!</b><br>%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<QVariant> 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<QVariant> list = network["Servers"].toList();
- list[idx] = dlg.getServer();
- network["Servers"] = list;
- updateWidgets();
- }
-}
-
-void NetworkEditDlg::on_deleteServer_clicked() {
- int idx = ui.serverList->currentRow();
- QList<QVariant> 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<QVariant> 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<QVariant> 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<QString, QString> 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;
-}
-
-
-/***************************************************************************/
+++ /dev/null
-/***************************************************************************
- * 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 <QtGui>
-#include <QMap>
-#include <QList>
-#include <QVariant>
-
-#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
+++ /dev/null
-<ui version="4.0" >
- <class>ServerListDlg</class>
- <widget class="QDialog" name="ServerListDlg" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>465</width>
- <height>482</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Server List</string>
- </property>
- <property name="windowIcon" >
- <iconset/>
- </property>
- <property name="sizeGripEnabled" >
- <bool>false</bool>
- </property>
- <property name="modal" >
- <bool>false</bool>
- </property>
- <layout class="QVBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>8</number>
- </property>
- <property name="topMargin" >
- <number>8</number>
- </property>
- <property name="rightMargin" >
- <number>8</number>
- </property>
- <property name="bottomMargin" >
- <number>8</number>
- </property>
- <item>
- <widget class="QLabel" name="label" >
- <property name="text" >
- <string><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></string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
- </property>
- <property name="wordWrap" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
- <item>
- <widget class="QTreeWidget" name="networkTree" >
- <property name="dragEnabled" >
- <bool>false</bool>
- </property>
- <property name="alternatingRowColors" >
- <bool>false</bool>
- </property>
- <property name="selectionMode" >
- <enum>QAbstractItemView::ExtendedSelection</enum>
- </property>
- <property name="sortingEnabled" >
- <bool>false</bool>
- </property>
- <column>
- <property name="text" >
- <string>1</string>
- </property>
- </column>
- </widget>
- </item>
- <item>
- <layout class="QVBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
- <item>
- <widget class="QPushButton" name="addButton" >
- <property name="text" >
- <string>&Add...</string>
- </property>
- <property name="icon" >
- <iconset/>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="editButton" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="text" >
- <string>&Edit...</string>
- </property>
- <property name="icon" >
- <iconset/>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="deleteButton" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="text" >
- <string>&Delete</string>
- </property>
- <property name="icon" >
- <iconset/>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>85</width>
- <height>296</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>0</number>
- </property>
- <property name="topMargin" >
- <number>0</number>
- </property>
- <property name="rightMargin" >
- <number>0</number>
- </property>
- <property name="bottomMargin" >
- <number>0</number>
- </property>
- <item>
- <widget class="QCheckBox" name="showOnStartup" >
- <property name="text" >
- <string>&Show this dialog on startup</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>291</width>
- <height>25</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="connectButton" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="text" >
- <string>&Connect</string>
- </property>
- <property name="icon" >
- <iconset/>
- </property>
- <property name="default" >
- <bool>false</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="closeButton" >
- <property name="text" >
- <string>C&lose</string>
- </property>
- <property name="icon" >
- <iconset/>
- </property>
- <property name="default" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- <widget class="QWidget" native="1" name="widget" >
- <property name="geometry" >
- <rect>
- <x>9</x>
- <y>9</y>
- <width>739</width>
- <height>393</height>
- </rect>
- </property>
- </widget>
- <widget class="QWidget" native="1" name="widget_2" >
- <property name="geometry" >
- <rect>
- <x>9</x>
- <y>408</y>
- <width>739</width>
- <height>27</height>
- </rect>
- </property>
- </widget>
- <widget class="QWidget" native="1" name="widget_3" >
- <property name="geometry" >
- <rect>
- <x>660</x>
- <y>10</y>
- <width>87</width>
- <height>391</height>
- </rect>
- </property>
- </widget>
- </widget>
- <resources>
- <include location="../images/icons.qrc" />
- </resources>
- <connections>
- <connection>
- <sender>connectButton</sender>
- <signal>clicked()</signal>
- <receiver>ServerListDlg</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>278</x>
- <y>253</y>
- </hint>
- <hint type="destinationlabel" >
- <x>96</x>
- <y>254</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>closeButton</sender>
- <signal>clicked()</signal>
- <receiver>ServerListDlg</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>369</x>
- <y>253</y>
- </hint>
- <hint type="destinationlabel" >
- <x>179</x>
- <y>282</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
+++ /dev/null
-/***************************************************************************
- * 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() {
-
-}
+++ /dev/null
-/***************************************************************************
- * 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 <QtCore>
-#include <QtGui>
-
-#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