Commits

Yuya Nishihara committed fda72e9

mq: use getQQueues() to build queue combobox

Comments (0)

Files changed (1)

tortoisehg/hgqt/mq.py

 from PyQt4.QtGui import *
 
 from mercurial import patch
-from hgext import mq as mqmod
 
 from tortoisehg.util import hglib
 from tortoisehg.hgqt.i18n import _
         self.refreshStatus()
 
     def _reload(self):
-        ui, repo = self.repo.ui.copy(), self.repo
+        repo = self.repo
 
         self.queueCombo.clear()
-
-        ui.quiet = True  # don't append "(active)"
-        ui.pushbuffer()
-        mqmod.qqueue(ui, repo, list=True)
-        out = ui.popbuffer()
-        for i, qname in enumerate(out.splitlines()):
-            if qname == repo.thgactivemqname:
-                current = i
-            self.queueCombo.addItem(hglib.tounicode(qname))
-        self.queueCombo.setCurrentIndex(current)
+        self.queueCombo.addItems(mqutil.getQQueues(repo))
+        activemq = hglib.tounicode(repo.thgactivemqname)
+        self.queueCombo.setCurrentIndex(self.queueCombo.findText(activemq))
         self.queueCombo.setEnabled(self.queueCombo.count() > 1)
 
         self.messages = []