Plus some extensions of the Network class (NetworkInfo is back, yay!).
Plus I moved obsolete files to dev-notes/obsolete to remove them from the translators' scope :)
src/qtui/settingsdlg.cpp
src/qtui/settingsdlg.h
src/qtui/settingspages
-src/qtui/settingspages.cpp
-src/qtui/settingspages.h
src/qtui/settingspages/createidentitydlg.ui
src/qtui/settingspages/fontssettingspage.cpp
src/qtui/settingspages/fontssettingspage.h
src/qtui/topicwidget.h
src/qtui/ui
src/qtui/ui/aboutdlg.ui
-src/qtui/ui/buffermgmtpage.ui
src/qtui/ui/bufferviewwidget.ui
src/qtui/ui/bufferwidget.ui
-src/qtui/ui/channelwidget.ui
-src/qtui/ui/connectionpage.ui
src/qtui/ui/coreconnectdlg.ui
-src/qtui/ui/coresettingspage.ui
src/qtui/ui/debugconsole.ui
src/qtui/ui/identitiesdlg.ui
src/qtui/ui/identitieseditdlg.ui
src/qtui/ui/serverlistdlg.ui
src/qtui/ui/settingsdlg.ui
src/qtui/ui/topicwidget.ui
-src/qtui/ui/usermgmtpage.ui
src/uisupport
src/uisupport/action.cpp
src/uisupport/action.h
+++ /dev/null
-NetworkSettingsPage:
---------------------
-* Connect-Icons vor dem Network-Eintrag (für aktuellen Zustand)
-* Nur disconnectete Netze können entfernt werden
-
-Architektur:
-------------
-NetworkInfo wird zu Network, ist in Zukunft das Top-Level-Objekt für ein
-Netz. Server wird zu NetworkConnection, als Child von Network.
-Threading? Mal sehen wie das am besten gehen würde...
-
/*** public static methods ***/
-
-QList<Network *> Client::networks() {
- return instance()->_networks.values();
-}
-
-Network *Client::network(NetworkId networkid) {
- if(instance()->_networks.contains(networkid))
- return instance()->_networks[networkid];
- else
- return 0;
-}
-
QList<BufferInfo> Client::allBufferInfos() {
QList<BufferInfo> bufferids;
foreach(Buffer *buffer, buffers()) {
return instance()->_syncedToCore;
}
+/*** Network handling ***/
+
+QList<NetworkId> Client::networkIds() {
+ return instance()->_networks.keys();
+}
+
+const Network * Client::network(NetworkId networkid) {
+ if(instance()->_networks.contains(networkid)) return instance()->_networks[networkid];
+ else return 0;
+}
+
/*** Identity handling ***/
QList<IdentityId> Client::identityIds() {
// Clear internal data. Hopefully nothing relies on it at this point.
_networkModel->clear();
- QHash<BufferId, Buffer *>::iterator bufferIter = _buffers.begin();
- while(bufferIter != _buffers.end()) {
- Buffer *buffer = bufferIter.value();
- disconnect(buffer, SIGNAL(destroyed()), this, 0);
- bufferIter = _buffers.erase(bufferIter);
- buffer->deleteLater();
- }
- Q_ASSERT(_buffers.isEmpty());
-
-
QHash<NetworkId, Network*>::iterator netIter = _networks.begin();
while(netIter != _networks.end()) {
Network *net = netIter.value();
}
Q_ASSERT(_networks.isEmpty());
+ QHash<BufferId, Buffer *>::iterator bufferIter = _buffers.begin();
+ while(bufferIter != _buffers.end()) {
+ Buffer *buffer = bufferIter.value();
+ disconnect(buffer, SIGNAL(destroyed()), this, 0);
+ bufferIter = _buffers.erase(bufferIter);
+ buffer->deleteLater();
+ }
+ Q_ASSERT(_buffers.isEmpty());
+
QHash<IdentityId, Identity*>::iterator idIter = _identities.begin();
while(idIter != _identities.end()) {
Identity *id = idIter.value();
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
}
static void destroy();
static void init(AbstractUi *);
- static QList<Network *> networks();
- static Network *network(NetworkId networkid);
-
static QList<BufferInfo> allBufferInfos();
static QList<Buffer *> buffers();
static Buffer *buffer(BufferId bufferUid);
static Buffer *buffer(BufferInfo);
+ static QList<NetworkId> networkIds();
+ static const Network * network(NetworkId);
+
static QList<IdentityId> identityIds();
static const Identity * identity(IdentityId);
//! Sent to the core when an identity shall be removed. Should not be used elsewhere.
void requestRemoveIdentity(IdentityId);
+ void networkAdded(NetworkId id);
+
public slots:
//void selectBuffer(Buffer *);
}
// I think this is unnecessary since IrcUsers have us as their daddy :)
-//Network::~Network() {
-// QHashIterator<QString, IrcUser *> ircuser(_ircUsers);
-// while (ircuser.hasNext()) {
-// ircuser.next();
-// delete ircuser.value();
-// }
-//}
+/*
+Network::~Network() {
+ QHashIterator<QString, IrcUser *> ircuser(_ircUsers);
+ while (ircuser.hasNext()) {
+ ircuser.next();
+ delete ircuser.value();
+ }
+}
+*/
NetworkId Network::networkId() const {
return _networkId;
return _connected;
}
+NetworkInfo Network::networkInfo() const {
+ NetworkInfo info;
+ info.networkName = networkName();
+ info.networkId = networkId();
+ info.identity = identity();
+ info.codecForEncoding = codecForEncoding();
+ info.codecForDecoding = codecForDecoding();
+ info.serverList = serverList();
+ return info;
+}
+
+void Network::setNetworkInfo(const NetworkInfo &info) {
+ // we don't set our ID!
+ if(!info.networkName.isEmpty()) setNetworkName(info.networkName);
+ if(info.identity > 0) setIdentity(info.identity);
+ if(!info.codecForEncoding.isEmpty()) setCodecForEncoding(QTextCodec::codecForName(info.codecForEncoding));
+ if(!info.codecForDecoding.isEmpty()) setCodecForDecoding(QTextCodec::codecForName(info.codecForDecoding));
+ if(info.serverList.count()) setServerList(info.serverList);
+}
+
QString Network::prefixToMode(const QString &prefix) {
if(prefixes().contains(prefix))
return QString(prefixModes()[prefixes().indexOf(prefix)]);
return newIrcChannel(decodeString(channelname));
}
-IrcChannel *Network::ircChannel(QString channelname) {
+IrcChannel *Network::ircChannel(QString channelname) const {
channelname = channelname.toLower();
if(_ircChannels.contains(channelname))
return _ircChannels[channelname];
return 0;
}
-IrcChannel *Network::ircChannel(const QByteArray &channelname) {
+IrcChannel *Network::ircChannel(const QByteArray &channelname) const {
return ircChannel(decodeString(channelname));
}
void Network::setCodecForEncoding(QTextCodec *codec) {
_codecForEncoding = codec;
+ emit codecForEncodingSet(codecForEncoding());
}
QByteArray Network::codecForDecoding() const {
void Network::setCodecForDecoding(QTextCodec *codec) {
_codecForDecoding = codec;
+ emit codecForDecodingSet(codecForDecoding());
}
QString Network::decodeString(const QByteArray &text) const {
class IrcUser;
class IrcChannel;
+// defined below!
+struct NetworkInfo;
+
// TODO: ConnectionInfo to propagate and sync the current state of NetworkConnection, encodings etcpp
class Network : public SyncableObject {
public:
Network(const NetworkId &networkid, QObject *parent = 0);
- //virtual ~Network();
+ // ~Network();
NetworkId networkId() const;
QStringList channels() const;
QList<QVariantMap> serverList() const;
+ NetworkInfo networkInfo() const;
+ void setNetworkInfo(const NetworkInfo &);
+
QString prefixes();
QString prefixModes();
IrcChannel *newIrcChannel(const QString &channelname);
IrcChannel *newIrcChannel(const QByteArray &channelname);
- IrcChannel *ircChannel(QString channelname);
- IrcChannel *ircChannel(const QByteArray &channelname);
+ IrcChannel *ircChannel(QString channelname) const;
+ IrcChannel *ircChannel(const QByteArray &channelname) const;
QList<IrcChannel *> ircChannels() const;
quint32 ircChannelCount() const;
QList<QVariantMap> _serverList;
//QVariantMap networkSettings;
- //QVariantMap identity;
-
+
QPointer<SignalProxy> _proxy;
void determinePrefixes();
};
+//! Stores all editable information about a network (as opposed to runtime state).
+struct NetworkInfo {
+ NetworkId networkId;
+ IdentityId identity;
+ QString networkName;
+ QByteArray codecForEncoding;
+ QByteArray codecForDecoding;
+ QList<QVariantMap> serverList;
+
+};
+
+
#endif
}
-Network *BufferWidget::currentNetwork() const {
+const Network *BufferWidget::currentNetwork() const {
if(!selectionModel())
return 0;
if(!variant.isValid())
return 0;
- return Client::network(qVariantValue<NetworkId>(variant));
+ return Client::network(variant.value<NetworkId>());
}
void BufferWidget::updateNickSelector() const {
- Network *net = currentNetwork();
+ const Network *net = currentNetwork();
if(!net)
return;
}
void BufferWidget::changeNick(const QString &newNick) const {
- Network *net = currentNetwork();
+ const Network *net = currentNetwork();
if(!net || net->isMyNick(newNick))
return;
emit userInput(QString("/nick %1").arg(newNick));
inline QItemSelectionModel *selectionModel() const { return _selectionModel; }
void setSelectionModel(QItemSelectionModel *selectionModel);
- Network *currentNetwork() const;
+ const Network *currentNetwork() const;
signals:
void userInput(QString msg) const;
addBufferView(tr("All Buffers"), model, BufferViewFilter::AllNets, QList<NetworkId>());
addBufferView(tr("All Channels"), model, BufferViewFilter::AllNets|BufferViewFilter::NoQueries|BufferViewFilter::NoServers, QList<NetworkId>());
- addBufferView(tr("All Queries"), model, BufferViewFilter::AllNets|BufferViewFilter::NoChannels|BufferViewFilter::NoServers, QList<NetworkId>())->hide();
- addBufferView(tr("All Networks"), model, BufferViewFilter::AllNets|BufferViewFilter::NoChannels|BufferViewFilter::NoQueries, QList<NetworkId>())->hide();
- addBufferView(tr("Full Custom"), model, BufferViewFilter::FullCustom, QList<NetworkId>())->hide();
+ addBufferView(tr("All Queries"), model, BufferViewFilter::AllNets|BufferViewFilter::NoChannels|BufferViewFilter::NoServers, QList<NetworkId>());
+ addBufferView(tr("All Networks"), model, BufferViewFilter::AllNets|BufferViewFilter::NoChannels|BufferViewFilter::NoQueries, QList<NetworkId>());
+ addBufferView(tr("Full Custom"), model, BufferViewFilter::FullCustom, QList<NetworkId>());
ui.menuViews->addSeparator();
}
settingsDlg->registerSettingsPage(new FontsSettingsPage(settingsDlg));
settingsDlg->registerSettingsPage(new IdentitiesSettingsPage(settingsDlg));
- settingsDlg->registerSettingsPage(new NetworksSettingsPage(settingsDlg));
+ //settingsDlg->registerSettingsPage(new NetworksSettingsPage(settingsDlg));
}
void MainWin::connectedToCore() {
FORMNAMES = identitiesdlg.ui identitieseditdlg.ui networkeditdlg.ui mainwin.ui nickeditdlg.ui serverlistdlg.ui \
servereditdlg.ui coreaccounteditdlg.ui coreconnectdlg.ui bufferviewwidget.ui bufferwidget.ui nicklistwidget.ui settingsdlg.ui \
- buffermgmtpage.ui connectionpage.ui usermgmtpage.ui topicwidget.ui debugconsole.ui
+ topicwidget.ui debugconsole.ui
for(ui, FORMNAMES) {
FRMS += ui/$${ui}
treeItems[sp] = item;
pages[QString("%1$%2").arg(sp->category(), sp->title())] = sp;
// TESTING
- //selectPage(sp->category(), sp->title());
+ selectPage(sp->category(), sp->title());
}
void SettingsDlg::selectPage(const QString &cat, const QString &title) {
ui.nicknameList->addItem(dlg.nick());
ui.nicknameList->setCurrentRow(ui.nicknameList->count()-1);
setWidgetStates();
+ widgetHasChanged();
}
}
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
+#include <QHeaderView>
+
#include "networkssettingspage.h"
+#include "client.h"
+#include "identity.h"
+#include "network.h"
+
+
NetworksSettingsPage::NetworksSettingsPage(QWidget *parent) : SettingsPage(tr("General"), tr("Networks"), parent) {
ui.setupUi(this);
+ connectedIcon = QIcon(":/22x22/actions/network-connect");
+ disconnectedIcon = QIcon(":/22x22/actions/network-disconnect");
+
+ currentId = 0;
+ setEnabled(false); // need a core connection!
+ setWidgetStates();
+ connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool)));
+ connect(Client::instance(), SIGNAL(networkAdded(NetworkId)), this, SLOT(clientNetworkAdded(NetworkId)));
+ connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), this, SLOT(clientNetworkRemoved(NetworkId)));
+ 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()));
+
+ foreach(IdentityId id, Client::identityIds()) {
+ clientIdentityAdded(id);
+ }
}
void NetworksSettingsPage::save() {
}
void NetworksSettingsPage::load() {
+ reset();
+ foreach(NetworkId netid, Client::networkIds()) {
+ clientNetworkAdded(netid);
+ }
+ ui.networkList->setCurrentRow(0);
+ changeState(false);
+}
+
+void NetworksSettingsPage::reset() {
+ currentId = 0;
+ ui.networkList->clear();
+ networkInfos.clear();
+
+ /*
+ foreach(Identity *identity, identities.values()) {
+ identity->deleteLater();
+ }
+ identities.clear();
+ deletedIdentities.clear();
+ changedIdentities.clear();
+ ui.identityList->clear();
+ */
+}
+
+void NetworksSettingsPage::widgetHasChanged() {
+ bool changed = testHasChanged();
+ if(changed != hasChanged()) changeState(changed);
+}
+bool NetworksSettingsPage::testHasChanged() {
+ return false;
}
+
+void NetworksSettingsPage::setWidgetStates() {
+ // network list
+ if(ui.networkList->selectedItems().count()) {
+ NetworkId id = ui.networkList->selectedItems()[0]->data(Qt::UserRole).value<NetworkId>();
+ ui.detailsBox->setEnabled(true);
+ ui.renameNetwork->setEnabled(true);
+ ui.deleteNetwork->setEnabled(true);
+ ui.connectNow->setEnabled(true);
+ if(Client::network(id)->isConnected()) {
+ ui.connectNow->setIcon(disconnectedIcon);
+ ui.connectNow->setText(tr("Disconnect"));
+ } else {
+ ui.connectNow->setIcon(connectedIcon);
+ ui.connectNow->setText(tr("Connect"));
+ }
+ } else {
+ ui.renameNetwork->setEnabled(false);
+ ui.deleteNetwork->setEnabled(false);
+ ui.connectNow->setEnabled(false);
+ ui.detailsBox->setEnabled(false);
+ }
+ // network details
+ if(ui.serverList->selectedItems().count()) {
+ ui.editServer->setEnabled(true);
+ ui.deleteServer->setEnabled(true);
+ ui.upServer->setEnabled(ui.serverList->currentRow() > 0);
+ ui.downServer->setEnabled(ui.serverList->currentRow() < ui.serverList->count() - 1);
+ } else {
+ ui.editServer->setEnabled(false);
+ ui.deleteServer->setEnabled(false);
+ ui.upServer->setEnabled(false);
+ ui.downServer->setEnabled(false);
+ }
+}
+
+void NetworksSettingsPage::coreConnectionStateChanged(bool state) {
+ this->setEnabled(state);
+ if(state) {
+ load();
+ } else {
+ // reset
+ //currentId = 0;
+ }
+}
+
+QListWidgetItem *NetworksSettingsPage::networkItem(NetworkId id) const {
+ for(int i = 0; i < ui.networkList->count(); i++) {
+ QListWidgetItem *item = ui.networkList->item(i);
+ if(item->data(Qt::UserRole).value<NetworkId>() == id) return item;
+ }
+ return 0;
+}
+
+void NetworksSettingsPage::clientIdentityAdded(IdentityId id) {
+ const Identity * identity = Client::identity(id);
+ connect(identity, SIGNAL(updatedRemotely()), this, SLOT(clientIdentityUpdated()));
+
+ if(id == 1) {
+ // default identity is always the first one!
+ ui.identityList->insertItem(0, identity->identityName(), id.toInt());
+ } else {
+ QString name = identity->identityName();
+ for(int j = 0; j < ui.identityList->count(); j++) {
+ if((j>0 || ui.identityList->itemData(0).toInt() != 1) && name.localeAwareCompare(ui.identityList->itemText(j)) < 0) {
+ ui.identityList->insertItem(j, name, id.toInt());
+ widgetHasChanged();
+ return;
+ }
+ }
+ // append
+ ui.identityList->insertItem(ui.identityList->count(), name, id.toInt());
+ widgetHasChanged();
+ }
+}
+
+void NetworksSettingsPage::clientIdentityUpdated() {
+ const Identity *identity = qobject_cast<const Identity *>(sender());
+ if(!identity) {
+ qWarning() << "NetworksSettingsPage: Invalid identity to update!";
+ return;
+ }
+ int row = ui.identityList->findData(identity->id().toInt());
+ if(row < 0) {
+ qWarning() << "NetworksSettingsPage: Invalid identity to update!";
+ return;
+ }
+ if(ui.identityList->itemText(row) != identity->identityName()) {
+ ui.identityList->setItemText(row, identity->identityName());
+ }
+}
+
+void NetworksSettingsPage::clientIdentityRemoved(IdentityId id) {
+ ui.identityList->removeItem(ui.identityList->findData(id.toInt()));
+ foreach(NetworkInfo info, networkInfos.values()) {
+ if(info.identity == id) info.identity = 1; // set to default
+ }
+ widgetHasChanged();
+}
+
+
+void NetworksSettingsPage::clientNetworkAdded(NetworkId id) {
+ insertNetwork(id);
+ connect(Client::network(id), SIGNAL(updatedRemotely()), this, SLOT(clientNetworkUpdated()));
+}
+
+void NetworksSettingsPage::clientNetworkUpdated() {
+ const Network *net = qobject_cast<const Network *>(sender());
+ if(!net) {
+ qWarning() << "Update request for unknown network received!";
+ return;
+ }
+ QListWidgetItem *item = networkItem(net->networkId());
+ if(!item) return;
+ item->setText(net->networkName());
+ if(net->isConnected()) {
+ item->setIcon(connectedIcon);
+ } else {
+ item->setIcon(disconnectedIcon);
+ }
+}
+
+
+void NetworksSettingsPage::insertNetwork(NetworkId id) {
+ NetworkInfo info = Client::network(id)->networkInfo();
+ networkInfos[id] = info;
+ QListWidgetItem *item = new QListWidgetItem(disconnectedIcon, info.networkName);
+ item->setData(Qt::UserRole, QVariant::fromValue<NetworkId>(id));
+ ui.networkList->addItem(item);
+ if(Client::network(id)->isConnected()) {
+ item->setIcon(connectedIcon);
+ } else {
+ item->setIcon(disconnectedIcon);
+ }
+ widgetHasChanged();
+}
+
+void NetworksSettingsPage::displayNetwork(NetworkId id, bool dontsave) {
+ NetworkInfo info = networkInfos[id];
+ ui.serverList->clear();
+ foreach(QVariantMap v, info.serverList) {
+ ui.serverList->addItem(QString("%1:%2").arg(v["Address"].toString()).arg(v["Port"].toUInt()));
+ }
+
+}
+
+/*** Network list ***/
+
+void NetworksSettingsPage::on_networkList_itemSelectionChanged() {
+ if(ui.networkList->selectedItems().count()) {
+ NetworkId id = ui.networkList->selectedItems()[0]->data(Qt::UserRole).value<NetworkId>();
+ displayNetwork(id);
+ }
+ setWidgetStates();
+}
+
+
+
+
+
+
+
+
#ifndef _NETWORKSSETTINGSPAGE_H_
#define _NETWORKSSETTINGSPAGE_H_
-#include "settingspage.h"
+#include <QIcon>
+#include "settingspage.h"
#include "ui_networkssettingspage.h"
+#include "network.h"
+#include "types.h"
+
class NetworksSettingsPage : public SettingsPage {
Q_OBJECT
void save();
void load();
+ private slots:
+ void widgetHasChanged();
+ void setWidgetStates();
+ void coreConnectionStateChanged(bool);
+
+ void displayNetwork(NetworkId, bool dontsave = false);
+
+ void clientNetworkAdded(NetworkId);
+ void clientNetworkUpdated();
+
+ void clientIdentityAdded(IdentityId);
+ void clientIdentityRemoved(IdentityId);
+ void clientIdentityUpdated();
+
+ void on_networkList_itemSelectionChanged();
+
private:
Ui::NetworksSettingsPage ui;
+ NetworkId currentId;
+ QHash<NetworkId, NetworkInfo> networkInfos;
+
+ QIcon connectedIcon, disconnectedIcon;
+
+ void reset();
+ bool testHasChanged();
+ void insertNetwork(NetworkId);
+ QListWidgetItem *networkItem(NetworkId) const;
};
<rect>
<x>0</x>
<y>0</y>
- <width>417</width>
- <height>416</height>
+ <width>560</width>
+ <height>322</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
- <layout class="QVBoxLayout" >
+ <layout class="QHBoxLayout" >
+ <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>
- <layout class="QGridLayout" >
- <item row="0" column="0" >
- <widget class="QTableWidget" name="networkTable" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
- <horstretch>1</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <column>
- <property name="text" >
- <string>Network</string>
- </property>
- </column>
- <column>
- <property name="text" >
- <string>Identity</string>
- </property>
- </column>
- </widget>
- </item>
- <item row="0" column="1" >
+ <layout class="QHBoxLayout" >
+ <item>
<layout class="QVBoxLayout" >
<item>
- <widget class="QPushButton" name="renameNetwork" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Re&name...</string>
- </property>
- <property name="icon" >
- <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/edit-rename.png</iconset>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="addNetwork" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>&Add...</string>
- </property>
- <property name="icon" >
- <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/list-add.png</iconset>
- </property>
- <property name="iconSize" >
- <size>
- <width>16</width>
- <height>16</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="deleteNetwork" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>De&lete</string>
+ <widget class="QListWidget" name="networkList" >
+ <property name="selectionBehavior" >
+ <enum>QAbstractItemView::SelectRows</enum>
</property>
- <property name="icon" >
- <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/edit-delete.png</iconset>
+ <property name="sortingEnabled" >
+ <bool>true</bool>
</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>
- <item>
- <widget class="QPushButton" name="connectNow" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Connect now</string>
- </property>
- <property name="icon" >
- <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/network-disconnect.png</iconset>
- </property>
- </widget>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QPushButton" name="renameNetwork" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Re&name...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/edit-rename.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="addNetwork" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>&Add...</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/list-add.png</iconset>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="deleteNetwork" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>De&lete</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/edit-delete.png</iconset>
+ </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>
+ <item>
+ <widget class="QPushButton" name="connectNow" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Connect now</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../../icons/icons.qrc" >:/16x16/actions/oxygen/16x16/actions/network-connect.png</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
</layout>
</item>
- <item row="1" column="0" colspan="2" >
- <widget class="QGroupBox" name="groupBox" >
+ <item>
+ <widget class="QGroupBox" name="detailsBox" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+ <horstretch>10</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="title" >
<string>Network Details</string>
</property>
<layout class="QVBoxLayout" >
+ <item>
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLabel" name="label_6" >
+ <property name="text" >
+ <string>Identity:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="identityList" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
<item>
<widget class="QTabWidget" name="tabWidget" >
<property name="enabled" >
+++ /dev/null
-<ui version="4.0" >
- <class>ConnectionSettingsPage</class>
- <widget class="QWidget" name="ConnectionSettingsPage" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>666</width>
- <height>457</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string/>
- </property>
- </widget>
- <resources/>
- <connections/>
-</ui>
+++ /dev/null
-<ui version="4.0" >
- <class>CoreSettingsPage</class>
- <widget class="QWidget" name="CoreSettingsPage" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>693</width>
- <height>482</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string/>
- </property>
- </widget>
- <resources/>
- <connections/>
-</ui>
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow" >
- <enum>QFrame::Raised</enum>
+ <enum>QFrame::Sunken</enum>
</property>
<layout class="QVBoxLayout" >
<item>
NetworkId networkId = currentIndex.data(NetworkModel::NetworkIdRole).value<NetworkId>();
QString channelName = currentIndex.sibling(currentIndex.row(), 0).data().toString();
- Network *network = Client::network(networkId);
+ const Network *network = Client::network(networkId);
if(!network)
return;