X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwedittags.c;h=4918edc5d187fb566edfe92e00ab773ae22bc5de;hb=82b4e616032702ec6e09b7b07d14a2275196f574;hp=22a23ab860bd81da7ad56d363aacf20d80847507;hpb=b382d988c6f886f3a49483df9e3e36de0b6b0824;p=xboard.git diff --git a/winboard/wedittags.c b/winboard/wedittags.c index 22a23ab..4918edc 100644 --- a/winboard/wedittags.c +++ b/winboard/wedittags.c @@ -73,6 +73,10 @@ EditTagsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) EnableWindow(GetDlgItem(hDlg, OPT_TagsCancel), canEditTags); EnableWindow(GetDlgItem(hDlg, OPT_EditTags), !canEditTags); SendMessage(hwndText, EM_SETREADONLY, !canEditTags, 0); + if (bookUp) { + SetWindowText(hDlg, _("Edit Book")); + SetFocus(hwndText); + } else if (canEditTags) { SetWindowText(hDlg, _("Edit Tags")); SetFocus(hwndText); @@ -127,8 +131,9 @@ EditTagsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) else *p++ = *q++; } - *p = NULLCHAR; - if(resPtr) *resPtr = strdup(str), err = 0; else + *p = NULLCHAR; err = 0; + if(resPtr) *resPtr = strdup(str); else + if(bookUp) SaveToBook(str); else err = ReplaceTags(str, &gameInfo); if (err) DisplayError(_("Error replacing tags."), err); @@ -173,7 +178,7 @@ VOID TagsPopDown(void) { if (editTagsDialog) ShowWindow(editTagsDialog, SW_HIDE); CheckMenuItem(GetMenu(hwndMain), IDM_Tags, MF_UNCHECKED); - editTagsUp = FALSE; + editTagsUp = bookUp = FALSE; } @@ -206,6 +211,7 @@ VOID EitherTagsPopUp(char *tags, char *msg, BOOLEAN edit) if (editTagsDialog) { SendMessage(editTagsDialog, WM_INITDIALOG, 0, 0); ShowWindow(editTagsDialog, SW_SHOW); + if(bookUp) SetFocus(hwndMain); } else { lpProc = MakeProcInstance((FARPROC)EditTagsDialog, hInst); CreateDialog(hInst, MAKEINTRESOURCE(DLG_EditTags), @@ -230,7 +236,7 @@ VOID EditTagsPopUp(char *tags, char **dest) VOID EditTagsProc() { - if (editTagsUp) { + if (editTagsUp && !bookUp) { TagsPopDown(); } else { EditTagsEvent();