UI/CompareDialog.py

changeset 2836
289ad03f0e57
parent 2835
678978fe9ffd
child 2837
a96cb48e86a5
equal deleted inserted replaced
2835:678978fe9ffd 2836:289ad03f0e57
330 330
331 self.vsb1.setValue(0) 331 self.vsb1.setValue(0)
332 self.vsb2.setValue(0) 332 self.vsb2.setValue(0)
333 self.firstButton.setEnabled(False) 333 self.firstButton.setEnabled(False)
334 self.upButton.setEnabled(False) 334 self.upButton.setEnabled(False)
335 self.downButton.setEnabled(len(self.diffParas) > 0) 335 self.downButton.setEnabled(len(self.diffParas) > 0 and
336 self.lastButton.setEnabled(len(self.diffParas) > 0) 336 (self.vsb1.isVisible() or self.vsb2.isVisible()))
337 self.lastButton.setEnabled(len(self.diffParas) > 0 and
338 (self.vsb1.isVisible() or self.vsb2.isVisible()))
337 339
338 self.totalLabel.setText(self.trUtf8('Total: {0}')\ 340 self.totalLabel.setText(self.trUtf8('Total: {0}')\
339 .format(added + deleted + changed)) 341 .format(added + deleted + changed))
340 self.changedLabel.setText(self.trUtf8('Changed: {0}').format(changed)) 342 self.changedLabel.setText(self.trUtf8('Changed: {0}').format(changed))
341 self.addedLabel.setText(self.trUtf8('Added: {0}').format(added)) 343 self.addedLabel.setText(self.trUtf8('Added: {0}').format(added))
343 345
344 def __moveTextToCurrentDiffPos(self): 346 def __moveTextToCurrentDiffPos(self):
345 """ 347 """
346 Private slot to move the text display to the current diff position. 348 Private slot to move the text display to the current diff position.
347 """ 349 """
348 value = (self.diffParas[self.currentDiffPos] - 1) * self.fontHeight 350 if 0<= self.currentDiffPos < len(self.diffParas):
349 self.vsb1.setValue(value) 351 value = (self.diffParas[self.currentDiffPos] - 1) * self.fontHeight
350 self.vsb2.setValue(value) 352 self.vsb1.setValue(value)
353 self.vsb2.setValue(value)
351 354
352 def __scrollBarMoved(self, value): 355 def __scrollBarMoved(self, value):
353 """ 356 """
354 Private slot to enable the buttons and set the current diff position 357 Private slot to enable the buttons and set the current diff position
355 depending on scrollbar position. 358 depending on scrollbar position.

eric ide

mercurial