summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-01-18 19:12:02 (GMT)
committerSwift Review <review@swift.im>2015-02-05 09:34:57 (GMT)
commitedfd69a55e4f52576ab58306da8a82b1df890d5f (patch)
tree3d2a72b1014d11435f0a5592984d2894441c97e8 /Swift/Controllers/HighlightAction.cpp
parent53c86d070255ae1a33b7a3642bb6eb9ce42e7f70 (diff)
downloadswift-edfd69a55e4f52576ab58306da8a82b1df890d5f.zip
swift-edfd69a55e4f52576ab58306da8a82b1df890d5f.tar.bz2
Add "Reset defaults" button to highlight editor window.
The button is only shown if the current rules are *not* the default set of rules. Test-Information: Tested on Mac OS X 10.9.5. Change-Id: Ibf1856af04c6bdacf6102d240e6fe5f6071cb46a
Diffstat (limited to 'Swift/Controllers/HighlightAction.cpp')
-rw-r--r--Swift/Controllers/HighlightAction.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/Swift/Controllers/HighlightAction.cpp b/Swift/Controllers/HighlightAction.cpp
index 492d4d2..80d9d85 100644
--- a/Swift/Controllers/HighlightAction.cpp
+++ b/Swift/Controllers/HighlightAction.cpp
@@ -4,6 +4,12 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2015 Isode Limited.
+ * All rights reserved.
+ * See the COPYING file for more information.
+ */
+
#include <Swift/Controllers/HighlightAction.h>
namespace Swift {
@@ -25,4 +31,32 @@ void HighlightAction::setPlaySound(bool playSound)
}
}
+bool operator ==(HighlightAction const& a, HighlightAction const& b) {
+ if (a.highlightAllText() != b.highlightAllText()) {
+ return false;
+ }
+
+ if (a.getTextColor() != b.getTextColor()) {
+ return false;
+ }
+
+ if (a.getTextBackground() != b.getTextBackground()) {
+ return false;
+ }
+
+ if (a.playSound() != b.playSound()) {
+ return false;
+ }
+
+ if (a.getSoundFile() != b.getSoundFile()) {
+ return false;
+ }
+
+ return true;
+}
+
+bool operator !=(HighlightAction const& a, HighlightAction const& b) {
+ return !(a == b);
+}
+
}