Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

changeset 5450
a5d5e757efcf
parent 5449
7679d1d3671a
child 5451
8ee36e8a315f
equal deleted inserted replaced
5449:7679d1d3671a 5450:a5d5e757efcf
184 self.__logTreeBoldFont.setBold(True) 184 self.__logTreeBoldFont.setBold(True)
185 185
186 self.detailsEdit.anchorClicked.connect(self.__revisionClicked) 186 self.detailsEdit.anchorClicked.connect(self.__revisionClicked)
187 187
188 self.__initActionsMenu() 188 self.__initActionsMenu()
189
190 self.__finishCallbacks = []
191
192 def __addFinishCallback(self, callback):
193 """
194 Private method to add a method to be called once the process finished.
195
196 The callback methods are invoke in a FIFO style and are consumed. If
197 a callback method needs to be called again, it must be added again.
198
199 @param callback callback method
200 @type function
201 """
202 if callback not in self.__finishCallbacks:
203 self.__finishCallbacks.append(callback)
189 204
190 def __initActionsMenu(self): 205 def __initActionsMenu(self):
191 """ 206 """
192 Private method to initialize the actions menu. 207 Private method to initialize the actions menu.
193 """ 208 """
978 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True) 993 self.buttonBox.button(QDialogButtonBox.Close).setDefault(True)
979 994
980 self.inputGroup.setEnabled(False) 995 self.inputGroup.setEnabled(False)
981 self.inputGroup.hide() 996 self.inputGroup.hide()
982 self.refreshButton.setEnabled(True) 997 self.refreshButton.setEnabled(True)
998
999 while self.__finishCallbacks:
1000 self.__finishCallbacks.pop(0)()
983 1001
984 def __modifyForLargeFiles(self, filename): 1002 def __modifyForLargeFiles(self, filename):
985 """ 1003 """
986 Private method to convert the displayed file name for a large file. 1004 Private method to convert the displayed file name for a large file.
987 1005
1434 itm = self.logTree.itemBelow(self.logTree.currentItem()) 1452 itm = self.logTree.itemBelow(self.logTree.currentItem())
1435 if itm: 1453 if itm:
1436 self.logTree.setCurrentItem(itm) 1454 self.logTree.setCurrentItem(itm)
1437 else: 1455 else:
1438 # load the next bunch and try again 1456 # load the next bunch and try again
1457 self.__addFinishCallback(self.on_downButton_clicked)
1439 self.on_nextButton_clicked() 1458 self.on_nextButton_clicked()
1440 self.on_downButton_clicked()
1441 1459
1442 @pyqtSlot() 1460 @pyqtSlot()
1443 def on_nextButton_clicked(self): 1461 def on_nextButton_clicked(self):
1444 """ 1462 """
1445 Private slot to handle the Next button. 1463 Private slot to handle the Next button.

eric ide

mercurial