Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py

changeset 5449
7679d1d3671a
parent 5448
1a86766ed19a
child 5450
a5d5e757efcf
equal deleted inserted replaced
5448:1a86766ed19a 5449:7679d1d3671a
79 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) 79 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
80 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) 80 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
81 81
82 self.filesTree.headerItem().setText(self.filesTree.columnCount(), "") 82 self.filesTree.headerItem().setText(self.filesTree.columnCount(), "")
83 self.filesTree.header().setSortIndicator(0, Qt.AscendingOrder) 83 self.filesTree.header().setSortIndicator(0, Qt.AscendingOrder)
84
85 self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow.png"))
86 self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow.png"))
84 87
85 self.refreshButton = self.buttonBox.addButton( 88 self.refreshButton = self.buttonBox.addButton(
86 self.tr("&Refresh"), QDialogButtonBox.ActionRole) 89 self.tr("&Refresh"), QDialogButtonBox.ActionRole)
87 self.refreshButton.setToolTip( 90 self.refreshButton.setToolTip(
88 self.tr("Press to refresh the list of changesets")) 91 self.tr("Press to refresh the list of changesets"))
1392 1395
1393 # Highlight the current entry using a bold font 1396 # Highlight the current entry using a bold font
1394 for col in range(self.logTree.columnCount()): 1397 for col in range(self.logTree.columnCount()):
1395 current and current.setFont(col, self.__logTreeBoldFont) 1398 current and current.setFont(col, self.__logTreeBoldFont)
1396 previous and previous.setFont(col, self.__logTreeNormalFont) 1399 previous and previous.setFont(col, self.__logTreeNormalFont)
1400
1401 # set the state of the up and down buttons
1402 self.upButton.setEnabled(
1403 current is not None and
1404 self.logTree.indexOfTopLevelItem(current) > 0)
1405 self.downButton.setEnabled(
1406 current is not None and
1407 int(current.text(self.RevisionColumn).split(":")[0]) > 0)
1397 1408
1398 @pyqtSlot() 1409 @pyqtSlot()
1399 def on_logTree_itemSelectionChanged(self): 1410 def on_logTree_itemSelectionChanged(self):
1400 """ 1411 """
1401 Private slot called, when the selection has changed. 1412 Private slot called, when the selection has changed.
1403 if len(self.logTree.selectedItems()) == 1: 1414 if len(self.logTree.selectedItems()) == 1:
1404 self.__updateGui(self.logTree.selectedItems()[0]) 1415 self.__updateGui(self.logTree.selectedItems()[0])
1405 1416
1406 self.__updateDiffButtons() 1417 self.__updateDiffButtons()
1407 self.__updateToolMenuActions() 1418 self.__updateToolMenuActions()
1419
1420 @pyqtSlot()
1421 def on_upButton_clicked(self):
1422 """
1423 Private slot to move the current item up one entry.
1424 """
1425 itm = self.logTree.itemAbove(self.logTree.currentItem())
1426 if itm:
1427 self.logTree.setCurrentItem(itm)
1428
1429 @pyqtSlot()
1430 def on_downButton_clicked(self):
1431 """
1432 Private slot to move the current item down one entry.
1433 """
1434 itm = self.logTree.itemBelow(self.logTree.currentItem())
1435 if itm:
1436 self.logTree.setCurrentItem(itm)
1437 else:
1438 # load the next bunch and try again
1439 self.on_nextButton_clicked()
1440 self.on_downButton_clicked()
1408 1441
1409 @pyqtSlot() 1442 @pyqtSlot()
1410 def on_nextButton_clicked(self): 1443 def on_nextButton_clicked(self):
1411 """ 1444 """
1412 Private slot to handle the Next button. 1445 Private slot to handle the Next button.

eric ide

mercurial