src/qtgui/ui/servereditdlg.ui
src/qtgui/ui/serverlistdlg.ui
src/qtgui/ui/settingsdlg.ui
+src/client/clientsettings.h
+src/client/clientsettings.cpp
+src/qtgui/guisettings.h
+src/qtgui/guisettings.cpp
-SET(client_SRCS buffer.cpp buffertreemodel.cpp client.cpp clientproxy.cpp treemodel.cpp)
+SET(client_SRCS buffer.cpp buffertreemodel.cpp client.cpp clientproxy.cpp clientsettings.cpp treemodel.cpp)
SET(client_HDRS )
-SET(client_MOCS buffer.h buffertreemodel.h client.h clientproxy.h treemodel.h)
+SET(client_MOCS buffer.h buffertreemodel.h client.h clientproxy.h clientsettings.h treemodel.h)
QT4_WRAP_CPP(_MOC ${client_MOCS})
ADD_LIBRARY(client ${client_SRCS} ${_MOC})
+TARGET_LINK_LIBRARIES(client common)
\ No newline at end of file
}
Buffer::~Buffer() {
+ //qDebug() << "destroying buffer";
//delete widget;
/*
QSettings s;
bool Client::connectedToCore = false;
Client::ClientMode Client::clientMode;
+VarMap Client::coreConnectionInfo;
QHash<BufferId, Buffer *> Client::buffers;
QHash<uint, BufferId> Client::bufferIds;
QHash<QString, QHash<QString, VarMap> > Client::nicks;
QHash<QString, bool> Client::netConnected;
+QStringList Client::netsAwaitingInit;
QHash<QString, QString> Client::ownNick;
Client *Client::instance() {
void Client::connectToCore(const VarMap &conn) {
// TODO implement SSL
+ coreConnectionInfo = conn;
if(isConnected()) {
- qDebug() << "Already connected to core!";
+ emit coreConnectionError(tr("Already connected to Core!"));
return;
}
if(conn["Host"].toString().isEmpty()) {
clientMode = LocalCore;
- syncToCore(); // TODO send user and pw from conn info
+ syncToCore();
} else {
clientMode = RemoteCore;
+ emit coreConnectionMsg(tr("Connecting..."));
socket.connectToHost(conn["Host"].toString(), conn["Port"].toUInt());
}
}
disconnectFromLocalCore();
coreDisconnected();
}
- // TODO clear internal data
+ /* Clear internal data. Hopefully nothing relies on it at this point. */
+ coreConnectionInfo.clear();
+ sessionData.clear();
+ //foreach(Buffer *buf, buffers.values()) delete buf;
+ qDebug() << "barfoo";
+ _bufferModel->clear();
+ //qDeleteAll(buffers);
+ qDebug() << "foobar";
}
void Client::coreConnected() {
void Client::syncToCore() {
VarMap state;
if(clientMode == LocalCore) {
- state = connectToLocalCore("Default", "password").toMap(); // TODO make this configurable
+ state = connectToLocalCore(coreConnectionInfo["User"].toString(), coreConnectionInfo["Password"].toString()).toMap();
} else {
-
+ // TODO connect to remote cores
}
VarMap data = state["CoreData"].toMap();
//}
VarMap sessionState = state["SessionState"].toMap();
+ VarMap sessData = sessionState["SessionData"].toMap();
+ foreach(QString key, sessData.keys()) {
+ recvSessionData(key, sessData[key]);
+ }
QList<QVariant> coreBuffers = sessionState["Buffers"].toList();
/* make lookups by id faster */
foreach(QVariant vid, coreBuffers) {
bufferIds[id.uid()] = id; // make lookups by id faster
buffer(id); // create all buffers, so we see them in the network views
}
+ netsAwaitingInit = sessionState["Networks"].toStringList();
connectedToCore = true;
- emit connected();
- emit requestNetworkStates();
+ if(netsAwaitingInit.count()) {
+ emit coreConnectionMsg(tr("Requesting network states..."));
+ emit coreConnectionProgress(0, netsAwaitingInit.count());
+ emit requestNetworkStates();
+ }
+ else {
+ emit coreConnectionProgress(1, 1);
+ emit connected();
+ }
}
void Client::updateCoreData(UserId, QString key) {
sessionData[key] = data;
emit sessionDataChanged(key, data);
emit sessionDataChanged(key);
- qDebug() << "stored data in client:" << key;
}
void Client::storeSessionData(const QString &key, const QVariant &data) {
else return def;
}
+QStringList Client::sessionDataKeys() {
+ return instance()->sessionData.keys();
+}
+
void Client::recvProxySignal(ClientSignal sig, QVariant arg1, QVariant arg2, QVariant arg3) {
if(clientMode == LocalCore) return;
QList<QVariant> sigdata;
}
void Client::networkConnected(QString net) {
+ Q_ASSERT(!netsAwaitingInit.contains(net));
netConnected[net] = true;
BufferId id = statusBufferId(net);
Buffer *b = buffer(id);
b->setActive(false);
}
netConnected[net] = false;
+ if(netsAwaitingInit.contains(net)) {
+ qDebug() << "Network" << net << "disconnected while not yet initialized!";
+ netsAwaitingInit.removeAll(net);
+ emit coreConnectionProgress(netConnected.count(), netConnected.count() + netsAwaitingInit.count());
+ if(!netsAwaitingInit.count()) emit connected();
+ }
}
void Client::updateBufferId(BufferId id) {
}
void Client::recvNetworkState(QString net, QVariant state) {
+ netsAwaitingInit.removeAll(net);
netConnected[net] = true;
setOwnNick(net, state.toMap()["OwnNick"].toString());
buffer(statusBufferId(net))->setActive(true);
foreach(QString nick, n.keys()) {
addNick(net, nick, n[nick].toMap());
}
+ emit coreConnectionProgress(netConnected.count(), netConnected.count() + netsAwaitingInit.count());
+ if(!netsAwaitingInit.count()) emit connected();
}
void Client::recvMessage(const Message &msg) {
static void storeSessionData(const QString &key, const QVariant &data);
static QVariant retrieveSessionData(const QString &key, const QVariant &def = QVariant());
+ static QStringList sessionDataKeys();
signals:
void sendInput(BufferId, QString message);
void recvPartialItem(quint32 avail, quint32 size);
void coreConnectionError(QString errorMsg);
+ void coreConnectionMsg(const QString &msg);
+ void coreConnectionProgress(uint part, uint total);
void connected();
void disconnected();
quint32 blockSize;
static bool connectedToCore;
+ static VarMap coreConnectionInfo;
static QHash<BufferId, Buffer *> buffers;
static QHash<uint, BufferId> bufferIds;
static QHash<QString, QHash<QString, VarMap> > nicks;
static QHash<QString, bool> netConnected;
+ static QStringList netsAwaitingInit;
static QHash<QString, QString> ownNick;
QTimer *layoutTimer;
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 by The Quassel IRC Development Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "client.h"
+#include "clientsettings.h"
+
+#include <QStringList>
+
+ClientSettings::ClientSettings(QString g) : Settings(g) {
+
+
+}
+
+ClientSettings::~ClientSettings() {
+
+
+}
+
+QStringList ClientSettings::sessionKeys() {
+ return Client::sessionDataKeys();
+}
+
+void ClientSettings::setSessionValue(const QString &key, const QVariant &data) {
+ Client::storeSessionData(key, data);
+}
+
+QVariant ClientSettings::sessionValue(const QString &key, const QVariant &def) {
+ return Client::retrieveSessionData(key, def);
+}
+
+/***********************************************************************************************/
+
+AccountSettings::AccountSettings() : ClientSettings("Accounts") {
+
+
+}
+
+QStringList AccountSettings::knownAccounts() {
+ return localChildGroups();
+}
+
+QString AccountSettings::lastAccount() {
+ return localValue("LastAccount", "").toString();
+}
+
+void AccountSettings::setLastAccount(const QString &account) {
+ setLocalValue("LastAccount", account);
+}
+
+QString AccountSettings::autoConnectAccount() {
+ return localValue("AutoConnectAccount", "").toString();
+}
+
+void AccountSettings::setAutoConnectAccount(const QString &account) {
+ setLocalValue("AutoConnectAccount", account);
+}
+
+void AccountSettings::setValue(const QString &account, const QString &key, const QVariant &data) {
+ setLocalValue(QString("%1/%2").arg(account).arg(key), data);
+}
+
+QVariant AccountSettings::value(const QString &account, const QString &key, const QVariant &def) {
+ return localValue(QString("%1/%2").arg(account).arg(key), def);
+}
+
+void AccountSettings::removeAccount(const QString &account) {
+ removeLocalKey(account);
+}
+
+
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 by The Quassel IRC Development Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _CLIENTSETTINGS_H_
+#define _CLIENTSETTINGS_H_
+
+#include "settings.h"
+
+class ClientSettings : public Settings {
+ Q_OBJECT
+
+ public:
+ virtual ~ClientSettings();
+
+ protected:
+ ClientSettings(QString group = "General");
+
+ //virtual QStringList allSessionKeys() = 0;
+ virtual QStringList sessionKeys();
+
+ virtual void setSessionValue(const QString &key, const QVariant &data);
+ virtual QVariant sessionValue(const QString &key, const QVariant &def = QVariant());
+
+};
+
+class AccountSettings : public ClientSettings {
+ Q_OBJECT
+
+ public:
+ AccountSettings();
+
+ QStringList knownAccounts();
+ QString lastAccount();
+ void setLastAccount(const QString &account);
+ QString autoConnectAccount();
+ void setAutoConnectAccount(const QString &account);
+
+ void setValue(const QString &account, const QString &key, const QVariant &data);
+ QVariant value(const QString &account, const QString &key, const QVariant &def = QVariant());
+ void removeAccount(const QString &account);
+
+};
+
+#endif
beginRemoveRows(parent, row, row + count - 1);
+
for(int i = row + count - 1; i >= 0; i--) {
item->removeChild(i);
}
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
+ void clear();
+
protected:
bool removeRow(int row, const QModelIndex &parent = QModelIndex());
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
- void clear();
-
+
TreeItem *rootItem;
};
SET(common_SRCS global.cpp logger.cpp message.cpp settings.cpp util.cpp ircuser.cpp)
-SET(common_HDRS message.h settings.h util.h)
-SET(common_MOCS global.h logger.h ircuser.h quasselui.h)
+SET(common_HDRS message.h util.h)
+SET(common_MOCS global.h logger.h ircuser.h quasselui.h settings.h)
QT4_WRAP_CPP(_MOC ${common_MOCS})
ADD_LIBRARY(common ${common_SRCS} ${_MOC})
#define BACKLOG_FORMAT 2
#define BACKLOG_STRING "QuasselIRC Backlog File"
+#define DEFAULT_PORT 4242
+
class Global;
#include <QHash>
Core::instance(); // create and init the core
#endif
- Settings::init();
+ //Settings::init();
#ifndef BUILD_CORE
Style::init();
***************************************************************************/
#include <QSettings>
+#include <QStringList>
+#include <QDebug>
#include "settings.h"
-Settings *settings;
+Settings::Settings(QString g) : QObject(), group(g) {
+
-void Settings::init() {
- curProfile = QObject::tr("Default");
}
-/*
+
Settings::~Settings() {
- qDebug() << "destructing";
}
-*/
-void Settings::setProfile(const QString &profile) {
- curProfile = profile;
+void Settings::setGroup(QString g) {
+ group = g;
+
+}
+
+QStringList Settings::allLocalKeys() {
+ QSettings s;
+ s.beginGroup(group);
+ return s.allKeys();
+}
+
+QStringList Settings::localChildKeys() {
+ QSettings s;
+ s.beginGroup(group);
+ return s.childKeys();
}
-void Settings::setGuiValue(const QString &key, const QVariant &value) {
+QStringList Settings::localChildGroups() {
QSettings s;
- //s.setValue("GUI/Default/BufferStates/QuakeNet/#quassel/voicedExpanded", true);
- //QString k = QString("GUI/%1/%2").arg(curProfile).arg(key);
- s.setValue(QString("GUI/%1/%2").arg(curProfile).arg(key), value);
+ s.beginGroup(group);
+ return s.childGroups();
}
-QVariant Settings::guiValue(const QString &key, const QVariant &defaultValue) {
+void Settings::setLocalValue(const QString &key, const QVariant &data) {
QSettings s;
- return s.value(QString("GUI/%1/%2").arg(curProfile).arg(key), defaultValue);
+ s.beginGroup(group);
+ s.setValue(key, data);
}
-void Settings::setCoreValue(const QString &user, const QString &key, const QVariant &value) {
+QVariant Settings::localValue(const QString &key, const QVariant &def) {
QSettings s;
- s.setValue(QString("Core/%1/%2").arg(user).arg(key), value);
+ s.beginGroup(group);
+ return s.value(key, def);
}
-QVariant Settings::coreValue(const QString &user, const QString &key, const QVariant &defaultValue) {
+void Settings::removeLocalKey(const QString &key) {
QSettings s;
- return s.value(QString("Core/%1/%2").arg(user).arg(key), defaultValue);
+ s.beginGroup(group);
+ s.remove(key);
}
-QString Settings::curProfile;
#include <QString>
#include <QVariant>
-class Settings {
+class Settings : public QObject {
+ Q_OBJECT
public:
- //Settings();
- //~Settings();
- static void init();
- static void setProfile(const QString &string);
- static QString profile();
+ virtual ~Settings();
- static void setGuiValue(const QString &key, const QVariant &value);
- static QVariant guiValue (const QString &key, const QVariant &defaultValue = QVariant());
- static void setCoreValue(const QString &user, const QString &key, const QVariant &value);
- static QVariant coreValue (const QString &user, const QString& key, const QVariant &defaultValue = QVariant());
+ static void setGuiValue(QString, QVariant) {};
+ static QVariant guiValue(QString, QVariant = QVariant()) { return QVariant(); }
+ protected:
+ Settings(QString group = "General");
- private:
- static QString curProfile;
+ void setGroup(QString group);
+ virtual QStringList allLocalKeys();
+ virtual QStringList localChildKeys();
+ virtual QStringList localChildGroups();
+ //virtual QStringList allSessionKeys() = 0;
+ virtual QStringList sessionKeys() = 0;
+
+ virtual void setLocalValue(const QString &key, const QVariant &data);
+ virtual QVariant localValue(const QString &key, const QVariant &def = QVariant());
+
+ virtual void setSessionValue(const QString &key, const QVariant &data) = 0;
+ virtual QVariant sessionValue(const QString &key, const QVariant &def = QVariant()) = 0;
+
+ virtual void removeLocalKey(const QString &key);
+
+ QString group;
};
-//extern Settings *settings;
+
#endif
return reply;
}
-QVariant Core::disconnectLocalClient() {
+void Core::disconnectLocalClient() {
qDebug() << "Local client disconnected.";
instance()->guiUser = 0;
Global::setGuiUser(0);
static CoreSession * createSession(UserId);
static QVariant connectLocalClient(QString user, QString passwd);
- static QVariant disconnectLocalClient();
+ static void disconnectLocalClient();
private slots:
void recvProxySignal(CoreSignal, QVariant, QVariant, QVariant);
- bool startListening(uint port = 4242);
+ bool startListening(uint port = DEFAULT_PORT);
void stopListening();
void incomingConnection();
void clientHasData();
mutex.lock();
v["SessionData"] = sessionData;
mutex.unlock();
-
+ v["Networks"] = QVariant(servers.keys());
return v;
}
#include <QDateTime>
#include "util.h"
+#include "core.h"
+#include "coresession.h"
Server::Server(UserId uid, QString net) : user(uid), network(net) {
QString MQUOTE = QString('\020');
void Server::connectToIrc(QString net) {
if(net != network) return; // not me!
- networkSettings = Global::data(user, "Networks").toMap()[net].toMap();
- identity = Global::data(user, "Identities").toMap()[networkSettings["Identity"].toString()].toMap();
+ CoreSession *sess = Core::session(user);
+ //networkSettings = Global::data(user, "Networks").toMap()[net].toMap();
+ networkSettings = sess->retrieveSessionData("Networks").toMap()[net].toMap();
+ //identity = Global::data(user, "Identities").toMap()[networkSettings["Identity"].toString()].toMap();
+ identity = sess->retrieveSessionData("Identities").toMap()[networkSettings["Identity"].toString()].toMap();
QList<QVariant> servers = networkSettings["Servers"].toList();
QString host = servers[0].toMap()["Address"].toString();
quint16 port = servers[0].toMap()["Port"].toUInt();
#include "message.h"
#include "serverinfo.h"
-#define DEFAULT_PORT 6667
-
/*!
* This is a server object, managing a single connection to an IRC server, handling the associated channels and so on.
SET(qtgui_SRCS bufferview.cpp bufferviewfilter.cpp bufferwidget.cpp channelwidgetinput.cpp chatline.cpp chatwidget.cpp coreconnectdlg.cpp
- identities.cpp mainwin.cpp qtgui.cpp serverlist.cpp settingsdlg.cpp settingspages.cpp style.cpp tabcompleter.cpp)
+ guisettings.cpp identities.cpp mainwin.cpp qtgui.cpp serverlist.cpp settingsdlg.cpp settingspages.cpp style.cpp tabcompleter.cpp)
SET(qtgui_HDRS style.h)
SET(qtgui_MOCS bufferview.h bufferviewfilter.h bufferwidget.h channelwidgetinput.h chatline.h chatwidget.h coreconnectdlg.h
- identities.h mainwin.h qtgui.h serverlist.h settingsdlg.h settingspages.h tabcompleter.h)
+ guisettings.h identities.h mainwin.h qtgui.h serverlist.h settingsdlg.h settingspages.h tabcompleter.h)
SET(qtgui_UICS identitiesdlg.ui identitieseditdlg.ui networkeditdlg.ui mainwin.ui
nickeditdlg.ui serverlistdlg.ui servereditdlg.ui coreconnectdlg.ui ircwidget.ui
bufferviewwidget.ui bufferwidget.ui settingsdlg.ui
#INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
ADD_LIBRARY(qtgui ${qtgui_SRCS} ${_MOC} ${_UIC})
-TARGET_LINK_LIBRARIES(qtgui common)
\ No newline at end of file
+TARGET_LINK_LIBRARIES(qtgui common client)
\ No newline at end of file
/***************************************************************************
- * Copyright (C) 2005/06 by The Quassel Team *
+ * Copyright (C) 2005-07 by The Quassel Team *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include "clientproxy.h"
#include "global.h"
#include "client.h"
+#include "clientsettings.h"
+
+CoreConnectDlg::CoreConnectDlg(QWidget *parent, bool /*doAutoConnect*/) : QDialog(parent) {
+ ui.setupUi(this); //qDebug() << "new dlg";
-CoreConnectDlg::CoreConnectDlg(QWidget *parent) : QDialog(parent) {
- ui.setupUi(this);
- ui.progressBar->hide();
coreState = 0;
- QSettings s;
- /*
- connect(ui.hostName, SIGNAL(textChanged(QString)), this, SLOT(hostEditChanged(QString)));
- connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(hostSelected()));
-
- ui.hostName->setText(s.value("GUI/CoreHost", "localhost").toString());
- ui.hostName->setSelection(0, ui.hostName->text().length());
- ui.hostPort->setValue(s.value("GUI/CorePort", 4242).toInt());
- ui.autoConnect->setChecked(s.value("GUI/CoreAutoConnect", true).toBool());
- if(s.value("GUI/CoreAutoConnect").toBool()) {
- hostSelected();
+ 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.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()));
+
+ AccountSettings s;
+ ui.accountList->addItems(s.knownAccounts());
+ curacc = s.lastAccount();
+ 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(DEFAULT_PORT);
+ 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(!curacc.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(curacc);
+ ui.accountList->setCurrentIndex(idx);
+ //}
+ }
+ }
+}
+
+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.autoConnect->setEnabled(false); // FIXME temporär
+ ui.buttonBox1->button(QDialogButtonBox::Ok)->setEnabled(en && checkInputValid());
+}
+
+void CoreConnectDlg::accountChanged(const QString &text) {
+ AccountSettings s;
+ if(!curacc.isEmpty()) {
+ VarMap 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);
+ VarMap 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;
+ }
+ VarMap 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(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
+
+ VarMap conninfo;
+ ui.stackedWidget->setCurrentIndex(1);
+ if(ui.internalCore->isChecked()) {
+ 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["Post"] = 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.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::hostEditChanged(QString /*txt*/) {
+ //ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(txt.length());
}
void CoreConnectDlg::hostSelected() { /*
VarMap 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);
- ui.autoConnect->setChecked(false);
+ //ui.autoConnect->setChecked(false);
setStartState();
}
-void CoreConnectDlg::updateProgressBar(quint32 recv, quint32 avail) {
- ui.progressBar->setMaximum(avail);
- ui.progressBar->setValue(recv);
+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();
+ //ui.progressBar->hide();
coreState = state;
accept();
}
#define _CORECONNECTDLG_H
#include "ui_coreconnectdlg.h"
+#include "global.h"
class CoreConnectDlg: public QDialog {
Q_OBJECT
public:
- CoreConnectDlg(QWidget *);
+ CoreConnectDlg(QWidget *parent, bool doAutoConnect = false);
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 updateProgressBar(quint32 bytes, quint32 avail);
+ //void coreConnectionMsg(const QString &);
+ //void coreConnectionProgress(uint partial, uint total);
+ void updateProgressBar(uint partial, uint total);
void recvCoreState(QVariant);
private:
Ui::CoreConnectDlg ui;
QVariant coreState;
+ void cancelConnect();
void setStartState();
+ VarMap accountData;
+ QString curacc;
};
#endif
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 by The Quassel IRC Development Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 by The Quassel IRC Development Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef _GUISETTINGS_H_
+#define _GUISETTINGS_H_
+
+#include "clientsettings.h"
+
+class GuiSettings : public ClientSettings {
+ Q_OBJECT
+
+ public:
+ GuiSettings();
+
+
+};
+
+class GuiProfile : public ClientSettings {
+ Q_OBJECT
+
+ public:
+ GuiProfile();
+
+ static QStringList availableProfiles();
+ static GuiProfile *profile(QString name);
+
+
+
+};
+
+#endif
***************************************************************************/
#include "identities.h"
+#include "client.h"
IdentitiesDlg::IdentitiesDlg(QWidget *parent, QString selected) : QDialog(parent) {
ui.setupUi(this);
connect(ui.enableAutoAway, SIGNAL(stateChanged(int)), this, SLOT(autoAwayChecked()));
- identities = Global::data("Identities").toMap();
+ identities = Client::retrieveSessionData("Identities").toMap();
foreach(QString name, identities.keys()) {
nameMapping[name] = name;
}
updateIdentity(getCurIdentity());
QString result = checkValidity();
if(result.length() == 0) {
- Global::putData("Identities", identities);
+ Client::storeSessionData("Identities", identities);
// We have to care about renamed identities and update the network list appropriately...
- VarMap networks = Global::data("Networks").toMap();
+ VarMap networks = Client::retrieveSessionData("Networks").toMap();
foreach(QString netname, networks.keys()) {
VarMap net = networks[netname].toMap();
if(nameMapping.contains(net["Identity"].toString())) {
} else net["Identity"] = "Default";
networks[netname] = net;
}
- Global::putData("Networks", networks);
+ Client::storeSessionData("Networks", networks);
QDialog::accept();
} else {
QMessageBox::warning(this, tr("Invalid Identity!"),
show();
- VarMap connInfo;
- connInfo["User"] = "Default";
- connInfo["Password"] = "password";
- connectToCore(connInfo);
+ //VarMap connInfo;
+ //connInfo["User"] = "Default";
+ //connInfo["Password"] = "password";
+ //connectToCore(connInfo);
- statusBar()->showMessage(tr("Ready."));
+ statusBar()->showMessage(tr("Not connected to core."));
systray = new QSystemTrayIcon(this);
systray->setIcon(QIcon(":/qirc-icon.png"));
systray->show();
if(s.contains("MainWinState")) restoreState(s.value("MainWinState").toByteArray());
s.endGroup();
- s.beginGroup("Buffers");
- QString net = s.value("CurrentNetwork", "").toString();
- QString buf = s.value("CurrentBuffer", "").toString();
- s.endGroup();
+ //s.beginGroup("Buffers");
+ //QString net = s.value("CurrentNetwork", "").toString();
+ //QString buf = s.value("CurrentBuffer", "").toString();
+ //s.endGroup();
+
+ disconnectedFromCore(); // Disable menus and stuff
+ showCoreConnectionDlg(true); // autoconnect if appropriate
+ //ui.actionConnectCore->activate(QAction::Trigger);
}
MainWin::~MainWin() {
*/
void MainWin::setupMenus() {
+ connect(ui.actionConnectCore, SIGNAL(triggered()), this, SLOT(showCoreConnectionDlg()));
+ connect(ui.actionDisconnectCore, SIGNAL(triggered()), Client::instance(), SLOT(disconnectFromCore()));
connect(ui.actionNetworkList, SIGNAL(triggered()), this, SLOT(showServerList()));
connect(ui.actionEditIdentities, SIGNAL(triggered()), serverListDlg, SLOT(editIdentities()));
connect(ui.actionSettingsDlg, SIGNAL(triggered()), this, SLOT(showSettingsDlg()));
BufferTreeModel *model = Client::bufferModel();
connect(model, SIGNAL(bufferSelected(Buffer *)), this, SLOT(showBuffer(Buffer *)));
-
+
addBufferView(tr("All Buffers"), model, BufferViewFilter::AllNets, QStringList());
- addBufferView(tr("All Channels"), model, BufferViewFilter::AllNets|BufferViewFilter::NoQueries|BufferViewFilter::NoServers, QStringList());
- addBufferView(tr("All Queries"), model, BufferViewFilter::AllNets|BufferViewFilter::NoChannels|BufferViewFilter::NoServers, QStringList());
- addBufferView(tr("All Networks"), model, BufferViewFilter::AllNets|BufferViewFilter::NoChannels|BufferViewFilter::NoQueries, QStringList());
- addBufferView(tr("Full Custom"), model, BufferViewFilter::FullCustom, QStringList());
+ //addBufferView(tr("All Channels"), model, BufferViewFilter::AllNets|BufferViewFilter::NoQueries|BufferViewFilter::NoServers, QStringList());
+ //addBufferView(tr("All Queries"), model, BufferViewFilter::AllNets|BufferViewFilter::NoChannels|BufferViewFilter::NoServers, QStringList());
+ //addBufferView(tr("All Networks"), model, BufferViewFilter::AllNets|BufferViewFilter::NoChannels|BufferViewFilter::NoQueries, QStringList());
+ //addBufferView(tr("Full Custom"), model, BufferViewFilter::FullCustom, QStringList());
ui.menuViews->addSeparator();
}
foreach(BufferId id, Client::allBufferIds()) {
emit requestBacklog(id, 100, -1);
}
+
+ ui.menuViews->setEnabled(true);
+ ui.menuCore->setEnabled(true);
+ ui.actionDisconnectCore->setEnabled(false); // FIXME
+ ui.actionNetworkList->setEnabled(true);
+ ui.bufferWidget->show();
}
void MainWin::disconnectedFromCore() {
-
+ ui.menuViews->setEnabled(false);
+ ui.menuCore->setEnabled(false);
+ ui.actionDisconnectCore->setEnabled(false);
+ ui.actionNetworkList->setEnabled(false);
+ ui.bufferWidget->hide();
+ ui.actionConnectCore->setEnabled(false); // FIXME
+ qDebug() << "mainwin disconnected";
}
AbstractUiMsg *MainWin::layoutMsg(const Message &msg) {
return new ChatLine(msg);
}
+void MainWin::showCoreConnectionDlg(bool autoConnect) {
+ coreConnectDlg = new CoreConnectDlg(this, autoConnect);
+ connect(coreConnectDlg, SIGNAL(finished(int)), this, SLOT(coreConnectionDlgFinished(int)));
+ coreConnectDlg->setModal(true);
+ if(!autoConnect || !coreConnectDlg->willDoInternalAutoConnect())
+ coreConnectDlg->show(); // avoid flicker and show dlg only if we do remote connect, which needs a progress bar
+ if(autoConnect) coreConnectDlg->doAutoConnect();
+}
+
+void MainWin::coreConnectionDlgFinished(int /*code*/) {
+
+ delete coreConnectDlg;
+}
+
+
void MainWin::showServerList() {
// if(!serverListDlg) {
// serverListDlg = new ServerListDlg(this);
void showServerList();
void showSettingsDlg();
+ void showCoreConnectionDlg(bool autoConnect = false);
+ void coreConnectionDlgFinished(int result);
void showBuffer(BufferId);
void showBuffer(Buffer *);
SettingsDlg *settingsDlg;
uint currentBuffer;
+ QString currentProfile;
QList<QDockWidget *> netViews;
#include "serverlist.h"
#include "identities.h"
+#include "client.h"
#include "clientproxy.h"
/* NOTE: This dialog holds not only the server list, but also the identities.
updateNetworkTree();
connect(ui.networkTree, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
+ connect(Client::instance(), SIGNAL(sessionDataChanged(const QString &)), this, SLOT(updateNetworkTree()));
settings.endGroup();
// check if we already have a valid identity
- if(!Global::data("Identities", VarMap()).toMap().contains("Default")) editIdentities(true);
+ //if(!Global::data("Identities", VarMap()).toMap().contains("Default")) editIdentities(true); // FIXME
connect(this, SIGNAL(requestConnect(QStringList)), ClientProxy::instance(), SLOT(gsRequestConnect(QStringList)));
// Autoconnect
QStringList list;
- VarMap networks = Global::data("Networks").toMap();
+ VarMap networks = Client::retrieveSessionData("Networks").toMap();
foreach(QString net, networks.keys()) {
if(networks[net].toMap()["AutoConnect"].toBool()) {
list << net;
}
void ServerListDlg::updateNetworkTree() {
- VarMap networks = Global::data("Networks").toMap();
+ VarMap networks = Client::retrieveSessionData("Networks").toMap();
//QStringList headers;
//headers << "Network" << "Autoconnect";
ui.networkTree->clear();
//item->setCheckState(1, Qt::Unchecked);
}
ui.networkTree->sortItems(0, Qt::AscendingOrder);
-
+ updateButtons();
}
void ServerListDlg::updateButtons() {
void ServerListDlg::on_addButton_clicked() {
NetworkEditDlg dlg(this, VarMap());
if(dlg.exec() == QDialog::Accepted) {
- VarMap networks = Global::data("Networks").toMap();
+ VarMap networks = Client::retrieveSessionData("Networks").toMap();
VarMap net = dlg.getNetwork();
networks[net["Name"].toString()] = net;
- Global::putData("Networks", networks);
+ Client::storeSessionData("Networks", networks);
updateNetworkTree();
}
}
void ServerListDlg::on_editButton_clicked() {
QString curnet = ui.networkTree->currentItem()->text(0);
- VarMap networks = Global::data("Networks").toMap();
+ VarMap networks = Client::retrieveSessionData("Networks").toMap();
NetworkEditDlg dlg(this, networks[curnet].toMap());
if(dlg.exec() == QDialog::Accepted) {
VarMap net = dlg.getNetwork();
networks.remove(curnet);
networks[net["Name"].toString()] = net;
- Global::putData("Networks", networks);
+ 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) {
- VarMap networks = Global::data("Networks").toMap();
+ VarMap networks = Client::retrieveSessionData("Networks").toMap();
QList<QTreeWidgetItem *> sel = ui.networkTree->selectedItems();
foreach(QTreeWidgetItem *item, sel) {
networks.remove(item->text(0));
}
- Global::putData("Networks", networks);
+ Client::storeSessionData("Networks", networks);
updateNetworkTree();
}
}
connect(ui.serverList, SIGNAL(itemSelectionChanged()), this, SLOT(updateServerButtons()));
- VarMap identities = Global::data("Identities").toMap();
+ VarMap 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 << "";
- VarMap nets = Global::data("Networks").toMap();
+ VarMap nets = Client::retrieveSessionData("Networks").toMap();
foreach(QString net, nets.keys()) {
QString gr = nets[net].toMap()["Group"].toString();
if(!groups.contains(gr) && !gr.isEmpty()) {
QString NetworkEditDlg::checkValidity() {
QString r;
- VarMap nets = Global::data("Networks").toMap();
+ VarMap nets = Client::retrieveSessionData("Networks").toMap();
if(ui.networkName->text() != oldName && nets.keys().contains(ui.networkName->text())) {
r += tr(" Network name already exists.");
}
else id = "Default";
IdentitiesDlg dlg(this, id);
if(dlg.exec() == QDialog::Accepted) {
- VarMap identities = Global::data("Identities").toMap();
+ VarMap identities = Client::retrieveSessionData("Identities").toMap();
ui.identityList->clear();
ui.identityList->addItem(tr("Default Identity"));
foreach(QString i, identities.keys()) {
private slots:
void updateButtons();
+ void updateNetworkTree();
void on_showOnStartup_stateChanged(int);
void on_addButton_clicked();
void on_editButton_clicked();
private:
Ui::ServerListDlg ui;
- void updateNetworkTree();
//VarMap networks;
//VarMap identities; <-- this is now stored in global
};
<rect>
<x>0</x>
<y>0</y>
- <width>498</width>
- <height>270</height>
+ <width>484</width>
+ <height>215</height>
</rect>
</property>
<property name="sizePolicy" >
<bool>false</bool>
</property>
<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="QGroupBox" name="groupBox" >
- <property name="title" >
- <string>Core Connection Settings</string>
- </property>
- <layout class="QHBoxLayout" >
- <item>
- <layout class="QGridLayout" >
- <item row="0" column="0" colspan="2" >
- <widget class="QComboBox" name="connectProfileName" />
- </item>
- <item row="1" column="0" >
- <widget class="QLabel" name="label_2" >
- <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:'Bitstream Vera 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-weight:600;">Host:</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QLabel" name="hostName" >
- <property name="text" >
- <string>quassel.mindpool.net:4242</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0" >
- <widget class="QLabel" name="label_3" >
- <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:'Bitstream Vera 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-weight:600;">User:</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QLabel" name="user" >
- <property name="text" >
- <string>quasseluser</string>
- </property>
- </widget>
- </item>
- <item row="3" column="0" >
- <widget class="QLabel" name="label_4" >
- <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:'Bitstream Vera 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-weight:600;">Password:</span></p></body></html></string>
- </property>
- </widget>
- </item>
- <item row="3" column="1" >
- <widget class="QLineEdit" name="passwdEdit" >
- <property name="echoMode" >
- <enum>QLineEdit::Password</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="2" >
- <widget class="QPushButton" name="editConnectProfile" >
- <property name="text" >
- <string>Edit...</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2" >
- <widget class="QPushButton" name="newConnectProfile" >
- <property name="text" >
- <string>New...</string>
- </property>
- </widget>
- </item>
- <item row="3" column="2" >
- <widget class="QCheckBox" name="rememberPasswd" >
- <property name="text" >
- <string>Remember</string>
- </property>
- </widget>
- </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>
- <item>
- <widget class="QProgressBar" name="progressBar" >
- <property name="value" >
+ <widget class="QStackedWidget" name="stackedWidget" >
+ <property name="currentIndex" >
<number>0</number>
</property>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
+ <widget class="QWidget" name="page" >
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="title" >
+ <string>Account Settings</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item rowspan="2" row="0" column="0" >
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>Account:</string>
+ </property>
+ </widget>
+ </item>
+ <item rowspan="2" row="0" column="1" colspan="2" >
+ <widget class="QComboBox" name="accountList" >
+ <property name="editable" >
+ <bool>false</bool>
+ </property>
+ <property name="insertPolicy" >
+ <enum>QComboBox::InsertAlphabetically</enum>
+ </property>
+ </widget>
+ </item>
+ <item rowspan="2" row="0" column="3" >
+ <widget class="QToolButton" name="editAccount" >
+ <property name="text" >
+ <string>...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../../images/icons.qrc" >:/default/edit.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item rowspan="2" row="0" column="4" >
+ <widget class="QToolButton" name="newAccount" >
+ <property name="text" >
+ <string>...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../../images/icons.qrc" >:/default/edit_add.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item rowspan="2" row="0" column="5" colspan="2" >
+ <widget class="QToolButton" name="delAccount" >
+ <property name="text" >
+ <string>...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../../images/icons.qrc" >:/default/edit_remove.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="6" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>Host:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" colspan="2" >
+ <widget class="QLineEdit" name="hostEdit" />
+ </item>
+ <item row="2" column="3" colspan="4" >
+ <widget class="QCheckBox" name="internalCore" >
+ <property name="text" >
+ <string>Use internal</string>
+ </property>
+ <property name="checked" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Port:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QSpinBox" name="port" >
+ <property name="minimum" >
+ <number>1024</number>
+ </property>
+ <property name="maximum" >
+ <number>65535</number>
+ </property>
+ <property name="value" >
+ <number>4242</number>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>211</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>User:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="1" colspan="2" >
+ <widget class="QLineEdit" name="userEdit" />
+ </item>
+ <item row="5" column="0" >
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Password:</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1" colspan="2" >
+ <widget class="QLineEdit" name="passwdEdit" >
+ <property name="echoMode" >
+ <enum>QLineEdit::Password</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="3" colspan="4" >
+ <widget class="QCheckBox" name="rememberPasswd" >
+ <property name="text" >
+ <string>Remember</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="0" >
+ <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="autoConnect" >
+ <property name="text" >
+ <string>Always use this account</string>
+ </property>
+ <property name="checked" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>101</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox1" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="page_2" >
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QGroupBox" name="connectionGroupBox" >
+ <property name="title" >
+ <string>Connecting to...</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QLabel" name="connectionStatus" >
+ <property name="text" >
+ <string>Connecting...</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QProgressBar" name="connectionProgress" >
+ <property name="value" >
+ <number>0</number>
+ </property>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="profileLabel" >
+ <property name="text" >
+ <string>GUI Profile:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="guiProfile" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="newGuiProfile" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Maximum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>New...</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="alwaysUseProfile" >
+ <property name="text" >
+ <string>Always use this profile</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>31</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox2" >
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Abort|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </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="QCheckBox" name="autoConnect" >
- <property name="text" >
- <string>Connect automatically</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>101</width>
- <height>31</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>
- </item>
</layout>
</widget>
- <includes/>
<resources>
<include location="../../images/icons.qrc" />
</resources>
<connections>
<connection>
- <sender>buttonBox</sender>
+ <sender>buttonBox1</sender>
<signal>rejected()</signal>
<receiver>CoreConnectDlg</receiver>
<slot>reject()</slot>
<x>0</x>
<y>0</y>
<width>800</width>
- <height>28</height>
+ <height>32</height>
</rect>
</property>
<widget class="QMenu" name="menuConnection" >
<property name="title" >
<string>Connection</string>
</property>
- <widget class="QMenu" name="menuConnectCore" >
- <property name="title" >
- <string>Connect to Core</string>
- </property>
- <addaction name="actionInternal" />
- </widget>
- <addaction name="menuConnectCore" />
+ <addaction name="actionConnectCore" />
<addaction name="actionDisconnectCore" />
<addaction name="separator" />
<addaction name="actionNetworkList" />
</property>
</action>
<action name="actionDisconnectCore" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
<property name="text" >
<string>Disconnect from Core</string>
</property>
</action>
+ <action name="actionConnectCore" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="text" >
+ <string>Connect to Core...</string>
+ </property>
+ </action>
</widget>
<customwidgets>
<customwidget>