mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 01:25:10 -07:00
[DeckShare] Open shared decks via links with a gated preview flow
- 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
This commit is contained in:
parent
812f2a88ea
commit
7faa2fca13
25 changed files with 1350 additions and 55 deletions
59
cockatrice/src/interface/intents/intent_open_shared_deck.h
Normal file
59
cockatrice/src/interface/intents/intent_open_shared_deck.h
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue