summaryrefslogtreecommitdiff
authorsandman <sandman>2002-10-29 22:09:37 (UTC)
committer sandman <sandman>2002-10-29 22:09:37 (UTC)
commit1e294abab44c96f1fdf4fe0e7083a19fbeb970e0 (patch) (unidiff)
treedaa27f50fcd27d00ef165e46a4ba948346fc7437
parent7c340d2a08601f4d27f6d2a407fc0de437b8efad (diff)
downloadopie-1e294abab44c96f1fdf4fe0e7083a19fbeb970e0.zip
opie-1e294abab44c96f1fdf4fe0e7083a19fbeb970e0.tar.gz
opie-1e294abab44c96f1fdf4fe0e7083a19fbeb970e0.tar.bz2
check if the system date is in a reasonable range (year > 2000) - inform
the user and optionally launch systemtime, if it's not (on iPAQs mostly because of battery drain)
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/main.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index 8974ced..715239f 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -31,6 +31,7 @@
31 31
32#include <opie/odevice.h> 32#include <opie/odevice.h>
33 33
34#include <qmessagebox.h>
34#include <qfile.h> 35#include <qfile.h>
35#include <qimage.h> 36#include <qimage.h>
36#include <qwindowsystem_qws.h> 37#include <qwindowsystem_qws.h>
@@ -117,6 +118,18 @@ int initApplication( int argc, char ** argv )
117 118
118 d->show(); 119 d->show();
119 120
121 if ( QDate::currentDate ( ). year ( ) < 2000 ) {
122 if ( QMessageBox::information ( 0, DesktopApplication::tr( "Information" ), DesktopApplication::tr( "<p>The system date doesn't seem to be valid.\n(%1)</p><p>Do you want to correct the clock ?</p>" ). arg( TimeString::dateString ( QDate::currentDate ( ))), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) {
123 QCString app;
124 if ( QFile::exists ( QPEApplication::qpeDir ( ) + "/bin/netsystemtime" ))
125 app = "netsystemtime";
126 else
127 app = "systemtime";
128 QCopEnvelope e ( "QPE/Application/" + app, "setDocument(QString)" );
129 e << QString ( );
130 }
131 }
132
120 int rv = a.exec(); 133 int rv = a.exec();
121 134
122 delete d; 135 delete d;