-rw-r--r-- | noncore/settings/netsystemtime/timetabwidget.cpp | 9 |
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 @@ -51,4 +51,6 @@ #include <qscrollview.h> #include <qspinbox.h> +#include <qmessagebox.h> +#include <qfile.h> #include <stdlib.h> @@ -278,4 +280,10 @@ 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(); @@ -308,2 +316,3 @@ void TimeTabWidget::slotTZChanged( const QString &newtz ) emit tzChanged( newtz ); } +} |