[OpendTect_Developers] Doing work immediately after dialog pop up

Bert Bril bert at opendtect.org
Mon Dec 5 13:33:04 CET 2011


Hi,


I'm doing some work on the OpendTect installer. When the window pops up 
it needs to contact the web site to download a file with the available 
packages. When I tried this, the window remained blank during the time 
this file was downloaded.

I found that very ugly, so I placed the download stuff in a CallBack 
function which I coupled to the finalise-done notifier:

postFinalise().notify( mCB(this,uiODInstMgr,initWin) );

[I need to mention we changed 'finaliseDone' to postFinalise().] Anyway, 
that didn't work either (the work was done but the UI was still blank). 
In the end I used a Timer (include "timer.h"):

toStatusBar( "Connecting to Internet" );
timer_ = new Timer;
timer_->tick.notify( mCB(this,uiODInstMgr,initWin) );
timer_->start( 250, true );

That does the trick. When debugging, the timer hits for sure whenever 
you have any breakpoint (I can't print a variable before 250 ms is 
over). I'm wondering whether there may be a better way?


/Bert


-- 
-- Bert Bril / OpendTect developer at dGB
-- mailto:Bert.Bril at opendtect.org , http://opendtect.org





More information about the Developers mailing list