-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | noncore/settings/netsystemtime/mainwindow.cpp | 16 |
2 files changed, 14 insertions, 3 deletions
@@ -11,32 +11,33 @@ * Opie-Tabmanager has gone unsupported - it barely works and there is not much of a use of it anyway (mickeyl) * Checkbook: Added configuration option to use smaller font for checkbook transaction tab (hrw) * ZSafe: Made UI conform to Opie standards (drw) * Today Addressbook plugin: Fixed configuration to show/not show birthdays, use checkboxes for selection (hrw) * Opie-Console: Read initial fixed font configuration from qpe.conf (mickeyl) * Opie-PcmciaApplet: Configure insert/resume actions and bind unsupported cards (mickeyl) * SysInfo: Remove CPU tab and add Devices tab instead (mickeyl) Fixed Bugs ---------- * #1377 - Suspend Powermanagement when switched to another VT (mickeyl) - We actually suspend the complete Opie now in that case. * #1384 - Battery status updated improperly when charging (skyhusker) * #1476 - Wrong order of application entries in the O-menu (skyhusker) * #1514 - Remove usage of cardmon/pcmcia picture in applications. pcmcia is now an inline picture (mickeyl) * #1535 - Missing line break and unnecessary location shown with Today-Calendar plugin (deller) + * #1543 - Time Settings: "predict" tab is displayed twice after reopen (hrw) * #1546 - Battery applet popup is not always large enough to show jacket remaining info (skyhusker) * #1557 - Light&Power-Settings don't store warning intervall and warning levels (skyhusker) * #1565 - crash-fix in odevice.cpp while scanning the distribution table (deller) * #1614 - Make Opie-console start in $HOME instead of / (skyhusker) * #1635 - opie-today, datebook-plugin does not show notes (skyhusker) * #1665 - Opie-IRC displays the host prepended to the message when peer is using and ipv6 address (skyhusker) * #1666 - Opie-IRC does not allow to add !channels in config as autojoin ones (skyhusker) * #1667 - Opie-IRC does not show messages from !channel (skyhusker) * #1679 - Security PIN plugin is QVGA sized (hrw) * n.a. - always show volume and wireless applet popups inside visible screen (deller) * n.a. - scale O-Menu-Applets appropriately (mickeyl) * n.a. - libopienet: fix bugs in wireless scanning and setting SSID (skyhusker) * n.a. - Wellenreiter: relax WE version matching test a bit (mickeyl) * n.a. - scale BluezApplet appropriately and use larger icons (mickeyl) * n.a. - memoryapplet: fix crash in memoryapplet on kernels without swap support (seneca cunningham) * n.a. - networksettings: ignore hostap control interfaces wifi* (mickeyl) 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 @@ -54,38 +54,38 @@ using namespace Opie::Ui; using namespace Opie::Core; MainWindow::MainWindow( QWidget *parent , const char *name, bool modal, WFlags f ) : QDialog( parent, name, modal, f ) { setCaption( tr( "SystemTime" ) ); QVBoxLayout *layout = new QVBoxLayout( this ); layout->setMargin( 2 ); layout->setSpacing( 4 ); // Create main tabbed control mainWidget = new OTabWidget( this ); // Default object pointers to null ntpProcess = 0x0; ntpTab = 0x0; + predictTab = 0x0; // Add tab widgets mainWidget->addTab( timeTab = new TimeTabWidget( mainWidget ), "netsystemtime/DateTime", tr( "Time" ) ); 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" ); slotDisplayNTPTab( config.readBoolEntry( "displayNtpTab", false ) ); slotDisplayPredictTab( config.readBoolEntry( "displayPredictTab", false ) ); mainWidget->setCurrentTab( tr( "Time" ) ); layout->addWidget( mainWidget ); connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), this, SLOT(slotQCopReceive(const QCString&,const QByteArray&)) ); // Create NTP socket ntpSock = new QSocket( this ); connect( ntpSock, SIGNAL(error(int)),SLOT(slotCheckNtp(int)) ); slotProbeNTPServer(); @@ -262,32 +262,33 @@ void MainWindow::slotDisplayNTPTab( bool display ) ntpTab = new NTPTabWidget( mainWidget ); connect( ntpTab, SIGNAL(getNTPTime()), this, SLOT(slotGetNTPTime()) ); } // Display/hide tab display ? mainWidget->addTab( ntpTab, "netsystemtime/ntptab", tr( "Time Server" ) ) : mainWidget->removePage( ntpTab ); } void MainWindow::slotDisplayPredictTab( bool display ) { predictTabEnabled = display; // Create widget if it hasn't needed if ( display && !predictTab ) { + predictTab = new PredictTabWidget( mainWidget ); } // Display/hide tab display ? mainWidget->addTab( predictTab, "netsystemtime/predicttab", tr( "Predict" ) ) : mainWidget->removePage( predictTab ); } void MainWindow::slotGetNTPTime() { ntpInteractive = true; runNTP(); } void MainWindow::slotTimerGetNTPTime() { ntpInteractive = false; runNTP(); @@ -358,61 +359,70 @@ void MainWindow::slotNtpFinished( OProcess *p ) return; int secsSinceLast = time - lastLookup; output = tr( "%1 seconds").arg(QString::number( timeShift )); // Display information on time server tab if ( ntpTabEnabled ) { ntpTab->setTimeShift( output ); ntpTab->setNewTime( dt.toString() ); } if ( lastNtp && lastLookup > 0 && secsSinceLast > 60 * ntpDelay ) { QString grpname = QString( "lookup_" ).append( QString::number( lookupCount ) ); config.setGroup( grpname ); lookupCount++; - predictTab->setShiftPerSec( (int)(timeShift / secsSinceLast) ); + + if(predictTab) + { + predictTab->setShiftPerSec( (int)(timeShift / secsSinceLast) ); + } + config.writeEntry( "secsSinceLast", secsSinceLast ); config.writeEntry( "timeShift", QString::number( timeShift ) ); config.setGroup( "lookups" ); config.writeEntry( "count", lookupCount ); config.writeEntry( "lastNtp", true ); } } void MainWindow::slotNTPDelayChanged( int delay ) { ntpTimer->changeInterval( delay * 1000 * 60 ); ntpDelay = delay; } void MainWindow::slotCheckNtp( int i ) { if ( i == 0 ) { if ( ntpDelayElapsed() ) { runNTP(); disconnect( ntpTimer, SIGNAL(timeout()), this, SLOT(slotProbeNTPServer()) ); connect( ntpTimer, SIGNAL(timeout()), SLOT(slotTimerGetNTPTime()) ); } else { disconnect(ntpTimer, SIGNAL(timeout()), this, SLOT(slotTimerGetNTPTime()) ); connect(ntpTimer, SIGNAL(timeout()), SLOT(slotProbeNTPServer()) ); } } else { - predictTab->slotPredictTime(); + if(predictTab) + { + predictTab->slotPredictTime(); + } + if ( i > 0 ) { QString output = tr( "Could not connect to server " ); output.append( settingsTab->ntpServer() ); ntpOutput.append( output ); if ( ntpTabEnabled ) ntpTab->addNtpOutput( output ); } connect( ntpTimer, SIGNAL(timeout()), SLOT(slotProbeNTPServer()) ); } } |