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

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 01-27-2011, 09:30 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
[GUI Plugin] Quick Preferences

This plugin provides a way to quickly switch between certain preferences values without going into the preferences dialog. Specifically it currently caters for preferences related to adding books but could be added to in future if needed.

Many users like myself prefer to rename files to a single standard format before importing into Calibre. However this plugin gives you the option to quickly "switch on the fly" your settings without the drudgery of the Preferences dialog (and saving your regular expressions in Notepad!).

By default I have included two regex patterns - the default Calibre one, and a second for handling titles in "author [- optional series #] - title" format.

Main Features of v1.4.1:
  • Add to your toolbar a quick selection dropdown button rather than navigating through the Calibre Preferences dialog.
  • Store as many regular expressions file patterns as you wish
  • Optionally specify a pairing of the swap author name setting with your regular expression
  • Toggle the checked status of the three other options related to adding books that exist in the preferences dialog currently
  • Switch your automerge type
  • Customise which menu options are included on the dropdown
  • Customise keyboard shortcuts
  • Keeps in sync with changes made via the Preferences dialog

Special Notes:
  • Requires Calibre 0.8.18 or later.

Installation Notes:
  1. Download the attached zip file and install the plugin/restart Calibre/add to toolbar as described in the Introduction to plugins thread.
  2. Customise the regular expressions and menu options.

Paypal Donations:
  • If you find this or any of my other plugins useful please feel free to show your appreciation. I have spent many hundreds of unpaid hours in their development and support so any encouragement for me to continue is appreciated!

Version History:
Spoiler:

Version 1.4.1 - 11 Aug 2014
Support for upcoming calibre 2.0

Version 1.4.0 - 11 Sep 2011
Upgrade to support the centralised keyboard shortcut management in Calibre

Version 1.3.1 - 09 Apr 2011
Support skinning of icons by putting them in a plugin name subfolder of local resources/images
Fix bug of NoneType error when add new row, move it and not specifying a shortcut

Version 1.3 - 08 Apr 2011
Rewrite config UI to support any number of regex file patterns, added via a grid.
Optional pairing of author name swap parameter with a regex pattern

Version 1.2 - 03 Apr 2011
Rewrite for new plugin infrastructure in Calibre 0.7.53
Add a Customize Plugin menu option
Rename menu items and preferences to match new Automerge name
Add submenu for quickly switching automerge type

Version 1.1 - 28 Jan 2011
Improve tracking of when to rebuild menu actions
Ensure keyboard shortcuts always hooked on startup

Version 1.0 - 02 Jan 2011
Initial release of Quick Preferences plugin
Attached Thumbnails
Click image for larger version

Name:	Screenshot_1_Toolbar.png
Views:	1105
Size:	44.3 KB
ID:	65628   Click image for larger version

Name:	Screenshot_2_Customise.png
Views:	875
Size:	41.7 KB
ID:	65629  
Attached Files
File Type: zip Quick Preferences-qt5.zip (62.7 KB, 6469 views)

Last edited by kovidgoyal; 08-11-2014 at 10:33 AM. Reason: v1.4.1 Released
kiwidude is offline   Reply With Quote
Old 04-03-2011, 11:52 AM   #2
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
v1.2 Released

Changes in v1.2:
  • Rewrite for new plugin infrastructure in Calibre 0.7.53
  • Add a Customize Plugin menu option
  • Rename menu items and preferences to match new Automerge name
  • Add submenu for quickly switching automerge type
kiwidude is offline   Reply With Quote
 
Advertisement
Old 04-08-2011, 02:40 PM   #3
Loeffel
Connoisseur
Loeffel began at the beginning.
 
Loeffel's Avatar
 
Posts: 58
Karma: 10
Join Date: Mar 2011
Device: Kindle 3 3G
I just looked at it. Is there a possibility to push it up to, say, 10 menu entries like the first four?
Loeffel is offline   Reply With Quote
Old 04-08-2011, 02:48 PM   #4
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
Moderator Notice
Moved Loeffel's post above from the Plugin Ideas thread

@Loeffel - when I wrote this plugin I didn't know how to write a grid in Qt, hence why the limit of four items

It has been on the list for a rewrite for a while but I figured I would wait until someone asked for more. It should really have a grid like the Search the Internet plugin allowing you to add, remove and reorder items. It isn't trivial but I will take a look into it now.
kiwidude is offline   Reply With Quote
Old 04-08-2011, 03:16 PM   #5
Loeffel
Connoisseur
Loeffel began at the beginning.
 
Loeffel's Avatar
 
Posts: 58
Karma: 10
Join Date: Mar 2011
Device: Kindle 3 3G
For me personally it would be enough to edit an INI-file. You know as admin I am not one of those who say there must be a gui for such things. ;-)

All major server systems (linux, windows, os/2) must be maintained via command prompt so it doesn't matters. :-D But I know that such people are rare among the normal users as they don't know how to use such things properly and a gui is much easier to understand.
Loeffel is offline   Reply With Quote
Old 04-08-2011, 03:29 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
In this case it is very much a hard-coded limit to the plugin with how the data is stored etc. It just let me get the plugin get developed very quickly without much effort. I'm making the changes now, it should be done in a few hours hopefully.
kiwidude is offline   Reply With Quote
Old 04-08-2011, 04:21 PM   #7
Loeffel
Connoisseur
Loeffel began at the beginning.
 
Loeffel's Avatar
 
Posts: 58
Karma: 10
Join Date: Mar 2011
Device: Kindle 3 3G
You really don't need to hurry. Nevertheless you're doing a great job.
I should come back to programming again haven't done it for a long time. Even so it makes fun.
Loeffel is offline   Reply With Quote
Old 04-08-2011, 09:04 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
v1.3 Released

Changes in this release
  • Rewrite config UI to support any number of regex file patterns, rather than previous limitation of just four.
  • Optional pairing of "swap author names" setting with each regex pattern

The second feature above may take some explaining. The "Swap author names" checkbox is traditionally set completely independently of your regular expression for the filename matching. However now that there is no limit on the number of items, users might find it more convenient to actually change both their regex and this setting in one click.

Say for instance I am importing batches of books which have variations in filenames like this:
Code:
Title - FN LN
Title - LN, FN
FN LN - Title
LN, FN - Title
To import those names I will have two unique regular expressions - one to handle "Title - Author" and the other to handle "Author - Title" (I'm avoiding mentioning series, it is irrelevant to this discussion as the same applies).

The default behaviour of the plugin is the same as it always was of treating the author first name and last name setting as independent of the file pattern. So your menu items will look like this:
Code:
Title - Author    Swap Names: Unspecified
Author - Title    Swap Names: Unspecified
You will need to take responsibility for changing both the filename pattern selected and the "swap author names" setting each time you import books with a different combination.

However you now have the option of specifying the swap author name setting for your menu items. So I could create four menu items that look something like this:
Code:
Title - FN LN     Swap Names: False
Title - LN, FN    Swap Names: True
FN LN - Title     Swap Names: False
LN, FN - Title    Swap Names: True
Entirely optional feature, and if your names are always FN LN or vice versa then not likely to be of interest.
kiwidude is offline   Reply With Quote
Old 04-09-2011, 04:39 AM   #9
Loeffel
Connoisseur
Loeffel began at the beginning.
 
Loeffel's Avatar
 
Posts: 58
Karma: 10
Join Date: Mar 2011
Device: Kindle 3 3G
Cool! Thanks, will give it a try this weekend.
Loeffel is offline   Reply With Quote
Old 04-09-2011, 01:25 PM   #10
Loeffel
Connoisseur
Loeffel began at the beginning.
 
Loeffel's Avatar
 
Posts: 58
Karma: 10
Join Date: Mar 2011
Device: Kindle 3 3G
Hmm, with my first try I entered all at once and got the following error message:

calibre, version 0.7.54
ERROR: Unhandled exception: <b>AttributeError</b>:'NoneType' object has no attribute 'text'

Traceback (most recent call last):
File "calibre_plugins.quick_preferences.action", line 146, in show_configuration
File "site-packages\calibre\customize\__init__.py", line 171, in do_user_config
File "calibre_plugins.quick_preferences.__init__", line 69, in save_settings
File "calibre_plugins.quick_preferences.config", line 353, in save_settings
File "calibre_plugins.quick_preferences.config", line 148, in get_data
File "calibre_plugins.quick_preferences.config", line 165, in convert_row_to_data
AttributeError: 'NoneType' object has no attribute 'text'

I don't know what went wrong, when I entered everything again, one by one leaving the configuration, everything worked fine.
Loeffel is offline   Reply With Quote
Old 04-09-2011, 01:32 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
@Loeffel - funnily enough I got that same error once too while I was developing it, then no matter what I did I couldn't replicate it. I will have to take another look to see if I can figure out how to replicate it. It sounds like other than that you are now up and running ok, correct?

EDIT: I figured out the problem, new version up shortly. You have to add a new row, move it and not assign a shortcut to it to get the error. Easily fixed. Before I post the fix, are you happy with everything else?

Last edited by kiwidude; 04-09-2011 at 01:35 PM.
kiwidude is offline   Reply With Quote
Old 04-09-2011, 02:15 PM   #12
Loeffel
Connoisseur
Loeffel began at the beginning.
 
Loeffel's Avatar
 
Posts: 58
Karma: 10
Join Date: Mar 2011
Device: Kindle 3 3G
Ahhh, I couldn't replicate the error too. ;-)
Yes it is fine, it runs smooth as I can say by now, but just didn't finished testing by now.
Loeffel is offline   Reply With Quote
Old 04-09-2011, 02:26 PM   #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
v1.3.1 Released

Changes in this release:
  • Support skinning of icons by putting them in a plugin name subfolder of local resources/images
  • Fix bug of NoneType error when add new row, move it and not specifying a shortcut
kiwidude is offline   Reply With Quote
Old 07-29-2011, 01:01 PM   #14
superanima
W2E & ePub freak
superanima began at the beginning.
 
Posts: 38
Karma: 10
Join Date: May 2009
Device: cybook gen3 + boox60
Quote:
Originally Posted by kiwidude View Post

By default I have included two regex patterns - the default Calibre one, and a second for handling titles in "author [- optional series #] - title" format.
Sorry Kiwi,
can you explain what those pattern are about?

Thanks
Luca
superanima is offline   Reply With Quote
Old 07-29-2011, 04:20 PM   #15
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
Hi Luca,

When you add books to Calibre, then depending on your settings and the circumstance there are times when the filename of the book file being added is used to determine information like the title and author for your Calibre book record.

IIRC Calibre comes with a default setting which expects books in a "title - author" format (i.e. anything after a spaced hyphen is considered as the author). This is specified as a regular expression pattern that you can see on the Preferences->Adding Books screen.

That particular pattern is "fine" for simple cases if your books are named in that way, but if the filenames include series information for instance then you will want to use a different pattern. One example of an additional pattern is included as the second plugin pre-bundled option mentioned above. This particular pattern will detect either "author - title" or "author - series - title" books.

Those two happen to be the two I use the most to use as a starting point. So this plugin lets a user quickly switch between their different patterns before adding a bunch of books. That saves on the manual "fiddling" that you often have to do where you get the title/author the wrong way around etc.

I hope that helps explain it. For more info see the help manual or ask in the Library Management forum.
kiwidude 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
[GUI Plugin] Open With kiwidude Plugins 251 12-15-2014 01:07 PM
[GUI Plugin] Clipboard Search kiwidude Plugins 9 08-12-2014 04:36 AM
[GUI Plugin] Search the Internet kiwidude Plugins 205 08-11-2014 03:22 PM
[GUI Plugin] Walk Search History kiwidude Plugins 11 07-14-2014 06:11 AM


All times are GMT -4. The time now is 03:26 AM.


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