263 self.multiProject = MultiProject(self.project, self) |
263 self.multiProject = MultiProject(self.project, self) |
264 |
264 |
265 # Generate the debug server object |
265 # Generate the debug server object |
266 from Debugger.DebugServer import DebugServer |
266 from Debugger.DebugServer import DebugServer |
267 debugServer = DebugServer(self.__originalPathString, |
267 debugServer = DebugServer(self.__originalPathString, |
268 project=self.project) |
268 project=self.project, parent=self) |
269 |
269 |
270 # Create the background service object |
270 # Create the background service object |
271 from Utilities.BackgroundService import BackgroundService |
271 from Utilities.BackgroundService import BackgroundService |
272 self.backgroundService = BackgroundService() |
272 self.backgroundService = BackgroundService(self) |
273 |
273 |
274 splash.showMessage(self.tr("Initializing Plugin Manager...")) |
274 splash.showMessage(self.tr("Initializing Plugin Manager...")) |
275 |
275 |
276 # Initialize the Plugin Manager (Plugins are initialized later |
276 # Initialize the Plugin Manager (Plugins are initialized later |
277 from PluginManager.PluginManager import PluginManager |
277 from PluginManager.PluginManager import PluginManager |
769 layout.setSpacing(1) |
769 layout.setSpacing(1) |
770 layout.addWidget(self.viewmanager.mainWidget()) |
770 layout.addWidget(self.viewmanager.mainWidget()) |
771 layout.addWidget(self.viewmanager.searchWidget()) |
771 layout.addWidget(self.viewmanager.searchWidget()) |
772 layout.addWidget(self.viewmanager.replaceWidget()) |
772 layout.addWidget(self.viewmanager.replaceWidget()) |
773 self.viewmanager.mainWidget().setSizePolicy( |
773 self.viewmanager.mainWidget().setSizePolicy( |
774 QSizePolicy.Preferred, QSizePolicy.Expanding) |
774 QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Expanding) |
775 leftWidget.setLayout(layout) |
775 leftWidget.setLayout(layout) |
776 self.viewmanager.searchWidget().hide() |
776 self.viewmanager.searchWidget().hide() |
777 self.viewmanager.replaceWidget().hide() |
777 self.viewmanager.replaceWidget().hide() |
778 |
778 |
779 splitter = QSplitter(Qt.Horizontal) |
779 splitter = QSplitter(Qt.Orientation.Horizontal) |
780 splitter.addWidget(leftWidget) |
780 splitter.addWidget(leftWidget) |
781 self.setCentralWidget(splitter) |
781 self.setCentralWidget(splitter) |
782 |
782 |
783 # Create previewer |
783 # Create previewer |
784 logging.debug("Creating Previewer...") |
784 logging.debug("Creating Previewer...") |
824 logging.debug("Creating Toolboxes Layout...") |
824 logging.debug("Creating Toolboxes Layout...") |
825 |
825 |
826 # Create the left toolbox |
826 # Create the left toolbox |
827 self.lToolboxDock = self.__createDockWindow("lToolboxDock") |
827 self.lToolboxDock = self.__createDockWindow("lToolboxDock") |
828 self.lToolbox = E5VerticalToolBox(self.lToolboxDock) |
828 self.lToolbox = E5VerticalToolBox(self.lToolboxDock) |
829 self.__setupDockWindow(self.lToolboxDock, Qt.LeftDockWidgetArea, |
829 self.__setupDockWindow(self.lToolboxDock, |
830 self.lToolbox, self.tr("Left Toolbox")) |
830 Qt.DockWidgetArea.LeftDockWidgetArea, |
|
831 self.lToolbox, |
|
832 self.tr("Left Toolbox")) |
831 |
833 |
832 # Create the horizontal toolbox |
834 # Create the horizontal toolbox |
833 self.hToolboxDock = self.__createDockWindow("hToolboxDock") |
835 self.hToolboxDock = self.__createDockWindow("hToolboxDock") |
834 self.hToolbox = E5HorizontalToolBox(self.hToolboxDock) |
836 self.hToolbox = E5HorizontalToolBox(self.hToolboxDock) |
835 self.__setupDockWindow(self.hToolboxDock, Qt.BottomDockWidgetArea, |
837 self.__setupDockWindow(self.hToolboxDock, |
|
838 Qt.DockWidgetArea.BottomDockWidgetArea, |
836 self.hToolbox, |
839 self.hToolbox, |
837 self.tr("Horizontal Toolbox")) |
840 self.tr("Horizontal Toolbox")) |
838 |
841 |
839 # Create the right toolbox |
842 # Create the right toolbox |
840 self.rToolboxDock = self.__createDockWindow("rToolboxDock") |
843 self.rToolboxDock = self.__createDockWindow("rToolboxDock") |
841 self.rToolbox = E5VerticalToolBox(self.rToolboxDock) |
844 self.rToolbox = E5VerticalToolBox(self.rToolboxDock) |
842 self.__setupDockWindow(self.rToolboxDock, Qt.RightDockWidgetArea, |
845 self.__setupDockWindow(self.rToolboxDock, |
843 self.rToolbox, self.tr("Right Toolbox")) |
846 Qt.DockWidgetArea.RightDockWidgetArea, |
|
847 self.rToolbox, |
|
848 self.tr("Right Toolbox")) |
844 |
849 |
845 #################################################### |
850 #################################################### |
846 ## Populate the left toolbox |
851 ## Populate the left toolbox |
847 #################################################### |
852 #################################################### |
848 |
853 |
1213 self.bottomSidebar.setCurrentIndex(0) |
1218 self.bottomSidebar.setCurrentIndex(0) |
1214 |
1219 |
1215 # create the central widget |
1220 # create the central widget |
1216 logging.debug("Creating central widget...") |
1221 logging.debug("Creating central widget...") |
1217 cw = self.centralWidget() # save the current central widget |
1222 cw = self.centralWidget() # save the current central widget |
1218 self.leftSplitter = QSplitter(Qt.Horizontal) |
1223 self.leftSplitter = QSplitter(Qt.Orientation.Horizontal) |
1219 self.rightSplitter = QSplitter(Qt.Horizontal) |
1224 self.rightSplitter = QSplitter(Qt.Orientation.Horizontal) |
1220 self.verticalSplitter = QSplitter(Qt.Vertical) |
1225 self.verticalSplitter = QSplitter(Qt.Orientation.Vertical) |
1221 self.verticalSplitter.addWidget(cw) |
1226 self.verticalSplitter.addWidget(cw) |
1222 self.verticalSplitter.addWidget(self.bottomSidebar) |
1227 self.verticalSplitter.addWidget(self.bottomSidebar) |
1223 self.rightSplitter.addWidget(self.verticalSplitter) |
1228 self.rightSplitter.addWidget(self.verticalSplitter) |
1224 self.rightSplitter.addWidget(self.rightSidebar) |
1229 self.rightSplitter.addWidget(self.rightSidebar) |
1225 self.leftSplitter.addWidget(self.leftSidebar) |
1230 self.leftSplitter.addWidget(self.leftSidebar) |
1558 @return the generated dock window (QDockWindow) |
1563 @return the generated dock window (QDockWindow) |
1559 """ |
1564 """ |
1560 dock = QDockWidget() |
1565 dock = QDockWidget() |
1561 dock.setObjectName(name) |
1566 dock.setObjectName(name) |
1562 dock.setFeatures( |
1567 dock.setFeatures( |
1563 QDockWidget.DockWidgetFeatures(QDockWidget.AllDockWidgetFeatures)) |
1568 QDockWidget.DockWidgetFeatures( |
|
1569 QDockWidget.DockWidgetFeature.DockWidgetClosable | |
|
1570 QDockWidget.DockWidgetFeature.DockWidgetMovable | |
|
1571 QDockWidget.DockWidgetFeature.DockWidgetFloatable |
|
1572 ) |
|
1573 ) |
1564 return dock |
1574 return dock |
1565 |
1575 |
1566 def __setupDockWindow(self, dock, where, widget, caption): |
1576 def __setupDockWindow(self, dock, where, widget, caption): |
1567 """ |
1577 """ |
1568 Private method to configure the dock window created with |
1578 Private method to configure the dock window created with |
1640 """<p>This quits the IDE. Any unsaved changes may be saved""" |
1650 """<p>This quits the IDE. Any unsaved changes may be saved""" |
1641 """ first. Any Python program being debugged will be stopped""" |
1651 """ first. Any Python program being debugged will be stopped""" |
1642 """ and the preferences will be written to disc.</p>""" |
1652 """ and the preferences will be written to disc.</p>""" |
1643 )) |
1653 )) |
1644 self.exitAct.triggered.connect(self.__quit) |
1654 self.exitAct.triggered.connect(self.__quit) |
1645 self.exitAct.setMenuRole(QAction.QuitRole) |
1655 self.exitAct.setMenuRole(QAction.MenuRole.QuitRole) |
1646 self.actions.append(self.exitAct) |
1656 self.actions.append(self.exitAct) |
1647 |
1657 |
1648 self.restartAct = E5Action( |
1658 self.restartAct = E5Action( |
1649 self.tr('Restart'), |
1659 self.tr('Restart'), |
1650 UI.PixmapCache.getIcon("restart"), |
1660 UI.PixmapCache.getIcon("restart"), |
2524 """<b>Preferences</b>""" |
2534 """<b>Preferences</b>""" |
2525 """<p>Set the configuration items of the application""" |
2535 """<p>Set the configuration items of the application""" |
2526 """ with your prefered values.</p>""" |
2536 """ with your prefered values.</p>""" |
2527 )) |
2537 )) |
2528 self.prefAct.triggered.connect(self.showPreferences) |
2538 self.prefAct.triggered.connect(self.showPreferences) |
2529 self.prefAct.setMenuRole(QAction.PreferencesRole) |
2539 self.prefAct.setMenuRole(QAction.MenuRole.PreferencesRole) |
2530 self.actions.append(self.prefAct) |
2540 self.actions.append(self.prefAct) |
2531 |
2541 |
2532 self.prefExportAct = E5Action( |
2542 self.prefExportAct = E5Action( |
2533 self.tr('Export Preferences'), |
2543 self.tr('Export Preferences'), |
2534 UI.PixmapCache.getIcon("configureExport"), |
2544 UI.PixmapCache.getIcon("configureExport"), |
3453 self.addToolBar(starttb) |
3463 self.addToolBar(starttb) |
3454 self.addToolBar(debugtb) |
3464 self.addToolBar(debugtb) |
3455 self.addToolBar(multiprojecttb) |
3465 self.addToolBar(multiprojecttb) |
3456 self.addToolBar(projecttb) |
3466 self.addToolBar(projecttb) |
3457 self.addToolBar(vcstb) |
3467 self.addToolBar(vcstb) |
3458 self.addToolBar(Qt.RightToolBarArea, settingstb) |
3468 self.addToolBar(Qt.ToolBarArea.RightToolBarArea, settingstb) |
3459 self.addToolBar(Qt.RightToolBarArea, toolstb) |
3469 self.addToolBar(Qt.ToolBarArea.RightToolBarArea, toolstb) |
3460 self.addToolBar(helptb) |
3470 self.addToolBar(helptb) |
3461 self.addToolBar(bookmarktb) |
3471 self.addToolBar(bookmarktb) |
3462 self.addToolBar(spellingtb) |
3472 self.addToolBar(spellingtb) |
3463 self.addToolBar(unittesttb) |
3473 self.addToolBar(unittesttb) |
3464 self.addToolBar(profilestb) |
3474 self.addToolBar(profilestb) |
4497 if not state.isEmpty(): |
4507 if not state.isEmpty(): |
4498 self.rightSidebar.restoreState(state) |
4508 self.rightSidebar.restoreState(state) |
4499 |
4509 |
4500 if self.__layoutType == "Toolboxes": |
4510 if self.__layoutType == "Toolboxes": |
4501 # set the corner usages |
4511 # set the corner usages |
4502 self.setCorner(Qt.TopLeftCorner, |
4512 self.setCorner(Qt.Corner.TopLeftCorner, |
4503 Qt.LeftDockWidgetArea) |
4513 Qt.DockWidgetArea.LeftDockWidgetArea) |
4504 self.setCorner(Qt.BottomLeftCorner, |
4514 self.setCorner(Qt.Corner.BottomLeftCorner, |
4505 Qt.LeftDockWidgetArea) |
4515 Qt.DockWidgetArea.LeftDockWidgetArea) |
4506 self.setCorner(Qt.TopRightCorner, |
4516 self.setCorner(Qt.Corner.TopRightCorner, |
4507 Qt.RightDockWidgetArea) |
4517 Qt.DockWidgetArea.RightDockWidgetArea) |
4508 self.setCorner(Qt.BottomRightCorner, |
4518 self.setCorner(Qt.Corner.BottomRightCorner, |
4509 Qt.RightDockWidgetArea) |
4519 Qt.DockWidgetArea.RightDockWidgetArea) |
4510 |
4520 |
4511 # step 3: activate the windows of the new profile |
4521 # step 3: activate the windows of the new profile |
4512 if self.__layoutType == "Toolboxes": |
4522 if self.__layoutType == "Toolboxes": |
4513 self.lToolboxDock.setVisible(self.profiles[name][1][0]) |
4523 self.lToolboxDock.setVisible(self.profiles[name][1][0]) |
4514 self.hToolboxDock.setVisible(self.profiles[name][1][1]) |
4524 self.hToolboxDock.setVisible(self.profiles[name][1][1]) |
4616 self.lToolbox.setCurrentWidget(self.projectBrowser) |
4626 self.lToolbox.setCurrentWidget(self.projectBrowser) |
4617 elif self.__layoutType == "Sidebars": |
4627 elif self.__layoutType == "Sidebars": |
4618 self.leftSidebar.show() |
4628 self.leftSidebar.show() |
4619 self.leftSidebar.setCurrentWidget(self.projectBrowser) |
4629 self.leftSidebar.setCurrentWidget(self.projectBrowser) |
4620 self.projectBrowser.currentWidget().setFocus( |
4630 self.projectBrowser.currentWidget().setFocus( |
4621 Qt.ActiveWindowFocusReason) |
4631 Qt.FocusReason.ActiveWindowFocusReason) |
4622 |
4632 |
4623 def __activateMultiProjectBrowser(self): |
4633 def __activateMultiProjectBrowser(self): |
4624 """ |
4634 """ |
4625 Private slot to handle the activation of the project browser. |
4635 Private slot to handle the activation of the project browser. |
4626 """ |
4636 """ |
4628 self.lToolboxDock.show() |
4638 self.lToolboxDock.show() |
4629 self.lToolbox.setCurrentWidget(self.multiProjectBrowser) |
4639 self.lToolbox.setCurrentWidget(self.multiProjectBrowser) |
4630 elif self.__layoutType == "Sidebars": |
4640 elif self.__layoutType == "Sidebars": |
4631 self.leftSidebar.show() |
4641 self.leftSidebar.show() |
4632 self.leftSidebar.setCurrentWidget(self.multiProjectBrowser) |
4642 self.leftSidebar.setCurrentWidget(self.multiProjectBrowser) |
4633 self.multiProjectBrowser.setFocus(Qt.ActiveWindowFocusReason) |
4643 self.multiProjectBrowser.setFocus( |
|
4644 Qt.FocusReason.ActiveWindowFocusReason) |
4634 |
4645 |
4635 def activateDebugViewer(self): |
4646 def activateDebugViewer(self): |
4636 """ |
4647 """ |
4637 Public slot to handle the activation of the debug viewer. |
4648 Public slot to handle the activation of the debug viewer. |
4638 """ |
4649 """ |
4640 self.rToolboxDock.show() |
4651 self.rToolboxDock.show() |
4641 self.rToolbox.setCurrentWidget(self.debugViewer) |
4652 self.rToolbox.setCurrentWidget(self.debugViewer) |
4642 elif self.__layoutType == "Sidebars": |
4653 elif self.__layoutType == "Sidebars": |
4643 self.rightSidebar.show() |
4654 self.rightSidebar.show() |
4644 self.rightSidebar.setCurrentWidget(self.debugViewer) |
4655 self.rightSidebar.setCurrentWidget(self.debugViewer) |
4645 self.debugViewer.currentWidget().setFocus(Qt.ActiveWindowFocusReason) |
4656 self.debugViewer.currentWidget().setFocus( |
|
4657 Qt.FocusReason.ActiveWindowFocusReason) |
4646 |
4658 |
4647 def __activateShell(self): |
4659 def __activateShell(self): |
4648 """ |
4660 """ |
4649 Private slot to handle the activation of the Shell window. |
4661 Private slot to handle the activation of the Shell window. |
4650 """ |
4662 """ |
4652 self.__shellParent.show() |
4664 self.__shellParent.show() |
4653 self.__shellParent.widget().setCurrentWidget(self.shellAssembly) |
4665 self.__shellParent.widget().setCurrentWidget(self.shellAssembly) |
4654 elif self.__layoutType == "Sidebars": |
4666 elif self.__layoutType == "Sidebars": |
4655 self.__shellParent.show() |
4667 self.__shellParent.show() |
4656 self.__shellParent.setCurrentWidget(self.shellAssembly) |
4668 self.__shellParent.setCurrentWidget(self.shellAssembly) |
4657 self.shell.setFocus(Qt.ActiveWindowFocusReason) |
4669 self.shell.setFocus(Qt.FocusReason.ActiveWindowFocusReason) |
4658 |
4670 |
4659 def __activateLogViewer(self): |
4671 def __activateLogViewer(self): |
4660 """ |
4672 """ |
4661 Private slot to handle the activation of the Log Viewer. |
4673 Private slot to handle the activation of the Log Viewer. |
4662 """ |
4674 """ |
4664 self.hToolboxDock.show() |
4676 self.hToolboxDock.show() |
4665 self.hToolbox.setCurrentWidget(self.logViewer) |
4677 self.hToolbox.setCurrentWidget(self.logViewer) |
4666 elif self.__layoutType == "Sidebars": |
4678 elif self.__layoutType == "Sidebars": |
4667 self.bottomSidebar.show() |
4679 self.bottomSidebar.show() |
4668 self.bottomSidebar.setCurrentWidget(self.logViewer) |
4680 self.bottomSidebar.setCurrentWidget(self.logViewer) |
4669 self.logViewer.setFocus(Qt.ActiveWindowFocusReason) |
4681 self.logViewer.setFocus(Qt.FocusReason.ActiveWindowFocusReason) |
4670 |
4682 |
4671 def __activateTaskViewer(self): |
4683 def __activateTaskViewer(self): |
4672 """ |
4684 """ |
4673 Private slot to handle the activation of the Task Viewer. |
4685 Private slot to handle the activation of the Task Viewer. |
4674 """ |
4686 """ |
4676 self.hToolboxDock.show() |
4688 self.hToolboxDock.show() |
4677 self.hToolbox.setCurrentWidget(self.taskViewer) |
4689 self.hToolbox.setCurrentWidget(self.taskViewer) |
4678 elif self.__layoutType == "Sidebars": |
4690 elif self.__layoutType == "Sidebars": |
4679 self.bottomSidebar.show() |
4691 self.bottomSidebar.show() |
4680 self.bottomSidebar.setCurrentWidget(self.taskViewer) |
4692 self.bottomSidebar.setCurrentWidget(self.taskViewer) |
4681 self.taskViewer.setFocus(Qt.ActiveWindowFocusReason) |
4693 self.taskViewer.setFocus(Qt.FocusReason.ActiveWindowFocusReason) |
4682 |
4694 |
4683 def __activateTemplateViewer(self): |
4695 def __activateTemplateViewer(self): |
4684 """ |
4696 """ |
4685 Private slot to handle the activation of the Template Viewer. |
4697 Private slot to handle the activation of the Template Viewer. |
4686 """ |
4698 """ |
4689 self.lToolboxDock.show() |
4701 self.lToolboxDock.show() |
4690 self.lToolbox.setCurrentWidget(self.templateViewer) |
4702 self.lToolbox.setCurrentWidget(self.templateViewer) |
4691 elif self.__layoutType == "Sidebars": |
4703 elif self.__layoutType == "Sidebars": |
4692 self.leftSidebar.show() |
4704 self.leftSidebar.show() |
4693 self.leftSidebar.setCurrentWidget(self.templateViewer) |
4705 self.leftSidebar.setCurrentWidget(self.templateViewer) |
4694 self.templateViewer.setFocus(Qt.ActiveWindowFocusReason) |
4706 self.templateViewer.setFocus( |
|
4707 Qt.FocusReason.ActiveWindowFocusReason) |
4695 |
4708 |
4696 def __activateBrowser(self): |
4709 def __activateBrowser(self): |
4697 """ |
4710 """ |
4698 Private slot to handle the activation of the file browser. |
4711 Private slot to handle the activation of the file browser. |
4699 """ |
4712 """ |
4702 self.lToolboxDock.show() |
4715 self.lToolboxDock.show() |
4703 self.lToolbox.setCurrentWidget(self.browser) |
4716 self.lToolbox.setCurrentWidget(self.browser) |
4704 elif self.__layoutType == "Sidebars": |
4717 elif self.__layoutType == "Sidebars": |
4705 self.leftSidebar.show() |
4718 self.leftSidebar.show() |
4706 self.leftSidebar.setCurrentWidget(self.browser) |
4719 self.leftSidebar.setCurrentWidget(self.browser) |
4707 self.browser.setFocus(Qt.ActiveWindowFocusReason) |
4720 self.browser.setFocus(Qt.FocusReason.ActiveWindowFocusReason) |
4708 |
4721 |
4709 def __toggleLeftToolbox(self): |
4722 def __toggleLeftToolbox(self): |
4710 """ |
4723 """ |
4711 Private slot to handle the toggle of the Left Toolbox window. |
4724 Private slot to handle the toggle of the Left Toolbox window. |
4712 """ |
4725 """ |
4713 hasFocus = self.lToolbox.currentWidget().hasFocus() |
4726 hasFocus = self.lToolbox.currentWidget().hasFocus() |
4714 shown = self.__toggleWindow(self.lToolboxDock) |
4727 shown = self.__toggleWindow(self.lToolboxDock) |
4715 if shown: |
4728 if shown: |
4716 self.lToolbox.currentWidget().setFocus(Qt.ActiveWindowFocusReason) |
4729 self.lToolbox.currentWidget().setFocus( |
|
4730 Qt.FocusReason.ActiveWindowFocusReason) |
4717 else: |
4731 else: |
4718 if hasFocus: |
4732 if hasFocus: |
4719 self.__activateViewmanager() |
4733 self.__activateViewmanager() |
4720 |
4734 |
4721 def __toggleRightToolbox(self): |
4735 def __toggleRightToolbox(self): |
4723 Private slot to handle the toggle of the Right Toolbox window. |
4737 Private slot to handle the toggle of the Right Toolbox window. |
4724 """ |
4738 """ |
4725 hasFocus = self.rToolbox.currentWidget().hasFocus() |
4739 hasFocus = self.rToolbox.currentWidget().hasFocus() |
4726 shown = self.__toggleWindow(self.rToolboxDock) |
4740 shown = self.__toggleWindow(self.rToolboxDock) |
4727 if shown: |
4741 if shown: |
4728 self.rToolbox.currentWidget().setFocus(Qt.ActiveWindowFocusReason) |
4742 self.rToolbox.currentWidget().setFocus( |
|
4743 Qt.FocusReason.ActiveWindowFocusReason) |
4729 else: |
4744 else: |
4730 if hasFocus: |
4745 if hasFocus: |
4731 self.__activateViewmanager() |
4746 self.__activateViewmanager() |
4732 |
4747 |
4733 def __toggleHorizontalToolbox(self): |
4748 def __toggleHorizontalToolbox(self): |
4735 Private slot to handle the toggle of the Horizontal Toolbox window. |
4750 Private slot to handle the toggle of the Horizontal Toolbox window. |
4736 """ |
4751 """ |
4737 hasFocus = self.hToolbox.currentWidget().hasFocus() |
4752 hasFocus = self.hToolbox.currentWidget().hasFocus() |
4738 shown = self.__toggleWindow(self.hToolboxDock) |
4753 shown = self.__toggleWindow(self.hToolboxDock) |
4739 if shown: |
4754 if shown: |
4740 self.hToolbox.currentWidget().setFocus(Qt.ActiveWindowFocusReason) |
4755 self.hToolbox.currentWidget().setFocus( |
|
4756 Qt.FocusReason.ActiveWindowFocusReason) |
4741 else: |
4757 else: |
4742 if hasFocus: |
4758 if hasFocus: |
4743 self.__activateViewmanager() |
4759 self.__activateViewmanager() |
4744 |
4760 |
4745 def __toggleLeftSidebar(self): |
4761 def __toggleLeftSidebar(self): |
4748 """ |
4764 """ |
4749 hasFocus = self.leftSidebar.currentWidget().hasFocus() |
4765 hasFocus = self.leftSidebar.currentWidget().hasFocus() |
4750 shown = self.__toggleWindow(self.leftSidebar) |
4766 shown = self.__toggleWindow(self.leftSidebar) |
4751 if shown: |
4767 if shown: |
4752 self.leftSidebar.currentWidget().setFocus( |
4768 self.leftSidebar.currentWidget().setFocus( |
4753 Qt.ActiveWindowFocusReason) |
4769 Qt.FocusReason.ActiveWindowFocusReason) |
4754 else: |
4770 else: |
4755 if hasFocus: |
4771 if hasFocus: |
4756 self.__activateViewmanager() |
4772 self.__activateViewmanager() |
4757 |
4773 |
4758 def __toggleRightSidebar(self): |
4774 def __toggleRightSidebar(self): |
4761 """ |
4777 """ |
4762 hasFocus = self.rightSidebar.currentWidget().hasFocus() |
4778 hasFocus = self.rightSidebar.currentWidget().hasFocus() |
4763 shown = self.__toggleWindow(self.rightSidebar) |
4779 shown = self.__toggleWindow(self.rightSidebar) |
4764 if shown: |
4780 if shown: |
4765 self.rightSidebar.currentWidget().setFocus( |
4781 self.rightSidebar.currentWidget().setFocus( |
4766 Qt.ActiveWindowFocusReason) |
4782 Qt.FocusReason.ActiveWindowFocusReason) |
4767 else: |
4783 else: |
4768 if hasFocus: |
4784 if hasFocus: |
4769 self.__activateViewmanager() |
4785 self.__activateViewmanager() |
4770 |
4786 |
4771 def __toggleBottomSidebar(self): |
4787 def __toggleBottomSidebar(self): |
4774 """ |
4790 """ |
4775 hasFocus = self.bottomSidebar.currentWidget().hasFocus() |
4791 hasFocus = self.bottomSidebar.currentWidget().hasFocus() |
4776 shown = self.__toggleWindow(self.bottomSidebar) |
4792 shown = self.__toggleWindow(self.bottomSidebar) |
4777 if shown: |
4793 if shown: |
4778 self.bottomSidebar.currentWidget().setFocus( |
4794 self.bottomSidebar.currentWidget().setFocus( |
4779 Qt.ActiveWindowFocusReason) |
4795 Qt.FocusReason.ActiveWindowFocusReason) |
4780 else: |
4796 else: |
4781 if hasFocus: |
4797 if hasFocus: |
4782 self.__activateViewmanager() |
4798 self.__activateViewmanager() |
4783 |
4799 |
4784 def activateCooperationViewer(self): |
4800 def activateCooperationViewer(self): |
4790 self.rToolboxDock.show() |
4806 self.rToolboxDock.show() |
4791 self.rToolbox.setCurrentWidget(self.cooperation) |
4807 self.rToolbox.setCurrentWidget(self.cooperation) |
4792 elif self.__layoutType == "Sidebars": |
4808 elif self.__layoutType == "Sidebars": |
4793 self.rightSidebar.show() |
4809 self.rightSidebar.show() |
4794 self.rightSidebar.setCurrentWidget(self.cooperation) |
4810 self.rightSidebar.setCurrentWidget(self.cooperation) |
4795 self.cooperation.setFocus(Qt.ActiveWindowFocusReason) |
4811 self.cooperation.setFocus(Qt.FocusReason.ActiveWindowFocusReason) |
4796 |
4812 |
4797 def __activateIRC(self): |
4813 def __activateIRC(self): |
4798 """ |
4814 """ |
4799 Private slot to handle the activation of the IRC window. |
4815 Private slot to handle the activation of the IRC window. |
4800 """ |
4816 """ |
4803 self.rToolboxDock.show() |
4819 self.rToolboxDock.show() |
4804 self.rToolbox.setCurrentWidget(self.irc) |
4820 self.rToolbox.setCurrentWidget(self.irc) |
4805 elif self.__layoutType == "Sidebars": |
4821 elif self.__layoutType == "Sidebars": |
4806 self.rightSidebar.show() |
4822 self.rightSidebar.show() |
4807 self.rightSidebar.setCurrentWidget(self.irc) |
4823 self.rightSidebar.setCurrentWidget(self.irc) |
4808 self.irc.setFocus(Qt.ActiveWindowFocusReason) |
4824 self.irc.setFocus(Qt.FocusReason.ActiveWindowFocusReason) |
4809 |
4825 |
4810 def __activateSymbolsViewer(self): |
4826 def __activateSymbolsViewer(self): |
4811 """ |
4827 """ |
4812 Private slot to handle the activation of the Symbols Viewer. |
4828 Private slot to handle the activation of the Symbols Viewer. |
4813 """ |
4829 """ |
4816 self.lToolboxDock.show() |
4832 self.lToolboxDock.show() |
4817 self.lToolbox.setCurrentWidget(self.symbolsViewer) |
4833 self.lToolbox.setCurrentWidget(self.symbolsViewer) |
4818 elif self.__layoutType == "Sidebars": |
4834 elif self.__layoutType == "Sidebars": |
4819 self.leftSidebar.show() |
4835 self.leftSidebar.show() |
4820 self.leftSidebar.setCurrentWidget(self.symbolsViewer) |
4836 self.leftSidebar.setCurrentWidget(self.symbolsViewer) |
4821 self.symbolsViewer.setFocus(Qt.ActiveWindowFocusReason) |
4837 self.symbolsViewer.setFocus(Qt.FocusReason.ActiveWindowFocusReason) |
4822 |
4838 |
4823 def __activateNumbersViewer(self): |
4839 def __activateNumbersViewer(self): |
4824 """ |
4840 """ |
4825 Private slot to handle the activation of the Numbers Viewer. |
4841 Private slot to handle the activation of the Numbers Viewer. |
4826 """ |
4842 """ |
4829 self.hToolboxDock.show() |
4845 self.hToolboxDock.show() |
4830 self.hToolbox.setCurrentWidget(self.numbersViewer) |
4846 self.hToolbox.setCurrentWidget(self.numbersViewer) |
4831 elif self.__layoutType == "Sidebars": |
4847 elif self.__layoutType == "Sidebars": |
4832 self.bottomSidebar.show() |
4848 self.bottomSidebar.show() |
4833 self.bottomSidebar.setCurrentWidget(self.numbersViewer) |
4849 self.bottomSidebar.setCurrentWidget(self.numbersViewer) |
4834 self.numbersViewer.setFocus(Qt.ActiveWindowFocusReason) |
4850 self.numbersViewer.setFocus(Qt.FocusReason.ActiveWindowFocusReason) |
4835 |
4851 |
4836 def __activateViewmanager(self): |
4852 def __activateViewmanager(self): |
4837 """ |
4853 """ |
4838 Private slot to handle the activation of the current editor. |
4854 Private slot to handle the activation of the current editor. |
4839 """ |
4855 """ |
4840 aw = self.viewmanager.activeWindow() |
4856 aw = self.viewmanager.activeWindow() |
4841 if aw is not None: |
4857 if aw is not None: |
4842 aw.setFocus(Qt.ActiveWindowFocusReason) |
4858 aw.setFocus(Qt.FocusReason.ActiveWindowFocusReason) |
4843 |
4859 |
4844 def activateCodeDocumentationViewer(self, switchFocus=True): |
4860 def activateCodeDocumentationViewer(self, switchFocus=True): |
4845 """ |
4861 """ |
4846 Public slot to handle the activation of the Code Documentation Viewer. |
4862 Public slot to handle the activation of the Code Documentation Viewer. |
4847 |
4863 |
4856 self.rightSidebar.show() |
4872 self.rightSidebar.show() |
4857 self.rightSidebar.setCurrentWidget( |
4873 self.rightSidebar.setCurrentWidget( |
4858 self.codeDocumentationViewer) |
4874 self.codeDocumentationViewer) |
4859 if switchFocus: |
4875 if switchFocus: |
4860 self.codeDocumentationViewer.setFocus( |
4876 self.codeDocumentationViewer.setFocus( |
4861 Qt.ActiveWindowFocusReason) |
4877 Qt.FocusReason.ActiveWindowFocusReason) |
4862 |
4878 |
4863 def __activatePipWidget(self): |
4879 def __activatePipWidget(self): |
4864 """ |
4880 """ |
4865 Private slot to handle the activation of the PyPI manager widget. |
4881 Private slot to handle the activation of the PyPI manager widget. |
4866 """ |
4882 """ |
4869 self.rToolboxDock.show() |
4885 self.rToolboxDock.show() |
4870 self.rToolbox.setCurrentWidget(self.pipWidget) |
4886 self.rToolbox.setCurrentWidget(self.pipWidget) |
4871 elif self.__layoutType == "Sidebars": |
4887 elif self.__layoutType == "Sidebars": |
4872 self.rightSidebar.show() |
4888 self.rightSidebar.show() |
4873 self.rightSidebar.setCurrentWidget(self.pipWidget) |
4889 self.rightSidebar.setCurrentWidget(self.pipWidget) |
4874 self.pipWidget.setFocus(Qt.ActiveWindowFocusReason) |
4890 self.pipWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason) |
4875 |
4891 |
4876 def __activateCondaWidget(self): |
4892 def __activateCondaWidget(self): |
4877 """ |
4893 """ |
4878 Private slot to handle the activation of the Conda manager widget. |
4894 Private slot to handle the activation of the Conda manager widget. |
4879 """ |
4895 """ |
4882 self.rToolboxDock.show() |
4898 self.rToolboxDock.show() |
4883 self.rToolbox.setCurrentWidget(self.condaWidget) |
4899 self.rToolbox.setCurrentWidget(self.condaWidget) |
4884 elif self.__layoutType == "Sidebars": |
4900 elif self.__layoutType == "Sidebars": |
4885 self.rightSidebar.show() |
4901 self.rightSidebar.show() |
4886 self.rightSidebar.setCurrentWidget(self.condaWidget) |
4902 self.rightSidebar.setCurrentWidget(self.condaWidget) |
4887 self.condaWidget.setFocus(Qt.ActiveWindowFocusReason) |
4903 self.condaWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason) |
4888 |
4904 |
4889 def __activateMicroPython(self): |
4905 def __activateMicroPython(self): |
4890 """ |
4906 """ |
4891 Private slot to handle the activation of the MicroPython widget. |
4907 Private slot to handle the activation of the MicroPython widget. |
4892 """ |
4908 """ |
4895 self.rToolboxDock.show() |
4911 self.rToolboxDock.show() |
4896 self.rToolbox.setCurrentWidget(self.microPythonWidget) |
4912 self.rToolbox.setCurrentWidget(self.microPythonWidget) |
4897 elif self.__layoutType == "Sidebars": |
4913 elif self.__layoutType == "Sidebars": |
4898 self.rightSidebar.show() |
4914 self.rightSidebar.show() |
4899 self.rightSidebar.setCurrentWidget(self.microPythonWidget) |
4915 self.rightSidebar.setCurrentWidget(self.microPythonWidget) |
4900 self.microPythonWidget.setFocus(Qt.ActiveWindowFocusReason) |
4916 self.microPythonWidget.setFocus( |
|
4917 Qt.FocusReason.ActiveWindowFocusReason) |
4901 |
4918 |
4902 def __toggleWindow(self, w): |
4919 def __toggleWindow(self, w): |
4903 """ |
4920 """ |
4904 Private method to toggle a workspace editor window. |
4921 Private method to toggle a workspace editor window. |
4905 |
4922 |
4918 Private slot to handle the tools configuration menu entry. |
4935 Private slot to handle the tools configuration menu entry. |
4919 """ |
4936 """ |
4920 from Preferences.ToolConfigurationDialog import ToolConfigurationDialog |
4937 from Preferences.ToolConfigurationDialog import ToolConfigurationDialog |
4921 dlg = ToolConfigurationDialog( |
4938 dlg = ToolConfigurationDialog( |
4922 self.toolGroups[self.currentToolGroup][1], self) |
4939 self.toolGroups[self.currentToolGroup][1], self) |
4923 if dlg.exec() == QDialog.Accepted: |
4940 if dlg.exec() == QDialog.DialogCode.Accepted: |
4924 self.toolGroups[self.currentToolGroup][1] = dlg.getToollist() |
4941 self.toolGroups[self.currentToolGroup][1] = dlg.getToollist() |
4925 self.__updateExternalToolsActions() |
4942 self.__updateExternalToolsActions() |
4926 |
4943 |
4927 def __toolGroupsConfiguration(self): |
4944 def __toolGroupsConfiguration(self): |
4928 """ |
4945 """ |
4931 from Preferences.ToolGroupConfigurationDialog import ( |
4948 from Preferences.ToolGroupConfigurationDialog import ( |
4932 ToolGroupConfigurationDialog |
4949 ToolGroupConfigurationDialog |
4933 ) |
4950 ) |
4934 dlg = ToolGroupConfigurationDialog( |
4951 dlg = ToolGroupConfigurationDialog( |
4935 self.toolGroups, self.currentToolGroup, self) |
4952 self.toolGroups, self.currentToolGroup, self) |
4936 if dlg.exec() == QDialog.Accepted: |
4953 if dlg.exec() == QDialog.DialogCode.Accepted: |
4937 self.toolGroups, self.currentToolGroup = dlg.getToolGroups() |
4954 self.toolGroups, self.currentToolGroup = dlg.getToolGroups() |
4938 |
4955 |
4939 def __createUnitTestDialog(self): |
4956 def __createUnitTestDialog(self): |
4940 """ |
4957 """ |
4941 Private slot to generate the unit test dialog on demand. |
4958 Private slot to generate the unit test dialog on demand. |
5547 'Ensure that it is available as <b>{1}</b>.</p>') |
5564 'Ensure that it is available as <b>{1}</b>.</p>') |
5548 .format(tool['menutext'], tool['executable'])) |
5565 .format(tool['menutext'], tool['executable'])) |
5549 else: |
5566 else: |
5550 self.toolProcs.append((program, proc, procData)) |
5567 self.toolProcs.append((program, proc, procData)) |
5551 if tool['redirect'] == 'no': |
5568 if tool['redirect'] == 'no': |
5552 proc.closeReadChannel(QProcess.StandardOutput) |
5569 proc.closeReadChannel(QProcess.ProcessChannel.StandardOutput) |
5553 proc.closeReadChannel(QProcess.StandardError) |
5570 proc.closeReadChannel(QProcess.ProcessChannel.StandardError) |
5554 proc.closeWriteChannel() |
5571 proc.closeWriteChannel() |
5555 |
5572 |
5556 def __processToolStdout(self): |
5573 def __processToolStdout(self): |
5557 """ |
5574 """ |
5558 Private slot to handle the readyReadStdout signal of a tool process. |
5575 Private slot to handle the readyReadStdout signal of a tool process. |
5559 """ |
5576 """ |
5560 ioEncoding = Preferences.getSystem("IOEncoding") |
5577 ioEncoding = Preferences.getSystem("IOEncoding") |
5561 |
5578 |
5562 # loop through all running tool processes |
5579 # loop through all running tool processes |
5563 for program, toolProc, toolProcData in self.toolProcs: |
5580 for program, toolProc, toolProcData in self.toolProcs: |
5564 toolProc.setReadChannel(QProcess.StandardOutput) |
5581 toolProc.setReadChannel(QProcess.ProcessChannel.StandardOutput) |
5565 |
5582 |
5566 if ( |
5583 if ( |
5567 toolProcData[0] is None or |
5584 toolProcData[0] is None or |
5568 toolProcData[1] not in ["insert", "replaceSelection"] |
5585 toolProcData[1] not in ["insert", "replaceSelection"] |
5569 ): |
5586 ): |
5586 """ |
5603 """ |
5587 ioEncoding = Preferences.getSystem("IOEncoding") |
5604 ioEncoding = Preferences.getSystem("IOEncoding") |
5588 |
5605 |
5589 # loop through all running tool processes |
5606 # loop through all running tool processes |
5590 for program, toolProc, _toolProcData in self.toolProcs: |
5607 for program, toolProc, _toolProcData in self.toolProcs: |
5591 toolProc.setReadChannel(QProcess.StandardError) |
5608 toolProc.setReadChannel(QProcess.ProcessChannel.StandardError) |
5592 |
5609 |
5593 while toolProc.canReadLine(): |
5610 while toolProc.canReadLine(): |
5594 error = str(toolProc.readLine(), ioEncoding, 'replace') |
5611 error = str(toolProc.readLine(), ioEncoding, 'replace') |
5595 s = "{0} - {1}".format(program, error) |
5612 s = "{0} - {1}".format(program, error) |
5596 self.appendToStderr(s) |
5613 self.appendToStderr(s) |
5604 """ |
5621 """ |
5605 exitedProcs = [] |
5622 exitedProcs = [] |
5606 |
5623 |
5607 # loop through all running tool processes |
5624 # loop through all running tool processes |
5608 for program, toolProc, toolProcData in self.toolProcs: |
5625 for program, toolProc, toolProcData in self.toolProcs: |
5609 if toolProc.state() == QProcess.NotRunning: |
5626 if toolProc.state() == QProcess.ProcessState.NotRunning: |
5610 exitedProcs.append((program, toolProc, toolProcData)) |
5627 exitedProcs.append((program, toolProc, toolProcData)) |
5611 if toolProcData[0] is not None: |
5628 if toolProcData[0] is not None: |
5612 if toolProcData[1] == "replaceSelection": |
5629 if toolProcData[1] == "replaceSelection": |
5613 text = ''.join(toolProcData[2]) |
5630 text = ''.join(toolProcData[2]) |
5614 toolProcData[0].replace(text) |
5631 toolProcData[0].replace(text) |
5927 @type str |
5944 @type str |
5928 @param useSingle flag indicating to use a single browser window |
5945 @param useSingle flag indicating to use a single browser window |
5929 @type bool |
5946 @type bool |
5930 """ |
5947 """ |
5931 if isinstance(home, QUrl): |
5948 if isinstance(home, QUrl): |
5932 home = home.toString(QUrl.None_) |
5949 home = home.toString(QUrl.UrlFormattingOption.None_) |
5933 |
5950 |
5934 if len(home) > 0: |
5951 if len(home) > 0: |
5935 homeUrl = QUrl(home) |
5952 homeUrl = QUrl(home) |
5936 if not homeUrl.scheme(): |
5953 if not homeUrl.scheme(): |
5937 home = QUrl.fromLocalFile(home).toString() |
5954 home = QUrl.fromLocalFile(home).toString() |
6030 else: |
6047 else: |
6031 connectCount -= 1 |
6048 connectCount -= 1 |
6032 QThread.msleep(1000) |
6049 QThread.msleep(1000) |
6033 QApplication.processEvents() |
6050 QApplication.processEvents() |
6034 if ( |
6051 if ( |
6035 process.state() == QProcess.NotRunning and |
6052 process.state() == QProcess.ProcessState.NotRunning and |
6036 process.exitStatus() == QProcess.NormalExit and |
6053 process.exitStatus() == QProcess.ExitStatus.NormalExit and |
6037 process.exitCode() == 100 |
6054 process.exitCode() == 100 |
6038 ): |
6055 ): |
6039 # Process exited prematurely due to missing pre-requisites |
6056 # Process exited prematurely due to missing pre-requisites |
6040 return -1 |
6057 return -1 |
6041 if res <= 0: |
6058 if res <= 0: |
6115 self.__lastConfigurationPageName) |
6132 self.__lastConfigurationPageName) |
6116 else: |
6133 else: |
6117 self.__configurationDialog.showConfigurationPageByName("empty") |
6134 self.__configurationDialog.showConfigurationPageByName("empty") |
6118 self.__configurationDialog.exec() |
6135 self.__configurationDialog.exec() |
6119 QApplication.processEvents() |
6136 QApplication.processEvents() |
6120 if self.__configurationDialog.result() == QDialog.Accepted: |
6137 if ( |
|
6138 self.__configurationDialog.result() == |
|
6139 QDialog.DialogCode.Accepted |
|
6140 ): |
6121 self.__configurationDialog.setPreferences() |
6141 self.__configurationDialog.setPreferences() |
6122 Preferences.syncPreferences() |
6142 Preferences.syncPreferences() |
6123 self.__preferencesChanged() |
6143 self.__preferencesChanged() |
6124 self.__lastConfigurationPageName = ( |
6144 self.__lastConfigurationPageName = ( |
6125 self.__configurationDialog.getConfigurationPageName() |
6145 self.__configurationDialog.getConfigurationPageName() |
6254 Private slot to configure the various view profiles. |
6274 Private slot to configure the various view profiles. |
6255 """ |
6275 """ |
6256 from Preferences.ViewProfileDialog import ViewProfileDialog |
6276 from Preferences.ViewProfileDialog import ViewProfileDialog |
6257 dlg = ViewProfileDialog(self.__layoutType, self.profiles['edit'][1], |
6277 dlg = ViewProfileDialog(self.__layoutType, self.profiles['edit'][1], |
6258 self.profiles['debug'][1]) |
6278 self.profiles['debug'][1]) |
6259 if dlg.exec() == QDialog.Accepted: |
6279 if dlg.exec() == QDialog.DialogCode.Accepted: |
6260 edit, debug = dlg.getVisibilities() |
6280 edit, debug = dlg.getVisibilities() |
6261 self.profiles['edit'][1] = edit |
6281 self.profiles['edit'][1] = edit |
6262 self.profiles['debug'][1] = debug |
6282 self.profiles['debug'][1] = debug |
6263 Preferences.setUI("ViewProfiles2", self.profiles) |
6283 Preferences.setUI("ViewProfiles2", self.profiles) |
6264 if self.currentProfile == "edit": |
6284 if self.currentProfile == "edit": |
6270 """ |
6290 """ |
6271 Private slot to configure the various toolbars. |
6291 Private slot to configure the various toolbars. |
6272 """ |
6292 """ |
6273 from E5Gui.E5ToolBarDialog import E5ToolBarDialog |
6293 from E5Gui.E5ToolBarDialog import E5ToolBarDialog |
6274 dlg = E5ToolBarDialog(self.toolbarManager) |
6294 dlg = E5ToolBarDialog(self.toolbarManager) |
6275 if dlg.exec() == QDialog.Accepted: |
6295 if dlg.exec() == QDialog.DialogCode.Accepted: |
6276 Preferences.setUI( |
6296 Preferences.setUI( |
6277 "ToolbarManagerState", self.toolbarManager.saveState()) |
6297 "ToolbarManagerState", self.toolbarManager.saveState()) |
6278 |
6298 |
6279 def __configShortcuts(self): |
6299 def __configShortcuts(self): |
6280 """ |
6300 """ |
6349 """ |
6369 """ |
6350 Private slot to clear the private data lists. |
6370 Private slot to clear the private data lists. |
6351 """ |
6371 """ |
6352 from .ClearPrivateDataDialog import ClearPrivateDataDialog |
6372 from .ClearPrivateDataDialog import ClearPrivateDataDialog |
6353 dlg = ClearPrivateDataDialog(self) |
6373 dlg = ClearPrivateDataDialog(self) |
6354 if dlg.exec() == QDialog.Accepted: |
6374 if dlg.exec() == QDialog.DialogCode.Accepted: |
6355 # recent files, recent projects, recent multi projects, |
6375 # recent files, recent projects, recent multi projects, |
6356 # debug histories, shell histories |
6376 # debug histories, shell histories |
6357 (files, projects, multiProjects, debug, shell, vcs, plugins) = ( |
6377 (files, projects, multiProjects, debug, shell, vcs, plugins) = ( |
6358 dlg.getData() |
6378 dlg.getData() |
6359 ) |
6379 ) |
6506 else: |
6526 else: |
6507 # try old style XML file second |
6527 # try old style XML file second |
6508 fn = os.path.join(Utilities.getConfigDir(), "eric6tasks.e6t") |
6528 fn = os.path.join(Utilities.getConfigDir(), "eric6tasks.e6t") |
6509 if os.path.exists(fn): |
6529 if os.path.exists(fn): |
6510 f = QFile(fn) |
6530 f = QFile(fn) |
6511 if f.open(QIODevice.ReadOnly): |
6531 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
6512 from E5XML.TasksReader import TasksReader |
6532 from E5XML.TasksReader import TasksReader |
6513 reader = TasksReader(f, viewer=self.taskViewer) |
6533 reader = TasksReader(f, viewer=self.taskViewer) |
6514 reader.readXML() |
6534 reader.readXML() |
6515 f.close() |
6535 f.close() |
6516 else: |
6536 else: |
6544 |
6564 |
6545 if fn.endswith(".esj"): |
6565 if fn.endswith(".esj"): |
6546 res = self.__sessionFile.writeFile(fn) |
6566 res = self.__sessionFile.writeFile(fn) |
6547 else: |
6567 else: |
6548 f = QFile(fn) |
6568 f = QFile(fn) |
6549 if f.open(QIODevice.WriteOnly): |
6569 if f.open(QIODevice.OpenModeFlag.WriteOnly): |
6550 from E5XML.SessionWriter import SessionWriter |
6570 from E5XML.SessionWriter import SessionWriter |
6551 SessionWriter(f, None).writeXML() |
6571 SessionWriter(f, None).writeXML() |
6552 f.close() |
6572 f.close() |
6553 res = True |
6573 res = True |
6554 else: |
6574 else: |
6596 res = self.__sessionFile.readFile(fn) |
6616 res = self.__sessionFile.readFile(fn) |
6597 self.__readingSession = False |
6617 self.__readingSession = False |
6598 else: |
6618 else: |
6599 # old XML based format |
6619 # old XML based format |
6600 f = QFile(fn) |
6620 f = QFile(fn) |
6601 if f.open(QIODevice.ReadOnly): |
6621 if f.open(QIODevice.OpenModeFlag.ReadOnly): |
6602 from E5XML.SessionReader import SessionReader |
6622 from E5XML.SessionReader import SessionReader |
6603 self.__readingSession = True |
6623 self.__readingSession = True |
6604 reader = SessionReader(f, True) |
6624 reader = SessionReader(f, True) |
6605 reader.readXML() |
6625 reader.readXML() |
6606 self.__readingSession = False |
6626 self.__readingSession = False |
6830 Public slot to show the plugins available for download. |
6850 Public slot to show the plugins available for download. |
6831 """ |
6851 """ |
6832 from PluginManager.PluginRepositoryDialog import PluginRepositoryDialog |
6852 from PluginManager.PluginRepositoryDialog import PluginRepositoryDialog |
6833 dlg = PluginRepositoryDialog(self.pluginManager, self) |
6853 dlg = PluginRepositoryDialog(self.pluginManager, self) |
6834 res = dlg.exec() |
6854 res = dlg.exec() |
6835 if res == (QDialog.Accepted + 1): |
6855 if res == (QDialog.DialogCode.Accepted + 1): |
6836 self.__installPlugins(dlg.getDownloadedPlugins()) |
6856 self.__installPlugins(dlg.getDownloadedPlugins()) |
6837 |
6857 |
6838 def __pluginsConfigure(self): |
6858 def __pluginsConfigure(self): |
6839 """ |
6859 """ |
6840 Private slot to show the plugin manager configuration page. |
6860 Private slot to show the plugin manager configuration page. |
7069 self.__versionsDownloadCanceled) |
7089 self.__versionsDownloadCanceled) |
7070 self.__versionCheckProgress.setLabelText( |
7090 self.__versionCheckProgress.setLabelText( |
7071 self.tr("Trying host {0}").format(url.host())) |
7091 self.tr("Trying host {0}").format(url.host())) |
7072 self.__versionCheckProgress.setValue(alternative) |
7092 self.__versionCheckProgress.setValue(alternative) |
7073 request = QNetworkRequest(url) |
7093 request = QNetworkRequest(url) |
7074 request.setAttribute(QNetworkRequest.CacheLoadControlAttribute, |
7094 request.setAttribute( |
7075 QNetworkRequest.AlwaysNetwork) |
7095 QNetworkRequest.Attribute.CacheLoadControlAttribute, |
|
7096 QNetworkRequest.CacheLoadControl.AlwaysNetwork) |
7076 reply = self.__networkManager.get(request) |
7097 reply = self.__networkManager.get(request) |
7077 reply.finished.connect(lambda: self.__versionsDownloadDone(reply)) |
7098 reply.finished.connect(lambda: self.__versionsDownloadDone(reply)) |
7078 self.__replies.append(reply) |
7099 self.__replies.append(reply) |
7079 |
7100 |
7080 @pyqtSlot() |
7101 @pyqtSlot() |
7094 return |
7115 return |
7095 |
7116 |
7096 reply.deleteLater() |
7117 reply.deleteLater() |
7097 if reply in self.__replies: |
7118 if reply in self.__replies: |
7098 self.__replies.remove(reply) |
7119 self.__replies.remove(reply) |
7099 if reply.error() == QNetworkReply.NoError: |
7120 if reply.error() == QNetworkReply.NetworkError.NoError: |
7100 ioEncoding = Preferences.getSystem("IOEncoding") |
7121 ioEncoding = Preferences.getSystem("IOEncoding") |
7101 versions = str(reply.readAll(), ioEncoding, 'replace').splitlines() |
7122 versions = str(reply.readAll(), ioEncoding, 'replace').splitlines() |
7102 reply.close() |
7123 reply.close() |
7103 if ( |
7124 if ( |
7104 reply.error() != QNetworkReply.NoError or |
7125 reply.error() != QNetworkReply.NetworkError.NoError or |
7105 len(versions) == 0 or |
7126 len(versions) == 0 or |
7106 versions[0].startswith("<") |
7127 versions[0].startswith("<") |
7107 ): |
7128 ): |
7108 # network error or an error page |
7129 # network error or an error page |
7109 self.httpAlternative += 1 |
7130 self.httpAlternative += 1 |
7430 |
7451 |
7431 @param evt reference to the show event (QShowEvent) |
7452 @param evt reference to the show event (QShowEvent) |
7432 """ |
7453 """ |
7433 if self.__startup: |
7454 if self.__startup: |
7434 if Preferences.getGeometry("MainMaximized"): |
7455 if Preferences.getGeometry("MainMaximized"): |
7435 self.setWindowState(Qt.WindowStates(Qt.WindowMaximized)) |
7456 self.setWindowState( |
|
7457 Qt.WindowStates(Qt.WindowState.WindowMaximized)) |
7436 self.__startup = False |
7458 self.__startup = False |
7437 |
7459 |
7438 ########################################## |
7460 ########################################## |
7439 ## Support for desktop notifications below |
7461 ## Support for desktop notifications below |
7440 ########################################## |
7462 ########################################## |