src/eric7/UI/UserInterface.py

branch
eric7
changeset 10877
83e79644616a
parent 10862
c14dae55e9d8
child 10892
409d010d7cae
child 10905
487adcd8dfa7
equal deleted inserted replaced
10876:ec224611090e 10877:83e79644616a
5641 @return current layout type 5641 @return current layout type
5642 @rtype str 5642 @rtype str
5643 """ 5643 """
5644 return self.__layoutType 5644 return self.__layoutType
5645 5645
5646 def __activateLeftRightSidebarWidget(self, widget): 5646 def setLeftRightSidebarWidgetIcon(self, widget, icon):
5647 """ 5647 """
5648 Private method to activate the given widget in the left or right 5648 Public method to set the icon of the given widget in the left or right
5649 sidebar.
5650
5651 @param widget reference to the widget to set the icon for
5652 @type QWidget
5653 @param icon icon to be set
5654 @type QIcon
5655 """
5656 sidebar = (
5657 self.leftSidebar
5658 if Preferences.getUI("CombinedLeftRightSidebar")
5659 else self.rightSidebar
5660 )
5661 index = sidebar.indexOf(widget)
5662 sidebar.setTabIcon(index, icon)
5663
5664 def activateLeftRightSidebarWidget(self, widget):
5665 """
5666 Public method to activate the given widget in the left or right
5649 sidebar. 5667 sidebar.
5650 5668
5651 @param widget reference to the widget to be activated 5669 @param widget reference to the widget to be activated
5652 @type QWidget 5670 @type QWidget
5653 """ 5671 """
5692 """ 5710 """
5693 if self.__layoutType == "Toolboxes": 5711 if self.__layoutType == "Toolboxes":
5694 self.rToolboxDock.show() 5712 self.rToolboxDock.show()
5695 self.rToolbox.setCurrentWidget(self.debugViewer) 5713 self.rToolbox.setCurrentWidget(self.debugViewer)
5696 elif self.__layoutType == "Sidebars": 5714 elif self.__layoutType == "Sidebars":
5697 self.__activateLeftRightSidebarWidget(self.debugViewer) 5715 self.activateLeftRightSidebarWidget(self.debugViewer)
5698 self.debugViewer.currentWidget().setFocus( 5716 self.debugViewer.currentWidget().setFocus(
5699 Qt.FocusReason.ActiveWindowFocusReason 5717 Qt.FocusReason.ActiveWindowFocusReason
5700 ) 5718 )
5701 5719
5702 def __activateShell(self): 5720 def __activateShell(self):
5884 if self.cooperation is not None: 5902 if self.cooperation is not None:
5885 if self.__layoutType == "Toolboxes": 5903 if self.__layoutType == "Toolboxes":
5886 self.rToolboxDock.show() 5904 self.rToolboxDock.show()
5887 self.rToolbox.setCurrentWidget(self.cooperation) 5905 self.rToolbox.setCurrentWidget(self.cooperation)
5888 elif self.__layoutType == "Sidebars": 5906 elif self.__layoutType == "Sidebars":
5889 self.__activateLeftRightSidebarWidget(self.cooperation) 5907 self.activateLeftRightSidebarWidget(self.cooperation)
5890 self.cooperation.setFocus(Qt.FocusReason.ActiveWindowFocusReason) 5908 self.cooperation.setFocus(Qt.FocusReason.ActiveWindowFocusReason)
5891 5909
5892 def __activateIRC(self): 5910 def __activateIRC(self):
5893 """ 5911 """
5894 Private slot to handle the activation of the IRC window. 5912 Private slot to handle the activation of the IRC window.
5896 if self.irc is not None: 5914 if self.irc is not None:
5897 if self.__layoutType == "Toolboxes": 5915 if self.__layoutType == "Toolboxes":
5898 self.rToolboxDock.show() 5916 self.rToolboxDock.show()
5899 self.rToolbox.setCurrentWidget(self.irc) 5917 self.rToolbox.setCurrentWidget(self.irc)
5900 elif self.__layoutType == "Sidebars": 5918 elif self.__layoutType == "Sidebars":
5901 self.__activateLeftRightSidebarWidget(self.irc) 5919 self.activateLeftRightSidebarWidget(self.irc)
5902 self.irc.setFocus(Qt.FocusReason.ActiveWindowFocusReason) 5920 self.irc.setFocus(Qt.FocusReason.ActiveWindowFocusReason)
5903 5921
5904 def __activateSymbolsViewer(self): 5922 def __activateSymbolsViewer(self):
5905 """ 5923 """
5906 Private slot to handle the activation of the Symbols Viewer. 5924 Private slot to handle the activation of the Symbols Viewer.
5947 ): 5965 ):
5948 if self.__layoutType == "Toolboxes": 5966 if self.__layoutType == "Toolboxes":
5949 self.rToolboxDock.show() 5967 self.rToolboxDock.show()
5950 self.rToolbox.setCurrentWidget(self.codeDocumentationViewer) 5968 self.rToolbox.setCurrentWidget(self.codeDocumentationViewer)
5951 elif self.__layoutType == "Sidebars": 5969 elif self.__layoutType == "Sidebars":
5952 self.__activateLeftRightSidebarWidget(self.codeDocumentationViewer) 5970 self.activateLeftRightSidebarWidget(self.codeDocumentationViewer)
5953 if switchFocus: 5971 if switchFocus:
5954 self.codeDocumentationViewer.setFocus( 5972 self.codeDocumentationViewer.setFocus(
5955 Qt.FocusReason.ActiveWindowFocusReason 5973 Qt.FocusReason.ActiveWindowFocusReason
5956 ) 5974 )
5957 5975
5962 if self.pipWidget is not None: 5980 if self.pipWidget is not None:
5963 if self.__layoutType == "Toolboxes": 5981 if self.__layoutType == "Toolboxes":
5964 self.rToolboxDock.show() 5982 self.rToolboxDock.show()
5965 self.rToolbox.setCurrentWidget(self.pipWidget) 5983 self.rToolbox.setCurrentWidget(self.pipWidget)
5966 elif self.__layoutType == "Sidebars": 5984 elif self.__layoutType == "Sidebars":
5967 self.__activateLeftRightSidebarWidget(self.pipWidget) 5985 self.activateLeftRightSidebarWidget(self.pipWidget)
5968 self.pipWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason) 5986 self.pipWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason)
5969 5987
5970 def __activateCondaWidget(self): 5988 def __activateCondaWidget(self):
5971 """ 5989 """
5972 Private slot to handle the activation of the Conda manager widget. 5990 Private slot to handle the activation of the Conda manager widget.
5974 if self.condaWidget is not None: 5992 if self.condaWidget is not None:
5975 if self.__layoutType == "Toolboxes": 5993 if self.__layoutType == "Toolboxes":
5976 self.rToolboxDock.show() 5994 self.rToolboxDock.show()
5977 self.rToolbox.setCurrentWidget(self.condaWidget) 5995 self.rToolbox.setCurrentWidget(self.condaWidget)
5978 elif self.__layoutType == "Sidebars": 5996 elif self.__layoutType == "Sidebars":
5979 self.__activateLeftRightSidebarWidget(self.condaWidget) 5997 self.activateLeftRightSidebarWidget(self.condaWidget)
5980 self.condaWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason) 5998 self.condaWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason)
5981 5999
5982 def __activateMicroPython(self): 6000 def __activateMicroPython(self):
5983 """ 6001 """
5984 Private slot to handle the activation of the MicroPython widget. 6002 Private slot to handle the activation of the MicroPython widget.
5986 if self.microPythonWidget is not None: 6004 if self.microPythonWidget is not None:
5987 if self.__layoutType == "Toolboxes": 6005 if self.__layoutType == "Toolboxes":
5988 self.rToolboxDock.show() 6006 self.rToolboxDock.show()
5989 self.rToolbox.setCurrentWidget(self.microPythonWidget) 6007 self.rToolbox.setCurrentWidget(self.microPythonWidget)
5990 elif self.__layoutType == "Sidebars": 6008 elif self.__layoutType == "Sidebars":
5991 self.__activateLeftRightSidebarWidget(self.microPythonWidget) 6009 self.activateLeftRightSidebarWidget(self.microPythonWidget)
5992 self.microPythonWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason) 6010 self.microPythonWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason)
5993 6011
5994 def __toggleWindow(self, w): 6012 def __toggleWindow(self, w):
5995 """ 6013 """
5996 Private method to toggle a workspace editor window. 6014 Private method to toggle a workspace editor window.
6301 def __startFido2SecurityKeyMgmt(self): 6319 def __startFido2SecurityKeyMgmt(self):
6302 """ 6320 """
6303 Private slot to start the FIDO2 Security Key Management. 6321 Private slot to start the FIDO2 Security Key Management.
6304 """ 6322 """
6305 fido2Mgmt = os.path.join(os.path.dirname(__file__), "..", "eric7_fido2.py") 6323 fido2Mgmt = os.path.join(os.path.dirname(__file__), "..", "eric7_fido2.py")
6306 QProcess.startDetached( 6324 QProcess.startDetached(PythonUtilities.getPythonExecutable(), [fido2Mgmt])
6307 PythonUtilities.getPythonExecutable(), [fido2Mgmt]
6308 )
6309 6325
6310 def __customViewer(self, home=None): 6326 def __customViewer(self, home=None):
6311 """ 6327 """
6312 Private slot to start a custom viewer. 6328 Private slot to start a custom viewer.
6313 6329
8156 if self.__helpViewerWidget is not None: 8172 if self.__helpViewerWidget is not None:
8157 if self.__layoutType == "Toolboxes": 8173 if self.__layoutType == "Toolboxes":
8158 self.rToolboxDock.show() 8174 self.rToolboxDock.show()
8159 self.rToolbox.setCurrentWidget(self.__helpViewerWidget) 8175 self.rToolbox.setCurrentWidget(self.__helpViewerWidget)
8160 elif self.__layoutType == "Sidebars": 8176 elif self.__layoutType == "Sidebars":
8161 self.__activateLeftRightSidebarWidget(self.__helpViewerWidget) 8177 self.activateLeftRightSidebarWidget(self.__helpViewerWidget)
8162 self.__helpViewerWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason) 8178 self.__helpViewerWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason)
8163 8179
8164 url = None 8180 url = None
8165 searchWord = None 8181 searchWord = None
8166 8182
8304 8320
8305 if self.__layoutType == "Toolboxes": 8321 if self.__layoutType == "Toolboxes":
8306 self.rToolboxDock.show() 8322 self.rToolboxDock.show()
8307 self.rToolbox.setCurrentWidget(self.pluginRepositoryViewer) 8323 self.rToolbox.setCurrentWidget(self.pluginRepositoryViewer)
8308 elif self.__layoutType == "Sidebars": 8324 elif self.__layoutType == "Sidebars":
8309 self.__activateLeftRightSidebarWidget(self.pluginRepositoryViewer) 8325 self.activateLeftRightSidebarWidget(self.pluginRepositoryViewer)
8310 self.pluginRepositoryViewer.setFocus(Qt.FocusReason.ActiveWindowFocusReason) 8326 self.pluginRepositoryViewer.setFocus(Qt.FocusReason.ActiveWindowFocusReason)
8311 8327
8312 ################################################################# 8328 #################################################################
8313 ## Drag and Drop Support 8329 ## Drag and Drop Support
8314 ################################################################# 8330 #################################################################
8823 """ 8839 """
8824 if self.__layoutType == "Toolboxes": 8840 if self.__layoutType == "Toolboxes":
8825 self.rToolboxDock.show() 8841 self.rToolboxDock.show()
8826 self.rToolbox.setCurrentWidget(self.__virtualenvManagerWidget) 8842 self.rToolbox.setCurrentWidget(self.__virtualenvManagerWidget)
8827 elif self.__layoutType == "Sidebars": 8843 elif self.__layoutType == "Sidebars":
8828 self.__activateLeftRightSidebarWidget(self.__virtualenvManagerWidget) 8844 self.activateLeftRightSidebarWidget(self.__virtualenvManagerWidget)
8829 self.__virtualenvManagerWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason) 8845 self.__virtualenvManagerWidget.setFocus(Qt.FocusReason.ActiveWindowFocusReason)
8830 8846
8831 ############################################################ 8847 ############################################################
8832 ## Interface to the eric-ide server interface 8848 ## Interface to the eric-ide server interface
8833 ############################################################ 8849 ############################################################

eric ide

mercurial