diff --git a/src/calibre/devices/smart_device_app/driver.py b/src/calibre/devices/smart_device_app/driver.py index 208db0ce75..95fea47d20 100644 --- a/src/calibre/devices/smart_device_app/driver.py +++ b/src/calibre/devices/smart_device_app/driver.py @@ -208,6 +208,7 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): THUMBNAIL_HEIGHT = 160 DEFAULT_THUMBNAIL_HEIGHT = 160 THUMBNAIL_COMPRESSION_QUALITY = 75 + DEFAULT_THUMBNAIL_COMPRESSION_QUALITY = 75 PREFIX = '' BACKLOADING_ERROR_MESSAGE = None @@ -680,6 +681,8 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): return self.OPT_PORT_NUMBER elif opt_string == 'force_ip_address': return self.OPT_FORCE_IP_ADDRESS + elif opt_string == 'thumbnail_compression_quality': + return self.OPT_COMPRESSION_QUALITY else: return None @@ -1463,6 +1466,7 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): self.connection_attempts = {} self.client_wants_uuid_file_names = False + message = None compression_quality_ok = True try: cq = int(self.settings().extra_customization[self.OPT_COMPRESSION_QUALITY]) @@ -1474,11 +1478,12 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): compression_quality_ok = False if not compression_quality_ok: self.THUMBNAIL_COMPRESSION_QUALITY = 70 - message = 'Bad compression quality setting. It must be a number between 50 and 99' + message = _('Bad compression quality setting. It must be a number ' + 'between 50 and 99. Forced to be %d.')%self.DEFAULT_THUMBNAIL_COMPRESSION_QUALITY self._debug(message) - return message + self.set_option('thumbnail_compression_quality', + str(self.DEFAULT_THUMBNAIL_COMPRESSION_QUALITY)) - message = None try: self.listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) set_socket_inherit(self.listen_socket, False) @@ -1541,7 +1546,6 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin): # Now try to open a UDP socket to receive broadcasts on - message = None try: self.broadcast_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) except: diff --git a/src/calibre/gui2/dialogs/smartdevice.py b/src/calibre/gui2/dialogs/smartdevice.py index bebec4abee..9bd570a12e 100644 --- a/src/calibre/gui2/dialogs/smartdevice.py +++ b/src/calibre/gui2/dialogs/smartdevice.py @@ -143,7 +143,7 @@ class SmartdeviceDialog(QDialog, Ui_Dialog): if not self.device_manager.is_running('smartdevice'): error_dialog(self, _('Problem starting the wireless device'), - _('The wireless device driver did not start. It said "%s"')%message, + _('The wireless device driver had problems starting. It said "%s"')%message, show=True) self.device_manager.set_option('smartdevice', 'use_fixed_port', self.orig_fixed_port) diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index a019ae11b6..8888ba7a07 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -432,7 +432,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{ if message: if not self.device_manager.is_running('Wireless Devices'): error_dialog(self, _('Problem starting the wireless device'), - _('The wireless device driver did not start. ' + _('The wireless device driver had problems starting. ' 'It said "%s"')%message, show=True) self.iactions['Connect Share'].set_smartdevice_action_state()