View Single Post
Old 06-11-2016, 04:39 PM   #11
varlog
actually it is /var/log
varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.varlog ought to be getting tired of karma fortunes by now.
 
varlog's Avatar
 
Posts: 341
Karma: 2994236
Join Date: Sep 2012
Location: usually Europa
Device: prs t1
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...?
Attached Thumbnails
Click image for larger version

Name:	SCE_before.jpg
Views:	267
Size:	37.8 KB
ID:	149347   Click image for larger version

Name:	SCE_after.jpg
Views:	273
Size:	44.9 KB
ID:	149348  

Last edited by varlog; 06-11-2016 at 04:41 PM.
varlog is offline   Reply With Quote