VCS/StatusMonitorLed.py

changeset 6529
1c2968f124b7
parent 6048
82ad8ec9548c
child 6645
ad476851d7e0
diff -r 3e194fec0eaa -r 1c2968f124b7 VCS/StatusMonitorLed.py
--- a/VCS/StatusMonitorLed.py	Wed Oct 03 14:31:58 2018 +0200
+++ b/VCS/StatusMonitorLed.py	Wed Oct 03 17:33:40 2018 +0200
@@ -12,7 +12,7 @@
 
 from PyQt5.QtCore import Qt
 from PyQt5.QtGui import QColor
-from PyQt5.QtWidgets import QInputDialog, QMenu
+from PyQt5.QtWidgets import QWidget, QInputDialog, QMenu, QHBoxLayout, QLabel
 
 from E5Gui.E5Led import E5ClickableLed, E5LedRectangular
 
@@ -175,3 +175,44 @@
                 else:
                     # call status dialog
                     vcs.vcsStatus(self.project.getProjectPath())
+
+
+class StatusMonitorLedWidget(QWidget):
+    """
+    Class implementing a widget containing a LED to indicate the status of the
+    VCS status monitor thread and a short info message.
+    """
+    def __init__(self, project, parent):
+        """
+        Constructor
+        
+        @param project reference to the project object
+        @type Project.Project
+        @param parent reference to the parent object
+        @type QWidget
+        """
+        super(StatusMonitorLedWidget, self).__init__(parent)
+        
+        self.__layout = QHBoxLayout(self)
+        self.__layout.setContentsMargins(0, 0, 0, 0)
+        
+        self.__led = StatusMonitorLed(project, self)
+        self.__infoLabel = QLabel(self)
+        
+        self.__layout.addWidget(self.__led)
+        self.__layout.addWidget(self.__infoLabel)
+        
+        self.__projectVcsStatusMonitorInfo("")
+        
+        project.vcsStatusMonitorInfo.connect(
+            self.__projectVcsStatusMonitorInfo)
+    
+    def __projectVcsStatusMonitorInfo(self, info):
+        """
+        Private slot handling the receipt of an info message.
+        
+        @param info received info message
+        @type str
+        """
+        self.__infoLabel.setVisible(bool(info))
+        self.__infoLabel.setText(info)

eric ide

mercurial