Pull from trunk

This commit is contained in:
Kovid Goyal 2010-09-18 20:07:44 -06:00
commit db2f4dca7f
2 changed files with 6 additions and 1 deletions

View File

@ -707,6 +707,10 @@ class DeviceMixin(object): # {{{
''' '''
Called when a device is connected to the computer. Called when a device is connected to the computer.
''' '''
# This can happen as this function is called in a queued connection and
# the user could have yanked the device in the meantime
if connected and not self.device_manager.is_device_connected:
connected = False
self.set_device_menu_items_state(connected) self.set_device_menu_items_state(connected)
if connected: if connected:
self.device_manager.get_device_information(\ self.device_manager.get_device_information(\

View File

@ -38,6 +38,7 @@ from calibre.gui2.init import LibraryViewMixin, LayoutMixin
from calibre.gui2.search_box import SearchBoxMixin, SavedSearchBoxMixin from calibre.gui2.search_box import SearchBoxMixin, SavedSearchBoxMixin
from calibre.gui2.search_restriction_mixin import SearchRestrictionMixin from calibre.gui2.search_restriction_mixin import SearchRestrictionMixin
from calibre.gui2.tag_view import TagBrowserMixin from calibre.gui2.tag_view import TagBrowserMixin
from calibre.utils.ordered_dict import OrderedDict
class Listener(Thread): # {{{ class Listener(Thread): # {{{
@ -97,7 +98,7 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, # {{{
MainWindow.__init__(self, opts, parent) MainWindow.__init__(self, opts, parent)
self.opts = opts self.opts = opts
self.device_connected = None self.device_connected = None
acmap = {} acmap = OrderedDict()
for action in interface_actions(): for action in interface_actions():
mod, cls = action.actual_plugin.split(':') mod, cls = action.actual_plugin.split(':')
ac = getattr(__import__(mod, fromlist=['1'], level=0), cls)(self, ac = getattr(__import__(mod, fromlist=['1'], level=0), cls)(self,