12-18-2017, 09:52 AM | #211 |
Connoisseur
Posts: 91
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. |
12-18-2017, 04:37 PM | #212 |
null operator
Posts: 20,415
Karma: 25894272
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
Advert | |
|
12-20-2017, 12:26 PM | #213 |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
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'. |
12-20-2017, 12:41 PM | #214 |
creator of calibre
Posts: 43,744
Karma: 22446736
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.
|
12-20-2017, 12:52 PM | #215 |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
@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 | |
|
12-21-2017, 07:21 PM | #216 |
Connoisseur
Posts: 91
Karma: 10
Join Date: Mar 2014
Device: Libra H20, Clara 2E
|
Did that, so I have a quick work-around :-), thanks!
|
02-09-2018, 07:26 PM | #217 |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
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. |
02-09-2018, 07:56 PM | #218 | |
null operator
Posts: 20,415
Karma: 25894272
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 |
|
02-10-2018, 03:35 AM | #219 |
Grand Sorcerer
Posts: 6,208
Karma: 11766195
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).
|
02-10-2018, 05:13 AM | #220 | ||
null operator
Posts: 20,415
Karma: 25894272
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Quote:
BR |
||
02-13-2018, 04:03 PM | #221 |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
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. |
02-13-2018, 04:14 PM | #222 |
creator of calibre
Posts: 43,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Splitter state is most definitely saved, see pin_columns.py PinContainer.save_state()
|
02-13-2018, 06:09 PM | #223 |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
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:
|
02-13-2018, 08:50 PM | #224 |
creator of calibre
Posts: 43,744
Karma: 22446736
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
|
02-13-2018, 10:30 PM | #225 |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
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 Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Open With | kiwidude | Plugins | 402 | 03-16-2024 11:44 PM |
[GUI Plugin] Goodreads Sync | kiwidude | Plugins | 1713 | 03-16-2024 11:37 PM |
[GUI Plugin] Generate Cover | kiwidude | Plugins | 811 | 03-16-2024 11:31 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 |