From: H.G. Muller Date: Wed, 24 Mar 2010 12:14:54 +0000 (+0100) Subject: Fix handling username change during game X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=0855b99b2a83b0e26b9ccb500ba9b9e15cffdb68 Fix handling username change during game The title bar and gameInfo (going into the PGN) were not adapted when the username was changed through the menu, so that the change became only effective on the next game. Requires SetGameInfo to be called from the front-end, and thus a prototype for it in backend.c. --- diff --git a/backend.h b/backend.h index 2b2a2a7..c35d2bc 100644 --- a/backend.h +++ b/backend.h @@ -207,6 +207,7 @@ void NewSettingEvent P((int option, char *command, int value)); void DoEcho P((void)); void DontEcho P((void)); void TidyProgramName P((char *prog, char *host, char *buf)); +void SetGameInfo P((void)); void AskQuestionEvent P((char *title, char *question, char *replyPrefix, char *which)); Boolean ParseOneMove P((char *move, int moveNum, diff --git a/winboard/winboard.c b/winboard/winboard.c index e7e4ca7..473bc5c 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -6126,6 +6126,12 @@ TypeInNameDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) GetDlgItemText(hDlg, OPT_Name, move, sizeof(move)); appData.userName = strdup(move); SetUserLogo(); + SetGameInfo(); + if(gameMode == MachinePlaysWhite || gameMode == MachinePlaysBlack) { + sprintf(move, "%s vs. %s", gameInfo.white, gameInfo.black); + DisplayTitle(move); + } + EndDialog(hDlg, TRUE); return TRUE;