Changeset b256a167a674…
Parent 105be55e034a…
by
Changes to 3 files · Browse files at b256a167a674 Showing diff from parent 105be55e034a Diff from another changeset...
@@ -33,19 +33,22 @@
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()
@@ -153,8 +156,6 @@ 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
|
@@ -56,6 +56,8 @@ 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)
@@ -66,6 +68,7 @@ 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()
@@ -187,6 +190,11 @@ 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',
@@ -285,4 +293,3 @@ return QTableView.mouseMoveEvent(self, event)
self.dragObject()
return QTableView.mouseMoveEvent(self, event)
-
|
@@ -177,15 +177,14 @@ 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):
@@ -204,7 +203,7 @@ 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()
|
Loading...