Commits

Yuya Nishihara committed 4b8005b

mqdock: simply disable main widget if mq functions are unavailable

  • Participants
  • Parent commits 61b9fb2

Comments (0)

Files changed (1)

tortoisehg/hgqt/mq.py

 
     @pyqtSlot()
     def reload(self):
-        if self.repo is None:
-            self.qqueueComboWidget.setEnabled(False)
-            self.qqueueConfigBtn.setEnabled(False)
-            self.guardSelBtn.setEnabled(False)
-            self.qpushAllAct.setEnabled(False)
-            self.qpushAct.setEnabled(False)
-            self.qdeleteAct.setEnabled(False)
-            self.setGuardsAct.setEnabled(False)
-            self.qrenameAct.setEnabled(False)
-            self.qpopAct.setEnabled(False)
-            self.qpopAllAct.setEnabled(False)
+        self.widget().setEnabled(bool(self._repoagent))
+        if not self._repoagent:
             return
 
         self.loadQQueues()
         self.refreshSelectedGuards()
 
         self.qqueueComboWidget.setEnabled(self.qqueueComboWidget.count() > 1)
-        self.qqueueConfigBtn.setEnabled(True)
         self.qpushAllAct.setEnabled(bool(repo.thgmqunappliedpatches))
         self.qpushAct.setEnabled(bool(repo.thgmqunappliedpatches))
         self.qdeleteAct.setEnabled(False)