mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
[VDE] Add a new setting to determine initial tab (Context/Deck/Database) (#7122)
* [VDE] Add a new setting to determine initial tab (Context/Deck/Database) Took 16 minutes Took 4 seconds * Adjust tooltip Took 4 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
parent
6ee1fd58e6
commit
fbe5c4ade0
9 changed files with 108 additions and 5 deletions
|
|
@ -25,6 +25,11 @@ int DeckEditorSettings::getDefaultDeckEditorType() const
|
|||
return getValue("defaultDeckEditorType", QString(), QString(), 1).toInt();
|
||||
}
|
||||
|
||||
int DeckEditorSettings::getVdeStartupTab() const
|
||||
{
|
||||
return getValue("vdeStartupTab", QString(), QString(), VdeStartupTabContext).toInt();
|
||||
}
|
||||
|
||||
void DeckEditorSettings::setOpenDeckInNewTab(bool _openDeckInNewTab)
|
||||
{
|
||||
setValue(_openDeckInNewTab, "openDeckInNewTab");
|
||||
|
|
@ -47,6 +52,12 @@ void DeckEditorSettings::setDefaultDeckEditorType(int _defaultDeckEditorType)
|
|||
setValue(_defaultDeckEditorType, "defaultDeckEditorType");
|
||||
}
|
||||
|
||||
void DeckEditorSettings::setVdeStartupTab(int _vdeStartupTab)
|
||||
{
|
||||
setValue(_vdeStartupTab, "vdeStartupTab");
|
||||
emit vdeStartupTabChanged(_vdeStartupTab);
|
||||
}
|
||||
|
||||
int DeckEditorSettings::getCommanderSpellbookIntegrationEnabled() const
|
||||
{
|
||||
return getValue("commanderspellbookintegrationenabled", QString(), QString(),
|
||||
|
|
|
|||
|
|
@ -13,6 +13,13 @@ enum commanderSpellbookIntegrationEnabledIndex
|
|||
commanderSpellbookIntegrationEnabledIndexUnprompted,
|
||||
};
|
||||
|
||||
enum VdeStartupTab
|
||||
{
|
||||
VdeStartupTabContext, ///< Match the opened deck: new decks show the database display, existing decks the deck view
|
||||
VdeStartupTabDeckDisplay, ///< Always open the Visual Deck View
|
||||
VdeStartupTabDatabaseDisplay, ///< Always open the Visual Database Display
|
||||
};
|
||||
|
||||
class DeckEditorSettings : public SettingsManager, public IDeckEditorSettingsProvider
|
||||
{
|
||||
Q_OBJECT
|
||||
|
|
@ -23,6 +30,7 @@ public:
|
|||
[[nodiscard]] bool getBannerCardComboBoxVisible() const override;
|
||||
[[nodiscard]] bool getTagsWidgetVisible() const override;
|
||||
[[nodiscard]] int getDefaultDeckEditorType() const override;
|
||||
[[nodiscard]] int getVdeStartupTab() const;
|
||||
[[nodiscard]] int getCommanderSpellbookIntegrationEnabled() const;
|
||||
[[nodiscard]] bool getCommanderSpellbookIntegrationUseOfficialBracketNames() const;
|
||||
|
||||
|
|
@ -30,6 +38,7 @@ public:
|
|||
void setBannerCardComboBoxVisible(bool _bannerCardComboBoxVisible);
|
||||
void setTagsWidgetVisible(bool _tagsWidgetVisible);
|
||||
void setDefaultDeckEditorType(int _defaultDeckEditorType);
|
||||
void setVdeStartupTab(int _vdeStartupTab);
|
||||
void setCommanderSpellbookIntegrationEnabled(int _commanderSpellbookIntegrationEnabled);
|
||||
void setCommanderSpellbookIntegrationUseOfficialBracketNames(bool _useOfficialBracketNames);
|
||||
|
||||
|
|
@ -38,6 +47,7 @@ signals:
|
|||
void tagsWidgetVisibleChanged(bool visible);
|
||||
void commanderSpellbookIntegrationEnabledChanged(int enabled);
|
||||
void commanderSpellbookIntegrationUseOfficialBracketNamesChanged(bool useOfficialBracketNames);
|
||||
void vdeStartupTabChanged(int vdeStartupTab);
|
||||
|
||||
public:
|
||||
explicit DeckEditorSettings(const QString &settingPath, QObject *parent = nullptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue