View Single Post
Old 01-04-2016, 01:52 AM   #1036
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Another beta: Comments, toolbar button tooltip, driver menu

Attached is a new beta with a few changes.

Firstly the comments template in the metadata update. As I mentioned in discussion after my last beta, I am questioning the best way to do the template. The last beta uses the "jacket" style of template. Then I played with the "plugboard" style of template. There are things to be said for both. The former is simpler, but the latter is more powerful. So, this beta allows both. Which style is used, depends on the first word of the template. So, the two examples are:

Code:
jacket:{comments}<hr/><p>{tags_label}: {tags}</p><p>{rating_label}: {rating}</p><p>{_kobo_last_read_label}: {_kobo_last_read}</p><p>Word count: {_words}</p>

template:{comments}{tags:|<p>Tags: |</p>}{rating:|<p>Rating: |</p>}{#kobo_last_read:|<p>Last Read: |</p>}{#words:|<p>Word count: |</p>}
So, if the template starts with "jacket:", it will be treated as the jacket style. That means simple replacement of the template elements. If the template starts with "template:" or "plugboard:", it will be processed like a plugboard template with fill evaluation of the template elements.

And as a reminder, the template goes into a file called "kobo_template.xhtml" in the "resources" directory of you calibre configuration. It doesn't have to be on one line as my examples, but, any new-lines in the final comments will be used in the synopsis displayed on the device.

What I want is an opinion of which to support. I don't really want to support both. I might, but, if I hit problems later, I might have to drop one. So, try it and tell me what you think.

While doing the above, I got annoyed by the wait while the selected books were checked before the options dialog was displayed. I couldn't do anything about the time taken, so added a progress dialog to show that something was being done.

The other changes are related to some "fiddling" I have been doing. I've been fiddling with the driver and kept having to open the configuration when the device wasn't connected. Going through the calibre preferences was a pain, so, I added a function to do this. Then I needed to swap between the main and the extended driver, so, another function added to swap the driver. Then, I kept forgetting which driver I was using. So, I added the driver to the tooltip of the plugins toolbar button. And as I was doing that, I added the current device name and firmware version if a device was connected.

For the driver options, if there is a device connected, it will show the correct device or open the configuration for it. If the device isn't connected, it looks to see which of the main and extended drivers are enabled and goes from there. It will handle if the extended driver isn't installed.

So, the list for this beta is:
  • Update: Use template for comments/synopsis with a choice of "plugboard" style or "jacket" style.
  • Update: Display progress dialog when getting book list for updating metadata.
  • New: Submenu for the calibre driver.
    • New: Menu option to swap between main and extended driver.
    • New: Menu option to open driver configuration. If a device is connected, will open its configuration. Otherwise, it opens whichever is enable of the main and extended drivers.
  • New: Display device name, firmware version and the driver name in tooltip of button.

Please test and tell me how these all work. Or don't. And tell me what you think is best for the comments template.

Last edited by davidfor; 04-02-2016 at 07:07 AM. Reason: Remove old beta.
davidfor is offline