Plugins/VcsPlugins/vcsPySvn/SvnLogBrowserDialog.py

changeset 5449
7679d1d3671a
parent 5389
9b1c800daff3
child 5517
805b36a7ffb7
equal deleted inserted replaced
5448:1a86766ed19a 5449:7679d1d3671a
23 23
24 from .SvnUtilities import formatTime, dateFromTime_t 24 from .SvnUtilities import formatTime, dateFromTime_t
25 from .SvnDialogMixin import SvnDialogMixin 25 from .SvnDialogMixin import SvnDialogMixin
26 26
27 from .Ui_SvnLogBrowserDialog import Ui_SvnLogBrowserDialog 27 from .Ui_SvnLogBrowserDialog import Ui_SvnLogBrowserDialog
28
29 import UI.PixmapCache
28 30
29 31
30 class SvnLogBrowserDialog(QWidget, SvnDialogMixin, Ui_SvnLogBrowserDialog): 32 class SvnLogBrowserDialog(QWidget, SvnDialogMixin, Ui_SvnLogBrowserDialog):
31 """ 33 """
32 Class implementing a dialog to browse the log history. 34 Class implementing a dialog to browse the log history.
44 46
45 self.__position = QPoint() 47 self.__position = QPoint()
46 48
47 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False) 49 self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
48 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True) 50 self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
51
52 self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow.png"))
53 self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow.png"))
49 54
50 self.filesTree.headerItem().setText(self.filesTree.columnCount(), "") 55 self.filesTree.headerItem().setText(self.filesTree.columnCount(), "")
51 self.filesTree.header().setSortIndicator(0, Qt.AscendingOrder) 56 self.filesTree.header().setSortIndicator(0, Qt.AscendingOrder)
52 57
53 self.vcs = vcs 58 self.vcs = vcs
65 'A': self.tr('Added'), 70 'A': self.tr('Added'),
66 'D': self.tr('Deleted'), 71 'D': self.tr('Deleted'),
67 'M': self.tr('Modified'), 72 'M': self.tr('Modified'),
68 'R': self.tr('Replaced'), 73 'R': self.tr('Replaced'),
69 } 74 }
75
76 self.__logTreeNormalFont = self.logTree.font()
77 self.__logTreeNormalFont.setBold(False)
78 self.__logTreeBoldFont = self.logTree.font()
79 self.__logTreeBoldFont.setBold(True)
70 80
71 self.client = self.vcs.getClient() 81 self.client = self.vcs.getClient()
72 self.client.callback_cancel = \ 82 self.client.callback_cancel = \
73 self._clientCancelCallback 83 self._clientCancelCallback
74 self.client.callback_get_login = \ 84 self.client.callback_get_login = \
425 self.__resortFiles() 435 self.__resortFiles()
426 436
427 self.diffPreviousButton.setEnabled( 437 self.diffPreviousButton.setEnabled(
428 current != self.logTree.topLevelItem( 438 current != self.logTree.topLevelItem(
429 self.logTree.topLevelItemCount() - 1)) 439 self.logTree.topLevelItemCount() - 1))
440
441 # Highlight the current entry using a bold font
442 for col in range(self.logTree.columnCount()):
443 current and current.setFont(col, self.__logTreeBoldFont)
444 previous and previous.setFont(col, self.__logTreeNormalFont)
445
446 # set the state of the up and down buttons
447 self.upButton.setEnabled(
448 current is not None and
449 self.logTree.indexOfTopLevelItem(current) > 0)
450 self.downButton.setEnabled(
451 current is not None and
452 int(current.text(0)) > 1)
430 453
431 @pyqtSlot() 454 @pyqtSlot()
432 def on_logTree_itemSelectionChanged(self): 455 def on_logTree_itemSelectionChanged(self):
433 """ 456 """
434 Private slot called, when the selection has changed. 457 Private slot called, when the selection has changed.
584 """ 607 """
585 self.vcs.getPlugin().setPreferences("StopLogOnCopy", 608 self.vcs.getPlugin().setPreferences("StopLogOnCopy",
586 int(self.stopCheckBox.isChecked())) 609 int(self.stopCheckBox.isChecked()))
587 self.nextButton.setEnabled(True) 610 self.nextButton.setEnabled(True)
588 self.limitSpinBox.setEnabled(True) 611 self.limitSpinBox.setEnabled(True)
612
613 @pyqtSlot()
614 def on_upButton_clicked(self):
615 """
616 Private slot to move the current item up one entry.
617 """
618 itm = self.logTree.itemAbove(self.logTree.currentItem())
619 if itm:
620 self.logTree.setCurrentItem(itm)
621
622 @pyqtSlot()
623 def on_downButton_clicked(self):
624 """
625 Private slot to move the current item down one entry.
626 """
627 itm = self.logTree.itemBelow(self.logTree.currentItem())
628 if itm:
629 self.logTree.setCurrentItem(itm)
630 else:
631 # load the next bunch and try again
632 self.on_nextButton_clicked()
633 self.on_downButton_clicked()

eric ide

mercurial