|
|
Thread Tools | Search this Thread |
11-24-2010, 07:02 AM | #16 |
Wizard
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
I knew that I need the patch to play with the facility to really understand it
|
11-24-2010, 07:25 AM | #17 | |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Quote:
Imagine however you had a "Books to Read" user category. It might contain anything with tag "ToRead", plus a couple of your favourite authors, plus a series (by multiple authors). In that situation "Books to Read" would be in the second level menu (where "Fav Authors" is in my screenshot) and you are able to add any of authors/tags/series with the sub-menu from the selected rows. |
|
Advert | |
|
11-24-2010, 09:23 AM | #18 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Patch file attached to ticket 7642
Read the notes in the ticket carefully if you want to apply it - as stated the patch was made with ticket 7502 already applied which is my "Search the internet" patch. So either apply both (7502 patch first), or just modify the two lines of code in the two files listed affected to remove mention of "SearchTheInternetAction" and "Search The Internet" respectively. |
11-28-2010, 08:39 AM | #19 |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Apologies for resurrecting this thread, but I am curious -- wouldn't it be easier to drag the book onto the user category instead of the context menu?
Dragging onto a category doesn't currently do anything, but it wouldn't be hard to do something like 'add the currently selected column as a category'. In other words, clicking in the author cell then dragging that book to the category would add that author to the category. |
11-28-2010, 08:45 AM | #20 | |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Quote:
Plus it also requires that you not only have the tag viewer visible but also the category within it visible to drop onto which could require collapsing/scrolling etc first. I frequently have the tag viewer turned off completely while editing metadata for screen real-estate. |
|
Advert | |
|
11-28-2010, 08:51 AM | #21 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
Since we have UI action plugins and customizable menus now to reduce/customize the amount of UI bloat, is there something wrong with having both? Personally, had I need for such an action, I'd prefer the context menu, but I can also see the appeal for drag-and-drop.
|
11-28-2010, 09:03 AM | #22 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Not at all imho - as I said above it sounds like a nice additional option to add. I just tried to justify why I didn't choose that approach first up. As I am sure others would say, feel free to write it yourself and submit it...
|
11-28-2010, 09:25 AM | #23 | |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
However, as I wouldn't use the feature, I won't be submitting a patch. I asked because I was wondering about your rationale, and that was exactly the what you gave me. |
|
11-29-2010, 01:10 PM | #24 | |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
The code works with authors, publisher, series, non-multiple text custom columns, and series-like custom columns. I chose not to do tags and multiple custom columns, because it didn't make sense to me to add *all* the tags on a book to a user category. Note that autoscroll and autoexpand are both enabled, so you don't need to position the tags pane first. However, I did notice that it wants to open only one category at a time. If you want to open another one, simply move the mouse pointer out of, then back into, the tags pane. Autoscroll by moving the mouse pointer to the bottom or the top. Code is available in 'trunk', and will be in the next release. |
|
11-29-2010, 01:40 PM | #25 | |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Quote:
As you are someone who is clearly familiar with the code/writing features etc there is something else I would like. Got any ideas about an easy way to select all of the items within a user category (for applying as a search)? At the moment you have to ctrl+single click each one by one. Perhaps something like a "Select All" or similar right-click on the user category name? |
|
11-29-2010, 02:00 PM | #26 | ||
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Quote:
|
||
11-29-2010, 02:19 PM | #27 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Do you have any suggestions on the best way to correct such a deficiency? I've read a tutorial and browsed the docs, but I'm still having trouble with Qt. I can add option boxes and menu items, but much more than that and I get lost. I haven't played much with the designer - should I be focusing there more?
|
11-29-2010, 03:51 PM | #28 | |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
First, I should note that I am continually frustrated by Qt. Its organization and the class hierarchies do not match my mental model, which derives from writing code for Win 3.1 and early smalltalk programs. I have similar problems with Java's class hierarchies. If I didn't have samples (Kovid's code), I would be totally lost. Regarding getting experience, there are two facets to consider: event-driven programming and the Qt package. If you aren't familiar with the first, then the second is much more problematic. As regards the first, at the risk of being booed out of town, playing with MS Visual Basic might be a way to go forward, much better that Qt's designer. VB has a rather clean event and form model, so it is easy to get used to writing code that reacts to events instead of code that proactively does something. It supports instant addition and execution of event functions. Qt's designer does not permit easy insertion of event functions, making it harder to use as a learning tool. As regards the second, what I did (and do) is choose something interesting in the code, then try to understand what is happening. I then try to predict the effect of changes, then test the predictions. In addition, I look at the change logs and the change sets for most GUI changes that Kovid makes, worrying at it until I can describe what the change does, and why. As a side benefit, sometimes I find bugs. My first real effort with Qt was adding custom columns and user-defined categories to the library view and tag browser. I looked at how Kovid did the standard stuff, and then played with possible changes. I changed the code, submitted it, and then looked at how Kovid changed what I did. I still check the code in 'trunk' against what I submitted, because the differences are instructive. I suppose that what I am suggesting is that you jump in and try. Of course, this might be impractical if you have a 'real job', because the process is quite time consuming. BTW: if you are going to do much more development, you might want to consider creating a launchpad account. Managing repositories is much easier if you don't need to deal with patches. I maintain a local shadow of trunk, merge from that, then push changes to my launchpad repository. Kovid takes changes from there. I think that it is easier for Kovid to merge from launchpad repositories as opposed to patches, but I am not sure of that. I know that it is easier for me. |
|
11-29-2010, 05:53 PM | #29 |
creator of calibre
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I bootstrapped myself on GUI programming with Qt, evidence of which you can find in some of the older code in calibre, which is, to put it charitably, a mess.
I still occasionally find Qt jarring to use, primarily because it doesn't have a pythonic interface. PyQt, understandably, models the C++ interface of Qt very closely, so that people new to it can use the C++ documentation. So keep that in mind. When you're using Qt, you're doing things the C++ way. As for getting started on Qt, I would suggest avoiding Qt Designer, and hand coding a few dialogs, that will give you a better feel for what goes on underneath. I know it is really tedious creating endless labels and input fields and putting them all together in a layout, but if you succesfully do it once of twice it will raise your confidence levels. Another trick I would suggest is develop dialogs as standalone objects, which you can run independent of calibre easily and quickly. There are many examples of that in the calibre code. For instance calibre-debug -e src/calibre/gui2/preferences/main.py or calibre-debug -e src/calibre/gui2/dialogs/scheduler.py Look at the if __name__ == '__main__' section of these files to see how to do that. |
11-30-2010, 09:14 AM | #30 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Thanks, Charles and Kovid, for your helpful comments. I've been doing pretty much what Charles has suggested - picking interesting bits of Kovid's code, trying to understand it, modifying it to see the effects, etc. It's been instructive. I tried to play with the Designer, but didn't feel it was helping me much, so I'm going to go back to what Kovid suggests and do it by hand, bit by bit, until I understand it.
|
|
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 01:19 PM |
Author category: feature request! | alexxxm | Calibre | 1 | 08-18-2010 07:21 PM |
Feature Request - Edit File Option | fcoulter | Calibre | 10 | 07-22-2010 12:56 AM |
Power Mode option in diagnostics menu? | scarab1 | Ectaco jetBook | 0 | 02-28-2010 10:59 PM |