00001 /* 00002 This file is part of the Opie Project 00003 00004 Copyright (C) Opie Team <opie-devel@handhelds.org> 00005 =. 00006 .=l. 00007 .>+-= 00008 _;:, .> :=|. This program is free software; you can 00009 .> <`_, > . <= redistribute it and/or modify it under 00010 :`=1 )Y*s>-.-- : the terms of the GNU Library General Public 00011 .="- .-=="i, .._ License as published by the Free Software 00012 - . .-<_> .<> Foundation; either version 2 of the License, 00013 ._= =} : or (at your option) any later version. 00014 .%`+i> _;_. 00015 .i_,=:_. -<s. This program is distributed in the hope that 00016 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 00017 : .. .:, . . . without even the implied warranty of 00018 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 00019 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 00020 ..}^=.= = ; Library General Public License for more 00021 ++= -. .` .: details. 00022 : = ...= . :.=- 00023 -. .:....=;==+<; You should have received a copy of the GNU 00024 -_. . . )=. = Library General Public License along with 00025 -- :-=` this library; see the file COPYING.LIB. 00026 If not, write to the Free Software Foundation, 00027 Inc., 59 Temple Place - Suite 330, 00028 Boston, MA 02111-1307, USA. 00029 */ 00030 00031 #ifndef MAINWINDOW_H 00032 #define MAINWINDOW_H 00033 00034 #include <qdialog.h> 00035 00036 #include <opie2/oprocess.h> 00037 #include <opie2/otabwidget.h> 00038 00039 class TimeTabWidget; 00040 class FormatTabWidget; 00041 class SettingsTabWidget; 00042 class NTPTabWidget; 00043 class PredictTabWidget; 00044 00045 00046 class QDateTime; 00047 class QSocket; 00048 class QTimer; 00049 00050 class MainWindow : public QDialog 00051 { 00052 Q_OBJECT 00053 00054 public: 00055 MainWindow( QWidget *parent = 0, const char *name = 0, bool modal = FALSE,WFlags f = 0); 00056 ~MainWindow(); 00057 static QString appName() { return QString::fromLatin1("systemtime"); } 00058 00059 protected: 00060 void accept(); 00061 void reject(); 00062 00063 private: 00064 Opie::Ui::OTabWidget *mainWidget; 00065 00066 TimeTabWidget *timeTab; 00067 FormatTabWidget *formatTab; 00068 SettingsTabWidget *settingsTab; 00069 NTPTabWidget *ntpTab; 00070 PredictTabWidget *predictTab; 00071 00072 bool ntpTabEnabled; 00073 bool predictTabEnabled; 00074 00075 Opie::Core::OProcess *ntpProcess; 00076 QTimer *ntpTimer; 00077 QSocket *ntpSock; 00078 int ntpDelay; 00079 bool ntpInteractive; 00080 QString ntpOutput; 00081 int _lookupDiff; 00082 00083 void runNTP(); 00084 bool ntpDelayElapsed(); 00085 00086 private slots: 00087 void slotSetTime( const QDateTime & ); 00088 void slotQCopReceive( const QCString &, const QByteArray & ); 00089 void slotDisplayNTPTab( bool ); 00090 void slotDisplayPredictTab( bool ); 00091 void slotGetNTPTime(); 00092 void slotTimerGetNTPTime(); 00093 void slotProbeNTPServer(); 00094 void slotNtpOutput( Opie::Core::OProcess *, char *, int ); 00095 void slotNtpFinished( Opie::Core::OProcess* ); 00096 void slotNTPDelayChanged( int ); 00097 void slotCheckNtp( int ); 00098 }; 00099 00100 #endif
1.4.2