tallforasmurf / PPQT

A post-processing tool for PGDP written in Python, PyQt4, and Qt
GNU General Public License v3.0
4 stars 2 forks source link

Add the page number #97

Closed bibimbop closed 11 years ago

bibimbop commented 11 years ago

Could the book page number be added along side the line number ?

guiguts has the png and folio numbers:

"Img: 237"     "Lbl: Pg230"

I think both fields should be there, and both could be editable to go to the page, similar to the line number.

tallforasmurf commented 11 years ago

This will take some thought. I'm not sure how hard it would be, it's months since I looked at the Page table code.

I will take a look. If too complicated to kludge it now I will mark it as V2 goal.

tallforasmurf commented 11 years ago

The issues here are multiple. First re displaying the image number. One, it already is displayed, at the top of the Pngs panel, as "0077.png - 35%". That's view-only. So it could be moved down to the status line (the zoom% removed, it is redundant now with the zoom spinner at the bottom) so it would be visible even when the Pngs panel is not. That would free some vertical space in the Pngs panel as well, a good thing.

However things get more complicated if one wants the image zoom field to be editable like the line# widget. See pqMsgs.py, the lineLabel class, it would be like that: the value would be updated from the Pngs panel whenever the cursor moved (as now). On returnPressed signal in the widget, it would tell the editor to jump to the first line of that page (like the line number widget does), that in turn would result in a cursorPositionChanged signal to the Pngs panel which would update the content of the label widget again. Not a problem, just kludgy.

Second, displaying the folio number, this is available as IMC.pageTable[n][5], the sixth value in each page's list, see pqPages.py opening comments. So we could have label in the status bar with the current folio value with not too much overhead. It would have to be formatted as per pageTable[n][4], arabic/roman/upper/lower. But the question is, when do you update that field?

In fact there should be one piece of code that gets the cursorPositionChanged signal from the editor, and that one piece of code should: (a) decide if the line has changed and update the line# display, (b) decide if the page has changed and if so, decide if the cursor is on a valid page or not, and update the image number widget, the Pngs panel display, and the folio number widget, all three, appropriately. In effect, pqPngs gets reduced to a simple widget slaved to the cursorPosition slot.

The line number widget, image number widget, and folio widget can each catch its own returnPressed signal and tell the editor to move the cursor, which would trigger the above cursorPositionChanged signal as above.

That's three classes (the current pqMsgs.lineLabel and two new ones) and some of the code now scattered around pqPngs.py. Where should it live?

I'm giving this the Needs Thought and V2 Goal flags and deferring it for now.