author | tille <tille> | 2002-11-10 17:01:05 (UTC) |
---|---|---|
committer | tille <tille> | 2002-11-10 17:01:05 (UTC) |
commit | 8394ee8e5fc0014605256b243909709864afdc9b (patch) (side-by-side diff) | |
tree | 02718093edeb4c2df58ef8611fbf3db11abcf574 /noncore/settings/netsystemtime/ntp.cpp | |
parent | 81e63be3c1e21da2a2f97df1fc38417e7ca814e1 (diff) | |
download | opie-8394ee8e5fc0014605256b243909709864afdc9b.zip opie-8394ee8e5fc0014605256b243909709864afdc9b.tar.gz opie-8394ee8e5fc0014605256b243909709864afdc9b.tar.bz2 |
usability improvments
Diffstat (limited to 'noncore/settings/netsystemtime/ntp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/netsystemtime/ntp.cpp | 38 |
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" ) ); |