summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a54a7c4)
If set, this disables colors and icons in a BufferView. Mostly useful for
having plain BufferViews in settingspages and similar.
We use this for the ChatMonitorSettingsPage now.
_addNewBuffersAutomatically(true),
_sortAlphabetically(true),
_hideInactiveBuffers(false),
_addNewBuffersAutomatically(true),
_sortAlphabetically(true),
_hideInactiveBuffers(false),
+ _disableDecoration(false),
_allowedBufferTypes(BufferInfo::StatusBuffer | BufferInfo::ChannelBuffer | BufferInfo::QueryBuffer | BufferInfo::GroupBuffer),
_minimumActivity(0)
{
_allowedBufferTypes(BufferInfo::StatusBuffer | BufferInfo::ChannelBuffer | BufferInfo::QueryBuffer | BufferInfo::GroupBuffer),
_minimumActivity(0)
{
BufferViewConfig::BufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent)
: SyncableObject(parent),
BufferViewConfig::BufferViewConfig(int bufferViewId, const QVariantMap &properties, QObject *parent)
: SyncableObject(parent),
- _bufferViewId(bufferViewId)
+ _bufferViewId(bufferViewId),
+ _disableDecoration(false) // FIXME remove as soon as we have bumped the protocol version to v8
{
fromVariantMap(properties);
setObjectName(QString::number(bufferViewId));
{
fromVariantMap(properties);
setObjectName(QString::number(bufferViewId));
emit sortAlphabeticallySet(sortAlphabetically);
}
emit sortAlphabeticallySet(sortAlphabetically);
}
+void BufferViewConfig::setDisableDecoration(bool disableDecoration) {
+ if(_disableDecoration == disableDecoration)
+ return;
+
+ _disableDecoration = disableDecoration;
+ emit disableDecorationSet(disableDecoration);
+}
+
void BufferViewConfig::setAllowedBufferTypes(int bufferTypes) {
if(_allowedBufferTypes == bufferTypes)
return;
void BufferViewConfig::setAllowedBufferTypes(int bufferTypes) {
if(_allowedBufferTypes == bufferTypes)
return;
if(_removedBuffers.contains(bufferId))
_removedBuffers.remove(bufferId);
if(_removedBuffers.contains(bufferId))
_removedBuffers.remove(bufferId);
if(_temporarilyRemovedBuffers.contains(bufferId))
_temporarilyRemovedBuffers.remove(bufferId);
if(_temporarilyRemovedBuffers.contains(bufferId))
_temporarilyRemovedBuffers.remove(bufferId);
_buffers.insert(pos, bufferId);
emit bufferAdded(bufferId, pos);
}
_buffers.insert(pos, bufferId);
emit bufferAdded(bufferId, pos);
}
void BufferViewConfig::removeBuffer(const BufferId &bufferId) {
if(_buffers.contains(bufferId))
_buffers.removeAt(_buffers.indexOf(bufferId));
void BufferViewConfig::removeBuffer(const BufferId &bufferId) {
if(_buffers.contains(bufferId))
_buffers.removeAt(_buffers.indexOf(bufferId));
if(_removedBuffers.contains(bufferId))
_removedBuffers.remove(bufferId);
if(_removedBuffers.contains(bufferId))
_removedBuffers.remove(bufferId);
if(_temporarilyRemovedBuffers.contains(bufferId))
_temporarilyRemovedBuffers.remove(bufferId);
if(_temporarilyRemovedBuffers.contains(bufferId))
_temporarilyRemovedBuffers.remove(bufferId);
_removedBuffers << bufferId;
emit bufferPermanentlyRemoved(bufferId);
_removedBuffers << bufferId;
emit bufferPermanentlyRemoved(bufferId);
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 addNewBuffersAutomatically READ addNewBuffersAutomatically WRITE setAddNewBuffersAutomatically)
Q_PROPERTY(bool sortAlphabetically READ sortAlphabetically WRITE setSortAlphabetically)
Q_PROPERTY(bool hideInactiveBuffers READ hideInactiveBuffers WRITE setHideInactiveBuffers)
+ 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(int allowedBufferTypes READ allowedBufferTypes WRITE setAllowedBufferTypes)
Q_PROPERTY(int minimumActivity READ minimumActivity WRITE setMinimumActivity)
inline bool sortAlphabetically() const { return _sortAlphabetically; }
void setSortAlphabetically(bool sortAlphabetically);
inline bool sortAlphabetically() const { return _sortAlphabetically; }
void setSortAlphabetically(bool sortAlphabetically);
+ inline bool disableDecoration() const { return _disableDecoration; }
+ void setDisableDecoration(bool disableDecoration);
+
inline int allowedBufferTypes() const { return _allowedBufferTypes; }
void setAllowedBufferTypes(int bufferTypes);
inline int allowedBufferTypes() const { return _allowedBufferTypes; }
void setAllowedBufferTypes(int bufferTypes);
inline bool hideInactiveBuffers() const { return _hideInactiveBuffers; }
void setHideInactiveBuffers(bool hideInactiveBuffers);
inline bool hideInactiveBuffers() const { return _hideInactiveBuffers; }
void setHideInactiveBuffers(bool hideInactiveBuffers);
virtual inline void requestSetBufferViewName(const QString &bufferViewName) { emit setBufferViewNameRequested(bufferViewName); }
const QList<BufferId> &bufferList() const { return _buffers; }
virtual inline void requestSetBufferViewName(const QString &bufferViewName) { emit setBufferViewNameRequested(bufferViewName); }
const QList<BufferId> &bufferList() const { return _buffers; }
virtual inline void requestRemoveBuffer(const BufferId &bufferId) { emit removeBufferRequested(bufferId); }
void removeBufferPermanently(const BufferId &bufferId);
virtual inline void requestRemoveBufferPermanently(const BufferId &bufferId) { emit removeBufferPermanentlyRequested(bufferId); }
virtual inline void requestRemoveBuffer(const BufferId &bufferId) { emit removeBufferRequested(bufferId); }
void removeBufferPermanently(const BufferId &bufferId);
virtual inline void requestRemoveBufferPermanently(const BufferId &bufferId) { emit removeBufferPermanentlyRequested(bufferId); }
signals:
void bufferViewNameSet(const QString &bufferViewName);
void networkIdSet(const NetworkId &networkId);
void addNewBuffersAutomaticallySet(bool addNewBuffersAutomatically);
signals:
void bufferViewNameSet(const QString &bufferViewName);
void networkIdSet(const NetworkId &networkId);
void addNewBuffersAutomaticallySet(bool addNewBuffersAutomatically);
- void sortAlphabeticallySet(bool sortAlphabetically);
+ void sortAlphabeticallySet(bool sortAlphabetically);
+ void disableDecorationSet(bool disableDecoration);
void allowedBufferTypesSet(int allowedBufferTypes);
void minimumActivitySet(int activity);
void hideInactiveBuffersSet(bool hideInactiveBuffers);
void allowedBufferTypesSet(int allowedBufferTypes);
void minimumActivitySet(int activity);
void hideInactiveBuffersSet(bool hideInactiveBuffers);
void bufferPermanentlyRemoved(const BufferId &bufferId);
void removeBufferRequested(const BufferId &bufferId);
void removeBufferPermanentlyRequested(const BufferId &bufferId);
void bufferPermanentlyRemoved(const BufferId &bufferId);
void removeBufferRequested(const BufferId &bufferId);
void removeBufferPermanentlyRequested(const BufferId &bufferId);
void setBufferViewNameRequested(const QString &bufferViewName);
private:
void setBufferViewNameRequested(const QString &bufferViewName);
private:
bool _addNewBuffersAutomatically;
bool _sortAlphabetically;
bool _hideInactiveBuffers;
bool _addNewBuffersAutomatically;
bool _sortAlphabetically;
bool _hideInactiveBuffers;
+ bool _disableDecoration;
int _allowedBufferTypes;
int _minimumActivity;
QList<BufferId> _buffers;
int _allowedBufferTypes;
int _minimumActivity;
QList<BufferId> _buffers;
_configAvailable = new BufferViewConfig(-667, this);
_configAvailable->setBufferViewName("tmpChatMonitorAvailableBuffers");
_configAvailable->setSortAlphabetically(true);
_configAvailable = new BufferViewConfig(-667, this);
_configAvailable->setBufferViewName("tmpChatMonitorAvailableBuffers");
_configAvailable->setSortAlphabetically(true);
+ _configAvailable->setDisableDecoration(true);
_configAvailable->setNetworkId(NetworkId());
_configAvailable->setInitialized();
_configAvailable->setNetworkId(NetworkId());
_configAvailable->setInitialized();
_configActive = new BufferViewConfig(-666, this);
_configActive->setBufferViewName("tmpChatMonitorActiveBuffers");
_configActive->setSortAlphabetically(true);
_configActive = new BufferViewConfig(-666, this);
_configActive->setBufferViewName("tmpChatMonitorActiveBuffers");
_configActive->setSortAlphabetically(true);
+ _configActive->setDisableDecoration(true);
_configActive->setNetworkId(NetworkId());
_configActive->setInitialized();
_configActive->setNetworkId(NetworkId());
_configActive->setInitialized();
}
QVariant BufferViewFilter::icon(const QModelIndex &index) const {
}
QVariant BufferViewFilter::icon(const QModelIndex &index) const {
- if(!_showUserStateIcons)
+ if(!_showUserStateIcons || config() && config()->disableDecoration())
return QVariant();
if(index.column() != 0)
return QVariant();
if(index.column() != 0)
}
QVariant BufferViewFilter::foreground(const QModelIndex &index) const {
}
QVariant BufferViewFilter::foreground(const QModelIndex &index) const {
+ if(config() && config()->disableDecoration())
+ return _FgColorNoActivity;
+
BufferInfo::ActivityLevel activity = (BufferInfo::ActivityLevel)index.data(NetworkModel::BufferActivityRole).toInt();
if(activity & BufferInfo::Highlight)
BufferInfo::ActivityLevel activity = (BufferInfo::ActivityLevel)index.data(NetworkModel::BufferActivityRole).toInt();
if(activity & BufferInfo::Highlight)