summaryrefslogtreecommitdiff
path: root/noncore/settings/netsystemtime/ntp.cpp
Unidiff
Diffstat (limited to 'noncore/settings/netsystemtime/ntp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/ntp.cpp38
1 files changed, 33 insertions, 5 deletions
diff --git a/noncore/settings/netsystemtime/ntp.cpp b/noncore/settings/netsystemtime/ntp.cpp
index 40805a0..111f7d4 100644
--- a/noncore/settings/netsystemtime/ntp.cpp
+++ b/noncore/settings/netsystemtime/ntp.cpp
@@ -48,2 +48,19 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl )
48 48
49 //make tab order
50
51 TabWidgetMain->removePage( tabMain );
52 TabWidgetMain->removePage( tabManualSetTime );
53 TabWidgetMain->removePage( TabSettings );
54 TabWidgetMain->removePage( tabPredict );
55 TabWidgetMain->removePage( tabNtp );
56
57 TabWidgetMain->insertTab( tabMain, tr( "Main" ) );
58 TabWidgetMain->insertTab( tabManualSetTime, tr( "Manual" ) );
59 TabWidgetMain->insertTab( TabSettings, tr( "Settings" ) );
60 TabWidgetMain->insertTab( tabPredict, tr( "Predict" ) );
61 TabWidgetMain->insertTab( tabNtp, tr( "NTP" ) );
62 NtpBaseLayout->addWidget( TabWidgetMain, 0, 0 );
63
64
65
49 bool advMode = cfg.readBoolEntry("advancedFeatures", false ); 66 bool advMode = cfg.readBoolEntry("advancedFeatures", false );
@@ -114,3 +131,3 @@ void Ntp::slotRunNtp()
114{ 131{
115 if ( !ntpDelayElapsed() ) 132 if ( !ntpDelayElapsed() && CheckBoxAdvSettings->isChecked() )
116 { 133 {
@@ -135,2 +152,4 @@ void Ntp::slotRunNtp()
135 if ( !ret ) { 152 if ( !ret ) {
153 QMessageBox::critical(this, tr("ntp error"),
154 tr("Error while getting time form network!"));
136 qDebug("Error while executing ntpdate"); 155 qDebug("Error while executing ntpdate");
@@ -142,2 +161,3 @@ void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen)
142{ 161{
162 if (! proc ) qDebug("Ntp::getNtpOutput OProcess is null");
143 QString lineStr, lineStrOld; 163 QString lineStr, lineStrOld;
@@ -155,6 +175,12 @@ void Ntp::ntpFinished(OProcess *p)
155{ 175{
156 //qDebug("p->exitStatus() %i",p->exitStatus()); 176 qDebug("p->exitStatus() %i",p->exitStatus());
157 if (p->exitStatus()!=0 || !p->normalExit()) 177 if (p->exitStatus()!=0 || !p->normalExit())
158 { 178 {
159 slotProbeNtpServer(); 179 QMessageBox::critical(this, tr("ntp error"),
180 tr("Error while getting time form\n server")+
181 getNtpServer()+"\n"+
182 _ntpOutput );
183 // TabWidgetMain->setCurrentPage( 1 );
184 TabWidgetMain->showPage( tabManualSetTime );
185
160 return; 186 return;
@@ -309,2 +335,3 @@ void Ntp::ntpOutPut(QString out)
309{ 335{
336
310 MultiLineEditntpOutPut->append(out); 337 MultiLineEditntpOutPut->append(out);
@@ -340,3 +367,3 @@ void Ntp::setDocument(const QString &fileName)
340{ 367{
341 368 qDebug("Ntp::setDocument( %s )",fileName.latin1());
342} 369}
@@ -346,2 +373,3 @@ void Ntp::showAdvancedFeatures(bool advMode)
346 if (advMode) { 373 if (advMode) {
374
347 TabWidgetMain->addTab( tabPredict, tr( "Predict" ) ); 375 TabWidgetMain->addTab( tabPredict, tr( "Predict" ) );