mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Fix #2390 (Error window when a large number books cannot be transferred to a device because of incompatible formats is too large for dis)
This commit is contained in:
parent
3523ecaf5f
commit
4f643a17f6
@ -16,7 +16,7 @@ from calibre.gui2.dialogs.choose_format import ChooseFormatDialog
|
|||||||
from calibre.parallel import Job
|
from calibre.parallel import Job
|
||||||
from calibre.devices.scanner import DeviceScanner
|
from calibre.devices.scanner import DeviceScanner
|
||||||
from calibre.gui2 import config, error_dialog, Dispatcher, dynamic, \
|
from calibre.gui2 import config, error_dialog, Dispatcher, dynamic, \
|
||||||
pixmap_to_data, warning_dialog
|
pixmap_to_data
|
||||||
from calibre.ebooks.metadata import authors_to_string
|
from calibre.ebooks.metadata import authors_to_string
|
||||||
from calibre.gui2.dialogs.conversion_error import ConversionErrorDialog
|
from calibre.gui2.dialogs.conversion_error import ConversionErrorDialog
|
||||||
from calibre.devices.interface import Device
|
from calibre.devices.interface import Device
|
||||||
@ -26,6 +26,11 @@ from calibre.devices.errors import FreeSpaceError
|
|||||||
from calibre.utils.smtp import compose_mail, sendmail, extract_email_address, \
|
from calibre.utils.smtp import compose_mail, sendmail, extract_email_address, \
|
||||||
config as email_config
|
config as email_config
|
||||||
|
|
||||||
|
def warning(title, msg, details, parent):
|
||||||
|
from calibre.gui2.widgets import WarningDialog
|
||||||
|
WarningDialog(title, msg, details, parent).exec_()
|
||||||
|
|
||||||
|
|
||||||
class DeviceJob(Job):
|
class DeviceJob(Job):
|
||||||
|
|
||||||
def __init__(self, func, *args, **kwargs):
|
def __init__(self, func, *args, **kwargs):
|
||||||
@ -478,11 +483,11 @@ class DeviceGUI(object):
|
|||||||
self.status_bar.showMessage(_('Sending email to')+' '+to, 3000)
|
self.status_bar.showMessage(_('Sending email to')+' '+to, 3000)
|
||||||
|
|
||||||
if bad:
|
if bad:
|
||||||
bad = '\n'.join('<li>%s</li>'%(i,) for i in bad)
|
bad = u'\n'.join(u'<li>%s</li>'%(i,) for i in bad)
|
||||||
d = warning_dialog(self, _('No suitable formats'),
|
details = u'<p><ul>%s</ul></p>'%bad
|
||||||
'<p>'+ _('Could not email the following books '
|
warning(_('No suitable formats'),
|
||||||
'as no suitable formats were found:<br><ul>%s</ul>')%(bad,))
|
_('Could not email the following books '
|
||||||
d.exec_()
|
'as no suitable formats were found:'), details, self)
|
||||||
|
|
||||||
def emails_sent(self, results, remove=[]):
|
def emails_sent(self, results, remove=[]):
|
||||||
errors, good = [], []
|
errors, good = [], []
|
||||||
@ -624,13 +629,13 @@ class DeviceGUI(object):
|
|||||||
self.upload_books(gf, names, good, on_card, memory=(_files, remove))
|
self.upload_books(gf, names, good, on_card, memory=(_files, remove))
|
||||||
self.status_bar.showMessage(_('Sending books to device.'), 5000)
|
self.status_bar.showMessage(_('Sending books to device.'), 5000)
|
||||||
if bad:
|
if bad:
|
||||||
bad = '\n'.join('<li>%s</li>'%(i,) for i in bad)
|
bad = u'\n'.join(u'<li>%s</li>'%(i,) for i in bad)
|
||||||
d = warning_dialog(self, _('No suitable formats'),
|
details = u'<p><ul>%s</ul></p>'%bad
|
||||||
|
warning(_('No suitable formats'),
|
||||||
_('Could not upload the following books to the device, '
|
_('Could not upload the following books to the device, '
|
||||||
'as no suitable formats were found. Try changing the output '
|
'as no suitable formats were found. Try changing the output '
|
||||||
'format in the upper right corner next to the red heart and '
|
'format in the upper right corner next to the red heart and '
|
||||||
're-converting. <br><ul>%s</ul>')%(bad,))
|
're-converting.'), details, self)
|
||||||
d.exec_()
|
|
||||||
|
|
||||||
def upload_booklists(self):
|
def upload_booklists(self):
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user