Bug 12433 - End game confirmation dialogs should lead to gameoverDialog
: End game confirmation dialogs should lead to gameoverDialog
Status: NEW
Product: Miniature
General
: master
: All All
: High normal (vote)
: ---
Assigned To: unassigned
: general
:
:
:
: 12424
  Show dependency tree
 
Reported: 2011-09-20 21:05 UTC by Quim Gil
Modified: 2011-12-09 08:27 UTC (History)
0 users (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Quim Gil (reporter) 2011-09-20 21:05:34 UTC
SOFTWARE VERSION: 
master

EXACT STEPS LEADING TO PROBLEM: 
1. Start a game
2. Make a couple of moves.
3. Resign

EXPECTED OUTCOME: 

After confirming with "Yes" the gameoverDialog appears with result "You
lose...", reason "You resigned" and the rating adjustment.

ACTUAL OUTCOME: 

Pressing "Yes" jumps back to SeekGame.

REPRODUCIBILITY: 
always

OTHER COMMENTS: 

Removing "pageStack.pop()" from resignDialog and similar dialogs is the easy
part. The depeer problem seems to be in miniature.cc:

void Miniature::resign()
{
    Q_D(Miniature);

    if (Game *g = d->game.data()) {
        Command::GameEnded gec(TargetEngine, g->id(),
                               ::Game::ResultUnknown,
::Game::ReasonSurrendered,
                               d->local_side.id().toLatin1());
        sendCommand(&gec);

        d->message_log.removeAll();
    }
}

- No GameEnded signal emmitted to frontend? At least no signal is retrieving
the gameoverDialog.

- Why "ResultUnknown"? After the resignation there is a winner, either white or
black.

- Also note that we are not using ReasonSurrendered currently in OnlineBoard,
we need to add it there.

We need to find the right structure for this resign() and apply it also in
draw, adjourn & abort as soon as we implement them as options in OnlineBoard
UI.