1. TortoiseHg
  2. TortoiseHg
  3. hgtk

Commits

Steve Borho  committed b256a16

revdetails: create a 'show all' action for merge changesets

The action behavior is currently broken, it somehow jumps to the merge parent.
Also removed unused revdetails.actionActivateFile

  • Participants
  • Parent commits 105be55
  • Branches default

Comments (0)

Files changed (3)

File tortoisehg/hgqt/filelistmodel.py

View file
  • Ignore whitespace
 
     contextChanged = pyqtSignal(object)
 
-    def __init__(self, repo, parent=None):
+    def __init__(self, repo, parent):
         """
         data is a HgHLRepo instance
         """
         QAbstractTableModel.__init__(self, parent)
         self.repo = repo
+        self._boldfont = parent.font()
+        self._boldfont.setBold(True)
         self._ctx = None
         self._files = []
         self._filesdict = {}
         self._fulllist = False
 
-    def toggleFullFileList(self):
-        self._fulllist = not self._fulllist
+    @pyqtSlot(bool)
+    def toggleFullFileList(self, value):
+        self._fulllist = value
         self.loadFiles()
         self.layoutChanged.emit()
 
                 return QVariant(geticon('filedelete'))
         elif role == Qt.FontRole:
             if self._fulllist and current_file_desc['infiles']:
-                font = self.font()
-                font.setBold(True)
-                return QVariant(font)
+                return QVariant(self._boldfont)
         else:
             return nullvariant

File tortoisehg/hgqt/filelistview.py

View file
  • Ignore whitespace
         model.contextChanged.connect(self.contextChanged)
         self.selectionModel().currentRowChanged.connect(self.fileSelected)
         self.horizontalHeader().setResizeMode(1, QHeaderView.Stretch)
+        self.actionShowAllMerge.setChecked(False)
+        self.actionShowAllMerge.toggled.connect(model.toggleFullFileList)
         if model._ctx is not None:
             self.contextChanged(model._ctx)
 
             self._actions[act].setEnabled(real)
         for act in ['diff', 'revert']:
             self._actions[act].setEnabled(real or wd)
+        self.actionShowAllMerge.setVisible(len(ctx.parents()) == 2)
 
     def currentFile(self):
         index = self.currentIndex()
             dlg.activateWindow()
 
     def createActions(self):
+        self.actionShowAllMerge = QAction('Show All', self)
+        self.actionShowAllMerge.setCheckable(True)
+        self.actionShowAllMerge.setChecked(False)
+        self.actionShowAllMerge.setVisible(False)
+
         self._actions = {}
         for name, desc, icon, key, tip, cb in [
             ('navigate', _('File history'), None, 'Shift+Return',
             return QTableView.mouseMoveEvent(self, event)
         self.dragObject()
         return QTableView.mouseMoveEvent(self, event)
-

File tortoisehg/hgqt/revdetails.py

View file
  • Ignore whitespace
         self.filelist.clearDisplay.connect(self.fileview.clearDisplay)
 
     def createActions(self):
-        # Activate file (file diff navigator)
-        self.actionActivateFile = QAction('Activate file', self)
+        def fileActivated():
+            idx = self.filelist.currentIndex()
+            self.filelist.fileActivated(idx, alternate=True)
         self.actionActivateFileAlt = QAction('Activate alt. file', self)
         self.actionActivateFileAlt.setShortcuts([Qt.ALT+Qt.Key_Return,
                                                  Qt.ALT+Qt.Key_Enter])
-        self.actionActivateFileAlt.triggered.connect(
-                lambda self=self:
-                self.filelist.fileActivated(self.filelist.currentIndex(),
-                                                      alternate=True))
+        self.actionActivateFileAlt.triggered.connect(fileActivated)
+        self.mergeToolBar.addAction(self.filelist.actionShowAllMerge)
 
     @pyqtSlot()
     def toggleSearchBar(self):
                                     self.searchbar.caseInsensitive())
 
     def create_models(self):
-        self.filelistmodel = HgFileListModel(self.repo, parent=self)
+        self.filelistmodel = HgFileListModel(self.repo, self)
 
     def setupModels(self):
         self.create_models()