X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fbufferviewconfig.h;h=0390ddb60fbf79b026d7108272355278d908f082;hb=2c8434f74c68194d56f2084f637419123e61d18b;hp=5b506e5ca77c4dda0ecb1ff3d2d6eed7b25b0a2a;hpb=5b686746c880e5cda6d5de3e08180ea4332ff222;p=quassel.git diff --git a/src/common/bufferviewconfig.h b/src/common/bufferviewconfig.h index 5b506e5c..0390ddb6 100644 --- a/src/common/bufferviewconfig.h +++ b/src/common/bufferviewconfig.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2012 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -18,32 +18,34 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef BUFFERVIEWCONFIG_H -#define BUFFERVIEWCONFIG_H +#pragma once + +#include "common-export.h" #include "syncableobject.h" +#include "bufferinfo.h" #include "types.h" -class BufferViewConfig : public SyncableObject +class COMMON_EXPORT BufferViewConfig : public SyncableObject { - SYNCABLE_OBJECT Q_OBJECT + SYNCABLE_OBJECT Q_PROPERTY(QString bufferViewName READ bufferViewName WRITE setBufferViewName) Q_PROPERTY(NetworkId networkId READ networkId WRITE setNetworkId) Q_PROPERTY(bool addNewBuffersAutomatically READ addNewBuffersAutomatically WRITE setAddNewBuffersAutomatically) Q_PROPERTY(bool sortAlphabetically READ sortAlphabetically WRITE setSortAlphabetically) Q_PROPERTY(bool hideInactiveBuffers READ hideInactiveBuffers WRITE setHideInactiveBuffers) + Q_PROPERTY(bool hideInactiveNetworks READ hideInactiveNetworks WRITE setHideInactiveNetworks) Q_PROPERTY(bool disableDecoration READ disableDecoration WRITE setDisableDecoration) Q_PROPERTY(int allowedBufferTypes READ allowedBufferTypes WRITE setAllowedBufferTypes) Q_PROPERTY(int minimumActivity READ minimumActivity WRITE setMinimumActivity) + Q_PROPERTY(bool showSearch READ showSearch WRITE setShowSearch) public : - BufferViewConfig(int bufferViewId, QObject *parent = 0); - BufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = 0); - - inline virtual const QMetaObject *syncMetaObject() const { return &staticMetaObject; } + BufferViewConfig(int bufferViewId, QObject *parent = nullptr); + BufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent = nullptr); public slots: inline int bufferViewId() const { return _bufferViewId; } @@ -72,6 +74,12 @@ public slots: inline bool hideInactiveBuffers() const { return _hideInactiveBuffers; } void setHideInactiveBuffers(bool hideInactiveBuffers); + inline bool hideInactiveNetworks() const { return _hideInactiveNetworks; } + void setHideInactiveNetworks(bool hideInactiveNetworks); + + inline bool showSearch() const { return _showSearch; } + void setShowSearch(bool showSearch); + virtual inline void requestSetBufferViewName(const QString &bufferViewName) { REQUEST(ARG(bufferViewName)) } const QList &bufferList() const { return _buffers; } @@ -121,19 +129,22 @@ signals: // void setBufferViewNameRequested(const QString &bufferViewName); private: - int _bufferViewId; - QString _bufferViewName; - NetworkId _networkId; - bool _addNewBuffersAutomatically; - bool _sortAlphabetically; - bool _hideInactiveBuffers; - bool _disableDecoration; - int _allowedBufferTypes; - int _minimumActivity; + int _bufferViewId = 0; ///< ID of the associated BufferView + QString _bufferViewName = {}; ///< Display name of the associated BufferView + NetworkId _networkId = {}; ///< Network ID this buffer belongs to + + bool _addNewBuffersAutomatically = true; ///< Automatically add new buffers when created + bool _sortAlphabetically = true; ///< Sort buffers alphabetically + bool _hideInactiveBuffers = false; ///< Hide buffers without activity + bool _hideInactiveNetworks = false; ///< Hide networks without activity + bool _disableDecoration = false; ///< Disable buffer decoration (not fully implemented) + /// Buffer types allowed within this view + int _allowedBufferTypes = (BufferInfo::StatusBuffer | BufferInfo::ChannelBuffer + | BufferInfo::QueryBuffer | BufferInfo::GroupBuffer); + int _minimumActivity = 0; ///< Minimum activity for a buffer to show + bool _showSearch = false; ///< Persistently show the buffer search UI + QList _buffers; QSet _removedBuffers; QSet _temporarilyRemovedBuffers; }; - - -#endif // BUFFERVIEWCONFIG_H