Add Save Selected Games menu item
[xboard.git] / ngamelist.c
index cf937ac..43de988 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * ngamelist.c -- Game list window, Xt-independent front-end code for XBoard
  *
- * Copyright 1995, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
+ * Copyright 1995, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
  * ------------------------------------------------------------------------
  *
  * GNU XBoard is free software: you can redistribute it and/or modify
@@ -151,7 +151,7 @@ static int
 GameListCreate (char *name)
 {
     int new;
-    if(new = GenericPopUp(gamesOptions, name, GameListDlg, BoardWindow, NONMODAL, 1))
+    if(new = GenericPopUp(gamesOptions, name, GameListDlg, BoardWindow, NONMODAL, appData.topLevel))
        AddHandler(&gamesOptions[1], GameListDlg, 4),
        AddHandler(&gamesOptions[0], GameListDlg, 5);
     FocusOnWidget(&gamesOptions[0], GameListDlg);
@@ -242,6 +242,7 @@ GameListPopUp (FILE *fp, char *filename)
     page = 0;
     GameListReplace(0); // [HGM] filter: code put in separate routine, and also called to set title
     MarkMenu("View.GameList", GameListDlg);
+    EnableNamedMenuItem("File.SaveSelected", TRUE);
 }
 
 FILE *
@@ -254,6 +255,7 @@ void
 GameListDestroy ()
 {
     if (glc == NULL) return;
+    EnableNamedMenuItem("File.SaveSelected", FALSE);
     PopDown(GameListDlg);
     if (glc->strings != NULL) {
        char **st;
@@ -278,7 +280,7 @@ ShowGameListProc ()
        PopDown(GameListDlg);
        return;
     }
-    GenericPopUp(NULL, NULL, GameListDlg, BoardWindow, NONMODAL, 1); // first two args ignored when shell exists!
+    GenericPopUp(NULL, NULL, GameListDlg, BoardWindow, NONMODAL, appData.topLevel); // first two args ignored when shell exists!
     MarkMenu("View.GameList", GameListDlg);
     GameListHighlight(lastLoadGameNumber);
 }