Skip to content

Commit d039709

Browse files
authored
Merge pull request #3193 from SuslikV/patch-8
Add confirmation dialog when canceling export
2 parents 79f3d76 + f79842c commit d039709

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/windows/export.py

+12
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
from PyQt5.QtWidgets import *
3737
from PyQt5.QtGui import QIcon
3838

39+
from classes import info
3940
from classes import ui_util
4041
from classes.app import get_app
4142
from classes.metrics import *
@@ -979,6 +980,17 @@ def accept(self):
979980
super(Export, self).accept()
980981

981982
def reject(self):
983+
if self.exporting and not self.close_button.isVisible():
984+
# Show confirmation dialog
985+
_ = get_app()._tr
986+
result = QMessageBox.question(self,
987+
_("Export Video"),
988+
_("Are you sure you want to cancel the export?"),
989+
QMessageBox.No | QMessageBox.Yes)
990+
if result == QMessageBox.No:
991+
# Resume export
992+
return
993+
982994
# Re-set OMP thread enabled flag
983995
if self.s.get("omp_threads_enabled"):
984996
openshot.Settings.Instance().WAIT_FOR_VIDEO_PROCESSING_TASK = False

0 commit comments

Comments
 (0)