X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fuisupport%2Fbufferviewfilter.h;h=4715f11a5072b245b715f93954954fcd5b740a75;hb=7431a7bfe8419ed104621fb8e77b37e4e1943fd9;hp=f27352e7a66d0ce2eb48f1c20739c71b952d1697;hpb=770b7ef54b03f3ebd1e29a58b4757505e1809b2d;p=quassel.git diff --git a/src/uisupport/bufferviewfilter.h b/src/uisupport/bufferviewfilter.h index f27352e7..4715f11a 100644 --- a/src/uisupport/bufferviewfilter.h +++ b/src/uisupport/bufferviewfilter.h @@ -18,15 +18,18 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _BUFFERVIEWFILTER_H_ -#define _BUFFERVIEWFILTER_H_ +#ifndef BUFFERVIEWFILTER_H_ +#define BUFFERVIEWFILTER_H_ -#include +#include #include -#include +#include +#include #include -// #include "buffer.h" +#include + #include "types.h" +#include "bufferviewconfig.h" /***************************************** * Buffer View Filter @@ -47,32 +50,43 @@ public: }; Q_DECLARE_FLAGS(Modes, Mode); - BufferViewFilter(QAbstractItemModel *model, const Modes &mode, const QList &nets); + BufferViewFilter(QAbstractItemModel *model, BufferViewConfig *config = 0); virtual Qt::ItemFlags flags(const QModelIndex &index) const; 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 foreground(const QModelIndex &index) const; - + + void setConfig(BufferViewConfig *config); + inline BufferViewConfig *config() const { return _config; } + public slots: void removeBuffer(const QModelIndex &); + void source_rowsInserted(const QModelIndex &parent, int start, int end); protected: bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const; - bool lessThan(const QModelIndex &, const QModelIndex &) 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; + private: - Modes mode; - QSet networks; - QSet buffers; + QPointer _config; + QColor _FgColorInactiveActivity; + QColor _FgColorNoActivity; + QColor _FgColorHighlightActivity; + QColor _FgColorNewMessageActivity; + QColor _FgColorOtherActivity; + void loadColors(); + bool filterAcceptBuffer(const QModelIndex &) const; bool filterAcceptNetwork(const QModelIndex &) const; void addBuffer(const BufferId &); - }; Q_DECLARE_OPERATORS_FOR_FLAGS(BufferViewFilter::Modes) -#endif +bool bufferIdLessThan(const BufferId &, const BufferId &); +#endif // BUFFERVIEWFILTER_H_