Commits

Yuya Nishihara committed 337d7e8

comment

Comments (0)

Files changed (2)

mq-appliedcnt.diff

 # HG changeset patch
-# Parent bfa0b562e6cbb0dd1bf184cfaec243a6920a8e54
+# Parent 71056d4689aec13d7792d6a3fb15e204a781a166
+mqdock: update qpush/qpop actions by applied and series count of model
+
+It's good for consistency between PatchQueueModel and its actions.
 
 diff --git a/tortoisehg/hgqt/mq.py b/tortoisehg/hgqt/mq.py
 --- a/tortoisehg/hgqt/mq.py
 +++ b/tortoisehg/hgqt/mq.py
-@@ -400,6 +400,9 @@ class PatchQueueModel(QAbstractListModel
+@@ -409,6 +409,9 @@ class PatchQueueModel(QAbstractListModel
              return 0
          return len(self._series)
  
      def patchName(self, index):
          if not index.isValid():
              return ''
-@@ -686,12 +689,13 @@ class MQPatchesWidget(QDockWidget):
- 
+@@ -698,12 +701,13 @@ class MQPatchesWidget(QDockWidget):
+     @pyqtSlot()
      def _updatePatchActions(self):
          model = self.queueListWidget.model()
 -        repo = self.repo
 # HG changeset patch
-# Parent 5d4880a99e564d9de5a5c0e9c741ea4f54f60399
+# Parent 0c35458fd926360c8c6606fdf95658d7bac9aead
+mqdock: unify method which updates availability of patch actions
 
 diff --git a/tortoisehg/hgqt/mq.py b/tortoisehg/hgqt/mq.py
 --- a/tortoisehg/hgqt/mq.py
 +++ b/tortoisehg/hgqt/mq.py
-@@ -686,6 +686,13 @@ class MQPatchesWidget(QDockWidget):
- 
+@@ -698,6 +698,13 @@ class MQPatchesWidget(QDockWidget):
+     @pyqtSlot()
      def _updatePatchActions(self):
          model = self.queueListWidget.model()
 +        repo = self.repo
          index = self.queueListWidget.currentIndex()
          self.qdeleteAct.setEnabled(index.isValid()
                                     and not model.isApplied(index))
-@@ -716,7 +723,6 @@ class MQPatchesWidget(QDockWidget):
+@@ -728,7 +735,6 @@ class MQPatchesWidget(QDockWidget):
  
          repo = self.repo
  
          self.allguards = set()
          for idx, patch in enumerate(repo.mq.series):
              patchguards = repo.mq.seriesguards[idx]
-@@ -729,11 +735,7 @@ class MQPatchesWidget(QDockWidget):
+@@ -741,10 +747,6 @@ class MQPatchesWidget(QDockWidget):
          self.refreshSelectedGuards()
  
          self.qqueueComboWidget.setEnabled(self.qqueueComboWidget.count() > 1)
 -        self.qpushAllAct.setEnabled(bool(repo.thgmqunappliedpatches))
 -        self.qpushAct.setEnabled(bool(repo.thgmqunappliedpatches))
-         self._updatePatchActions()
 -        self.qpopAct.setEnabled(bool(applied))
 -        self.qpopAllAct.setEnabled(bool(applied))