Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-23-2010, 02:32 PM   #1
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,230
Karma: 1345754
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Possible new feature: Adding a r/c menu option to add to user category items

I just "discovered" a use for a Calibre feature today ("Manage User Categories) to allow me to build various "lists" such as favourite authors etc, all very cool!

However I think the feature could be improved if you did not have to always go into the manage dialog to add to a user category. When you have a large database it is a bit painful to scroll up/down the list to find an author etc, plus it as not as convenient as a right-click on your library view could be.

So I started playing with the source code and have a very simple working implementation with the user category hard-coded (i.e. works for me, if no-one else cares/wants it then no problem). However I could submit the changes as a patch if it was developed a bit further.

There are various ways the context menu could be structured. From a user perspective I think the simplest to use (least clicks) would be for the user category name to appear as a sub-menu a bit like this:
Code:
Add to user category ==>
                           User Category 1 ==>
                                                     Selected authors
                                                     Selected series
                                                     Selected tags
                                                     Selected publishers
                           User Category 2 ==>
        ... etc
However that would seem to require that every time a context menu is built to get the user category names via either
(1.1) interrogate the database, or
(1.2) interrogate a cache, or
(1.3) interrogate a tweak option value

Option (1.1) is likely undesired for performance reasons, and option (1.3) might be considered too complex for users and prone to becoming out of date as users add/remove categories in the tag viewer. I would need some guidance to implement option (1.2) and also the issue with caches is of course knowing all the places they need to be refreshed.

The alternative approach is to force the user through a popup dialog. Personally I hate popups where they can be avoided, but I can accept that in this situation if the above is unacceptable/undesired then it seems the only alternative. So the menu could look like this:
Code:
Add to user category ==>
                           Selected authors...
                           Selected series...
                           Selected tags...
                           Selected publishers...
The dialog that appears could be one of two implementations I can think of:
(2.1) A simple popup list where the user chooses a category to add to (like remove format dialog), or
(2.2) Re-use the existing Manage User categories dialog

I would prefer option (2.1) here as a user I think though more work to code it. Option (2.2) would be possible by butchering the existing code a bit. For instance when the dialog is in this 'mode' rather than displaying "all" authors/tags/publishers etc on the LHS you restrict it to just data from the selected row(s). However the user would still need to first select the category, then select all the values on the LHS and the button to add them to your category. Lots more clicks, and more clicks suck imho.

Anyone have any thoughts on this? Would love to see the feature or really not bothered? Guidance would be appreciated if someone would like to see it as a patch, or else it will just stay forever in my local copy of Calibre...
kiwidude is offline   Reply With Quote
Old 11-23-2010, 02:39 PM   #2
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 15,270
Karma: 6022733
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
I think what you are asking for is called "Saved Searches" (upper right)

Once made, you can use them as implied or to Restrict view: which allows you to still search within the restricted view.
Management can be done in the Tag view window
theducks is online now   Reply With Quote
Old 11-23-2010, 02:50 PM   #3
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,230
Karma: 1345754
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Quote:
Originally Posted by theducks View Post
I think what you are asking for is called "Saved Searches" (upper right)

Once made, you can use them as implied or to Restrict view: which allows you to still search within the restricted view.
Management can be done in the Tag view window
I will confess I haven't found a use yet for saved searches. I don't actually want to restrict my view of the library in normal day to day usage when I am adding new books and editing metadata. When you are trying to ensure no duplicates etc you can't use a restricted view.

What I do want to do is be able to build lists of series or authors that I intend to "revisit" in future. There is no meaningful "subset" that I could restrict my view to which reduces the authors down to a manageable level, given my favourite authors list for instance could include any one of them?

I understand I "could" construct my lists as a saved search by building monstrous "or" expressions, however this is pretty nasty to maintain and I think the "user categories" feature is better suited? Or am I missing something?
kiwidude is offline   Reply With Quote
Old 11-23-2010, 03:01 PM   #4
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by kiwidude View Post
What I do want to do is be able to build lists of series or authors that I intend to "revisit" in future.
Why not just tag the books for that author "FavoriteAuthor" then search for that tag or tag the books "FavoriteSeries" and then search for that tag (and save the search)? I tag with "ToRead" to indicate it's a specific book I want to read (later), but you can do it at the series or author level, instead of at the book level, if you prefer.
Starson17 is offline   Reply With Quote
Old 11-23-2010, 03:14 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,438
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
you can get the list of user categories by interogating

self.model().db.field_metadata

see field_metadata.py for details
kovidgoyal is offline   Reply With Quote
Old 11-23-2010, 03:26 PM   #6
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,230
Karma: 1345754
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Quote:
Originally Posted by Starson17 View Post
Why not just tag the books for that author "FavoriteAuthor" then search for that tag or tag the books "FavoriteSeries" and then search for that tag (and save the search)? I tag with "ToRead" to indicate it's a specific book I want to read (later), but you can do it at the series or author level, instead of at the book level, if you prefer.
I've tried that tag approach for this but to be honest I just don't like it for this purpose. Absolutely I use a "Read" type tag if I spot an individual book that I want to highlight. However there are times where you want to work at a "level higher" than "per book" level which is the issue with tags. For instance if I want to read a series that has 20 books in it, either you have to remember to apply that tag to every book (and any new ones in the series you add over time), or you apply it to the first one and then do extra search steps to get all the books in that series when it comes time to make use of it.

Similarly I am still trying to consolidate my various book collections into Calibre and are working through author by author to update metadata, resolve duplicates, find better formats, create wishlist books for missing entries etc. So I am recording per author that I am "done" with them. I was doing this in a spreadsheet, but instead adding these to a user category list will work better than adding yet more tags across every book?

I think the tag viewer works well when you have a relatively small subset, which user categories allows you to make, and lets me drill into stuff with just a couple of clicks rather than typing search queries and sorting/scrolling through results to drill down to the same effect.

Lots of ways to skin the cat, one of the great features of Calibre
kiwidude is offline   Reply With Quote
Old 11-23-2010, 03:56 PM   #7
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,230
Karma: 1345754
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Quote:
Originally Posted by kovidgoyal View Post
you can get the list of user categories by interogating

self.model().db.field_metadata

see field_metadata.py for details
Excellent, thanks for the heads up Kovid. I wasn't sure where field_metadata fit into the picture until I found that tag_view.py rebuilds the list of user categories in field_metadata when it's model is refreshed. Sound just what I was after, thanks.
kiwidude is offline   Reply With Quote
Old 11-23-2010, 04:31 PM   #8
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,230
Karma: 1345754
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Quote:
Originally Posted by kiwidude View Post
Excellent, thanks for the heads up Kovid. I wasn't sure where field_metadata fit into the picture until I found that tag_view.py rebuilds the list of user categories in field_metadata when it's model is refreshed. Sound just what I was after, thanks.
Ok, discovered a fly in the ointment but perhaps you know a workaround. It seems the context menus are only built once at application startup, rather than every time you right-click.

Problem (1) is that means if you add a new user category you won't see it in the menu until you restart. Not the end of the world given how rare you would add new ones.

However the bigger problem (2) is that it "appears" that in the genesis method of the user action I don't have access to the model? I've tried a number of permutations such as self.model(), self.gui.model(), self.gui.library_view.model() but keep getting hit with AttributeError:'xxx' object has no attribute 'model'.

I would presume that the model has not been initialised at the time the menus are created? Is there a plan B or is this approach scuppered? Apologies for being dense.
kiwidude is offline   Reply With Quote
Old 11-23-2010, 04:43 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,438
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
use initialization_complete rather than genesis
kovidgoyal is offline   Reply With Quote
Old 11-23-2010, 05:48 PM   #10
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by kiwidude View Post
I've tried that tag approach for this but to be honest I just don't like it for this purpose. ...

Lots of ways to skin the cat, one of the great features of Calibre
Having thought about it a bit, I can see where you are going with the right click and assignment of selected items to user categories. It looks useful, and Kovid's leads should help you on your way. I'd encourage you to submit it as a patch.

To be sure I understand, you would select books, then you would right click, choose "Add to user category" which would expand to list all the created user categories , and you would choose one of the user categories, which would then expand to show these options: "Selected authors" or ... or "Selected series" or Selected Tags"?

Behind the scenes, all the authors in all the selected books would be assigned to the selected user category if you chose "Selected authors"?

Would you assign all the tags on all the selected books if you chose "Selected Tags"?
Starson17 is offline   Reply With Quote
Old 11-23-2010, 07:38 PM   #11
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,230
Karma: 1345754
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Job done - thanks very much to Kovid for the pointers.

Starson17 - yes that is exactly the behaviour. Depending on the sub-menu you select I build a unique list of authors/tags/series/publishers from the rows selected. Any that don't already exist in the user category are then added to it. As mentioned above the one minor issue is that you have to restart Calibre to get new user categories to appear in the menu but that is no big deal once you know that.

I've attached a screenshot, and probably tomorrow submit it in a day or two as a patch in case anything else comes up or other suggestions arise.
Attached Thumbnails
Click image for larger version

Name:	AddToUserCategory.png
Views:	129
Size:	55.9 KB
ID:	61742  
kiwidude is offline   Reply With Quote
Old 11-24-2010, 06:21 AM   #12
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,908
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by kiwidude View Post
I've attached a screenshot, and probably tomorrow submit it in a day or two as a patch in case anything else comes up or other suggestions arise.
Just curious, if someone hasn't created any "User categories" what will they see when they hover over the "Add to user category" menu?
DoctorOhh is offline   Reply With Quote
Old 11-24-2010, 06:57 AM   #13
kiwidude
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,230
Karma: 1345754
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite 3G, iPad 3, iPad Air
Quote:
Originally Posted by dwanthny View Post
Just curious, if someone hasn't created any "User categories" what will they see when they hover over the "Add to user category" menu?
The top level menu item is disabled in that situation currently. I considered it having a disabled sub-menu item saying something like "No user categories defined" or similar but perhaps that's a little non-standard?

If someone has a better suggestion I'm all ears.
kiwidude is offline   Reply With Quote
Old 11-24-2010, 07:50 AM   #14
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,106
Karma: 780247
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Looking at the screenshot, the top level talks about "Favourite Auth" but then point to Authors, Series, etc. Perhaps the nintermediate level should just be "Favourites" and "Processed" as it does not seem to be limited to Authors?

Let us know when the patch is available - I would be interested in downloading it and seeing how it works in more detail.
itimpi is offline   Reply With Quote
Old 11-24-2010, 07:56 AM   #15
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,908
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by itimpi View Post
Looking at the screenshot, the top level talks about "Favourite Auth" but then point to Authors, Series, etc.
The top level are whatever user categories you have already defined, look left to the tag browser in the image.
DoctorOhh is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Suggestion: Selecting a user-defined Category should show all of the books in it Daemon Calibre 6 08-23-2010 02:19 PM
Author category: feature request! alexxxm Calibre 1 08-18-2010 08:21 PM
Feature Request - Edit File Option fcoulter Calibre 10 07-22-2010 01:56 AM
Power Mode option in diagnostics menu? scarab1 Ectaco jetBook 0 02-28-2010 11:59 PM


All times are GMT -4. The time now is 07:10 PM.


MobileRead.com is a privately owned, operated and funded community.