def __init__(self, workspaceClass, *args, **kwargs):
MainWindow.__init__(self, *args, **kwargs)<EOL>self._workspace_cls = workspaceClass<EOL>self.setCentralWidget(QtWidgets.QStackedWidget())<EOL>m = self.menuBar()<EOL>w = m.menu_workspace = QtWidgets.QMenu('<STR_LIT>')<EOL>m.insertMenuBefore(m.menu_help, w)<EOL>action_add = QtWidgets.QAction('<STR_LIT>', w)<EOL>action_add.triggered.connect(self.addWorkspace)<EOL>action_add.setShortcuts(<EOL>QtGui.QKeySequence(<EOL>QtCore.Qt.CTRL +<EOL>QtCore.Qt.Key_W))<EOL>w.addAction(action_add)<EOL>action_close = QtWidgets.QAction('<STR_LIT>', w)<EOL>action_close.triggered.connect(self.closeCurrentWorkspace)<EOL>action_close.setShortcuts(<EOL>QtGui.QKeySequence(<EOL>QtCore.Qt.CTRL +<EOL>QtCore.Qt.Key_Q))<EOL>w.addAction(action_close)<EOL>action_next = QtWidgets.QAction('<STR_LIT>', w)<EOL>action_next.triggered.connect(self.showNextWorkspace)<EOL>action_next.setShortcuts(<EOL>QtGui.QKeySequence(<EOL>QtCore.Qt.CTRL +<EOL>QtCore.Qt.Key_PageUp))<EOL>w.addAction(action_next)<EOL>action_previous = QtWidgets.QAction('<STR_LIT>', w)<EOL>action_previous.triggered.connect(self.showPreviousWorkspace)<EOL>action_previous.setShortcuts(<EOL>QtGui.QKeySequence(<EOL>QtCore.Qt.CTRL +<EOL>QtCore.Qt.Key_PageDown))<EOL>w.addAction(action_previous)<EOL>self._menu_workspaces = QtWidgets.QMenu('<STR_LIT>', w)<EOL>self._menu_workspaces.aboutToShow.connect(self._listWorkspacesInMenu)<EOL>w.addMenu(self._menu_workspaces)<EOL>sc = self.menuBar().shortcutsWidget<EOL>sc.addShortcut('<STR_LIT>', '<STR_LIT>')<EOL>sc.addShortcut('<STR_LIT>', '<STR_LIT>')<EOL>sc.addShortcut('<STR_LIT>', '<STR_LIT>')<EOL>sc.addShortcut('<STR_LIT>', '<STR_LIT>')<EOL>
workspaceClass needs to have the following methods:

* def setActive -> called when workspace is activated
* def setInactive -> called when workspace is deactivated