code: def removeMainWindow(self, mainWindow):
          
          logger.debug("removeMainWindow called")
  
          self.windowActionGroup.removeAction(mainWindow.activateWindowAction)
          self.repopulateAllWindowMenus()
  
          self.mainWindows.remove(mainWindow)
docs: Removes the mainWindow from the list of windows. Saves the settings