2017-01-18 21:30:23 +01:00
|
|
|
#include "settings/settings.h"
|
|
|
|
|
2017-01-20 06:10:28 +01:00
|
|
|
#include <QDir>
|
|
|
|
#include <QStandardPaths>
|
|
|
|
|
2017-01-18 21:30:23 +01:00
|
|
|
namespace chatterino {
|
|
|
|
namespace settings {
|
|
|
|
|
2017-01-20 06:10:28 +01:00
|
|
|
StringSetting Settings::theme("", "dark");
|
|
|
|
StringSetting Settings::user("", "");
|
|
|
|
FloatSetting Settings::emoteScale("", 1.0);
|
|
|
|
BoolSetting Settings::scaleEmotesByLineHeight("", false);
|
|
|
|
BoolSetting Settings::showTimestamps("", true);
|
|
|
|
BoolSetting Settings::showTimestampSeconds("", false);
|
|
|
|
BoolSetting Settings::allowDouplicateMessages("", true);
|
|
|
|
BoolSetting Settings::linksDoubleClickOnly("", false);
|
|
|
|
BoolSetting Settings::hideEmptyInput("", false);
|
|
|
|
BoolSetting Settings::showMessageLength("", false);
|
|
|
|
BoolSetting Settings::seperateMessages("", false);
|
|
|
|
BoolSetting Settings::mentionUsersWithAt("", false);
|
|
|
|
BoolSetting Settings::allowCommandsAtEnd("", false);
|
|
|
|
BoolSetting Settings::enableHighlights("", true);
|
|
|
|
BoolSetting Settings::enableHighlightSound("", true);
|
|
|
|
BoolSetting Settings::enableHighlightTaskbar("", true);
|
|
|
|
BoolSetting Settings::customHighlightSound("", false);
|
|
|
|
BoolSetting Settings::enableTwitchEmotes("", true);
|
|
|
|
BoolSetting Settings::enableBttvEmotes("", true);
|
|
|
|
BoolSetting Settings::enableFFzEmotes("", true);
|
|
|
|
BoolSetting Settings::enableEmojis("", true);
|
|
|
|
BoolSetting Settings::enableGifAnimations("", true);
|
|
|
|
BoolSetting Settings::enableGifs("", true);
|
|
|
|
BoolSetting Settings::inlineWhispers("", true);
|
|
|
|
BoolSetting Settings::windowTopMost("", true);
|
2017-01-22 05:58:23 +01:00
|
|
|
BoolSetting Settings::hideTabX("", false);
|
2017-01-20 06:10:28 +01:00
|
|
|
|
|
|
|
QSettings Settings::settings(
|
|
|
|
QStandardPaths::writableLocation(QStandardPaths::AppDataLocation),
|
|
|
|
QSettings::IniFormat);
|
|
|
|
|
|
|
|
std::vector<Setting *> Settings::settingsItems;
|
|
|
|
|
|
|
|
bool Settings::portable(false);
|
|
|
|
|
2017-01-18 21:30:23 +01:00
|
|
|
messages::Word::Type Settings::wordTypeMask = messages::Word::Default;
|
|
|
|
|
2017-01-20 06:10:28 +01:00
|
|
|
int Settings::_ = Settings::_init();
|
|
|
|
|
|
|
|
void
|
|
|
|
Settings::save()
|
|
|
|
{
|
|
|
|
for (Setting *item : settingsItems) {
|
|
|
|
item->save(settings);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
Settings::load()
|
2017-01-18 21:30:23 +01:00
|
|
|
{
|
2017-01-20 06:10:28 +01:00
|
|
|
for (Setting *item : settingsItems) {
|
|
|
|
item->load(settings);
|
|
|
|
}
|
2017-01-18 21:30:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
Settings::isIgnoredEmote(const QString &emote)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|