X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatscene.h;h=7f6bb75fa5091ecbcf0a42d5e37b54112bef4f5f;hp=68ef20f726bebe6eb1af36c489379fbd338cb9bb;hb=c27d5bfbe80bfeb583a25404f4ccee4b70b010e0;hpb=b82e9603ab7ce1164e8f550132f0c649653ad8ab diff --git a/src/qtui/chatscene.h b/src/qtui/chatscene.h index 68ef20f7..7f6bb75f 100644 --- a/src/qtui/chatscene.h +++ b/src/qtui/chatscene.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 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 * @@ -116,6 +116,23 @@ public: inline CutoffMode senderCutoffMode() const { return _cutoffMode; } inline void setSenderCutoffMode(CutoffMode mode) { _cutoffMode = mode; } + /** + * Gets whether to re-add hidden brackets around sender for all message types + * + * Used within the Chat Monitor as the normal message prefixes are overridden. + * + * @return Whether to re-add hidden brackets around sender for all message types + */ + inline bool alwaysBracketSender() const { return _alwaysBracketSender; } + /** + * Sets whether to re-add hidden brackets around sender for all message types + * + * @see ChatScene::alwaysBracketSender() + * + * @param brackets Sets whether to re-add hidden brackets around sender for all message types + */ + inline void setAlwaysBracketSender(bool alwaysBracket) { _alwaysBracketSender = alwaysBracket; } + QString selection() const; bool hasSelection() const; bool hasGlobalSelection() const; @@ -185,6 +202,25 @@ private slots: */ void showSenderBracketsChanged(); + /** + * Updates the local setting cache of whether or not to use the custom timestamp format + */ + void useCustomTimestampFormatChanged(); + + /** + * Updates the local setting cache of the timestamp format string + */ + void timestampFormatStringChanged(); + + /** + * Updates the status of whether or not the timestamp format string contains brackets + * + * When the timestamp contains brackets -and- showSenderBrackets is disabled, we need to + * automatically add brackets. This function checks if the timestamp has brackets and stores + * the result, rather than checking each time text is copied. + */ + void updateTimestampHasBrackets(); + void rowsRemoved(); void clickTimeout(); @@ -215,6 +251,8 @@ private: qreal _firstColHandlePos, _secondColHandlePos; int _defaultFirstColHandlePos, _defaultSecondColHandlePos; CutoffMode _cutoffMode; + /// Whether to re-add hidden brackets around sender for all message types + bool _alwaysBracketSender; ChatItem *_selectingItem; int _selectionStartCol, _selectionMinCol; @@ -233,6 +271,10 @@ private: bool _showSenderBrackets; /// If true, show brackets around sender names + bool _useCustomTimestampFormat; /// If true, use the custom timestamp format + QString _timestampFormatString; /// Format of the timestamp string + bool _timestampHasBrackets; /// If true, timestamp format has [brackets] of some sort + static const int _webSearchSelectionTextMaxVisible = 24; #if defined HAVE_WEBKIT || defined HAVE_WEBENGINE