Prototype intents

Took 53 minutes

Took 6 seconds
This commit is contained in:
Lukas Brübach 2026-04-13 20:58:59 +02:00
parent d791e7d0ff
commit 47a80ddb12
8 changed files with 133 additions and 10 deletions

View file

@ -24,6 +24,7 @@
#include "client/settings/cache_settings.h"
#include "client/sound_engine.h"
#include "database/interface/settings_card_preference_provider.h"
#include "interface/intents/intent_open_local_deck.h"
#include "interface/logger.h"
#include "interface/pixel_map_generator.h"
#include "interface/theme_manager.h"
@ -320,11 +321,8 @@ int main(int argc, char *argv[])
if (file.startsWith("cockatrice://")) {
// ui.openUrl(QUrl(file));
} else if (QFileInfo(file).exists()) {
std::optional<LoadedDeck> deckOpt =
DeckLoader::loadFromFile(file, DeckFileFormat::getFormatFromName(file), true);
if (deckOpt) {
ui.getTabSupervisor()->openDeckInNewTab(deckOpt.value());
}
auto openDeckIntent = new IntentOpenLocalDeck(ui.getTabSupervisor(), file);
openDeckIntent->execute();
}
}
@ -334,11 +332,8 @@ int main(int argc, char *argv[])
if (file.startsWith("cockatrice://")) {
// ui.openUrl(QUrl(file));
} else if (QFileInfo(file).exists()) {
std::optional<LoadedDeck> deckOpt =
DeckLoader::loadFromFile(file, DeckFileFormat::getFormatFromName(file), true);
if (deckOpt) {
ui.getTabSupervisor()->openDeckInNewTab(deckOpt.value());
}
auto openDeckIntent = new IntentOpenLocalDeck(ui.getTabSupervisor(), file);
openDeckIntent->execute();
}
}
});