Commits

Steve Borho committed b669652

mq: clear new patch button after qnew

Comments (0)

Files changed (1)

tortoisehg/hgqt/mq.py

         self.repo = repo
         self.opts = opts
         self.refreshing = False
+        self.finishfunc = None
 
         layout = QVBoxLayout()
         layout.setSpacing(4)
     def onCommandFinished(self, ret):
         self.qtbar.setEnabled(True)
         self.repo.decrementBusyCount()
-        if ret is not 0:
-            pass # TODO: look for reject notifications
+        if self.finishfunc:
+            self.finishfunc(ret, self.cmd.core.rawoutput())
+            self.finishfunc = None
 
     @pyqtSlot()
     def onPushAll(self):
 
     @pyqtSlot()
     def onQNewOrQRefresh(self):
+        def finished(ret, output):
+            self.newCheckBox.setChecked(False)
         if self.newCheckBox.isChecked():
             name = hglib.fromunicode(self.patchNameLE.text())
             if not name:
                 self.patchNameLE.setFocus()
                 return
             cmdline = ['qnew', '--repository', self.repo.root, name]
+            self.finishfunc = finished
         else:
             cmdline = ['qrefresh', '--repository', self.repo.root]
         message = self.messageEditor.text()