[bt-devel] Beginnings of a DCOP interface to BibleTime

Joachim Ansorg nospam+bt-devel at joachim-ansorg.de
Wed Aug 24 02:43:39 MST 2005


Hi Teus,

> I am interested in getting one done. Are there any pointers you could
> give me to get started with this function:
>
> ASYNC BibleTime::syncAllVerseBasedModules(QString key) {
>     qWarning("DCOP: syncing all verse based modules ...");
> }

That shouldn't be too difficult.
The widget called CMDIArea contains all windows. Each window is of the type 
CDisplayWindow and provides methods to get the list of modules 
(CDisplayWindow::modules()) and to show the text for a key 
(CDisplayWindow::lookup(QString)).

So basically you have to this:
 - Get the pointer to the CMDIArea (it's already in BibleTime::m_mdi)
 - Get a list of all windows (CMDIArea::usableWindowList)
 - Iterate through that list and cast each QWidget to a CDisplayWindow
 - Get for each module the module list and check whether the first module's 
type is a Bible or Commentary (those are the verse based modules). It's 
enough to check only the first module in each window's module list
 - If the type is ok call CDisplayWindow::lookup (QString&) on the current 
window

That should be all you need to do.

Let us know if you need more help,
Joachim


More information about the bt-devel mailing list