code: def addNewMainWindow(self, settings=None, inspectorFullName=None):
          
          mainWindow = MainWindow(self)
          self.mainWindows.append(mainWindow)
  
          self.windowActionGroup.addAction(mainWindow.activateWindowAction)
          self.repopulateAllWindowMenus()
  
          if settings:
              mainWindow.readViewSettings(settings)
  
          if inspectorFullName:
              inspectorId = nameToIdentifier(inspectorFullName)
              mainWindow.setInspectorById(inspectorId)
  
          if mainWindow.inspectorRegItem: # can be None at start
              inspectorId = mainWindow.inspectorRegItem.identifier
              mainWindow.getInspectorActionById(inspectorId).setChecked(True)
              logger.info("Created new window with inspector: {}"
                          .format(mainWindow.inspectorRegItem.fullName))
          else:
              logger.info("Created new window without inspector")
  
          mainWindow.drawInspectorContents(reason=UpdateReason.NEW_MAIN_WINDOW)
          mainWindow.show()
  
          if sys.platform.startswith('darwin'):
              # Calling raise before the QApplication.exec_ only shows the last window
              # that was added. Therefore we also call activeWindow. However, this may not
              # always be desirable. TODO: make optional?
              mainWindow.raise_()
              pass
  
          return mainWindow
docs: Creates and shows a new MainWindow.
  
              If inspectorFullName is set, it will set the identifier from that name.
              If the inspector identifier is not found in the registry, a KeyError is raised.