diff options
author | Tobias Markmann <tm@ayena.de> | 2015-01-18 19:12:02 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2015-02-05 09:34:57 (GMT) |
commit | edfd69a55e4f52576ab58306da8a82b1df890d5f (patch) | |
tree | 3d2a72b1014d11435f0a5592984d2894441c97e8 /Swift/Controllers/HighlightManager.cpp | |
parent | 53c86d070255ae1a33b7a3642bb6eb9ce42e7f70 (diff) | |
download | swift-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/HighlightManager.cpp')
-rw-r--r-- | Swift/Controllers/HighlightManager.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Swift/Controllers/HighlightManager.cpp b/Swift/Controllers/HighlightManager.cpp index ee1e9ed..383f5df 100644 --- a/Swift/Controllers/HighlightManager.cpp +++ b/Swift/Controllers/HighlightManager.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -75,6 +75,7 @@ std::vector<HighlightRule> HighlightManager::getDefaultRules() HighlightRule r; r.setMatchChat(true); r.getAction().setPlaySound(true); + r.setMatchWholeWords(true); rules.push_back(r); return rules; } @@ -136,4 +137,12 @@ Highlighter* HighlightManager::createHighlighter() return new Highlighter(this); } +bool HighlightManager::isDefaultRulesList() const { + return getDefaultRules() == rules_->list_; +} + +void HighlightManager::resetToDefaultRulesList() { + rules_->list_ = getDefaultRules(); +} + } |