summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/mainwindow.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/settings/netsystemtime/mainwindow.cpp b/noncore/settings/netsystemtime/mainwindow.cpp
index 306117a..ab71463 100644
--- a/noncore/settings/netsystemtime/mainwindow.cpp
+++ b/noncore/settings/netsystemtime/mainwindow.cpp
@@ -1,99 +1,98 @@
1/* 1/*
2                This file is part of the OPIE Project 2                This file is part of the OPIE Project
3 =. 3 =.
4             .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?> 4             .=l. Copyright (c) 2002 OPIE team <opie@handhelds.org?>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "mainwindow.h" 29#include "mainwindow.h"
30#include "timetabwidget.h" 30#include "timetabwidget.h"
31#include "formattabwidget.h" 31#include "formattabwidget.h"
32#include "settingstabwidget.h" 32#include "settingstabwidget.h"
33#include "ntptabwidget.h" 33#include "ntptabwidget.h"
34#include "predicttabwidget.h" 34#include "predicttabwidget.h"
35#include "systemtimeconfig.h"
36 35
37#include <opie/oprocess.h> 36#include <opie/oprocess.h>
38#include <opie/otabwidget.h> 37#include <opie/otabwidget.h>
39 38
40#include <qpe/config.h> 39#include <qpe/config.h>
41#include <qpe/datebookdb.h> 40#include <qpe/datebookdb.h>
42#include <qpe/qpeapplication.h> 41#include <qpe/qpeapplication.h>
43 42
44#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) 43#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
45#include <qpe/qcopenvelope_qws.h> 44#include <qpe/qcopenvelope_qws.h>
46#endif 45#endif
47 46
48#include <qlayout.h> 47#include <qlayout.h>
49#include <qmessagebox.h> 48#include <qmessagebox.h>
50#include <qsocket.h> 49#include <qsocket.h>
51#include <qstring.h> 50#include <qstring.h>
52#include <qtimer.h> 51#include <qtimer.h>
53 52
54MainWindow::MainWindow() 53MainWindow::MainWindow()
55 : QDialog( 0x0, 0x0, TRUE, 0 ) 54 : QDialog( 0x0, 0x0, TRUE, 0 )
56{ 55{
57 setCaption( tr( "SystemTime" ) ); 56 setCaption( tr( "SystemTime" ) );
58 57
59 QVBoxLayout *layout = new QVBoxLayout( this ); 58 QVBoxLayout *layout = new QVBoxLayout( this );
60 layout->setMargin( 2 ); 59 layout->setMargin( 2 );
61 layout->setSpacing( 4 ); 60 layout->setSpacing( 4 );
62 61
63 // Create main tabbed control 62 // Create main tabbed control
64 mainWidget = new OTabWidget( this ); 63 mainWidget = new OTabWidget( this );
65 64
66 // Default object pointers to null 65 // Default object pointers to null
67 ntpProcess = 0x0; 66 ntpProcess = 0x0;
68 ntpTab = 0x0; 67 ntpTab = 0x0;
69 68
70 // Add tab widgets 69 // Add tab widgets
71 mainWidget->addTab( timeTab = new TimeTabWidget( mainWidget ), "netsystemtime/DateTime", tr( "Time" ) ); 70 mainWidget->addTab( timeTab = new TimeTabWidget( mainWidget ), "netsystemtime/DateTime", tr( "Time" ) );
72 mainWidget->addTab( formatTab = new FormatTabWidget( mainWidget ), "netsystemtime/formattab", tr( "Format" ) ); 71 mainWidget->addTab( formatTab = new FormatTabWidget( mainWidget ), "netsystemtime/formattab", tr( "Format" ) );
73 mainWidget->addTab( settingsTab = new SettingsTabWidget( mainWidget ), "SettingsIcon", tr( "Settings" ) ); 72 mainWidget->addTab( settingsTab = new SettingsTabWidget( mainWidget ), "SettingsIcon", tr( "Settings" ) );
74 mainWidget->addTab( predictTab = new PredictTabWidget( mainWidget ), "netsystemtime/predicttab", tr( "Predict" ) ); 73 mainWidget->addTab( predictTab = new PredictTabWidget( mainWidget ), "netsystemtime/predicttab", tr( "Predict" ) );
75 Config config( "ntp" ); 74 Config config( "ntp" );
76 config.setGroup( "settings" ); 75 config.setGroup( "settings" );
77 slotDisplayNTPTab( config.readBoolEntry( "displayNtpTab", FALSE ) ); 76 slotDisplayNTPTab( config.readBoolEntry( "displayNtpTab", FALSE ) );
78 slotDisplayPredictTab( config.readBoolEntry( "displayPredictTab", FALSE ) ); 77 slotDisplayPredictTab( config.readBoolEntry( "displayPredictTab", FALSE ) );
79 78
80 mainWidget->setCurrentTab( tr( "Time" ) ); 79 mainWidget->setCurrentTab( tr( "Time" ) );
81 layout->addWidget( mainWidget ); 80 layout->addWidget( mainWidget );
82 81
83 // Create QCOP channel 82 // Create QCOP channel
84 QCopChannel *channel = new QCopChannel( "QPE/Application/netsystemtime", this ); 83 QCopChannel *channel = new QCopChannel( "QPE/Application/netsystemtime", this );
85 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 84 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
86 this, SLOT(slotQCopReceive(const QCString&, const QByteArray&)) ); 85 this, SLOT(slotQCopReceive(const QCString&, const QByteArray&)) );
87 86
88 // Create NTP socket 87 // Create NTP socket
89 ntpSock = new QSocket( this ); 88 ntpSock = new QSocket( this );
90 connect( ntpSock, SIGNAL(error(int)),SLOT(slotCheckNtp(int)) ); 89 connect( ntpSock, SIGNAL(error(int)),SLOT(slotCheckNtp(int)) );
91 slotProbeNTPServer(); 90 slotProbeNTPServer();
92 91
93 // Create timer for automatic time lookups 92 // Create timer for automatic time lookups
94 ntpTimer = new QTimer( this ); 93 ntpTimer = new QTimer( this );
95 94
96 // Connect everything together 95 // Connect everything together
97 connect( timeTab, SIGNAL(getNTPTime()), this, SLOT(slotGetNTPTime()) ); 96 connect( timeTab, SIGNAL(getNTPTime()), this, SLOT(slotGetNTPTime()) );
98 connect( timeTab, SIGNAL(tzChanged(const QString &)), predictTab, SLOT(slotTZChanged(const QString &)) ); 97 connect( timeTab, SIGNAL(tzChanged(const QString &)), predictTab, SLOT(slotTZChanged(const QString &)) );
99 connect( timeTab, SIGNAL(getPredictedTime()), predictTab, SLOT(slotSetPredictedTime()) ); 98 connect( timeTab, SIGNAL(getPredictedTime()), predictTab, SLOT(slotSetPredictedTime()) );