summaryrefslogtreecommitdiff
path: root/noncore/settings/netsystemtime/ntp.cpp
authortille <tille>2002-11-16 16:43:02 (UTC)
committer tille <tille>2002-11-16 16:43:02 (UTC)
commit0633fb26123857509c9eb0e0a013b654667ca9ce (patch) (side-by-side diff)
tree9187213cc22830c65dcba1923be9a8355c673b5a /noncore/settings/netsystemtime/ntp.cpp
parent88435a3192f09453e035a7f1cf73bbc8c24245c9 (diff)
downloadopie-0633fb26123857509c9eb0e0a013b654667ca9ce.zip
opie-0633fb26123857509c9eb0e0a013b654667ca9ce.tar.gz
opie-0633fb26123857509c9eb0e0a013b654667ca9ce.tar.bz2
usability:
made it a dialog that saves when exiting clock now running
Diffstat (limited to 'noncore/settings/netsystemtime/ntp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp56
1 files changed, 31 insertions, 25 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
@@ -50,3 +50,3 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
//make tab order
-
+
TabWidgetMain->removePage( tabMain );
@@ -58,3 +58,2 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
TabWidgetMain->insertTab( tabMain, tr( "Main" ) );
- TabWidgetMain->insertTab( tabManualSetTime, tr( "Manual" ) );
TabWidgetMain->insertTab( TabSettings, tr( "Settings" ) );
@@ -98,2 +97,5 @@ Ntp::~Ntp()
delete ntpProcess;
+}
+
+void Ntp::saveConfig(){
int srvCount = ComboNtpSrv->count();
@@ -201,16 +203,6 @@ void Ntp::ntpFinished(OProcess *p)
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 << "";
@@ -308,3 +300,3 @@ void Ntp::preditctTime()
TextLabelPredTime->setText(predictedTime.toString());
- TextLabelMainPredTime->setText(tr("Predicted time:")+"<br><b>"+predictedTime.toString()+"</b>");
+// TextLabelMainPredTime->setText(tr("Predicted time:")+"<br><b>"+predictedTime.toString()+"</b>");
}
@@ -313,4 +305,5 @@ void Ntp::setPredictTime()
{
+ qDebug("Ntp::setPredictTime");
preditctTime();
- setTime( predictedTime );
+ timeButton->setTime( predictedTime );
}
@@ -319,5 +312,6 @@ void Ntp::slotCheckNtp(int i)
{
+ qDebug(" Ntp::slotCheckNtp(%i)",i);
if (i == 0)
{
- TextLabelMainPredTime->hide();
+// TextLabelMainPredTime->hide();
ButtonSetTime->setText( tr("Get time from network") );
@@ -325,11 +319,11 @@ void Ntp::slotCheckNtp(int i)
if ( ntpDelayElapsed() )
- {
- slotRunNtp();
- disconnect(ntpTimer, SIGNAL( timeout() ), this, SLOT(slotProbeNtpServer()) );
- connect(ntpTimer, SIGNAL( timeout() ), SLOT(slotTimerRunNtp()) );
- }else{
- disconnect(ntpTimer, SIGNAL( timeout() ), this, SLOT(slotTimerRunNtp()) );
- connect(ntpTimer, SIGNAL( timeout() ), SLOT(slotProbeNtpServer()) );
- }
- }else{
+ {
+ slotRunNtp();
+ disconnect(ntpTimer, SIGNAL( timeout() ), this, SLOT(slotProbeNtpServer()) );
+ connect(ntpTimer, SIGNAL( timeout() ), SLOT(slotTimerRunNtp()) );
+ }else{
+ disconnect(ntpTimer, SIGNAL( timeout() ), this, SLOT(slotTimerRunNtp()) );
+ connect(ntpTimer, SIGNAL( timeout() ), SLOT(slotProbeNtpServer()) );
+ }
+ }else{
preditctTime();
@@ -420 +414,13 @@ void Ntp::showAdvancedFeatures(bool advMode)
}
+
+
+void Ntp::accept( ){
+ qDebug("accepted");
+ //SetTimeDate
+ commitTime();
+ writeSettings();
+ updateSystem();
+ // Ntp
+ saveConfig();
+ qApp->quit();
+} \ No newline at end of file