Merge pull request #32 from cbhaley/master

In device view: change so that "sync" icon has priority over "in library" icon
This commit is contained in:
Kovid Goyal 2013-07-11 08:19:44 -07:00
commit 9f1b2ee1fa

View File

@ -1545,10 +1545,10 @@ class DeviceBooksModel(BooksModel): # {{{
self.db.supports_collections()): self.db.supports_collections()):
return QVariant(_("Double click to <b>edit</b> me<br><br>")) return QVariant(_("Double click to <b>edit</b> me<br><br>"))
elif role == Qt.DecorationRole and cname == 'inlibrary': elif role == Qt.DecorationRole and cname == 'inlibrary':
if self.db[self.map[row]].in_library: if hasattr(self.db[self.map[row]], 'in_library_waiting'):
return QVariant(self.bool_yes_icon)
elif hasattr(self.db[self.map[row]], 'in_library_waiting'):
return QVariant(self.sync_icon) return QVariant(self.sync_icon)
elif self.db[self.map[row]].in_library:
return QVariant(self.bool_yes_icon)
elif self.db[self.map[row]].in_library is not None: elif self.db[self.map[row]].in_library is not None:
return QVariant(self.bool_no_icon) return QVariant(self.bool_no_icon)
elif role == Qt.TextAlignmentRole: elif role == Qt.TextAlignmentRole: