Fixed a bug in the log browser dialogs causing an endless loop.

Sat, 28 Jan 2017 16:02:52 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 28 Jan 2017 16:02:52 +0100
changeset 5450
a5d5e757efcf
parent 5449
7679d1d3671a
child 5451
8ee36e8a315f

Fixed a bug in the log browser dialogs causing an endless loop.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric6.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.html file | annotate | diff | comparison | revisions
Documentation/Source/eric6.Plugins.VcsPlugins.vcsSubversion.SvnLogBrowserDialog.html file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Sat Jan 28 14:22:00 2017 +0100
+++ b/Documentation/Help/source.qhp	Sat Jan 28 16:02:52 2017 +0100
@@ -7557,6 +7557,7 @@
       <keyword name="HgLogBrowserDialog (Constructor)" id="HgLogBrowserDialog (Constructor)" ref="eric6.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.html#HgLogBrowserDialog.__init__" />
       <keyword name="HgLogBrowserDialog (Module)" id="HgLogBrowserDialog (Module)" ref="eric6.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.html" />
       <keyword name="HgLogBrowserDialog.__actionMode" id="HgLogBrowserDialog.__actionMode" ref="eric6.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.html#HgLogBrowserDialog.__actionMode" />
+      <keyword name="HgLogBrowserDialog.__addFinishCallback" id="HgLogBrowserDialog.__addFinishCallback" ref="eric6.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.html#HgLogBrowserDialog.__addFinishCallback" />
       <keyword name="HgLogBrowserDialog.__bookmarkActTriggered" id="HgLogBrowserDialog.__bookmarkActTriggered" ref="eric6.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.html#HgLogBrowserDialog.__bookmarkActTriggered" />
       <keyword name="HgLogBrowserDialog.__bookmarkMoveActTriggered" id="HgLogBrowserDialog.__bookmarkMoveActTriggered" ref="eric6.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.html#HgLogBrowserDialog.__bookmarkMoveActTriggered" />
       <keyword name="HgLogBrowserDialog.__branchColor" id="HgLogBrowserDialog.__branchColor" ref="eric6.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.html#HgLogBrowserDialog.__branchColor" />
@@ -13270,6 +13271,7 @@
       <keyword name="SvnLogBrowserDialog (Constructor)" id="SvnLogBrowserDialog (Constructor)" ref="eric6.Plugins.VcsPlugins.vcsSubversion.SvnLogBrowserDialog.html#SvnLogBrowserDialog.__init__" />
       <keyword name="SvnLogBrowserDialog (Module)" id="SvnLogBrowserDialog (Module)" ref="eric6.Plugins.VcsPlugins.vcsPySvn.SvnLogBrowserDialog.html" />
       <keyword name="SvnLogBrowserDialog (Module)" id="SvnLogBrowserDialog (Module)" ref="eric6.Plugins.VcsPlugins.vcsSubversion.SvnLogBrowserDialog.html" />
+      <keyword name="SvnLogBrowserDialog.__addFinishCallback" id="SvnLogBrowserDialog.__addFinishCallback" ref="eric6.Plugins.VcsPlugins.vcsSubversion.SvnLogBrowserDialog.html#SvnLogBrowserDialog.__addFinishCallback" />
       <keyword name="SvnLogBrowserDialog.__diffRevisions" id="SvnLogBrowserDialog.__diffRevisions" ref="eric6.Plugins.VcsPlugins.vcsPySvn.SvnLogBrowserDialog.html#SvnLogBrowserDialog.__diffRevisions" />
       <keyword name="SvnLogBrowserDialog.__diffRevisions" id="SvnLogBrowserDialog.__diffRevisions" ref="eric6.Plugins.VcsPlugins.vcsSubversion.SvnLogBrowserDialog.html#SvnLogBrowserDialog.__diffRevisions" />
       <keyword name="SvnLogBrowserDialog.__filterLogs" id="SvnLogBrowserDialog.__filterLogs" ref="eric6.Plugins.VcsPlugins.vcsPySvn.SvnLogBrowserDialog.html#SvnLogBrowserDialog.__filterLogs" />
--- a/Documentation/Source/eric6.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.html	Sat Jan 28 14:22:00 2017 +0100
+++ b/Documentation/Source/eric6.Plugins.VcsPlugins.vcsMercurial.HgLogBrowserDialog.html	Sat Jan 28 16:02:52 2017 +0100
@@ -63,6 +63,9 @@
 <td><a href="#HgLogBrowserDialog.__actionMode">__actionMode</a></td>
 <td>Private method to get the selected action mode.</td>
 </tr><tr>
+<td><a href="#HgLogBrowserDialog.__addFinishCallback">__addFinishCallback</a></td>
+<td>Private method to add a method to be called once the process finished.</td>
+</tr><tr>
 <td><a href="#HgLogBrowserDialog.__bookmarkActTriggered">__bookmarkActTriggered</a></td>
 <td>Private slot to bookmark the selected revision.</td>
 </tr><tr>
@@ -307,6 +310,19 @@
 <dd>
 selected action mode (string, one of filter or find)
 </dd>
+</dl><a NAME="HgLogBrowserDialog.__addFinishCallback" ID="HgLogBrowserDialog.__addFinishCallback"></a>
+<h4>HgLogBrowserDialog.__addFinishCallback</h4>
+<b>__addFinishCallback</b>(<i>callback</i>)
+<p>
+        Private method to add a method to be called once the process finished.
+</p><p>
+        The callback methods are invoke in a FIFO style and are consumed. If
+        a callback method needs to be called again, it must be added again.
+</p><dl>
+<dt><i>callback</i> (function)</dt>
+<dd>
+callback method
+</dd>
 </dl><a NAME="HgLogBrowserDialog.__bookmarkActTriggered" ID="HgLogBrowserDialog.__bookmarkActTriggered"></a>
 <h4>HgLogBrowserDialog.__bookmarkActTriggered</h4>
 <b>__bookmarkActTriggered</b>(<i></i>)
--- a/Documentation/Source/eric6.Plugins.VcsPlugins.vcsSubversion.SvnLogBrowserDialog.html	Sat Jan 28 14:22:00 2017 +0100
+++ b/Documentation/Source/eric6.Plugins.VcsPlugins.vcsSubversion.SvnLogBrowserDialog.html	Sat Jan 28 16:02:52 2017 +0100
@@ -60,6 +60,9 @@
 <td><a href="#SvnLogBrowserDialog.__init__">SvnLogBrowserDialog</a></td>
 <td>Constructor</td>
 </tr><tr>
+<td><a href="#SvnLogBrowserDialog.__addFinishCallback">__addFinishCallback</a></td>
+<td>Private method to add a method to be called once the process finished.</td>
+</tr><tr>
 <td><a href="#SvnLogBrowserDialog.__diffRevisions">__diffRevisions</a></td>
 <td>Private method to do a diff of two revisions.</td>
 </tr><tr>
@@ -186,6 +189,19 @@
 <dd>
 parent widget (QWidget)
 </dd>
+</dl><a NAME="SvnLogBrowserDialog.__addFinishCallback" ID="SvnLogBrowserDialog.__addFinishCallback"></a>
+<h4>SvnLogBrowserDialog.__addFinishCallback</h4>
+<b>__addFinishCallback</b>(<i>callback</i>)
+<p>
+        Private method to add a method to be called once the process finished.
+</p><p>
+        The callback methods are invoke in a FIFO style and are consumed. If
+        a callback method needs to be called again, it must be added again.
+</p><dl>
+<dt><i>callback</i> (function)</dt>
+<dd>
+callback method
+</dd>
 </dl><a NAME="SvnLogBrowserDialog.__diffRevisions" ID="SvnLogBrowserDialog.__diffRevisions"></a>
 <h4>SvnLogBrowserDialog.__diffRevisions</h4>
 <b>__diffRevisions</b>(<i>rev1, rev2</i>)
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat Jan 28 14:22:00 2017 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat Jan 28 16:02:52 2017 +0100
@@ -186,6 +186,21 @@
         self.detailsEdit.anchorClicked.connect(self.__revisionClicked)
         
         self.__initActionsMenu()
+        
+        self.__finishCallbacks = []
+    
+    def __addFinishCallback(self, callback):
+        """
+        Private method to add a method to be called once the process finished.
+        
+        The callback methods are invoke in a FIFO style and are consumed. If
+        a callback method needs to be called again, it must be added again.
+        
+        @param callback callback method
+        @type function
+        """
+        if callback not in self.__finishCallbacks:
+            self.__finishCallbacks.append(callback)
     
     def __initActionsMenu(self):
         """
@@ -980,6 +995,9 @@
         self.inputGroup.setEnabled(False)
         self.inputGroup.hide()
         self.refreshButton.setEnabled(True)
+        
+        while self.__finishCallbacks:
+            self.__finishCallbacks.pop(0)()
     
     def __modifyForLargeFiles(self, filename):
         """
@@ -1436,8 +1454,8 @@
             self.logTree.setCurrentItem(itm)
         else:
             # load the next bunch and try again
+            self.__addFinishCallback(self.on_downButton_clicked)
             self.on_nextButton_clicked()
-            self.on_downButton_clicked()
     
     @pyqtSlot()
     def on_nextButton_clicked(self):
--- a/Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py	Sat Jan 28 14:22:00 2017 +0100
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py	Sat Jan 28 16:02:52 2017 +0100
@@ -101,6 +101,21 @@
         self.__logTreeNormalFont.setBold(False)
         self.__logTreeBoldFont = self.logTree.font()
         self.__logTreeBoldFont.setBold(True)
+        
+        self.__finishCallbacks = []
+    
+    def __addFinishCallback(self, callback):
+        """
+        Private method to add a method to be called once the process finished.
+        
+        The callback methods are invoke in a FIFO style and are consumed. If
+        a callback method needs to be called again, it must be added again.
+        
+        @param callback callback method
+        @type function
+        """
+        if callback not in self.__finishCallbacks:
+            self.__finishCallbacks.append(callback)
     
     def __initData(self):
         """
@@ -358,6 +373,9 @@
         
         self.inputGroup.setEnabled(False)
         self.inputGroup.hide()
+        
+        while self.__finishCallbacks:
+            self.__finishCallbacks.pop(0)()
     
     def __processBuffer(self):
         """
@@ -697,8 +715,8 @@
             self.logTree.setCurrentItem(itm)
         else:
             # load the next bunch and try again
+            self.__addFinishCallback(self.on_downButton_clicked)
             self.on_nextButton_clicked()
-            self.on_downButton_clicked()
     
     def on_passwordCheckBox_toggled(self, isOn):
         """

eric ide

mercurial