mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-23 10:05: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
ae937e3b60
commit
0fc7023335
25 changed files with 1350 additions and 55 deletions
|
|
@ -1,8 +1,11 @@
|
|||
#include "intent_login.h"
|
||||
|
||||
#include "../../client/settings/cache_settings.h"
|
||||
#include "../widgets/dialogs/dlg_login_prompt.h"
|
||||
#include "libcockatrice/settings/servers_settings.h"
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
IntentGetLoginCredentials::IntentGetLoginCredentials(ContextConnectToServer *_context) : Intent(), context(_context)
|
||||
{
|
||||
}
|
||||
|
|
@ -29,5 +32,27 @@ void IntentGetLoginCredentials::onPreconditionSatisfied()
|
|||
|
||||
void IntentGetLoginCredentials::onPreconditionNotSatisfied()
|
||||
{
|
||||
emitFailed(tr("No saved credentials for this server"));
|
||||
// No credentials saved for the target server: ask the user for them. They
|
||||
// opt into saving them so later links to the same server connect directly.
|
||||
const QString serverText = context->hostname + ":" + context->port;
|
||||
DlgLoginPrompt dialog(serverText);
|
||||
// ApplicationModal: the dialog has no parent (the intent is not a widget),
|
||||
// so WindowModal would not actually block any other window.
|
||||
dialog.setWindowModality(Qt::ApplicationModal);
|
||||
|
||||
if (dialog.exec() != QDialog::Accepted) {
|
||||
emitCancelled();
|
||||
return;
|
||||
}
|
||||
|
||||
context->username = dialog.username();
|
||||
context->password = dialog.password();
|
||||
|
||||
if (dialog.savePassword() && !context->username.isEmpty()) {
|
||||
ServersSettings &servers = SettingsCache::instance().servers();
|
||||
servers.addNewServer(context->hostname, context->hostname, context->port, context->username, context->password,
|
||||
true);
|
||||
}
|
||||
|
||||
emitFinished();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue