24 |
24 |
25 def __init__(self, project, parent): |
25 def __init__(self, project, parent): |
26 """ |
26 """ |
27 Constructor |
27 Constructor |
28 |
28 |
29 @param project reference to the project object (Project.Project) |
29 @param project reference to the project object |
30 @param parent reference to the parent object (QWidget) |
30 @type Project |
|
31 @param parent reference to the parent object |
|
32 @type QWidget |
31 """ |
33 """ |
32 super().__init__(parent, shape=EricLedType.RECTANGULAR, rectRatio=1.0) |
34 super().__init__(parent, shape=EricLedType.RECTANGULAR, rectRatio=1.0) |
33 |
35 |
34 self.__vcsClean = True |
36 self.__vcsClean = True |
35 self.project = project |
37 self.project = project |
93 |
95 |
94 def __projectVcsMonitorStatus(self, status, statusMsg): |
96 def __projectVcsMonitorStatus(self, status, statusMsg): |
95 """ |
97 """ |
96 Private method to receive the status monitor status. |
98 Private method to receive the status monitor status. |
97 |
99 |
98 @param status status of the monitoring thread (string, ok, nok or off) |
100 @param status status of the monitoring thread (ok, nok or off) |
99 @param statusMsg explanotory text for the signaled status (string) |
101 @type str |
|
102 @param statusMsg explanotory text for the signaled status |
|
103 @type str |
100 """ |
104 """ |
101 self.setColor(self.vcsMonitorLedColors[status]) |
105 self.setColor(self.vcsMonitorLedColors[status]) |
102 self.setToolTip(statusMsg) |
106 self.setToolTip(statusMsg) |
103 |
107 |
104 self.__on = status != "off" |
108 self.__on = status != "off" |
105 |
109 |
106 def _showContextMenu(self, coord): |
110 def _showContextMenu(self, coord): |
107 """ |
111 """ |
108 Protected slot to show the context menu. |
112 Protected slot to show the context menu. |
109 |
113 |
110 @param coord the position of the mouse pointer (QPoint) |
114 @param coord the position of the mouse pointer |
|
115 @type QPoint |
111 """ |
116 """ |
112 if not self.project.isOpen(): |
117 if not self.project.isOpen(): |
113 return |
118 return |
114 |
119 |
115 self.__checkActions() |
120 self.__checkActions() |
151 |
156 |
152 def __vcsStateChanged(self, state): |
157 def __vcsStateChanged(self, state): |
153 """ |
158 """ |
154 Private slot to handle a change in the vcs state. |
159 Private slot to handle a change in the vcs state. |
155 |
160 |
156 @param state new vcs state (string) |
161 @param state new vcs state |
|
162 @type str |
157 """ |
163 """ |
158 self.__vcsClean = state == " " |
164 self.__vcsClean = state == " " |
159 |
165 |
160 def __ledClicked(self, pos): # noqa: U100 |
166 def __ledClicked(self, pos): # noqa: U100 |
161 """ |
167 """ |
162 Private slot to react upon clicks on the LED. |
168 Private slot to react upon clicks on the LED. |
163 |
169 |
164 @param pos position of the click (QPoint) |
170 @param pos position of the click |
|
171 @type QPoint |
165 """ |
172 """ |
166 if self.__on: |
173 if self.__on: |
167 vcs = self.project.getVcs() |
174 vcs = self.project.getVcs() |
168 if vcs: |
175 if vcs: |
169 if self.__vcsClean: |
176 if self.__vcsClean: |