mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use cancel instead of no on autoconvert dialog
This commit is contained in:
parent
2f15bc9e61
commit
c19273afe4
@ -226,10 +226,11 @@ def error_dialog(parent, title, msg, det_msg='', show=False,
|
|||||||
return d.exec_()
|
return d.exec_()
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def question_dialog(parent, title, msg, det_msg='', show_copy_button=True):
|
def question_dialog(parent, title, msg, det_msg='', show_copy_button=True,
|
||||||
d = MessageBox(QMessageBox.Question, title, msg, QMessageBox.Yes|QMessageBox.No,
|
buttons=QMessageBox.Yes|QMessageBox.No):
|
||||||
|
d = MessageBox(QMessageBox.Question, title, msg, buttons,
|
||||||
parent, det_msg)
|
parent, det_msg)
|
||||||
d.setIconPixmap(QPixmap(I('dialog_information.svg')))
|
d.setIconPixmap(QPixmap(I('dialog_question.svg')))
|
||||||
d.setEscapeButton(QMessageBox.No)
|
d.setEscapeButton(QMessageBox.No)
|
||||||
if not show_copy_button:
|
if not show_copy_button:
|
||||||
d.cb.setVisible(False)
|
d.cb.setVisible(False)
|
||||||
|
@ -10,7 +10,7 @@ from functools import partial
|
|||||||
from binascii import unhexlify
|
from binascii import unhexlify
|
||||||
|
|
||||||
from PyQt4.Qt import QMenu, QAction, QActionGroup, QIcon, SIGNAL, QPixmap, \
|
from PyQt4.Qt import QMenu, QAction, QActionGroup, QIcon, SIGNAL, QPixmap, \
|
||||||
Qt, pyqtSignal, QColor, QPainter, QDialog
|
Qt, pyqtSignal, QColor, QPainter, QDialog, QMessageBox
|
||||||
from PyQt4.QtSvg import QSvgRenderer
|
from PyQt4.QtSvg import QSvgRenderer
|
||||||
|
|
||||||
from calibre.customize.ui import available_input_formats, available_output_formats, \
|
from calibre.customize.ui import available_input_formats, available_output_formats, \
|
||||||
@ -952,7 +952,8 @@ class DeviceMixin(object): # {{{
|
|||||||
autos = '\n'.join('%s'%i for i in autos)
|
autos = '\n'.join('%s'%i for i in autos)
|
||||||
if question_dialog(self, _('No suitable formats'),
|
if question_dialog(self, _('No suitable formats'),
|
||||||
_('Auto convert the following books before sending via '
|
_('Auto convert the following books before sending via '
|
||||||
'email?'), det_msg=autos):
|
'email?'), det_msg=autos,
|
||||||
|
buttons=QMessageBox.Yes|QMessageBox.Cancel):
|
||||||
self.auto_convert_mail(to, fmts, delete_from_library, auto, format)
|
self.auto_convert_mail(to, fmts, delete_from_library, auto, format)
|
||||||
|
|
||||||
if bad:
|
if bad:
|
||||||
@ -1051,7 +1052,8 @@ class DeviceMixin(object): # {{{
|
|||||||
autos = '\n'.join('%s'%i for i in autos)
|
autos = '\n'.join('%s'%i for i in autos)
|
||||||
if question_dialog(self, _('No suitable formats'),
|
if question_dialog(self, _('No suitable formats'),
|
||||||
_('Auto convert the following books before uploading to '
|
_('Auto convert the following books before uploading to '
|
||||||
'the device?'), det_msg=autos):
|
'the device?'), det_msg=autos,
|
||||||
|
buttons=QMessageBox.Yes|QMessageBox.Cancel):
|
||||||
self.auto_convert_catalogs(auto, format)
|
self.auto_convert_catalogs(auto, format)
|
||||||
files = [f for f in files if f is not None]
|
files = [f for f in files if f is not None]
|
||||||
if not files:
|
if not files:
|
||||||
@ -1112,7 +1114,8 @@ class DeviceMixin(object): # {{{
|
|||||||
autos = '\n'.join('%s'%i for i in autos)
|
autos = '\n'.join('%s'%i for i in autos)
|
||||||
if question_dialog(self, _('No suitable formats'),
|
if question_dialog(self, _('No suitable formats'),
|
||||||
_('Auto convert the following books before uploading to '
|
_('Auto convert the following books before uploading to '
|
||||||
'the device?'), det_msg=autos):
|
'the device?'), det_msg=autos,
|
||||||
|
buttons=QMessageBox.Yes|QMessageBox.Cancel):
|
||||||
self.auto_convert_news(auto, format)
|
self.auto_convert_news(auto, format)
|
||||||
files = [f for f in files if f is not None]
|
files = [f for f in files if f is not None]
|
||||||
for f in files:
|
for f in files:
|
||||||
@ -1230,7 +1233,8 @@ class DeviceMixin(object): # {{{
|
|||||||
autos = '\n'.join('%s'%i for i in autos)
|
autos = '\n'.join('%s'%i for i in autos)
|
||||||
if question_dialog(self, _('No suitable formats'),
|
if question_dialog(self, _('No suitable formats'),
|
||||||
_('Auto convert the following books before uploading to '
|
_('Auto convert the following books before uploading to '
|
||||||
'the device?'), det_msg=autos):
|
'the device?'), det_msg=autos,
|
||||||
|
buttons=QMessageBox.Yes|QMessageBox.Cancel):
|
||||||
self.auto_convert(auto, on_card, format)
|
self.auto_convert(auto, on_card, format)
|
||||||
|
|
||||||
if bad:
|
if bad:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user