View Single Post
Old 02-13-2018, 04:03 PM   #221
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 7,045
Karma: 4604637
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)
As far as I can tell, calibre saves *whether* the view is split(), but doesn't save *where*. IE, on restart, the split bar is centered regardless of where it was last dragged. Is that intended, I wonder?

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.
JimmXinu is offline   Reply With Quote