Skip to content

Commit f79842c

Browse files
committed
Tweak export-cancel confirmation
- Change title to "Export Video", already translated - Use QMessageBox.question() convenience function
1 parent 20080ce commit f79842c

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/windows/export.py

Lines changed: 8 additions & 11 deletions
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,19 +980,15 @@ def accept(self):
979980
super(Export, self).accept()
980981

981982
def reject(self):
982-
# Handle cancel
983983
if self.exporting and not self.close_button.isVisible():
984+
# Show confirmation dialog
984985
_ = 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:
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
995992
return
996993

997994
# Re-set OMP thread enabled flag

0 commit comments

Comments
 (0)