Provided a hacky way to disconnect from a network, you'll find that in the Debug menu.
No visual feedback is given, but you should be able to reconnect afterwards.
p->attachSlot(SIGNAL(identityCreated(const Identity &)), this, SLOT(coreIdentityCreated(const Identity &)));
p->attachSlot(SIGNAL(identityRemoved(IdentityId)), this, SLOT(coreIdentityRemoved(IdentityId)));
+ p->attachSignal(this, SIGNAL(requestCreateNetwork(const NetworkInfo &)), SIGNAL(createNetwork(const NetworkInfo &)));
+ p->attachSignal(this, SIGNAL(requestUpdateNetwork(const NetworkInfo &)), SIGNAL(updateNetwork(const NetworkInfo &)));
+ p->attachSignal(this, SIGNAL(requestRemoveNetwork(NetworkId)), SIGNAL(removeNetwork(NetworkId)));
+ p->attachSlot(SIGNAL(networkCreated(const NetworkInfo &)), this, SLOT(coreNetworkCreated(const NetworkInfo &)));
+ p->attachSlot(SIGNAL(networkRemoved(NetworkId)), this, SLOT(coreNetworkRemoved(NetworkId)));
+
connect(p, SIGNAL(disconnected()), this, SLOT(disconnectFromCore()));
//connect(mainUi, SIGNAL(connectToCore(const QVariantMap &)), this, SLOT(connectToCore(const QVariantMap &)));
/*** ***/
+// FIXME
+void Client::disconnectFromNetwork(NetworkId id) {
+ if(!instance()->_networks.contains(id)) return;
+ Network *net = instance()->_networks[id];
+ net->requestDisconnect();
+}
+
/*
void Client::networkConnected(uint netid) {
// TODO: create statusBuffer / switch to networkids
}
*/
-void Client::addNetwork(NetworkId netid) {
- Network *net = new Network(netid, instance());
- addNetwork(net);
-}
-
void Client::addNetwork(Network *net) {
net->setProxy(signalProxy());
signalProxy()->synchronize(net);
networkModel()->attachNetwork(net);
connect(net, SIGNAL(destroyed()), instance(), SLOT(networkDestroyed()));
instance()->_networks[net->networkId()] = net;
- emit instance()->networkAdded(net->networkId());
- //if(net->networkId() == 1) net->requestConnect(); // FIXME
+ emit instance()->networkCreated(net->networkId());
+}
+
+void Client::createNetwork(const NetworkInfo &info) {
+
+
}
/*** ***/
}
void Client::networkDestroyed() {
- Network *netinfo = static_cast<Network *>(sender());
- NetworkId networkId = netinfo->networkId();
+ // FIXME this is not gonna work, net is a QObject here already!
+ Network *net = static_cast<Network *>(sender());
+ NetworkId networkId = net->networkId();
if(_networks.contains(networkId))
_networks.remove(networkId);
}
class IrcChannel;
class NickModel;
class SignalProxy;
+struct NetworkInfo;
class QTimer;
*/
static void removeIdentity(IdentityId id);
- static void addNetwork(NetworkId id);
- static void addNetwork(Network *);
-
+ static void createNetwork(const NetworkInfo &info);
+ static void updateNetwork(const NetworkInfo &info);
+ static void removeNetwork(NetworkId id);
static NetworkModel *networkModel();
static BufferModel *bufferModel();
static QVariant retrieveSessionData(const QString &key, const QVariant &def = QVariant());
static QStringList sessionDataKeys();
+ static void disconnectFromNetwork(NetworkId);
+
enum ClientMode { LocalCore, RemoteCore };
signals:
//! Sent to the core when an identity shall be removed. Should not be used elsewhere.
void requestRemoveIdentity(IdentityId);
- void networkAdded(NetworkId id);
+ void networkCreated(NetworkId id);
+ void networkRemoved(NetworkId id);
+
+ void requestCreateNetwork(const NetworkInfo &info);
+ void requestUpdateNetwork(const NetworkInfo &info);
+ void requestRemoveNetwork(const NetworkInfo &info);
public slots:
//void selectBuffer(Buffer *);
virtual ~Client();
void init();
- void syncToCore(const QVariantMap &sessionState);
+ static void addNetwork(Network *);
static QPointer<Client> instanceptr;
else emit connectRequested(networkId()); // and this is for CoreSession :)
}
+void Network::requestDisconnect() {
+ if(!proxy()) return;
+ if(proxy()->proxyMode() == SignalProxy::Client) emit disconnectRequested(); // on the client this triggers calling this slot on the core
+ else emit disconnectRequested(networkId()); // and this is for CoreSession :)
+}
+
// ====================
// Private:
// ====================
}
}
+/************************************************************************
+ * NetworkInfo
+ ************************************************************************/
+
+bool NetworkInfo::operator==(const NetworkInfo &other) const {
+ if(networkId != other.networkId) return false;
+ if(networkName != other.networkName) return false;
+ if(identity != other.identity) return false;
+ if(codecForEncoding != other.codecForEncoding) return false;
+ if(codecForDecoding != other.codecForDecoding) return false;
+ if(serverList != other.serverList) return false;
+ return true;
+}
+
+bool NetworkInfo::operator!=(const NetworkInfo &other) const {
+ return !(*this == other);
+}
void ircUserNickChanged(QString newnick);
void requestConnect();
+ void requestDisconnect();
private slots:
void ircUserDestroyed();
void ircChannelInitDone(IrcChannel *);
void connectRequested(NetworkId = 0);
+ void disconnectRequested(NetworkId = 0);
private:
NetworkId _networkId;
QHash<QString, QString> _supports; // stores results from RPL_ISUPPORT
QList<QVariantMap> _serverList;
+ QStringList _perform;
//QVariantMap networkSettings;
QPointer<SignalProxy> _proxy;
QByteArray codecForDecoding;
QList<QVariantMap> serverList;
+ bool operator==(const NetworkInfo &other) const;
+ bool operator!=(const NetworkInfo &other) const;
};
//p->attachSlot(SIGNAL(requestNetworkStates()), this, SLOT(networkStateRequested()));
p->attachSlot(SIGNAL(requestConnect(QString)), this, SLOT(connectToNetwork(QString)));
+ p->attachSlot(SIGNAL(disconnectFromNetwork(NetworkId)), this, SLOT(disconnectFromNetwork(NetworkId))); // FIXME
p->attachSlot(SIGNAL(sendInput(BufferInfo, QString)), this, SLOT(msgFromClient(BufferInfo, QString)));
p->attachSlot(SIGNAL(requestBacklog(BufferInfo, QVariant, QVariant)), this, SLOT(sendBacklog(BufferInfo, QVariant, QVariant)));
p->attachSignal(this, SIGNAL(displayMsg(Message)));
net->setCodecForEncoding("ISO-8859-15"); // FIXME
net->setCodecForDecoding("ISO-8859-15"); // FIXME
QList<QVariantMap> slist;
- foreach(QVariant v, network["Servers"].toList()) slist << v.toMap();
+ foreach(QVariant v, network["Servers"].toList()) {
+ QVariantMap server;
+ server["Host"] = v.toMap()["Address"];
+ server["Port"] = v.toMap()["Port"];
+ slist << server;
+ }
net->setServerList(slist);
net->setProxy(p);
_networks[netid] = net;
// TODO add error handling
}
+void CoreSession::disconnectFromNetwork(NetworkId id) {
+ _connections[id]->disconnectFromIrc();
+}
+
void CoreSession::networkStateRequested() {
}
void connectToNetwork(QString, const QVariant &previousState = QVariant());
void connectToNetwork(NetworkId, const QVariant &previousState = QVariant());
+ void disconnectFromNetwork(NetworkId id);
//void processSignal(ClientSignal, QVariant, QVariant, QVariant);
void sendBacklog(BufferInfo, QVariant, QVariant);
connect(network, SIGNAL(currentServerSet(const QString &)), this, SLOT(sendPerform()));
connect(&socket, SIGNAL(connected()), this, SLOT(socketConnected()));
- //connect(&socket, SIGNAL(disconnected()), this, SLOT(quit())); FIXME
+ connect(&socket, SIGNAL(disconnected()), this, SLOT(socketDisconnected()));
connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketError(QAbstractSocket::SocketError)));
connect(&socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(socketStateChanged(QAbstractSocket::SocketState)));
connect(&socket, SIGNAL(readyRead()), this, SLOT(socketHasData()));
}
// TODO implement cycling / random servers
- QString host = serverList[0]["Address"].toString();
+ QString host = serverList[0]["Host"].toString();
quint16 port = serverList[0]["Port"].toUInt();
displayStatusMsg(QString("Connecting to %1:%2...").arg(host).arg(port));
socket.connectToHost(host, port);
//qDebug() << "Socket state changed: " << state;
}
+void NetworkConnection::socketDisconnected() {
+ emit disconnected(networkId());
+}
+
// FIXME switch to BufferId
void NetworkConnection::userInput(QString buf, QString msg) {
userInputHandler()->handleUserInput(buf, msg);
void socketHasData();
void socketError(QAbstractSocket::SocketError);
void socketConnected();
+ void socketDisconnected();
void socketStateChanged(QAbstractSocket::SocketState);
private:
ui.ircUsersProgress->setRange(0, 1);
ui.ircUsersProgress->setValue(1);
} else {
+ if(val % 100) return;
ui.ircUsersProgress->setFormat("%v/%m");
ui.ircUsersProgress->setRange(0, max);
ui.ircUsersProgress->setValue(val);
void MainWin::init() {
Client::signalProxy()->attachSignal(this, SIGNAL(requestBacklog(BufferInfo, QVariant, QVariant)));
+ Client::signalProxy()->attachSignal(this, SIGNAL(disconnectFromNetwork(NetworkId)));
ui.bufferWidget->init();
show();
connect(ui.actionEditIdentities, SIGNAL(triggered()), serverListDlg, SLOT(editIdentities()));
connect(ui.actionSettingsDlg, SIGNAL(triggered()), this, SLOT(showSettingsDlg()));
connect(ui.actionDebug_Console, SIGNAL(triggered()), this, SLOT(showDebugConsole()));
+ connect(ui.actionDisconnectNet, SIGNAL(triggered()), this, SLOT(disconnectFromNet()));
connect(ui.actionAboutQt, SIGNAL(triggered()), QApplication::instance(), SLOT(aboutQt()));
+
}
void MainWin::setupViews() {
settingsDlg->registerSettingsPage(new FontsSettingsPage(settingsDlg));
settingsDlg->registerSettingsPage(new IdentitiesSettingsPage(settingsDlg));
- //settingsDlg->registerSettingsPage(new NetworksSettingsPage(settingsDlg));
+ settingsDlg->registerSettingsPage(new NetworksSettingsPage(settingsDlg));
}
void MainWin::connectedToCore() {
else
hide();
}
-
-
-
}
+
+void MainWin::disconnectFromNet() {
+ int i = QInputDialog::getInteger(this, tr("Disconnect from Network"), tr("Enter network id:"));
+ emit disconnectFromNetwork(NetworkId(i));
+}
+
void showCoreConnectionDlg(bool autoConnect = false);
void coreConnectionDlgFinished(int result);
+ void disconnectFromNet();
+
signals:
void connectToCore(const QVariantMap &connInfo);
void disconnectFromCore();
+ void disconnectFromNetwork(NetworkId);
void requestBacklog(BufferInfo, QVariant, QVariant);
private:
***************************************************************************/
#include <QHeaderView>
+#include <QMessageBox>
#include "networkssettingspage.h"
#include "client.h"
+#include "global.h"
#include "identity.h"
#include "network.h"
connect(Client::instance(), SIGNAL(identityCreated(IdentityId)), this, SLOT(clientIdentityAdded(IdentityId)));
connect(Client::instance(), SIGNAL(identityRemoved(IdentityId)), this, SLOT(clientIdentityRemoved(IdentityId)));
- //connect(ui.networkList, SIGNAL(itemSelectionChanged()), this, SLOT(setWidgetStates()));
- //connect(ui.serverList, SIGNAL(itemSelectionChanged()), this, SLOT(setWidgetStates()));
+ connect(ui.identityList, SIGNAL(currentIndexChanged(int)), this, SLOT(widgetHasChanged()));
+ //connect(ui., SIGNAL(), this, SLOT(widgetHasChanged()));
+ //connect(ui., SIGNAL(), this, SLOT(widgetHasChanged()));
foreach(IdentityId id, Client::identityIds()) {
clientIdentityAdded(id);
}
void NetworksSettingsPage::save() {
-
-
+ if(currentId != 0) saveToNetworkInfo(networkInfos[currentId]);
+
+ // First, remove the temporarily created networks
+ QList<NetworkInfo> toCreate, toUpdate;
+ QList<NetworkId> toRemove;
+ QHash<NetworkId, NetworkInfo>::iterator i = networkInfos.begin();
+ while(i != networkInfos.end()) {
+ if((*i).networkId < 0) {
+ toCreate.append(*i);
+ i = networkInfos.erase(i);
+ } else {
+ if((*i) != Client::network((*i).networkId)->networkInfo()) {
+ toUpdate.append(*i);
+ }
+ ++i;
+ }
+ }
+ foreach(NetworkId id, Client::networkIds()) {
+ if(!networkInfos.contains(id)) toRemove.append(id);
+ }
+ SaveNetworksDlg dlg(toCreate, toUpdate, toRemove, this);
+ int ret = dlg.exec();
+ if(ret == QDialog::Rejected) {
+ // canceled -> reload everything to be safe
+ load();
+ }
}
void NetworksSettingsPage::load() {
*/
}
+bool NetworksSettingsPage::aboutToSave() {
+
+ return true; // FIXME
+}
+
void NetworksSettingsPage::widgetHasChanged() {
bool changed = testHasChanged();
if(changed != hasChanged()) setChangedState(changed);
}
bool NetworksSettingsPage::testHasChanged() {
-
+ if(currentId != 0) {
+ saveToNetworkInfo(networkInfos[currentId]);
+ }
+ if(Client::networkIds().count() != networkInfos.count()) return true;
+ foreach(NetworkId id, networkInfos.keys()) {
+ if(id < 0) return true;
+ if(Client::network(id)->networkInfo() != networkInfos[id]) return true;
+ }
return false;
}
ui.renameNetwork->setEnabled(true);
ui.deleteNetwork->setEnabled(true);
ui.connectNow->setEnabled(true);
- if(Client::network(id)->isConnected()) {
+ if(Client::network(id) && Client::network(id)->isConnected()) {
ui.connectNow->setIcon(disconnectedIcon);
ui.connectNow->setText(tr("Disconnect"));
} else {
QListWidgetItem *item = networkItem(net->networkId());
if(!item) return;
item->setText(net->networkName());
+ if(net->isInitialized()) item->setFlags(item->flags() | Qt::ItemIsEnabled);
+ else item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
if(net->isConnected()) {
item->setIcon(connectedIcon);
} else {
}
-void NetworksSettingsPage::insertNetwork(NetworkId id) {
+QListWidgetItem *NetworksSettingsPage::insertNetwork(NetworkId id) {
NetworkInfo info = Client::network(id)->networkInfo();
networkInfos[id] = info;
+ return insertNetwork(info);
+}
+
+QListWidgetItem *NetworksSettingsPage::insertNetwork(const NetworkInfo &info) {
QListWidgetItem *item = new QListWidgetItem(disconnectedIcon, info.networkName);
- item->setData(Qt::UserRole, QVariant::fromValue<NetworkId>(id));
+ item->setData(Qt::UserRole, QVariant::fromValue<NetworkId>(info.networkId));
ui.networkList->addItem(item);
- if(Client::network(id)->isConnected()) {
+ const Network *net = Client::network(info.networkId);
+ if(net->isInitialized()) item->setFlags(item->flags() | Qt::ItemIsEnabled);
+ else item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
+ if(net && net->isConnected()) {
item->setIcon(connectedIcon);
} else {
item->setIcon(disconnectedIcon);
}
widgetHasChanged();
+ return item;
}
void NetworksSettingsPage::displayNetwork(NetworkId id, bool dontsave) {
+ Q_UNUSED(dontsave);
NetworkInfo info = networkInfos[id];
+ ui.identityList->setCurrentIndex(ui.identityList->findData(info.identity.toInt()));
ui.serverList->clear();
foreach(QVariantMap v, info.serverList) {
- ui.serverList->addItem(QString("%1:%2").arg(v["Address"].toString()).arg(v["Port"].toUInt()));
+ ui.serverList->addItem(QString("%1:%2").arg(v["Host"].toString()).arg(v["Port"].toUInt()));
}
-
}
+void NetworksSettingsPage::saveToNetworkInfo(NetworkInfo &info) {
+ info.identity = ui.identityList->itemData(ui.identityList->currentIndex()).toInt();
+}
/*** Network list ***/
void NetworksSettingsPage::on_networkList_itemSelectionChanged() {
+ if(currentId != 0) {
+ saveToNetworkInfo(networkInfos[currentId]);
+ }
if(ui.networkList->selectedItems().count()) {
NetworkId id = ui.networkList->selectedItems()[0]->data(Qt::UserRole).value<NetworkId>();
+ currentId = id;
displayNetwork(id);
+ ui.serverList->setCurrentRow(0);
+ } else {
+ currentId = 0;
}
setWidgetStates();
}
void NetworksSettingsPage::on_addNetwork_clicked() {
+ QStringList existing;
+ for(int i = 0; i < ui.networkList->count(); i++) existing << ui.networkList->item(i)->text();
+ NetworkEditDlgNew dlg(QString(), existing, this);
+ if(dlg.exec() == QDialog::Accepted) {
+ NetworkId id;
+ for(id = 1; id <= networkInfos.count(); id++) {
+ widgetHasChanged();
+ if(!networkInfos.keys().contains(-id.toInt())) break;
+ }
+ id = -id.toInt();
+ NetworkInfo info;
+ info.networkId = id;
+ info.networkName = dlg.networkName();
+ info.identity = 1;
+ networkInfos[id] = info;
+ QListWidgetItem *item = insertNetwork(info);
+ ui.networkList->setCurrentItem(item);
+ setWidgetStates();
+ }
+}
+
+void NetworksSettingsPage::on_deleteNetwork_clicked() {
+ if(ui.networkList->selectedItems().count()) {
+ NetworkId netid = ui.networkList->selectedItems()[0]->data(Qt::UserRole).value<NetworkId>();
+ int ret = QMessageBox::question(this, tr("Delete Network?"),
+ tr("Do you really want to delete the network \"%1\" and all related settings, including the backlog?"
+ "<br><br><em>NOTE: Backlog deletion hasn't actually been implemented yet.</em>").arg(networkInfos[netid].networkName),
+ QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
+ if(ret == QMessageBox::Yes) {
+ currentId = 0;
+ networkInfos.remove(netid); qDebug() << netid << networkInfos.count();
+ delete ui.networkList->selectedItems()[0];
+ ui.networkList->setCurrentRow(qMin(ui.networkList->currentRow()+1, ui.networkList->count()-1));
+ setWidgetStates();
+ widgetHasChanged();
+ }
+ }
+}
+
+void NetworksSettingsPage::on_renameNetwork_clicked() {
+ if(!ui.networkList->selectedItems().count()) return;
+ QString old = ui.networkList->selectedItems()[0]->text();
+ QStringList existing;
+ for(int i = 0; i < ui.networkList->count(); i++) existing << ui.networkList->item(i)->text();
+ NetworkEditDlgNew dlg(old, existing, this);
+ if(dlg.exec() == QDialog::Accepted) {
+ ui.networkList->selectedItems()[0]->setText(dlg.networkName());
+ NetworkId netid = ui.networkList->selectedItems()[0]->data(Qt::UserRole).value<NetworkId>();
+ networkInfos[netid].networkName = dlg.networkName();
+ widgetHasChanged();
+ }
+}
+
+/*** Server list ***/
+
+void NetworksSettingsPage::on_serverList_itemSelectionChanged() {
+ setWidgetStates();
+}
+
+void NetworksSettingsPage::on_addServer_clicked() {
+ if(currentId == 0) return;
+ ServerEditDlgNew dlg(QVariantMap(), this);
+ if(dlg.exec() == QDialog::Accepted) {
+ networkInfos[currentId].serverList.append(dlg.serverData());
+ displayNetwork(currentId);
+ ui.serverList->setCurrentRow(ui.serverList->count()-1);
+ widgetHasChanged();
+ }
+}
+void NetworksSettingsPage::on_editServer_clicked() {
+ if(currentId == 0) return;
+ int cur = ui.serverList->currentRow();
+ ServerEditDlgNew dlg(networkInfos[currentId].serverList[cur], this);
+ if(dlg.exec() == QDialog::Accepted) {
+ networkInfos[currentId].serverList[cur] = dlg.serverData();
+ displayNetwork(currentId);
+ ui.serverList->setCurrentRow(cur);
+ widgetHasChanged();
+ }
+}
+void NetworksSettingsPage::on_deleteServer_clicked() {
+ if(currentId == 0) return;
+ int cur = ui.serverList->currentRow();
+ networkInfos[currentId].serverList.removeAt(cur);
+ displayNetwork(currentId);
+ ui.serverList->setCurrentRow(qMin(cur, ui.serverList->count()-1));
+ widgetHasChanged();
+}
+
+void NetworksSettingsPage::on_upServer_clicked() {
+ int cur = ui.serverList->currentRow();
+ QVariantMap foo = networkInfos[currentId].serverList.takeAt(cur);
+ networkInfos[currentId].serverList.insert(cur-1, foo);
+ displayNetwork(currentId);
+ ui.serverList->setCurrentRow(cur-1);
+ widgetHasChanged();
+}
+
+void NetworksSettingsPage::on_downServer_clicked() {
+ int cur = ui.serverList->currentRow();
+ QVariantMap foo = networkInfos[currentId].serverList.takeAt(cur);
+ networkInfos[currentId].serverList.insert(cur+1, foo);
+ displayNetwork(currentId);
+ ui.serverList->setCurrentRow(cur+1);
+ widgetHasChanged();
}
/**************************************************************************
* ServerEditDlg
*************************************************************************/
-//ServerEditDlg::
+ServerEditDlgNew::ServerEditDlgNew(const QVariantMap &serverData, QWidget *parent) : QDialog(parent) {
+ ui.setupUi(this);
+ if(serverData.count()) {
+ ui.host->setText(serverData["Host"].toString());
+ ui.port->setValue(serverData["Port"].toUInt());
+ ui.password->setText(serverData["Password"].toString());
+ ui.useSSL->setChecked(serverData["UseSSL"].toBool());
+ } else {
+ ui.port->setValue(Global::defaultPort);
+ }
+ on_host_textChanged();
+}
+QVariantMap ServerEditDlgNew::serverData() const {
+ QVariantMap _serverData;
+ _serverData["Host"] = ui.host->text();
+ _serverData["Port"] = ui.port->value();
+ _serverData["Password"] = ui.password->text();
+ _serverData["UseSSL"] = ui.useSSL->isChecked();
+ return _serverData;
+}
+void ServerEditDlgNew::on_host_textChanged() {
+ ui.buttonBox->button(QDialogButtonBox::Ok)->setDisabled(ui.host->text().isEmpty());
+}
+/**************************************************************************
+ * SaveNetworksDlg
+ *************************************************************************/
+SaveNetworksDlg::SaveNetworksDlg(const QList<NetworkInfo> &toCreate, const QList<NetworkInfo> &toUpdate, const QList<NetworkId> &toRemove, QWidget *parent) : QDialog(parent)
+{
+ ui.setupUi(this);
+
+}
#include "settingspage.h"
#include "ui_networkssettingspage.h"
#include "ui_networkeditdlgnew.h"
+#include "ui_servereditdlgnew.h"
+#include "ui_saveidentitiesdlg.h"
#include "network.h"
#include "types.h"
public:
NetworksSettingsPage(QWidget *parent = 0);
- //bool aboutToSave();
+ bool aboutToSave();
public slots:
void save();
void on_networkList_itemSelectionChanged();
void on_addNetwork_clicked();
+ void on_deleteNetwork_clicked();
+ void on_renameNetwork_clicked();
+
+ void on_serverList_itemSelectionChanged();
+ void on_addServer_clicked();
+ void on_deleteServer_clicked();
+ void on_editServer_clicked();
+ void on_upServer_clicked();
+ void on_downServer_clicked();
private:
Ui::NetworksSettingsPage ui;
void reset();
bool testHasChanged();
- void insertNetwork(NetworkId);
+ QListWidgetItem *insertNetwork(NetworkId);
+ QListWidgetItem *insertNetwork(const NetworkInfo &info);
QListWidgetItem *networkItem(NetworkId) const;
+ void saveToNetworkInfo(NetworkInfo &);
};
class NetworkEditDlgNew : public QDialog {
QVariantMap serverData() const;
+ private slots:
+ void on_host_textChanged();
+
private:
- QVariantMap _serverData;
+ Ui::ServerEditDlgNew ui;
};
+class SaveNetworksDlg : public QDialog {
+ Q_OBJECT
+
+ public:
+ SaveNetworksDlg(const QList<NetworkInfo> &toCreate, const QList<NetworkInfo> &toUpdate, const QList<NetworkId> &toRemove, QWidget *parent = 0);
+
+ private:
+ Ui::SaveIdentitiesDlg ui;
+};
#endif
<rect>
<x>0</x>
<y>0</y>
- <width>560</width>
- <height>322</height>
+ <width>688</width>
+ <height>462</height>
</rect>
</property>
<property name="windowTitle" >
</widget>
</item>
<item row="1" column="0" >
- <widget class="QLineEdit" name="serverAddress" />
+ <widget class="QLineEdit" name="host" />
</item>
<item row="1" column="1" >
- <widget class="QSpinBox" name="serverPort" >
+ <widget class="QSpinBox" name="port" >
<property name="minimum" >
<number>1</number>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="serverPassword" >
+ <widget class="QLineEdit" name="password" >
<property name="enabled" >
<bool>false</bool>
</property>
<x>0</x>
<y>0</y>
<width>800</width>
- <height>24</height>
+ <height>25</height>
</rect>
</property>
<widget class="QMenu" name="menuConnection" >
<string>Debug</string>
</property>
<addaction name="actionDebug_Console" />
+ <addaction name="actionDisconnectNet" />
</widget>
<widget class="QMenu" name="menuCore" >
<property name="title" >
<string>Debug &Console</string>
</property>
</action>
+ <action name="actionDisconnectNet" >
+ <property name="text" >
+ <string>Disconnect from Network...</string>
+ </property>
+ </action>
</widget>
<customwidgets>
<customwidget>