summaryrefslogtreecommitdiff
path: root/noncore/settings/netsystemtime/ntp.cpp
Side-by-side diff
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 )
+ //make tab order
+
+ TabWidgetMain->removePage( tabMain );
+ TabWidgetMain->removePage( tabManualSetTime );
+ TabWidgetMain->removePage( TabSettings );
+ TabWidgetMain->removePage( tabPredict );
+ 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" ) );
+ NtpBaseLayout->addWidget( TabWidgetMain, 0, 0 );
+
+
+
bool advMode = cfg.readBoolEntry("advancedFeatures", false );
@@ -114,3 +131,3 @@ void Ntp::slotRunNtp()
{
- if ( !ntpDelayElapsed() )
+ if ( !ntpDelayElapsed() && CheckBoxAdvSettings->isChecked() )
{
@@ -135,2 +152,4 @@ void Ntp::slotRunNtp()
if ( !ret ) {
+ QMessageBox::critical(this, tr("ntp error"),
+ tr("Error while getting time form network!"));
qDebug("Error while executing ntpdate");
@@ -142,2 +161,3 @@ void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen)
{
+ if (! proc ) qDebug("Ntp::getNtpOutput OProcess is null");
QString lineStr, lineStrOld;
@@ -155,6 +175,12 @@ void Ntp::ntpFinished(OProcess *p)
{
- // qDebug("p->exitStatus() %i",p->exitStatus());
+ qDebug("p->exitStatus() %i",p->exitStatus());
if (p->exitStatus()!=0 || !p->normalExit())
- {
- slotProbeNtpServer();
+ {
+ QMessageBox::critical(this, tr("ntp error"),
+ tr("Error while getting time form\n server")+
+ getNtpServer()+"\n"+
+ _ntpOutput );
+ // TabWidgetMain->setCurrentPage( 1 );
+ TabWidgetMain->showPage( tabManualSetTime );
+
return;
@@ -309,2 +335,3 @@ void Ntp::ntpOutPut(QString out)
{
+
MultiLineEditntpOutPut->append(out);
@@ -340,3 +367,3 @@ void Ntp::setDocument(const QString &fileName)
{
-
+ qDebug("Ntp::setDocument( %s )",fileName.latin1());
}
@@ -346,2 +373,3 @@ void Ntp::showAdvancedFeatures(bool advMode)
if (advMode) {
+
TabWidgetMain->addTab( tabPredict, tr( "Predict" ) );