summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp5
-rw-r--r--libkdepim/kpimglobalprefs.cpp3
-rw-r--r--libkdepim/kpimglobalprefs.h1
-rw-r--r--microkde/kdecore/klocale.cpp4
-rw-r--r--microkde/kdecore/klocale.h2
5 files changed, 12 insertions, 3 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 1eef150..332f975 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -310,32 +310,37 @@ void KDEPIMConfigWidget::setupTimeZoneTab()
mTimeZoneCombo->insertStringList(list);
// find the currently set time zone and select it
QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId;
int nCurrentlySet = 11;
for (int i = 0; i < mTimeZoneCombo->count(); i++)
{
if (mTimeZoneCombo->text(i) == sCurrentlySet)
{
nCurrentlySet = i;
break;
}
}
mTimeZoneCombo->setCurrentItem(nCurrentlySet);
int iii = 1;
KPrefsWidBool *sb =
+ addWidBool(i18n("Add 30 min (+00:30) to selected Timezone"),
+ &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame);
+ topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
+ ++iii;
+ sb =
addWidBool(i18n("Timezone has daylight saving"),
&(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame);
topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
++iii;
QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
topLayout->addMultiCellWidget(lab, iii,iii,0,1);
++iii;
lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
topLayout->addMultiCellWidget(lab, iii,iii,0,1);
++iii;
lab = new QLabel( i18n("Daylight start:"), topFrame );
topLayout->addWidget(lab, iii,0);
mStartDateSavingEdit = new KDateEdit(topFrame);
topLayout->addWidget(mStartDateSavingEdit, iii,1);
++iii;
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 5081b26..04e2072 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -46,32 +46,33 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
{
KPrefs::setCurrentGroup("Locale");
addItemInt("PreferredLanguage",&mPreferredLanguage,0);
addItemInt("PreferredTime",&mPreferredTime,0);
addItemInt("PreferredDate",&mPreferredDate,0);
addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false);
//addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false);
// addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y");
addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y");
KPrefs::setCurrentGroup("Time & Date");
addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") );
addItemBool("UseDaylightsaving",&mUseDaylightsaving,true);
+ addItemBool("TimeZoneAdd30min",&mTimeZoneAdd30min,false);
addItemInt("DaylightsavingStart",&mDaylightsavingStart,90);
addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304);
KPrefs::setCurrentGroup( "ExternalApplications" );
addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC );
addItemString( "EmailChannel", &mEmailOtherChannel, "" );
addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" );
addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" );
addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" );
addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" );
addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC );
addItemString( "PhoneChannel", &mPhoneOtherChannel, "" );
addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" );
addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" );
@@ -105,33 +106,33 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
void KPimGlobalPrefs::setGlobalConfig()
{
KGlobal::locale()->setHore24Format( !mPreferredTime );
KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday );
KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate );
KGlobal::locale()->setLanguage( mPreferredLanguage );
QString dummy = mUserDateFormatLong;
KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
dummy = mUserDateFormatShort;
KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
KGlobal::locale()->setDaylightSaving( mUseDaylightsaving,
mDaylightsavingStart,
mDaylightsavingEnd );
- KGlobal::locale()->setTimezone( mTimeZoneId );
+ KGlobal::locale()->setTimezone( mTimeZoneId, mTimeZoneAdd30min );
}
KPimGlobalPrefs::~KPimGlobalPrefs()
{
//qDebug("KPimGlobalPrefs::~KPimGlobalPrefs() ");
writeConfig();
}
KPimGlobalPrefs *KPimGlobalPrefs::instance()
{
if ( !sInstance ) {
sInstance = staticDeleter.setObject( new KPimGlobalPrefs() );
sInstance->readConfig();
}
return sInstance;
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h
index f6b6628..7c55099 100644
--- a/libkdepim/kpimglobalprefs.h
+++ b/libkdepim/kpimglobalprefs.h
@@ -83,32 +83,33 @@ class KPimGlobalPrefs : public KPrefs
static KPimGlobalPrefs *sInstance;
public:
//US I copied the following "locale" settings from KOPrefs
int mPreferredDate;
QString mUserDateFormatLong;
QString mUserDateFormatShort;
int mPreferredLanguage;
int mPreferredTime;
bool mWeekStartsOnSunday;
QString mTimeZoneId;
bool mUseDaylightsaving;
int mDaylightsavingStart;
int mDaylightsavingEnd;
+ bool mTimeZoneAdd30min;
int mEmailClient;
QString mEmailOtherChannel;
QString mEmailOtherMessage;
QString mEmailOtherMessageParameters;
QString mEmailOtherMessage2;
QString mEmailOtherMessageParameters2;
int mPhoneClient;
QString mPhoneOtherChannel;
QString mPhoneOtherMessage;
QString mPhoneOtherMessageParameters;
int mFaxClient;
QString mFaxOtherChannel;
QString mFaxOtherMessage;
diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp
index 27acfec..673d845 100644
--- a/microkde/kdecore/klocale.cpp
+++ b/microkde/kdecore/klocale.cpp
@@ -806,35 +806,37 @@ KCalendarSystem *KLocale::calendar()
return mCalendarSystem;
}
int KLocale::timezoneOffset( QString timeZone )
{
int ret = 1001;
int index = mTimeZoneList.findIndex( timeZone );
if ( index < 24 )
ret = ( index-11 ) * 60 ;
return ret;
}
QStringList KLocale::timeZoneList() const
{
return mTimeZoneList;
}
-void KLocale::setTimezone( const QString &timeZone )
+void KLocale::setTimezone( const QString &timeZone, bool oddTZ )
{
mTimeZoneOffset = timezoneOffset( timeZone );
+ if ( oddTZ )
+ mTimeZoneOffset += 30;
}
void KLocale::setDaylightSaving( bool b, int start , int end )
{
daylightEnabled = b;
daylightStart = start;
daylightEnd = end;
mSouthDaylight = (end < start);
// qDebug("klocale daylight %d %d %d ", b, start , end );
}
int KLocale::localTimeOffset( const QDateTime &dt )
{
bool addDaylight = false;
if ( daylightEnabled ) {
int d_end, d_start;
diff --git a/microkde/kdecore/klocale.h b/microkde/kdecore/klocale.h
index 5783530..be9442c 100644
--- a/microkde/kdecore/klocale.h
+++ b/microkde/kdecore/klocale.h
@@ -82,33 +82,33 @@ class KLocale
void setLanguage( int );
void setDateFormat( QString );
void setDateFormatShort( QString );
QString m_decimalSymbol;
QString m_thousandsSeparator;
QString m_currencySymbol;
QString m_monetaryDecimalSymbol;
QString m_monetaryThousandsSeparator;
QString m_positiveSign;
QString m_negativeSign;
int timezoneOffset( QString );
QStringList timeZoneList() const;
void setDaylightSaving( bool, int , int );
int localTimeOffset(const QDateTime &);
- void setTimezone( const QString &timeZone );
+ void setTimezone( const QString &timeZone , bool oddTZ);
private:
QTime readTime(const QString &str, bool seconds, bool *ok) const;
QDate readDate(const QString &str, bool shortFormat, bool *ok) const;
KCalendarSystem *mCalendarSystem;
bool mWeekStartsMonday;
bool mHourF24Format;
IntDateFormat mIntDateFormat;
IntDateFormat mIntTimeFormat;
int mLanguage;
QString mDateFormat;
QString mDateFormatShort;
QStringList mTimeZoneList;
bool daylightEnabled;
int mDaylightTZoffset;
int mNondaylightTZoffset;
bool mSouthDaylight;