author | tille <tille> | 2002-11-10 17:01:05 (UTC) |
---|---|---|
committer | tille <tille> | 2002-11-10 17:01:05 (UTC) |
commit | 8394ee8e5fc0014605256b243909709864afdc9b (patch) (unidiff) | |
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 | |||
@@ -47,4 +47,21 @@ Ntp::Ntp( QWidget* parent, const char* name, WFlags fl ) | |||
47 | ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) ); | 47 | ComboNtpSrv->setCurrentItem( cfg.readNumEntry("ntpServer", 0) ); |
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 ); |
50 | showAdvancedFeatures(advMode); | 67 | showAdvancedFeatures(advMode); |
@@ -113,5 +130,5 @@ QString Ntp::getNtpServer() | |||
113 | void Ntp::slotRunNtp() | 130 | void Ntp::slotRunNtp() |
114 | { | 131 | { |
115 | if ( !ntpDelayElapsed() ) | 132 | if ( !ntpDelayElapsed() && CheckBoxAdvSettings->isChecked() ) |
116 | { | 133 | { |
117 | switch ( | 134 | switch ( |
@@ -134,4 +151,6 @@ void Ntp::slotRunNtp() | |||
134 | bool ret = ntpProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput); | 151 | bool ret = ntpProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput); |
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"); |
137 | ntpOutPut( tr("Error while executing ntpdate")); | 156 | ntpOutPut( tr("Error while executing ntpdate")); |
@@ -141,4 +160,5 @@ void Ntp::slotRunNtp() | |||
141 | void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen) | 160 | 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; |
144 | lineStr = buffer; | 164 | lineStr = buffer; |
@@ -154,8 +174,14 @@ void Ntp::getNtpOutput(OProcess *proc, char *buffer, int buflen) | |||
154 | void Ntp::ntpFinished(OProcess *p) | 174 | 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; |
161 | } | 187 | } |
@@ -308,4 +334,5 @@ void Ntp::slotNtpDelayChanged(int delay) | |||
308 | void Ntp::ntpOutPut(QString out) | 334 | void Ntp::ntpOutPut(QString out) |
309 | { | 335 | { |
336 | |||
310 | MultiLineEditntpOutPut->append(out); | 337 | MultiLineEditntpOutPut->append(out); |
311 | MultiLineEditntpOutPut->setCursorPosition(MultiLineEditntpOutPut->numLines() + 1,0,FALSE); | 338 | MultiLineEditntpOutPut->setCursorPosition(MultiLineEditntpOutPut->numLines() + 1,0,FALSE); |
@@ -339,5 +366,5 @@ void Ntp::receive(const QCString &msg, const QByteArray &arg) | |||
339 | void Ntp::setDocument(const QString &fileName) | 366 | void Ntp::setDocument(const QString &fileName) |
340 | { | 367 | { |
341 | 368 | qDebug("Ntp::setDocument( %s )",fileName.latin1()); | |
342 | } | 369 | } |
343 | 370 | ||
@@ -345,4 +372,5 @@ void Ntp::showAdvancedFeatures(bool advMode) | |||
345 | { | 372 | { |
346 | if (advMode) { | 373 | if (advMode) { |
374 | |||
347 | TabWidgetMain->addTab( tabPredict, tr( "Predict" ) ); | 375 | TabWidgetMain->addTab( tabPredict, tr( "Predict" ) ); |
348 | TabWidgetMain->addTab( tabNtp, tr( "NTP" ) ); | 376 | TabWidgetMain->addTab( tabNtp, tr( "NTP" ) ); |