X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwedittags.c;h=2ec157d1dbb14ec10f92a2fe390c5a71a09724ee;hb=6445f59125a3dff0cbb9426a0c0bd300a31075d1;hp=22a23ab860bd81da7ad56d363aacf20d80847507;hpb=7fb59a9a90f59e4e94ff49e2eb55ba7c24b2ef7b;p=xboard.git diff --git a/winboard/wedittags.c b/winboard/wedittags.c index 22a23ab..2ec157d 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; } @@ -230,7 +235,7 @@ VOID EditTagsPopUp(char *tags, char **dest) VOID EditTagsProc() { - if (editTagsUp) { + if (editTagsUp && !bookUp) { TagsPopDown(); } else { EditTagsEvent();