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, 08: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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
[GUI Plugin] Quick Preferences

This plugin provides a way to quickly switch calibre settings without manually clicking through the various calibre Preferences dialogs. Specifically it caters for preferences related to adding books (but could be added to in future if needed)

Some example common use cases:
- You are importing batches of books with differing filename conventions and want to quickly toggle between various regular expressions for each.
- You want to quickly toggle which metadata source(s) you are downloading from.

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:
  • 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
  • Quickly switch between sets of metadata source preferences
  • Toggle various other options related to adding books
  • Customise which menu options are included on the dropdown
  • Customise keyboard shortcuts
  • Keeps in sync with changes made via the Preferences dialog

Special Notes:
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!
Attached Files
File Type: zip Quick Preferences.zip (156.8 KB, 113 views)

Last edited by kiwidude; 03-16-2024 at 11:46 PM. Reason: New version
kiwidude is offline   Reply With Quote
Old 04-03-2011, 10: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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
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
Advert
Old 04-08-2011, 01: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, 01: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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
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, 02: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
Advert
Old 04-08-2011, 02: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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
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, 03: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, 08: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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
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, 03: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, 12: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, 12: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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@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 12:35 PM.
kiwidude is offline   Reply With Quote
Old 04-09-2011, 01: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, 01: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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
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, 12: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, 03: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,588
Karma: 2089838
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
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

Tags
error, nameerror, quick preferences

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Walk Search History kiwidude Plugins 38 03-17-2024 12:47 AM
[GUI Plugin] Search the Internet kiwidude Plugins 408 03-16-2024 11:57 PM
[GUI Plugin] Open With kiwidude Plugins 402 03-16-2024 11:44 PM
[GUI Plugin] Clipboard Search kiwidude Plugins 24 03-16-2024 11:06 PM


All times are GMT -4. The time now is 06:35 AM.


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