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' (#6415)
* [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>
This commit is contained in:
parent
e9eab328a4
commit
827e44a4d3
35 changed files with 1642 additions and 8 deletions
|
|
@ -38,6 +38,7 @@
|
|||
#include "version_string.h"
|
||||
#include "widgets/dialogs/dlg_connect.h"
|
||||
#include "widgets/server/handle_public_servers.h"
|
||||
#include "widgets/tabs/api/commander_spellbook/handle_commander_brackets.h"
|
||||
#include "widgets/utility/get_text_with_max.h"
|
||||
|
||||
#include <QAction>
|
||||
|
|
@ -559,6 +560,8 @@ void MainWindow::startupConfigCheck()
|
|||
actCheckClientUpdates();
|
||||
}
|
||||
|
||||
actCheckCommanderBracketDefinitionUpdates();
|
||||
|
||||
if (SettingsCache::instance().network().getClientVersion() == CLIENT_INFO_NOT_SET) {
|
||||
// no config found, 99% new clean install
|
||||
qCInfo(WindowMainStartupVersionLog)
|
||||
|
|
@ -661,6 +664,7 @@ void MainWindow::alertForcedOracleRun(const QString &version, bool isUpdate)
|
|||
|
||||
actCheckCardUpdates();
|
||||
actCheckServerUpdates();
|
||||
actCheckCommanderBracketDefinitionUpdates();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
|
@ -1005,6 +1009,16 @@ void MainWindow::checkClientUpdatesFinished(bool needToUpdate, bool /* isCompati
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::actCheckCommanderBracketDefinitionUpdates()
|
||||
{
|
||||
auto *handler = new HandleCommanderBrackets(this);
|
||||
|
||||
connect(handler, &HandleCommanderBrackets::sigBracketDefinitionsDownloaded, this,
|
||||
[]() { qDebug() << "Bracket definitions loaded"; });
|
||||
|
||||
handler->downloadBracketDefinitions();
|
||||
}
|
||||
|
||||
void MainWindow::refreshShortcuts()
|
||||
{
|
||||
ShortcutsSettings &shortcuts = SettingsCache::instance().shortcuts();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue