This commit is contained in:
Kovid Goyal 2011-02-25 10:09:59 -07:00
commit f021980826
2 changed files with 12 additions and 11 deletions

View File

@ -85,7 +85,7 @@ class TagsView(QTreeView): # {{{
author_sort_edit = pyqtSignal(object, object)
tag_item_renamed = pyqtSignal()
search_item_renamed = pyqtSignal()
drag_drop_finished = pyqtSignal(object, object)
drag_drop_finished = pyqtSignal(object)
def __init__(self, parent=None):
QTreeView.__init__(self, parent=None)
@ -921,7 +921,7 @@ class TagsModel(QAbstractItemModel): # {{{
def handle_user_category_drop(self, on_node, ids, column):
categories = self.db.prefs.get('user_categories', {})
category = categories.get(on_node.category_key[:-1], None)
category = categories.get(on_node.category_key[1:], None)
if category is None:
return
fm_src = self.db.metadata_for_field(column)
@ -955,9 +955,9 @@ class TagsModel(QAbstractItemModel): # {{{
break
else:
category.append([val, column, vmap[val]])
categories[on_node.category_key[:-1]] = category
categories[on_node.category_key[1:]] = category
self.db.prefs.set('user_categories', categories)
self.drag_drop_finished.emit(None, True)
self.tags_view.recount()
def handle_drop(self, on_node, ids):
#print 'Dropped ids:', ids, on_node.tag
@ -975,7 +975,7 @@ class TagsModel(QAbstractItemModel): # {{{
fm = self.db.metadata_for_field(key)
is_multiple = fm['is_multiple']
val = on_node.tag.name
val = original_name(on_node.tag)
for id in ids:
mi = self.db.get_metadata(id, index_is_id=True)
@ -1007,7 +1007,7 @@ class TagsModel(QAbstractItemModel): # {{{
self.db.set_metadata(id, mi, set_title=False,
set_authors=set_authors, commit=False)
self.db.commit()
self.drag_drop_finished.emit(ids, False)
self.drag_drop_finished.emit(ids)
def set_search_restriction(self, s):
self.search_restriction = s
@ -1912,11 +1912,8 @@ class TagBrowserMixin(object): # {{{
self.library_view.model().refresh()
self.tags_view.recount()
def drag_drop_finished(self, ids, is_category):
if is_category:
self.tags_view.recount()
else:
self.library_view.model().refresh_ids(ids)
def drag_drop_finished(self, ids):
self.library_view.model().refresh_ids(ids)
# }}}

View File

@ -440,6 +440,8 @@ The Tag Browser allows you to easily browse your collection by Author/Tags/Serie
There is a search bar at the top of the Tag Browser that allows you to easily find any item in the Tag Browser. In addition, you can right click on any item and choose to hide it or rename it or open a "Manage x" dialog that allows you to manage items of that kind. For example the "Manage Authors" dialog allows you to rename authors and control how their names are sorted.
Items in the Tag browser have their icons partially colored. The amount of color depends on the average rating of the books in that category. So for example if the books by Isaac Asimov have an average of four stars, the icon for ISaac Asimov in the Tag Browser will be 4/5th colored. You can hover your mouse over the icon to see the average rating.
For convenience, you can drag and drop books from the book list to items in the Tag Browser and that item will be automatically applied to the dropped books. For example, dragging a book to Isaac Asimov will set the author of that book to Isaac Asimov or dragging it to the tag History will add the tag History to its tags.
The outer-level items in the tag browser such as Authors and Series are called categories. You can create your own categories, called User Categories, which are useful for organizing items. For example, you can use the user categories editor (push the Manage User Categories button) to create a user category called Favorite Authors, then put the items for your favorites into the category. User categories act like built-in categories; you can click on items to search for them. You can search for all items in a category by right-clicking on the category name and choosing "Search for books in ...".
@ -450,6 +452,8 @@ It is also possible to create hierarchies inside some of the built-in categories
You can drag and drop items in the Tag browser onto user categories to add them to that category.
You can control how items are sorted in the Tag browser via the box at the bottom of the Tag Browser. You can choose to sort by name, average rating or popularity (popularity is the number of books with an item in your library; for example; the popularity of Isaac Asimov is the number of book sin your library by Isacc Asimov).
Jobs
-----