summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-22 03:08:05 (UTC)
committer zautrix <zautrix>2004-09-22 03:08:05 (UTC)
commitd63eac7a612a9724705bc58ad98c65c6ac052d07 (patch) (side-by-side diff)
treedc584a0ddcbd5f828ea36b86b6af640e46e137f2
parent633522024e48efc423155a04b71083a03696211d (diff)
downloadkdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.zip
kdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.tar.gz
kdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.tar.bz2
connected global config
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/mainembedded.cpp15
-rw-r--r--kmicromail/libmailwrapper/genericwrapper.cpp18
-rw-r--r--kmicromail/opiemail.cpp2
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--korganizer/koprefs.cpp2
-rw-r--r--korganizer/koprefsdialog.cpp102
-rw-r--r--korganizer/mainwindow.cpp2
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp2
-rw-r--r--libkdepim/kpimglobalprefs.cpp17
-rw-r--r--libkdepim/kpimglobalprefs.h4
10 files changed, 90 insertions, 78 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 10b1013..965fb06 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,41 +1,42 @@
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#include <stdlib.h>
#else
#include <qapplication.h>
#include <qwindowsstyle.h>
#include <qplatinumstyle.h>
#include <qmainwindow.h>
#endif
#include <kstandarddirs.h>
#include <qregexp.h>
#include <kglobal.h>
#include <stdio.h>
#include <qdir.h>
#include "kaddressbookmain.h"
#include "externalapphandler.h"
+#include <libkdepim/kpimglobalprefs.h>
int main( int argc, char **argv )
{
#ifndef DESKTOP_VERSION
QPEApplication a( argc, argv );
a.setKeepRunning ();
#else
QApplication a( argc, argv );
QApplication::setStyle( new QPlatinumStyle ());
QString hdir = QDir::homeDirPath();
// there is a bug when creating dirs for WIN 98
// it is difficult to fix, because we have no WIN 98 runnung
// such that we try it to create the dirs at startup here
if ( hdir == "C:\\" ) { // win 98 or ME
QDir app_dir;
if ( !app_dir.exists("C:\\kdepim") )
app_dir.mkdir ("C:\\kdepim");
if ( !app_dir.exists("C:\\kdepim\\apps") )
app_dir.mkdir ("C:\\kdepim\\apps");
if ( !app_dir.exists("C:\\kdepim\\config") )
app_dir.mkdir ("C:\\kdepim\\config");
if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") )
app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook");
}
@@ -52,61 +53,49 @@ int main( int argc, char **argv )
exitHelp = true;
}
}
if ( ! exitHelp ) {
KGlobal::setAppName( "kaddressbook" );
#ifndef DESKTOP_VERSION
if ( QApplication::desktop()->width() > 320 )
KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
else
KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
#else
QString fileName ;
fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
QApplication::addLibraryPath ( qApp->applicationDirPath () );
#endif
KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
KAddressBookMain m ;
//US MainWindow m;
QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
{
- KConfig kon ( locateLocal( "config", "korganizerrc" ) );
- kon.setGroup("Locale");
- KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) );
- QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( "");
- KGlobal::locale()->setHore24Format( !kon.readNumEntry( "PreferredTime",0 ) );
- KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
- dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" );
- KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
- kon.setGroup("Time & Date");
- KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ),
- kon.readNumEntry( "DaylightsavingStart", 90),
- kon.readNumEntry( "DaylightsavingEnd",304) );
- KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") );
+ KPimGlobalPrefs::instance()->setGlobalConfig();
}
#ifndef DESKTOP_VERSION
a.showMainWidget( &m );
#else
a.setMainWidget( &m );
m.resize (640, 480 );
m.show();
#endif
a.exec();
}
qDebug("KA: Bye! ");
}
/*
#include <stdlib.h>
#include <qstring.h>
#include <kabc/stdaddressbook.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <kcrash.h>
#include <kdebug.h>
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp
index 09a6447..e691082 100644
--- a/kmicromail/libmailwrapper/genericwrapper.cpp
+++ b/kmicromail/libmailwrapper/genericwrapper.cpp
@@ -8,67 +8,49 @@
#include <kstandarddirs.h>
using namespace Opie::Core;
Genericwrapper::Genericwrapper()
: AbstractMail()
{
bodyCache.clear();
m_storage = 0;
m_folder = 0;
}
Genericwrapper::~Genericwrapper()
{
if (m_folder) {
mailfolder_free(m_folder);
}
if (m_storage) {
mailstorage_free(m_storage);
}
cleanMimeCache();
}
const QDateTime Genericwrapper::parseDateTime( mailimf_date_time *date )
{
- static bool init = false ;
- if ( ! init ) {
- KConfig kon ( locateLocal( "config", "korganizerrc" ) );
- kon.setGroup("Locale");
- KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) );
- QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( "");
- KGlobal::locale()->setHore24Format( !kon.readNumEntry( "PreferredTime",0 ) );
- KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
- dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" );
- KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
- kon.setGroup("Time & Date");
- KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ),
- kon.readNumEntry( "DaylightsavingStart", 90),
- kon.readNumEntry( "DaylightsavingEnd",304) );
- KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") );
-
- init = true;
- }
QDate da (date->dt_year,date->dt_month, date->dt_day );
QTime ti ( date->dt_hour, date->dt_min, date->dt_sec );
QDateTime dt ( da ,ti );
int addsec = -date->dt_zone*36;
//qDebug("adsec1 %d ",addsec );
dt = dt.addSecs( addsec );
int off = KGlobal::locale()->localTimeOffset( dt );
//qDebug("adsec2 %d ",off*60 );
dt = dt.addSecs( off*60 );
return dt;
#if 0
QString ret;
if ( dt.date() == QDate::currentDate () )
ret = KGlobal::locale()->formatTime( dt.time(),true);
else {
ret = KGlobal::locale()->formatDateTime( dt,true,true);
}
#endif
#if 0
if ( off < 0 )
ret += " -";
else
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 9a1a750..164988c 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -1,58 +1,60 @@
// CHANGED 2004-09-31 Lutz Rogowski
// CHANGED 2004-08-06 Lutz Rogowski
#include "settingsdialog.h"
#include "opiemail.h"
#include "editaccounts.h"
#include "composemail.h"
#include "mailistviewitem.h"
#include "viewmail.h"
#include "selectstore.h"
#include "selectsmtp.h"
#include "accountitem.h"
#include "koprefsdialog.h"
#include <qmessagebox.h>
#include <qtimer.h>
#include <libkdepim/externalapphandler.h>
+#include <libkdepim/kpimglobalprefs.h>
#include <qpe/qpeapplication.h>
#include <libmailwrapper/smtpwrapper.h>
#include <libmailwrapper/mailtypes.h>
#include <libmailwrapper/abstractmail.h>
/* OPIE */
//#include <qpe/resource.h>
//#include <qpe/qpeapplication.h>
/* QT */
//using namespace Opie::Core;
OpieMail::OpieMail( QWidget *parent, const char *name )
: MainWindow( parent, name) //, WStyle_ContextHelp )
{
settings = new Settings();
+ KPimGlobalPrefs::instance()->setGlobalConfig();
folderView->populate( settings->getAccounts() );
}
OpieMail::~OpieMail()
{
if (settings) delete settings;
}
void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
{
}
#include <stdlib.h>
void OpieMail::message(const QCString &msg, const QByteArray &data)
{
// copied from old mail2
static int ii = 0;
//qDebug("QCOP CALL ############################# %d ", ii);
//QString mess ( msg );
//qDebug("Message = %s ",mess.latin1());
++ii;
//qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this);
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index bc8625d..3635cfa 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -42,48 +42,49 @@
#include <qtimer.h>
#include <qwidgetstack.h>
#include <qptrlist.h>
#include <qregexp.h>
#include <qgroupbox.h>
#include <qfile.h>
#include <qdir.h>
#ifndef KORG_NOSPLITTER
#include <qsplitter.h>
#endif
#include <kglobal.h>
#include <kdebug.h>
#include <kstandarddirs.h>
#include <kfiledialog.h>
#include <kmessagebox.h>
#include <knotifyclient.h>
#include <kconfig.h>
#include <libkdepim/ksyncprefsdialog.h>
#include <krun.h>
#include <kdirwatch.h>
#include <libkdepim/kdatepicker.h>
#include <libkdepim/ksyncprofile.h>
+#include <libkdepim/kpimglobalprefs.h>
#include <libkcal/vcaldrag.h>
#include <libkcal/icaldrag.h>
#include <libkcal/icalformat.h>
#include <libkcal/vcalformat.h>
#include <libkcal/scheduler.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/journal.h>
#include <libkcal/calfilter.h>
#include <libkcal/attendee.h>
#include <libkcal/dndfactory.h>
#include <libkcal/freebusy.h>
#include <libkcal/filestorage.h>
#include <libkcal/calendarresources.h>
#include <libkcal/qtopiaformat.h>
#include "../kalarmd/alarmdialog.h"
#ifndef DESKTOP_VERSION
#include <libkcal/sharpformat.h>
#endif
#include <libkcal/phoneformat.h>
#ifndef KORG_NOMAIL
#include "komailclient.h"
#endif
@@ -1865,60 +1866,63 @@ void CalendarView::goToday()
{
mNavigator->selectToday();
}
void CalendarView::goNext()
{
mNavigator->selectNext();
}
void CalendarView::goPrevious()
{
mNavigator->selectPrevious();
}
void CalendarView::goNextMonth()
{
mNavigator->selectNextMonth();
}
void CalendarView::goPreviousMonth()
{
mNavigator->selectPreviousMonth();
}
void CalendarView::writeLocale()
{
+ //KPimGlobalPrefs::instance()->setGlobalConfig();
+#if 0
KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime );
KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday );
KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate );
KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage );
QString dummy = KOPrefs::instance()->mUserDateFormatLong;
KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
dummy = KOPrefs::instance()->mUserDateFormatShort;
KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving,
KOPrefs::instance()->mDaylightsavingStart,
KOPrefs::instance()->mDaylightsavingEnd );
KGlobal::locale()->setTimezone( KOPrefs::instance()->mTimeZoneId );
+#endif
}
void CalendarView::updateConfig()
{
writeLocale();
if ( KOPrefs::instance()->mUseAppColors )
QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
emit configChanged();
mTodoList->updateConfig();
// mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
mCalendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId);
// To make the "fill window" configurations work
//mViewManager->raiseCurrentView();
}
void CalendarView::eventChanged(Event *event)
{
changeEventDisplay(event,KOGlobals::EVENTEDITED);
//updateUnmanagedViews();
}
void CalendarView::eventAdded(Event *event)
{
changeEventDisplay(event,KOGlobals::EVENTADDED);
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index dd978bf..5d7db4f 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -20,48 +20,49 @@
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <time.h>
#ifndef _WIN32_
#include <unistd.h>
#endif
#include <qdir.h>
#include <qtextstream.h>
#include <qtextcodec.h>
#include <qstring.h>
#include <qregexp.h>
#include <qfont.h>
#include <qcolor.h>
#include <qstringlist.h>
#include <stdlib.h>
#include <kglobal.h>
#include <kconfig.h>
#include <klocale.h>
#include <kdebug.h>
#include <kemailsettings.h>
#include <kstaticdeleter.h>
+#include <libkdepim/kpimglobalprefs.h>
#include "koprefs.h"
#include "mainwindow.h"
const char *germanwords[][2] = {
#include "wordsgerman.h"
"", ""
};
KOPrefs *KOPrefs::mInstance = 0;
static KStaticDeleter<KOPrefs> insd;
KOPrefs::KOPrefs() :
KPimPrefs("korganizerrc")
{
mCategoryColors.setAutoDelete(true);
mLocaleDict = 0;
fillMailDefaults();
mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
QColor defaultHolidayColor = QColor(255,0,0);
QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
QColor defaultTodoDueTodayColor = QColor(255,220,100);
@@ -369,48 +370,49 @@ void KOPrefs::setCategoryDefaults()
QStringList::Iterator it;
for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
setCategoryColor(*it,mDefaultCategoryColor);
}
}
QStringList KOPrefs::getDefaultList()
{
QStringList retval ;
retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer")
<< i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner")
<< i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts")
<< i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids")
<< i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel")
<< i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping")
<< i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University")
<< i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ;
retval.sort();
return retval;
}
void KOPrefs::usrReadConfig()
{
+ mPreferredLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
mLocaleDict = 0;
// pending LR fix translation
// qDebug("KOPrefs::usrReadConfig() fix translation ");
if ( mPreferredLanguage > 0 && mPreferredLanguage < 4 ) {
if ( mPreferredLanguage == 1 ) {
mLocaleDict = new QDict<QString>;
int i = 0;
QString fw ( germanwords[i] [0]);
while ( !fw.isEmpty() ) {
mLocaleDict->insert( fw, new QString (germanwords[i] [1] ));
++i;
fw = germanwords[i] [0];
}
setLocaleDict( mLocaleDict );
} else {
QString fileName ;
if ( mPreferredLanguage == 3 )
fileName = MainWindow::resourcePath()+"usertranslation.txt";
else if ( mPreferredLanguage == 2 )
fileName = MainWindow::resourcePath()+"frenchtranslation.txt";
QFile file( fileName );
if (file.open( IO_ReadOnly ) ) {
QTextStream ts( &file );
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 7dafcd8..b4b3b27 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -60,77 +60,78 @@
#if defined(USE_SOLARIS)
#include <sys/param.h>
#define ZONEINFODIR "/usr/share/lib/zoneinfo"
#define INITFILE "/etc/default/init"
#endif
#include "koprefs.h"
#include "koprefsdialog.h"
#include "kpimglobalprefs.h"
KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
KPrefsDialog(KOPrefs::instance(),parent,name,true)
{
setCaption( i18n("Preferences - some settings need a restart (nr)"));
mCategoryDict.setAutoDelete(true);
KGlobal::locale()->insertCatalogue("timezones");
setupGlobalTab();
setupMainTab();
- setupLocaleTab();
- setupTimeZoneTab();
+ // setupLocaleTab();
+ //setupTimeZoneTab();
setupTimeTab();
- setupLocaleDateTab();
+ //setupLocaleDateTab();
setupFontsTab();
setupColorsTab();
setupViewsTab();
//setupSyncTab();
//setupSyncAlgTab();
//setupPrinterTab();
//setupGroupSchedulingTab();
//setupGroupAutomationTab();
}
KOPrefsDialog::~KOPrefsDialog()
{
}
void KOPrefsDialog::setupGlobalTab()
{
QFrame *topFrame = addPage(i18n("Global"),0,0);
kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" );
QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
topLayout->addWidget( kdelibcfg );
}
void KOPrefsDialog::setupLocaleDateTab()
{
+#if 0
QFrame *topFrame = addPage(i18n("Date Format"),0,0);
QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
int iii = 0;
KPrefsDialogWidRadios *syncPrefsGroup =
addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
QString format;
if ( QApplication::desktop()->width() < 480 )
format = "(%d.%m.%Y)";
else
format = "(%d.%m.%Y|%A %d %B %Y)";
syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
if ( QApplication::desktop()->width() < 480 )
format = "(%m.%d.%Y)";
else
format = "(%m.%d.%Y|%A %B %d %Y)";
syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
if ( QApplication::desktop()->width() < 480 )
format = "(%Y-%m-%d)";
else
format = "(%Y-%m-%d|%A %Y %B %d)";
@@ -138,53 +139,55 @@ QFrame *topFrame = addPage(i18n("Date Format"),0,0);
syncPrefsGroup->addRadio(i18n("User defined"));
topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
++iii;
++iii;
QLabel * lab;
mUserDateFormatLong = new QLineEdit(topFrame);
lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
topLayout->addWidget(lab ,iii,0);
topLayout->addWidget(mUserDateFormatLong,iii,1);
++iii;
mUserDateFormatShort = new QLineEdit(topFrame);
lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
topLayout->addWidget(lab ,iii,0);
topLayout->addWidget(mUserDateFormatShort,iii,1);
++iii;
lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
++iii;
lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
++iii;
lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
++iii;
+#endif
}
void KOPrefsDialog::setupLocaleTab()
{
+#if 0
QFrame *topFrame = addPage(i18n("Locale"),0,0);
QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
int iii = 0;
KPrefsDialogWidRadios *syncPrefsGroup =
addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
syncPrefsGroup->addRadio(i18n("English"));
syncPrefsGroup->addRadio(i18n("German"));
syncPrefsGroup->addRadio(i18n("French"));
syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
if ( QApplication::desktop()->width() < 300 )
;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
++iii;
syncPrefsGroup =
addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
if ( QApplication::desktop()->width() > 300 )
syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
syncPrefsGroup->addRadio(i18n("24:00"));
syncPrefsGroup->addRadio(i18n("12:00am"));
syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
@@ -202,48 +205,49 @@ void KOPrefsDialog::setupLocaleTab()
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
}
else {
QWidget * hb = new QWidget( topFrame );
QHBoxLayout *hbLayout = new QHBoxLayout(hb);
sb =
addWidBool(i18n("Week starts on Sunday"),
&(KOPrefs::instance()->mWeekStartsOnSunday),hb);
hbLayout->addWidget(sb->checkBox() );
sb =
addWidBool(i18n("Use short date in (WN/E) view"),
&(KOPrefs::instance()->mShortDateInViewer),hb);
hbLayout->addWidget(sb->checkBox() );
topLayout->addMultiCellWidget(hb, iii,iii,0,1);
}
// KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
#if 0
++iii;
sb =
addWidBool(i18n("Quick load/save (w/o Unicode)"),
&(KOPrefs::instance()->mUseQuicksave),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
#endif
+#endif
}
void KOPrefsDialog::showSyncPage()
{
showPage ( 2 ) ;
}
void KOPrefsDialog::setupSyncAlgTab()
{
#if 0
QLabel * lab;
QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0);
mSetupSyncAlgTab = topFrame;
QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
int iii = 0;
KPrefsDialogWidBool *sb =
addWidBool(i18n("Ask for preferences before syncing"),
&(KOPrefs::instance()->mAskForPreferences),topFrame);
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
++iii;
@@ -602,63 +606,48 @@ void KOPrefsDialog::setupViewsTab()
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Use light color for highlight current day"),
&(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
KPrefsDialogWidBool *dailyRecur =
addWidBool(i18n("Show events that recur daily in date nav."),
&(KOPrefs::instance()->mDailyRecur),topFrame);
topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
KPrefsDialogWidBool *weeklyRecur =
addWidBool(i18n("Show ev. that recur weekly in date nav."),
&(KOPrefs::instance()->mWeeklyRecur),topFrame);
topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
if ( QApplication::desktop()->width() > 640 ) {
KPrefsDialogWidBool *enableToolTips =
addWidBool(i18n("Enable tooltips displaying summary of ev."),
&(KOPrefs::instance()->mEnableToolTips),topFrame);
topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
}
- KPrefsDialogWidBool *passwdk =
- addWidBool(i18n("Show parent To-Do's in What's Next view"),
- &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
- topLayout->addWidget(passwdk->checkBox(), ii++,0);
-
- passwdk =
- addWidBool(i18n("Show location in What's Next view"),
- &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
- topLayout->addWidget(passwdk->checkBox(), ii++,0);
-
- passwdk =
- addWidBool(i18n("Show Sync Events in WN/Agenda view"),
- &(KOPrefs::instance()->mShowSyncEvents),topFrame);
- topLayout->addWidget(passwdk->checkBox(), ii++,0);
-
KPrefsDialogWidBool *marcusBainsEnabled =
addWidBool(i18n("Show Marcus Bains line"),
&(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
// topLayout->addWidget(hourSizeGroup,ii++,0);
// topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
//topLayout->setRowStretch(11,1);
topFrame = addPage(i18n("ViewChange"),0,0);
// DesktopIcon("viewmag",KIcon::SizeMedium));
topLayout = new QGridLayout(topFrame,6,1);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
ii = 0;
@@ -778,48 +767,74 @@ void KOPrefsDialog::setupViewsTab()
topLayout->addWidget(dummy->checkBox(),ii++,0);
coloredCategoriesInMonthView =
addWidBool(i18n("Month view uses day colors"),
&(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
KPrefsDialogWidColor *holidayColor =
addWidColor(i18n("Day color odd months"),
&(KOPrefs::instance()->mMonthViewOddColor),topFrame);
topLayout->addWidget(holidayColor->label(),ii,0);
topLayout->addWidget(holidayColor->button(),ii++,1);
holidayColor =
addWidColor(i18n("Day color even months"),
&(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
topLayout->addWidget(holidayColor->label(),ii,0);
topLayout->addWidget(holidayColor->button(),ii++,1);
holidayColor =
addWidColor(i18n("Color for Sundays + category \"Holiday\""),
&(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
topLayout->addWidget(holidayColor->label(),ii,0);
topLayout->addWidget(holidayColor->button(),ii++,1);
+ // *********************** What'sNext View
+ topFrame = addPage(i18n("What's Next View"),0,0);
+ // DesktopIcon("viewmag",KIcon::SizeMedium));
+
+ topLayout = new QGridLayout(topFrame,4,1);
+ topLayout->setSpacing(spacingHint());
+ topLayout->setMargin(marginHint());
+ ii = 0;
+ KPrefsDialogWidBool *passwdk =
+ addWidBool(i18n("Show parent To-Do's in What's Next view"),
+ &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
+ topLayout->addWidget(passwdk->checkBox(), ii++,0);
+
+ passwdk =
+ addWidBool(i18n("Show location in What's Next view"),
+ &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
+ topLayout->addWidget(passwdk->checkBox(), ii++,0);
+
+ passwdk =
+ addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"),
+ &(KOPrefs::instance()->mShowSyncEvents),topFrame);
+ topLayout->addWidget(passwdk->checkBox(), ii++,0);
+ passwdk =
+ addWidBool(i18n("Use short date in \nWhat's Next/Event view"),
+ &(KOPrefs::instance()->mShortDateInViewer),topFrame);
+ topLayout->addMultiCellWidget(passwdk->checkBox(), ii,ii,0,1);
// *********************** Todo View
topFrame = addPage(i18n("Todo View"),0,0);
// DesktopIcon("viewmag",KIcon::SizeMedium));
topLayout = new QGridLayout(topFrame,4,1);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
ii = 0;
KPrefsDialogWidBool *showCompletedTodo =
addWidBool(i18n("To-do view shows completed Todos"),
&(KOPrefs::instance()->mShowCompletedTodo),topFrame);
topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
dummy =
addWidBool(i18n("To-do view shows complete as 'xx %'"),
&(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
dummy =
addWidBool(i18n("Small To-do view uses smaller font"),
&(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
topLayout->addWidget(dummy->checkBox(),ii++,0);
@@ -1315,122 +1330,122 @@ void KOPrefsDialog::showPrinterTab()
void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
const QStringList *tags)
{
if (tags) {
int i = tags->findIndex(text);
if (i > 0) combo->setCurrentItem(i);
} else {
for(int i=0;i<combo->count();++i) {
if (combo->text(i) == text) {
combo->setCurrentItem(i);
break;
}
}
}
}
void KOPrefsDialog::usrReadConfig()
{
kdelibcfg->readConfig();
mNameEdit->setText(KOPrefs::instance()->fullName());
mEmailEdit->setText(KOPrefs::instance()->email());
mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
- QDate current ( 2001, 1,1);
- mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
- mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
- setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId));
+ // QDate current ( 2001, 1,1);
+ //mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
+ //mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
+ //setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId));
//mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
// if (KOPrefs::instance()->mAllDaySize > 47 )
// KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2;
//mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize);
mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
// mAMails->clear();
// for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
// QListViewItem *item = new QListViewItem(mAMails);
// item->setText(0,*it);
// mAMails->insertItem(item);
// }
// mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP);
//mRemoteUser->setText(KOPrefs::instance()->mRemoteUser);
//mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd);
//mRemoteFile->setText(KOPrefs::instance()->mRemoteFile);
//that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
- QString dummy = KOPrefs::instance()->mUserDateFormatLong;
- mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
- dummy = KOPrefs::instance()->mUserDateFormatShort;
- mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
+ //QString dummy = KOPrefs::instance()->mUserDateFormatLong;
+ //mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
+ //dummy = KOPrefs::instance()->mUserDateFormatShort;
+ //mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
updateCategories();
mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
}
void KOPrefsDialog::usrWriteConfig()
{
kdelibcfg->writeConfig();
// KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text();
//KOPrefs::instance()->mRemoteUser = mRemoteUser->text();
//KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text();
//KOPrefs::instance()->mRemoteFile= mRemoteFile->text();
//KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text();
KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
- KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
- KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
+ //KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
+ //KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
KOPrefs::instance()->setFullName(mNameEdit->text());
KOPrefs::instance()->setEmail(mEmailEdit->text());
KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
- KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText();
- QDate date;
- date = mStartDateSavingEdit->date();
- int sub = 0;
- if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
- sub = 1;
- KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub;
- date = mEndDateSavingEdit->date();
- if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
- sub = 1;
- else
- sub = 0;
- KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub;
- // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value();
+ // KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText();
+ //QDate date;
+ //date = mStartDateSavingEdit->date();
+ //int sub = 0;
+ //if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
+ // sub = 1;
+// KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub;
+// date = mEndDateSavingEdit->date();
+// if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
+// sub = 1;
+// else
+// sub = 0;
+// KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub;
+// // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value();
KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
//KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value();
QDictIterator<QColor> it(mCategoryDict);
while (it.current()) {
KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
++it;
}
KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
KOPrefs::instance()->mAdditionalMails.clear();
// QListViewItem *item;
// item = mAMails->firstChild();
// while (item)
// {
// KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
// item = item->nextSibling();
@@ -1536,48 +1551,49 @@ void KOPrefsDialog::updateInput()
void KOPrefsDialog::updateTimezoneOffset( int index )
{
/*
qDebug("updateTimezoneOffset %d ", index);
if ( index < 24 ) {
mTimezoneOffsetSpin->setEnabled ( false );
mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 );
} else {
if ( index == 24 ) {
mTimezoneOffsetSpin->setEnabled ( true );
mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
} else {
mTimezoneOffsetSpin->setEnabled ( false );
mTimezoneOffsetSpin->setValue( 0 );
}
}
*/
}
void KOPrefsDialog::setupTimeZoneTab()
{
+#if 0
QFrame *topFrame = addPage(i18n("Time Zone"),0,0);
// DesktopIcon("clock",KIcon::SizeMedium));
QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
topLayout->setSpacing(spacingHint());
topLayout->setMargin(marginHint());
QHBox *timeZoneBox = new QHBox( topFrame );
topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
new QLabel( i18n("Timezone:"), timeZoneBox );
mTimeZoneCombo = new QComboBox( timeZoneBox );
if ( QApplication::desktop()->width() < 300 ) {
mTimeZoneCombo->setMaximumWidth(150);
}
QStringList list;
list = KGlobal::locale()->timeZoneList();
mTimeZoneCombo->insertStringList(list);
// find the currently set time zone and select it
QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId;
int nCurrentlySet = 11;
for (int i = 0; i < mTimeZoneCombo->count(); i++)
@@ -1594,28 +1610,28 @@ void KOPrefsDialog::setupTimeZoneTab()
addWidBool(i18n("Timezone has daylight saving"),
&(KOPrefs::instance()->mUseDaylightsaving),topFrame);
topLayout->addMultiCellWidget(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;
lab = new QLabel( i18n("Daylight end:"), topFrame );
topLayout->addWidget(lab, iii,0);
mEndDateSavingEdit = new KDateEdit(topFrame);
topLayout->addWidget(mEndDateSavingEdit, iii,1);
++iii;
QDate current ( 2001, 1,1);
mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
-
+#endif
}
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index b597a6a..1c4a186 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -13,95 +13,97 @@
#include <qlabel.h>
#include <qmap.h>
#include <qwmatrix.h>
#include <qtextbrowser.h>
#include <qtextstream.h>
#ifndef DESKTOP_VERSION
#include <qpe/global.h>
#include <qpe/qpemenubar.h>
#include <qpe/qpetoolbar.h>
#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
#include <qtopia/alarmserver.h>
#include <qtopia/qcopenvelope_qws.h>
#else
#include <qmenubar.h>
#include <qtoolbar.h>
#include <qapplication.h>
//#include <resource.h>
#endif
#include <libkcal/calendarlocal.h>
#include <libkcal/todo.h>
#include <libkdepim/ksyncprofile.h>
#include <libkcal/kincidenceformatter.h>
+#include <libkdepim/kpimglobalprefs.h>
#include "calendarview.h"
#include "koviewmanager.h"
#include "datenavigator.h"
#include "koagendaview.h"
#include "koagenda.h"
#include "kodialogmanager.h"
#include "kdialogbase.h"
#include "kapplication.h"
#include "kofilterview.h"
#include "kstandarddirs.h"
#include "koprefs.h"
#include "kfiledialog.h"
#include "koglobals.h"
#include "kglobal.h"
#include "klocale.h"
#include "kconfig.h"
#include "simplealarmclient.h"
#include "externalapphandler.h"
using namespace KCal;
#ifndef _WIN32_
#include <unistd.h>
#else
#include "koimportoldialog.h"
#endif
#include "mainwindow.h"
int globalFlagBlockStartup;
MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
QMainWindow( parent, name )
{
#ifdef DESKTOP_VERSION
setFont( QFont("Arial"), 14 );
#endif
mClosed = false;
//QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
QString confFile = locateLocal("config","korganizerrc");
QFileInfo finf ( confFile );
bool showWarning = !finf.exists();
setIcon(SmallIcon( "ko24" ) );
mBlockAtStartup = true;
mFlagKeyPressed = false;
setCaption("KOrganizer/Pi");
KOPrefs *p = KOPrefs::instance();
+ KPimGlobalPrefs::instance()->setGlobalConfig();
// if ( QApplication::desktop()->height() > 480 ) {
// if ( p->mHourSize == 4 )
// p->mHourSize = 6;
// }
if ( p->mHourSize > 18 )
p->mHourSize = 18;
QMainWindow::ToolBarDock tbd;
if ( p->mToolBarHor ) {
if ( p->mToolBarUp )
tbd = Bottom;
else
tbd = Top;
}
else {
if ( p->mToolBarUp )
tbd = Right;
else
tbd = Left;
}
if ( KOPrefs::instance()->mUseAppColors )
QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
globalFlagBlockStartup = 1;
iconToolBar = new QPEToolBar( this );
addToolBar (iconToolBar , tbd );
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 00a07d9..2819ab1 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -723,49 +723,49 @@ void KDEPIMConfigWidget::usrWriteConfig()
prefs->mFaxClient = mFaxClient;
prefs->mFaxOtherChannel = mFaxOtherChannel;
prefs->mFaxOtherMessage = mFaxOtherMessage;
prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters;
prefs->mSMSClient = mSMSClient;
prefs->mSMSOtherChannel = mSMSOtherChannel;
prefs->mSMSOtherMessage = mSMSOtherMessage;
prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters;
prefs->mPagerClient = mPagerClient;
prefs->mPagerOtherChannel = mPagerOtherChannel;
prefs->mPagerOtherMessage = mPagerOtherMessage;
prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters;
prefs->mSipClient = mSipClient;
prefs->mSipOtherChannel = mSipOtherChannel;
prefs->mSipOtherMessage = mSipOtherMessage;
prefs->mSipOtherMessageParameters = mSipOtherMessageParameters;
//release the cache that other views can access the changed values instantanious
ExternalAppHandler::instance()->loadConfig();
-
+ KPimGlobalPrefs::instance()->setGlobalConfig();
}
void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text,
const QStringList *tags)
{
if (tags) {
int i = tags->findIndex(text);
if (i > 0) combo->setCurrentItem(i);
} else {
for(int i=0;i<combo->count();++i) {
if (combo->text(i) == text) {
combo->setCurrentItem(i);
break;
}
}
}
}
void KDEPIMConfigWidget::textChanged( const QString& text )
{
emit changed( true );
}
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 12a503d..a896a0f 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -79,37 +79,54 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" );
addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC );
addItemString( "FaxChannel", &mFaxOtherChannel, "" );
addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" );
addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" );
addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC );
addItemString( "SMSChannel", &mSMSOtherChannel, "" );
addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" );
addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" );
addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC );
addItemString( "PagerChannel", &mPagerOtherChannel, "" );
addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" );
addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" );
addItemInt( "SIPChannelType", &mSipClient, NONE_SIC );
addItemString( "SIPChannel", &mSipOtherChannel, "" );
addItemString( "SIPChannelMessage", &mSipOtherMessage, "" );
addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" );
}
+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 );
+
+}
KPimGlobalPrefs::~KPimGlobalPrefs()
{
}
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 dad78e6..84ba689 100644
--- a/libkdepim/kpimglobalprefs.h
+++ b/libkdepim/kpimglobalprefs.h
@@ -16,48 +16,49 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
/*
Enhanced Version of the file for platform independent KDE tools.
Copyright (c) 2004 Ulf Schenk
$Id$
*/
#ifndef KPIMGLOBALPREFS_H
#define KPIMGLOBALPREFS_H
#include "kprefs.h"
class KPimGlobalPrefs : public KPrefs
{
public:
+ void setGlobalConfig();
static KPimGlobalPrefs *instance();
virtual ~KPimGlobalPrefs();
enum EMailClients {
NONE_EMC = 0,
OTHER_EMC = 1,
OMPI_EMC = 2,
QTOPIA_EMC = 3,
OPIE_EMC = 4
};
enum PhoneClients {
NONE_PHC = 0,
OTHER_PHC = 1,
KPPI_PHC = 2
};
enum FaxClients {
NONE_FAC = 0,
OTHER_FAC = 1
};
@@ -75,51 +76,48 @@ class KPimGlobalPrefs : public KPrefs
enum SIPClients {
NONE_SIC = 0,
OTHER_SIC = 1
};
private:
KPimGlobalPrefs( const QString &name = QString::null );
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;
-
-
-
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;
QString mFaxOtherMessageParameters;
int mSMSClient;
QString mSMSOtherChannel;
QString mSMSOtherMessage;
QString mSMSOtherMessageParameters;
int mPagerClient;
QString mPagerOtherChannel;