02-13-2018, 10:59 PM | #226 |
creator of calibre
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Put in a print statement in restore_state() to check if restoreState() is returning True or not.
|
02-14-2018, 11:55 AM | #227 |
Plugin Developer
Posts: 6,316
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Yes, it does. I also deleted gprefs['book_list_pin_splitter_state'] and then tried again with `calibre --ignore-plugins` and it still re-centered.
I added some debug output and save_state is being called during startup before restore_state. (calibre-debug doesn't support --ignore-plugins, BTW) Debug output: Spoiler:
I threw a quick lock boolean in to prevent saving before restoring and now the split bar is staying where I put it across restarts. Kludged & debug PinContainer: Spoiler:
I can clean that code up and submit it if you find it an acceptable workaround, but it doesn't explain why it happens in the first place. |
02-14-2018, 12:21 PM | #228 |
creator of calibre
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Stick an
Code:
import traceback traceback.print_stack() |
02-14-2018, 12:34 PM | #229 |
Plugin Developer
Posts: 6,316
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
(I removed username path)
Code:
Starting up... save_state: File "site.py", line 101, in main File "site.py", line 78, in run_entry_point File "C:\...\calibre\src\calibre\debug.py", line 260, in main File "C:\...\calibre\src\calibre\gui_launch.py", line 74, in calibre File "C:\...\calibre\src\calibre\gui2\main.py", line 557, in main File "C:\...\calibre\src\calibre\gui2\main.py", line 392, in run_gui File "C:\...\calibre\src\calibre\gui2\main.py", line 351, in initialize File "C:\...\calibre\src\calibre\gui2\main.py", line 332, in initialize_db File "C:\...\calibre\src\calibre\gui2\main.py", line 293, in initialize_db_stage2 File "C:\...\calibre\src\calibre\gui2\main.py", line 233, in start_gui File "C:\...\calibre\src\calibre\gui2\ui.py", line 349, in initialize File "C:\...\calibre\src\calibre\gui2\init.py", line 67, in init_library_view_mixin File "C:\...\calibre\src\calibre\gui2\library\views.py", line 811, in set_database File "C:\...\calibre\src\calibre\gui2\library\models.py", line 307, in set_database File "C:\...\calibre\src\calibre\gui2\library\views.py", line 904, in database_changed File "C:\...\calibre\src\calibre\gui2\library\views.py", line 768, in restore_state File "C:\...\calibre\src\calibre\gui2\pin_columns.py", line 121, in restore_state File "C:\...\calibre\src\calibre\gui2\pin_columns.py", line 70, in apply_state File "C:\...\calibre\src\calibre\gui2\pin_columns.py", line 114, in save_state File "C:\...\calibre\src\calibre\gui2\pin_columns.py", line 143, in save_state |
02-14-2018, 01:09 PM | #230 |
creator of calibre
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
This should take care of it: https://github.com/kovidgoyal/calibr...a692d0292d6549
|
02-14-2018, 01:41 PM | #231 |
Plugin Developer
Posts: 6,316
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
That does it, thanks!
If VM plugin ever does want to save/set the splitter location, we'll have to discuss how it should be done. I was mostly just curious right now. |
04-24-2018, 10:52 AM | #232 |
Connoisseur
Posts: 67
Karma: 10
Join Date: May 2015
Device: Kobo Aura H20, Kindle Fire 7 (7G), Kindle PW (2G), Nook GlowLight Plus
|
View Manager w/ Split View
I've recently been playing with the "Split the book list" feature, and noticed that the View Manager appears to only change the view settings for the left-hand pane of the split view--the RHS uses some other view (maybe the original Calibre default?) and ignores whatever I select in View Manager. Is this expected behavior? I see some discussion earlier in the thread about testing the two together?
|
04-24-2018, 05:37 PM | #233 |
Plugin Developer
Posts: 6,316
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
When split book list came along, I tested to see what would happen and Kovid kindly fixed a problem found then.
But after documenting what you found (VM effects left-hand pane only), no one expressed any interest using VM and split view together, so it was left as is. If there are users that would use it, I can revisit expanding VM to manage both panes. |
04-25-2018, 09:25 PM | #234 |
Connoisseur
Posts: 67
Karma: 10
Join Date: May 2015
Device: Kobo Aura H20, Kindle Fire 7 (7G), Kindle PW (2G), Nook GlowLight Plus
|
|
04-26-2018, 03:23 PM | #235 |
Plugin Developer
Posts: 6,316
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
@kovidgoyal,
View Manager plugin can manage the right pane column order, sizes and show/hide and whether splitter is shown or not pretty easily. Adjusting the position of the splitter is down another level. With the existing code I can: Code:
## uses same state schema (minus 'sort_history') as library_view state ## to show/hide/order/size columns pin_state = self.gui.library_view.pin_view.get_state() # ... self.gui.library_view.pin_view.apply_state(pin_state) ## simple boolean Qt call for splitter visibility. show = self.gui.library_view.pin_view.isVisible() # ... self.gui.library_view.pin_view.setVisible(show) ## Call Qt methods directly, returns PyQt5.QtCore.QByteArray, convert to ## save/set splitter location splitter_state = bytearray(self.gui.library_view.pin_view.splitter.saveState()) # ... self.gui.library_view.pin_view.splitter.restoreState(splitter_state) |
04-26-2018, 10:08 PM | #236 |
creator of calibre
Posts: 43,856
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Should be fine. For maximum robustness, probably best to sue the functions I introduced here: https://github.com/kovidgoyal/calibr...e26b06b2816991
|
04-29-2018, 02:07 PM | #237 |
Plugin Developer
Posts: 6,316
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
I could use some input from VM PI users.
I've figured out how to save and apply splitter on/off, splitter location, shown/hidden columns and columns sizes in right hand pane. Sort order is applied as before(*). It became complex when I started thinking about different possible use cases and configuration options. Which of the following would you find useful?
Actually doing all these is fairly straightforward. What's complex is coming up with ways to configure them that are intuitive for the user. My first thought was to add another list of columns to show/hide and order for the right pane and call it a day. "Everything View" all the time. My second thought was, typically for me, about how to allow more customization instead. Which soon spun out of control. Feel free at this point to suggest other ideas for consideration. (*) - Calibre limits how many sort columns it applies to 4 by default when apply_state() is called and at Calibre startup--not sure how I never noticed that before. But we can pass in a bigger value. Also, it looks like Calibre forces timestamp into the sort order if not already included, either adding it or replacing the last(least precedence) sort item. |
05-02-2018, 01:52 PM | #238 |
Plugin Developer
Posts: 6,316
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
New Test Version
Here's a new test version of View Manager that can save and apply split, split location and the columns in both left and right panes. By default, a View will be of type Automatic and save & apply everything. In VM config, there's a checkbox above the list for the right pane that controls whether the split is shown or hidden. In Automatic that will be changed when you 'Save View' to match what you have on the screen. You can change a View (in VM config) to be a Manual type view which adds checkboxes for whether to save/apply column settings in the left pane, show/hide the split pane and also whether to save/apply Sort order. The presence/absence of the splitter will not be changed with the Save View menu action. These let you make Views that add (or change) split & right pane without changing the left pane, and Views without Sort or with only Sort as you like. This is a compromise solution between useful features and intuitive (to me at least) configuration. Let me know what you think. Known Issues: - Sort depth: Calibre limits how many sort columns it applies to 4 by default when apply_state() is called and at Calibre startup--not sure how I never noticed that before. But we can pass in a bigger value. This version saves and applies all sorted columns. Perhaps VM should be similarly limited instead? - Also, it looks like Calibre forces Date aka timestamp(desc) into the sort order if not already included, either adding it or replacing the last(least precedence) sort item. Is this a concern or continue to ignore? - VM PI doesn't currently rebuild its menu if you add/rename/remove a View from config but then hit Cancel instead of OK. Need to fix. Last edited by JimmXinu; 05-12-2018 at 12:57 PM. Reason: Remove obsolete test versions |
05-02-2018, 05:55 PM | #239 | ||
null operator (he/him)
Posts: 20,567
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Quote:
As you may recall, because the changes you implemented back then didn't really interest me, I decided to stick with version 1.3.2. I don't use Split View, but before upgrading to calibre 3.17 I did do some tests to ensure it didn't interfere with my usage of the old VM, which it didn't. When you release the new version I'll reconsider my decision of June 2017, my preference always is to be using current versions - assuming it doesn't involve any monetary considerations. BR Last edited by BetterRed; 05-02-2018 at 06:09 PM. Reason: clarity |
||
05-04-2018, 01:35 PM | #240 |
Plugin Developer
Posts: 6,316
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
BR - Maybe this is a good time to discuss what you didn't like about the VM changes before and what we can do to accommodate you.
As I recall, you wanted to be able to save column order/sizes without changing your sort order in a View. In the latest test version, I was trying to allow separate Views that only do Sort and nothing else. But I see that I failed--if you uncheck "Columns in Split(right) Pane", the splitter is removed. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Goodreads Sync | kiwidude | Plugins | 1721 | 04-18-2024 10:22 AM |
[GUI Plugin] Open With | kiwidude | Plugins | 403 | 04-01-2024 08:39 AM |
[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 |