summaryrefslogtreecommitdiff
path: root/noncore/settings/netsystemtime/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/settings/netsystemtime/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/mainwindow.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/settings/netsystemtime/mainwindow.cpp b/noncore/settings/netsystemtime/mainwindow.cpp
index c995d6e..ba96f33 100644
--- a/noncore/settings/netsystemtime/mainwindow.cpp
+++ b/noncore/settings/netsystemtime/mainwindow.cpp
@@ -39,24 +39,26 @@
39#include <qpe/qpedialog.h> 39#include <qpe/qpedialog.h>
40 40
41#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 41#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
42#include <qpe/qcopenvelope_qws.h> 42#include <qpe/qcopenvelope_qws.h>
43#endif 43#endif
44 44
45#include <qlayout.h> 45#include <qlayout.h>
46#include <qmessagebox.h> 46#include <qmessagebox.h>
47#include <qsocket.h> 47#include <qsocket.h>
48#include <qstring.h> 48#include <qstring.h>
49#include <qtimer.h> 49#include <qtimer.h>
50 50
51using namespace Opie::Ui;
52using namespace Opie::Core;
51MainWindow::MainWindow( QWidget *parent , const char *name, bool modal, WFlags f ) 53MainWindow::MainWindow( QWidget *parent , const char *name, bool modal, WFlags f )
52 : QDialog( 0x0, 0x0, TRUE, 0 ) 54 : QDialog( 0x0, 0x0, TRUE, 0 )
53{ 55{
54 setCaption( tr( "SystemTime" ) ); 56 setCaption( tr( "SystemTime" ) );
55 57
56 QVBoxLayout *layout = new QVBoxLayout( this ); 58 QVBoxLayout *layout = new QVBoxLayout( this );
57 layout->setMargin( 2 ); 59 layout->setMargin( 2 );
58 layout->setSpacing( 4 ); 60 layout->setSpacing( 4 );
59 61
60 // Create main tabbed control 62 // Create main tabbed control
61 mainWidget = new OTabWidget( this ); 63 mainWidget = new OTabWidget( this );
62 64
@@ -179,27 +181,27 @@ void MainWindow::runNTP()
179 // Send information to time server tab if enabled 181 // Send information to time server tab if enabled
180 if ( ntpTabEnabled ) 182 if ( ntpTabEnabled )
181 { 183 {
182 ntpTab->setStartTime( QDateTime::currentDateTime().toString() ); 184 ntpTab->setStartTime( QDateTime::currentDateTime().toString() );
183 QString output = tr( "Running:\nntpdate " ); 185 QString output = tr( "Running:\nntpdate " );
184 output.append( srv ); 186 output.append( srv );
185 ntpTab->addNtpOutput( output ); 187 ntpTab->addNtpOutput( output );
186 } 188 }
187 189
188 if ( !ntpProcess ) 190 if ( !ntpProcess )
189 { 191 {
190 ntpProcess = new OProcess(); 192 ntpProcess = new OProcess();
191 connect( ntpProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), 193 connect( ntpProcess, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
192 this, SLOT(slotNtpOutput(OProcess*,char*,int)) ); 194 this, SLOT(slotNtpOutput(OProcess*,char*,int)) );
193 connect( ntpProcess, SIGNAL(processExited(OProcess*)), 195 connect( ntpProcess, SIGNAL(processExited(Opie::Core::OProcess*)),
194 this, SLOT(slotNtpFinished(OProcess*)) ); 196 this, SLOT(slotNtpFinished(OProcess*)) );
195 } 197 }
196 198
197 else 199 else
198 ntpProcess->clearArguments(); 200 ntpProcess->clearArguments();
199 201
200 *ntpProcess << "ntpdate" << srv; 202 *ntpProcess << "ntpdate" << srv;
201 bool ret = ntpProcess->start( OProcess::NotifyOnExit, OProcess::AllOutput ); 203 bool ret = ntpProcess->start( OProcess::NotifyOnExit, OProcess::AllOutput );
202 if ( !ret ) 204 if ( !ret )
203 { 205 {
204 QMessageBox::critical( this, tr( "Error" ), tr( "Error while getting time from network." ) ); 206 QMessageBox::critical( this, tr( "Error" ), tr( "Error while getting time from network." ) );
205 if ( ntpTabEnabled ) 207 if ( ntpTabEnabled )