--- a/src/eric7/UI/UserInterface.py Mon Jul 29 14:43:59 2024 +0200 +++ b/src/eric7/UI/UserInterface.py Sat Aug 31 10:54:21 2024 +0200 @@ -5643,9 +5643,27 @@ """ return self.__layoutType - def __activateLeftRightSidebarWidget(self, widget): - """ - Private method to activate the given widget in the left or right + def setLeftRightSidebarWidgetIcon(self, widget, icon): + """ + Public method to set the icon of the given widget in the left or right + sidebar. + + @param widget reference to the widget to set the icon for + @type QWidget + @param icon icon to be set + @type QIcon + """ + sidebar = ( + self.leftSidebar + if Preferences.getUI("CombinedLeftRightSidebar") + else self.rightSidebar + ) + index = sidebar.indexOf(widget) + sidebar.setTabIcon(index, icon) + + def activateLeftRightSidebarWidget(self, widget): + """ + Public method to activate the given widget in the left or right sidebar. @param widget reference to the widget to be activated @@ -5694,7 +5712,7 @@ self.rToolboxDock.show() self.rToolbox.setCurrentWidget(self.debugViewer) elif self.__layoutType == "Sidebars": - self.__activateLeftRightSidebarWidget(self.debugViewer) + self.activateLeftRightSidebarWidget(self.debugViewer) self.debugViewer.currentWidget().setFocus( Qt.FocusReason.ActiveWindowFocusReason ) @@ -5886,7 +5904,7 @@ self.rToolboxDock.show() self.rToolbox.setCurrentWidget(self.cooperation) elif self.__layoutType == "Sidebars": - self.__activateLeftRightSidebarWidget(self.cooperation) + self.activateLeftRightSidebarWidget(self.cooperation) self.cooperation.setFocus(Qt.FocusReason.ActiveWindowFocusReason) def __activateIRC(self): @@ -5898,7 +5916,7 @@ self.rToolboxDock.show() self.rToolbox.setCurrentWidget(self.irc) elif self.__layoutType == "Sidebars": - self.__activateLeftRightSidebarWidget(self.irc) + self.activateLeftRightSidebarWidget(self.irc) self.irc.setFocus(Qt.FocusReason.ActiveWindowFocusReason) def __activateSymbolsViewer(self): @@ -5949,7 +5967,7 @@ self.rToolboxDock.show() self.rToolbox.setCurrentWidget(self.codeDocumentationViewer) elif self.__layoutType == "Sidebars": - self.__activateLeftRightSidebarWidget(self.codeDocumentationViewer) + self.activateLeftRightSidebarWidget(self.codeDocumentationViewer) if switchFocus: self.codeDocumentationViewer.setFocus( Qt.FocusReason.ActiveWindowFocusReason @@ -5964,7 +5982,7 @@ self.rToolboxDock.show() self.rToolbox.setCurrentWidget(self.pipWidget) elif self.__layoutType == "Sidebars": - self.__activateLeftRightSidebarWidget(self.pipWidget) + self.activateLeftRightSidebarWidget(self.pipWidget) self.pipWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason) def __activateCondaWidget(self): @@ -5976,7 +5994,7 @@ self.rToolboxDock.show() self.rToolbox.setCurrentWidget(self.condaWidget) elif self.__layoutType == "Sidebars": - self.__activateLeftRightSidebarWidget(self.condaWidget) + self.activateLeftRightSidebarWidget(self.condaWidget) self.condaWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason) def __activateMicroPython(self): @@ -5988,7 +6006,7 @@ self.rToolboxDock.show() self.rToolbox.setCurrentWidget(self.microPythonWidget) elif self.__layoutType == "Sidebars": - self.__activateLeftRightSidebarWidget(self.microPythonWidget) + self.activateLeftRightSidebarWidget(self.microPythonWidget) self.microPythonWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason) def __toggleWindow(self, w): @@ -6303,9 +6321,7 @@ Private slot to start the FIDO2 Security Key Management. """ fido2Mgmt = os.path.join(os.path.dirname(__file__), "..", "eric7_fido2.py") - QProcess.startDetached( - PythonUtilities.getPythonExecutable(), [fido2Mgmt] - ) + QProcess.startDetached(PythonUtilities.getPythonExecutable(), [fido2Mgmt]) def __customViewer(self, home=None): """ @@ -8158,7 +8174,7 @@ self.rToolboxDock.show() self.rToolbox.setCurrentWidget(self.__helpViewerWidget) elif self.__layoutType == "Sidebars": - self.__activateLeftRightSidebarWidget(self.__helpViewerWidget) + self.activateLeftRightSidebarWidget(self.__helpViewerWidget) self.__helpViewerWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason) url = None @@ -8306,7 +8322,7 @@ self.rToolboxDock.show() self.rToolbox.setCurrentWidget(self.pluginRepositoryViewer) elif self.__layoutType == "Sidebars": - self.__activateLeftRightSidebarWidget(self.pluginRepositoryViewer) + self.activateLeftRightSidebarWidget(self.pluginRepositoryViewer) self.pluginRepositoryViewer.setFocus(Qt.FocusReason.ActiveWindowFocusReason) ################################################################# @@ -8825,7 +8841,7 @@ self.rToolboxDock.show() self.rToolbox.setCurrentWidget(self.__virtualenvManagerWidget) elif self.__layoutType == "Sidebars": - self.__activateLeftRightSidebarWidget(self.__virtualenvManagerWidget) + self.activateLeftRightSidebarWidget(self.__virtualenvManagerWidget) self.__virtualenvManagerWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason) ############################################################