mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
* [DeckEditor] Use CommanderSpellbook.com to estimate bracket if format is 'commander' Took 2 minutes Took 16 minutes * Convert json data holder to structs, rename variables, extract widget - Extract bracket estimation UI from DeckEditorDeckDockWidget into a new CommanderBracketWidget - Move CommanderSpellbook integration settings from CardsDisplaySettings to DeckEditorSettings (matching the settings refactor on master) - Rename CommanderSpellbook integration variables to drop the redundant 'DeckEditor' prefix Took 4 minutes # Commit time for manual adjustment: # Took 6 minutes # Commit time for manual adjustment: # Took 8 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
72 lines
2.5 KiB
C++
72 lines
2.5 KiB
C++
#include "deck_editor_settings.h"
|
|
|
|
DeckEditorSettings::DeckEditorSettings(const QString &settingPath, QObject *parent)
|
|
: SettingsManager(settingPath + "deck_editor.ini", "deckeditor", QString(), parent)
|
|
{
|
|
}
|
|
|
|
bool DeckEditorSettings::getOpenDeckInNewTab() const
|
|
{
|
|
return getValue("openDeckInNewTab", QString(), QString(), false).toBool();
|
|
}
|
|
|
|
bool DeckEditorSettings::getBannerCardComboBoxVisible() const
|
|
{
|
|
return getValue("bannerCardComboBoxVisible", QString(), QString(), true).toBool();
|
|
}
|
|
|
|
bool DeckEditorSettings::getTagsWidgetVisible() const
|
|
{
|
|
return getValue("tagsWidgetVisible", QString(), QString(), true).toBool();
|
|
}
|
|
|
|
int DeckEditorSettings::getDefaultDeckEditorType() const
|
|
{
|
|
return getValue("defaultDeckEditorType", QString(), QString(), 1).toInt();
|
|
}
|
|
|
|
void DeckEditorSettings::setOpenDeckInNewTab(bool _openDeckInNewTab)
|
|
{
|
|
setValue(_openDeckInNewTab, "openDeckInNewTab");
|
|
}
|
|
|
|
void DeckEditorSettings::setBannerCardComboBoxVisible(bool _bannerCardComboBoxVisible)
|
|
{
|
|
setValue(_bannerCardComboBoxVisible, "bannerCardComboBoxVisible");
|
|
emit bannerCardComboBoxVisibleChanged(_bannerCardComboBoxVisible);
|
|
}
|
|
|
|
void DeckEditorSettings::setTagsWidgetVisible(bool _tagsWidgetVisible)
|
|
{
|
|
setValue(_tagsWidgetVisible, "tagsWidgetVisible");
|
|
emit tagsWidgetVisibleChanged(_tagsWidgetVisible);
|
|
}
|
|
|
|
void DeckEditorSettings::setDefaultDeckEditorType(int _defaultDeckEditorType)
|
|
{
|
|
setValue(_defaultDeckEditorType, "defaultDeckEditorType");
|
|
}
|
|
|
|
int DeckEditorSettings::getCommanderSpellbookIntegrationEnabled() const
|
|
{
|
|
return getValue("commanderspellbookintegrationenabled", QString(), QString(),
|
|
commanderSpellbookIntegrationEnabledIndexUnprompted)
|
|
.toInt();
|
|
}
|
|
|
|
bool DeckEditorSettings::getCommanderSpellbookIntegrationUseOfficialBracketNames() const
|
|
{
|
|
return getValue("commanderspellbookintegrationuseofficialbracketnames", QString(), QString(), false).toBool();
|
|
}
|
|
|
|
void DeckEditorSettings::setCommanderSpellbookIntegrationEnabled(int _commanderSpellbookIntegrationEnabled)
|
|
{
|
|
setValue(_commanderSpellbookIntegrationEnabled, "commanderspellbookintegrationenabled");
|
|
emit commanderSpellbookIntegrationEnabledChanged(_commanderSpellbookIntegrationEnabled);
|
|
}
|
|
|
|
void DeckEditorSettings::setCommanderSpellbookIntegrationUseOfficialBracketNames(bool _useOfficialBracketNames)
|
|
{
|
|
setValue(_useOfficialBracketNames, "commanderspellbookintegrationuseofficialbracketnames");
|
|
emit commanderSpellbookIntegrationUseOfficialBracketNamesChanged(_useOfficialBracketNames);
|
|
}
|