UI/UserInterface.py

changeset 6434
872d10fa686a
parent 6433
92680b6a3585
child 6455
22a6fc33ab6d
child 6477
096fefd24a26
equal deleted inserted replaced
6433:92680b6a3585 6434:872d10fa686a
207 self.__noOpenAtStartup = noOpenAtStartup 207 self.__noOpenAtStartup = noOpenAtStartup
208 self.__noCrashOpenAtStartup = noCrashOpenAtStartup 208 self.__noCrashOpenAtStartup = noCrashOpenAtStartup
209 self.__disableCrashSession = disableCrashSession 209 self.__disableCrashSession = disableCrashSession
210 self.__disabledPlugins = disabledPlugins[:] 210 self.__disabledPlugins = disabledPlugins[:]
211 211
212 self.layoutType = Preferences.getUI("LayoutType") 212 self.__layoutType = Preferences.getUI("LayoutType")
213 213
214 self.passiveMode = Preferences.getDebugger("PassiveDbgEnabled") 214 self.passiveMode = Preferences.getDebugger("PassiveDbgEnabled")
215 215
216 g = Preferences.getGeometry("MainGeometry") 216 g = Preferences.getGeometry("MainGeometry")
217 if g.isEmpty(): 217 if g.isEmpty():
760 from .Previewer import Previewer 760 from .Previewer import Previewer
761 self.__previewer = Previewer(self.viewmanager, splitter) 761 self.__previewer = Previewer(self.viewmanager, splitter)
762 splitter.addWidget(self.__previewer) 762 splitter.addWidget(self.__previewer)
763 763
764 # Create layout with toolbox windows embedded in dock windows 764 # Create layout with toolbox windows embedded in dock windows
765 if self.layoutType == "Toolboxes": 765 if self.__layoutType == "Toolboxes":
766 logging.debug("Creating toolboxes...") 766 logging.debug("Creating toolboxes...")
767 self.__createToolboxesLayout(debugServer) 767 self.__createToolboxesLayout(debugServer)
768 768
769 # Create layout with sidebar windows embedded in dock windows 769 # Create layout with sidebar windows embedded in dock windows
770 elif self.layoutType == "Sidebars": 770 elif self.__layoutType == "Sidebars":
771 logging.debug("Creating sidebars...") 771 logging.debug("Creating sidebars...")
772 self.__createSidebarsLayout(debugServer) 772 self.__createSidebarsLayout(debugServer)
773 773
774 else: 774 else:
775 raise ValueError("Wrong layout type given ({0})".format( 775 raise ValueError("Wrong layout type given ({0})".format(
776 self.layoutType)) 776 self.__layoutType))
777 logging.debug("Created Layout") 777 logging.debug("Created Layout")
778 778
779 def __createToolboxesLayout(self, debugServer): 779 def __createToolboxesLayout(self, debugServer):
780 """ 780 """
781 Private method to create the Toolboxes layout. 781 Private method to create the Toolboxes layout.
1112 @param icon icon to be used (QIcon) 1112 @param icon icon to be used (QIcon)
1113 @param label label text to be shown (string) 1113 @param label label text to be shown (string)
1114 """ 1114 """
1115 assert side in [UserInterface.LeftSide, UserInterface.BottomSide] 1115 assert side in [UserInterface.LeftSide, UserInterface.BottomSide]
1116 1116
1117 if self.layoutType == "Toolboxes": 1117 if self.__layoutType == "Toolboxes":
1118 if side == UserInterface.LeftSide: 1118 if side == UserInterface.LeftSide:
1119 self.lToolbox.addItem(widget, icon, label) 1119 self.lToolbox.addItem(widget, icon, label)
1120 elif side == UserInterface.BottomSide: 1120 elif side == UserInterface.BottomSide:
1121 self.hToolbox.addItem(widget, icon, label) 1121 self.hToolbox.addItem(widget, icon, label)
1122 elif side == UserInterface.RightSide: 1122 elif side == UserInterface.RightSide:
1123 self.rToolbox.addItem(widget, icon, label) 1123 self.rToolbox.addItem(widget, icon, label)
1124 elif self.layoutType == "Sidebars": 1124 elif self.__layoutType == "Sidebars":
1125 if side == UserInterface.LeftSide: 1125 if side == UserInterface.LeftSide:
1126 self.leftSidebar.addTab(widget, icon, label) 1126 self.leftSidebar.addTab(widget, icon, label)
1127 elif side == UserInterface.BottomSide: 1127 elif side == UserInterface.BottomSide:
1128 self.bottomSidebar.addTab(widget, icon, label) 1128 self.bottomSidebar.addTab(widget, icon, label)
1129 elif side == UserInterface.RightSide: 1129 elif side == UserInterface.RightSide:
1133 """ 1133 """
1134 Public method to remove a widget added using addSideWidget(). 1134 Public method to remove a widget added using addSideWidget().
1135 1135
1136 @param widget reference to the widget to remove (QWidget) 1136 @param widget reference to the widget to remove (QWidget)
1137 """ 1137 """
1138 if self.layoutType == "Toolboxes": 1138 if self.__layoutType == "Toolboxes":
1139 for container in [self.lToolbox, self.hToolbox, self.rToolbox]: 1139 for container in [self.lToolbox, self.hToolbox, self.rToolbox]:
1140 index = container.indexOf(widget) 1140 index = container.indexOf(widget)
1141 if index != -1: 1141 if index != -1:
1142 container.removeItem(index) 1142 container.removeItem(index)
1143 elif self.layoutType == "Sidebars": 1143 elif self.__layoutType == "Sidebars":
1144 for container in [self.leftSidebar, self.bottomSidebar, 1144 for container in [self.leftSidebar, self.bottomSidebar,
1145 self.rightSidebar]: 1145 self.rightSidebar]:
1146 index = container.indexOf(widget) 1146 index = container.indexOf(widget)
1147 if index != -1: 1147 if index != -1:
1148 container.removeTab(index) 1148 container.removeTab(index)
1150 def showLogViewer(self): 1150 def showLogViewer(self):
1151 """ 1151 """
1152 Public method to show the Log-Viewer. 1152 Public method to show the Log-Viewer.
1153 """ 1153 """
1154 if Preferences.getUI("LogViewerAutoRaise"): 1154 if Preferences.getUI("LogViewerAutoRaise"):
1155 if self.layoutType == "Toolboxes": 1155 if self.__layoutType == "Toolboxes":
1156 self.hToolboxDock.show() 1156 self.hToolboxDock.show()
1157 self.hToolbox.setCurrentWidget(self.logViewer) 1157 self.hToolbox.setCurrentWidget(self.logViewer)
1158 self.hToolboxDock.raise_() 1158 self.hToolboxDock.raise_()
1159 elif self.layoutType == "Sidebars": 1159 elif self.__layoutType == "Sidebars":
1160 self.bottomSidebar.show() 1160 self.bottomSidebar.show()
1161 self.bottomSidebar.setCurrentWidget(self.logViewer) 1161 self.bottomSidebar.setCurrentWidget(self.logViewer)
1162 self.bottomSidebar.raise_() 1162 self.bottomSidebar.raise_()
1163 if self.bottomSidebar.isAutoHiding(): 1163 if self.bottomSidebar.isAutoHiding():
1164 self.bottomSidebar.setFocus() 1164 self.bottomSidebar.setFocus()
3824 self.__menus["window"].clear() 3824 self.__menus["window"].clear()
3825 3825
3826 self.__menus["window"].addActions(self.viewProfileActGrp.actions()) 3826 self.__menus["window"].addActions(self.viewProfileActGrp.actions())
3827 self.__menus["window"].addSeparator() 3827 self.__menus["window"].addSeparator()
3828 3828
3829 if self.layoutType == "Toolboxes": 3829 if self.__layoutType == "Toolboxes":
3830 self.__menus["window"].addAction(self.ltAct) 3830 self.__menus["window"].addAction(self.ltAct)
3831 self.ltAct.setChecked(not self.lToolboxDock.isHidden()) 3831 self.ltAct.setChecked(not self.lToolboxDock.isHidden())
3832 self.__menus["window"].addAction(self.rtAct) 3832 self.__menus["window"].addAction(self.rtAct)
3833 self.rtAct.setChecked(not self.lToolboxDock.isHidden()) 3833 self.rtAct.setChecked(not self.lToolboxDock.isHidden())
3834 self.__menus["window"].addAction(self.htAct) 3834 self.__menus["window"].addAction(self.htAct)
3835 self.htAct.setChecked(not self.hToolboxDock.isHidden()) 3835 self.htAct.setChecked(not self.hToolboxDock.isHidden())
3836 elif self.layoutType == "Sidebars": 3836 elif self.__layoutType == "Sidebars":
3837 self.__menus["window"].addAction(self.lsbAct) 3837 self.__menus["window"].addAction(self.lsbAct)
3838 self.lsbAct.setChecked(not self.leftSidebar.isHidden()) 3838 self.lsbAct.setChecked(not self.leftSidebar.isHidden())
3839 self.__menus["window"].addAction(self.rsbAct) 3839 self.__menus["window"].addAction(self.rsbAct)
3840 self.rsbAct.setChecked(not self.rightSidebar.isHidden()) 3840 self.rsbAct.setChecked(not self.rightSidebar.isHidden())
3841 self.__menus["window"].addAction(self.bsbAct) 3841 self.__menus["window"].addAction(self.bsbAct)
3956 @param save flag indicating that the current profile should 3956 @param save flag indicating that the current profile should
3957 be saved (boolean) 3957 be saved (boolean)
3958 """ 3958 """
3959 if self.currentProfile and save: 3959 if self.currentProfile and save:
3960 # step 1: save the window geometries of the active profile 3960 # step 1: save the window geometries of the active profile
3961 if self.layoutType in ["Toolboxes", "Sidebars"]: 3961 if self.__layoutType in ["Toolboxes", "Sidebars"]:
3962 state = self.saveState() 3962 state = self.saveState()
3963 self.profiles[self.currentProfile][0] = state 3963 self.profiles[self.currentProfile][0] = state
3964 if self.layoutType == "Sidebars": 3964 if self.__layoutType == "Sidebars":
3965 state = self.leftSplitter.saveState() 3965 state = self.leftSplitter.saveState()
3966 self.profiles[self.currentProfile][2][0] = state 3966 self.profiles[self.currentProfile][2][0] = state
3967 state = self.verticalSplitter.saveState() 3967 state = self.verticalSplitter.saveState()
3968 self.profiles[self.currentProfile][2][1] = state 3968 self.profiles[self.currentProfile][2][1] = state
3969 state = self.leftSidebar.saveState() 3969 state = self.leftSidebar.saveState()
3973 state = self.rightSplitter.saveState() 3973 state = self.rightSplitter.saveState()
3974 self.profiles[self.currentProfile][2][4] = state 3974 self.profiles[self.currentProfile][2][4] = state
3975 state = self.rightSidebar.saveState() 3975 state = self.rightSidebar.saveState()
3976 self.profiles[self.currentProfile][2][5] = state 3976 self.profiles[self.currentProfile][2][5] = state
3977 # step 2: save the visibility of the windows of the active profile 3977 # step 2: save the visibility of the windows of the active profile
3978 if self.layoutType == "Toolboxes": 3978 if self.__layoutType == "Toolboxes":
3979 self.profiles[self.currentProfile][1][0] = \ 3979 self.profiles[self.currentProfile][1][0] = \
3980 self.lToolboxDock.isVisible() 3980 self.lToolboxDock.isVisible()
3981 self.profiles[self.currentProfile][1][1] = \ 3981 self.profiles[self.currentProfile][1][1] = \
3982 self.hToolboxDock.isVisible() 3982 self.hToolboxDock.isVisible()
3983 self.profiles[self.currentProfile][1][2] = \ 3983 self.profiles[self.currentProfile][1][2] = \
3984 self.rToolboxDock.isVisible() 3984 self.rToolboxDock.isVisible()
3985 elif self.layoutType == "Sidebars": 3985 elif self.__layoutType == "Sidebars":
3986 self.profiles[self.currentProfile][1][0] = \ 3986 self.profiles[self.currentProfile][1][0] = \
3987 self.leftSidebar.isVisible() 3987 self.leftSidebar.isVisible()
3988 self.profiles[self.currentProfile][1][1] = \ 3988 self.profiles[self.currentProfile][1][1] = \
3989 self.bottomSidebar.isVisible() 3989 self.bottomSidebar.isVisible()
3990 self.profiles[self.currentProfile][1][2] = \ 3990 self.profiles[self.currentProfile][1][2] = \
4002 if self.currentProfile != name or not save: 4002 if self.currentProfile != name or not save:
4003 # step 1: save the active profile 4003 # step 1: save the active profile
4004 self.__saveCurrentViewProfile(save) 4004 self.__saveCurrentViewProfile(save)
4005 4005
4006 # step 2: set the window geometries of the new profile 4006 # step 2: set the window geometries of the new profile
4007 if self.layoutType in ["Toolboxes", "Sidebars"]: 4007 if self.__layoutType in ["Toolboxes", "Sidebars"]:
4008 state = self.profiles[name][0] 4008 state = self.profiles[name][0]
4009 if not state.isEmpty(): 4009 if not state.isEmpty():
4010 self.restoreState(state) 4010 self.restoreState(state)
4011 if self.layoutType == "Sidebars": 4011 if self.__layoutType == "Sidebars":
4012 state = self.profiles[name][2][0] 4012 state = self.profiles[name][2][0]
4013 if not state.isEmpty(): 4013 if not state.isEmpty():
4014 self.leftSplitter.restoreState(state) 4014 self.leftSplitter.restoreState(state)
4015 state = self.profiles[name][2][1] 4015 state = self.profiles[name][2][1]
4016 if not state.isEmpty(): 4016 if not state.isEmpty():
4028 if not state.isEmpty(): 4028 if not state.isEmpty():
4029 self.rightSidebar.restoreState(state) 4029 self.rightSidebar.restoreState(state)
4030 self.__configureDockareaCornerUsage() 4030 self.__configureDockareaCornerUsage()
4031 4031
4032 # step 3: activate the windows of the new profile 4032 # step 3: activate the windows of the new profile
4033 if self.layoutType == "Toolboxes": 4033 if self.__layoutType == "Toolboxes":
4034 self.lToolboxDock.setVisible(self.profiles[name][1][0]) 4034 self.lToolboxDock.setVisible(self.profiles[name][1][0])
4035 self.hToolboxDock.setVisible(self.profiles[name][1][1]) 4035 self.hToolboxDock.setVisible(self.profiles[name][1][1])
4036 self.rToolboxDock.setVisible(self.profiles[name][1][2]) 4036 self.rToolboxDock.setVisible(self.profiles[name][1][2])
4037 elif self.layoutType == "Sidebars": 4037 elif self.__layoutType == "Sidebars":
4038 self.leftSidebar.setVisible(self.profiles[name][1][0]) 4038 self.leftSidebar.setVisible(self.profiles[name][1][0])
4039 self.bottomSidebar.setVisible(self.profiles[name][1][1]) 4039 self.bottomSidebar.setVisible(self.profiles[name][1][1])
4040 self.rightSidebar.setVisible(self.profiles[name][1][2]) 4040 self.rightSidebar.setVisible(self.profiles[name][1][2])
4041 4041
4042 # step 4: remember the new profile 4042 # step 4: remember the new profile
4055 def __debuggingStarted(self): 4055 def __debuggingStarted(self):
4056 """ 4056 """
4057 Private slot to handle the start of a debugging session. 4057 Private slot to handle the start of a debugging session.
4058 """ 4058 """
4059 self.setDebugProfile() 4059 self.setDebugProfile()
4060 if self.layoutType == "Toolboxes": 4060 if self.__layoutType == "Toolboxes":
4061 self.__currentRightWidget = self.rToolbox.currentWidget() 4061 self.__currentRightWidget = self.rToolbox.currentWidget()
4062 self.rToolbox.setCurrentWidget(self.debugViewer) 4062 self.rToolbox.setCurrentWidget(self.debugViewer)
4063 self.__currentBottomWidget = self.hToolbox.currentWidget() 4063 self.__currentBottomWidget = self.hToolbox.currentWidget()
4064 self.hToolbox.setCurrentWidget(self.shellAssembly) 4064 self.hToolbox.setCurrentWidget(self.shellAssembly)
4065 elif self.layoutType == "Sidebars": 4065 elif self.__layoutType == "Sidebars":
4066 self.__currentRightWidget = self.rightSidebar.currentWidget() 4066 self.__currentRightWidget = self.rightSidebar.currentWidget()
4067 self.rightSidebar.setCurrentWidget(self.debugViewer) 4067 self.rightSidebar.setCurrentWidget(self.debugViewer)
4068 self.__currentBottomWidget = self.bottomSidebar.currentWidget() 4068 self.__currentBottomWidget = self.bottomSidebar.currentWidget()
4069 self.bottomSidebar.setCurrentWidget(self.shellAssembly) 4069 self.bottomSidebar.setCurrentWidget(self.shellAssembly)
4070 4070
4071 def __debuggingDone(self): 4071 def __debuggingDone(self):
4072 """ 4072 """
4073 Private slot to handle the end of a debugging session. 4073 Private slot to handle the end of a debugging session.
4074 """ 4074 """
4075 self.__setEditProfile() 4075 self.__setEditProfile()
4076 if self.layoutType == "Toolboxes": 4076 if self.__layoutType == "Toolboxes":
4077 if self.__currentRightWidget: 4077 if self.__currentRightWidget:
4078 self.rToolbox.setCurrentWidget(self.__currentRightWidget) 4078 self.rToolbox.setCurrentWidget(self.__currentRightWidget)
4079 if self.__currentBottomWidget: 4079 if self.__currentBottomWidget:
4080 self.hToolbox.setCurrentWidget(self.__currentBottomWidget) 4080 self.hToolbox.setCurrentWidget(self.__currentBottomWidget)
4081 elif self.layoutType == "Sidebars": 4081 elif self.__layoutType == "Sidebars":
4082 if self.__currentRightWidget: 4082 if self.__currentRightWidget:
4083 self.rightSidebar.setCurrentWidget(self.__currentRightWidget) 4083 self.rightSidebar.setCurrentWidget(self.__currentRightWidget)
4084 if self.__currentBottomWidget: 4084 if self.__currentBottomWidget:
4085 self.bottomSidebar.setCurrentWidget(self.__currentBottomWidget) 4085 self.bottomSidebar.setCurrentWidget(self.__currentBottomWidget)
4086 self.__currentRightWidget = None 4086 self.__currentRightWidget = None
4116 Public method to get the current view profile. 4116 Public method to get the current view profile.
4117 4117
4118 @return the name of the current view profile (string) 4118 @return the name of the current view profile (string)
4119 """ 4119 """
4120 return self.currentProfile 4120 return self.currentProfile
4121 4121
4122 def getLayoutType(self):
4123 """
4124 Public method to get the current layout type.
4125
4126 @return current layout type
4127 @rtype str
4128 """
4129 return self.__layoutType
4130
4122 def __activateProjectBrowser(self): 4131 def __activateProjectBrowser(self):
4123 """ 4132 """
4124 Private slot to handle the activation of the project browser. 4133 Private slot to handle the activation of the project browser.
4125 """ 4134 """
4126 if self.layoutType == "Toolboxes": 4135 if self.__layoutType == "Toolboxes":
4127 self.lToolboxDock.show() 4136 self.lToolboxDock.show()
4128 self.lToolbox.setCurrentWidget(self.projectBrowser) 4137 self.lToolbox.setCurrentWidget(self.projectBrowser)
4129 elif self.layoutType == "Sidebars": 4138 elif self.__layoutType == "Sidebars":
4130 self.leftSidebar.show() 4139 self.leftSidebar.show()
4131 self.leftSidebar.setCurrentWidget(self.projectBrowser) 4140 self.leftSidebar.setCurrentWidget(self.projectBrowser)
4132 else: 4141 else:
4133 self.projectBrowser.show() 4142 self.projectBrowser.show()
4134 self.projectBrowser.currentWidget().setFocus( 4143 self.projectBrowser.currentWidget().setFocus(
4136 4145
4137 def __activateMultiProjectBrowser(self): 4146 def __activateMultiProjectBrowser(self):
4138 """ 4147 """
4139 Private slot to handle the activation of the project browser. 4148 Private slot to handle the activation of the project browser.
4140 """ 4149 """
4141 if self.layoutType == "Toolboxes": 4150 if self.__layoutType == "Toolboxes":
4142 self.lToolboxDock.show() 4151 self.lToolboxDock.show()
4143 self.lToolbox.setCurrentWidget(self.multiProjectBrowser) 4152 self.lToolbox.setCurrentWidget(self.multiProjectBrowser)
4144 elif self.layoutType == "Sidebars": 4153 elif self.__layoutType == "Sidebars":
4145 self.leftSidebar.show() 4154 self.leftSidebar.show()
4146 self.leftSidebar.setCurrentWidget(self.multiProjectBrowser) 4155 self.leftSidebar.setCurrentWidget(self.multiProjectBrowser)
4147 else: 4156 else:
4148 self.multiProjectBrowser.show() 4157 self.multiProjectBrowser.show()
4149 self.multiProjectBrowser.setFocus(Qt.ActiveWindowFocusReason) 4158 self.multiProjectBrowser.setFocus(Qt.ActiveWindowFocusReason)
4150 4159
4151 def activateDebugViewer(self): 4160 def activateDebugViewer(self):
4152 """ 4161 """
4153 Public slot to handle the activation of the debug viewer. 4162 Public slot to handle the activation of the debug viewer.
4154 """ 4163 """
4155 if self.layoutType == "Toolboxes": 4164 if self.__layoutType == "Toolboxes":
4156 self.rToolboxDock.show() 4165 self.rToolboxDock.show()
4157 self.rToolbox.setCurrentWidget(self.debugViewer) 4166 self.rToolbox.setCurrentWidget(self.debugViewer)
4158 elif self.layoutType == "Sidebars": 4167 elif self.__layoutType == "Sidebars":
4159 self.rightSidebar.show() 4168 self.rightSidebar.show()
4160 self.rightSidebar.setCurrentWidget(self.debugViewer) 4169 self.rightSidebar.setCurrentWidget(self.debugViewer)
4161 else: 4170 else:
4162 self.debugViewer.show() 4171 self.debugViewer.show()
4163 self.debugViewer.currentWidget().setFocus(Qt.ActiveWindowFocusReason) 4172 self.debugViewer.currentWidget().setFocus(Qt.ActiveWindowFocusReason)
4164 4173
4165 def __activateShell(self): 4174 def __activateShell(self):
4166 """ 4175 """
4167 Private slot to handle the activation of the Shell window. 4176 Private slot to handle the activation of the Shell window.
4168 """ 4177 """
4169 if self.layoutType == "Toolboxes": 4178 if self.__layoutType == "Toolboxes":
4170 self.hToolboxDock.show() 4179 self.hToolboxDock.show()
4171 self.hToolbox.setCurrentWidget(self.shellAssembly) 4180 self.hToolbox.setCurrentWidget(self.shellAssembly)
4172 elif self.layoutType == "Sidebars": 4181 elif self.__layoutType == "Sidebars":
4173 self.bottomSidebar.show() 4182 self.bottomSidebar.show()
4174 self.bottomSidebar.setCurrentWidget(self.shellAssembly) 4183 self.bottomSidebar.setCurrentWidget(self.shellAssembly)
4175 else: 4184 else:
4176 self.shell.show() 4185 self.shell.show()
4177 self.shell.setFocus(Qt.ActiveWindowFocusReason) 4186 self.shell.setFocus(Qt.ActiveWindowFocusReason)
4178 4187
4179 def __activateLogViewer(self): 4188 def __activateLogViewer(self):
4180 """ 4189 """
4181 Private slot to handle the activation of the Log Viewer. 4190 Private slot to handle the activation of the Log Viewer.
4182 """ 4191 """
4183 if self.layoutType == "Toolboxes": 4192 if self.__layoutType == "Toolboxes":
4184 self.hToolboxDock.show() 4193 self.hToolboxDock.show()
4185 self.hToolbox.setCurrentWidget(self.logViewer) 4194 self.hToolbox.setCurrentWidget(self.logViewer)
4186 elif self.layoutType == "Sidebars": 4195 elif self.__layoutType == "Sidebars":
4187 self.bottomSidebar.show() 4196 self.bottomSidebar.show()
4188 self.bottomSidebar.setCurrentWidget(self.logViewer) 4197 self.bottomSidebar.setCurrentWidget(self.logViewer)
4189 else: 4198 else:
4190 self.logViewer.show() 4199 self.logViewer.show()
4191 self.logViewer.setFocus(Qt.ActiveWindowFocusReason) 4200 self.logViewer.setFocus(Qt.ActiveWindowFocusReason)
4192 4201
4193 def __activateTaskViewer(self): 4202 def __activateTaskViewer(self):
4194 """ 4203 """
4195 Private slot to handle the activation of the Task Viewer. 4204 Private slot to handle the activation of the Task Viewer.
4196 """ 4205 """
4197 if self.layoutType == "Toolboxes": 4206 if self.__layoutType == "Toolboxes":
4198 self.hToolboxDock.show() 4207 self.hToolboxDock.show()
4199 self.hToolbox.setCurrentWidget(self.taskViewer) 4208 self.hToolbox.setCurrentWidget(self.taskViewer)
4200 elif self.layoutType == "Sidebars": 4209 elif self.__layoutType == "Sidebars":
4201 self.bottomSidebar.show() 4210 self.bottomSidebar.show()
4202 self.bottomSidebar.setCurrentWidget(self.taskViewer) 4211 self.bottomSidebar.setCurrentWidget(self.taskViewer)
4203 else: 4212 else:
4204 self.taskViewer.show() 4213 self.taskViewer.show()
4205 self.taskViewer.setFocus(Qt.ActiveWindowFocusReason) 4214 self.taskViewer.setFocus(Qt.ActiveWindowFocusReason)
4207 def __activateTemplateViewer(self): 4216 def __activateTemplateViewer(self):
4208 """ 4217 """
4209 Private slot to handle the activation of the Template Viewer. 4218 Private slot to handle the activation of the Template Viewer.
4210 """ 4219 """
4211 if self.templateViewer is not None: 4220 if self.templateViewer is not None:
4212 if self.layoutType == "Toolboxes": 4221 if self.__layoutType == "Toolboxes":
4213 self.lToolboxDock.show() 4222 self.lToolboxDock.show()
4214 self.lToolbox.setCurrentWidget(self.templateViewer) 4223 self.lToolbox.setCurrentWidget(self.templateViewer)
4215 elif self.layoutType == "Sidebars": 4224 elif self.__layoutType == "Sidebars":
4216 self.leftSidebar.show() 4225 self.leftSidebar.show()
4217 self.leftSidebar.setCurrentWidget(self.templateViewer) 4226 self.leftSidebar.setCurrentWidget(self.templateViewer)
4218 else: 4227 else:
4219 self.templateViewer.show() 4228 self.templateViewer.show()
4220 self.templateViewer.setFocus(Qt.ActiveWindowFocusReason) 4229 self.templateViewer.setFocus(Qt.ActiveWindowFocusReason)
4222 def __activateBrowser(self): 4231 def __activateBrowser(self):
4223 """ 4232 """
4224 Private slot to handle the activation of the file browser. 4233 Private slot to handle the activation of the file browser.
4225 """ 4234 """
4226 if self.browser is not None: 4235 if self.browser is not None:
4227 if self.layoutType == "Toolboxes": 4236 if self.__layoutType == "Toolboxes":
4228 self.lToolboxDock.show() 4237 self.lToolboxDock.show()
4229 self.lToolbox.setCurrentWidget(self.browser) 4238 self.lToolbox.setCurrentWidget(self.browser)
4230 elif self.layoutType == "Sidebars": 4239 elif self.__layoutType == "Sidebars":
4231 self.leftSidebar.show() 4240 self.leftSidebar.show()
4232 self.leftSidebar.setCurrentWidget(self.browser) 4241 self.leftSidebar.setCurrentWidget(self.browser)
4233 else: 4242 else:
4234 self.browser.show() 4243 self.browser.show()
4235 self.browser.setFocus(Qt.ActiveWindowFocusReason) 4244 self.browser.setFocus(Qt.ActiveWindowFocusReason)
4312 def activateCooperationViewer(self): 4321 def activateCooperationViewer(self):
4313 """ 4322 """
4314 Public slot to handle the activation of the cooperation window. 4323 Public slot to handle the activation of the cooperation window.
4315 """ 4324 """
4316 if self.cooperation is not None: 4325 if self.cooperation is not None:
4317 if self.layoutType == "Toolboxes": 4326 if self.__layoutType == "Toolboxes":
4318 self.rToolboxDock.show() 4327 self.rToolboxDock.show()
4319 self.rToolbox.setCurrentWidget(self.cooperation) 4328 self.rToolbox.setCurrentWidget(self.cooperation)
4320 elif self.layoutType == "Sidebars": 4329 elif self.__layoutType == "Sidebars":
4321 self.rightSidebar.show() 4330 self.rightSidebar.show()
4322 self.rightSidebar.setCurrentWidget(self.cooperation) 4331 self.rightSidebar.setCurrentWidget(self.cooperation)
4323 else: 4332 else:
4324 self.cooperation.show() 4333 self.cooperation.show()
4325 self.cooperation.setFocus(Qt.ActiveWindowFocusReason) 4334 self.cooperation.setFocus(Qt.ActiveWindowFocusReason)
4327 def __activateIRC(self): 4336 def __activateIRC(self):
4328 """ 4337 """
4329 Private slot to handle the activation of the IRC window. 4338 Private slot to handle the activation of the IRC window.
4330 """ 4339 """
4331 if self.irc is not None: 4340 if self.irc is not None:
4332 if self.layoutType == "Toolboxes": 4341 if self.__layoutType == "Toolboxes":
4333 self.rToolboxDock.show() 4342 self.rToolboxDock.show()
4334 self.rToolbox.setCurrentWidget(self.irc) 4343 self.rToolbox.setCurrentWidget(self.irc)
4335 elif self.layoutType == "Sidebars": 4344 elif self.__layoutType == "Sidebars":
4336 self.rightSidebar.show() 4345 self.rightSidebar.show()
4337 self.rightSidebar.setCurrentWidget(self.irc) 4346 self.rightSidebar.setCurrentWidget(self.irc)
4338 else: 4347 else:
4339 self.irc.show() 4348 self.irc.show()
4340 self.irc.setFocus(Qt.ActiveWindowFocusReason) 4349 self.irc.setFocus(Qt.ActiveWindowFocusReason)
4342 def __activateSymbolsViewer(self): 4351 def __activateSymbolsViewer(self):
4343 """ 4352 """
4344 Private slot to handle the activation of the Symbols Viewer. 4353 Private slot to handle the activation of the Symbols Viewer.
4345 """ 4354 """
4346 if self.symbolsViewer is not None: 4355 if self.symbolsViewer is not None:
4347 if self.layoutType == "Toolboxes": 4356 if self.__layoutType == "Toolboxes":
4348 self.lToolboxDock.show() 4357 self.lToolboxDock.show()
4349 self.lToolbox.setCurrentWidget(self.symbolsViewer) 4358 self.lToolbox.setCurrentWidget(self.symbolsViewer)
4350 elif self.layoutType == "Sidebars": 4359 elif self.__layoutType == "Sidebars":
4351 self.leftSidebar.show() 4360 self.leftSidebar.show()
4352 self.leftSidebar.setCurrentWidget(self.symbolsViewer) 4361 self.leftSidebar.setCurrentWidget(self.symbolsViewer)
4353 else: 4362 else:
4354 self.symbolsViewer.show() 4363 self.symbolsViewer.show()
4355 self.symbolsViewer.setFocus(Qt.ActiveWindowFocusReason) 4364 self.symbolsViewer.setFocus(Qt.ActiveWindowFocusReason)
4357 def __activateNumbersViewer(self): 4366 def __activateNumbersViewer(self):
4358 """ 4367 """
4359 Private slot to handle the activation of the Numbers Viewer. 4368 Private slot to handle the activation of the Numbers Viewer.
4360 """ 4369 """
4361 if self.numbersViewer is not None: 4370 if self.numbersViewer is not None:
4362 if self.layoutType == "Toolboxes": 4371 if self.__layoutType == "Toolboxes":
4363 self.hToolboxDock.show() 4372 self.hToolboxDock.show()
4364 self.hToolbox.setCurrentWidget(self.numbersViewer) 4373 self.hToolbox.setCurrentWidget(self.numbersViewer)
4365 elif self.layoutType == "Sidebars": 4374 elif self.__layoutType == "Sidebars":
4366 self.bottomSidebar.show() 4375 self.bottomSidebar.show()
4367 self.bottomSidebar.setCurrentWidget(self.numbersViewer) 4376 self.bottomSidebar.setCurrentWidget(self.numbersViewer)
4368 else: 4377 else:
4369 self.numbersViewer.show() 4378 self.numbersViewer.show()
4370 self.numbersViewer.setFocus(Qt.ActiveWindowFocusReason) 4379 self.numbersViewer.setFocus(Qt.ActiveWindowFocusReason)
4383 4392
4384 @param switchFocus flag indicating to transfer the input focus 4393 @param switchFocus flag indicating to transfer the input focus
4385 @type bool 4394 @type bool
4386 """ 4395 """
4387 if self.codeDocumentationViewer is not None: 4396 if self.codeDocumentationViewer is not None:
4388 if self.layoutType == "Toolboxes": 4397 if self.__layoutType == "Toolboxes":
4389 self.rToolboxDock.show() 4398 self.rToolboxDock.show()
4390 self.rToolbox.setCurrentWidget(self.codeDocumentationViewer) 4399 self.rToolbox.setCurrentWidget(self.codeDocumentationViewer)
4391 elif self.layoutType == "Sidebars": 4400 elif self.__layoutType == "Sidebars":
4392 self.rightSidebar.show() 4401 self.rightSidebar.show()
4393 self.rightSidebar.setCurrentWidget( 4402 self.rightSidebar.setCurrentWidget(
4394 self.codeDocumentationViewer) 4403 self.codeDocumentationViewer)
4395 else: 4404 else:
4396 self.codeDocumentationViewer.show() 4405 self.codeDocumentationViewer.show()
5797 5806
5798 from QScintilla.SpellChecker import SpellChecker 5807 from QScintilla.SpellChecker import SpellChecker
5799 SpellChecker.setDefaultLanguage( 5808 SpellChecker.setDefaultLanguage(
5800 Preferences.getEditor("SpellCheckingDefaultLanguage")) 5809 Preferences.getEditor("SpellCheckingDefaultLanguage"))
5801 5810
5802 if self.layoutType == "Sidebars": 5811 if self.__layoutType == "Sidebars":
5803 delay = Preferences.getUI("SidebarDelay") 5812 delay = Preferences.getUI("SidebarDelay")
5804 self.leftSidebar.setDelay(delay) 5813 self.leftSidebar.setDelay(delay)
5805 self.bottomSidebar.setDelay(delay) 5814 self.bottomSidebar.setDelay(delay)
5806 self.rightSidebar.setDelay(delay) 5815 self.rightSidebar.setDelay(delay)
5807 5816
5861 def __configViewProfiles(self): 5870 def __configViewProfiles(self):
5862 """ 5871 """
5863 Private slot to configure the various view profiles. 5872 Private slot to configure the various view profiles.
5864 """ 5873 """
5865 from Preferences.ViewProfileDialog import ViewProfileDialog 5874 from Preferences.ViewProfileDialog import ViewProfileDialog
5866 dlg = ViewProfileDialog(self.layoutType, self.profiles['edit'][1], 5875 dlg = ViewProfileDialog(self.__layoutType, self.profiles['edit'][1],
5867 self.profiles['debug'][1]) 5876 self.profiles['debug'][1])
5868 if dlg.exec_() == QDialog.Accepted: 5877 if dlg.exec_() == QDialog.Accepted:
5869 edit, debug = dlg.getVisibilities() 5878 edit, debug = dlg.getVisibilities()
5870 self.profiles['edit'][1] = edit 5879 self.profiles['edit'][1] = edit
5871 self.profiles['debug'][1] = debug 5880 self.profiles['debug'][1] = debug
6563 6572
6564 self.pluginManager.doShutdown() 6573 self.pluginManager.doShutdown()
6565 6574
6566 self.virtualenvManager.shutdown() 6575 self.virtualenvManager.shutdown()
6567 6576
6568 if self.layoutType == "Sidebars": 6577 if self.__layoutType == "Sidebars":
6569 self.leftSidebar.shutdown() 6578 self.leftSidebar.shutdown()
6570 self.bottomSidebar.shutdown() 6579 self.bottomSidebar.shutdown()
6571 self.rightSidebar.shutdown() 6580 self.rightSidebar.shutdown()
6572 6581
6573 if self.SAServer is not None: 6582 if self.SAServer is not None:

eric ide

mercurial