10 |
10 |
11 from __future__ import unicode_literals |
11 from __future__ import unicode_literals |
12 |
12 |
13 from PyQt5.QtCore import Qt |
13 from PyQt5.QtCore import Qt |
14 from PyQt5.QtGui import QColor |
14 from PyQt5.QtGui import QColor |
15 from PyQt5.QtWidgets import QInputDialog, QMenu |
15 from PyQt5.QtWidgets import QWidget, QInputDialog, QMenu, QHBoxLayout, QLabel |
16 |
16 |
17 from E5Gui.E5Led import E5ClickableLed, E5LedRectangular |
17 from E5Gui.E5Led import E5ClickableLed, E5LedRectangular |
18 |
18 |
19 import Preferences |
19 import Preferences |
20 |
20 |
173 # call log browser dialog |
173 # call log browser dialog |
174 vcs.vcsLogBrowser(self.project.getProjectPath()) |
174 vcs.vcsLogBrowser(self.project.getProjectPath()) |
175 else: |
175 else: |
176 # call status dialog |
176 # call status dialog |
177 vcs.vcsStatus(self.project.getProjectPath()) |
177 vcs.vcsStatus(self.project.getProjectPath()) |
|
178 |
|
179 |
|
180 class StatusMonitorLedWidget(QWidget): |
|
181 """ |
|
182 Class implementing a widget containing a LED to indicate the status of the |
|
183 VCS status monitor thread and a short info message. |
|
184 """ |
|
185 def __init__(self, project, parent): |
|
186 """ |
|
187 Constructor |
|
188 |
|
189 @param project reference to the project object |
|
190 @type Project.Project |
|
191 @param parent reference to the parent object |
|
192 @type QWidget |
|
193 """ |
|
194 super(StatusMonitorLedWidget, self).__init__(parent) |
|
195 |
|
196 self.__layout = QHBoxLayout(self) |
|
197 self.__layout.setContentsMargins(0, 0, 0, 0) |
|
198 |
|
199 self.__led = StatusMonitorLed(project, self) |
|
200 self.__infoLabel = QLabel(self) |
|
201 |
|
202 self.__layout.addWidget(self.__led) |
|
203 self.__layout.addWidget(self.__infoLabel) |
|
204 |
|
205 self.__projectVcsStatusMonitorInfo("") |
|
206 |
|
207 project.vcsStatusMonitorInfo.connect( |
|
208 self.__projectVcsStatusMonitorInfo) |
|
209 |
|
210 def __projectVcsStatusMonitorInfo(self, info): |
|
211 """ |
|
212 Private slot handling the receipt of an info message. |
|
213 |
|
214 @param info received info message |
|
215 @type str |
|
216 """ |
|
217 self.__infoLabel.setVisible(bool(info)) |
|
218 self.__infoLabel.setText(info) |