In The Source: LOST IN SPACE
Had a little more time today...
So src->Dialogs->(SpellcheckEditor.cpp, SpellcheckEditor.h).
This class is responsible for spellchecking cockpit you all know so well (see first picture). The graphical side of it is described in separate file:
src->Form_Files->SpellcheckEditor.ui
in human-readable xml format.
I did a lot of jumping around, met some new classes ("Language" in Misc have some handy functions for one) and old scary acquaintances - but I run away from them again...
It seems to work like this: class MainWindow - which, as you rightly suspect, is responsible for the main Sigil window - initializes, well... dumb class SpellcheckEditor. Dumb because it doesn't know at the moment of creation what book it is supposed to work on. It is important: it means that some useful things to be done have to wait...
MainWindow creates or reads in a new book using the SetNewBook(QSharedPointer<Book>) function, which, among others, tells SpellcheckEditor "Hey, have book". To do this it uses function SpellcheckEditor::SetBook(QSharedPointer<Book>), which is public function of... wait now... SpellcheckEditor! MainWindow, by initiation, first creates Book and than SpellcheckEditor: some time travel here?
BF begins (B is for Brain).
Ok, let it be for now...
I did some things to function SpellcheckEditor::CreateModel(...), wrote some help functions, wrote one fake five-liner (to deliver language of the words), meddled with SpellcheckEditor.ui - QtC has a graphical editor for this, but I prefer to do it manually: this way the diff patch is smaller.
The idea was to create preliminary mock-up of the end product, as a focus for farther thoughts and to get used to Sigil and C++ again. See second picture for results, done on the same sample as the first one.
tbc...?
Last edited by varlog; 06-11-2016 at 04:41 PM.
|