Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py

changeset 5449
7679d1d3671a
parent 5389
9b1c800daff3
child 5450
a5d5e757efcf
--- a/Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py	Sat Jan 28 12:39:43 2017 +0100
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnLogBrowserDialog.py	Sat Jan 28 14:22:00 2017 +0100
@@ -26,6 +26,7 @@
 from .Ui_SvnLogBrowserDialog import Ui_SvnLogBrowserDialog
 
 import Preferences
+import UI.PixmapCache
 
 
 class SvnLogBrowserDialog(QWidget, Ui_SvnLogBrowserDialog):
@@ -47,6 +48,9 @@
         self.buttonBox.button(QDialogButtonBox.Close).setEnabled(False)
         self.buttonBox.button(QDialogButtonBox.Cancel).setDefault(True)
         
+        self.upButton.setIcon(UI.PixmapCache.getIcon("1uparrow.png"))
+        self.downButton.setIcon(UI.PixmapCache.getIcon("1downarrow.png"))
+        
         self.filesTree.headerItem().setText(self.filesTree.columnCount(), "")
         self.filesTree.header().setSortIndicator(0, Qt.AscendingOrder)
         
@@ -92,6 +96,11 @@
             'R': self.tr('Replaced'),
         }
         self.intercept = False
+        
+        self.__logTreeNormalFont = self.logTree.font()
+        self.__logTreeNormalFont.setBold(False)
+        self.__logTreeBoldFont = self.logTree.font()
+        self.__logTreeBoldFont.setBold(True)
     
     def __initData(self):
         """
@@ -366,7 +375,7 @@
             elif self.rx_rev2.exactMatch(s):
                 log["revision"] = self.rx_rev2.cap(1)
                 log["author"] = self.rx_rev2.cap(2)
-                log["date"] = self.rx_rev2.cap(3)
+                log["date"] = " ".join(self.rx_rev2.cap(3).split()[:2])
                 # number of lines is ignored
             elif self.rx_flags1.exactMatch(s):
                 changedPaths.append({
@@ -519,6 +528,19 @@
         self.diffPreviousButton.setEnabled(
             current != self.logTree.topLevelItem(
                 self.logTree.topLevelItemCount() - 1))
+        
+        # Highlight the current entry using a bold font
+        for col in range(self.logTree.columnCount()):
+            current and current.setFont(col, self.__logTreeBoldFont)
+            previous and previous.setFont(col, self.__logTreeNormalFont)
+        
+        # set the state of the up and down buttons
+        self.upButton.setEnabled(
+            current is not None and 
+            self.logTree.indexOfTopLevelItem(current) > 0)
+        self.downButton.setEnabled(
+            current is not None and
+            int(current.text(0)) > 1)
     
     @pyqtSlot()
     def on_logTree_itemSelectionChanged(self):
@@ -656,6 +678,28 @@
         self.nextButton.setEnabled(True)
         self.limitSpinBox.setEnabled(True)
     
+    @pyqtSlot()
+    def on_upButton_clicked(self):
+        """
+        Private slot to move the current item up one entry.
+        """
+        itm = self.logTree.itemAbove(self.logTree.currentItem())
+        if itm:
+            self.logTree.setCurrentItem(itm)
+    
+    @pyqtSlot()
+    def on_downButton_clicked(self):
+        """
+        Private slot to move the current item down one entry.
+        """
+        itm = self.logTree.itemBelow(self.logTree.currentItem())
+        if itm:
+            self.logTree.setCurrentItem(itm)
+        else:
+            # load the next bunch and try again
+            self.on_nextButton_clicked()
+            self.on_downButton_clicked()
+    
     def on_passwordCheckBox_toggled(self, isOn):
         """
         Private slot to handle the password checkbox toggled.

eric ide

mercurial