mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-21 09:05:10 -07:00
[DeckShare] Resolve the stable server client in the deck editor gate
actShareDeck went through tabSupervisor->getClient(), which hands back a LocalClient while an offline game is running. LocalClient never sets its status, so a logged-in user could not share from the deck editor during a local game, and got a misleading "You must be connected" message. Expose the supervisor's stable remote client and use it for the gate and the dialog, matching the other share tabs.
This commit is contained in:
parent
64335328c3
commit
c4ffc789cd
2 changed files with 7 additions and 2 deletions
|
|
@ -388,7 +388,8 @@ bool AbstractTabDeckEditor::actSaveDeckAs()
|
|||
*/
|
||||
void AbstractTabDeckEditor::actShareDeck()
|
||||
{
|
||||
if (tabSupervisor->getClient()->getStatus() != StatusLoggedIn) {
|
||||
AbstractClient *client = tabSupervisor->getServerClient();
|
||||
if (client->getStatus() != StatusLoggedIn) {
|
||||
QMessageBox::information(this, tr("Share deck"), tr("You must be connected to the server to share a deck."));
|
||||
return;
|
||||
}
|
||||
|
|
@ -399,7 +400,7 @@ void AbstractTabDeckEditor::actShareDeck()
|
|||
return;
|
||||
}
|
||||
|
||||
DlgShareDeck shareDialog(tabSupervisor->getClient(), deck, this);
|
||||
DlgShareDeck shareDialog(client, deck, this);
|
||||
shareDialog.exec();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -152,6 +152,10 @@ public:
|
|||
return userInfo;
|
||||
}
|
||||
[[nodiscard]] AbstractClient *getClient() const;
|
||||
[[nodiscard]] AbstractClient *getServerClient() const
|
||||
{
|
||||
return client;
|
||||
}
|
||||
[[nodiscard]] UserListManager *getUserListManager() const
|
||||
{
|
||||
return userListManager;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue