summaryrefslogtreecommitdiff
path: root/noncore/settings/netsystemtime/ntp.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/netsystemtime/ntp.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp36
1 files changed, 21 insertions, 15 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index c7e3b52..53dbe46 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -56,7 +56,6 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
TabWidgetMain->removePage( tabNtp );
TabWidgetMain->insertTab( tabMain, tr( "Main" ) );
- TabWidgetMain->insertTab( tabManualSetTime, tr( "Manual" ) );
TabWidgetMain->insertTab( TabSettings, tr( "Settings" ) );
TabWidgetMain->insertTab( tabPredict, tr( "Predict" ) );
TabWidgetMain->insertTab( tabNtp, tr( "NTP" ) );
@@ -96,6 +95,9 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
Ntp::~Ntp()
{
delete ntpProcess;
+}
+
+void Ntp::saveConfig(){
int srvCount = ComboNtpSrv->count();
bool serversChanged = true;
QString edit = ComboNtpSrv->currentText();
@@ -199,21 +201,11 @@ void Ntp::ntpFinished(OProcess *p)
{
if ( isVisible() && _interactive ){
QMessageBox::critical(this, tr("ntp error"),tr("Error while getting time form\n server")+getNtpServer()+"\n"+_ntpOutput );
- TabWidgetMain->showPage( tabManualSetTime );
}
-
+// slotCheckNtp(-1);
return;
}
- Global::writeHWClock();
- // since time has changed quickly load in the datebookdb
- // to allow the alarm server to get a better grip on itself
- // (example re-trigger alarms for when we travel back in time)
- DateBookDB db;
-
- // QCopEnvelope timeApplet( "QPE/TaskBar", "reloadApplets()" );
- // timeApplet << "";
-
Config cfg("ntp",Config::User);
cfg.setGroup("lookups");
int lastLookup = cfg.readNumEntry("time",0);
@@ -306,20 +298,22 @@ void Ntp::preditctTime()
TextLabelEstimatedShift->setText(QString::number(corr)+tr(" seconds"));
predictedTime = QDateTime::currentDateTime().addSecs(corr);
TextLabelPredTime->setText(predictedTime.toString());
- TextLabelMainPredTime->setText(tr("Predicted time:")+"<br><b>"+predictedTime.toString()+"</b>");
+// TextLabelMainPredTime->setText(tr("Predicted time:")+"<br><b>"+predictedTime.toString()+"</b>");
}
void Ntp::setPredictTime()
{
+ qDebug("Ntp::setPredictTime");
preditctTime();
- setTime( predictedTime );
+ timeButton->setTime( predictedTime );
}
void Ntp::slotCheckNtp(int i)
{
+ qDebug(" Ntp::slotCheckNtp(%i)",i);
if (i == 0)
{
- TextLabelMainPredTime->hide();
+// TextLabelMainPredTime->hide();
ButtonSetTime->setText( tr("Get time from network") );
connect( ButtonSetTime, SIGNAL(clicked()), SLOT(slotButtonRunNtp()) );
if ( ntpDelayElapsed() )
@@ -418,3 +412,15 @@ void Ntp::showAdvancedFeatures(bool advMode)
};
TabWidgetMain->show();
}
+
+
+void Ntp::accept( ){
+ qDebug("accepted");
+ //SetTimeDate
+ commitTime();
+ writeSettings();
+ updateSystem();
+ // Ntp
+ saveConfig();
+ qApp->quit();
+} \ No newline at end of file