summaryrefslogtreecommitdiff
path: root/noncore
authorpaule <paule>2007-01-14 03:02:55 (UTC)
committer paule <paule>2007-01-14 03:02:55 (UTC)
commitca67251af3f46d685afac8dc6bfe452799c2546e (patch) (side-by-side diff)
tree3e7ae7ed8d06e97c5556b52c5cf3826426cedd9b /noncore
parent81de0baf254bd2d935d0fdf035143e5510354fa7 (diff)
downloadopie-ca67251af3f46d685afac8dc6bfe452799c2546e.zip
opie-ca67251af3f46d685afac8dc6bfe452799c2546e.tar.gz
opie-ca67251af3f46d685afac8dc6bfe452799c2546e.tar.bz2
When selecting a time zone, warn the user if the time zone file in /usr/share/zoneinfo for the selected time zone is missing
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/netsystemtime/timetabwidget.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/noncore/settings/netsystemtime/timetabwidget.cpp b/noncore/settings/netsystemtime/timetabwidget.cpp
index bcfbdf7..895514b 100644
--- a/noncore/settings/netsystemtime/timetabwidget.cpp
+++ b/noncore/settings/netsystemtime/timetabwidget.cpp
@@ -50,6 +50,8 @@
#include <qpushbutton.h>
#include <qscrollview.h>
#include <qspinbox.h>
+#include <qmessagebox.h>
+#include <qfile.h>
#include <stdlib.h>
#include <sys/time.h>
@@ -277,6 +279,12 @@ void TimeTabWidget::slotWeekStartChanged( int monday )
void TimeTabWidget::slotTZChanged( const QString &newtz )
{
+ // Check timezone has a valid file in /usr/share/zoneinfo
+ if(!QFile::exists("/usr/share/zoneinfo/" + newtz)) {
+ QMessageBox::warning(this, tr("Time zone file missing"),
+ (tr("There is no time zone file for the\nselected time zone (%1).\nYou will need to install it before the\nsystem time zone can be set correctly.")).arg(newtz));
+ }
+ else {
// If controls have a valid date & time, update systemtime
int hour = sbHour->value();
if ( use12HourTime && cbAmpm->currentItem() == ValuePM )
@@ -307,3 +315,4 @@ void TimeTabWidget::slotTZChanged( const QString &newtz )
emit tzChanged( newtz );
}
+}