Merge branch 'v4.7.x' into master
[xboard.git] / winboard / wedittags.c
index 2ec157d..b3cf334 100644 (file)
@@ -1,7 +1,7 @@
 /*\r
  * wedittags.c -- EditTags window for WinBoard\r
  *\r
- * Copyright 1995, 2009, 2010, 2011 Free Software Foundation, Inc.\r
+ * Copyright 1995, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.\r
  *\r
  * Enhancements Copyright 2005 Alessandro Scotti\r
  *\r
@@ -118,6 +118,7 @@ EditTagsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   case WM_COMMAND:\r
     switch (LOWORD(wParam)) {\r
     case IDOK:\r
+    case OPT_TagsSave:\r
       if (canEditTags) {\r
        char *p, *q;\r
        /* Read changed options from the dialog box */\r
@@ -133,13 +134,13 @@ EditTagsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
        }\r
        *p = NULLCHAR; err = 0;\r
         if(resPtr) *resPtr = strdup(str); else\r
-       if(bookUp) SaveToBook(str); else\r
+       if(bookUp) SaveToBook(str), DisplayBook(currentMove); else\r
        err = ReplaceTags(str, &gameInfo);\r
        if (err) DisplayError(_("Error replacing tags."), err);\r
 \r
        free(str);\r
       }\r
-      TagsPopDown();\r
+      if(LOWORD(wParam) == IDOK) TagsPopDown();\r
       return TRUE;\r
       \r
     case IDCANCEL:\r
@@ -211,6 +212,7 @@ VOID EitherTagsPopUp(char *tags, char *msg, BOOLEAN edit)
   if (editTagsDialog) {\r
     SendMessage(editTagsDialog, WM_INITDIALOG, 0, 0);\r
     ShowWindow(editTagsDialog, SW_SHOW);\r
+    if(bookUp) SetFocus(hwndMain);\r
   } else {\r
     lpProc = MakeProcInstance((FARPROC)EditTagsDialog, hInst);\r
     CreateDialog(hInst, MAKEINTRESOURCE(DLG_EditTags),\r