Added code to propagate a change of the project or its VCS status.

Mon, 19 Aug 2013 15:06:05 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 19 Aug 2013 15:06:05 +0200
changeset 2853
0866c3aac79f
parent 2848
15c84f1f745a
child 2854
2de1955c6391

Added code to propagate a change of the project or its VCS status.

APIs/Python3/eric5.api file | annotate | diff | comparison | revisions
Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric5.Project.Project.html file | annotate | diff | comparison | revisions
Documentation/Source/eric5.VCS.VersionControl.html file | annotate | diff | comparison | revisions
Project/Project.py file | annotate | diff | comparison | revisions
VCS/VersionControl.py file | annotate | diff | comparison | revisions
--- a/APIs/Python3/eric5.api	Sun Aug 18 13:20:24 2013 +0200
+++ b/APIs/Python3/eric5.api	Mon Aug 19 15:06:05 2013 +0200
@@ -6271,6 +6271,7 @@
 eric5.Project.Project.Project.othersAdded?4(fn, updateModel=True)
 eric5.Project.Project.Project.prepareRepopulateItem?7
 eric5.Project.Project.Project.projectAboutToBeCreated?7
+eric5.Project.Project.Project.projectChanged?7
 eric5.Project.Project.Project.projectClosed?7
 eric5.Project.Project.Project.projectClosedHooks?7
 eric5.Project.Project.Project.projectFileRenamed?7
@@ -8601,6 +8602,7 @@
 eric5.VCS.VersionControl.VersionControl.vcsSetOtherData?4(data)
 eric5.VCS.VersionControl.VersionControl.vcsShutdown?4()
 eric5.VCS.VersionControl.VersionControl.vcsStatus?4(name)
+eric5.VCS.VersionControl.VersionControl.vcsStatusChanged?7
 eric5.VCS.VersionControl.VersionControl.vcsStatusMonitorData?7
 eric5.VCS.VersionControl.VersionControl.vcsStatusMonitorStatus?7
 eric5.VCS.VersionControl.VersionControl.vcsSwitch?4(name)
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Sun Aug 18 13:20:24 2013 +0200
+++ b/Documentation/Help/source.qhp	Mon Aug 19 15:06:05 2013 +0200
@@ -8371,6 +8371,7 @@
       <keyword name="Project.__showUserProperties" id="Project.__showUserProperties" ref="eric5.Project.Project.html#Project.__showUserProperties" />
       <keyword name="Project.__statusMonitorStatus" id="Project.__statusMonitorStatus" ref="eric5.Project.Project.html#Project.__statusMonitorStatus" />
       <keyword name="Project.__syncRecent" id="Project.__syncRecent" ref="eric5.Project.Project.html#Project.__syncRecent" />
+      <keyword name="Project.__vcsStatusChanged" id="Project.__vcsStatusChanged" ref="eric5.Project.Project.html#Project.__vcsStatusChanged" />
       <keyword name="Project.__writeDebugProperties" id="Project.__writeDebugProperties" ref="eric5.Project.Project.html#Project.__writeDebugProperties" />
       <keyword name="Project.__writeProject" id="Project.__writeProject" ref="eric5.Project.Project.html#Project.__writeProject" />
       <keyword name="Project.__writeSession" id="Project.__writeSession" ref="eric5.Project.Project.html#Project.__writeSession" />
--- a/Documentation/Source/eric5.Project.Project.html	Sun Aug 18 13:20:24 2013 +0200
+++ b/Documentation/Source/eric5.Project.Project.html	Mon Aug 19 15:06:05 2013 +0200
@@ -74,6 +74,9 @@
 </dd><dt>projectAboutToBeCreated()</dt>
 <dd>
 emitted just before the project will be created
+</dd><dt>projectChanged()</dt>
+<dd>
+emitted to signal a change of the project
 </dd><dt>projectClosed()</dt>
 <dd>
 emitted after a project was closed
@@ -320,6 +323,9 @@
 <td><a href="#Project.__syncRecent">__syncRecent</a></td>
 <td>Private method to synchronize the list of recently opened projects with the central store.</td>
 </tr><tr>
+<td><a href="#Project.__vcsStatusChanged">__vcsStatusChanged</a></td>
+<td>Private slot to handle a change of the overall VCS status.</td>
+</tr><tr>
 <td><a href="#Project.__writeDebugProperties">__writeDebugProperties</a></td>
 <td>Private method to write the project debugger properties file (.e4d)</td>
 </tr><tr>
@@ -1073,6 +1079,11 @@
 <p>
         Private method to synchronize the list of recently opened projects
         with the central store.
+</p><a NAME="Project.__vcsStatusChanged" ID="Project.__vcsStatusChanged"></a>
+<h4>Project.__vcsStatusChanged</h4>
+<b>__vcsStatusChanged</b>(<i></i>)
+<p>
+        Private slot to handle a change of the overall VCS status.
 </p><a NAME="Project.__writeDebugProperties" ID="Project.__writeDebugProperties"></a>
 <h4>Project.__writeDebugProperties</h4>
 <b>__writeDebugProperties</b>(<i>quiet=False</i>)
--- a/Documentation/Source/eric5.VCS.VersionControl.html	Sun Aug 18 13:20:24 2013 +0200
+++ b/Documentation/Source/eric5.VCS.VersionControl.html	Mon Aug 19 15:06:05 2013 +0200
@@ -50,7 +50,10 @@
     and the common methods.
 </p><h3>Signals</h3>
 <dl>
-<dt>vcsStatusMonitorData(list of str)</dt>
+<dt>vcsStatusChanged()</dt>
+<dd>
+emitted to indicate a change of the overall VCS status
+</dd><dt>vcsStatusMonitorData(list of str)</dt>
 <dd>
 emitted to update the VCS status
 </dd><dt>vcsStatusMonitorStatus(str, str)</dt>
--- a/Project/Project.py	Sun Aug 18 13:20:24 2013 +0200
+++ b/Project/Project.py	Mon Aug 19 15:06:05 2013 +0200
@@ -83,6 +83,7 @@
             of the menu and a reference to the menu are given.
     @signal lexerAssociationsChanged() emitted after the lexer associations have been
             changed
+    @signal projectChanged() emitted to signal a change of the project
     """
     dirty = pyqtSignal(int)
     projectLanguageAdded = pyqtSignal(str)
@@ -116,6 +117,7 @@
     reinitVCS = pyqtSignal()
     showMenu = pyqtSignal(str, QMenu)
     lexerAssociationsChanged = pyqtSignal()
+    projectChanged = pyqtSignal()
     
     keynames = [
         "PROGLANGUAGE", "MIXEDLANGUAGE", "PROJECTTYPE",
@@ -583,6 +585,8 @@
         self.__dirty = b
         self.saveAct.setEnabled(b)
         self.dirty.emit(bool(b))
+        if self.__dirty:
+            self.projectChanged.emit()
         
     def isDirty(self):
         """
@@ -2273,6 +2277,7 @@
                     self.vcs.startStatusMonitor(self)
                     self.vcs.vcsStatusMonitorData.connect(self.__model.changeVCSStates)
                     self.vcs.vcsStatusMonitorStatus.connect(self.__statusMonitorStatus)
+                    self.vcs.vcsStatusChanged.connect(self.__vcsStatusChanged)
                 self.reinitVCS.emit()
             
             if self.pudata["VCSSTATUSMONITORINTERVAL"]:
@@ -2468,6 +2473,8 @@
                             self.__model.changeVCSStates)
                         self.vcs.vcsStatusMonitorStatus.connect(
                             self.__statusMonitorStatus)
+                        self.vcs.vcsStatusChanged.connect(
+                            self.__vcsStatusChanged)
                 else:
                     QApplication.restoreOverrideCursor()
         
@@ -3953,6 +3960,12 @@
             .getPluginDisplayStrings("version_control")
         return len(vcsSystemsDict) != 0
     
+    def __vcsStatusChanged(self):
+        """
+        Private slot to handle a change of the overall VCS status.
+        """
+        self.projectChanged.emit()
+    
     #########################################################################
     ## Below is the interface to the checker tools
     #########################################################################
--- a/VCS/VersionControl.py	Sun Aug 18 13:20:24 2013 +0200
+++ b/VCS/VersionControl.py	Mon Aug 19 15:06:05 2013 +0200
@@ -30,9 +30,11 @@
     @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, off) and a status message
+    @signal vcsStatusChanged() emitted to indicate a change of the overall VCS status
     """
     vcsStatusMonitorData = pyqtSignal(list)
     vcsStatusMonitorStatus = pyqtSignal(str, str)
+    vcsStatusChanged = pyqtSignal()
     
     canBeCommitted = 1  # Indicates that a file/directory is in the vcs.
     canBeAdded = 2      # Indicates that a file/directory is not in vcs.
@@ -723,6 +725,8 @@
         """
         Public method to wake up the VCS status monitor thread.
         """
+        self.vcsStatusChanged.emit()
+        
         if self.statusMonitorThread is not None:
             self.statusMonitorThread.checkStatus()
     

eric ide

mercurial