VCS/StatusMonitorThread.py

changeset 6529
1c2968f124b7
parent 6048
82ad8ec9548c
child 6645
ad476851d7e0
diff -r 3e194fec0eaa -r 1c2968f124b7 VCS/StatusMonitorThread.py
--- a/VCS/StatusMonitorThread.py	Wed Oct 03 14:31:58 2018 +0200
+++ b/VCS/StatusMonitorThread.py	Wed Oct 03 17:33:40 2018 +0200
@@ -20,9 +20,12 @@
     @signal vcsStatusMonitorData(list of str) emitted to update the VCS status
     @signal vcsStatusMonitorStatus(str, str) emitted to signal the status of
         the monitoring thread (ok, nok, op) and a status message
+    @signal vcsStatusMonitorInfo(str) emitted to signal some info of the
+        monitoring thread
     """
     vcsStatusMonitorData = pyqtSignal(list)
     vcsStatusMonitorStatus = pyqtSignal(str, str)
+    vcsStatusMonitorInfo = pyqtSignal(str)
     
     def __init__(self, interval, project, vcs, parent=None):
         """
@@ -74,6 +77,7 @@
                             "VcsStatusMonitorThread",
                             "Checking repository status"))
                     res, statusMsg = self._performMonitor()
+                    infoMsg = self._getInfo()
                 finally:
                     self.vcs.vcsExecutionMutex.unlock()
                 if res:
@@ -85,11 +89,13 @@
                         "VcsStatusMonitorThread", "Sending data"))
                 self.vcsStatusMonitorData.emit(self.statusList)
                 self.vcsStatusMonitorStatus.emit(status, statusMsg)
+                self.vcsStatusMonitorInfo.emit(infoMsg)
             else:
                 self.vcsStatusMonitorStatus.emit(
                     "timeout", QCoreApplication.translate(
                         "VcsStatusMonitorThread",
                         "Timed out waiting for lock"))
+                self.vcsStatusMonitorInfo.emit("")
             
             if self.autoUpdate and self.shouldUpdate:
                 self.vcs.vcsUpdate(self.projectDir, True)
@@ -198,6 +204,18 @@
         """
         raise RuntimeError('Not implemented')
     
+    def _getInfo(self):
+        """
+        Protected method implementing the real info action.
+        
+        This method should be overridden and create a short info message to be
+        shown in the main window status bar right next to the status indicator.
+        
+        @return short info message
+        @rtype str
+        """
+        return ""
+    
     def _shutdown(self):
         """
         Protected method performing shutdown actions.

eric ide

mercurial