From 0345db41a6f6e2fb27dbcc1b4e0cfbf88066f098 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 4 Aug 2011 13:22:55 +0200 Subject: [PATCH] Print progress during load / selection of game The title bar of themain window is used to display a running count of the number of games loaded / searched. --- gamelist.c | 8 ++++++-- winboard/wgamelist.c | 6 ++++++ xgamelist.c | 6 ++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gamelist.c b/gamelist.c index 4e57cb3..d8d0a46 100644 --- a/gamelist.c +++ b/gamelist.c @@ -214,7 +214,7 @@ int GameListBuild(f) ListGame *currentListGame = NULL; int error; int offset; - char lastComment[MSG_SIZ]; + char lastComment[MSG_SIZ], buf[MSG_SIZ]; GameListFree(&gameList); yynewfile(f); @@ -316,10 +316,13 @@ int GameListBuild(f) default: break; } + if(gameNumber % 1000 == 0) { + snprintf(buf, MSG_SIZ,"Reading game file (%d)", gameNumber); + DisplayTitle(buf); + } } while (cm != (ChessMove) 0); - if (appData.debugMode) { for (currentListGame = (ListGame *) gameList.head; currentListGame->node.succ; @@ -333,6 +336,7 @@ int GameListBuild(f) rewind(f); yyskipmoves = FALSE; + DisplayTitle("WinBoard"); return 0; } diff --git a/winboard/wgamelist.c b/winboard/wgamelist.c index c5a25f5..9d15fa1 100644 --- a/winboard/wgamelist.c +++ b/winboard/wgamelist.c @@ -91,6 +91,11 @@ static int GameListToListBox( HWND hDlg, BOOL boReset, char * pszFilter, struct BOOL skip = FALSE; int pos = -1; + if(nItem % 2000 == 0) { + snprintf(buf, MSG_SIZ, _("Scanning through games (%d)"), nItem); + SetWindowText(hwndMain, buf); + } + if( hasFilter ) { st = GameListLine(lg->number, &lg->gameInfo); if( !SearchPattern( st, pszFilter) ) skip = TRUE; @@ -123,6 +128,7 @@ static int GameListToListBox( HWND hDlg, BOOL boReset, char * pszFilter, struct } SendDlgItemMessage(hDlg, OPT_GameListText, LB_SETCURSEL, 0, 0); + SetWindowText(hwndMain, "WinBoard"); return count; } diff --git a/xgamelist.c b/xgamelist.c index d68c00b..95e9164 100644 --- a/xgamelist.c +++ b/xgamelist.c @@ -341,9 +341,15 @@ GameListPrepare(int byPos) *st++ = line; // [HGM] filter: make adding line conditional listLength++; } + if(listLength % 2000 == 0) { + char buf[MSG_SIZ]; + snprintf(buf, MSG_SIZ, _("Reading game file (%d)"), listLength); + DisplayTitle(buf); + } lg->position = pos; lg = (ListGame *) lg->node.succ; } + DisplayTitle("WinBoard"); *st = NULL; return listLength; } -- 1.7.0.4