提交 590a0d1d 编写于 作者: なるみ 提交者: Kentaro Wada

Add delete file warning

上级 eb2e55a1
......@@ -1429,12 +1429,17 @@ class MainWindow(QtWidgets.QMainWindow, WindowMixin):
return label_file
def deleteFile(self):
label_file = self.getLabelFile()
if osp.exists(label_file):
os.remove(label_file)
logger.info('%s removed', label_file)
self.importDirImages(self.lastOpenDir)
mb = QtWidgets.QMessageBox
msg = 'You are about to permanently delete this label file, ' \
'proceed anyway?'
answer = mb.warning(self, 'Attention', msg, mb.Yes | mb.No)
if answer == mb.Yes:
label_file = self.getLabelFile()
if osp.exists(label_file):
os.remove(label_file)
logger.info('%s removed', label_file)
self.importDirImages(self.lastOpenDir)
# Message Dialogs. #
def hasLabels(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册