![]() |
#211 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: Libra H20, Clara 2E
|
ViewManager view partially applied at startup
I'm using the current version of Calibre (3.14) and the View Manager plugin. I set up my new "default" view, and modified the sort, column widths, etc., then did "Save columns, widths and sorts". I set View manager to automatically apply the view at startup.
When I re-start calibre, the view is checked in ViewManager, but is only partially applied. I see my desired sorts and columns, but the column widths are wrong. If I click the view name in the ViewManager menu, THEN it's fully applied. See the attached pic . . . . How can I get this to (fully) apply at startup? Thanks! Dan Moderator Notice
Merged with Plugin Thread Last edited by theducks; 12-18-2017 at 11:16 AM. |
![]() |
![]() |
![]() |
#212 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
![]() |
![]() |
Advert | |
|
![]() |
#213 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,969
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
drawson1, I can reproduce your issue, but I'm not sure anything can be done about it.
VM is attempting to set the column order and sizes when the plugin's initialization_complete() is called. However, I don't think Calibre has finished setting up and displaying the library view yet and so the sizes are being ignored/replaced. Personally, I set a keyboard shortcut for my most used view to 'spacebar'. ![]() |
![]() |
![]() |
![]() |
#214 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@JimmXinu: I dont think any library view layouting is done after initialization_complete (it is called at line 409 in gui2/ui.py which is close to the end of that method). You can insert a print there and also a print in the apply_state function in library/views.py which is where the column layout for the book list is restored, to check.
|
![]() |
![]() |
![]() |
#215 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,969
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
@kovidgoyal, I was just speculating as to the cause.
The same code in VM applies column size at start up (initialization_complete()) and library switch (library_changed() calls initialization_complete()). On library switch, the sizes are applied, on start up they are not. I don't see how anything the plugin does could change that. |
![]() |
![]() |
Advert | |
|
![]() |
#216 |
Connoisseur
![]() Posts: 96
Karma: 10
Join Date: Mar 2014
Device: Libra H20, Clara 2E
|
Did that, so I have a quick work-around :-), thanks!
|
![]() |
![]() |
![]() |
#217 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,969
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Has anyone started thinking about how View Manager and the new "Split the book list" feature interact? And how they should interact?
Some quick initial testing seems to show VM effecting only the left side of the split list. |
![]() |
![]() |
![]() |
#218 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
I haven't installed 3.17. Does Split View (SV) effect VM if you don't use SV, if it does I won't install the new version - my problem is that I don't use the latest VM because of the changes made last year. BR |
|
![]() |
![]() |
![]() |
#219 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,628
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
I have calibre 3.17 and VM (last version). No change (without using SV, I don't know with SV because I see no use for me at this moment).
|
![]() |
![]() |
![]() |
#220 | ||
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,722
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Quote:
BR |
||
![]() |
![]() |
![]() |
#221 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,969
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Here's what I've found:
Code:
# Internally, the second split view is referred to as the 'pin_view'. # state can be gotten and appears the same as library_view. state = self.gui.library_view.get_state() pin_state = self.gui.library_view.pin_view.get_state() # it looks like apply_state(state) will also work the same. state = {'hidden_columns': hidden_cols, 'column_positions': positions, # no sort_history in pin_view 'column_sizes': resize_cols} self.gui.library_view.pin_view.apply_state(state) # showing/hiding the pin_view is easy: # self.gui.library_view.pin_view.isVisible() self.gui.library_view.set_pin_view_visibility(bool) So saving and applying column data for both sides in View Manager looks doable, as does showing/not showing the splitter. Placement of the splitter, I haven't figured out. Integrating split on/off and a second 'Columns in View' list in the plugin config dialog would be the hardest part. |
![]() |
![]() |
![]() |
#222 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Splitter state is most definitely saved, see pin_columns.py PinContainer.save_state()
|
![]() |
![]() |
![]() |
#223 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,969
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Kovid, I did see that, which is why I wonder if it's working correctly.
Whether the view is split or not is saved across calibre restart, but the right-left location of the splitter bar is not kept for me when I restart calibre. Steps:
|
![]() |
![]() |
![]() |
#224 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Works fine for me. And according to the qt docs saveState() saves the entire layout, https://doc.qt.io/qt-5/qsplitter.html#saveState
|
![]() |
![]() |
![]() |
#225 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,969
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Hrm. It worked for me for a bit after uninstalling VM, then reset to center when I installed VM again, but now it doesn't work even after I removed VM again.
In fact, even while running with `calibre --ignore-plugins` I'm still seeing the split bar reset to center on restart. So while it might be something to do with my computer, I don't think it's anything to do with the plugin... |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Generate Cover | kiwidude | Plugins | 861 | 06-21-2025 11:51 AM |
[GUI Plugin] Open With | kiwidude | Plugins | 404 | 02-21-2025 05:42 AM |
[GUI Plugin] Goodreads Sync | kiwidude | Plugins | 1781 | 02-12-2025 07:09 PM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 12:27 PM |
[GUI Plugin] Book Sync **Deprecated** | kiwidude | Plugins | 111 | 06-07-2011 07:47 PM |