summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Maudsley <richard.maudsley@isode.com>2014-01-16 15:14:20 (GMT)
committerRichard Maudsley <richard.maudsley@isode.com>2014-01-16 15:14:20 (GMT)
commitcacd6f5cc3754872653311d5333145f2256079d9 (patch)
treee4258b40a8ea33e94e5d6183b1f439a795a7b37c /Swift/Controllers
parentc4f8b7b06d038473a377c88d0dee54b69f67c77a (diff)
downloadswift-cacd6f5cc3754872653311d5333145f2256079d9.zip
swift-cacd6f5cc3754872653311d5333145f2256079d9.tar.bz2
Updated highlight dialog.
Change-Id: I9bf91fdbf542e01a9f2421315698846ca0bdb043
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/HighlightAction.h9
-rw-r--r--Swift/Controllers/HighlightManager.cpp7
2 files changed, 10 insertions, 6 deletions
diff --git a/Swift/Controllers/HighlightAction.h b/Swift/Controllers/HighlightAction.h
index a8da90a..8d8bafc 100644
--- a/Swift/Controllers/HighlightAction.h
+++ b/Swift/Controllers/HighlightAction.h
@@ -22,15 +22,24 @@ namespace Swift {
bool highlightText() const { return highlightText_; }
void setHighlightText(bool highlightText);
+ /**
+ * Gets the foreground highlight color. If the string is empty, assume a default color.
+ */
const std::string& getTextColor() const { return textColor_; }
void setTextColor(const std::string& textColor) { textColor_ = textColor; }
+ /**
+ * Gets the background highlight color. If the string is empty, assume a default color.
+ */
const std::string& getTextBackground() const { return textBackground_; }
void setTextBackground(const std::string& textBackground) { textBackground_ = textBackground; }
bool playSound() const { return playSound_; }
void setPlaySound(bool playSound);
+ /**
+ * Gets the sound filename. If the string is empty, assume a default sound file.
+ */
const std::string& getSoundFile() const { return soundFile_; }
void setSoundFile(const std::string& soundFile) { soundFile_ = soundFile; }
diff --git a/Swift/Controllers/HighlightManager.cpp b/Swift/Controllers/HighlightManager.cpp
index 46af389..17ce776 100644
--- a/Swift/Controllers/HighlightManager.cpp
+++ b/Swift/Controllers/HighlightManager.cpp
@@ -125,12 +125,7 @@ void HighlightManager::storeSettings()
void HighlightManager::loadSettings()
{
std::string highlightRules = settings_->getSetting(SettingConstants::HIGHLIGHT_RULES);
- std::vector<HighlightRule> rules = rulesFromString(highlightRules);
- if (rules.empty()) {
- rules_ = getDefaultRules();
- } else {
- rules_ = rules;
- }
+ rules_ = rulesFromString(highlightRules);
}
Highlighter* HighlightManager::createHighlighter()