eric6/Project/ProjectBrowser.py

changeset 7533
88261c96484b
parent 7360
9190402e4505
child 7635
0cdead130a81
equal deleted inserted replaced
7532:1358e9d67a1c 7533:88261c96484b
44 @param parent parent widget (QWidget) 44 @param parent parent widget (QWidget)
45 """ 45 """
46 E5TabWidget.__init__(self, parent) 46 E5TabWidget.__init__(self, parent)
47 self.project = project 47 self.project = project
48 48
49 self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) 49 self.setWindowIcon(UI.PixmapCache.getIcon("eric"))
50 50
51 self.setUsesScrollButtons(True) 51 self.setUsesScrollButtons(True)
52 52
53 self.vcsStatusIndicator = E5ClickableLed(self) 53 self.vcsStatusIndicator = E5ClickableLed(self)
54 self.setCornerWidget(self.vcsStatusIndicator, Qt.TopLeftCorner) 54 self.setCornerWidget(self.vcsStatusIndicator, Qt.TopLeftCorner)
178 178
179 # step 2: add browsers 179 # step 2: add browsers
180 if browserFlags & SourcesBrowserFlag: 180 if browserFlags & SourcesBrowserFlag:
181 index = self.addTab( 181 index = self.addTab(
182 self.psBrowser, 182 self.psBrowser,
183 UI.PixmapCache.getIcon("projectSources.png"), '') 183 UI.PixmapCache.getIcon("projectSources"), '')
184 self.setTabToolTip(index, self.psBrowser.windowTitle()) 184 self.setTabToolTip(index, self.psBrowser.windowTitle())
185 185
186 if browserFlags & FormsBrowserFlag: 186 if browserFlags & FormsBrowserFlag:
187 index = self.addTab( 187 index = self.addTab(
188 self.pfBrowser, 188 self.pfBrowser,
189 UI.PixmapCache.getIcon("projectForms.png"), '') 189 UI.PixmapCache.getIcon("projectForms"), '')
190 self.setTabToolTip(index, self.pfBrowser.windowTitle()) 190 self.setTabToolTip(index, self.pfBrowser.windowTitle())
191 191
192 if browserFlags & ResourcesBrowserFlag: 192 if browserFlags & ResourcesBrowserFlag:
193 index = self.addTab( 193 index = self.addTab(
194 self.prBrowser, 194 self.prBrowser,
195 UI.PixmapCache.getIcon("projectResources.png"), '') 195 UI.PixmapCache.getIcon("projectResources"), '')
196 self.setTabToolTip(index, self.prBrowser.windowTitle()) 196 self.setTabToolTip(index, self.prBrowser.windowTitle())
197 197
198 if browserFlags & TranslationsBrowserFlag: 198 if browserFlags & TranslationsBrowserFlag:
199 index = self.addTab( 199 index = self.addTab(
200 self.ptBrowser, 200 self.ptBrowser,
201 UI.PixmapCache.getIcon("projectTranslations.png"), '') 201 UI.PixmapCache.getIcon("projectTranslations"), '')
202 self.setTabToolTip(index, self.ptBrowser.windowTitle()) 202 self.setTabToolTip(index, self.ptBrowser.windowTitle())
203 203
204 if browserFlags & InterfacesBrowserFlag: 204 if browserFlags & InterfacesBrowserFlag:
205 index = self.addTab( 205 index = self.addTab(
206 self.piBrowser, 206 self.piBrowser,
207 UI.PixmapCache.getIcon("projectInterfaces.png"), '') 207 UI.PixmapCache.getIcon("projectInterfaces"), '')
208 self.setTabToolTip(index, self.piBrowser.windowTitle()) 208 self.setTabToolTip(index, self.piBrowser.windowTitle())
209 209
210 if browserFlags & ProtocolsBrowserFlag: 210 if browserFlags & ProtocolsBrowserFlag:
211 index = self.addTab( 211 index = self.addTab(
212 self.ppBrowser, 212 self.ppBrowser,
213 UI.PixmapCache.getIcon("protobuf.png"), '') 213 UI.PixmapCache.getIcon("protobuf"), '')
214 self.setTabToolTip(index, self.ppBrowser.windowTitle()) 214 self.setTabToolTip(index, self.ppBrowser.windowTitle())
215 215
216 if browserFlags & OthersBrowserFlag: 216 if browserFlags & OthersBrowserFlag:
217 index = self.addTab( 217 index = self.addTab(
218 self.poBrowser, 218 self.poBrowser,
219 UI.PixmapCache.getIcon("projectOthers.png"), '') 219 UI.PixmapCache.getIcon("projectOthers"), '')
220 self.setTabToolTip(index, self.poBrowser.windowTitle()) 220 self.setTabToolTip(index, self.poBrowser.windowTitle())
221 221
222 QApplication.processEvents() 222 QApplication.processEvents()
223 223
224 def __currentChanged(self, index): 224 def __currentChanged(self, index):
279 def __setSourcesIcon(self): 279 def __setSourcesIcon(self):
280 """ 280 """
281 Private method to set the right icon for the sources browser tab. 281 Private method to set the right icon for the sources browser tab.
282 """ 282 """
283 if not self.project.isOpen(): 283 if not self.project.isOpen():
284 icon = UI.PixmapCache.getIcon("projectSources.png") 284 icon = UI.PixmapCache.getIcon("projectSources")
285 else: 285 else:
286 if self.project.getProjectLanguage() in [ 286 if self.project.getProjectLanguage() in [
287 "Python", "Python2", "Python3" 287 "Python", "Python2", "Python3"
288 ]: 288 ]:
289 if self.project.isMixedLanguageProject(): 289 if self.project.isMixedLanguageProject():
290 icon = UI.PixmapCache.getIcon("projectSourcesPyMixed.png") 290 icon = UI.PixmapCache.getIcon("projectSourcesPyMixed")
291 else: 291 else:
292 icon = UI.PixmapCache.getIcon("projectSourcesPy.png") 292 icon = UI.PixmapCache.getIcon("projectSourcesPy")
293 elif self.project.getProjectLanguage() == "MicroPython": 293 elif self.project.getProjectLanguage() == "MicroPython":
294 icon = UI.PixmapCache.getIcon("micropython") 294 icon = UI.PixmapCache.getIcon("micropython")
295 elif self.project.getProjectLanguage() == "Ruby": 295 elif self.project.getProjectLanguage() == "Ruby":
296 if self.project.isMixedLanguageProject(): 296 if self.project.isMixedLanguageProject():
297 icon = UI.PixmapCache.getIcon("projectSourcesRbMixed.png") 297 icon = UI.PixmapCache.getIcon("projectSourcesRbMixed")
298 else: 298 else:
299 icon = UI.PixmapCache.getIcon("projectSourcesRb.png") 299 icon = UI.PixmapCache.getIcon("projectSourcesRb")
300 elif self.project.getProjectLanguage() == "JavaScript": 300 elif self.project.getProjectLanguage() == "JavaScript":
301 icon = UI.PixmapCache.getIcon("projectSourcesJavaScript.png") 301 icon = UI.PixmapCache.getIcon("projectSourcesJavaScript")
302 else: 302 else:
303 icon = UI.PixmapCache.getIcon("projectSources.png") 303 icon = UI.PixmapCache.getIcon("projectSources")
304 self.setTabIcon(self.indexOf(self.psBrowser), icon) 304 self.setTabIcon(self.indexOf(self.psBrowser), icon)
305 305
306 def handleEditorChanged(self, fn): 306 def handleEditorChanged(self, fn):
307 """ 307 """
308 Public slot to handle the editorChanged signal. 308 Public slot to handle the editorChanged signal.

eric ide

mercurial