mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 09:35:08 -07:00
[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>
This commit is contained in:
parent
cf0b453e75
commit
12f0f59453
166 changed files with 5589 additions and 3066 deletions
|
|
@ -10,6 +10,7 @@
|
|||
#include "abstract_tab_deck_editor.h"
|
||||
|
||||
#include "../../../client/settings/cache_settings.h"
|
||||
#include "../../../client/settings/shortcuts_settings.h"
|
||||
#include "../client/network/interfaces/deck_stats_interface.h"
|
||||
#include "../client/network/interfaces/tapped_out_interface.h"
|
||||
#include "../deck_editor/deck_state_manager.h"
|
||||
|
|
@ -43,6 +44,9 @@
|
|||
#include <libcockatrice/protocol/pb/command_deck_upload.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response.pb.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <libcockatrice/settings/paths_settings.h>
|
||||
#include <libcockatrice/settings/recents_settings.h>
|
||||
#include <libcockatrice/utility/string_limits.h>
|
||||
|
||||
/**
|
||||
|
|
@ -199,7 +203,7 @@ void AbstractTabDeckEditor::cleanDeckAndResetModified()
|
|||
*/
|
||||
AbstractTabDeckEditor::DeckOpenLocation AbstractTabDeckEditor::confirmOpen(const bool openInSameTabIfBlank)
|
||||
{
|
||||
if (SettingsCache::instance().getOpenDeckInNewTab()) {
|
||||
if (SettingsCache::instance().interface().getOpenDeckInNewTab()) {
|
||||
if (openInSameTabIfBlank && deckStateManager->isBlankNewDeck()) {
|
||||
return SAME_TAB;
|
||||
} else {
|
||||
|
|
@ -350,7 +354,7 @@ bool AbstractTabDeckEditor::actSaveDeckAs()
|
|||
DeckList deckList = deckStateManager->getDeckList();
|
||||
|
||||
QFileDialog dialog(this, tr("Save deck"));
|
||||
dialog.setDirectory(SettingsCache::instance().getDeckPath());
|
||||
dialog.setDirectory(SettingsCache::instance().paths().getDeckPath());
|
||||
dialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
dialog.setDefaultSuffix("cod");
|
||||
dialog.setNameFilters(DeckLoader::FILE_NAME_FILTERS);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
#include <libcockatrice/models/database/card/card_completer_proxy_model.h>
|
||||
#include <libcockatrice/models/database/card/card_search_model.h>
|
||||
#include <libcockatrice/settings/visual_deck_storage_settings.h>
|
||||
#include <version_string.h>
|
||||
|
||||
TabArchidekt::TabArchidekt(TabSupervisor *_tabSupervisor)
|
||||
|
|
@ -131,7 +132,8 @@ void TabArchidekt::initializeUi()
|
|||
|
||||
// Settings
|
||||
settingsButton = new SettingsButtonWidget(primaryToolbar);
|
||||
cardSizeSlider = new CardSizeWidget(primaryToolbar, nullptr, SettingsCache::instance().getArchidektPreviewSize());
|
||||
cardSizeSlider = new CardSizeWidget(primaryToolbar, nullptr,
|
||||
SettingsCache::instance().visualDeckStorage().getArchidektPreviewSize());
|
||||
settingsButton->addSettingsWidget(cardSizeSlider);
|
||||
|
||||
// Assemble primary toolbar
|
||||
|
|
@ -337,8 +339,8 @@ void TabArchidekt::connectSignals()
|
|||
doSearch();
|
||||
});
|
||||
|
||||
connect(cardSizeSlider, &CardSizeWidget::cardSizeSettingUpdated, &SettingsCache::instance(),
|
||||
&SettingsCache::setArchidektPreviewCardSize);
|
||||
connect(cardSizeSlider, &CardSizeWidget::cardSizeSettingUpdated, &SettingsCache::instance().visualDeckStorage(),
|
||||
&VisualDeckStorageSettings::setArchidektPreviewCardSize);
|
||||
|
||||
// Search button triggers immediate search
|
||||
connect(searchButton, &QPushButton::clicked, this, &TabArchidekt::doSearchImmediate);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include <libcockatrice/card/database/card_database_manager.h>
|
||||
#include <libcockatrice/models/database/card/card_completer_proxy_model.h>
|
||||
#include <libcockatrice/models/database/card/card_search_model.h>
|
||||
#include <libcockatrice/settings/visual_deck_storage_settings.h>
|
||||
#include <version_string.h>
|
||||
|
||||
static bool canBeCommander(const CardInfoPtr &cardInfo)
|
||||
|
|
@ -94,9 +95,10 @@ TabEdhRecMain::TabEdhRecMain(TabSupervisor *_tabSupervisor) : Tab(_tabSupervisor
|
|||
|
||||
settingsButton = new SettingsButtonWidget(this);
|
||||
|
||||
cardSizeSlider = new CardSizeWidget(this, nullptr, SettingsCache::instance().getEDHRecCardSize());
|
||||
connect(cardSizeSlider, &CardSizeWidget::cardSizeSettingUpdated, &SettingsCache::instance(),
|
||||
&SettingsCache::setEDHRecCardSize);
|
||||
cardSizeSlider =
|
||||
new CardSizeWidget(this, nullptr, SettingsCache::instance().visualDeckStorage().getEDHRecCardSize());
|
||||
connect(cardSizeSlider, &CardSizeWidget::cardSizeSettingUpdated, &SettingsCache::instance().visualDeckStorage(),
|
||||
&VisualDeckStorageSettings::setEDHRecCardSize);
|
||||
|
||||
settingsButton->addSettingsWidget(cardSizeSlider);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "tab_deck_editor.h"
|
||||
|
||||
#include "../../../client/settings/cache_settings.h"
|
||||
#include "../../../client/settings/shortcuts_settings.h"
|
||||
#include "../deck_editor/deck_state_manager.h"
|
||||
#include "../filters/filter_builder.h"
|
||||
#include "../interface/pixel_map_generator.h"
|
||||
|
|
@ -21,6 +22,8 @@
|
|||
#include <libcockatrice/models/database/card_database_model.h>
|
||||
#include <libcockatrice/network/client/abstract/abstract_client.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
#include <libcockatrice/settings/cards_display_settings.h>
|
||||
#include <libcockatrice/settings/layouts_settings.h>
|
||||
|
||||
/**
|
||||
* @brief Constructs a new TabDeckEditor object.
|
||||
|
|
@ -59,7 +62,8 @@ void TabDeckEditor::createMenus()
|
|||
registerDockWidget(viewMenu, filterDockWidget, {250, 250});
|
||||
registerDockWidget(viewMenu, printingSelectorDockWidget, {525, 250});
|
||||
|
||||
connect(&SettingsCache::instance(), &SettingsCache::overrideAllCardArtWithPersonalPreferenceChanged, this,
|
||||
connect(&SettingsCache::instance().cardsDisplay(),
|
||||
&CardsDisplaySettings::overrideAllCardArtWithPersonalPreferenceChanged, this,
|
||||
[this](bool enabled) { dockToActions[printingSelectorDockWidget].menu->setEnabled(!enabled); });
|
||||
|
||||
viewMenu->addSeparator();
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include <libcockatrice/protocol/pb/response_deck_download.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_deck_upload.pb.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
#include <libcockatrice/settings/paths_settings.h>
|
||||
#include <libcockatrice/utility/string_limits.h>
|
||||
|
||||
TabDeckStorage::TabDeckStorage(TabSupervisor *_tabSupervisor,
|
||||
|
|
@ -36,7 +37,7 @@ TabDeckStorage::TabDeckStorage(TabSupervisor *_tabSupervisor,
|
|||
: Tab(_tabSupervisor), client(_client)
|
||||
{
|
||||
localDirModel = new QFileSystemModel(this);
|
||||
localDirModel->setRootPath(SettingsCache::instance().getDeckPath());
|
||||
localDirModel->setRootPath(SettingsCache::instance().paths().getDeckPath());
|
||||
localDirModel->sort(0, Qt::AscendingOrder);
|
||||
|
||||
localDirView = new QTreeView;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "tab_game.h"
|
||||
|
||||
#include "../../../client/settings/cache_settings.h"
|
||||
#include "../../../client/settings/shortcuts_settings.h"
|
||||
#include "../game/game.h"
|
||||
#include "../game/player/player_logic.h"
|
||||
#include "../game/replay.h"
|
||||
|
|
@ -44,6 +45,10 @@
|
|||
#include <libcockatrice/protocol/pb/game_replay.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_player.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
|
||||
#include <libcockatrice/settings/chat_settings.h>
|
||||
#include <libcockatrice/settings/debug_settings.h>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <libcockatrice/settings/layouts_settings.h>
|
||||
#include <libcockatrice/utility/string_limits.h>
|
||||
|
||||
TabGame::TabGame(TabSupervisor *_tabSupervisor, GameReplay *_replay)
|
||||
|
|
@ -252,8 +257,8 @@ void TabGame::resetChatAndPhase()
|
|||
|
||||
void TabGame::emitUserEvent()
|
||||
{
|
||||
bool globalEvent =
|
||||
!game->getPlayerManager()->isSpectator() || SettingsCache::instance().getSpectatorNotificationsEnabled();
|
||||
bool globalEvent = !game->getPlayerManager()->isSpectator() ||
|
||||
SettingsCache::instance().interface().getSpectatorNotificationsEnabled();
|
||||
emit userEvent(globalEvent);
|
||||
updatePlayerListDockTitle();
|
||||
}
|
||||
|
|
@ -626,8 +631,8 @@ void TabGame::actRotateViewCCW()
|
|||
|
||||
void TabGame::actCompleterChanged()
|
||||
{
|
||||
SettingsCache::instance().getChatMentionCompleter() ? completer->setCompletionRole(2)
|
||||
: completer->setCompletionRole(1);
|
||||
SettingsCache::instance().chat().getChatMentionCompleter() ? completer->setCompletionRole(2)
|
||||
: completer->setCompletionRole(1);
|
||||
}
|
||||
|
||||
void TabGame::notifyPlayerJoin(QString playerName)
|
||||
|
|
@ -1265,7 +1270,7 @@ void TabGame::createMessageDock(bool bReplay)
|
|||
if (!bReplay) {
|
||||
connect(messageLog, &MessageLogWidget::openMessageDialog, this, &TabGame::openMessageDialog);
|
||||
connect(messageLog, &MessageLogWidget::addMentionTag, this, &TabGame::addMentionTag);
|
||||
connect(&SettingsCache::instance(), &SettingsCache::chatMentionCompleterChanged, this,
|
||||
connect(&SettingsCache::instance().chat(), &ChatSettings::chatMentionCompleterChanged, this,
|
||||
&TabGame::actCompleterChanged);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
|
||||
#include <libcockatrice/protocol/pb/session_commands.pb.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
#include <libcockatrice/settings/chat_settings.h>
|
||||
#include <libcockatrice/utility/string_limits.h>
|
||||
|
||||
TabMessage::TabMessage(TabSupervisor *_tabSupervisor,
|
||||
|
|
@ -126,7 +127,7 @@ void TabMessage::processUserMessageEvent(const Event_UserMessage &event)
|
|||
if (tabSupervisor->currentIndex() != tabSupervisor->indexOf(this)) {
|
||||
soundEngine->playSound("private_message");
|
||||
}
|
||||
if (SettingsCache::instance().getShowMessagePopup() && shouldShowSystemPopup(event)) {
|
||||
if (SettingsCache::instance().chat().getShowMessagePopup() && shouldShowSystemPopup(event)) {
|
||||
showSystemPopup(event);
|
||||
}
|
||||
if (QString::fromStdString(event.sender_name()).toLower().simplified() == "servatrice") {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include <libcockatrice/protocol/pb/response_replay_download.pb.h>
|
||||
#include <libcockatrice/protocol/pb/response_replay_get_code.pb.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
#include <libcockatrice/settings/paths_settings.h>
|
||||
|
||||
inline Q_LOGGING_CATEGORY(TabReplaysLog, "replays_tab");
|
||||
|
||||
|
|
@ -59,7 +60,7 @@ TabReplays::TabReplays(TabSupervisor *_tabSupervisor, AbstractClient *_client, c
|
|||
QGroupBox *TabReplays::createLeftLayout()
|
||||
{
|
||||
localDirModel = new QFileSystemModel(this);
|
||||
localDirModel->setRootPath(SettingsCache::instance().getReplaysPath());
|
||||
localDirModel->setRootPath(SettingsCache::instance().paths().getReplaysPath());
|
||||
localDirModel->sort(0, Qt::AscendingOrder);
|
||||
|
||||
localDirView = new QTreeView;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "tab_room.h"
|
||||
|
||||
#include "../../../client/settings/cache_settings.h"
|
||||
#include "../../../client/settings/shortcuts_settings.h"
|
||||
#include "../interface/widgets/dialogs/dlg_settings.h"
|
||||
#include "../interface/widgets/server/chat_view/chat_view.h"
|
||||
#include "../interface/widgets/server/game_selector.h"
|
||||
|
|
@ -31,6 +32,7 @@
|
|||
#include <libcockatrice/protocol/pb/room_commands.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_room.pb.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
#include <libcockatrice/settings/chat_settings.h>
|
||||
#include <libcockatrice/utility/string_limits.h>
|
||||
|
||||
TabRoom::TabRoom(TabSupervisor *_tabSupervisor,
|
||||
|
|
@ -75,7 +77,7 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor,
|
|||
connect(chatView, &ChatView::showCardInfoPopup, this, &TabRoom::showCardInfoPopup);
|
||||
connect(chatView, &ChatView::deleteCardInfoPopup, this, &TabRoom::deleteCardInfoPopup);
|
||||
connect(chatView, &ChatView::addMentionTag, this, &TabRoom::addMentionTag);
|
||||
connect(&SettingsCache::instance(), &SettingsCache::chatMentionCompleterChanged, this,
|
||||
connect(&SettingsCache::instance().chat(), &ChatSettings::chatMentionCompleterChanged, this,
|
||||
&TabRoom::actCompleterChanged);
|
||||
sayLabel = new QLabel;
|
||||
sayEdit = new LineEditCompleter;
|
||||
|
|
@ -246,8 +248,8 @@ void TabRoom::actOpenChatSettings()
|
|||
|
||||
void TabRoom::actCompleterChanged()
|
||||
{
|
||||
SettingsCache::instance().getChatMentionCompleter() ? completer->setCompletionRole(2)
|
||||
: completer->setCompletionRole(1);
|
||||
SettingsCache::instance().chat().getChatMentionCompleter() ? completer->setCompletionRole(2)
|
||||
: completer->setCompletionRole(1);
|
||||
}
|
||||
|
||||
void TabRoom::processRoomEvent(const RoomEvent &event)
|
||||
|
|
@ -307,13 +309,13 @@ void TabRoom::processRoomSayEvent(const Event_RoomSay &event)
|
|||
ServerInfo_User userInfo = {};
|
||||
if (twi) {
|
||||
userInfo = twi->getUserInfo();
|
||||
if (SettingsCache::instance().getIgnoreUnregisteredUsers() &&
|
||||
if (SettingsCache::instance().chat().getIgnoreUnregisteredUsers() &&
|
||||
!UserLevelFlags(userInfo.user_level()).testFlag(ServerInfo_User::IsRegistered)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (event.message_type() == Event_RoomSay::ChatHistory && !SettingsCache::instance().getRoomHistory()) {
|
||||
if (event.message_type() == Event_RoomSay::ChatHistory && !SettingsCache::instance().chat().getRoomHistory()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "tab_supervisor.h"
|
||||
|
||||
#include "../../../client/settings/cache_settings.h"
|
||||
#include "../../../client/settings/shortcuts_settings.h"
|
||||
#include "../interface/pixel_map_generator.h"
|
||||
#include "../interface/widgets/server/user/user_list_manager.h"
|
||||
#include "../interface/widgets/server/user/user_list_widget.h"
|
||||
|
|
@ -37,6 +38,10 @@
|
|||
#include <libcockatrice/protocol/pb/room_event.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_room.pb.h>
|
||||
#include <libcockatrice/protocol/pb/serverinfo_user.pb.h>
|
||||
#include <libcockatrice/settings/chat_settings.h>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <libcockatrice/settings/tabs_settings.h>
|
||||
#include <libcockatrice/settings/visual_deck_storage_settings.h>
|
||||
|
||||
QRect MacOSTabFixStyle::subElementRect(SubElement element, const QStyleOption *option, const QWidget *widget) const
|
||||
{
|
||||
|
|
@ -341,13 +346,13 @@ void TabSupervisor::initStartupTabs()
|
|||
openTabHome();
|
||||
setCurrentWidget(tabHome);
|
||||
|
||||
if (SettingsCache::instance().getTabVisualDeckStorageOpen()) {
|
||||
if (SettingsCache::instance().tabs().getTabVisualDeckStorageOpen()) {
|
||||
openTabVisualDeckStorage();
|
||||
}
|
||||
if (SettingsCache::instance().getTabDeckStorageOpen()) {
|
||||
if (SettingsCache::instance().tabs().getTabDeckStorageOpen()) {
|
||||
openTabDeckStorage();
|
||||
}
|
||||
if (SettingsCache::instance().getTabReplaysOpen()) {
|
||||
if (SettingsCache::instance().tabs().getTabReplaysOpen()) {
|
||||
openTabReplays();
|
||||
}
|
||||
}
|
||||
|
|
@ -427,10 +432,10 @@ void TabSupervisor::start(const ServerInfo_User &_userInfo)
|
|||
tabsMenu->addAction(aTabServer);
|
||||
tabsMenu->addAction(aTabAccount);
|
||||
|
||||
if (SettingsCache::instance().getTabServerOpen()) {
|
||||
if (SettingsCache::instance().tabs().getTabServerOpen()) {
|
||||
openTabServer();
|
||||
}
|
||||
if (SettingsCache::instance().getTabAccountOpen()) {
|
||||
if (SettingsCache::instance().tabs().getTabAccountOpen()) {
|
||||
openTabAccount();
|
||||
}
|
||||
|
||||
|
|
@ -442,10 +447,10 @@ void TabSupervisor::start(const ServerInfo_User &_userInfo)
|
|||
tabsMenu->addAction(aTabLog);
|
||||
tabsMenu->addAction(aTabCardArtRules);
|
||||
|
||||
if (SettingsCache::instance().getTabAdminOpen()) {
|
||||
if (SettingsCache::instance().tabs().getTabAdminOpen()) {
|
||||
openTabAdmin();
|
||||
}
|
||||
if (SettingsCache::instance().getTabLogOpen()) {
|
||||
if (SettingsCache::instance().tabs().getTabLogOpen()) {
|
||||
openTabLog();
|
||||
}
|
||||
openTabCardArtRules();
|
||||
|
|
@ -547,7 +552,7 @@ void TabSupervisor::openTabHome()
|
|||
|
||||
void TabSupervisor::actTabVisualDeckStorage(bool checked)
|
||||
{
|
||||
SettingsCache::instance().setTabVisualDeckStorageOpen(checked);
|
||||
SettingsCache::instance().tabs().setTabVisualDeckStorageOpen(checked);
|
||||
if (checked && !tabVisualDeckStorage) {
|
||||
openTabVisualDeckStorage();
|
||||
setCurrentWidget(tabVisualDeckStorage);
|
||||
|
|
@ -571,7 +576,7 @@ void TabSupervisor::openTabVisualDeckStorage()
|
|||
|
||||
void TabSupervisor::actTabServer(bool checked)
|
||||
{
|
||||
SettingsCache::instance().setTabServerOpen(checked);
|
||||
SettingsCache::instance().tabs().setTabServerOpen(checked);
|
||||
if (checked && !tabServer) {
|
||||
openTabServer();
|
||||
setCurrentWidget(tabServer);
|
||||
|
|
@ -594,7 +599,7 @@ void TabSupervisor::openTabServer()
|
|||
|
||||
void TabSupervisor::actTabAccount(bool checked)
|
||||
{
|
||||
SettingsCache::instance().setTabAccountOpen(checked);
|
||||
SettingsCache::instance().tabs().setTabAccountOpen(checked);
|
||||
if (checked && !tabAccount) {
|
||||
openTabAccount();
|
||||
setCurrentWidget(tabAccount);
|
||||
|
|
@ -619,7 +624,7 @@ void TabSupervisor::openTabAccount()
|
|||
|
||||
void TabSupervisor::actTabDeckStorage(bool checked)
|
||||
{
|
||||
SettingsCache::instance().setTabDeckStorageOpen(checked);
|
||||
SettingsCache::instance().tabs().setTabDeckStorageOpen(checked);
|
||||
if (checked && !tabDeckStorage) {
|
||||
openTabDeckStorage();
|
||||
setCurrentWidget(tabDeckStorage);
|
||||
|
|
@ -642,7 +647,7 @@ void TabSupervisor::openTabDeckStorage()
|
|||
|
||||
void TabSupervisor::actTabReplays(bool checked)
|
||||
{
|
||||
SettingsCache::instance().setTabReplaysOpen(checked);
|
||||
SettingsCache::instance().tabs().setTabReplaysOpen(checked);
|
||||
if (checked && !tabReplays) {
|
||||
openTabReplays();
|
||||
setCurrentWidget(tabReplays);
|
||||
|
|
@ -667,7 +672,7 @@ void TabSupervisor::openTabReplays()
|
|||
|
||||
void TabSupervisor::actTabAdmin(bool checked)
|
||||
{
|
||||
SettingsCache::instance().setTabAdminOpen(checked);
|
||||
SettingsCache::instance().tabs().setTabAdminOpen(checked);
|
||||
if (checked && !tabAdmin) {
|
||||
openTabAdmin();
|
||||
setCurrentWidget(tabAdmin);
|
||||
|
|
@ -714,7 +719,7 @@ void TabSupervisor::openTabCardArtRules()
|
|||
|
||||
void TabSupervisor::actTabLog(bool checked)
|
||||
{
|
||||
SettingsCache::instance().setTabLogOpen(checked);
|
||||
SettingsCache::instance().tabs().setTabLogOpen(checked);
|
||||
if (checked && !tabLog) {
|
||||
openTabLog();
|
||||
setCurrentWidget(tabLog);
|
||||
|
|
@ -905,7 +910,7 @@ void TabSupervisor::talkLeft(TabMessage *tab)
|
|||
*/
|
||||
void TabSupervisor::openDeckInNewTab(const LoadedDeck &deckToOpen)
|
||||
{
|
||||
int type = SettingsCache::instance().getDefaultDeckEditorType();
|
||||
int type = SettingsCache::instance().visualDeckStorage().getDefaultDeckEditorType();
|
||||
switch (type) {
|
||||
case ClassicDeckEditor:
|
||||
addDeckEditorTab(deckToOpen);
|
||||
|
|
@ -1004,7 +1009,7 @@ void TabSupervisor::tabUserEvent(bool globalEvent)
|
|||
tab->setContentsChanged(true);
|
||||
setTabIcon(indexOf(tab), QPixmap("theme:icons/tab_changed"));
|
||||
}
|
||||
if (globalEvent && SettingsCache::instance().getNotificationsEnabled()) {
|
||||
if (globalEvent && SettingsCache::instance().interface().getNotificationsEnabled()) {
|
||||
QApplication::alert(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -1046,11 +1051,11 @@ void TabSupervisor::processUserMessageEvent(const Event_UserMessage &event)
|
|||
const ServerInfo_User *onlineUserInfo = userListManager->getOnlineUser(senderName);
|
||||
if (onlineUserInfo) {
|
||||
auto userLevel = UserLevelFlags(onlineUserInfo->user_level());
|
||||
if (SettingsCache::instance().getIgnoreUnregisteredUserMessages() &&
|
||||
if (SettingsCache::instance().chat().getIgnoreUnregisteredUserMessages() &&
|
||||
!userLevel.testFlag(ServerInfo_User::IsRegistered)) {
|
||||
// Flags are additive, so reg/mod/admin are all IsRegistered
|
||||
return;
|
||||
} else if (SettingsCache::instance().getIgnoreNonBuddyUserMessages() &&
|
||||
} else if (SettingsCache::instance().chat().getIgnoreNonBuddyUserMessages() &&
|
||||
!userListManager->isUserBuddy(senderName) && !userLevel.testFlag(ServerInfo_User::IsModerator) &&
|
||||
!userLevel.testFlag(ServerInfo_User::IsAdmin)) {
|
||||
// Ignore private messages from non-buddies
|
||||
|
|
@ -1099,7 +1104,7 @@ void TabSupervisor::processUserJoined(const ServerInfo_User &userInfoJoined)
|
|||
}
|
||||
}
|
||||
|
||||
if (SettingsCache::instance().getBuddyConnectNotificationsEnabled()) {
|
||||
if (SettingsCache::instance().interface().getBuddyConnectNotificationsEnabled()) {
|
||||
QApplication::alert(this);
|
||||
this->actShowPopup(tr("Your buddy %1 has signed on!").arg(userName));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "tab_deck_editor_visual.h"
|
||||
|
||||
#include "../../../../client/settings/cache_settings.h"
|
||||
#include "../../../../client/settings/shortcuts_settings.h"
|
||||
#include "../../cards/card_info_display_widget.h"
|
||||
#include "../../deck_editor/deck_state_manager.h"
|
||||
#include "../../filters/filter_builder.h"
|
||||
|
|
@ -30,6 +31,7 @@
|
|||
#include <libcockatrice/models/deck_list/deck_list_model.h>
|
||||
#include <libcockatrice/protocol/pb/command_deck_upload.pb.h>
|
||||
#include <libcockatrice/protocol/pending_command.h>
|
||||
#include <libcockatrice/settings/layouts_settings.h>
|
||||
|
||||
/**
|
||||
* @brief Constructs the TabDeckEditorVisual instance.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue