Cockatrice/libcockatrice_settings/libcockatrice/settings/chat_settings.cpp
BruebachL 12f0f59453
[Settings] Split cache_settings monolith into multiple SettingsManager sub-classes (#7050)
* [Settings] Split cache_settings into multiple files

Took 9 minutes

Took 4 minutes

* [Settings] Fwd declare settings classes in cache_settings

Took 15 minutes

* Fix oracle includes.

Took 8 minutes

* Address comments, fix windows CI

Took 8 minutes

* fix copy constructor visibility

Took 3 minutes

* lint

Took 2 minutes

* Fix native format tests.

Took 5 minutes

* Remove test header guard

Took 4 seconds

* Remove tests invalid in CI environ

Took 24 seconds

* Adjust to rebase.

Took 11 minutes

* Change settings file name.

Took 8 minutes

---------

Co-authored-by: Lukas Brübach <lukas.bruebach@bdosecurity.de>
Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
2026-07-27 11:25:39 +02:00

137 lines
3.5 KiB
C++

#include "chat_settings.h"
ChatSettings::ChatSettings(const QString &settingPath, QObject *parent)
: SettingsManager(settingPath + "chat.ini", "chat", QString(), parent)
{
}
bool ChatSettings::getChatMention() const
{
return getValue("mention", QString(), QString(), true).toBool();
}
bool ChatSettings::getChatMentionCompleter() const
{
return getValue("mentioncompleter", QString(), QString(), true).toBool();
}
QString ChatSettings::getChatMentionColor() const
{
return getValue("mentioncolor", QString(), QString(), "A6120D").toString();
}
QString ChatSettings::getChatHighlightColor() const
{
return getValue("highlightcolor", QString(), QString(), "A6120D").toString();
}
bool ChatSettings::getChatMentionForeground() const
{
return getValue("mentionforeground", QString(), QString(), true).toBool();
}
bool ChatSettings::getChatHighlightForeground() const
{
return getValue("highlightforeground", QString(), QString(), true).toBool();
}
bool ChatSettings::getIgnoreUnregisteredUsers() const
{
return getValue("ignore_unregistered").toBool();
}
bool ChatSettings::getIgnoreUnregisteredUserMessages() const
{
return getValue("ignore_unregistered_messages").toBool();
}
bool ChatSettings::getIgnoreNonBuddyUserMessages() const
{
return getValue("ignore_nonbuddy_messages").toBool();
}
bool ChatSettings::getShowMessagePopup() const
{
return getValue("showmessagepopups", QString(), QString(), true).toBool();
}
bool ChatSettings::getShowMentionPopup() const
{
return getValue("showmentionpopups", QString(), QString(), true).toBool();
}
bool ChatSettings::getRoomHistory() const
{
return getValue("roomhistory", QString(), QString(), true).toBool();
}
QString ChatSettings::getHighlightWords() const
{
return getValue("highlightwords").toString();
}
void ChatSettings::setChatMention(bool _chatMention)
{
setValue(_chatMention, "mention");
}
void ChatSettings::setChatMentionCompleter(bool _chatMentionCompleter)
{
setValue(_chatMentionCompleter, "mentioncompleter");
emit chatMentionCompleterChanged();
}
void ChatSettings::setChatMentionColor(const QString &_chatMentionColor)
{
setValue(_chatMentionColor, "mentioncolor");
}
void ChatSettings::setChatHighlightColor(const QString &_chatHighlightColor)
{
setValue(_chatHighlightColor, "highlightcolor");
}
void ChatSettings::setChatMentionForeground(bool _chatMentionForeground)
{
setValue(_chatMentionForeground, "mentionforeground");
}
void ChatSettings::setChatHighlightForeground(bool _chatHighlightForeground)
{
setValue(_chatHighlightForeground, "highlightforeground");
}
void ChatSettings::setIgnoreUnregisteredUsers(bool _ignoreUnregisteredUsers)
{
setValue(_ignoreUnregisteredUsers, "ignore_unregistered");
}
void ChatSettings::setIgnoreUnregisteredUserMessages(bool _ignoreUnregisteredUserMessages)
{
setValue(_ignoreUnregisteredUserMessages, "ignore_unregistered_messages");
}
void ChatSettings::setIgnoreNonBuddyUserMessages(bool _ignoreNonBuddyUserMessages)
{
setValue(_ignoreNonBuddyUserMessages, "ignore_nonbuddy_messages");
}
void ChatSettings::setShowMessagePopups(bool _showMessagePopups)
{
setValue(_showMessagePopups, "showmessagepopups");
}
void ChatSettings::setShowMentionPopups(bool _showMentionPopups)
{
setValue(_showMentionPopups, "showmentionpopups");
}
void ChatSettings::setRoomHistory(bool _roomHistory)
{
setValue(_roomHistory, "roomhistory");
}
void ChatSettings::setHighlightWords(const QString &_highlightWords)
{
setValue(_highlightWords, "highlightwords");
}