Changeset a995ba14f694…
Parent 62d1f14bdba1…
by
Changes to 2 files · Browse files at a995ba14f694 Showing diff from parent 62d1f14bdba1 Diff from another changeset...
@@ -299,19 +299,17 @@ _('The destination "%s" already exists as a file!' % dest))
return False
elif os.listdir(dest):
- r = qtlib.QuestionMsgBox(_('Confirm overwrite'),
- _('The directory "%s" is not empty!\n\n'
- 'Do you want to overwrite it?' % dest),
- buttons=QMessageBox.Yes|QMessageBox.No)
- if r != QMessageBox.Yes:
+ if not qtlib.QuestionMsgBox(_('Confirm overwrite'),
+ _('The directory "%s" is not empty!\n\n'
+ 'Do you want to overwrite it?') % dest,
+ parent=self):
return False
else:
if os.path.isfile(dest):
- r = qtlib.QuestionMsgBox(_('Confirm overwrite'),
- _('The file "%s" already exists!\n\n'
- 'Do you want to overwrite it?' % dest),
- buttons=QMessageBox.Yes|QMessageBox.No)
- if r != QMessageBox.Yes:
+ if not qtlib.QuestionMsgBox(_('Confirm overwrite'),
+ _('The file "%s" already exists!\n\n'
+ 'Do you want to overwrite it?') % dest,
+ parent=self):
return False
else:
r = qtlib.WarningMsgBox(_('Duplicate name'),
|
@@ -205,7 +205,9 @@ return CommonMsgBox(QtGui.QMessageBox.Critical, *args, **kargs)
def QuestionMsgBox(*args, **kargs):
- return CommonMsgBox(QtGui.QMessageBox.Question, *args, **kargs)
+ btn = QtGui.QMessageBox.Yes | QtGui.QMessageBox.No
+ res = CommonMsgBox(QtGui.QMessageBox.Question, buttons=btn, *args, **kargs)
+ return res == QtGui.QMessageBox.Yes
class CustomPrompt(QtGui.QMessageBox):
def __init__(self, title, message, parent, choices, default=None,
|
Loading...