summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-10-26 13:00:29 (GMT)
committerSwift Review <review@swift.im>2015-10-30 15:50:52 (GMT)
commit7f321edd9ada1f531b1fbc3325ef61449218f40c (patch)
treef0a1998447a41fa2cedff39edd1c179eefb4b298 /Swift/Controllers/HighlightAction.h
parent50a3962e4d0b16fd0316be54121cfb293c3117bd (diff)
downloadswift-7f321edd9ada1f531b1fbc3325ef61449218f40c.zip
swift-7f321edd9ada1f531b1fbc3325ef61449218f40c.tar.bz2
Only highlight text if a highlight color is set
This commit has the default rule set the default color and changes HighlightAction::highlightText_ symbol to HighlightAction::highlightWholeMessage_ as it is more descriptive of its use. Test-Information: Tested highlighting with the default rule set, and one with a highlight color set for the chat rule. Change-Id: Ic638e6347bdf6623ab5959341486233494f005f0
Diffstat (limited to 'Swift/Controllers/HighlightAction.h')
-rw-r--r--Swift/Controllers/HighlightAction.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/Swift/Controllers/HighlightAction.h b/Swift/Controllers/HighlightAction.h
index a9e0cee..3930eee 100644
--- a/Swift/Controllers/HighlightAction.h
+++ b/Swift/Controllers/HighlightAction.h
@@ -12,26 +12,26 @@
12 12
13#pragma once 13#pragma once
14 14
15#include <string> 15#include <string>
16 16
17#include <boost/archive/text_oarchive.hpp>
18#include <boost/archive/text_iarchive.hpp> 17#include <boost/archive/text_iarchive.hpp>
18#include <boost/archive/text_oarchive.hpp>
19 19
20namespace Swift { 20namespace Swift {
21 21
22 class HighlightRule; 22 class HighlightRule;
23 23
24 class HighlightAction { 24 class HighlightAction {
25 public: 25 public:
26 HighlightAction() : highlightText_(false), playSound_(false) {} 26 HighlightAction() : highlightWholeMessage_(false), playSound_(false) {}
27 27
28 /** 28 /**
29 * Gets the flag that indicates the entire message should be highlighted. 29 * Gets the flag that indicates the entire message should be highlighted.
30 */ 30 */
31 bool highlightAllText() const { return highlightText_; } 31 bool highlightWholeMessage() const { return highlightWholeMessage_; }
32 void setHighlightAllText(bool highlightText); 32 void setHighlightWholeMessage(bool highlightText);
33 33
34 /** 34 /**
35 * Gets the foreground highlight color. 35 * Gets the foreground highlight color.
36 */ 36 */
37 const std::string& getTextColor() const { return textColor_; } 37 const std::string& getTextColor() const { return textColor_; }
@@ -50,17 +50,17 @@ namespace Swift {
50 * Gets the sound filename. If the string is empty, assume a default sound file. 50 * Gets the sound filename. If the string is empty, assume a default sound file.
51 */ 51 */
52 const std::string& getSoundFile() const { return soundFile_; } 52 const std::string& getSoundFile() const { return soundFile_; }
53 void setSoundFile(const std::string& soundFile) { soundFile_ = soundFile; } 53 void setSoundFile(const std::string& soundFile) { soundFile_ = soundFile; }
54 54
55 bool isEmpty() const { return !highlightText_ && !playSound_; } 55 bool isEmpty() const { return !highlightWholeMessage_ && !playSound_; }
56 56
57 private: 57 private:
58 friend class boost::serialization::access; 58 friend class boost::serialization::access;
59 template<class Archive> void serialize(Archive & ar, const unsigned int version); 59 template<class Archive> void serialize(Archive & ar, const unsigned int version);
60 60
61 bool highlightText_; 61 bool highlightWholeMessage_;
62 std::string textColor_; 62 std::string textColor_;
63 std::string textBackground_; 63 std::string textBackground_;
64 64
65 bool playSound_; 65 bool playSound_;
66 std::string soundFile_; 66 std::string soundFile_;
@@ -70,11 +70,11 @@ namespace Swift {
70 bool operator !=(HighlightAction const& a, HighlightAction const& b); 70 bool operator !=(HighlightAction const& a, HighlightAction const& b);
71 71
72 template<class Archive> 72 template<class Archive>
73 void HighlightAction::serialize(Archive& ar, const unsigned int /*version*/) 73 void HighlightAction::serialize(Archive& ar, const unsigned int /*version*/)
74 { 74 {
75 ar & highlightText_; 75 ar & highlightWholeMessage_;
76 ar & textColor_; 76 ar & textColor_;
77 ar & textBackground_; 77 ar & textBackground_;
78 ar & playSound_; 78 ar & playSound_;
79 ar & soundFile_; 79 ar & soundFile_;
80 } 80 }