Open pgaskin opened 3 years ago
The Volume
for the book can be found with ReadingView::getVolume
(this is inlined for most callers within ReadingView
, but it's used externally by other classes too). Most chapter-related metadata accessed via other getters on ReadingView
without needing to deal with Shortcover
s directly.
The current ReadingView
can be found via MainWindowController::currentView
or scanning the widget tree, but I'm going to see if there is a more direct way to do it.
This should avoid the need for parsing the assembly at runtime (or storing it per-version), scanning classes to extract field offsets, or intercepting more functions, which would be significantly less future-proof and/or stable.
Out of curiosity, I was looking at how this could be implemented yesterday, and it seems we came to similar conclusions (getting the Volume from the ReadingView).
I just thought of an interesting extension to this: I could add a filter:<arg>:<regexp>
option for selection menu items to allow selectively showing them based on the context. This would be especially useful for book-specific wikis or for only showing certain items for sideloaded books (e.g. my progress sync one). This would be for v0.6.0, though.
Also, see pgaskin/selection-menu-extra-arguments
for my work so far on this. It should be usable in its current state.
(e.g. my progress sync one).
Color me intrigued ;p.
Color me intrigued
It really isn't that much. It just mirrors the current position from the DB over SSH to my other Kobos.
* Book title. * Chapter title. * More?
Maybe language code? For language-specific search etc?
Maybe language code? For language-specific search etc?
That's a good idea. I'll add that.
Also, now that we'll be supporting book-wide metadata in the argument transformation, I think I'm going to add that to the library menu as well.
As mentioned previously in #93, #94, and on MR.
It will be implemented as an optional feature, only being computed (and potentially returning an error) if used. In addition to making it more future-proof, it means this feature can be included in v0.5.1 rather than v0.6.0.