author | hrw <hrw> | 2005-07-25 14:21:11 (UTC) |
---|---|---|
committer | hrw <hrw> | 2005-07-25 14:21:11 (UTC) |
commit | ee25393f06291c3d7a1e64f146abc5e5fbadaf60 (patch) (side-by-side diff) | |
tree | 110377f4eb42731974048854bbad0c1a34583565 /noncore | |
parent | b74ea9f8de39d355e2d16b4b685e9de54e2f0b0d (diff) | |
download | opie-ee25393f06291c3d7a1e64f146abc5e5fbadaf60.zip opie-ee25393f06291c3d7a1e64f146abc5e5fbadaf60.tar.gz opie-ee25393f06291c3d7a1e64f146abc5e5fbadaf60.tar.bz2 |
Show 'Predict' tab only once - close #1543
-rw-r--r-- | noncore/settings/netsystemtime/mainwindow.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/noncore/settings/netsystemtime/mainwindow.cpp b/noncore/settings/netsystemtime/mainwindow.cpp index 35d4105..c1cd796 100644 --- a/noncore/settings/netsystemtime/mainwindow.cpp +++ b/noncore/settings/netsystemtime/mainwindow.cpp @@ -68,4 +68,5 @@ MainWindow::MainWindow( QWidget *parent , const char *name, bool modal, WFlags ntpProcess = 0x0; ntpTab = 0x0; + predictTab = 0x0; // Add tab widgets @@ -73,5 +74,4 @@ MainWindow::MainWindow( QWidget *parent , const char *name, bool modal, WFlags mainWidget->addTab( formatTab = new FormatTabWidget( mainWidget ), "netsystemtime/formattab", tr( "Format" ) ); mainWidget->addTab( settingsTab = new SettingsTabWidget( mainWidget ), "SettingsIcon", tr( "Settings" ) ); - mainWidget->addTab( predictTab = new PredictTabWidget( mainWidget ), "netsystemtime/predicttab", tr( "Predict" ) ); Config config( "ntp" ); config.setGroup( "settings" ); @@ -276,4 +276,5 @@ void MainWindow::slotDisplayPredictTab( bool display ) if ( display && !predictTab ) { + predictTab = new PredictTabWidget( mainWidget ); } // Display/hide tab @@ -372,5 +373,10 @@ void MainWindow::slotNtpFinished( OProcess *p ) config.setGroup( grpname ); lookupCount++; + + if(predictTab) + { predictTab->setShiftPerSec( (int)(timeShift / secsSinceLast) ); + } + config.writeEntry( "secsSinceLast", secsSinceLast ); config.writeEntry( "timeShift", QString::number( timeShift ) ); @@ -405,5 +411,9 @@ void MainWindow::slotCheckNtp( int i ) else { + if(predictTab) + { predictTab->slotPredictTime(); + } + if ( i > 0 ) { |