eric7/UI/UserInterface.py

branch
eric7
changeset 8583
aac629a05f8b
parent 8580
e91b276e0771
child 8587
78971b458d25
equal deleted inserted replaced
8582:ae6032e4b4ef 8583:aac629a05f8b
1118 """ 1118 """
1119 from EricWidgets.EricSideBar import EricSideBar, EricSideBarSide 1119 from EricWidgets.EricSideBar import EricSideBar, EricSideBarSide
1120 1120
1121 logging.debug("Creating Sidebars Layout...") 1121 logging.debug("Creating Sidebars Layout...")
1122 1122
1123 delay = Preferences.getUI("SidebarDelay")
1124 # Create the left sidebar 1123 # Create the left sidebar
1125 self.leftSidebar = EricSideBar(EricSideBarSide.WEST, delay) 1124 self.leftSidebar = EricSideBar(EricSideBarSide.WEST)
1125 self.leftSidebar.setIconBarColor(Preferences.getUI("IconBarColor"))
1126 1126
1127 # Create the bottom sidebar 1127 # Create the bottom sidebar
1128 self.bottomSidebar = EricSideBar(EricSideBarSide.SOUTH, delay) 1128 self.bottomSidebar = EricSideBar(EricSideBarSide.SOUTH)
1129 self.bottomSidebar.setIconBarColor(Preferences.getUI("IconBarColor"))
1129 1130
1130 # Create the right sidebar 1131 # Create the right sidebar
1131 self.rightSidebar = EricSideBar(EricSideBarSide.EAST, delay) 1132 self.rightSidebar = EricSideBar(EricSideBarSide.EAST)
1133 self.rightSidebar.setIconBarColor(Preferences.getUI("IconBarColor"))
1132 1134
1133 #################################################### 1135 ####################################################
1134 ## Populate the left side bar 1136 ## Populate the left side bar
1135 #################################################### 1137 ####################################################
1136 1138
1137 self.leftSidebar.addTab( 1139 self.leftSidebar.addTab(
1138 self.projectBrowser, 1140 self.projectBrowser,
1139 UI.PixmapCache.getIcon("projectViewer"), 1141 UI.PixmapCache.getIcon("sbProjectViewer48"),
1140 self.tr("Project-Viewer")) 1142 self.tr("Project-Viewer"))
1141 1143
1142 self.leftSidebar.addTab( 1144 self.leftSidebar.addTab(
1143 self.multiProjectBrowser, 1145 self.multiProjectBrowser,
1144 UI.PixmapCache.getIcon("multiProjectViewer"), 1146 UI.PixmapCache.getIcon("sbMultiProjectViewer48"),
1145 self.tr("Multiproject-Viewer")) 1147 self.tr("Multiproject-Viewer"))
1146 1148
1147 if self.templateViewer: 1149 if self.templateViewer:
1148 self.leftSidebar.addTab( 1150 self.leftSidebar.addTab(
1149 self.templateViewer, 1151 self.templateViewer,
1150 UI.PixmapCache.getIcon("templateViewer"), 1152 UI.PixmapCache.getIcon("sbTemplateViewer48"),
1151 self.tr("Template-Viewer")) 1153 self.tr("Template-Viewer"))
1152 1154
1153 if self.browser: 1155 if self.browser:
1154 self.leftSidebar.addTab(self.browser, 1156 self.leftSidebar.addTab(
1155 UI.PixmapCache.getIcon("browser"), 1157 self.browser,
1156 self.tr("File-Browser")) 1158 UI.PixmapCache.getIcon("sbFileBrowser48"),
1159 self.tr("File-Browser"))
1157 1160
1158 if self.symbolsViewer: 1161 if self.symbolsViewer:
1159 self.leftSidebar.addTab(self.symbolsViewer, 1162 self.leftSidebar.addTab(
1160 UI.PixmapCache.getIcon("symbols"), 1163 self.symbolsViewer,
1161 self.tr("Symbols")) 1164 UI.PixmapCache.getIcon("sbSymbolsViewer48"),
1165 self.tr("Symbols"))
1162 1166
1163 #################################################### 1167 ####################################################
1164 ## Populate the right side bar 1168 ## Populate the right side bar
1165 #################################################### 1169 ####################################################
1166 1170
1167 if self.codeDocumentationViewer: 1171 if self.codeDocumentationViewer:
1168 self.rightSidebar.addTab( 1172 self.rightSidebar.addTab(
1169 self.codeDocumentationViewer, 1173 self.codeDocumentationViewer,
1170 UI.PixmapCache.getIcon("codeDocuViewer"), 1174 UI.PixmapCache.getIcon("sbCodeDocuViewer48"),
1171 self.tr("Code Documentation Viewer")) 1175 self.tr("Code Documentation Viewer"))
1172 1176
1173 self.rightSidebar.addTab( 1177 self.rightSidebar.addTab(
1174 self.debugViewer, UI.PixmapCache.getIcon("debugViewer"), 1178 self.debugViewer, UI.PixmapCache.getIcon("sbDebugViewer48"),
1175 self.tr("Debug-Viewer")) 1179 self.tr("Debug-Viewer"))
1176 1180
1177 if self.pipWidget: 1181 if self.pipWidget:
1178 self.rightSidebar.addTab( 1182 self.rightSidebar.addTab(
1179 self.pipWidget, UI.PixmapCache.getIcon("pypi"), 1183 self.pipWidget, UI.PixmapCache.getIcon("sbPyPI48"),
1180 self.tr("PyPI")) 1184 self.tr("PyPI"))
1181 1185
1182 if self.condaWidget: 1186 if self.condaWidget:
1183 self.rightSidebar.addTab( 1187 self.rightSidebar.addTab(
1184 self.condaWidget, UI.PixmapCache.getIcon("miniconda"), 1188 self.condaWidget, UI.PixmapCache.getIcon("sbMiniconda48"),
1185 self.tr("Conda")) 1189 self.tr("Conda"))
1186 1190
1187 if self.cooperation: 1191 if self.cooperation:
1188 self.rightSidebar.addTab( 1192 self.rightSidebar.addTab(
1189 self.cooperation, UI.PixmapCache.getIcon("cooperation"), 1193 self.cooperation, UI.PixmapCache.getIcon("sbCooperation48"),
1190 self.tr("Cooperation")) 1194 self.tr("Cooperation"))
1191 1195
1192 if self.irc: 1196 if self.irc:
1193 self.rightSidebar.addTab( 1197 self.rightSidebar.addTab(
1194 self.irc, UI.PixmapCache.getIcon("irc"), 1198 self.irc, UI.PixmapCache.getIcon("sbIrc48"),
1195 self.tr("IRC")) 1199 self.tr("IRC"))
1196 1200
1197 if self.microPythonWidget: 1201 if self.microPythonWidget:
1198 self.rightSidebar.addTab( 1202 self.rightSidebar.addTab(
1199 self.microPythonWidget, UI.PixmapCache.getIcon("micropython"), 1203 self.microPythonWidget,
1204 UI.PixmapCache.getIcon("sbMicroPython48"),
1200 self.tr("MicroPython")) 1205 self.tr("MicroPython"))
1201 1206
1202 #################################################### 1207 ####################################################
1203 ## Populate the bottom side bar 1208 ## Populate the bottom side bar
1204 #################################################### 1209 ####################################################
1205 1210
1206 self.bottomSidebar.addTab(self.taskViewer, 1211 self.bottomSidebar.addTab(self.taskViewer,
1207 UI.PixmapCache.getIcon("task"), 1212 UI.PixmapCache.getIcon("sbTasksViewer48"),
1208 self.tr("Task-Viewer")) 1213 self.tr("Task-Viewer"))
1209 1214
1210 self.bottomSidebar.addTab(self.logViewer, 1215 self.bottomSidebar.addTab(self.logViewer,
1211 UI.PixmapCache.getIcon("logViewer"), 1216 UI.PixmapCache.getIcon("sbLogViewer48"),
1212 self.tr("Log-Viewer")) 1217 self.tr("Log-Viewer"))
1213 1218
1214 if self.numbersViewer: 1219 if self.numbersViewer:
1215 self.bottomSidebar.addTab(self.numbersViewer, 1220 self.bottomSidebar.addTab(self.numbersViewer,
1216 UI.PixmapCache.getIcon("numbers"), 1221 UI.PixmapCache.getIcon("sbNumbers48"),
1217 self.tr("Numbers")) 1222 self.tr("Numbers"))
1218 1223
1219 #################################################### 1224 ####################################################
1220 ## Populate the configurable widgets 1225 ## Populate the configurable widgets
1221 #################################################### 1226 ####################################################
1226 elif self.__shellPosition == "right": 1231 elif self.__shellPosition == "right":
1227 self.__shellParent = self.rightSidebar 1232 self.__shellParent = self.rightSidebar
1228 else: 1233 else:
1229 self.__shellParent = self.bottomSidebar 1234 self.__shellParent = self.bottomSidebar
1230 self.__shellParent.insertTab(0, self.shellAssembly, 1235 self.__shellParent.insertTab(0, self.shellAssembly,
1231 UI.PixmapCache.getIcon("shell"), 1236 UI.PixmapCache.getIcon("sbShell48"),
1232 self.tr("Shell")) 1237 self.tr("Shell"))
1233 1238
1234 #################################################### 1239 ####################################################
1235 ## Set the start index of each side bar 1240 ## Set the start index of each side bar
1236 #################################################### 1241 ####################################################
1329 index = container.indexOf(widget) 1334 index = container.indexOf(widget)
1330 if index != -1: 1335 if index != -1:
1331 container.show() 1336 container.show()
1332 container.setCurrentIndex(index) 1337 container.setCurrentIndex(index)
1333 container.raise_() 1338 container.raise_()
1334 if container.isAutoHiding():
1335 container.setFocus()
1336 1339
1337 def showLogViewer(self): 1340 def showLogViewer(self):
1338 """ 1341 """
1339 Public method to show the Log-Viewer. 1342 Public method to show the Log-Viewer.
1340 """ 1343 """
1345 self.hToolboxDock.raise_() 1348 self.hToolboxDock.raise_()
1346 elif self.__layoutType == "Sidebars": 1349 elif self.__layoutType == "Sidebars":
1347 self.bottomSidebar.show() 1350 self.bottomSidebar.show()
1348 self.bottomSidebar.setCurrentWidget(self.logViewer) 1351 self.bottomSidebar.setCurrentWidget(self.logViewer)
1349 self.bottomSidebar.raise_() 1352 self.bottomSidebar.raise_()
1350 if self.bottomSidebar.isAutoHiding():
1351 self.bottomSidebar.setFocus()
1352 1353
1353 def __openOnStartup(self, startupType=None): 1354 def __openOnStartup(self, startupType=None):
1354 """ 1355 """
1355 Private method to open the last file, project or multiproject. 1356 Private method to open the last file, project or multiproject.
1356 1357
6195 self.SAServer.shutdown() 6196 self.SAServer.shutdown()
6196 self.SAServer = None 6197 self.SAServer = None
6197 self.newWindowAct.setEnabled( 6198 self.newWindowAct.setEnabled(
6198 not Preferences.getUI("SingleApplicationMode")) 6199 not Preferences.getUI("SingleApplicationMode"))
6199 6200
6201 if self.__layoutType == "Sidebars":
6202 self.leftSidebar.setIconBarColor(
6203 Preferences.getUI("IconBarColor"))
6204 self.bottomSidebar.setIconBarColor(
6205 Preferences.getUI("IconBarColor"))
6206 self.rightSidebar.setIconBarColor(
6207 Preferences.getUI("IconBarColor"))
6208
6200 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength") 6209 self.maxEditorPathLen = Preferences.getUI("CaptionFilenameLength")
6201 self.captionShowsFilename = Preferences.getUI("CaptionShowsFilename") 6210 self.captionShowsFilename = Preferences.getUI("CaptionShowsFilename")
6202 if not self.captionShowsFilename: 6211 if not self.captionShowsFilename:
6203 self.__setWindowCaption(editor="") 6212 self.__setWindowCaption(editor="")
6204 else: 6213 else:
6221 pwl = SpellChecker.getUserDictionaryPath(isException=False) 6230 pwl = SpellChecker.getUserDictionaryPath(isException=False)
6222 pel = SpellChecker.getUserDictionaryPath(isException=True) 6231 pel = SpellChecker.getUserDictionaryPath(isException=True)
6223 SpellCheckMixin.setDefaultLanguage( 6232 SpellCheckMixin.setDefaultLanguage(
6224 Preferences.getEditor("SpellCheckingDefaultLanguage"), 6233 Preferences.getEditor("SpellCheckingDefaultLanguage"),
6225 pwl, pel) 6234 pwl, pel)
6226
6227 if self.__layoutType == "Sidebars":
6228 delay = Preferences.getUI("SidebarDelay")
6229 self.leftSidebar.setDelay(delay)
6230 self.bottomSidebar.setDelay(delay)
6231 self.rightSidebar.setDelay(delay)
6232 6235
6233 if Preferences.getUI("UseSystemProxy"): 6236 if Preferences.getUI("UseSystemProxy"):
6234 QNetworkProxyFactory.setUseSystemConfiguration(True) 6237 QNetworkProxyFactory.setUseSystemConfiguration(True)
6235 else: 6238 else:
6236 self.__proxyFactory = EricNetworkProxyFactory() 6239 self.__proxyFactory = EricNetworkProxyFactory()
7015 self.cooperation.shutdown() 7018 self.cooperation.shutdown()
7016 7019
7017 self.pluginManager.doShutdown() 7020 self.pluginManager.doShutdown()
7018 7021
7019 self.virtualenvManager.shutdown() 7022 self.virtualenvManager.shutdown()
7020
7021 if self.__layoutType == "Sidebars":
7022 self.leftSidebar.shutdown()
7023 self.bottomSidebar.shutdown()
7024 self.rightSidebar.shutdown()
7025 7023
7026 if self.SAServer is not None: 7024 if self.SAServer is not None:
7027 self.SAServer.shutdown() 7025 self.SAServer.shutdown()
7028 self.SAServer = None 7026 self.SAServer = None
7029 7027

eric ide

mercurial