Merge from trunk

This commit is contained in:
Charles Haley 2010-09-19 07:34:52 +01:00
commit f0f858c7d0
4 changed files with 9 additions and 2 deletions

View file

@ -390,6 +390,9 @@ def format_field_extended(self, key, series_with_index=True):
return (None, None, None, None)
orig_res = res
cmeta = self.get_user_metadata(key, make_copy=False)
if res is None or res == '':
return (None, None, None, None)
orig_res = res
name = unicode(cmeta['name'])
datatype = cmeta['datatype']
if datatype == 'text' and cmeta['is_multiple']:

View file

@ -707,6 +707,10 @@ def device_detected(self, connected, device_kind):
'''
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)
if connected:
self.device_manager.get_device_information(\

View file

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

View file

@ -20,7 +20,6 @@
from calibre.library.server.utils import format_tag_string
from calibre import guess_type
from calibre.utils.ordered_dict import OrderedDict
from calibre.utils.date import format_date
BASE_HREFS = {
0 : '/stanza',