Move highlight phrases to new settings system

Add a setting serialize/deserializer for QString
Add constructor to ChatterinoSetting that doesn't take a default value
This commit is contained in:
Rasmus Karlsson
2018-01-04 01:52:37 +01:00
parent dc9f1b96eb
commit df733282be
9 changed files with 252 additions and 130 deletions
+6 -5
View File
@@ -1,5 +1,6 @@
#pragma once
#include "messages/highlightphrase.hpp"
#include "messages/word.hpp"
#include "setting.hpp"
#include "singletons/helper/chatterinosetting.hpp"
@@ -21,13 +22,12 @@ class SettingManager : public QObject
using FloatSetting = ChatterinoSetting<float>;
public:
void load();
void save();
messages::Word::Flags getWordTypeMask();
bool isIgnoredEmote(const QString &emote);
QSettings &getQSettings();
void load();
/// Appearance
BoolSetting showTimestamps = {"/appearance/messages/showTimestamps", true};
BoolSetting showTimestampSeconds = {"/appearance/messages/showTimestampSeconds", true};
@@ -73,9 +73,10 @@ public:
pajlada::Settings::Setting<std::string> preferredQuality;
Setting<float> emoteScale;
ChatterinoSetting<std::vector<messages::HighlightPhrase>> highlightProperties = {
"/highlighting/highlights"};
Setting<QString> pathHighlightSound;
Setting<QMap<QString, QPair<bool, bool>>> highlightProperties;
Setting<QString> highlightUserBlacklist;
BoolSetting highlightAlwaysPlaySound = {"/highlighting/alwaysPlaySound", false};
@@ -107,5 +108,5 @@ private:
pajlada::Settings::SettingListener wordMaskListener;
};
} // namespace singletons
} // namespace chatterino
}