Commits

Steve Borho committed 1af0cc4

shelve: verify deletions

Comments (0)

Files changed (1)

tortoisehg/hgqt/shelve.py

 
     @pyqtSlot()
     def deleteShelfA(self):
-        # TODO: Are you sure?
-        shelf = hglib.fromunicode(self.comboa.currentText())
+        ushelf = self.comboa.currentText()
+        if not qtlib.QuestionMsgBox(_('Are you sure?'),
+                                    _('Delete shelf file %s?') % ushelf):
+            return
+        shelf = hglib.fromunicode(ushelf)
         try:
             os.unlink(shelf)
             self.showMessage(_('Shelf deleted'))
 
     @pyqtSlot()
     def deleteShelfB(self):
-        # TODO: Are you sure?
-        shelf = hglib.fromunicode(self.combob.currentText())
+        ushelf = self.combob.currentText()
+        if not qtlib.QuestionMsgBox(_('Are you sure?'),
+                                    _('Delete shelf file %s?') % ushelf):
+            return
+        shelf = hglib.fromunicode(ushelf)
         try:
             os.unlink(shelf)
             self.showMessage(_('Shelf deleted'))