From d28b9ec38b6ea0bc473200fc2f1e65abd1b56bd6 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Fri, 18 Jan 2008 15:50:03 +0000 Subject: [PATCH] uint -> NetworkId, uint -> BufferId almost everywhere. Conversion will be made explicit soon, so we won't confuse that anymore. Distclean advised. --- Quassel.kdevelop.filelist | 2 + src/client/buffermodel.cpp | 4 +- src/client/client.cpp | 4 +- src/client/mappedselectionmodel.cpp | 2 +- src/client/networkmodel.cpp | 6 +- src/common/bufferinfo.cpp | 2 +- src/common/bufferinfo.h | 6 +- src/common/global.h | 2 +- src/common/types.h | 21 +- src/core/networkconnection.cpp | 2 +- src/core/sqlitestorage.cpp | 26 +- src/core/sqlitestorage.h | 2 +- src/core/storage.h | 2 +- src/qtui/bufferwidget.h | 4 +- src/qtui/mainwin.cpp | 2 + src/qtui/mainwin.h | 2 +- src/qtui/nicklistwidget.h | 2 +- src/qtui/settingsdlg.cpp | 2 +- .../settingspages/identitiessettingspage.cpp | 4 +- .../settingspages/networkssettingspage.cpp | 36 ++ src/qtui/settingspages/networkssettingspage.h | 46 ++ .../settingspages/networkssettingspage.ui | 543 ++++++++++++++++++ src/qtui/settingspages/servereditdlgnew.ui | 146 +++++ src/qtui/settingspages/settingspages.pri | 4 +- src/uisupport/bufferview.cpp | 2 +- src/uisupport/bufferviewfilter.cpp | 15 +- src/uisupport/bufferviewfilter.h | 3 +- src/uisupport/tabcompleter.cpp | 2 +- version.inc | 4 +- 29 files changed, 846 insertions(+), 52 deletions(-) create mode 100644 src/qtui/settingspages/networkssettingspage.cpp create mode 100644 src/qtui/settingspages/networkssettingspage.h create mode 100644 src/qtui/settingspages/networkssettingspage.ui create mode 100644 src/qtui/settingspages/servereditdlgnew.ui diff --git a/Quassel.kdevelop.filelist b/Quassel.kdevelop.filelist index fe1d9fa1..1cedf416 100644 --- a/Quassel.kdevelop.filelist +++ b/Quassel.kdevelop.filelist @@ -187,6 +187,8 @@ src/qtui/settingspages/fontssettingspage.ui src/qtui/settingspages/identitiessettingspage.cpp src/qtui/settingspages/identitiessettingspage.h src/qtui/settingspages/identitiessettingspage.ui +src/qtui/settingspages/networkssettingspage.cpp +src/qtui/settingspages/networkssettingspage.h src/qtui/settingspages/networkssettingspage.ui src/qtui/settingspages/nickeditdlgnew.ui src/qtui/settingspages/saveidentitiesdlg.ui diff --git a/src/client/buffermodel.cpp b/src/client/buffermodel.cpp index 440fff08..88c1ab8a 100644 --- a/src/client/buffermodel.cpp +++ b/src/client/buffermodel.cpp @@ -68,15 +68,15 @@ void BufferModel::synchronizeView(QAbstractItemView *view) { } void BufferModel::mapProperty(int column, int role, QObject *target, const QByteArray &property) { + qDebug() << property; propertyMapper()->addMapping(column, role, target, property); } // This Slot indicates that the user has selected a different buffer in the gui void BufferModel::setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command) { Q_UNUSED(command) - BufferId newCurrentBuffer; - if(index.data(NetworkModel::ItemTypeRole) == NetworkModel::BufferItemType && currentBuffer != (newCurrentBuffer = index.data(NetworkModel::BufferIdRole).toUInt())) { + if(index.data(NetworkModel::ItemTypeRole) == NetworkModel::BufferItemType && currentBuffer != (newCurrentBuffer = index.data(NetworkModel::BufferIdRole).value())) { currentBuffer = newCurrentBuffer; // FIXME: to something like: index.setData(ActivitRole, NoActivity); // networkModel->bufferActivity(BufferItem::NoActivity, currentBuffer); diff --git a/src/client/client.cpp b/src/client/client.cpp index 34c903ea..dd8bd214 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -127,7 +127,7 @@ QList Client::networks() { return instance()->_networks.values(); } -Network *Client::network(uint networkid) { +Network *Client::network(NetworkId networkid) { if(instance()->_networks.contains(networkid)) return instance()->_networks[networkid]; else @@ -245,7 +245,7 @@ void Client::coreIdentityRemoved(IdentityId id) { /*** ***/ -void Client::fakeInput(uint bufferUid, QString message) { +void Client::fakeInput(BufferId bufferUid, QString message) { Buffer *buff = buffer(bufferUid); if(!buff) qWarning() << "No Buffer with uid" << bufferUid << "can't send Input" << message; diff --git a/src/client/mappedselectionmodel.cpp b/src/client/mappedselectionmodel.cpp index f5b74709..e6325810 100644 --- a/src/client/mappedselectionmodel.cpp +++ b/src/client/mappedselectionmodel.cpp @@ -111,4 +111,4 @@ void MappedSelectionModel::_selectionChanged(const QItemSelection &selected, con Q_UNUSED(deselected) emit mappedSelectionChanged(mapSelectionToSource(QItemSelectionModel::selection())); } - + diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index 59485da8..e3739ae6 100644 --- a/src/client/networkmodel.cpp +++ b/src/client/networkmodel.cpp @@ -527,14 +527,14 @@ bool NetworkModel::dropMimeData(const QMimeData *data, Qt::DropAction action, in if(targetType != BufferItem::QueryType) return false; - QList< QPair > bufferList = mimeDataToBufferList(data); + QList< QPair > bufferList = mimeDataToBufferList(data); // exactly one buffer has to be dropped if(bufferList.count() != 1) return false; - uint netId = bufferList.first().first; - uint bufferId = bufferList.first().second; + NetworkId netId = bufferList.first().first; + BufferId bufferId = bufferList.first().second; // no self merges (would kill us) if(bufferId == parent.data(BufferIdRole).value()) diff --git a/src/common/bufferinfo.cpp b/src/common/bufferinfo.cpp index 75a816db..74cf4926 100644 --- a/src/common/bufferinfo.cpp +++ b/src/common/bufferinfo.cpp @@ -35,7 +35,7 @@ BufferInfo::BufferInfo() _bufferName(QString()) { } -BufferInfo::BufferInfo(uint id, uint networkid, uint gid, QString net, QString buf) +BufferInfo::BufferInfo(BufferId id, NetworkId networkid, uint gid, QString net, QString buf) : _id(id), _netid(networkid), _gid(gid), diff --git a/src/common/bufferinfo.h b/src/common/bufferinfo.h index 0597adcb..5e2b5f24 100644 --- a/src/common/bufferinfo.h +++ b/src/common/bufferinfo.h @@ -29,7 +29,7 @@ class QDataStream; class BufferInfo { public: BufferInfo(); - BufferInfo(uint id, uint networkid, uint gid = 0, QString net = QString(), QString buf = QString()); + BufferInfo(BufferId id, NetworkId networkid, uint gid = 0, QString net = QString(), QString buf = QString()); inline BufferId uid() const { return _id; } inline NetworkId networkId() const { return _netid; } @@ -42,8 +42,8 @@ public: inline bool operator==(const BufferInfo &other) const { return _id == other._id; } private: - uint _id; - uint _netid; + BufferId _id; + NetworkId _netid; uint _gid; QString _networkName; // WILL BE REMOVED QString _bufferName; diff --git a/src/common/global.h b/src/common/global.h index 8b7cf83c..39633675 100644 --- a/src/common/global.h +++ b/src/common/global.h @@ -54,6 +54,6 @@ namespace Global { extern unsigned int defaultPort; void registerMetaTypes(); -} +}; #endif diff --git a/src/common/types.h b/src/common/types.h index b0dd0d13..9793150d 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -23,12 +23,29 @@ #include +/* +class UnsignedId { + quint32 id; + + public: + inline UnsignedId(int _id = 0) { id = _id; } + inline quint32 toInt() const { return id; } + inline bool operator==(const UnsignedId &other) const { return id == other.id; } + inline bool operator!=(const UnsignedId &other) const { return id != other.id; } +}; + +struct BufferId : public UnsignedId { + inline BufferId(int _id = 0) : UnsignedId(_id) {}; + +}; +*/ + // FIXME make all ID types quint32 as soon as they all have been replaced typedef uint UserId; //!< Identifies a core user. typedef uint MsgId; //!< Identifies a message. typedef uint BufferId; //!< Identifies a buffer. -typedef uint NetworkId; //!< Identifies an IRC Network. -// IdentityId must be signed! +// These must be signed! +typedef qint32 NetworkId; //!< Identifies an IRC Network. typedef qint32 IdentityId; //!< Identifies an identity. //! Base class for exceptions. diff --git a/src/core/networkconnection.cpp b/src/core/networkconnection.cpp index 21e7f630..c4433de5 100644 --- a/src/core/networkconnection.cpp +++ b/src/core/networkconnection.cpp @@ -63,7 +63,7 @@ bool NetworkConnection::isConnected() const { return socket.state() == QAbstractSocket::ConnectedState; } -uint NetworkConnection::networkId() const { +NetworkId NetworkConnection::networkId() const { return network()->networkId(); } diff --git a/src/core/sqlitestorage.cpp b/src/core/sqlitestorage.cpp index 81108bd0..0cde45d1 100644 --- a/src/core/sqlitestorage.cpp +++ b/src/core/sqlitestorage.cpp @@ -163,7 +163,7 @@ void SqliteStorage::createBuffer(UserId user, const QString &network, const QStr } } -uint SqliteStorage::getNetworkId(UserId user, const QString &network) { +NetworkId SqliteStorage::getNetworkId(UserId user, const QString &network) { QSqlQuery query(logDb()); query.prepare("SELECT networkid FROM network " "WHERE userid = :userid AND networkname = :networkname"); @@ -172,12 +172,12 @@ uint SqliteStorage::getNetworkId(UserId user, const QString &network) { query.exec(); if(query.first()) - return query.value(0).toUInt(); + return query.value(0).value(); else { createBuffer(user, network, ""); query.exec(); if(query.first()) - return query.value(0).toUInt(); + return query.value(0).value(); else { qWarning() << "NETWORK NOT FOUND:" << network << "for User:" << user; return 0; @@ -188,7 +188,7 @@ uint SqliteStorage::getNetworkId(UserId user, const QString &network) { BufferInfo SqliteStorage::getBufferInfo(UserId user, const QString &network, const QString &buffer) { BufferInfo bufferid; // TODO: get rid of this hackaround - uint networkId = getNetworkId(user, network); + NetworkId networkId = getNetworkId(user, network); QSqlQuery *getBufferInfoQuery = cachedQuery("select_bufferByName"); getBufferInfoQuery->bindValue(":networkname", network); @@ -201,11 +201,11 @@ BufferInfo SqliteStorage::getBufferInfo(UserId user, const QString &network, con createBuffer(user, network, buffer); getBufferInfoQuery->exec(); if(getBufferInfoQuery->first()) { - bufferid = BufferInfo(getBufferInfoQuery->value(0).toUInt(), networkId, 0, network, buffer); + bufferid = BufferInfo(getBufferInfoQuery->value(0).value(), networkId, 0, network, buffer); emit bufferInfoUpdated(user, bufferid); } } else { - bufferid = BufferInfo(getBufferInfoQuery->value(0).toUInt(), networkId, 0, network, buffer); + bufferid = BufferInfo(getBufferInfoQuery->value(0).value(), networkId, 0, network, buffer); } Q_ASSERT(!getBufferInfoQuery->next()); @@ -227,7 +227,7 @@ QList SqliteStorage::requestBuffers(UserId user, QDateTime since) { query.exec(); watchQuery(&query); while(query.next()) { - bufferlist << BufferInfo(query.value(0).toUInt(), query.value(2).toUInt(), 0, query.value(3).toString(), query.value(1).toString()); + bufferlist << BufferInfo(query.value(0).value(), query.value(2).value(), 0, query.value(3).toString(), query.value(1).toString()); } return bufferlist; } @@ -265,7 +265,7 @@ MsgId SqliteStorage::logMessage(Message msg) { getLastMessageIdQuery->exec(); if(getLastMessageIdQuery->first()) { - return getLastMessageIdQuery->value(0).toUInt(); + return getLastMessageIdQuery->value(0).value(); } else { // somethin went wrong... :( qDebug() << getLastMessageIdQuery->lastQuery() << "time/bufferid/type/sender:" << msg.timestamp().toTime_t() << msg.buffer().uid() << msg.type() << msg.sender(); Q_ASSERT(false); @@ -281,7 +281,7 @@ QList SqliteStorage::requestMsgs(BufferInfo buffer, int lastmsgs, int o requestMsgsOffsetQuery->bindValue(":messageid", offset); requestMsgsOffsetQuery->exec(); requestMsgsOffsetQuery->first(); - offset = requestMsgsOffsetQuery->value(0).toUInt(); + offset = requestMsgsOffsetQuery->value(0).toInt(); // now let's select the messages QSqlQuery *requestMsgsQuery = cachedQuery("select_messages"); @@ -297,7 +297,7 @@ QList SqliteStorage::requestMsgs(BufferInfo buffer, int lastmsgs, int o requestMsgsQuery->value(5).toString(), requestMsgsQuery->value(4).toString(), requestMsgsQuery->value(3).toUInt()); - msg.setMsgId(requestMsgsQuery->value(0).toUInt()); + msg.setMsgId(requestMsgsQuery->value(0).value()); messagelist << msg; } return messagelist; @@ -312,7 +312,7 @@ QList SqliteStorage::requestMsgs(BufferInfo buffer, QDateTime since, in requestMsgsSinceOffsetQuery->bindValue(":since", since.toTime_t()); requestMsgsSinceOffsetQuery->exec(); requestMsgsSinceOffsetQuery->first(); - offset = requestMsgsSinceOffsetQuery->value(0).toUInt(); + offset = requestMsgsSinceOffsetQuery->value(0).toInt(); // now let's select the messages QSqlQuery *requestMsgsSinceQuery = cachedQuery("select_messagesSince"); @@ -329,7 +329,7 @@ QList SqliteStorage::requestMsgs(BufferInfo buffer, QDateTime since, in requestMsgsSinceQuery->value(5).toString(), requestMsgsSinceQuery->value(4).toString(), requestMsgsSinceQuery->value(3).toUInt()); - msg.setMsgId(requestMsgsSinceQuery->value(0).toUInt()); + msg.setMsgId(requestMsgsSinceQuery->value(0).value()); messagelist << msg; } @@ -352,7 +352,7 @@ QList SqliteStorage::requestMsgRange(BufferInfo buffer, int first, int requestMsgRangeQuery->value(5).toString(), requestMsgRangeQuery->value(4).toString(), requestMsgRangeQuery->value(3).toUInt()); - msg.setMsgId(requestMsgRangeQuery->value(0).toUInt()); + msg.setMsgId(requestMsgRangeQuery->value(0).value()); messagelist << msg; } diff --git a/src/core/sqlitestorage.h b/src/core/sqlitestorage.h index 992fc8f5..2038b2bc 100644 --- a/src/core/sqlitestorage.h +++ b/src/core/sqlitestorage.h @@ -51,7 +51,7 @@ public slots: virtual void delUser(UserId user); /* Network handling */ - virtual uint getNetworkId(UserId user, const QString &network); + virtual NetworkId getNetworkId(UserId user, const QString &network); /* Buffer handling */ virtual BufferInfo getBufferInfo(UserId user, const QString &network, const QString &buffer = ""); diff --git a/src/core/storage.h b/src/core/storage.h index db68417c..1af8d86e 100644 --- a/src/core/storage.h +++ b/src/core/storage.h @@ -101,7 +101,7 @@ class Storage : public QObject { * \param network The network name * \return The BufferInfo corresponding to the given network and buffer name, or 0 if not found */ - virtual uint getNetworkId(UserId user, const QString &network) = 0; + virtual NetworkId getNetworkId(UserId user, const QString &network) = 0; /* Buffer handling */ diff --git a/src/qtui/bufferwidget.h b/src/qtui/bufferwidget.h index 980d0def..d035fed1 100644 --- a/src/qtui/bufferwidget.h +++ b/src/qtui/bufferwidget.h @@ -36,8 +36,8 @@ class LayoutThread; class BufferWidget : public QWidget { Q_OBJECT - Q_PROPERTY(uint currentBuffer READ currentBuffer WRITE setCurrentBuffer) - + Q_PROPERTY(uint currentBuffer READ currentBuffer WRITE setCurrentBuffer); // FIXME BufferId + public: BufferWidget(QWidget *parent = 0); virtual ~BufferWidget(); diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index 8aa0bb2e..38b07a22 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -39,6 +39,7 @@ #include "settingspages/fontssettingspage.h" #include "settingspages/identitiessettingspage.h" +#include "settingspages/networkssettingspage.h" #include "debugconsole.h" @@ -202,6 +203,7 @@ void MainWin::addBufferView(const QString &viewname, QAbstractItemModel *model, void MainWin::setupSettingsDlg() { settingsDlg->registerSettingsPage(new FontsSettingsPage(settingsDlg)); settingsDlg->registerSettingsPage(new IdentitiesSettingsPage(settingsDlg)); + settingsDlg->registerSettingsPage(new NetworksSettingsPage(settingsDlg)); } void MainWin::connectedToCore() { diff --git a/src/qtui/mainwin.h b/src/qtui/mainwin.h index fc0ba025..00cfd685 100644 --- a/src/qtui/mainwin.h +++ b/src/qtui/mainwin.h @@ -85,7 +85,7 @@ class MainWin : public QMainWindow { CoreConnectDlg *coreConnectDlg; SettingsDlg *settingsDlg; - uint currentBuffer; + BufferId currentBuffer; QString currentProfile; QList netViews; diff --git a/src/qtui/nicklistwidget.h b/src/qtui/nicklistwidget.h index 4e8ac8d5..d58735f7 100644 --- a/src/qtui/nicklistwidget.h +++ b/src/qtui/nicklistwidget.h @@ -32,7 +32,7 @@ class NickView; class NickListWidget : public QWidget { Q_OBJECT - Q_PROPERTY(uint currentBuffer READ currentBuffer WRITE setCurrentBuffer) + Q_PROPERTY(uint currentBuffer READ currentBuffer WRITE setCurrentBuffer); // FIXME BufferId public: NickListWidget(QWidget *parent = 0); diff --git a/src/qtui/settingsdlg.cpp b/src/qtui/settingsdlg.cpp index 1e8a59b1..62fbdd0a 100644 --- a/src/qtui/settingsdlg.cpp +++ b/src/qtui/settingsdlg.cpp @@ -90,7 +90,7 @@ void SettingsDlg::selectPage(const QString &cat, const QString &title) { if(sp != currentPage()) { ui.pageTitle->setText(sp->title()); ui.settingsStack->setCurrentWidget(sp); - ui.settingsStack->setMinimumSize(sp->sizeHint()); // we don't want our page shrinked, use scrollbars instead... + ui.settingsStack->setMinimumSize(sp->minimumSizeHint()); // we don't want our page shrinked, use scrollbars instead... _currentPage = sp; } ui.settingsTree->setCurrentItem(treeItems[sp]); diff --git a/src/qtui/settingspages/identitiessettingspage.cpp b/src/qtui/settingspages/identitiessettingspage.cpp index 83b12066..e78e645c 100644 --- a/src/qtui/settingspages/identitiessettingspage.cpp +++ b/src/qtui/settingspages/identitiessettingspage.cpp @@ -250,7 +250,7 @@ void IdentitiesSettingsPage::on_identityList_currentIndexChanged(int index) { //ui.identityList->setEditable(false); displayIdentity(0); } else { - IdentityId id = ui.identityList->itemData(index).toInt(); + IdentityId id = ui.identityList->itemData(index).value(); if(identities.contains(id)) displayIdentity(identities[id]); ui.deleteIdentity->setEnabled(id != 1); // default identity cannot be deleted ui.renameIdentity->setEnabled(id != 1); // ...or renamed @@ -431,7 +431,7 @@ QString CreateIdentityDlg::identityName() const { IdentityId CreateIdentityDlg::duplicateId() const { if(!ui.duplicateIdentity->isChecked()) return 0; if(ui.identityList->currentIndex() >= 0) { - return ui.identityList->itemData(ui.identityList->currentIndex()).toInt(); + return ui.identityList->itemData(ui.identityList->currentIndex()).value(); } return 0; } diff --git a/src/qtui/settingspages/networkssettingspage.cpp b/src/qtui/settingspages/networkssettingspage.cpp new file mode 100644 index 00000000..205975f7 --- /dev/null +++ b/src/qtui/settingspages/networkssettingspage.cpp @@ -0,0 +1,36 @@ +/*************************************************************************** + * Copyright (C) 2005-08 by the Quassel IRC 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) version 3. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include "networkssettingspage.h" + +NetworksSettingsPage::NetworksSettingsPage(QWidget *parent) : SettingsPage(tr("General"), tr("Networks"), parent) { + ui.setupUi(this); + +} + +void NetworksSettingsPage::save() { + + +} + +void NetworksSettingsPage::load() { + + +} diff --git a/src/qtui/settingspages/networkssettingspage.h b/src/qtui/settingspages/networkssettingspage.h new file mode 100644 index 00000000..16e49818 --- /dev/null +++ b/src/qtui/settingspages/networkssettingspage.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (C) 2005-08 by the Quassel IRC 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) version 3. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _NETWORKSSETTINGSPAGE_H_ +#define _NETWORKSSETTINGSPAGE_H_ + +#include "settingspage.h" + +#include "ui_networkssettingspage.h" + +class NetworksSettingsPage : public SettingsPage { + Q_OBJECT + + public: + NetworksSettingsPage(QWidget *parent = 0); + + //bool aboutToSave(); + + public slots: + void save(); + void load(); + + private: + Ui::NetworksSettingsPage ui; + + +}; + +#endif diff --git a/src/qtui/settingspages/networkssettingspage.ui b/src/qtui/settingspages/networkssettingspage.ui new file mode 100644 index 00000000..c1696a7c --- /dev/null +++ b/src/qtui/settingspages/networkssettingspage.ui @@ -0,0 +1,543 @@ + + NetworksSettingsPage + + + + 0 + 0 + 417 + 416 + + + + Form + + + + + + + + + 1 + 0 + + + + + Network + + + + + Identity + + + + + + + + + + + 0 + 0 + + + + Re&name... + + + :/16x16/actions/oxygen/16x16/actions/edit-rename.png + + + + + + + + 0 + 0 + + + + &Add... + + + :/16x16/actions/oxygen/16x16/actions/list-add.png + + + + 16 + 16 + + + + + + + + + 0 + 0 + + + + De&lete + + + :/16x16/actions/oxygen/16x16/actions/edit-delete.png + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + false + + + + 0 + 0 + + + + Connect now + + + :/16x16/actions/oxygen/16x16/actions/network-disconnect.png + + + + + + + + + Network Details + + + + + + true + + + 0 + + + + true + + + Servers + + + + + + + + + + + 1 + 0 + + + + + + + + + + + 0 + 0 + + + + &Edit... + + + :/16x16/actions/oxygen/16x16/actions/configure.png + + + + + + + + 0 + 0 + + + + &Add... + + + :/16x16/actions/oxygen/16x16/actions/list-add.png + + + + + + + + 0 + 0 + + + + De&lete + + + :/16x16/actions/oxygen/16x16/actions/edit-delete.png + + + + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 0 + 20 + + + + + + + + Move upwards in list + + + ... + + + :/16x16/actions/oxygen/16x16/actions/go-up.png + + + + + + + Move downwards in list + + + ... + + + :/16x16/actions/oxygen/16x16/actions/go-down.png + + + + + + + Qt::Horizontal + + + + 0 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + false + + + Choose random server for connecting + + + + + + + + + + Perform + + + + + + Commands to execute on connect: + + + + + + + + + false + + + QTextEdit::NoWrap + + + + + + + false + + + Auto Identify + + + true + + + false + + + + + + + + Service: + + + + + + + NickServ + + + + + + + Password: + + + + + + + QLineEdit::PasswordEchoOnEdit + + + + + + + + + + + + + + + Advanced + + + + + + Network Encoding + + + + + + + + + + Sending: + + + + + + + false + + + + 0 + 0 + + + + + + + + Receiving: + + + + + + + false + + + + 0 + 0 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + false + + + Use defaults + + + true + + + + + + + + + + Qt::Vertical + + + + 375 + 31 + + + + + + + + + + + + + + + + + + + + + useDefaultEncodings + toggled(bool) + sendEncoding + setDisabled(bool) + + + 356 + 181 + + + 470 + 122 + + + + + useDefaultEncodings + toggled(bool) + recvEncoding + setDisabled(bool) + + + 383 + 181 + + + 445 + 156 + + + + + diff --git a/src/qtui/settingspages/servereditdlgnew.ui b/src/qtui/settingspages/servereditdlgnew.ui new file mode 100644 index 00000000..96e7eeb1 --- /dev/null +++ b/src/qtui/settingspages/servereditdlgnew.ui @@ -0,0 +1,146 @@ + + ServerEditDlgNew + + + + 0 + 0 + 264 + 159 + + + + Dialog + + + + + + + + Server address: + + + + + + + Port: + + + + + + + + + + 1 + + + 65535 + + + 6667 + + + + + + + + + + + Password: + + + + + + + false + + + QLineEdit::Password + + + + + + + + + false + + + Use SSL + + + :/16x16/actions/oxygen/16x16/actions/document-encrypt.png + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + ServerEditDlgNew + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ServerEditDlgNew + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/src/qtui/settingspages/settingspages.pri b/src/qtui/settingspages/settingspages.pri index e97d8cd5..7b14b4b4 100644 --- a/src/qtui/settingspages/settingspages.pri +++ b/src/qtui/settingspages/settingspages.pri @@ -1,8 +1,8 @@ # Putting $FOO in SETTINGSPAGES automatically includes # $FOOsettingspage.cpp, $FOOsettingspage.h and $FOOsettingspage.ui -SETTINGSPAGES = fonts identities +SETTINGSPAGES = fonts identities networks # Specify additional files (e.g. for subdialogs) here! SP_SRCS = SP_HDRS = -SP_FRMS = createidentitydlg.ui saveidentitiesdlg.ui nickeditdlgnew.ui +SP_FRMS = createidentitydlg.ui saveidentitiesdlg.ui nickeditdlgnew.ui servereditdlgnew.ui diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index 14b27ec8..c0bddb75 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -87,7 +87,7 @@ void BufferView::joinChannel(const QModelIndex &index) { if(bufferType != BufferItem::ChannelType) return; - Client::fakeInput(index.data(NetworkModel::BufferIdRole).toUInt(), QString("/JOIN %1").arg(index.sibling(index.row(), 0).data().toString())); + Client::fakeInput(index.data(NetworkModel::BufferIdRole).value(), QString("/JOIN %1").arg(index.sibling(index.row(), 0).data().toString())); } void BufferView::keyPressEvent(QKeyEvent *event) { diff --git a/src/uisupport/bufferviewfilter.cpp b/src/uisupport/bufferviewfilter.cpp index cf3d4685..4e7af886 100644 --- a/src/uisupport/bufferviewfilter.cpp +++ b/src/uisupport/bufferviewfilter.cpp @@ -65,9 +65,10 @@ bool BufferViewFilter::dropMimeData(const QMimeData *data, Qt::DropAction action if(!NetworkModel::mimeContainsBufferList(data)) return false; - QList< QPair > bufferList = NetworkModel::mimeDataToBufferList(data); + QList< QPair > bufferList = NetworkModel::mimeDataToBufferList(data); - uint netId, bufferId; + NetworkId netId; + BufferId bufferId; for(int i = 0; i < bufferList.count(); i++) { netId = bufferList[i].first; bufferId = bufferList[i].second; @@ -79,7 +80,7 @@ bool BufferViewFilter::dropMimeData(const QMimeData *data, Qt::DropAction action return true; } -void BufferViewFilter::addBuffer(const uint &bufferuid) { +void BufferViewFilter::addBuffer(const BufferId &bufferuid) { if(!buffers.contains(bufferuid)) { buffers << bufferuid; invalidateFilter(); @@ -94,8 +95,8 @@ void BufferViewFilter::removeBuffer(const QModelIndex &index) { return; // only child elements can be deleted bool lastBuffer = (rowCount(index.parent()) == 1); - uint netId = index.data(NetworkModel::NetworkIdRole).toUInt(); - uint bufferuid = index.data(NetworkModel::BufferIdRole).toUInt(); + NetworkId netId = index.data(NetworkModel::NetworkIdRole).value(); + BufferId bufferuid = index.data(NetworkModel::BufferIdRole).value(); if(buffers.contains(bufferuid)) { buffers.remove(bufferuid); @@ -128,7 +129,7 @@ bool BufferViewFilter::filterAcceptBuffer(const QModelIndex &source_bufferIndex) // return false; if((mode & FullCustom)) { - uint bufferuid = source_bufferIndex.data(NetworkModel::BufferIdRole).toUInt(); + BufferId bufferuid = source_bufferIndex.data(NetworkModel::BufferIdRole).value(); return buffers.contains(bufferuid); } @@ -136,7 +137,7 @@ bool BufferViewFilter::filterAcceptBuffer(const QModelIndex &source_bufferIndex) } bool BufferViewFilter::filterAcceptNetwork(const QModelIndex &source_index) const { - uint net = source_index.data(NetworkModel::NetworkIdRole).toUInt(); + NetworkId net = source_index.data(NetworkModel::NetworkIdRole).value(); return !((mode & (SomeNets | FullCustom)) && !networks.contains(net)); } diff --git a/src/uisupport/bufferviewfilter.h b/src/uisupport/bufferviewfilter.h index d20445dc..506cbebd 100644 --- a/src/uisupport/bufferviewfilter.h +++ b/src/uisupport/bufferviewfilter.h @@ -26,6 +26,7 @@ #include #include // #include "buffer.h" +#include "types.h" /***************************************** * Buffer View Filter @@ -69,7 +70,7 @@ private: bool filterAcceptBuffer(const QModelIndex &) const; bool filterAcceptNetwork(const QModelIndex &) const; - void addBuffer(const uint &); + void addBuffer(const BufferId &); }; Q_DECLARE_OPERATORS_FOR_FLAGS(BufferViewFilter::Modes) diff --git a/src/uisupport/tabcompleter.cpp b/src/uisupport/tabcompleter.cpp index 60a74fb8..41ea4fff 100644 --- a/src/uisupport/tabcompleter.cpp +++ b/src/uisupport/tabcompleter.cpp @@ -42,7 +42,7 @@ void TabCompleter::buildCompletionList() { if(!currentIndex.data(NetworkModel::BufferIdRole).isValid()) return; - NetworkId networkId = currentIndex.data(NetworkModel::NetworkIdRole).toUInt(); + NetworkId networkId = currentIndex.data(NetworkModel::NetworkIdRole).value(); QString channelName = currentIndex.sibling(currentIndex.row(), 0).data().toString(); Network *network = Client::network(networkId); diff --git a/version.inc b/version.inc index 2f02d5a6..a4744a84 100644 --- a/version.inc +++ b/version.inc @@ -4,8 +4,8 @@ { using namespace Global; quasselVersion = "0.2.0-pre"; - quasselDate = "2008-01-17"; - quasselBuild = 355; + quasselDate = "2008-01-18"; + quasselBuild = 356; //! Minimum client build number the core needs clientBuildNeeded = 355; -- 2.20.1