Skip to content

Small notification annoyance #148

@TTorell

Description

@TTorell

If we are playing an engine, we get notified by a pop-up window about the result of the game when it's finished.
If we press OK and then for instance choose Mode->Engines... the same notification pops up again, we press OK, do something in the Engine dialog and press OK and the same notification reappears for the third time.

There's already a mechanism in the code to prevent this, the doNotNotifyAboutResult boolean, but it's reset to often.
We only have to reset that boolean to false when we have started playing something again, I think.

So I suggest this fix in ModeMenuController stateChanged()

if(mode == GameModel.MODE_PLAY_WHITE || mode == GameModel.MODE_PLAY_BLACK || 
   mode == GameModel.MODE_PLAYOUT_POSITION) {
     gameModel.doNotNotifyAboutResult = false;
 }

instead of just:
gameModel.doNotNotifyAboutResult = false;

(Maybe it should be a set-method instead of setting a member of another class directly, but the code is full of those anyway.)

It seems to fix the problem and not create any new ones.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions