1268 |
1268 |
1269 #################################################### |
1269 #################################################### |
1270 ## Populate the right side bar |
1270 ## Populate the right side bar |
1271 #################################################### |
1271 #################################################### |
1272 |
1272 |
|
1273 # TODO: add option to add all tools to the left sidebar |
|
1274 # possibly with different order (e.g. debug after VCS) |
1273 self.rightSidebar.addTab( |
1275 self.rightSidebar.addTab( |
1274 self.debugViewer, |
1276 self.debugViewer, |
1275 UI.PixmapCache.getIcon("sbDebugViewer96"), |
1277 UI.PixmapCache.getIcon("sbDebugViewer96"), |
1276 self.tr("Debug-Viewer")) |
1278 self.tr("Debug-Viewer")) |
1277 |
1279 |
1364 self.bottomSidebar.setCurrentIndex(0) |
1366 self.bottomSidebar.setCurrentIndex(0) |
1365 |
1367 |
1366 # create the central widget |
1368 # create the central widget |
1367 logging.debug("Creating central widget...") |
1369 logging.debug("Creating central widget...") |
1368 cw = self.centralWidget() # save the current central widget |
1370 cw = self.centralWidget() # save the current central widget |
1369 self.leftSplitter = QSplitter(Qt.Orientation.Horizontal) |
1371 self.horizontalSplitter = QSplitter(Qt.Orientation.Horizontal) |
1370 self.rightSplitter = QSplitter(Qt.Orientation.Horizontal) |
1372 self.horizontalSplitter.setChildrenCollapsible(False) |
1371 self.verticalSplitter = QSplitter(Qt.Orientation.Vertical) |
1373 self.verticalSplitter = QSplitter(Qt.Orientation.Vertical) |
|
1374 self.verticalSplitter.setChildrenCollapsible(False) |
1372 self.verticalSplitter.addWidget(cw) |
1375 self.verticalSplitter.addWidget(cw) |
1373 self.verticalSplitter.addWidget(self.bottomSidebar) |
1376 self.verticalSplitter.addWidget(self.bottomSidebar) |
1374 self.rightSplitter.addWidget(self.verticalSplitter) |
1377 self.horizontalSplitter.addWidget(self.leftSidebar) |
1375 self.rightSplitter.addWidget(self.rightSidebar) |
1378 self.horizontalSplitter.addWidget(self.verticalSplitter) |
1376 self.leftSplitter.addWidget(self.leftSidebar) |
1379 self.horizontalSplitter.addWidget(self.rightSidebar) |
1377 self.leftSplitter.addWidget(self.rightSplitter) |
1380 self.setCentralWidget(self.horizontalSplitter) |
1378 self.setCentralWidget(self.leftSplitter) |
|
1379 |
|
1380 self.leftSidebar.setSplitter(self.leftSplitter) |
|
1381 self.rightSidebar.setSplitter(self.rightSplitter) |
|
1382 self.bottomSidebar.setSplitter(self.verticalSplitter) |
|
1383 |
1381 |
1384 def addSideWidget(self, side, widget, icon, label): |
1382 def addSideWidget(self, side, widget, icon, label): |
1385 """ |
1383 """ |
1386 Public method to add a widget to the sides. |
1384 Public method to add a widget to the sides. |
1387 |
1385 |
3450 if self.browser is not None: |
3448 if self.browser is not None: |
3451 self.__menus["subwindow"].addAction(self.browserActivateAct) |
3449 self.__menus["subwindow"].addAction(self.browserActivateAct) |
3452 if self.symbolsViewer is not None: |
3450 if self.symbolsViewer is not None: |
3453 self.__menus["subwindow"].addAction(self.symbolsViewerActivateAct) |
3451 self.__menus["subwindow"].addAction(self.symbolsViewerActivateAct) |
3454 |
3452 |
3455 # bottom side |
|
3456 self.__menus["subwindow"].addSection(self.tr("Bottom Side")) |
|
3457 if self.__shellPosition == "bottom": |
|
3458 self.__menus["subwindow"].addAction(self.shellActivateAct) |
|
3459 self.__menus["subwindow"].addAction(self.taskViewerActivateAct) |
|
3460 self.__menus["subwindow"].addAction(self.logViewerActivateAct) |
|
3461 if self.numbersViewer is not None: |
|
3462 self.__menus["subwindow"].addAction(self.numbersViewerActivateAct) |
|
3463 |
|
3464 # right side |
3453 # right side |
3465 self.__menus["subwindow"].addSection(self.tr("Right Side")) |
3454 self.__menus["subwindow"].addSection(self.tr("Right Side")) |
3466 if self.__shellPosition == "right": |
3455 if self.__shellPosition == "right": |
3467 self.__menus["subwindow"].addAction(self.shellActivateAct) |
3456 self.__menus["subwindow"].addAction(self.shellActivateAct) |
3468 self.__menus["subwindow"].addAction(self.debugViewerActivateAct) |
3457 self.__menus["subwindow"].addAction(self.debugViewerActivateAct) |
3484 if self.irc is not None: |
3473 if self.irc is not None: |
3485 self.__menus["subwindow"].addAction(self.ircActivateAct) |
3474 self.__menus["subwindow"].addAction(self.ircActivateAct) |
3486 if self.microPythonWidget is not None: |
3475 if self.microPythonWidget is not None: |
3487 self.__menus["subwindow"].addAction( |
3476 self.__menus["subwindow"].addAction( |
3488 self.microPythonWidgetActivateAct) |
3477 self.microPythonWidgetActivateAct) |
|
3478 |
|
3479 # bottom side |
|
3480 self.__menus["subwindow"].addSection(self.tr("Bottom Side")) |
|
3481 if self.__shellPosition == "bottom": |
|
3482 self.__menus["subwindow"].addAction(self.shellActivateAct) |
|
3483 self.__menus["subwindow"].addAction(self.taskViewerActivateAct) |
|
3484 self.__menus["subwindow"].addAction(self.logViewerActivateAct) |
|
3485 if self.numbersViewer is not None: |
|
3486 self.__menus["subwindow"].addAction(self.numbersViewerActivateAct) |
3489 |
3487 |
3490 # plug-in provided windows |
3488 # plug-in provided windows |
3491 self.__menus["subwindow"].addSection(self.tr("Plug-ins")) |
3489 self.__menus["subwindow"].addSection(self.tr("Plug-ins")) |
3492 |
3490 |
3493 ############################################################## |
3491 ############################################################## |
4632 # step 1: save the window geometries of the active profile |
4630 # step 1: save the window geometries of the active profile |
4633 if self.__layoutType in ["Toolboxes", "Sidebars"]: |
4631 if self.__layoutType in ["Toolboxes", "Sidebars"]: |
4634 state = self.saveState() |
4632 state = self.saveState() |
4635 self.profiles[self.currentProfile][0] = state |
4633 self.profiles[self.currentProfile][0] = state |
4636 if self.__layoutType == "Sidebars": |
4634 if self.__layoutType == "Sidebars": |
4637 state = self.leftSplitter.saveState() |
4635 state = self.horizontalSplitter.saveState() |
4638 self.profiles[self.currentProfile][2][0] = state |
4636 self.profiles[self.currentProfile][2][0] = state |
4639 state = self.verticalSplitter.saveState() |
4637 state = self.verticalSplitter.saveState() |
4640 self.profiles[self.currentProfile][2][1] = state |
4638 self.profiles[self.currentProfile][2][1] = state |
4641 state = self.rightSplitter.saveState() |
|
4642 self.profiles[self.currentProfile][2][2] = state |
|
4643 |
4639 |
4644 state = self.leftSidebar.saveState() |
4640 state = self.leftSidebar.saveState() |
|
4641 self.profiles[self.currentProfile][2][2] = state |
|
4642 state = self.bottomSidebar.saveState() |
4645 self.profiles[self.currentProfile][2][3] = state |
4643 self.profiles[self.currentProfile][2][3] = state |
4646 state = self.bottomSidebar.saveState() |
4644 state = self.rightSidebar.saveState() |
4647 self.profiles[self.currentProfile][2][4] = state |
4645 self.profiles[self.currentProfile][2][4] = state |
4648 state = self.rightSidebar.saveState() |
|
4649 self.profiles[self.currentProfile][2][5] = state |
|
4650 |
4646 |
4651 # step 2: save the visibility of the windows of the active profile |
4647 # step 2: save the visibility of the windows of the active profile |
4652 if self.__layoutType == "Toolboxes": |
4648 if self.__layoutType == "Toolboxes": |
4653 self.profiles[self.currentProfile][1][0] = ( |
4649 self.profiles[self.currentProfile][1][0] = ( |
4654 self.lToolboxDock.isVisible() |
4650 self.lToolboxDock.isVisible() |
4689 if not state.isEmpty(): |
4685 if not state.isEmpty(): |
4690 self.restoreState(state) |
4686 self.restoreState(state) |
4691 if self.__layoutType == "Sidebars": |
4687 if self.__layoutType == "Sidebars": |
4692 state = self.profiles[name][2][0] |
4688 state = self.profiles[name][2][0] |
4693 if not state.isEmpty(): |
4689 if not state.isEmpty(): |
4694 self.leftSplitter.restoreState(state) |
4690 self.horizontalSplitter.restoreState(state) |
4695 state = self.profiles[name][2][1] |
4691 state = self.profiles[name][2][1] |
4696 if not state.isEmpty(): |
4692 if not state.isEmpty(): |
4697 self.verticalSplitter.restoreState(state) |
4693 self.verticalSplitter.restoreState(state) |
|
4694 |
4698 state = self.profiles[name][2][2] |
4695 state = self.profiles[name][2][2] |
4699 if not state.isEmpty(): |
4696 if state: |
4700 self.rightSplitter.restoreState(state) |
4697 self.leftSidebar.restoreState(state) |
4701 |
|
4702 state = self.profiles[name][2][3] |
4698 state = self.profiles[name][2][3] |
4703 if state: |
4699 if state: |
4704 self.leftSidebar.restoreState(state) |
4700 self.bottomSidebar.restoreState(state) |
4705 state = self.profiles[name][2][4] |
4701 state = self.profiles[name][2][4] |
4706 if state: |
|
4707 self.bottomSidebar.restoreState(state) |
|
4708 state = self.profiles[name][2][5] |
|
4709 if state: |
4702 if state: |
4710 self.rightSidebar.restoreState(state) |
4703 self.rightSidebar.restoreState(state) |
4711 |
4704 |
4712 if self.__layoutType == "Toolboxes": |
4705 if self.__layoutType == "Toolboxes": |
4713 # set the corner usages |
4706 # set the corner usages |