X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fclient%2Fnetworkmodel.h;h=959d89a465a49b9340d19a1509ece0279793e34c;hb=1177f164f518b8f47b64f6736d176a995d5c17ed;hp=d891dd0e0013de9928b9c3afb9a9af396cc4073f;hpb=b2cf1b73760eadbeb3452d8d2260e1dc876e6fe5;p=quassel.git diff --git a/src/client/networkmodel.h b/src/client/networkmodel.h index d891dd0e..959d89a4 100644 --- a/src/client/networkmodel.h +++ b/src/client/networkmodel.h @@ -32,6 +32,8 @@ class BufferInfo; #include "selectionmodelsynchronizer.h" #include "modelpropertymapper.h" +#include "clientsettings.h" + class MappedSelectionModel; class QAbstractItemView; class Network; @@ -53,6 +55,7 @@ public: const BufferInfo &bufferInfo() const; virtual quint64 id() const; virtual QVariant data(int column, int role) const; + virtual bool setData(int column, const QVariant &value, int role); void attachIrcChannel(IrcChannel *ircChannel); @@ -80,8 +83,12 @@ public: Q_DECLARE_FLAGS(ActivityLevel, Activity) ActivityLevel activity() const; - void setActivity(const ActivityLevel &level); - void addActivity(const ActivityLevel &level); + bool setActivity(const ActivityLevel &level); + void updateActivity(const ActivityLevel &level); + + void setLastMsgInsert(QDateTime msgDate); + bool setLastSeen(); + QDateTime lastSeen(); public slots: void setTopic(const QString &topic); @@ -99,6 +106,8 @@ private: BufferInfo _bufferInfo; ActivityLevel _activity; Type _type; + QDateTime _lastMsgInsert; + QDateTime _lastSeen; QPointer _ircChannel; }; @@ -116,8 +125,8 @@ class NetworkItem : public PropertyMapItem { public: NetworkItem(const NetworkId &netid, AbstractTreeItem *parent = 0); - virtual QVariant data(int column, int row) const; virtual quint64 id() const; + virtual QVariant data(int column, int row) const; bool isActive() const; @@ -131,6 +140,8 @@ public slots: void attachNetwork(Network *network); void attachIrcChannel(const QString &channelName); + + void setActive(bool connected); private: NetworkId _networkId; @@ -150,8 +161,10 @@ public: QString categoryId(); virtual quint64 id() const; - + virtual QVariant data(int column, int role) const; + void addUser(IrcUser *ircUser); + bool removeUser(IrcUser *ircUser); static int categoryFromModes(const QString &modes); @@ -180,9 +193,9 @@ public: QString nickName() const; IrcUser *ircUser(); virtual quint64 id() const; - virtual QVariant data(int column, int role) const; - + virtual QString toolTip(int column) const; + private slots: void setNick(QString newNick); @@ -201,17 +214,19 @@ public: enum myRoles { BufferTypeRole = Qt::UserRole, ItemActiveRole, + BufferActivityRole, BufferIdRole, NetworkIdRole, - ItemTypeRole + BufferInfoRole, + ItemTypeRole, + LastSeenRole }; enum itemTypes { - AbstractItemType, - SimpleItemType, NetworkItemType, BufferItemType, - NickItemType + UserCategoryItemType, + IrcUserItemType }; NetworkModel(QObject *parent = 0); @@ -230,9 +245,11 @@ public: //Buffer *getBufferByIndex(const QModelIndex &) const; QModelIndex bufferIndex(BufferId bufferId); + const Network *networkByIndex(const QModelIndex &index) const; + public slots: void bufferUpdated(BufferInfo bufferInfo); - void bufferActivity(BufferItem::ActivityLevel, BufferInfo bufferInfo); + void updateBufferActivity(const Message &msg); private: QModelIndex networkIndex(NetworkId networkId);