Very strange change to prevent calibre from dieing when device_metadata_available or device_connection_changed is emitted.

This commit is contained in:
Charles Haley 2011-04-19 13:42:09 +01:00
parent d95d6eca67
commit b4dda27923

View File

@ -7,7 +7,7 @@ import os, traceback, Queue, time, cStringIO, re, sys
from threading import Thread
from PyQt4.Qt import QMenu, QAction, QActionGroup, QIcon, SIGNAL, \
Qt, pyqtSignal, QDialog
Qt, pyqtSignal, QDialog, QObject
from calibre.customize.ui import available_input_formats, available_output_formats, \
device_plugins
@ -587,8 +587,7 @@ class DeviceMenu(QMenu): # {{{
# }}}
class DeviceMixin(object): # {{{
class DeviceSignals(QObject):
#: This signal is emitted once, after metadata is downloaded from the
#: connected device.
#: The sequence: gui.device_manager.is_device_connected will become True,
@ -599,6 +598,10 @@ class DeviceMixin(object): # {{{
device_metadata_available = pyqtSignal()
device_connection_changed = pyqtSignal(object)
device_signals = DeviceSignals()
class DeviceMixin(object): # {{{
def __init__(self):
self.device_error_dialog = error_dialog(self, _('Error'),
_('Error communicating with device'), ' ')
@ -745,7 +748,7 @@ class DeviceMixin(object): # {{{
self.location_manager.update_devices()
self.library_view.set_device_connected(self.device_connected)
self.refresh_ondevice()
self.device_connection_changed.emit(connected)
device_signals.device_connection_changed.emit(connected)
def info_read(self, job):
'''
@ -784,7 +787,7 @@ class DeviceMixin(object): # {{{
self.sync_news()
self.sync_catalogs()
self.refresh_ondevice()
self.device_metadata_available.emit()
device_signals.device_metadata_available.emit()
def refresh_ondevice(self, reset_only = False):
'''