Skip to content

Commit 20080ce

Browse files
author
SuslikV
authored
Add confirmation dialog when canceling export
1 parent a8a641c commit 20080ce

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/windows/export.py

+15
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,21 @@ def accept(self):
979979
super(Export, self).accept()
980980

981981
def reject(self):
982+
# Handle cancel
983+
if self.exporting and not self.close_button.isVisible():
984+
_ = get_app()._tr
985+
ret = QMessageBox(self)
986+
ret.setIcon(QMessageBox.Question)
987+
ret.setWindowTitle(_("Video Export"))
988+
ret.setText(_("Are you sure you want to abort the video export?"))
989+
ret.addButton(_("Yes"), QMessageBox.AcceptRole)
990+
button_No = QPushButton(_("No"))
991+
ret.addButton(button_No, QMessageBox.RejectRole)
992+
ret.setDefaultButton(button_No)
993+
ret.exec_()
994+
if ret.clickedButton() == button_No:
995+
return
996+
982997
# Re-set OMP thread enabled flag
983998
if self.s.get("omp_threads_enabled"):
984999
openshot.Settings.Instance().WAIT_FOR_VIDEO_PROCESSING_TASK = False

0 commit comments

Comments
 (0)