mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
use a SettingListener for word type mask updating
This commit is contained in:
parent
e39b9093f9
commit
ba1c9598a4
2 changed files with 12 additions and 26 deletions
|
@ -20,33 +20,16 @@ SettingsManager::SettingsManager()
|
||||||
QMap<QString, QPair<bool, bool>>())
|
QMap<QString, QPair<bool, bool>>())
|
||||||
, highlightUserBlacklist(this->settingsItems, "highlightUserBlacklist", "")
|
, highlightUserBlacklist(this->settingsItems, "highlightUserBlacklist", "")
|
||||||
{
|
{
|
||||||
this->showTimestamps.connectSimple([this](auto) {
|
this->wordMaskListener.addSetting(this->showTimestamps);
|
||||||
|
this->wordMaskListener.addSetting(this->showTimestampSeconds);
|
||||||
|
this->wordMaskListener.addSetting(this->showBadges);
|
||||||
|
this->wordMaskListener.addSetting(this->enableBttvEmotes);
|
||||||
|
this->wordMaskListener.addSetting(this->enableEmojis);
|
||||||
|
this->wordMaskListener.addSetting(this->enableFfzEmotes);
|
||||||
|
this->wordMaskListener.addSetting(this->enableTwitchEmotes);
|
||||||
|
this->wordMaskListener.cb = [this](auto) {
|
||||||
this->updateWordTypeMask(); //
|
this->updateWordTypeMask(); //
|
||||||
});
|
};
|
||||||
|
|
||||||
this->showTimestampSeconds.connectSimple([this](auto) {
|
|
||||||
this->updateWordTypeMask(); //
|
|
||||||
});
|
|
||||||
|
|
||||||
this->showBadges.connectSimple([this](auto) {
|
|
||||||
this->updateWordTypeMask(); //
|
|
||||||
});
|
|
||||||
|
|
||||||
this->enableBttvEmotes.connectSimple([this](auto) {
|
|
||||||
this->updateWordTypeMask(); //
|
|
||||||
});
|
|
||||||
|
|
||||||
this->enableEmojis.connectSimple([this](auto) {
|
|
||||||
this->updateWordTypeMask(); //
|
|
||||||
});
|
|
||||||
|
|
||||||
this->enableFfzEmotes.connectSimple([this](auto) {
|
|
||||||
this->updateWordTypeMask(); //
|
|
||||||
});
|
|
||||||
|
|
||||||
this->enableTwitchEmotes.connectSimple([this](auto) {
|
|
||||||
this->updateWordTypeMask(); //
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsManager::save()
|
void SettingsManager::save()
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <pajlada/settings/setting.hpp>
|
#include <pajlada/settings/setting.hpp>
|
||||||
|
#include <pajlada/settings/settinglistener.hpp>
|
||||||
|
|
||||||
namespace chatterino {
|
namespace chatterino {
|
||||||
|
|
||||||
|
@ -94,6 +95,8 @@ private:
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
std::vector<std::reference_wrapper<BaseSetting>> settingsItems;
|
std::vector<std::reference_wrapper<BaseSetting>> settingsItems;
|
||||||
messages::Word::Type wordTypeMask = messages::Word::Default;
|
messages::Word::Type wordTypeMask = messages::Word::Default;
|
||||||
|
|
||||||
|
pajlada::Settings::SettingListener wordMaskListener;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace chatterino
|
} // namespace chatterino
|
||||||
|
|
Loading…
Reference in a new issue