Commits

Wagner Bruna committed 8553850

tag: disable actions if a command is still running

Closing the dialog while a tag command is still running (a commit or
tag hook could take a while to finish) could result in a Qt crash
(similar to #1338).

  • Participants
  • Parent commits f41f3ed
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/tag.py

             self.finishfunc()
 
     def onAddTag(self):
+        if self.cmd.core.running():
+            self.set_status(_('Repository command still running'), False)
+            return
+
         tagu = self.tagCombo.currentText()
         tag = hglib.fromunicode(tagu)
         local = self.localCheckBox.isChecked()
         self.cmd.run(cmd)
 
     def onRemoveTag(self):
+        if self.cmd.core.running():
+            self.set_status(_('Repository command still running'), False)
+            return
+
         tagu = self.tagCombo.currentText()
         tag = hglib.fromunicode(tagu)
         local = self.localCheckBox.isChecked()
         self.cmd.run(cmd)
 
     def reject(self):
+        if self.cmd.core.running():
+            self.set_status(_('Repository command still running'), False)
+            return
+
         # prevent signals from reaching deleted objects
         self.repo.repositoryChanged.disconnect(self.refresh)
         super(TagDialog, self).reject()