View Full Version : [GUI Plugin] View Manager


kiwidude
04-10-2011, 09:32 AM
This plugin allows you to easily switch between different views of your library. A view can consist of a combination of columns to be displayed in a certain order, with optional additions of a specified sort order, search restriction and/or saved search to be applied when the view is selected.

Example usages:

When performing certain tasks like editing metadata you want different columns visible.
You have multiple book types in your library, for which you want to display different columns for when you filter by that book type.
You want an easy way to quickly re-apply a default multi-column sort order.
You want to display/sort/filter your books differently while your device is connected (such as excluding books that are wishlist items and sorting those on the device at the top).


Main features of v1.3.2

Create as many different views as you wish
Views are library specific (redefine your views within each as you may have different columns)
Define which of your columns are visible and the display order for each view
Save your column widths on demand for the current view
Optional sort order(s) to be applied (right-click to choose ascending/descending)
Optional search restriction to be applied
Optional saved search to be applied
Optional keyboard shortcuts for quick access
Option to automatically apply either last selected view or a specifically named view at startup/when switching libraries


Special Notes:

Requires Calibre 0.8.57 or later.
If you enable the "automatically apply last view" functionality and then this will override over any values you have specified in tweaks for startup columns or restrictions.


Installation Steps:

Download the attached zip file and install the plugin/restart Calibre/add to context menu or toolbar as described in the Introduction to plugins thread (http://www.mobileread.com/forums/showthread.php?t=118680).


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!
https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif (https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RBHY43BYX9FVA)


Version History:

Version 1.3.2 - 22 Nov 2014
Fix keyboard shortcuts not working on calibre >= 2.10

Version 1.3.1 - 24 Jul 2014
Compatibility for upcoming calibre 2.0


Version 1.3.0 - 22 Jun 2012
Now requires calibre 0.8.57
Store views in the calibre database rather than a json file, to allow reuse from different computers (not simultaneously!)
Add a support option to the "Other" tab allowing viewing the plugin data stored in the database
No longer support upgrading from plugin versions older than 1.2.0

Version 1.2.1 - 11 Sep 2011
When switching libraries, ensure no issues with old menu items causing a crash

Version 1.2.0 - 11 Sep 2011
Upgrade to support the centralised keyboard shortcut management in Calibre
When opening the configuration dialog, default to the last selected view

Version 1.1.2 - 16 Jul 2011
Fix config error introduced with 1.1.1

Version 1.1.1 - 16 Jul 2011
Fix error issue for first time users

Version 1.1.0 - 11 Jul 2011
Add ability to store column widths as part of the view information

Version 1.0.6 - 15 Jun 2011
Indicate the last selected view with a checkbox in the menu

Version 1.0.5 - 23 Apr 2011
Fix bug of not always remembering the last applied view when restarting/switching libraries
Enhance configuration options to allow specifying a view to apply at startup
Ensure any auto applying of views is a per library setting

Version 1.0.4 - 14 Apr 2011
Fix bug of applying a blank saved search not working

Version 1.0.3 - 12 Apr 2011
Fix bug of plugin not working for first time users from 1.0.2
Add text to config dialog advising of behaviour if enable automatic apply view

Version 1.0.2 - 11 Apr 2011
Offer configuration option to apply last selected view at startup or switching libraries
Change configuration file format to offer more flexibility

Version 1.0.1 - 10 Apr 2011
Fix bug of key error when creating new views

Version 1.0 - 10 Feb 2011
Initial release of View Manager plugin

nynaevelan
04-10-2011, 10:50 AM
Kiwidude:

I get the following error when creating a new view, I have to close and restart the customize plugin in order for the columns to be selected:

69744

And thank you for this, I am going to love using this one. :D

theducks
04-10-2011, 11:12 AM
I noticed the same effect :rolleyes: XP SP3

1st start: No anything in any box.
Pulldown, to showed the word 'Default', Set. Error message.
Closed , restarted PI (default), now has Calibre show only field name Title.
Configured (default), now works as expected.

kiwidude
04-10-2011, 11:21 AM
Thanks guys and apologies for the clanger. I had the idea of adding saved searches/restrictions to the plugin just before I was going to release it and clearly forgot to re-test everything. I did warn it was a bit hot off the press :)

nynaevelan
04-10-2011, 04:50 PM
Kiwidude:

This is not a major thing, but is it possible for Calibre to remember the active View Manager view on a restart?

Nyn

kiwidude
04-10-2011, 06:53 PM
@Nyn - I've been experimenting with this. The answer is yes and no from my look at it. I can get it to restore the columns and sort from your last used view for a specific library, both when you startup and when you switch libraries.

However it does not appear to be possible from the plugin to specify a search or search restriction. They seem to get cleared at a point after the plugin has initialization_complete invoked. I will see if Kovid has any suggestions. Without that ability the "only" thing you would be gaining is the ability to have different sort orders per library (and being able to specify them in a nicer way than the tweak).

nynaevelan
04-10-2011, 07:24 PM
@Nyn - I've been experimenting with this. The answer is yes and no from my look at it. I can get it to restore the columns and sort from your last used view for a specific library, both when you startup and when you switch libraries.

Great, this would be nice if Calibre could maintain the last view.

However it does not appear to be possible from the plugin to specify a search or search restriction. They seem to get cleared at a point after the plugin has initialization_complete invoked. I will see if Kovid has any suggestions. Without that ability the "only" thing you would be gaining is the ability to have different sort orders per library (and being able to specify them in a nicer way than the tweak).

I'm not sure I understand you, are you saying it loses the restriction within the same session or when trying to restart Calibre?

kiwidude
04-10-2011, 07:37 PM
I'm not sure I understand you, are you saying it loses the restriction within the same session or when trying to restart Calibre?
Both - when switching libraries and when restarting Calibre, if I try from the plugin to specify a search or search restriction at the last point possible from my plugin the search is still getting cleared. I'm chasing up about it in the dev forums, hopefully we will figure something out - I've surprised Kovid which usually means it's my fault :)

kiwidude
04-11-2011, 07:30 AM
Changes in this release:

Offer configuration option to apply last selected view at startup or switching libraries
Change configuration file format to offer more flexibility


The automatic applying of the last selected view is turned off by default. Until Calibre 0.7.55 is released which has a fix, it has the following limitation. When switching libraries, only the columns and sort order specified in the last used view will be applied. Any search restriction or saved search for that view are ignored. This limitation does not apply when you startup Calibre.

Once Calibre 0.7.55 is released the functionality will work fully as expected without further upgrading the plugin.

nynaevelan
04-11-2011, 09:45 AM
Thank you so much for the plugin and for the update.

nynaevelan
04-11-2011, 10:09 AM
Kiwidude:

I am having trouble switching from a view that uses a restriction and one that doesn't. If I go from a view without a restriction to one with one, it switches fine but if I go from a view with a restriction to one without one, it will not update and add all the books into the view. Are you seeing this on your setup?

kiwidude
04-11-2011, 10:45 AM
@Nyn - If you go from a view with a restiction to one without, I would expect that you must set a restriction of "blank" on the one without and tick the "apply restriction" for it, to force the previous restriction to be removed.

I did it this way because if a user manually set a restriction, then wanted to change columns (using a view that had no restriction set) I didn't want it "always" cleared unless they explicitly did so as I described above.

Or are you experiencing something else?

nynaevelan
04-11-2011, 11:17 AM
@Nyn - If you go from a view with a restiction to one without, I would expect that you must set a restriction of "blank" on the one without and tick the "apply restriction" for it, to force the previous restriction to be removed.

I did it this way because if a user manually set a restriction, then wanted to change columns (using a view that had no restriction set) I didn't want it "always" cleared unless they explicitly did so as I described above.

Or are you experiencing something else?


Nope that's it, thanks for the pointer, I will do that to clear the restriction. Of course if I wanted to be REALLY lazy I could create a restriction that included everything to be used for that view. :rofl:

jesscat
04-12-2011, 02:57 PM
I'm in desperate need of help - can you tell me what I'm doing wrong? I go to "customize plugin," click the green "+", which puts "Default" in the "Select View to Customize" field. I left Default as the name for now, checked boxes in "Columns in View" on the left, didn't touch any of the "Sort Order" boxes for now, applied a search restriction (and checked the box), then added a shortcut ("Ctrl+1") and clicked OK.

But nothing happened. Ctrl+1 does nothing, and when I go back into Customize, there's nothing there - the dropdown menu in Select View is empty; my Default view doesn't appear to have been saved.

I know I must be doing something wrong and I feel like an idiot - what step am I missing?

kiwidude
04-12-2011, 03:12 PM
Not an idiot at all - you found a cunning flaw somehow. I'll push a fix when I figure out what broke :)

kiwidude
04-12-2011, 03:34 PM
Changes in this release:

Fix bug of plugin not working for first time users
Add text to config dialog advising of behaviour if enable automatic apply view


@Jesscat - please give this a whirl, thx for reporting the issue.

jesscat
04-13-2011, 11:22 PM
Never occurred to me that it could be a flaw in the plugin! :smack:

So I've tried out the new version, and it appears to be saving my views now and working fine. Thank you! :)

One thing, though... Re: the discussion above about restrictions, Nyn's comment:

If I go from a view without a restriction to one with one, it switches fine but if I go from a view with a restriction to one without one, it will not update and add all the books into the view.

And your response:

If you go from a view with a restriction to one without, I would expect that you must set a restriction of "blank" on the one without and tick the "apply restriction" for it, to force the previous restriction to be removed.

What about for Apply Saved Searches? I would think the same reasoning would apply, but when I go from a view with a saved search applied to one without, even if I set a blank saved search and tick "Apply Saved Search," it still doesn't force the previous saved search to be removed - the results remain limited to the saved search results and all the other books aren't added back into the view. Is this correct, or am I doing something wrong, or have I stumbled upon another error?

kiwidude
04-14-2011, 05:06 AM
Changes in this release:

Fix bug of applying a blank saved search not working

kiwidude
04-14-2011, 05:15 AM
Never occurred to me that it could be a flaw in the plugin! :smack:
lol... trust me, there have been a few flaws lately. Not enough time to test every permutation of the large number of plugins I maintain unfortunately. Just trying to rush through the backlog so I can take a break for a while so patience appreciated for the odd hiccup like you have found. :)
What about for Apply Saved Searches? I would think the same reasoning would apply, but when I go from a view with a saved search applied to one without, even if I set a blank saved search and tick "Apply Saved Search," it still doesn't force the previous saved search to be removed - the results remain limited to the saved search results and all the other books aren't added back into the view. Is this correct, or am I doing something wrong, or have I stumbled upon another error?
You would make a marvellous tester :)

Yeah, another flaw - there is a little difference in the GUI I hadn't noticed between the restriction combo (which has blank as a value in the dropdown and has fixed values) versus the saved search dropdown (which does not have blank). So it needs a different piece of code which I have now added in 1.0.4 above.

jesscat
04-14-2011, 02:04 PM
Okay, that's working! Glad I could help - I actually do have something of a background in programming/software development, though I'm only a dabbler now and my Python is pathetic enough that it might as well be nonexistent, so I'm pretty useless when it comes to actually helping with Calibre. But I think - I hope - I've still retained have decent testing/debugging skills and some understanding of procedure at least...

So another questions: Can you explain how sorting precedence works? For example, say I'd like to sort first on authors (A->Z), and then on my "read" column, which is a yes/no, in descending order - so all the books with "no" in that column would appear at the top, ordered by author name, all books with "yes" in the column, again ordered by author.

In the Calibre library, I accomplish this by sorting first on the author column, then on the read column. But in the plug-in, it seems to be the reverse: to get the result I want, I have to put my "read" column (sorted descending) *above* my author column in the sorting window.

Actually, now that I think about it, it kind of seems to me like the plugin logic makes more sense: sort by read/unread, then all the read books are sorted by author, and so are all the unread ones. Same for say, author and title: I think my inclination would be, sort by author, then sort by title within each author. But to get that result in the calibre library, you have to sort by title first, then author. Maybe it's a level of sorting sophistication logic I don't currently have an adequate grasp of.

Anyway, I'm not sure what my point is, except for the fact that the plugin and calibre seem not to match in their sub-sorting logic - again unless I'm missing something!

kiwidude
04-14-2011, 02:23 PM
@jesscat - you are absolutely right, there is a difference exactly as stated. I am kind of on the fence on this one and could be convinced to change it so that you have to reverse the order in the plugin.

I did it the way it is currently because it is how I mentally think, and in other applications if you are asked to specify a primary and then secondary sorts you would always put the primary sort first.

That you have to click on columns in Calibre in the opposite order is just a function of how grid sorting works, not intutively how our brains think about how to sort.

So if I want to sort by author and then by title, to me it makes sense to have author at the top and title underneath.

However I am well aware that this is the opposite of what you would actually click on in the grid. What do people prefer?

jesscat
04-15-2011, 05:35 PM
I'd never given much thought to the fact that the Calibre way (you say it's grid sorting? I don't know what that is...) really doesn't make logical sense to me. When I sort multiple columns I always do the same ones, so I've gotten accustomed to just clicking them in that order without actually thinking about it. But it isn't the way my brain works either, and it isn't the way any other software I've used works (thinking, e.g., of Excel), though there must be some reason Calibre does it that way?

So anyway, I can see why you're on the fence. I guess my initial thought would be to leave it as is. If people aren't really used to using Calibre's multiple-column sorting, my guess is that they'd more naturally assume it would work the way you have it. If they are, I think they'd probably figure it out (no one has complained so far, at least! :) ) I noticed mostly because I was setting up a view I use all the time, so I'm really accustomed to clicking those two columns in that order, but still, I didn't have any trouble figuring out what I needed to do to make it work.

And thanks for this - I haven't yet figured out all the ways it will be useful, but I know it will be!

chaley
04-15-2011, 05:59 PM
That you have to click on columns in Calibre in the opposite order is just a function of how grid sorting works, not intuitively how our brains think about how to sort.Funny -- my brain does work this way. Applications that permit sorting by clicking on column headers (which Excel 2003 does not support) always (AFAIK) want you to do it so that the major result is the last column clicked. When I fly somewhere, my destination is the last place I stop. When I sort books into a pile, the one on top (the important one) is the last one I put there. When I tell someone how I want something ordered, I say A within B within C. Saying A then B then C is ambiguous. What does "then" mean temporally? Usually it would mean C after B after A, but in Excel it means A after B after C.

Shows there's nothing so strange as folks. :)

kiwidude
04-15-2011, 06:18 PM
:) I guess my brain thinks about sorting in a visual way

Title
..Author

doesn't do it for me... versus

Author
..Title

If I was describing this to someone, I would say "sort by Author then by Title". I would never say "Title within Author". You can get all temporal on me but perhaps because of my visual offset it just works for me :)

Like I said in my original post - if I'm just alone and weird in thinking this way then I will happily change it.

jesscat
04-15-2011, 06:23 PM
I guess I think of it in a very linear way. To get the result I want, I'd have to sort by author first, then within each author, sort by title - that's the order in which those steps need to be taken in order to get the result; if you sorted by title first, you wouldn't get the right result. Or sort by read/unread first. Then within read and unread, sort by author. Which could be re-cast as by-author-within-read-status - but I still think of read status as being the first sort that has to happen.

I do see your point - after all, I've been doing it in calibre without thinking about it for a long time now: I click read status last, because that's ultimately what I want to see. But if I do think about it, the way calibre does it makes me confused, because it's not the order of the steps that have to happen, as I see it.

But yeah, brains are strange! ;)

(And I guess it's been too long since I've used Excel - I was projecting!)

nynaevelan
04-20-2011, 03:14 PM
Kiwidude:

I am having a little problem with the plugin, for some reason when I restart Calibre it is not starting with the view which I had when exiting. It is restarting with one of my views, but not the last viewed although it always starts with the same one. I was wondering if there was a way to have a option added to the customization to tell it which view to always start with.

Nyn

kiwidude
04-23-2011, 07:33 PM
Changes in this release:

Fix bug of not always remembering the last applied view when restarting/switching libraries
Enhance configuration options to allow specifying a view to apply at startup
Ensure any auto applying of views is a per library setting


@Nyn - this should hopefully address the bug and feature request you made above. As you can see from the new screenshot you can choose to do nothing (default, checkbox is unchecked) or to automatically apply either the "*Last view used" special item at the top of the dropdown combo, or one of your named views.

Note that just like the views themselves this is a per library setting.

nynaevelan
04-24-2011, 09:30 AM
Awesome!!! Now I need to decide if I want to use the last viewed or a specific view.... :chinscratch: :rofl:

Philosopher
06-13-2011, 04:27 AM
I've now been taking advantage of this plug-in a bit - and an idea (suggestion) came to mind. I don't know how easy this would be - as it would seem to require effecting the GUI itself (or perhaps it could - if this would be easier, as this is one thing that already has a dynamic feature - change just the icon for the plug-in) - but what I was wondering is if there was a way to indicate which view you were currently in.

kiwidude
06-13-2011, 06:27 AM
One problem is that if as a user you manually do something like moving or hiding a column, or changing sort order then the plugin will not know. So it would be lying to you about what view was selected.

Can you explain why you wanted it out of curiosity?

Philosopher
06-15-2011, 01:44 AM
>> Can you explain why you wanted it out of curiosity?

It was just a thought. I have just started to use your plug-in - thanks by the way - and am using it more and more in different ways. I envision many further reasons to use it.

In particular I have been using it to edit my database of books - I have an extremely large library - but I have also had my books spread out on many computers and many directories, have imported a number of duplicates, etc.

So some of the views I have created are very similar to each other - and not always immediately obvious which I am in at the moment.

I just thought it would be - particularly in terms of looking to future uses - convenient to be able to quickly tell which particular view I was in at any moment.

That's really all the thought was about - just trying to offer constructive ideas for possible development of the plug-in. I appreciate your response and your time in creating this tool. Thanks

nynaevelan
06-15-2011, 07:26 AM
I too would find that useful information, although I would be content with a checkmark next to the last selected view. Whether or not I've changed some of the columns around, it would be helpful to know when I was ready to switch to a new view, this would help to keep me from selecting the same one again. I too have similar views, some of which are exactly the same except one is filtered for specific tracks whereas the other is the full library.

Nyn

kiwidude
06-15-2011, 08:51 AM
Changes in this release:

Indicate the last selected view with a checkbox in the menu

CWatkinsNash
06-17-2011, 06:49 PM
Just wanted to pop in and say I'm now using this plugin too. Now that I'm managing multiple libraries with multiple restricted views in each for different reasons, it's nice to not have to manually fiddle with the columns only applicable in certain views.

So you can add this to the growing list of "things I thought I didn't need but now can't live without". :)

kiwidude
06-17-2011, 06:58 PM
Haha, glad to hear it. My number one usage of it is to restore my sort order with a keypress as I am forever doing actions which alter it, a fraction of what the plugin offers but glad you and others have found a use for the other stuff :)

nynaevelan
06-18-2011, 07:30 AM
Haha, glad to hear it. My number one usage of it is to restore my sort order with a keypress as I am forever doing actions which alter it, a fraction of what the plugin offers but glad you and others have found a use for the other stuff :)

Well since we have wandered down that road....

I currently have 23 different views, some are for editing, goodreads management, kindle collection creation, reading list adjustments, additions to my library, samples etc... This list of course could be a lot smaller but I have four that are in duplicate, one restricted with a specific group of books and its duplicate on the entire library. This, reading list, kindle collections and goodreads are my most used plugins but I currently have 17 installed 15 of which belong to Kiwidude.

capnm
06-28-2011, 05:29 PM
Feature request (well, more of an idea than a request -- I'm succeeding by editing the .json for now)

Be able to import a viewset from another library (any library in the .json, including libraries that no longer exist, but still have a viewset in the .json)
Overwriting(?) existing views of the same name.

Possible Enhancements -
select which view(s) to import
select a .json file to import from



As CWatkinsNash said, this is definitely one of those "things I thought I didn't need but now can't live without".:)
Thanks

nynaevelan
06-28-2011, 07:08 PM
Feature request (well, more of an idea than a request -- I'm succeeding by editing the .json for now)

Be able to import a viewset from another library (any library in the .json, including libraries that no longer exist, but still have a viewset in the .json)
Overwriting(?) existing views of the same name.

Possible Enhancements -
select which view(s) to import
select a .json file to import from



As CWatkinsNash said, this is definitely one of those "things I thought I didn't need but now can't live without".:)
Thanks

Now that is an idea I would not mind seeing. This would help me keeping track of my work and home views.

Nyn

domee
07-03-2011, 02:04 PM
Hey,

I really like your plugin, many thanks for this! The only minor problem for me is: I have a desktop computer with 24" display and a netbook with 10". I would really like to create a "netbook view", where a number of columns are not shown and - more importantly - where the width of the columns shown is much smaller than in my default view. However, the plugin does not save any information about the width of the columns. Would it be possible to implement this?

Greets,
domee

kiwidude
07-07-2011, 05:23 PM
@domee,

Here is a version for you to experiment with that allows you to save the column widths. To store the widths, you select the view, get the widths for the columns how you like them and then on the View Manager menu choose the new "Save column widths" option. This will store the widths for the current view, and will apply them the next time the view is applied.

It is in need of further testing so anyone who wants to assist with this it would be appreciated.

When a few people give me the thumbs up I will officially release it.

domee
07-08-2011, 04:06 AM
Works perfectly!:thumbsup: Thanks a lot!:thanks::)

kiwidude
07-11-2011, 02:42 PM
Changes in this release:

Add ability to store column widths as part of the view information


This is the same code as a few of you have tested as mentioned above, but with the verison officially bumped to 1.1. Nothe that to save your column widths, you need to first select the view to customise, then change your widths how you like them, then choose the "Save column widths" option in the View Manager menu.

Note that this now requires Calibre 0.8.8 or later

technomom
07-16-2011, 02:05 AM
I'm running the just-released version of Calibre (I guess that's obvious from the below) under Windows 7-64bit. I attempted to install the plugin for the first time and received an error message. I'm posting the details as requested. Thank you! Cyn

calibre, version 0.8.10
ERROR: Install Plugin Failed: A problem occurred while installing this plugin. This plugin will now be uninstalled. Please post the error message in details below into the forum thread for this plugin and restart Calibre.

Traceback (most recent call last):
File "site-packages\calibre\gui2\dialogs\plugin_updater.py", line 731, in _install_clicked
File "site-packages\calibre\gui2\preferences\plugins.py", line 384, in check_for_add_to_toolbars
File "site-packages\calibre\customize\__init__.py", line 539, in load_actual_plugin
File "importlib\__init__.py", line 37, in import_module
File "site-packages\calibre\customize\zipplugin.py", line 150, in load_module
File "calibre_plugins.view_manager.action", line 19, in <module>
File "site-packages\calibre\customize\zipplugin.py", line 150, in load_module
File "calibre_plugins.view_manager.config", line 82, in <module>
File "calibre_plugins.view_manager.config", line 75, in migrate_config_if_required
AttributeError: 'float' object has no attribute 'keys'

kiwidude
07-16-2011, 08:22 AM
Changes in this release:

Fix error issue for first time users


@technomom - thanks for reporting this. Obviously the last release needed a bit more testing than was done. This should resolve your issue for you, please let me know how you get on.

nynaevelan
07-16-2011, 02:01 PM
Kiwidude: I installed the latest version and it destroyed all my views, I then tried to just copy over a saved copy of the json file and they are all still messed up. All my views only show the title column. How do I get my views to work again without rebuilding them?

kiwidude
07-16-2011, 02:34 PM
Oh dear... let me look into it.

kiwidude
07-16-2011, 02:58 PM
Changes in this release:

Fix config error introduced with 1.1.1


This should reverse any "damage" to your views introduced for those of you who upgraded to 1.1.1 earlier today. The information was still in your configuration file, it was just stored in a way the plugin could not work with.

nynaevelan
07-16-2011, 11:41 PM
Changes in this release:

Fix config error introduced with 1.1.1


This should reverse any "damage" to your views introduced for those of you who upgraded to 1.1.1 earlier today. The information was still in your configuration file, it was just stored in a way the plugin could not work with.

:thanks::thanks::thanks::thanks:

domee
08-05-2011, 04:28 PM
Hey kiwidude,

thanks again for your great work, I really appreciate this and your other plugins! :thanks:

I have one more little "request": Your new version now allows to save custom column widths, which is great. It would be perfect, if I could also save a custom width for the book details window. Is this realizable?

Thanks a lot and keep up the brilliant work,
domee

kiwidude
08-07-2011, 07:00 PM
@domee - I'll have to think about that, I guess it might be possible. Though it has sparked another idea instead - the ability to save as part of the state the visibility of the tag browser panel and the book details panel (and cover browser too I guess). So with a single keypress to switch to your view you could effectively change the whole layout of your GUI?

Trying to do that and trying to save widths of panels would get a bit too complex I think. My preference would be for the ability to specify panels to be visible/hidden. Does anyone else have any thoughts on this?

domee
08-09-2011, 04:09 AM
Hey kiwi,

thanks for your reply. The problem for me is that I switch between desktop pc and netbook and when I use the latter, the book details panel always takes up half my screen. So it would be great if I could save a specific width for that panel too in my "netbook view".

But of course only if
a) this can be done without too much trouble and
b) you think it could be a useful feature in general

Thanks and keep up the great work:thumbsup:
domee

kiwidude
09-11-2011, 01:24 PM
Changes in this release:

Upgrade to support the centralised keyboard shortcut management in Calibre
When opening the configuration dialog, default to the last selected view


Requires Calibre 0.8.18. Note that you will lose any keyboard shortcuts you had previously assigned to your custom views (but not the views themselves). You can reapply the shortcuts using Preferences->Keyboard or from the Customise Plugin screen for this plugin.

kiwidude
09-11-2011, 05:45 PM
Changes in this release:

When switching libraries, ensure no issues with old menu items causing a crash


The downside of the new centralised shortcuts functionality is that when a plugin developer misses something Calibre crashes rather terminally :smack:.

In this case, I found toggling between libraries caused Calibre to crash with the changes I made in 1.2.0. I have completely changed my approach to unregistering old menu items now with both this plugin and the User Category one and it seems to be a better one.

ElMiko
11-06-2011, 01:04 PM
I noticed that you can configure your view based on saved searches (the equivalent of clicking a saved search once in the tag browser) under the "Apply saved search" dropdown. Is there any way to configure you view based on excluded saved searches (the equivalent of clicking a saved search twice in the tag browser)? Or on a string of saved searches ("ands", "ors", and "nots")?

kiwidude
11-06-2011, 01:15 PM
@ElMiko - whatever combination you want (whether excluding another saved search or combining them), save that as a new saved search, and then you can apply that to your view as per normal.

Dopedangel
04-25-2012, 04:52 AM
Where are the view manager settings saved I just restored my calibre database using library maintenance dialog. Is there a way I can get them back or do I need to do them over.
By the way after doing database restore my metadata.db file lost 25% of its size I just have 600 books but someone with thousands might get a good performance gain by doing this.

kiwidude
04-25-2012, 05:29 AM
The ViewManager settings will be stored in the View Manager.json file in the calibre plugins folder.

BTW I *do not* recommend others do what you have done. Restoring a library in that way should be a last resort. You will *lose* information that is stored only in the database. You will also have a new library id, which as you have found means that any per library settings (which many plugins have) get lost. You will have to edit the .json files and very carefully replace the library guids if you want to retain the same settings you had previously or else recreate them.

I suspect much of your recovered space came from conversion settings that were persisted - something which can be far more safely removed using the bulk edit dialog from memory.

kiwidude
06-22-2012, 05:08 PM
Changes in this release:

Now requires calibre 0.8.57
Store views in the calibre database rather than a json file, to allow reuse from different computers (not simultaneously!)
Add a support option to the "Other" tab allowing viewing the plugin data stored in the database
No longer support upgrading from plugin versions older than 1.2.0


I've got a number of plugin updates that will be released today based around calibre 0.8.57, taking advantage of a new feature to store plugin settings inside the calibre library. The benefit of this is for users that store their library in a shared network location and use calibre from multiple machines (though never at the same time - that limitation hasn't changed!). Your plugin configuration settings which are specific to each library (such as custom column names, book exemptions, reading lists etc) will be automatically kept in sync when calibre is next opened on each machine.

Specifically for this plugin it means that your views/sort orders do not have to be recreated on each machine that you open the library on.

capnm
06-22-2012, 11:53 PM
Hi! Great updates ...

Any chance of being able to export a view from one library to another?

I like to create a new library based on an existing library structure, then get my custom views too :)

chaley
06-23-2012, 04:49 AM
Hi! Great updates ...

Any chance of being able to export a view from one library to another?

I like to create a new library based on an existing library structure, then get my custom views too :)Now that the plugin info is stored in the database, it will be automatically copied when creating a new library using the existing library structure.

capnm
06-23-2012, 11:27 PM
Now that the plugin info is stored in the database, it will be automatically copied when creating a new library using the existing library structure.

Perfect!

edwdecarlo
04-19-2013, 09:20 AM
If possible, could you add the ability to manually edit the Column width for the columns within a view.

I have several Views which have the same fields, just displayed/sorted in a different order and would like them to be able to be the same size in each view. I used to do this within the View Manager.json (editing it manually), but now that it is saved in the DB this is no longer an option.

Note: I have tried to use the 'Save Column Widths' option without success. There are times when this option sets the column width to '-1' instead of the width, which seems to cause the column width to auto-size to data within the column the next time I start calibre. Also, since calibre has no way to manually set the column width, this would not result in columns of the same width (yes, I will see it jump if it is off by just a few pixels...you can't have Analyst without 'anal'-retentiveness...:thumbsup:).

Thank you for your time and consideration.

kiwidude
04-20-2013, 11:31 AM
@edwdecarlo - on some of my plugins there is actually an undocumented feature that you can manually edit the library configuration json content. However it was something I added *after* the last time I released this plugin, so you can't yet do it with this one. I don't advertise it, because obviously if people don't know what they are doing they wreck their configuration data for the plugin. I would have to push a new release of the plugin for this feature to automagically appear for you (it would be within View library preferences... and you can see the difference with it available in the Reading List plugin for instance).

As for the -1 thing, yes as you have found -1 is used to indicate the size should be autosized by calibre, and is what gets put in for example for hidden columns (like ondevice). And I can understand you would have to do a lot of trial and error to magically get these to align with different views without the ability to manually set the widths.

Adding some form of GUI to allow setting column widths in a user friendly way would be a whole bunch of work, and tbh I can't see a lot of people clamouring for it. Though I do understand why you want the ability, and I have my own OCD tendencies at times about such things.

I think the easiest solution would be for me to just push a new version of the plugin that uses the latest code from my "shared file" that my plugins share and will give you the edit library preferences capability?

edwdecarlo
04-22-2013, 10:22 AM
I think the easiest solution would be for me to just push a new version of the plugin that uses the latest code from my "shared file" that my plugins share and will give you the edit library preferences capability?

I took a look at Reading List, and the ability to edit the Setting json content would work great for me.

Thanks.

beckywc
05-25-2013, 11:49 AM
Since we have the option to use virtual libraries, can this be added to select a virtual library instead of a search or search restriction to allow for certain columns from within the view manager? I hope I'm making sense. Is this possible?

kiwidude
05-25-2013, 02:37 PM
Becky virtual library support for this plugin is indeed on the todo list when I get back into calibre plugin dev mode again, it's rather been on the backburner lately... it will have to happen one day soon though...

beckywc
05-25-2013, 04:08 PM
Thanks

rethec
07-16-2013, 06:49 AM
The last days I struggled with the organisation of my library, but thanks to your Plug-in I found a way that my calibre doesn't look like rubbish :D Perfekt! I'm looking forward to the virtual library support. Thanks for your Work!

BetterRed
09-30-2013, 06:30 PM
Currently I have to select the current view in the View Manager list of views to get it to refresh the spreadsheet after doing changes (error corrections) on the spreadsheet.

This is no great hardship, but it would be nice if I could just tap Alt/G on the keyboard - or click Go button.

I'm nearly always in a View, and I do almost all metadata editing on the spreadsheet cells - I only use the Metadata Editor for multi-book updates.

BR

kiwidude
09-30-2013, 07:32 PM
@BetterRed - I'm afraid I don't know what you are talking about. Do you mean you want to reapply a sort order (as specified by a view) after doing an edit in the main library grid, via a keyboard shortcut? You can assign keyboard shortcuts to your views within the plugin - for instance I assign ctrl+1 for my primary view and every time I want to re-sort after adding books or whatever I just hit that...

BetterRed
09-30-2013, 10:01 PM
@BetterRed - I'm afraid I don't know what you are talking about. Do you mean you want to reapply a sort order (as specified by a view) after doing an edit in the main library grid, via a keyboard shortcut? You can assign keyboard shortcuts to your views within the plugin - for instance I assign ctrl+1 for my primary view and every time I want to re-sort after adding books or whatever I just hit that...
Thank you for your response

My idea was to combine redo-sort with redo-search - on reflection that's probably not a good idea :smack:

I have 12 Views - 4 column sets, each with 3 sort variants - I can't imagine devising a coherent set of short cuts without disturbing long standing system and calibre shortcuts. Also there's nothing on screen that tells me which View I am currently using. That's not a problem but it might be if I wanted to have a different shortcut for each view - but I don't - want to do that.

And I don't really have a primary view - I'm currently making a comic library for a mate who's serving in Afghanistan - actually its for his kids... As you can imagine the views I'm using for that are different to the ones I have for my Journals library

So what I would like - is a shortcut to re-fresh/re-sort whatever the current view happens to be - I don't have a problem with using the drop down to switch views.

Hope that makes sense, but its a 'nice to have' request, not even a 'should have', let alone a 'must have'.

tks BR

kiwidude
10-01-2013, 03:55 AM
Ahhh, so just a Reapply Last View menu option that can be shortcut assigned to then... That would not be difficult. I am still too busy at mo to get to this plugin to update it but the request is recorded here now for the next time I do...

BetterRed
10-01-2013, 05:40 AM
Ahhh, so just a Reapply Last View menu option that can be shortcut assigned to then... That would not be difficult. I am still too busy at mo to get to this plugin to update it but the request is recorded here now for the next time I do...
:thumbsup: - thanks

take care - BR

atjnjk
10-21-2013, 03:04 AM
@kiwidude, there's a tiny little bug:
If "Automatically apply view" is ticked, calibre (from v1.3) auto scrolls to title column at startup. More info (https://bugs.launchpad.net/calibre/+bug/1242253).
Thank you for so many useful plugins. :2thumbsup

cryzed
05-26-2014, 05:06 PM
Maybe I misread the plugin description but shouldn't it be possibly to automatically switch to a certain view when switching to a certain virtual library? In the general options tab it says "When restarting Calibre or switching to this library...", I assumed the plugin would "remember" the current virtual library I am in and then allow me to set a specific view for this library -- but somehow this view is also applied during startup?

EDIT: Nevermind, apparently this feature is simply missing still, I'll do it manually for now. Thanks for the otherwise great plugin!

JimmXinu
07-08-2014, 10:53 PM
FYI, I am not kiwidude and this isn't my plugin. But I'm trying to help out by porting some of the plugins I use regularly while kiwidude is busy.

Attached is a test version that should work for both the existing 1.X calibre and the upcoming 2.X version calibre. 2.x will use PyQt5 which requires changes to virtually all plugins.

This version needs to be tested with the existing calibre.

Brave souls to test with with the beta 2.X version would also be appreciated. Links to the 2.X beta and discussion of the transition (for plugins) can be see at: Attn plugin developers: calibre moving to Qt 5 (http://www.mobileread.com/forums/showthread.php?t=242223).

BetterRed
07-09-2014, 02:37 AM
did some simple tests on 1.200 portable and 1.33 portable, no problems. I'll do a backup, when it's done I'll test this on calibre 1.43 64 bit with my 'real' libraries, where I have different views on different libraries with custom columns etc - this will replace the existing View Manager.

Thanks for taking on some of kiwidudes plugins - much appreciated.

Added : Tested on 1.43 64 install version with my real libraries - no problems works fine :thumbsup:

BR

JimmXinu
07-09-2014, 08:40 PM
did some simple tests on 1.200 portable and 1.33 portable, no problems. I'll do a backup, when it's done I'll test this on calibre 1.43 64 bit with my 'real' libraries, where I have different views on different libraries with custom columns etc - this will replace the existing View Manager.

Thanks for taking on some of kiwidudes plugins - much appreciated.

Added : Tested on 1.43 64 install version with my real libraries - no problems works fine :thumbsup:

BR
Excellent, thanks!

Inferno
07-30-2014, 11:11 PM
I don't know if here is the place to ask but is there an option to sort the authors or titles on the field (ie not the "author sort" or "title sort" but what is in the field?)

I don't want this all the time, but I would like the option to switch to a "normal" view vs the standard "sort" view.

When checking a list of files (books) or a directory of books it is almost always in the normalized order of first name last name. It would be much faster to check if I could switch between sort order views.

For the life of me I can't figure out how to do this

BetterRed
07-31-2014, 12:16 AM
I don't know if here is the place to ask but is there an option to sort the authors or titles on the field (ie not the "author sort" or "title sort" but what is in the field?)

I don't want this all the time, but I would like the option to switch to a "normal" view vs the standard "sort" view.

When checking a list of files (books) or a directory of books it is almost always in the normalized order of first name last name. It would be much faster to check if I could switch between sort order views.

For the life of me I can't figure out how to do this
@Inferno - I have Plain Title and Plain Author columns. Most of the time I don't show them, but I have a Plain View that shows them as a Plain List as and when needed ;) See attachments

BR

Inferno
07-31-2014, 07:03 PM
I tried the View Manager for the first time and had to redo my column view by hand to get it the way I always use it lol. Not used to this plugin for sure.

I have created the alphaauthor column based on authors. Now, I am not used to this but am I right in thinking this means that changes I make to the authors field automatically changes the alphaauthor column?

In terms of how a column like this works, does it add much in drive space requirement? or is it just a "reflection" of the authors column that will sort alphabetically by the actual content of the field?

It does appear to be solving my problem of it taking too long to compare a directory to calibre

BetterRed
07-31-2014, 07:37 PM
I tried the View Manager for the first time and had to redo my column view by hand to get it the way I always use it lol. Not used to this plugin for sure.

I have created the alphaauthor column based on authors. Now, I am not used to this but am I right in thinking this means that changes I make to the authors field automatically changes the alphaauthor column?

In terms of how a column like this works, does it add much in drive space requirement? or is it just a "reflection" of the authors column that will sort alphabetically by the actual content of the field?

It does appear to be solving my problem of it taking too long to compare a directory to calibre
@Inferno - Columns built from other columns (virtual columns) are created as needed from the source column(s), hence changes is the source column(s) are immediately reflected in the virtual columns.

Test: show the Author and the Author Alpha columns in the book list, F2 on an Author cell, change it, hit enter, the new value will be reflected in the Author Alpha column.

The disk space is trivial. A few hundred bytes in the database for the virtual column and view definitions, similarly in the metadata_db_prefs_backup.json file.

BR

Inferno
08-01-2014, 01:37 PM
Great. I have not looked into what is in each of the individual book opf files. I guess I need to at some point lol.

It works great. Makes it easier to find title/author swapped files.

kakt36
09-24-2014, 08:00 PM
I'd like the following to be optionally determined by the view:
- What categories are shown/hidden
- Whether tag browser, cover browser, cover grid and book details are shown/hidden.

lazorbeam
11-06-2014, 06:02 PM
My library view upon opening has recently changed and I can't figure out why. Anyone else experience this?

I'm using View Manager to sort books by most recently modified. That is still working; the books sort by that order. However, upon opening Calibre, my library view opens halfway down the list of books rather than at the top of the page with the first book title. It's moving to a highlighted book, but I don't know why this book is selected. It suddenly started happening and I don't recall it coinciding with any updates.

If I disable View Manager, my library auto sorts itself by some random column but it does open to the first book title.

Anyone know if their is some updated setting I need to adjust? It's not the hugest deal but I'd prefer it to function as intended as it did previously since it's such a useful plug-in. Thanks!

BetterRed
11-06-2014, 06:38 PM
It's moving to a highlighted book, but I don't know why this book is selected.
Highlighted in what sense - something other than it being the 'current' book?

I use View Manager - pretty much as you describe and I've not had any surprises - yet;)

Also what version of calibre and plugin do you use?

Added :
If I disable View Manager, my library auto sorts itself by some random column but it does open to the first book title.

You can control that with Preferences->Tweaks->sort_columns_at_startup

But that's unlikely to be the problem

Did you try uninstalling the PI and reinstalling - you'd have to set up your views again

BR

lazorbeam
11-06-2014, 07:03 PM
Highlighted in what sense - something other than it being the 'current' book?

I use View Manager - pretty much as you describe and I've not had any surprises - yet;)

Also what version of calibre and plugin do you use?

BR

I believe it's the "current" book. It's highlighted in blue and is displayed in the right-side book details panel.

I am using Calibre 2.7 and plugin version 1.31.

ACTUALLY - was just checking now for more info and I think it's related to Virtual Libraries? I have my Calibre set to open to a VLibrary. I just removed this setting and Calibre opened to the top book. Added the VLibrary back and my problem was recreated.

It seems the VLibrary setting is affecting this but I recall running both of these just fine together before this glitch started without me making changes. Thoughts? Thanks for responding.

Just saw your edit - yeah, I have uninstalled and reinstalled the plugin a few times trying to figure it out. It remembers my settings though.

I have set a tweak for that. It was trial and error and I don't think it's right which is why i use the VManager. :)
# Specify columns to sort the booklist by on startup

sort_columns_at_startup = ['date_modified', 1]

BetterRed
11-06-2014, 09:08 PM
FWIW - I also have a starting VL - Oh, I asked what you meant by 'highlighted' because I thought it might have something to do with Marked books and Excluded duplicates - but I didn't want to ask a leading question.

First thing is backup your library.

The View settings are in the library database, you can see them in the metadata_db_prefs_backup.json file in the library - look for "library_view books view state" - you'll need a 'real' editor, which basically means not Notepad (well at least its better than edlin :) )

You could try deleting that block from that json file and rebuilding the database via the Library Maintenance->Restore database. Before doing that though I would clean up any anomalies by running a calibredb — check-library (http://manual.calibre-ebook.com/generated/en/calibredb.html#check-library) - I prefer the command line version because I can get a CSV to work from.

Or you could try this : create an empty library and Copy a subset of your books into it with same custom columns. Then create the same VL's and Views in the new library and check it out. If you don't get the same problem then, delete the all books from that new library, and then Move all your books to the new library. Why - well, any books that remain in the old library need looking into, they are stranded books that need rescuing ;)

BR

lazorbeam
11-06-2014, 10:40 PM
JSON DID IT.

I was writing about how I appreciated the instructions but was sad to say that I failed and then I had a lightning bolt on the json stuff and I DID IT. :)

If you're curious (and because I already typed this), I went with option two first since it seemed more basic. I created a new library with copied structure so the virtual libs and view manager details carried over. I then copied over a number of books with various last mod dates including the erroneous highlighted book. Happily, in the new library these books sorted from the top - however, looking closer, they all had the same last mod date, 11/6 (today), from copying them over. So not a fix for this specific problem.

SOLUTION: I ended up just deleting the entire "library_view books view state" section you indicated in the json file and replacing the original file and that did it. I checked it multiple times after closing out in different VLs with different sorts going on and it sorted per view manager each time. Interesting however is that, for just a moment, I see that book it was reverting to in the book details pane before view manager overrides it. Weird.

But it's fixed and I learned some things about creating new libraries and json, so thank you very much for your assistance.

:thanks:

JimmXinu
11-16-2014, 11:32 PM
There's been a calibre change (in 2.10) that requires changes to some of the plugins to correctly support keyboard shortcuts. Specifically, plugins that change their menus dynamically.

I've been in touch with kiwidude, he doesn't have time right now to work on correcting these issues. But he has given the go-ahead for us (the PI dev community) to update them.

Attached is a version of this plugin I've updated. I've done some testing with it on calibre 2.10, 2.9 and 1.48 and it seems good. I'd like to hear if anybody has problems with it.

Confirmation that it fixes the shortcut issue for you would also be appreciated.

Terisa de morgan
11-17-2014, 01:28 AM
It has worked for me now, thank you very much.

BetterRed
11-17-2014, 01:40 AM
There's been a calibre change (in 2.10) that requires changes to some of the plugins to correctly support keyboard shortcuts. Specifically, plugins that change their menus dynamically.

I've been in touch with kiwidude, he doesn't have time right now to work on correcting these issues. But he has given the go-ahead for us (the PI dev community) to update them.

Attached is a version of this plugin I've updated. I've done some testing with it on calibre 2.10, 2.9 and 1.48 and it seems good. I'd like to hear if anybody has problems with it.

Confirmation that it fixes the shortcut issue for you would also be appreciated.
:thumbsup: Seems to be working for me in 2.9 and 2.10 (32 bit) :thanks:

BR