X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fbufferviewfilter.h;h=22fc2fd575fb3ef3048dd5bb14f7300f496af887;hp=07fec1bf9ada37493e3ccd79202c695424d93ced;hb=eba1be2f198709d25b9d2e1e48023dfadecd60db;hpb=8db1c0298b0b9baf3af072a5ef368b2f2d14169d diff --git a/src/uisupport/bufferviewfilter.h b/src/uisupport/bufferviewfilter.h index 07fec1bf..22fc2fd5 100644 --- a/src/uisupport/bufferviewfilter.h +++ b/src/uisupport/bufferviewfilter.h @@ -21,8 +21,10 @@ #ifndef BUFFERVIEWFILTER_H_ #define BUFFERVIEWFILTER_H_ +#include #include #include +#include #include #include #include @@ -47,7 +49,7 @@ public: NoServers = 0x40, FullCustom = 0x80 }; - Q_DECLARE_FLAGS(Modes, Mode); + Q_DECLARE_FLAGS(Modes, Mode) BufferViewFilter(QAbstractItemModel *model, BufferViewConfig *config = 0); @@ -55,27 +57,52 @@ public: virtual bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent); QVariant data(const QModelIndex &index, int role) const; + QVariant icon(const QModelIndex &index) const; QVariant foreground(const QModelIndex &index) const; void setConfig(BufferViewConfig *config); inline BufferViewConfig *config() const { return _config; } + virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder); + public slots: - void removeBuffer(const QModelIndex &); - void source_rowsInserted(const QModelIndex &parent, int start, int end); + void checkPreviousCurrentForRemoval(const QModelIndex ¤t, const QModelIndex &previous); + void checkItemForRemoval(const QModelIndex &index) { checkItemsForRemoval(index, index); } + void checkItemsForRemoval(const QModelIndex &topLeft, const QModelIndex &bottomRight); protected: bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; bool bufferLessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; bool networkLessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; + virtual void customEvent(QEvent *event); +signals: + void _dataChanged(const QModelIndex &source_topLeft, const QModelIndex &source_bottomRight); + void configChanged(); + +private slots: + void configInitialized(); + private: QPointer _config; + Qt::SortOrder _sortOrder; + + QColor _FgColorInactiveActivity; + QColor _FgColorNoActivity; + QColor _FgColorHighlightActivity; + QColor _FgColorNewMessageActivity; + QColor _FgColorOtherActivity; + + QPixmap _userOfflineIcon; + QPixmap _userAwayIcon; + QPixmap _userOnlineIcon; + + void loadColors(); bool filterAcceptBuffer(const QModelIndex &) const; bool filterAcceptNetwork(const QModelIndex &) const; - void addBuffer(const BufferId &); + void addBuffer(const BufferId &) const; }; Q_DECLARE_OPERATORS_FOR_FLAGS(BufferViewFilter::Modes)