summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index 06d944d..aecefc1 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -49,5 +49,5 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
//make tab order
-
+
TabWidgetMain->removePage( tabMain );
TabWidgetMain->removePage( tabManualSetTime );
@@ -62,5 +62,5 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
NtpBaseLayout->addWidget( TabWidgetMain, 0, 0 );
-
+
bool advMode = cfg.readBoolEntry("advancedFeatures", false );
@@ -101,5 +101,5 @@ void Ntp::saveConfig(){
int srvCount = ComboNtpSrv->count();
bool serversChanged = true;
- int curSrv = ComboNtpSrv->currentItem();
+ int curSrv = ComboNtpSrv->currentItem();
QString edit = ComboNtpSrv->currentText();
for (int i = 0; i < srvCount; i++){
@@ -110,5 +110,5 @@ void Ntp::saveConfig(){
ntpSrvs.setGroup("servers");
ntpSrvs.writeEntry("count", ++srvCount);
- ntpSrvs.setGroup("0");
+ ntpSrvs.setGroup("0");
ntpSrvs.writeEntry( "name", edit );
curSrv = 0;
@@ -132,5 +132,5 @@ bool Ntp::ntpDelayElapsed()
cfg.setGroup("lookups");
_lookupDiff = TimeConversion::toUTC(QDateTime::currentDateTime()) - cfg.readNumEntry("time",0);
- if (_lookupDiff < 0) return true;
+ if (_lookupDiff < 0) return true;
int i =_lookupDiff - (SpinBoxNtpDelay->value()*60);
return i > -60;
@@ -173,5 +173,5 @@ void Ntp::slotRunNtp()
TextLabelStartTime->setText(QDateTime::currentDateTime().toString());
ntpOutPut( tr("Running:")+"\nntpdate "+getNtpServer() );
-
+
ntpProcess->clearArguments();
*ntpProcess << "ntpdate" << getNtpServer();
@@ -203,5 +203,5 @@ void Ntp::ntpFinished(OProcess *p)
qDebug("p->exitStatus() %i",p->exitStatus());
if (p->exitStatus()!=0 || !p->normalExit())
- {
+ {
if ( isVisible() && _interactive ){
QMessageBox::critical(this, tr("ntp error"),tr("Error while getting time form\n server")+getNtpServer()+"\n"+_ntpOutput );
@@ -210,5 +210,5 @@ void Ntp::ntpFinished(OProcess *p)
return;
}
-
+
Config cfg("ntp",Config::User);
cfg.setGroup("lookups");
@@ -218,5 +218,5 @@ void Ntp::ntpFinished(OProcess *p)
int time = TimeConversion::toUTC( QDateTime::currentDateTime() );
cfg.writeEntry("time", time);
-
+
float timeShift = getTimeShift();
if (timeShift == 0.0) return;
@@ -330,5 +330,5 @@ void Ntp::slotCheckNtp(int i)
connect(ntpTimer, SIGNAL( timeout() ), SLOT(slotProbeNtpServer()) );
}
- }else{
+ }else{
preditctTime();
ButtonSetTime->setText( tr("Set predicted time: ")+predictedTime.toString() );
@@ -351,5 +351,5 @@ void Ntp::slotNtpDelayChanged(int delay)
void Ntp::ntpOutPut(QString out)
{
-
+
MultiLineEditntpOutPut->append(out);
MultiLineEditntpOutPut->setCursorPosition(MultiLineEditntpOutPut->numLines() + 1,0,FALSE);
@@ -358,5 +358,5 @@ void Ntp::ntpOutPut(QString out)
void Ntp::makeChannel()
-{
+{
channel = new QCopChannel( "QPE/Application/netsystemtime", this );
connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
@@ -390,7 +390,9 @@ void Ntp::showAdvancedFeatures(bool advMode)
{
if (advMode) {
-
- TabWidgetMain->addTab( tabPredict, tr( "Predict" ) );
- TabWidgetMain->addTab( tabNtp, tr( "NTP" ) );
+
+ if ( tabNtp->isVisible() ) {
+ TabWidgetMain->addTab( tabPredict, tr( "Predict" ) );
+ TabWidgetMain->addTab( tabNtp, tr( "NTP" ) );
+ }
TextLabel1_2_2->show();
TextLabel2_3->show();
@@ -423,8 +425,8 @@ void Ntp::accept( ){
//SetTimeDate
commitTime();
- writeSettings();
+ writeSettings();
updateSystem();
// Ntp
- saveConfig();
+ saveConfig();
qApp->quit();
}