eric6/Project/ProjectBrowser.py

Sun, 12 Apr 2020 19:07:49 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 12 Apr 2020 19:07:49 +0200
changeset 7533
88261c96484b
parent 7360
9190402e4505
child 7635
0cdead130a81
permissions
-rw-r--r--

Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7360
9190402e4505 Updated copyright for 2020.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7265
diff changeset
3 # Copyright (c) 2002 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
7 Module implementing the project browser part of the eric6 UI.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2408
diff changeset
10
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3600
diff changeset
11 from PyQt5.QtCore import Qt
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3600
diff changeset
12 from PyQt5.QtGui import QColor
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3600
diff changeset
13 from PyQt5.QtWidgets import QApplication
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 15
diff changeset
15 from E5Gui.E5TabWidget import E5TabWidget
3369
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
16 from E5Gui.E5Led import E5ClickableLed
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 import UI.PixmapCache
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
7265
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
21 from .ProjectBrowserFlags import (
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
22 SourcesBrowserFlag, FormsBrowserFlag, ResourcesBrowserFlag,
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
23 TranslationsBrowserFlag, InterfacesBrowserFlag, OthersBrowserFlag,
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
24 ProtocolsBrowserFlag, AllBrowsersFlag
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
25 )
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
27
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 15
diff changeset
28 class ProjectBrowser(E5TabWidget):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
30 Class implementing the project browser part of the eric6 UI.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 It generates a widget with up to seven tabs. The individual tabs contain
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 the project sources browser, the project forms browser,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 the project resources browser, the project translations browser,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 the project interfaces (IDL) browser and a browser for stuff,
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 that doesn't fit these categories. Optionally it contains an additional
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 tab with the file system browser.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 """
6416
a915f8dd1ca6 File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6285
diff changeset
39 def __init__(self, project, parent=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
41 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
42
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 @param project reference to the project object
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 @param parent parent widget (QWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 """
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 15
diff changeset
46 E5TabWidget.__init__(self, parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47 self.project = project
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
49 self.setWindowIcon(UI.PixmapCache.getIcon("eric"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50
1422
47f1dffa398e Fixed the tab bar issue observed for some styles (like Mac Aqua).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1112
diff changeset
51 self.setUsesScrollButtons(True)
47f1dffa398e Fixed the tab bar issue observed for some styles (like Mac Aqua).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1112
diff changeset
52
3369
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
53 self.vcsStatusIndicator = E5ClickableLed(self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 self.setCornerWidget(self.vcsStatusIndicator, Qt.TopLeftCorner)
3369
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
55 self.vcsStatusIndicator.clicked.connect(
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
56 self.__vcsStatusIndicatorClicked)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 self.vcsStatusColorNames = {
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
58 "A": "VcsAdded",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
59 "M": "VcsModified",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
60 "O": "VcsRemoved",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
61 "R": "VcsReplaced",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
62 "U": "VcsUpdate",
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
63 "Z": "VcsConflict",
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 }
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 self.vcsStatusText = {
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
66 " ": self.tr("up to date"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
67 "A": self.tr("files added"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
68 "M": self.tr("local modifications"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
69 "O": self.tr("files removed"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
70 "R": self.tr("files replaced"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
71 "U": self.tr("update required"),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
72 "Z": self.tr("conflict"),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 }
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 self.__vcsStateChanged(" ")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 # step 1: create all the individual browsers
2408
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
77 from .ProjectSourcesBrowser import ProjectSourcesBrowser
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
78 from .ProjectFormsBrowser import ProjectFormsBrowser
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
79 from .ProjectTranslationsBrowser import ProjectTranslationsBrowser
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
80 from .ProjectResourcesBrowser import ProjectResourcesBrowser
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
81 from .ProjectInterfacesBrowser import ProjectInterfacesBrowser
dc3a7c9d8f6e Continued implementing the delayed import.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
82 from .ProjectOthersBrowser import ProjectOthersBrowser
5968
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
83 from .ProjectProtocolsBrowser import ProjectProtocolsBrowser
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 # sources browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 self.psBrowser = ProjectSourcesBrowser(self.project)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 # forms browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 self.pfBrowser = ProjectFormsBrowser(self.project)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 # resources browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 self.prBrowser = ProjectResourcesBrowser(self.project)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 # translations browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 self.ptBrowser = ProjectTranslationsBrowser(self.project)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 # interfaces (IDL) browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 self.piBrowser = ProjectInterfacesBrowser(self.project)
5968
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
94 # protocols (protobuf) browser
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
95 self.ppBrowser = ProjectProtocolsBrowser(self.project)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 # others browser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97 self.poBrowser = ProjectOthersBrowser(self.project)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 # step 2: connect all the browsers
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 # connect the sources browser
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
101 self.project.projectClosed.connect(self.psBrowser._projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
102 self.project.projectOpened.connect(self.psBrowser._projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
103 self.project.newProject.connect(self.psBrowser._newProject)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
104 self.project.reinitVCS.connect(self.psBrowser._initMenusAndVcs)
3522
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
105 self.project.projectPropertiesChanged.connect(
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
106 self.psBrowser._initMenusAndVcs)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 # connect the forms browser
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
109 self.project.projectClosed.connect(self.pfBrowser._projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
110 self.project.projectOpened.connect(self.pfBrowser._projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
111 self.project.newProject.connect(self.pfBrowser._newProject)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
112 self.project.reinitVCS.connect(self.pfBrowser._initMenusAndVcs)
3522
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
113 self.project.projectPropertiesChanged.connect(
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
114 self.pfBrowser._initMenusAndVcs)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 # connect the resources browser
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
117 self.project.projectClosed.connect(self.prBrowser._projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
118 self.project.projectOpened.connect(self.prBrowser._projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
119 self.project.newProject.connect(self.prBrowser._newProject)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
120 self.project.reinitVCS.connect(self.prBrowser._initMenusAndVcs)
3522
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
121 self.project.projectPropertiesChanged.connect(
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
122 self.prBrowser._initMenusAndVcs)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 # connect the translations browser
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
125 self.project.projectClosed.connect(self.ptBrowser._projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
126 self.project.projectOpened.connect(self.ptBrowser._projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
127 self.project.newProject.connect(self.ptBrowser._newProject)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
128 self.project.reinitVCS.connect(self.ptBrowser._initMenusAndVcs)
3522
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
129 self.project.projectPropertiesChanged.connect(
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
130 self.ptBrowser._initMenusAndVcs)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
131
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
132 # connect the interfaces (IDL) browser
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
133 self.project.projectClosed.connect(self.piBrowser._projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
134 self.project.projectOpened.connect(self.piBrowser._projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
135 self.project.newProject.connect(self.piBrowser._newProject)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
136 self.project.reinitVCS.connect(self.piBrowser._initMenusAndVcs)
3522
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
137 self.project.projectPropertiesChanged.connect(
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
138 self.piBrowser._initMenusAndVcs)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139
5968
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
140 # connect the protocols (protobuf) browser
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
141 self.project.projectClosed.connect(self.ppBrowser._projectClosed)
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
142 self.project.projectOpened.connect(self.ppBrowser._projectOpened)
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
143 self.project.newProject.connect(self.ppBrowser._newProject)
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
144 self.project.reinitVCS.connect(self.ppBrowser._initMenusAndVcs)
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
145 self.project.projectPropertiesChanged.connect(
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
146 self.ppBrowser._initMenusAndVcs)
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
147
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 # connect the others browser
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
149 self.project.projectClosed.connect(self.poBrowser._projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
150 self.project.projectOpened.connect(self.poBrowser._projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
151 self.project.newProject.connect(self.poBrowser._newProject)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
152 self.project.reinitVCS.connect(self.poBrowser._initMenusAndVcs)
3522
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
153 self.project.projectPropertiesChanged.connect(
260420562809 Added code to reinitialize the project browser context menus upon a change of the project properties.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3448
diff changeset
154 self.poBrowser._initMenusAndVcs)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155
6285
045dc4c38701 Corrected a typo in several files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6048
diff changeset
156 # add signal connection to ourselves
486
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
157 self.project.projectOpened.connect(self.__projectOpened)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
158 self.project.projectClosed.connect(self.__projectClosed)
e4711a55e482 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 216
diff changeset
159 self.project.newProject.connect(self.__newProject)
2995
63d874899b8b Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
160 self.project.projectPropertiesChanged.connect(
63d874899b8b Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
161 self.__projectPropertiesChanged)
500
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
162 self.currentChanged.connect(self.__currentChanged)
c3abc7895a01 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 486
diff changeset
163 self.project.getModel().vcsStateChanged.connect(self.__vcsStateChanged)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 self.__currentBrowsersFlags = 0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 self.__projectPropertiesChanged()
6416
a915f8dd1ca6 File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6285
diff changeset
167 self.setCurrentIndex(0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169 def __setBrowsersAvailable(self, browserFlags):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 """
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2769
diff changeset
171 Private method to add selected browsers to the project browser.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 @param browserFlags flags indicating the browsers to add (integer)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 # step 1: remove all tabs
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 while self.count() > 0:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 self.removeTab(0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 # step 2: add browsers
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 if browserFlags & SourcesBrowserFlag:
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
181 index = self.addTab(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
182 self.psBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
183 UI.PixmapCache.getIcon("projectSources"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 self.setTabToolTip(index, self.psBrowser.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 if browserFlags & FormsBrowserFlag:
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
187 index = self.addTab(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
188 self.pfBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
189 UI.PixmapCache.getIcon("projectForms"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 self.setTabToolTip(index, self.pfBrowser.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192 if browserFlags & ResourcesBrowserFlag:
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
193 index = self.addTab(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
194 self.prBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
195 UI.PixmapCache.getIcon("projectResources"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196 self.setTabToolTip(index, self.prBrowser.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 if browserFlags & TranslationsBrowserFlag:
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
199 index = self.addTab(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
200 self.ptBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
201 UI.PixmapCache.getIcon("projectTranslations"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 self.setTabToolTip(index, self.ptBrowser.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 if browserFlags & InterfacesBrowserFlag:
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
205 index = self.addTab(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
206 self.piBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
207 UI.PixmapCache.getIcon("projectInterfaces"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 self.setTabToolTip(index, self.piBrowser.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209
5968
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
210 if browserFlags & ProtocolsBrowserFlag:
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
211 index = self.addTab(
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
212 self.ppBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
213 UI.PixmapCache.getIcon("protobuf"), '')
5968
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
214 self.setTabToolTip(index, self.ppBrowser.windowTitle())
c5112b5cb7a9 Started to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5389
diff changeset
215
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 if browserFlags & OthersBrowserFlag:
3030
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
217 index = self.addTab(
4a0a82ddd9d2 Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2995
diff changeset
218 self.poBrowser,
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
219 UI.PixmapCache.getIcon("projectOthers"), '')
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 self.setTabToolTip(index, self.poBrowser.windowTitle())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 QApplication.processEvents()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 def __currentChanged(self, index):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 Private slot to handle the currentChanged(int) signal.
2965
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2769
diff changeset
227
d133c7edd88a Continued correcting doc strings by using the new doc string checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2769
diff changeset
228 @param index index of the tab (integer)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 if index > -1:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 browser = self.widget(index)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 if browser is not None:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233 browser.layoutDisplay()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 def __projectOpened(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 Private slot to handle the projectOpened signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 self.__projectPropertiesChanged()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 self.setCurrentIndex(0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 self.__vcsStateChanged(" ")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 def __projectClosed(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 Private slot to handle the projectClosed signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247 self.__projectPropertiesChanged()
6416
a915f8dd1ca6 File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6285
diff changeset
248 self.setCurrentIndex(0)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 self.__setSourcesIcon()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250 self.__vcsStateChanged(" ")
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
251
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 def __newProject(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254 Private slot to handle the newProject signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256 self.setCurrentIndex(0)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257 self.__projectPropertiesChanged()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
258
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
259 def __projectPropertiesChanged(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 Private slot to handle the projectPropertiesChanged signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263 if self.project.isOpen():
2995
63d874899b8b Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
264 flags = Preferences.getProjectBrowserFlags(
63d874899b8b Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
265 self.project.getProjectType())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 flags = AllBrowsersFlag
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 if flags != self.__currentBrowsersFlags:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 self.__currentBrowsersFlags = flags
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 self.__setBrowsersAvailable(flags)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272
6416
a915f8dd1ca6 File-Browser, Shell: changed code so file-browser and shell are always a standalone windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6285
diff changeset
273 endIndex = self.count()
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 791
diff changeset
274 for index in range(endIndex):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 self.setTabEnabled(index, self.project.isOpen())
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 self.__setSourcesIcon()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 def __setSourcesIcon(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 Private method to set the right icon for the sources browser tab.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 if not self.project.isOpen():
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
284 icon = UI.PixmapCache.getIcon("projectSources")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 else:
7265
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
286 if self.project.getProjectLanguage() in [
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
287 "Python", "Python2", "Python3"
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
288 ]:
5100
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
289 if self.project.isMixedLanguageProject():
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
290 icon = UI.PixmapCache.getIcon("projectSourcesPyMixed")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291 else:
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
292 icon = UI.PixmapCache.getIcon("projectSourcesPy")
7178
43e994af5ee0 MicroPython: added more MicroPython type related handling.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
293 elif self.project.getProjectLanguage() == "MicroPython":
43e994af5ee0 MicroPython: added more MicroPython type related handling.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6942
diff changeset
294 icon = UI.PixmapCache.getIcon("micropython")
5100
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
295 elif self.project.getProjectLanguage() == "Ruby":
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
296 if self.project.isMixedLanguageProject():
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
297 icon = UI.PixmapCache.getIcon("projectSourcesRbMixed")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 else:
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
299 icon = UI.PixmapCache.getIcon("projectSourcesRb")
5100
2c193da9b94f Finished cleaning up some code related to the Project class and data structures.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
300 elif self.project.getProjectLanguage() == "JavaScript":
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
301 icon = UI.PixmapCache.getIcon("projectSourcesJavaScript")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 else:
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
303 icon = UI.PixmapCache.getIcon("projectSources")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 self.setTabIcon(self.indexOf(self.psBrowser), icon)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 def handleEditorChanged(self, fn):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
308 Public slot to handle the editorChanged signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310 @param fn filename of the changed file (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312 if Preferences.getProject("FollowEditor"):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313 if self.project.isProjectSource(fn):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 self.psBrowser.selectFile(fn)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 elif self.project.isProjectForm(fn):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 self.pfBrowser.selectFile(fn)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 elif self.project.isProjectInterface(fn):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 self.piBrowser.selectFile(fn)
5969
584c21b6587a Continued to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5968
diff changeset
319 elif self.project.isProjectProtocol(fn):
584c21b6587a Continued to add support for Google protobuf protocol files.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5968
diff changeset
320 self.ppBrowser.selectFile(fn)
5988
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
321 elif self.project.isProjectProtocol(fn):
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
322 self.ppBrowser.selectFile(fn)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323
2769
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
324 def handleEditorLineChanged(self, fn, lineno):
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
325 """
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
326 Public slot to handle the editorLineChanged signal.
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
327
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
328 @param fn filename of the changed file (string)
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
329 @param lineno one based line number of the item (integer)
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
330 """
7265
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
331 if (
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
332 Preferences.getProject("FollowEditor") and
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
333 Preferences.getProject("FollowCursorLine")
0665c4d509c9 Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
334 ):
2769
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
335 if self.project.isProjectSource(fn):
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
336 self.psBrowser.selectFileLine(fn, lineno)
8cbebde7a984 Added support to highlight the current class/method name of the current editor to the project sources viewer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2408
diff changeset
337
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
338 def getProjectBrowsers(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340 Public method to get references to the individual project browsers.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
341
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342 @return list of references to project browsers
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
344 return [self.psBrowser, self.pfBrowser, self.prBrowser,
5988
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
345 self.ptBrowser, self.piBrowser, self.ppBrowser,
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
346 self.poBrowser]
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
347
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348 def getProjectBrowser(self, name):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350 Public method to get a reference to the named project browser.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 @param name name of the requested project browser (string).
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353 Valid names are "sources, forms, resources, translations,
5988
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
354 interfaces, protocols, others".
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
355 @return reference to the requested browser or None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 if name == "sources":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358 return self.psBrowser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359 elif name == "forms":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 return self.pfBrowser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 elif name == "resources":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 return self.prBrowser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 elif name == "translations":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364 return self.ptBrowser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365 elif name == "interfaces":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 return self.piBrowser
5988
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
367 elif name == "protocols":
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
368 return self.ppBrowser
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369 elif name == "others":
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370 return self.poBrowser
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 return None
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373
3600
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
374 def getProjectBrowserNames(self):
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
375 """
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
376 Public method to get the names of the various project browsers.
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
377
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
378 @return list of project browser names (list of string)
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
379 """
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
380 return ["sources", "forms", "resources",
5988
3cd2d5b75cdb Fixed some methods in the project browser to also cope with the new protocol browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5969
diff changeset
381 "translations", "interfaces", "protocols", "others"]
3600
7d17c492ab95 Started implementing functionality to save expanded file and directory entries of the project browsers to the session.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3532
diff changeset
382
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 def handlePreferencesChanged(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 Public slot used to handle the preferencesChanged signal.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
386 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 self.__projectPropertiesChanged()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 self.__vcsStateChanged(self.currentVcsStatus)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390 def __vcsStateChanged(self, state):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
391 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392 Private slot to handle a change in the vcs state.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 @param state new vcs state (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
395 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396 self.currentVcsStatus = state
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
397 if state == " " or state not in self.vcsStatusColorNames:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 self.vcsStatusIndicator.setColor(QColor(Qt.lightGray))
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 else:
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 500
diff changeset
400 self.vcsStatusIndicator.setColor(
2995
63d874899b8b Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
401 Preferences.getProjectBrowserColour(
63d874899b8b Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2965
diff changeset
402 self.vcsStatusColorNames[state]))
1627
f3280c6a04ba Fixed an issue that can cause a crash in the project browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
403 if state not in self.vcsStatusText:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
404 self.vcsStatusIndicator.setToolTip(self.tr("unknown status"))
1627
f3280c6a04ba Fixed an issue that can cause a crash in the project browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
405 else:
f3280c6a04ba Fixed an issue that can cause a crash in the project browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1509
diff changeset
406 self.vcsStatusIndicator.setToolTip(self.vcsStatusText[state])
3369
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
407
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
408 def __vcsStatusIndicatorClicked(self, pos):
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
409 """
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
410 Private slot to react upon clicks on the VCS indicator LED.
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
411
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
412 @param pos position of the click (QPoint)
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
413 """
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
414 vcs = self.project.getVcs()
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
415 if vcs:
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
416 if self.currentVcsStatus == " ":
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
417 # call log browser dialog
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
418 vcs.vcsLogBrowser(self.project.getProjectPath())
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
419 else:
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
420 # call status dialog
6580dc0fe205 Added click functions to the project browser VCS status LED.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3190
diff changeset
421 vcs.vcsStatus(self.project.getProjectPath())

eric ide

mercurial