mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 17:15:09 -07:00
- Serialized url-chain dispatcher in IntentUrlParser; queue-drained urlChainFinished(bool) drives the startup auto-connect fallback - Open-shared-deck intent with sequential download state machine, 15s per-item timeout, partial-success offer, livable Cancel via ApplicationModal dlg_login_prompt interactive fallback - Preview dialog: download progress label, share vocab sweep, palette-highlight selection frame, Space/Enter keyboard toggle, NoFocus checkbox, double-click tile opens immediately - Confirm-before-server-migration with one-shot restore to the previous server on failed/cancelled chains (statusChanged settle deferral), hostname-only identity comparisons - Skip credential link when already connected; arrow-key navigation in FlowWidget; card glows use palette highlight - Address code-review M1-M4 and UI/UX QA blockers 1-2
59 lines
No EOL
1.6 KiB
C++
59 lines
No EOL
1.6 KiB
C++
#ifndef COCKATRICE_INTENT_OPEN_SHARED_DECK_H
|
|
#define COCKATRICE_INTENT_OPEN_SHARED_DECK_H
|
|
|
|
#include "contexts/context_open_deck.h"
|
|
#include "intent.h"
|
|
#include "remote_client.h"
|
|
|
|
#include <QList>
|
|
#include <QMap>
|
|
#include <QScopedPointer>
|
|
#include <memory>
|
|
|
|
class TabSupervisor;
|
|
struct LoadedDeck;
|
|
class CardDatabaseQuerier;
|
|
class DlgSharedDecksPreview;
|
|
class QTimer;
|
|
|
|
class IntentOpenSharedDeck : public Intent
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
IntentOpenSharedDeck(TabSupervisor *_tabSupervisor,
|
|
RemoteClient *_remoteClient,
|
|
const CardDatabaseQuerier *_querier,
|
|
std::unique_ptr<ContextOpenDeck> _context);
|
|
|
|
protected:
|
|
bool checkPrecondition() const override;
|
|
void onPreconditionSatisfied() override;
|
|
void onPreconditionNotSatisfied() override;
|
|
|
|
private slots:
|
|
void listShareFinished(const Response &response, const CommandContainer &commandContainer);
|
|
void downloadShareFinished(const Response &response, const CommandContainer &commandContainer);
|
|
void onDownloadTimeout();
|
|
|
|
private:
|
|
void startDownloads(const QList<int> &itemIds);
|
|
void downloadNextItem();
|
|
void onItemFailure(const QString &reason);
|
|
void finishAll();
|
|
|
|
TabSupervisor *tabSupervisor;
|
|
RemoteClient *remoteClient;
|
|
const CardDatabaseQuerier *querier;
|
|
QScopedPointer<ContextOpenDeck> context;
|
|
DlgSharedDecksPreview *previewDialog = nullptr;
|
|
QTimer *downloadTimer;
|
|
QMap<int, QString> itemNames;
|
|
QList<int> pendingItemIds;
|
|
QList<LoadedDeck> loadedDecks;
|
|
int currentItemId = 0;
|
|
int totalItems = 0;
|
|
int completedItems = 0;
|
|
};
|
|
|
|
#endif // COCKATRICE_INTENT_OPEN_SHARED_DECK_H
|