summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore 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.cpp6
-rw-r--r--korganizer/koprefs.cpp2
-rw-r--r--korganizer/koprefsdialog.cpp106
-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, 93 insertions, 81 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 10b1013..965fb06 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,223 +1,212 @@
1#ifndef DESKTOP_VERSION 1#ifndef DESKTOP_VERSION
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <stdlib.h> 3#include <stdlib.h>
4#else 4#else
5#include <qapplication.h> 5#include <qapplication.h>
6#include <qwindowsstyle.h> 6#include <qwindowsstyle.h>
7#include <qplatinumstyle.h> 7#include <qplatinumstyle.h>
8#include <qmainwindow.h> 8#include <qmainwindow.h>
9#endif 9#endif
10 10
11#include <kstandarddirs.h> 11#include <kstandarddirs.h>
12#include <qregexp.h> 12#include <qregexp.h>
13#include <kglobal.h> 13#include <kglobal.h>
14#include <stdio.h> 14#include <stdio.h>
15#include <qdir.h> 15#include <qdir.h>
16#include "kaddressbookmain.h" 16#include "kaddressbookmain.h"
17#include "externalapphandler.h" 17#include "externalapphandler.h"
18#include <libkdepim/kpimglobalprefs.h>
18 19
19int main( int argc, char **argv ) 20int main( int argc, char **argv )
20{ 21{
21#ifndef DESKTOP_VERSION 22#ifndef DESKTOP_VERSION
22 QPEApplication a( argc, argv ); 23 QPEApplication a( argc, argv );
23 a.setKeepRunning (); 24 a.setKeepRunning ();
24#else 25#else
25 QApplication a( argc, argv ); 26 QApplication a( argc, argv );
26 QApplication::setStyle( new QPlatinumStyle ()); 27 QApplication::setStyle( new QPlatinumStyle ());
27 QString hdir = QDir::homeDirPath(); 28 QString hdir = QDir::homeDirPath();
28 // there is a bug when creating dirs for WIN 98 29 // there is a bug when creating dirs for WIN 98
29 // it is difficult to fix, because we have no WIN 98 runnung 30 // it is difficult to fix, because we have no WIN 98 runnung
30 // such that we try it to create the dirs at startup here 31 // such that we try it to create the dirs at startup here
31 if ( hdir == "C:\\" ) { // win 98 or ME 32 if ( hdir == "C:\\" ) { // win 98 or ME
32 QDir app_dir; 33 QDir app_dir;
33 if ( !app_dir.exists("C:\\kdepim") ) 34 if ( !app_dir.exists("C:\\kdepim") )
34 app_dir.mkdir ("C:\\kdepim"); 35 app_dir.mkdir ("C:\\kdepim");
35 if ( !app_dir.exists("C:\\kdepim\\apps") ) 36 if ( !app_dir.exists("C:\\kdepim\\apps") )
36 app_dir.mkdir ("C:\\kdepim\\apps"); 37 app_dir.mkdir ("C:\\kdepim\\apps");
37 if ( !app_dir.exists("C:\\kdepim\\config") ) 38 if ( !app_dir.exists("C:\\kdepim\\config") )
38 app_dir.mkdir ("C:\\kdepim\\config"); 39 app_dir.mkdir ("C:\\kdepim\\config");
39 if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") ) 40 if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") )
40 app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook"); 41 app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook");
41 } 42 }
42#endif 43#endif
43 44
44 bool exitHelp = false; 45 bool exitHelp = false;
45 if ( argc > 1 ) { 46 if ( argc > 1 ) {
46 QString command = argv[1]; 47 QString command = argv[1];
47 if ( command == "-help" ){ 48 if ( command == "-help" ){
48 printf("KA/E command line commands:\n"); 49 printf("KA/E command line commands:\n");
49 printf(" no command: Start KA/E in usual way\n"); 50 printf(" no command: Start KA/E in usual way\n");
50 printf(" -help: This output\n"); 51 printf(" -help: This output\n");
51 printf(" KA/E is exiting now. Bye!\n"); 52 printf(" KA/E is exiting now. Bye!\n");
52 exitHelp = true; 53 exitHelp = true;
53 } 54 }
54 } 55 }
55 if ( ! exitHelp ) { 56 if ( ! exitHelp ) {
56 57
57 KGlobal::setAppName( "kaddressbook" ); 58 KGlobal::setAppName( "kaddressbook" );
58#ifndef DESKTOP_VERSION 59#ifndef DESKTOP_VERSION
59 if ( QApplication::desktop()->width() > 320 ) 60 if ( QApplication::desktop()->width() > 320 )
60 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); 61 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
61 else 62 else
62 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); 63 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
63#else 64#else
64 QString fileName ; 65 QString fileName ;
65 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; 66 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
66 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 67 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
67 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 68 QApplication::addLibraryPath ( qApp->applicationDirPath () );
68 69
69#endif 70#endif
70 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); 71 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
71 KAddressBookMain m ; 72 KAddressBookMain m ;
72//US MainWindow m; 73//US MainWindow m;
73 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 74 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
74 75
75 { 76 {
76 KConfig kon ( locateLocal( "config", "korganizerrc" ) ); 77 KPimGlobalPrefs::instance()->setGlobalConfig();
77 kon.setGroup("Locale");
78 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) );
79 QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( "");
80 KGlobal::locale()->setHore24Format( !kon.readNumEntry( "PreferredTime",0 ) );
81 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
82 dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" );
83 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
84 kon.setGroup("Time & Date");
85 KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ),
86 kon.readNumEntry( "DaylightsavingStart", 90),
87 kon.readNumEntry( "DaylightsavingEnd",304) );
88 KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") );
89 } 78 }
90#ifndef DESKTOP_VERSION 79#ifndef DESKTOP_VERSION
91 a.showMainWidget( &m ); 80 a.showMainWidget( &m );
92#else 81#else
93 a.setMainWidget( &m ); 82 a.setMainWidget( &m );
94 m.resize (640, 480 ); 83 m.resize (640, 480 );
95 m.show(); 84 m.show();
96#endif 85#endif
97 a.exec(); 86 a.exec();
98 87
99 } 88 }
100 qDebug("KA: Bye! "); 89 qDebug("KA: Bye! ");
101} 90}
102 91
103/* 92/*
104#include <stdlib.h> 93#include <stdlib.h>
105 94
106#include <qstring.h> 95#include <qstring.h>
107 96
108#include <kabc/stdaddressbook.h> 97#include <kabc/stdaddressbook.h>
109#include <kaboutdata.h> 98#include <kaboutdata.h>
110#include <kcmdlineargs.h> 99#include <kcmdlineargs.h>
111#include <kcrash.h> 100#include <kcrash.h>
112#include <kdebug.h> 101#include <kdebug.h>
113#include <klocale.h> 102#include <klocale.h>
114#include <kstartupinfo.h> 103#include <kstartupinfo.h>
115#include <kuniqueapplication.h> 104#include <kuniqueapplication.h>
116#include <kwin.h> 105#include <kwin.h>
117 106
118#include "kaddressbookmain.h" 107#include "kaddressbookmain.h"
119#include "kabcore.h" 108#include "kabcore.h"
120 109
121extern "C" { 110extern "C" {
122 111
123void crashHandler( int ) 112void crashHandler( int )
124{ 113{
125 KABC::StdAddressBook::handleCrash(); 114 KABC::StdAddressBook::handleCrash();
126 ::exit( 0 ); 115 ::exit( 0 );
127} 116}
128 117
129} 118}
130 119
131class KAddressBookApp : public KUniqueApplication { 120class KAddressBookApp : public KUniqueApplication {
132 public: 121 public:
133 KAddressBookApp() : mMainWin( 0 ) {} 122 KAddressBookApp() : mMainWin( 0 ) {}
134 ~KAddressBookApp() {} 123 ~KAddressBookApp() {}
135 124
136 int newInstance(); 125 int newInstance();
137 126
138 private: 127 private:
139 KAddressBookMain *mMainWin; 128 KAddressBookMain *mMainWin;
140}; 129};
141 130
142int KAddressBookApp::newInstance() 131int KAddressBookApp::newInstance()
143{ 132{
144 if ( isRestored() ) { 133 if ( isRestored() ) {
145 // There can only be one main window 134 // There can only be one main window
146 if ( KMainWindow::canBeRestored( 1 ) ) { 135 if ( KMainWindow::canBeRestored( 1 ) ) {
147 mMainWin = new KAddressBookMain; 136 mMainWin = new KAddressBookMain;
148 mMainWin->show(); 137 mMainWin->show();
149 mMainWin->restore( 1 ); 138 mMainWin->restore( 1 );
150 } 139 }
151 } else { 140 } else {
152 KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); 141 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
153 142
154 QCString addrStr = args->getOption( "addr" ); 143 QCString addrStr = args->getOption( "addr" );
155 QCString uidStr = args->getOption( "uid" ); 144 QCString uidStr = args->getOption( "uid" );
156 QString addr; 145 QString addr;
157 QString uid; 146 QString uid;
158 if ( !addrStr.isEmpty() ) 147 if ( !addrStr.isEmpty() )
159 addr = QString::fromLocal8Bit( addrStr ); 148 addr = QString::fromLocal8Bit( addrStr );
160 if ( !uidStr.isEmpty() ) 149 if ( !uidStr.isEmpty() )
161 uid = QString::fromLocal8Bit( uidStr ); 150 uid = QString::fromLocal8Bit( uidStr );
162 151
163 152
164 if ( args->isSet( "editor-only" ) ) { 153 if ( args->isSet( "editor-only" ) ) {
165 if ( !mMainWin ) 154 if ( !mMainWin )
166 mMainWin = new KAddressBookMain; 155 mMainWin = new KAddressBookMain;
167 KStartupInfo::appStarted(); 156 KStartupInfo::appStarted();
168 mMainWin->hide(); 157 mMainWin->hide();
169 } else { 158 } else {
170 if ( mMainWin ) { 159 if ( mMainWin ) {
171 mMainWin->show(); 160 mMainWin->show();
172 KWin::setActiveWindow( mMainWin->winId() ); 161 KWin::setActiveWindow( mMainWin->winId() );
173 } else { 162 } else {
174 mMainWin = new KAddressBookMain; 163 mMainWin = new KAddressBookMain;
175 mMainWin->show(); 164 mMainWin->show();
176 } 165 }
177 } 166 }
178 // Can not see why anyone would pass both a uid and an email address, so I'll leave it that two contact editors will show if they do 167 // Can not see why anyone would pass both a uid and an email address, so I'll leave it that two contact editors will show if they do
179 if ( !addr.isEmpty() ) 168 if ( !addr.isEmpty() )
180 mMainWin->addEmail( addr ); 169 mMainWin->addEmail( addr );
181 170
182 if ( !uid.isEmpty() ) 171 if ( !uid.isEmpty() )
183 mMainWin->showContactEditor( uid ); 172 mMainWin->showContactEditor( uid );
184 if ( args->isSet( "new-contact" ) ) { 173 if ( args->isSet( "new-contact" ) ) {
185 mMainWin->newContact(); 174 mMainWin->newContact();
186 } 175 }
187 } 176 }
188 177
189 KCrash::setEmergencySaveFunction( crashHandler ); 178 KCrash::setEmergencySaveFunction( crashHandler );
190 179
191 return 0; 180 return 0;
192} 181}
193 182
194// the dummy argument is required, because KMail apparently sends an empty 183// the dummy argument is required, because KMail apparently sends an empty
195// argument. 184// argument.
196static KCmdLineOptions kmoptions[] = 185static KCmdLineOptions kmoptions[] =
197{ 186{
198 { "a", 0 , 0 }, 187 { "a", 0 , 0 },
199 { "addr <email>", I18N_NOOP( "Shows contact editor with given email address" ), 0 }, 188 { "addr <email>", I18N_NOOP( "Shows contact editor with given email address" ), 0 },
200 { "uid <uid>", I18N_NOOP( "Shows contact editor with given uid" ), 0 }, 189 { "uid <uid>", I18N_NOOP( "Shows contact editor with given uid" ), 0 },
201 { "editor-only", I18N_NOOP( "Launches in editor only mode" ), 0 }, 190 { "editor-only", I18N_NOOP( "Launches in editor only mode" ), 0 },
202 { "new-contact", I18N_NOOP( "Launches editor for the new contact" ), 0 }, 191 { "new-contact", I18N_NOOP( "Launches editor for the new contact" ), 0 },
203 { "+[argument]", I18N_NOOP( "dummy argument" ), 0}, 192 { "+[argument]", I18N_NOOP( "dummy argument" ), 0},
204 { 0, 0, 0} 193 { 0, 0, 0}
205}; 194};
206 195
207int main( int argc, char *argv[] ) 196int main( int argc, char *argv[] )
208{ 197{
209 KLocale::setMainCatalogue( "kaddressbook" ); 198 KLocale::setMainCatalogue( "kaddressbook" );
210 199
211 KCmdLineArgs::init( argc, argv, KABCore::createAboutData() ); 200 KCmdLineArgs::init( argc, argv, KABCore::createAboutData() );
212 KCmdLineArgs::addCmdLineOptions( kmoptions ); 201 KCmdLineArgs::addCmdLineOptions( kmoptions );
213 KUniqueApplication::addCmdLineOptions(); 202 KUniqueApplication::addCmdLineOptions();
214 203
215 if ( !KAddressBookApp::start() ) 204 if ( !KAddressBookApp::start() )
216 exit( 0 ); 205 exit( 0 );
217 206
218 KAddressBookApp app; 207 KAddressBookApp app;
219 KGlobal::locale()->insertCatalogue( "libkdepim" ); 208 KGlobal::locale()->insertCatalogue( "libkdepim" );
220 209
221 return app.exec(); 210 return app.exec();
222} 211}
223*/ 212*/
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
@@ -1,242 +1,224 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#include "genericwrapper.h" 2#include "genericwrapper.h"
3#include <libetpan/libetpan.h> 3#include <libetpan/libetpan.h>
4#include "mailtypes.h" 4#include "mailtypes.h"
5 5
6#include <kconfig.h> 6#include <kconfig.h>
7#include <kglobal.h> 7#include <kglobal.h>
8#include <kstandarddirs.h> 8#include <kstandarddirs.h>
9 9
10 10
11using namespace Opie::Core; 11using namespace Opie::Core;
12Genericwrapper::Genericwrapper() 12Genericwrapper::Genericwrapper()
13 : AbstractMail() 13 : AbstractMail()
14{ 14{
15 bodyCache.clear(); 15 bodyCache.clear();
16 m_storage = 0; 16 m_storage = 0;
17 m_folder = 0; 17 m_folder = 0;
18} 18}
19 19
20Genericwrapper::~Genericwrapper() 20Genericwrapper::~Genericwrapper()
21{ 21{
22 if (m_folder) { 22 if (m_folder) {
23 mailfolder_free(m_folder); 23 mailfolder_free(m_folder);
24 } 24 }
25 if (m_storage) { 25 if (m_storage) {
26 mailstorage_free(m_storage); 26 mailstorage_free(m_storage);
27 } 27 }
28 cleanMimeCache(); 28 cleanMimeCache();
29} 29}
30const QDateTime Genericwrapper::parseDateTime( mailimf_date_time *date ) 30const QDateTime Genericwrapper::parseDateTime( mailimf_date_time *date )
31{ 31{
32 static bool init = false ;
33 if ( ! init ) {
34 KConfig kon ( locateLocal( "config", "korganizerrc" ) );
35 kon.setGroup("Locale");
36 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) );
37 QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( "");
38 KGlobal::locale()->setHore24Format( !kon.readNumEntry( "PreferredTime",0 ) );
39 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
40 dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" );
41 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
42 kon.setGroup("Time & Date");
43 KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ),
44 kon.readNumEntry( "DaylightsavingStart", 90),
45 kon.readNumEntry( "DaylightsavingEnd",304) );
46 KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") );
47
48 init = true;
49 32
50 }
51 QDate da (date->dt_year,date->dt_month, date->dt_day ); 33 QDate da (date->dt_year,date->dt_month, date->dt_day );
52 QTime ti ( date->dt_hour, date->dt_min, date->dt_sec ); 34 QTime ti ( date->dt_hour, date->dt_min, date->dt_sec );
53 QDateTime dt ( da ,ti ); 35 QDateTime dt ( da ,ti );
54 int addsec = -date->dt_zone*36; 36 int addsec = -date->dt_zone*36;
55 //qDebug("adsec1 %d ",addsec ); 37 //qDebug("adsec1 %d ",addsec );
56 dt = dt.addSecs( addsec ); 38 dt = dt.addSecs( addsec );
57 int off = KGlobal::locale()->localTimeOffset( dt ); 39 int off = KGlobal::locale()->localTimeOffset( dt );
58 //qDebug("adsec2 %d ",off*60 ); 40 //qDebug("adsec2 %d ",off*60 );
59 41
60 dt = dt.addSecs( off*60 ); 42 dt = dt.addSecs( off*60 );
61 return dt; 43 return dt;
62#if 0 44#if 0
63 QString ret; 45 QString ret;
64 if ( dt.date() == QDate::currentDate () ) 46 if ( dt.date() == QDate::currentDate () )
65 ret = KGlobal::locale()->formatTime( dt.time(),true); 47 ret = KGlobal::locale()->formatTime( dt.time(),true);
66 48
67 else { 49 else {
68 ret = KGlobal::locale()->formatDateTime( dt,true,true); 50 ret = KGlobal::locale()->formatDateTime( dt,true,true);
69 } 51 }
70#endif 52#endif
71#if 0 53#if 0
72 if ( off < 0 ) 54 if ( off < 0 )
73 ret += " -"; 55 ret += " -";
74 else 56 else
75 ret += " +"; 57 ret += " +";
76 ret += QString::number( off / 60 ); 58 ret += QString::number( off / 60 );
77 ret += "h"; 59 ret += "h";
78#endif 60#endif
79#if 0 61#if 0
80 char tmp[23]; 62 char tmp[23];
81 63
82 // snprintf( tmp, 23, "%02i.%02i.%04i %02i:%02i:%02i %+05i", 64 // snprintf( tmp, 23, "%02i.%02i.%04i %02i:%02i:%02i %+05i",
83 // date->dt_day, date->dt_month, date->dt_year, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone ); 65 // date->dt_day, date->dt_month, date->dt_year, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone );
84 snprintf( tmp, 23, "%04i-%02i-%02i %02i:%02i:%02i %+05i", 66 snprintf( tmp, 23, "%04i-%02i-%02i %02i:%02i:%02i %+05i",
85 date->dt_year,date->dt_month, date->dt_day, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone ); 67 date->dt_year,date->dt_month, date->dt_day, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone );
86 68
87 69
88 return QString( tmp ); 70 return QString( tmp );
89#endif 71#endif
90 //return ret; 72 //return ret;
91} 73}
92 74
93void Genericwrapper::fillSingleBody(RecPartP&target,mailmessage*,mailmime*mime) 75void Genericwrapper::fillSingleBody(RecPartP&target,mailmessage*,mailmime*mime)
94{ 76{
95 if (!mime) { 77 if (!mime) {
96 return; 78 return;
97 } 79 }
98 mailmime_field*field = 0; 80 mailmime_field*field = 0;
99 mailmime_single_fields fields; 81 mailmime_single_fields fields;
100 memset(&fields, 0, sizeof(struct mailmime_single_fields)); 82 memset(&fields, 0, sizeof(struct mailmime_single_fields));
101 if (mime->mm_mime_fields != NULL) { 83 if (mime->mm_mime_fields != NULL) {
102 mailmime_single_fields_init(&fields, mime->mm_mime_fields, 84 mailmime_single_fields_init(&fields, mime->mm_mime_fields,
103 mime->mm_content_type); 85 mime->mm_content_type);
104 } 86 }
105 87
106 mailmime_content*type = fields.fld_content; 88 mailmime_content*type = fields.fld_content;
107 clistcell*current; 89 clistcell*current;
108 if (!type) { 90 if (!type) {
109 target->setType("text"); 91 target->setType("text");
110 target->setSubtype("plain"); 92 target->setSubtype("plain");
111 } else { 93 } else {
112 target->setSubtype(type->ct_subtype); 94 target->setSubtype(type->ct_subtype);
113 switch(type->ct_type->tp_data.tp_discrete_type->dt_type) { 95 switch(type->ct_type->tp_data.tp_discrete_type->dt_type) {
114 case MAILMIME_DISCRETE_TYPE_TEXT: 96 case MAILMIME_DISCRETE_TYPE_TEXT:
115 target->setType("text"); 97 target->setType("text");
116 break; 98 break;
117 case MAILMIME_DISCRETE_TYPE_IMAGE: 99 case MAILMIME_DISCRETE_TYPE_IMAGE:
118 target->setType("image"); 100 target->setType("image");
119 break; 101 break;
120 case MAILMIME_DISCRETE_TYPE_AUDIO: 102 case MAILMIME_DISCRETE_TYPE_AUDIO:
121 target->setType("audio"); 103 target->setType("audio");
122 break; 104 break;
123 case MAILMIME_DISCRETE_TYPE_VIDEO: 105 case MAILMIME_DISCRETE_TYPE_VIDEO:
124 target->setType("video"); 106 target->setType("video");
125 break; 107 break;
126 case MAILMIME_DISCRETE_TYPE_APPLICATION: 108 case MAILMIME_DISCRETE_TYPE_APPLICATION:
127 target->setType("application"); 109 target->setType("application");
128 break; 110 break;
129 case MAILMIME_DISCRETE_TYPE_EXTENSION: 111 case MAILMIME_DISCRETE_TYPE_EXTENSION:
130 default: 112 default:
131 if (type->ct_type->tp_data.tp_discrete_type->dt_extension) { 113 if (type->ct_type->tp_data.tp_discrete_type->dt_extension) {
132 target->setType(type->ct_type->tp_data.tp_discrete_type->dt_extension); 114 target->setType(type->ct_type->tp_data.tp_discrete_type->dt_extension);
133 } 115 }
134 break; 116 break;
135 } 117 }
136 if (type->ct_parameters) { 118 if (type->ct_parameters) {
137 fillParameters(target,type->ct_parameters); 119 fillParameters(target,type->ct_parameters);
138 } 120 }
139 } 121 }
140 if (mime->mm_mime_fields && mime->mm_mime_fields->fld_list) { 122 if (mime->mm_mime_fields && mime->mm_mime_fields->fld_list) {
141 for (current=clist_begin(mime->mm_mime_fields->fld_list);current!=0;current=clist_next(current)) { 123 for (current=clist_begin(mime->mm_mime_fields->fld_list);current!=0;current=clist_next(current)) {
142 field = (mailmime_field*)current->data; 124 field = (mailmime_field*)current->data;
143 switch(field->fld_type) { 125 switch(field->fld_type) {
144 case MAILMIME_FIELD_TRANSFER_ENCODING: 126 case MAILMIME_FIELD_TRANSFER_ENCODING:
145 target->setEncoding(getencoding(field->fld_data.fld_encoding)); 127 target->setEncoding(getencoding(field->fld_data.fld_encoding));
146 break; 128 break;
147 case MAILMIME_FIELD_ID: 129 case MAILMIME_FIELD_ID:
148 target->setIdentifier(field->fld_data.fld_id); 130 target->setIdentifier(field->fld_data.fld_id);
149 break; 131 break;
150 case MAILMIME_FIELD_DESCRIPTION: 132 case MAILMIME_FIELD_DESCRIPTION:
151 target->setDescription(field->fld_data.fld_description); 133 target->setDescription(field->fld_data.fld_description);
152 break; 134 break;
153 default: 135 default:
154 break; 136 break;
155 } 137 }
156 } 138 }
157 } 139 }
158} 140}
159 141
160void Genericwrapper::fillParameters(RecPartP&target,clist*parameters) 142void Genericwrapper::fillParameters(RecPartP&target,clist*parameters)
161{ 143{
162 if (!parameters) {return;} 144 if (!parameters) {return;}
163 clistcell*current=0; 145 clistcell*current=0;
164 mailmime_parameter*param; 146 mailmime_parameter*param;
165 for (current=clist_begin(parameters);current!=0;current=clist_next(current)) { 147 for (current=clist_begin(parameters);current!=0;current=clist_next(current)) {
166 param = (mailmime_parameter*)current->data; 148 param = (mailmime_parameter*)current->data;
167 if (param) { 149 if (param) {
168 target->addParameter(QString(param->pa_name).lower(),QString(param->pa_value)); 150 target->addParameter(QString(param->pa_name).lower(),QString(param->pa_value));
169 } 151 }
170 } 152 }
171} 153}
172 154
173QString Genericwrapper::getencoding(mailmime_mechanism*aEnc) 155QString Genericwrapper::getencoding(mailmime_mechanism*aEnc)
174{ 156{
175 QString enc="7bit"; 157 QString enc="7bit";
176 if (!aEnc) return enc; 158 if (!aEnc) return enc;
177 switch(aEnc->enc_type) { 159 switch(aEnc->enc_type) {
178 case MAILMIME_MECHANISM_7BIT: 160 case MAILMIME_MECHANISM_7BIT:
179 enc = "7bit"; 161 enc = "7bit";
180 break; 162 break;
181 case MAILMIME_MECHANISM_8BIT: 163 case MAILMIME_MECHANISM_8BIT:
182 enc = "8bit"; 164 enc = "8bit";
183 break; 165 break;
184 case MAILMIME_MECHANISM_BINARY: 166 case MAILMIME_MECHANISM_BINARY:
185 enc = "binary"; 167 enc = "binary";
186 break; 168 break;
187 case MAILMIME_MECHANISM_QUOTED_PRINTABLE: 169 case MAILMIME_MECHANISM_QUOTED_PRINTABLE:
188 enc = "quoted-printable"; 170 enc = "quoted-printable";
189 break; 171 break;
190 case MAILMIME_MECHANISM_BASE64: 172 case MAILMIME_MECHANISM_BASE64:
191 enc = "base64"; 173 enc = "base64";
192 break; 174 break;
193 case MAILMIME_MECHANISM_TOKEN: 175 case MAILMIME_MECHANISM_TOKEN:
194 default: 176 default:
195 if (aEnc->enc_token) { 177 if (aEnc->enc_token) {
196 enc = QString(aEnc->enc_token); 178 enc = QString(aEnc->enc_token);
197 } 179 }
198 break; 180 break;
199 } 181 }
200 return enc; 182 return enc;
201} 183}
202 184
203void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rec,int current_count) 185void Genericwrapper::traverseBody(RecBodyP&target,mailmessage*message,mailmime*mime,QValueList<int>recList,unsigned int current_rec,int current_count)
204{ 186{
205 if (current_rec >= 10) { 187 if (current_rec >= 10) {
206 ; // odebug << "too deep recursion!" << oendl; 188 ; // odebug << "too deep recursion!" << oendl;
207 } 189 }
208 if (!message || !mime) { 190 if (!message || !mime) {
209 return; 191 return;
210 } 192 }
211 int r; 193 int r;
212 char*data = 0; 194 char*data = 0;
213 size_t len; 195 size_t len;
214 clistiter * cur = 0; 196 clistiter * cur = 0;
215 QString b; 197 QString b;
216 RecPartP part = new RecPart(); 198 RecPartP part = new RecPart();
217 199
218 switch (mime->mm_type) { 200 switch (mime->mm_type) {
219 case MAILMIME_SINGLE: 201 case MAILMIME_SINGLE:
220 { 202 {
221 QValueList<int>countlist = recList; 203 QValueList<int>countlist = recList;
222 countlist.append(current_count); 204 countlist.append(current_count);
223 r = mailmessage_fetch_section(message,mime,&data,&len); 205 r = mailmessage_fetch_section(message,mime,&data,&len);
224 part->setSize(len); 206 part->setSize(len);
225 part->setPositionlist(countlist); 207 part->setPositionlist(countlist);
226 b = gen_attachment_id(); 208 b = gen_attachment_id();
227 part->setIdentifier(b); 209 part->setIdentifier(b);
228 fillSingleBody(part,message,mime); 210 fillSingleBody(part,message,mime);
229 if (part->Type()=="text" && target->Bodytext().isNull()) { 211 if (part->Type()=="text" && target->Bodytext().isNull()) {
230 encodedString*rs = new encodedString(); 212 encodedString*rs = new encodedString();
231 rs->setContent(data,len); 213 rs->setContent(data,len);
232 encodedString*res = decode_String(rs,part->Encoding()); 214 encodedString*res = decode_String(rs,part->Encoding());
233 if (countlist.count()>2) { 215 if (countlist.count()>2) {
234 bodyCache[b]=rs; 216 bodyCache[b]=rs;
235 target->addPart(part); 217 target->addPart(part);
236 } else { 218 } else {
237 delete rs; 219 delete rs;
238 } 220 }
239 b = QString(res->Content()); 221 b = QString(res->Content());
240 delete res; 222 delete res;
241 target->setBodytext(b); 223 target->setBodytext(b);
242 target->setDescription(part); 224 target->setDescription(part);
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 9a1a750..164988c 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -1,226 +1,228 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2// CHANGED 2004-08-06 Lutz Rogowski 2// CHANGED 2004-08-06 Lutz Rogowski
3 3
4#include "settingsdialog.h" 4#include "settingsdialog.h"
5#include "opiemail.h" 5#include "opiemail.h"
6#include "editaccounts.h" 6#include "editaccounts.h"
7#include "composemail.h" 7#include "composemail.h"
8#include "mailistviewitem.h" 8#include "mailistviewitem.h"
9#include "viewmail.h" 9#include "viewmail.h"
10#include "selectstore.h" 10#include "selectstore.h"
11#include "selectsmtp.h" 11#include "selectsmtp.h"
12#include "accountitem.h" 12#include "accountitem.h"
13#include "koprefsdialog.h" 13#include "koprefsdialog.h"
14 14
15#include <qmessagebox.h> 15#include <qmessagebox.h>
16#include <qtimer.h> 16#include <qtimer.h>
17#include <libkdepim/externalapphandler.h> 17#include <libkdepim/externalapphandler.h>
18#include <libkdepim/kpimglobalprefs.h>
18 19
19#include <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
20#include <libmailwrapper/smtpwrapper.h> 21#include <libmailwrapper/smtpwrapper.h>
21#include <libmailwrapper/mailtypes.h> 22#include <libmailwrapper/mailtypes.h>
22#include <libmailwrapper/abstractmail.h> 23#include <libmailwrapper/abstractmail.h>
23/* OPIE */ 24/* OPIE */
24//#include <qpe/resource.h> 25//#include <qpe/resource.h>
25//#include <qpe/qpeapplication.h> 26//#include <qpe/qpeapplication.h>
26 27
27/* QT */ 28/* QT */
28 29
29//using namespace Opie::Core; 30//using namespace Opie::Core;
30 31
31OpieMail::OpieMail( QWidget *parent, const char *name ) 32OpieMail::OpieMail( QWidget *parent, const char *name )
32 : MainWindow( parent, name) //, WStyle_ContextHelp ) 33 : MainWindow( parent, name) //, WStyle_ContextHelp )
33{ 34{
34 settings = new Settings(); 35 settings = new Settings();
36 KPimGlobalPrefs::instance()->setGlobalConfig();
35 37
36 folderView->populate( settings->getAccounts() ); 38 folderView->populate( settings->getAccounts() );
37 39
38} 40}
39 41
40OpieMail::~OpieMail() 42OpieMail::~OpieMail()
41{ 43{
42 if (settings) delete settings; 44 if (settings) delete settings;
43} 45}
44 46
45void OpieMail::appMessage(const QCString &msg, const QByteArray &data) 47void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
46{ 48{
47 49
48} 50}
49#include <stdlib.h> 51#include <stdlib.h>
50void OpieMail::message(const QCString &msg, const QByteArray &data) 52void OpieMail::message(const QCString &msg, const QByteArray &data)
51{ 53{
52 // copied from old mail2 54 // copied from old mail2
53 static int ii = 0; 55 static int ii = 0;
54 //qDebug("QCOP CALL ############################# %d ", ii); 56 //qDebug("QCOP CALL ############################# %d ", ii);
55 //QString mess ( msg ); 57 //QString mess ( msg );
56 //qDebug("Message = %s ",mess.latin1()); 58 //qDebug("Message = %s ",mess.latin1());
57 ++ii; 59 ++ii;
58 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); 60 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this);
59 61
60 mPendingEmail = QString::null; 62 mPendingEmail = QString::null;
61 mPendingName = QString::null; 63 mPendingName = QString::null;
62 if (msg == "writeMail(QString,QString)") 64 if (msg == "writeMail(QString,QString)")
63 { 65 {
64 //qDebug("writeMail(QString,QString) "); 66 //qDebug("writeMail(QString,QString) ");
65 QDataStream stream(data,IO_ReadOnly); 67 QDataStream stream(data,IO_ReadOnly);
66 stream >> mPendingName >> mPendingEmail; 68 stream >> mPendingName >> mPendingEmail;
67 // removing the whitespaces at beginning and end is needed! 69 // removing the whitespaces at beginning and end is needed!
68 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 70 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
69 } 71 }
70 else if (msg == "newMail()") 72 else if (msg == "newMail()")
71 { 73 {
72 //qDebug("slotComposeMail() "); 74 //qDebug("slotComposeMail() ");
73 // we cannot call slotComposeMail(); directly, because may be executing a QCOP call 75 // we cannot call slotComposeMail(); directly, because may be executing a QCOP call
74 // and a QCOP call does not like a processevents in his execution 76 // and a QCOP call does not like a processevents in his execution
75 // with the Qtimer we call slotComposeMail() after we reached the main event loop 77 // with the Qtimer we call slotComposeMail() after we reached the main event loop
76 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 78 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
77 // slotComposeMail(); 79 // slotComposeMail();
78 } 80 }
79 else if (msg == "newMail(QString)") 81 else if (msg == "newMail(QString)")
80 { 82 {
81 //qDebug(" newMail(QString)"); 83 //qDebug(" newMail(QString)");
82 QDataStream stream(data,IO_ReadOnly); 84 QDataStream stream(data,IO_ReadOnly);
83 stream >> mPendingName; 85 stream >> mPendingName;
84 // the format is 86 // the format is
85 // NAME <EMAIL>:SUBJECT 87 // NAME <EMAIL>:SUBJECT
86 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) ); 88 QTimer::singleShot ( 50, this, SLOT(slotComposeMail() ) );
87 } else { 89 } else {
88 mPendingData = data; 90 mPendingData = data;
89 mPendingMessage = msg; 91 mPendingMessage = msg;
90 QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) ); 92 QTimer::singleShot ( 50, this, SLOT(slotExtAppHandler() ) );
91 } 93 }
92 94
93 //qDebug("END OpieMail::message "); 95 //qDebug("END OpieMail::message ");
94} 96}
95void OpieMail::slotExtAppHandler() 97void OpieMail::slotExtAppHandler()
96{ 98{
97 ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData ); 99 ExternalAppHandler::instance()->appMessage ( mPendingMessage, mPendingData );
98} 100}
99void OpieMail::slotwriteMail2(const QString& namemail ) 101void OpieMail::slotwriteMail2(const QString& namemail )
100{ 102{
101 //qDebug("OpieMail::slotwriteMail2 "); 103 //qDebug("OpieMail::slotwriteMail2 ");
102 //qApp->processEvents(); 104 //qApp->processEvents();
103 ComposeMail compose( settings, this, 0, true ); 105 ComposeMail compose( settings, this, 0, true );
104 if ( !namemail.isEmpty() ) { 106 if ( !namemail.isEmpty() ) {
105 QString to = namemail; 107 QString to = namemail;
106 if ( namemail.find( " <") > 1 ) { 108 if ( namemail.find( " <") > 1 ) {
107 to = "\"" +to.replace( QRegExp( " <"), "\" <") ; 109 to = "\"" +to.replace( QRegExp( " <"), "\" <") ;
108 } else 110 } else
109 if ( namemail.find( "<") > 1 ) { 111 if ( namemail.find( "<") > 1 ) {
110 to = "\"" +to.replace( QRegExp( "<"), "\" <") ; 112 to = "\"" +to.replace( QRegExp( "<"), "\" <") ;
111 } 113 }
112 int sub = to.find( ">:"); 114 int sub = to.find( ">:");
113 if ( sub > 0 ) { 115 if ( sub > 0 ) {
114 compose.setTo( to.left(sub+1) ); 116 compose.setTo( to.left(sub+1) );
115 compose.setSubject( to.mid(sub+2) ); 117 compose.setSubject( to.mid(sub+2) );
116 } else 118 } else
117 compose.setTo( to ); 119 compose.setTo( to );
118 } 120 }
119 compose.slotAdjustColumns(); 121 compose.slotAdjustColumns();
120 compose.showMaximized(); 122 compose.showMaximized();
121 compose.exec(); 123 compose.exec();
122 raise(); 124 raise();
123 //qDebug("retttich "); 125 //qDebug("retttich ");
124} 126}
125void OpieMail::slotwriteMail(const QString&name,const QString&email) 127void OpieMail::slotwriteMail(const QString&name,const QString&email)
126{ 128{
127 // qDebug("OpieMail::slotwriteMail "); 129 // qDebug("OpieMail::slotwriteMail ");
128 ComposeMail compose( settings, this, 0, true ); 130 ComposeMail compose( settings, this, 0, true );
129 if (!email.isEmpty()) 131 if (!email.isEmpty())
130 { 132 {
131 if (!name.isEmpty()) 133 if (!name.isEmpty())
132 { 134 {
133 compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); 135 compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">");
134 } 136 }
135 else 137 else
136 { 138 {
137 compose.setTo(email); 139 compose.setTo(email);
138 } 140 }
139 } 141 }
140 compose.slotAdjustColumns(); 142 compose.slotAdjustColumns();
141 compose.showMaximized(); 143 compose.showMaximized();
142 compose.exec(); 144 compose.exec();
143 raise(); 145 raise();
144} 146}
145 147
146void OpieMail::slotComposeMail() 148void OpieMail::slotComposeMail()
147{ 149{
148 if ( mPendingEmail == QString::null && mPendingName == QString::null) 150 if ( mPendingEmail == QString::null && mPendingName == QString::null)
149 slotwriteMail2( QString () ); 151 slotwriteMail2( QString () );
150 else { 152 else {
151 if ( mPendingEmail == QString::null ) 153 if ( mPendingEmail == QString::null )
152 slotwriteMail2( mPendingName ); 154 slotwriteMail2( mPendingName );
153 else 155 else
154 slotwriteMail( mPendingName, mPendingEmail ); 156 slotwriteMail( mPendingName, mPendingEmail );
155 } 157 }
156 //slotwriteMail(0l,0l); 158 //slotwriteMail(0l,0l);
157} 159}
158 160
159void OpieMail::slotSendQueued() 161void OpieMail::slotSendQueued()
160{ 162{
161 SMTPaccount *smtp = 0; 163 SMTPaccount *smtp = 0;
162 164
163 QList<Account> list = settings->getAccounts(); 165 QList<Account> list = settings->getAccounts();
164 QList<SMTPaccount> smtpList; 166 QList<SMTPaccount> smtpList;
165 smtpList.setAutoDelete(false); 167 smtpList.setAutoDelete(false);
166 Account *it; 168 Account *it;
167 for ( it = list.first(); it; it = list.next() ) 169 for ( it = list.first(); it; it = list.next() )
168 { 170 {
169 if ( it->getType() == MAILLIB::A_SMTP ) 171 if ( it->getType() == MAILLIB::A_SMTP )
170 { 172 {
171 smtp = static_cast<SMTPaccount *>(it); 173 smtp = static_cast<SMTPaccount *>(it);
172 smtpList.append(smtp); 174 smtpList.append(smtp);
173 } 175 }
174 } 176 }
175 if (smtpList.count()==0) 177 if (smtpList.count()==0)
176 { 178 {
177 QMessageBox::information(0,tr("Info"),tr("Define a smtp account first!\n")); 179 QMessageBox::information(0,tr("Info"),tr("Define a smtp account first!\n"));
178 return; 180 return;
179 } 181 }
180 if (smtpList.count()==1) 182 if (smtpList.count()==1)
181 { 183 {
182 smtp = smtpList.at(0); 184 smtp = smtpList.at(0);
183 } 185 }
184 else 186 else
185 { 187 {
186 smtp = 0; 188 smtp = 0;
187 selectsmtp selsmtp; 189 selectsmtp selsmtp;
188 selsmtp.setSelectionlist(&smtpList); 190 selsmtp.setSelectionlist(&smtpList);
189 selsmtp.showMaximized(); 191 selsmtp.showMaximized();
190 if ( selsmtp.exec() == QDialog::Accepted ) 192 if ( selsmtp.exec() == QDialog::Accepted )
191 { 193 {
192 smtp = selsmtp.selected_smtp(); 194 smtp = selsmtp.selected_smtp();
193 } 195 }
194 } 196 }
195 if (smtp) 197 if (smtp)
196 { 198 {
197 SMTPwrapper * wrap = new SMTPwrapper(smtp); 199 SMTPwrapper * wrap = new SMTPwrapper(smtp);
198 if ( wrap->flushOutbox() ) 200 if ( wrap->flushOutbox() )
199 { 201 {
200 QMessageBox::information(0,tr("Info"),tr("Mail queue flushed")); 202 QMessageBox::information(0,tr("Info"),tr("Mail queue flushed"));
201 } 203 }
202 delete wrap; 204 delete wrap;
203 } 205 }
204} 206}
205 207
206void OpieMail::slotSearchMails() 208void OpieMail::slotSearchMails()
207{ 209{
208 qDebug("OpieMail::slotSearchMails():not implemented "); 210 qDebug("OpieMail::slotSearchMails():not implemented ");
209} 211}
210 212
211void OpieMail::slotEditSettings() 213void OpieMail::slotEditSettings()
212{ 214{
213#if 0 215#if 0
214 SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp ); 216 SettingsDialog settingsDialog( this, 0, true, WStyle_ContextHelp );
215 settingsDialog.showMaximized(); 217 settingsDialog.showMaximized();
216 settingsDialog.exec(); 218 settingsDialog.exec();
217#endif 219#endif
218 KOPrefsDialog settingsDialog( this, "koprefs", true ); 220 KOPrefsDialog settingsDialog( this, "koprefs", true );
219 settingsDialog.showMaximized(); 221 settingsDialog.showMaximized();
220 settingsDialog.exec(); 222 settingsDialog.exec();
221} 223}
222 224
223void OpieMail::slotEditAccounts() 225void OpieMail::slotEditAccounts()
224{ 226{
225 EditAccounts eaDialog( settings, this, 0, true ); 227 EditAccounts eaDialog( settings, this, 0, true );
226 eaDialog.slotAdjustColumns(); 228 eaDialog.slotAdjustColumns();
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index bc8625d..3635cfa 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1,257 +1,258 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Requires the Qt and KDE widget libraries, available at no cost at 4 Requires the Qt and KDE widget libraries, available at no cost at
5 http://www.troll.no and http://www.kde.org respectively 5 http://www.troll.no and http://www.kde.org respectively
6 6
7 Copyright (c) 1997, 1998, 1999 7 Copyright (c) 1997, 1998, 1999
8 Preston Brown (preston.brown@yale.edu) 8 Preston Brown (preston.brown@yale.edu)
9 Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl) 9 Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl)
10 Ian Dawes (iadawes@globalserve.net) 10 Ian Dawes (iadawes@globalserve.net)
11 Laszlo Boloni (boloni@cs.purdue.edu) 11 Laszlo Boloni (boloni@cs.purdue.edu)
12 12
13 Copyright (c) 2000, 2001, 2002 13 Copyright (c) 2000, 2001, 2002
14 Cornelius Schumacher <schumacher@kde.org> 14 Cornelius Schumacher <schumacher@kde.org>
15 15
16 This program is free software; you can redistribute it and/or modify 16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by 17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 2 of the License, or 18 the Free Software Foundation; either version 2 of the License, or
19 (at your option) any later version. 19 (at your option) any later version.
20 20
21 This program is distributed in the hope that it will be useful, 21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of 22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
24 GNU General Public License for more details. 24 GNU General Public License for more details.
25 25
26 You should have received a copy of the GNU General Public License 26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software 27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#include <stdlib.h> 31#include <stdlib.h>
32 32
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qradiobutton.h> 34#include <qradiobutton.h>
35#include <qbuttongroup.h> 35#include <qbuttongroup.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qclipboard.h> 37#include <qclipboard.h>
38#include <qcursor.h> 38#include <qcursor.h>
39#include <qmessagebox.h> 39#include <qmessagebox.h>
40#include <qprogressbar.h> 40#include <qprogressbar.h>
41#include <qmultilineedit.h> 41#include <qmultilineedit.h>
42#include <qtimer.h> 42#include <qtimer.h>
43#include <qwidgetstack.h> 43#include <qwidgetstack.h>
44#include <qptrlist.h> 44#include <qptrlist.h>
45#include <qregexp.h> 45#include <qregexp.h>
46#include <qgroupbox.h> 46#include <qgroupbox.h>
47#include <qfile.h> 47#include <qfile.h>
48#include <qdir.h> 48#include <qdir.h>
49#ifndef KORG_NOSPLITTER 49#ifndef KORG_NOSPLITTER
50#include <qsplitter.h> 50#include <qsplitter.h>
51#endif 51#endif
52 52
53#include <kglobal.h> 53#include <kglobal.h>
54#include <kdebug.h> 54#include <kdebug.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56#include <kfiledialog.h> 56#include <kfiledialog.h>
57#include <kmessagebox.h> 57#include <kmessagebox.h>
58#include <knotifyclient.h> 58#include <knotifyclient.h>
59#include <kconfig.h> 59#include <kconfig.h>
60 60
61#include <libkdepim/ksyncprefsdialog.h> 61#include <libkdepim/ksyncprefsdialog.h>
62#include <krun.h> 62#include <krun.h>
63#include <kdirwatch.h> 63#include <kdirwatch.h>
64#include <libkdepim/kdatepicker.h> 64#include <libkdepim/kdatepicker.h>
65#include <libkdepim/ksyncprofile.h> 65#include <libkdepim/ksyncprofile.h>
66#include <libkdepim/kpimglobalprefs.h>
66 67
67#include <libkcal/vcaldrag.h> 68#include <libkcal/vcaldrag.h>
68#include <libkcal/icaldrag.h> 69#include <libkcal/icaldrag.h>
69#include <libkcal/icalformat.h> 70#include <libkcal/icalformat.h>
70#include <libkcal/vcalformat.h> 71#include <libkcal/vcalformat.h>
71#include <libkcal/scheduler.h> 72#include <libkcal/scheduler.h>
72#include <libkcal/calendarlocal.h> 73#include <libkcal/calendarlocal.h>
73#include <libkcal/journal.h> 74#include <libkcal/journal.h>
74#include <libkcal/calfilter.h> 75#include <libkcal/calfilter.h>
75#include <libkcal/attendee.h> 76#include <libkcal/attendee.h>
76#include <libkcal/dndfactory.h> 77#include <libkcal/dndfactory.h>
77#include <libkcal/freebusy.h> 78#include <libkcal/freebusy.h>
78#include <libkcal/filestorage.h> 79#include <libkcal/filestorage.h>
79#include <libkcal/calendarresources.h> 80#include <libkcal/calendarresources.h>
80#include <libkcal/qtopiaformat.h> 81#include <libkcal/qtopiaformat.h>
81#include "../kalarmd/alarmdialog.h" 82#include "../kalarmd/alarmdialog.h"
82 83
83#ifndef DESKTOP_VERSION 84#ifndef DESKTOP_VERSION
84#include <libkcal/sharpformat.h> 85#include <libkcal/sharpformat.h>
85#endif 86#endif
86#include <libkcal/phoneformat.h> 87#include <libkcal/phoneformat.h>
87#ifndef KORG_NOMAIL 88#ifndef KORG_NOMAIL
88#include "komailclient.h" 89#include "komailclient.h"
89#endif 90#endif
90#ifndef KORG_NOPRINTER 91#ifndef KORG_NOPRINTER
91#include "calprinter.h" 92#include "calprinter.h"
92#endif 93#endif
93#ifndef KORG_NOPLUGINS 94#ifndef KORG_NOPLUGINS
94#include "kocore.h" 95#include "kocore.h"
95#endif 96#endif
96#include "koeventeditor.h" 97#include "koeventeditor.h"
97#include "kotodoeditor.h" 98#include "kotodoeditor.h"
98#include "koprefs.h" 99#include "koprefs.h"
99#include "koeventviewerdialog.h" 100#include "koeventviewerdialog.h"
100#include "publishdialog.h" 101#include "publishdialog.h"
101#include "kofilterview.h" 102#include "kofilterview.h"
102#include "koglobals.h" 103#include "koglobals.h"
103#include "koviewmanager.h" 104#include "koviewmanager.h"
104#include "koagendaview.h" 105#include "koagendaview.h"
105#include "kodialogmanager.h" 106#include "kodialogmanager.h"
106#include "outgoingdialog.h" 107#include "outgoingdialog.h"
107#include "incomingdialog.h" 108#include "incomingdialog.h"
108#include "statusdialog.h" 109#include "statusdialog.h"
109#include "kdatenavigator.h" 110#include "kdatenavigator.h"
110#include "kotodoview.h" 111#include "kotodoview.h"
111#include "datenavigator.h" 112#include "datenavigator.h"
112#include "resourceview.h" 113#include "resourceview.h"
113#include "navigatorbar.h" 114#include "navigatorbar.h"
114#include "searchdialog.h" 115#include "searchdialog.h"
115#include "mainwindow.h" 116#include "mainwindow.h"
116 117
117#include "calendarview.h" 118#include "calendarview.h"
118#ifndef DESKTOP_VERSION 119#ifndef DESKTOP_VERSION
119#include <qtopia/alarmserver.h> 120#include <qtopia/alarmserver.h>
120#endif 121#endif
121#ifndef _WIN32_ 122#ifndef _WIN32_
122#include <stdlib.h> 123#include <stdlib.h>
123#include <stdio.h> 124#include <stdio.h>
124#include <unistd.h> 125#include <unistd.h>
125#else 126#else
126#include <qprocess.h> 127#include <qprocess.h>
127#endif 128#endif
128using namespace KOrg; 129using namespace KOrg;
129using namespace KCal; 130using namespace KCal;
130extern int globalFlagBlockAgenda; 131extern int globalFlagBlockAgenda;
131extern int globalFlagBlockStartup; 132extern int globalFlagBlockStartup;
132 133
133 134
134 135
135class KOBeamPrefs : public QDialog 136class KOBeamPrefs : public QDialog
136{ 137{
137 public: 138 public:
138 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : 139 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) :
139 QDialog( parent, name, true ) 140 QDialog( parent, name, true )
140 { 141 {
141 setCaption( i18n("Beam Options") ); 142 setCaption( i18n("Beam Options") );
142 QVBoxLayout* lay = new QVBoxLayout( this ); 143 QVBoxLayout* lay = new QVBoxLayout( this );
143 lay->setSpacing( 3 ); 144 lay->setSpacing( 3 );
144 lay->setMargin( 3 ); 145 lay->setMargin( 3 );
145 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); 146 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this );
146 lay->addWidget( format ); 147 lay->addWidget( format );
147 format->setExclusive ( true ) ; 148 format->setExclusive ( true ) ;
148 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); 149 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this );
149 lay->addWidget( time ); time->setExclusive ( true ) ; 150 lay->addWidget( time ); time->setExclusive ( true ) ;
150 vcal = new QRadioButton(" vCalendar ", format ); 151 vcal = new QRadioButton(" vCalendar ", format );
151 ical = new QRadioButton(" iCalendar ", format ); 152 ical = new QRadioButton(" iCalendar ", format );
152 vcal->setChecked( true ); 153 vcal->setChecked( true );
153 tz = new QRadioButton(i18n(" With timezone "), time ); 154 tz = new QRadioButton(i18n(" With timezone "), time );
154 local = new QRadioButton(i18n(" Local time "), time ); 155 local = new QRadioButton(i18n(" Local time "), time );
155 tz->setChecked( true ); 156 tz->setChecked( true );
156 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); 157 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this );
157 lay->addWidget( ok ); 158 lay->addWidget( ok );
158 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 159 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
159 lay->addWidget( cancel ); 160 lay->addWidget( cancel );
160 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 161 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
161 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 162 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
162 resize( 200, 200 ); 163 resize( 200, 200 );
163 } 164 }
164 165
165 bool beamVcal() { return vcal->isChecked(); } 166 bool beamVcal() { return vcal->isChecked(); }
166 bool beamLocal() { return local->isChecked(); } 167 bool beamLocal() { return local->isChecked(); }
167private: 168private:
168 QRadioButton* vcal, *ical, *local, *tz; 169 QRadioButton* vcal, *ical, *local, *tz;
169}; 170};
170class KOCatPrefs : public QDialog 171class KOCatPrefs : public QDialog
171{ 172{
172 public: 173 public:
173 KOCatPrefs( QWidget *parent=0, const char *name=0 ) : 174 KOCatPrefs( QWidget *parent=0, const char *name=0 ) :
174 QDialog( parent, name, true ) 175 QDialog( parent, name, true )
175 { 176 {
176 setCaption( i18n("Manage new Categories") ); 177 setCaption( i18n("Manage new Categories") );
177 QVBoxLayout* lay = new QVBoxLayout( this ); 178 QVBoxLayout* lay = new QVBoxLayout( this );
178 lay->setSpacing( 3 ); 179 lay->setSpacing( 3 );
179 lay->setMargin( 3 ); 180 lay->setMargin( 3 );
180 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); 181 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this );
181 lay->addWidget( lab ); 182 lay->addWidget( lab );
182 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 183 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
183 lay->addWidget( format ); 184 lay->addWidget( format );
184 format->setExclusive ( true ) ; 185 format->setExclusive ( true ) ;
185 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 186 addCatBut = new QRadioButton(i18n("Add to category list"), format );
186 new QRadioButton(i18n("Remove from Events/Todos"), format ); 187 new QRadioButton(i18n("Remove from Events/Todos"), format );
187 addCatBut->setChecked( true ); 188 addCatBut->setChecked( true );
188 QPushButton * ok = new QPushButton( i18n("OK"), this ); 189 QPushButton * ok = new QPushButton( i18n("OK"), this );
189 lay->addWidget( ok ); 190 lay->addWidget( ok );
190 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 191 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
191 lay->addWidget( cancel ); 192 lay->addWidget( cancel );
192 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 193 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
193 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 194 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
194 resize( 200, 200 ); 195 resize( 200, 200 );
195 } 196 }
196 197
197 bool addCat() { return addCatBut->isChecked(); } 198 bool addCat() { return addCatBut->isChecked(); }
198private: 199private:
199 QRadioButton* addCatBut; 200 QRadioButton* addCatBut;
200}; 201};
201 202
202 203
203 204
204CalendarView::CalendarView( CalendarResources *calendar, 205CalendarView::CalendarView( CalendarResources *calendar,
205 QWidget *parent, const char *name ) 206 QWidget *parent, const char *name )
206 : CalendarViewBase( parent, name ), 207 : CalendarViewBase( parent, name ),
207 mCalendar( calendar ), 208 mCalendar( calendar ),
208 mResourceManager( calendar->resourceManager() ) 209 mResourceManager( calendar->resourceManager() )
209{ 210{
210 211
211 mEventEditor = 0; 212 mEventEditor = 0;
212 mTodoEditor = 0; 213 mTodoEditor = 0;
213 214
214 init(); 215 init();
215} 216}
216 217
217CalendarView::CalendarView( Calendar *calendar, 218CalendarView::CalendarView( Calendar *calendar,
218 QWidget *parent, const char *name ) 219 QWidget *parent, const char *name )
219 : CalendarViewBase( parent, name ), 220 : CalendarViewBase( parent, name ),
220 mCalendar( calendar ), 221 mCalendar( calendar ),
221 mResourceManager( 0 ) 222 mResourceManager( 0 )
222{ 223{
223 224
224 mEventEditor = 0; 225 mEventEditor = 0;
225 mTodoEditor = 0; 226 mTodoEditor = 0;
226 init();} 227 init();}
227 228
228void CalendarView::init() 229void CalendarView::init()
229{ 230{
230 beamDialog = new KOBeamPrefs(); 231 beamDialog = new KOBeamPrefs();
231 mDatePickerMode = 0; 232 mDatePickerMode = 0;
232 mCurrentSyncDevice = ""; 233 mCurrentSyncDevice = "";
233 writeLocale(); 234 writeLocale();
234 mViewManager = new KOViewManager( this ); 235 mViewManager = new KOViewManager( this );
235 mDialogManager = new KODialogManager( this ); 236 mDialogManager = new KODialogManager( this );
236 mEventViewerDialog = 0; 237 mEventViewerDialog = 0;
237 mModified = false; 238 mModified = false;
238 mReadOnly = false; 239 mReadOnly = false;
239 mSelectedIncidence = 0; 240 mSelectedIncidence = 0;
240 mCalPrinter = 0; 241 mCalPrinter = 0;
241 mFilters.setAutoDelete(true); 242 mFilters.setAutoDelete(true);
242 243
243 mCalendar->registerObserver( this ); 244 mCalendar->registerObserver( this );
244 // TODO: Make sure that view is updated, when calendar is changed. 245 // TODO: Make sure that view is updated, when calendar is changed.
245 246
246 mStorage = new FileStorage( mCalendar ); 247 mStorage = new FileStorage( mCalendar );
247 mNavigator = new DateNavigator( this, "datevav", mViewManager ); 248 mNavigator = new DateNavigator( this, "datevav", mViewManager );
248 249
249 QBoxLayout *topLayout = (QBoxLayout*)layout(); 250 QBoxLayout *topLayout = (QBoxLayout*)layout();
250#ifndef KORG_NOSPLITTER 251#ifndef KORG_NOSPLITTER
251 // create the main layout frames. 252 // create the main layout frames.
252 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); 253 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner");
253 topLayout->addWidget(mPanner); 254 topLayout->addWidget(mPanner);
254 255
255 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, 256 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
256 "CalendarView::LeftFrame"); 257 "CalendarView::LeftFrame");
257 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); 258 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
@@ -1695,398 +1696,401 @@ void CalendarView::readSettings()
1695 h = list[3].toInt(); 1696 h = list[3].toInt();
1696 getEventViewerDialog()->setGeometry(x,y,w,h); 1697 getEventViewerDialog()->setGeometry(x,y,w,h);
1697 } 1698 }
1698#endif 1699#endif
1699 1700
1700} 1701}
1701 1702
1702 1703
1703void CalendarView::writeSettings() 1704void CalendarView::writeSettings()
1704{ 1705{
1705 // kdDebug() << "CalendarView::writeSettings" << endl; 1706 // kdDebug() << "CalendarView::writeSettings" << endl;
1706 1707
1707 KConfig *config = KOGlobals::config(); 1708 KConfig *config = KOGlobals::config();
1708 1709
1709#ifndef KORG_NOSPLITTER 1710#ifndef KORG_NOSPLITTER
1710 config->setGroup("KOrganizer Geometry"); 1711 config->setGroup("KOrganizer Geometry");
1711 1712
1712 QValueList<int> list = mPanner->sizes(); 1713 QValueList<int> list = mPanner->sizes();
1713 config->writeEntry("Separator1",list); 1714 config->writeEntry("Separator1",list);
1714 1715
1715 list = mLeftSplitter->sizes(); 1716 list = mLeftSplitter->sizes();
1716 config->writeEntry("Separator2",list); 1717 config->writeEntry("Separator2",list);
1717#endif 1718#endif
1718 1719
1719 mViewManager->writeSettings( config ); 1720 mViewManager->writeSettings( config );
1720 mTodoList->saveLayout(config,QString("Todo Layout")); 1721 mTodoList->saveLayout(config,QString("Todo Layout"));
1721 mDialogManager->writeSettings( config ); 1722 mDialogManager->writeSettings( config );
1722 //KOPrefs::instance()->usrWriteConfig(); 1723 //KOPrefs::instance()->usrWriteConfig();
1723 KOPrefs::instance()->writeConfig(); 1724 KOPrefs::instance()->writeConfig();
1724 1725
1725 writeFilterSettings(config); 1726 writeFilterSettings(config);
1726 1727
1727 config->setGroup( "Views" ); 1728 config->setGroup( "Views" );
1728 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 1729 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
1729 1730
1730#ifdef DESKTOP_VERSION 1731#ifdef DESKTOP_VERSION
1731 config->setGroup("WidgetLayout"); 1732 config->setGroup("WidgetLayout");
1732 QStringList list ;//= config->readListEntry("MainLayout"); 1733 QStringList list ;//= config->readListEntry("MainLayout");
1733 int x,y,w,h; 1734 int x,y,w,h;
1734 QWidget* wid; 1735 QWidget* wid;
1735 wid = topLevelWidget(); 1736 wid = topLevelWidget();
1736 x = wid->geometry().x(); 1737 x = wid->geometry().x();
1737 y = wid->geometry().y(); 1738 y = wid->geometry().y();
1738 w = wid->width(); 1739 w = wid->width();
1739 h = wid->height(); 1740 h = wid->height();
1740 list.clear(); 1741 list.clear();
1741 list << QString::number( x ); 1742 list << QString::number( x );
1742 list << QString::number( y ); 1743 list << QString::number( y );
1743 list << QString::number( w ); 1744 list << QString::number( w );
1744 list << QString::number( h ); 1745 list << QString::number( h );
1745 config->writeEntry("MainLayout",list ); 1746 config->writeEntry("MainLayout",list );
1746 1747
1747 wid = mEventEditor; 1748 wid = mEventEditor;
1748 x = wid->geometry().x(); 1749 x = wid->geometry().x();
1749 y = wid->geometry().y(); 1750 y = wid->geometry().y();
1750 w = wid->width(); 1751 w = wid->width();
1751 h = wid->height(); 1752 h = wid->height();
1752 list.clear(); 1753 list.clear();
1753 list << QString::number( x ); 1754 list << QString::number( x );
1754 list << QString::number( y ); 1755 list << QString::number( y );
1755 list << QString::number( w ); 1756 list << QString::number( w );
1756 list << QString::number( h ); 1757 list << QString::number( h );
1757 config->writeEntry("EditEventLayout",list ); 1758 config->writeEntry("EditEventLayout",list );
1758 1759
1759 wid = mTodoEditor; 1760 wid = mTodoEditor;
1760 x = wid->geometry().x(); 1761 x = wid->geometry().x();
1761 y = wid->geometry().y(); 1762 y = wid->geometry().y();
1762 w = wid->width(); 1763 w = wid->width();
1763 h = wid->height(); 1764 h = wid->height();
1764 list.clear(); 1765 list.clear();
1765 list << QString::number( x ); 1766 list << QString::number( x );
1766 list << QString::number( y ); 1767 list << QString::number( y );
1767 list << QString::number( w ); 1768 list << QString::number( w );
1768 list << QString::number( h ); 1769 list << QString::number( h );
1769 config->writeEntry("EditTodoLayout",list ); 1770 config->writeEntry("EditTodoLayout",list );
1770 wid = getEventViewerDialog(); 1771 wid = getEventViewerDialog();
1771 x = wid->geometry().x(); 1772 x = wid->geometry().x();
1772 y = wid->geometry().y(); 1773 y = wid->geometry().y();
1773 w = wid->width(); 1774 w = wid->width();
1774 h = wid->height(); 1775 h = wid->height();
1775 list.clear(); 1776 list.clear();
1776 list << QString::number( x ); 1777 list << QString::number( x );
1777 list << QString::number( y ); 1778 list << QString::number( y );
1778 list << QString::number( w ); 1779 list << QString::number( w );
1779 list << QString::number( h ); 1780 list << QString::number( h );
1780 config->writeEntry("ViewerLayout",list ); 1781 config->writeEntry("ViewerLayout",list );
1781 wid = mDialogManager->getSearchDialog(); 1782 wid = mDialogManager->getSearchDialog();
1782 if ( wid ) { 1783 if ( wid ) {
1783 x = wid->geometry().x(); 1784 x = wid->geometry().x();
1784 y = wid->geometry().y(); 1785 y = wid->geometry().y();
1785 w = wid->width(); 1786 w = wid->width();
1786 h = wid->height(); 1787 h = wid->height();
1787 list.clear(); 1788 list.clear();
1788 list << QString::number( x ); 1789 list << QString::number( x );
1789 list << QString::number( y ); 1790 list << QString::number( y );
1790 list << QString::number( w ); 1791 list << QString::number( w );
1791 list << QString::number( h ); 1792 list << QString::number( h );
1792 config->writeEntry("SearchLayout",list ); 1793 config->writeEntry("SearchLayout",list );
1793 } 1794 }
1794#endif 1795#endif
1795 1796
1796 1797
1797 config->sync(); 1798 config->sync();
1798} 1799}
1799 1800
1800void CalendarView::readFilterSettings(KConfig *config) 1801void CalendarView::readFilterSettings(KConfig *config)
1801{ 1802{
1802 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 1803 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
1803 1804
1804 mFilters.clear(); 1805 mFilters.clear();
1805 1806
1806 config->setGroup("General"); 1807 config->setGroup("General");
1807 QStringList filterList = config->readListEntry("CalendarFilters"); 1808 QStringList filterList = config->readListEntry("CalendarFilters");
1808 1809
1809 QStringList::ConstIterator it = filterList.begin(); 1810 QStringList::ConstIterator it = filterList.begin();
1810 QStringList::ConstIterator end = filterList.end(); 1811 QStringList::ConstIterator end = filterList.end();
1811 while(it != end) { 1812 while(it != end) {
1812 // kdDebug() << " filter: " << (*it) << endl; 1813 // kdDebug() << " filter: " << (*it) << endl;
1813 1814
1814 CalFilter *filter; 1815 CalFilter *filter;
1815 filter = new CalFilter(*it); 1816 filter = new CalFilter(*it);
1816 config->setGroup("Filter_" + (*it)); 1817 config->setGroup("Filter_" + (*it));
1817 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 1818 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
1818 filter->setCriteria(config->readNumEntry("Criteria",0)); 1819 filter->setCriteria(config->readNumEntry("Criteria",0));
1819 filter->setCategoryList(config->readListEntry("CategoryList")); 1820 filter->setCategoryList(config->readListEntry("CategoryList"));
1820 mFilters.append(filter); 1821 mFilters.append(filter);
1821 1822
1822 ++it; 1823 ++it;
1823 } 1824 }
1824 1825
1825 if (mFilters.count() == 0) { 1826 if (mFilters.count() == 0) {
1826 CalFilter *filter = new CalFilter(i18n("Default")); 1827 CalFilter *filter = new CalFilter(i18n("Default"));
1827 mFilters.append(filter); 1828 mFilters.append(filter);
1828 } 1829 }
1829 mFilterView->updateFilters(); 1830 mFilterView->updateFilters();
1830 config->setGroup("FilterView"); 1831 config->setGroup("FilterView");
1831 1832
1832 mFilterView->blockSignals(true); 1833 mFilterView->blockSignals(true);
1833 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 1834 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
1834 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 1835 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
1835 mFilterView->blockSignals(false); 1836 mFilterView->blockSignals(false);
1836 // We do it manually to avoid it being done twice by the above calls 1837 // We do it manually to avoid it being done twice by the above calls
1837 updateFilter(); 1838 updateFilter();
1838} 1839}
1839 1840
1840void CalendarView::writeFilterSettings(KConfig *config) 1841void CalendarView::writeFilterSettings(KConfig *config)
1841{ 1842{
1842 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 1843 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
1843 1844
1844 QStringList filterList; 1845 QStringList filterList;
1845 1846
1846 CalFilter *filter = mFilters.first(); 1847 CalFilter *filter = mFilters.first();
1847 while(filter) { 1848 while(filter) {
1848 // kdDebug() << " fn: " << filter->name() << endl; 1849 // kdDebug() << " fn: " << filter->name() << endl;
1849 filterList << filter->name(); 1850 filterList << filter->name();
1850 config->setGroup("Filter_" + filter->name()); 1851 config->setGroup("Filter_" + filter->name());
1851 config->writeEntry("Criteria",filter->criteria()); 1852 config->writeEntry("Criteria",filter->criteria());
1852 config->writeEntry("CategoryList",filter->categoryList()); 1853 config->writeEntry("CategoryList",filter->categoryList());
1853 filter = mFilters.next(); 1854 filter = mFilters.next();
1854 } 1855 }
1855 config->setGroup("General"); 1856 config->setGroup("General");
1856 config->writeEntry("CalendarFilters",filterList); 1857 config->writeEntry("CalendarFilters",filterList);
1857 1858
1858 config->setGroup("FilterView"); 1859 config->setGroup("FilterView");
1859 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 1860 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
1860 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 1861 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
1861} 1862}
1862 1863
1863 1864
1864void CalendarView::goToday() 1865void CalendarView::goToday()
1865{ 1866{
1866 mNavigator->selectToday(); 1867 mNavigator->selectToday();
1867} 1868}
1868 1869
1869void CalendarView::goNext() 1870void CalendarView::goNext()
1870{ 1871{
1871 mNavigator->selectNext(); 1872 mNavigator->selectNext();
1872} 1873}
1873 1874
1874void CalendarView::goPrevious() 1875void CalendarView::goPrevious()
1875{ 1876{
1876 mNavigator->selectPrevious(); 1877 mNavigator->selectPrevious();
1877} 1878}
1878void CalendarView::goNextMonth() 1879void CalendarView::goNextMonth()
1879{ 1880{
1880 mNavigator->selectNextMonth(); 1881 mNavigator->selectNextMonth();
1881} 1882}
1882 1883
1883void CalendarView::goPreviousMonth() 1884void CalendarView::goPreviousMonth()
1884{ 1885{
1885 mNavigator->selectPreviousMonth(); 1886 mNavigator->selectPreviousMonth();
1886} 1887}
1887void CalendarView::writeLocale() 1888void CalendarView::writeLocale()
1888{ 1889{
1890 //KPimGlobalPrefs::instance()->setGlobalConfig();
1891#if 0
1889 KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); 1892 KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime );
1890 KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); 1893 KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday );
1891 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); 1894 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate );
1892 KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); 1895 KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage );
1893 QString dummy = KOPrefs::instance()->mUserDateFormatLong; 1896 QString dummy = KOPrefs::instance()->mUserDateFormatLong;
1894 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); 1897 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
1895 dummy = KOPrefs::instance()->mUserDateFormatShort; 1898 dummy = KOPrefs::instance()->mUserDateFormatShort;
1896 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); 1899 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
1897 KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, 1900 KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving,
1898 KOPrefs::instance()->mDaylightsavingStart, 1901 KOPrefs::instance()->mDaylightsavingStart,
1899 KOPrefs::instance()->mDaylightsavingEnd ); 1902 KOPrefs::instance()->mDaylightsavingEnd );
1900 KGlobal::locale()->setTimezone( KOPrefs::instance()->mTimeZoneId ); 1903 KGlobal::locale()->setTimezone( KOPrefs::instance()->mTimeZoneId );
1904#endif
1901} 1905}
1902void CalendarView::updateConfig() 1906void CalendarView::updateConfig()
1903{ 1907{
1904 writeLocale(); 1908 writeLocale();
1905 if ( KOPrefs::instance()->mUseAppColors ) 1909 if ( KOPrefs::instance()->mUseAppColors )
1906 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 1910 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
1907 emit configChanged(); 1911 emit configChanged();
1908 mTodoList->updateConfig(); 1912 mTodoList->updateConfig();
1909 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 1913 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
1910 mCalendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId); 1914 mCalendar->setTimeZoneId(KOPrefs::instance()->mTimeZoneId);
1911 // To make the "fill window" configurations work 1915 // To make the "fill window" configurations work
1912 //mViewManager->raiseCurrentView(); 1916 //mViewManager->raiseCurrentView();
1913} 1917}
1914 1918
1915 1919
1916void CalendarView::eventChanged(Event *event) 1920void CalendarView::eventChanged(Event *event)
1917{ 1921{
1918 changeEventDisplay(event,KOGlobals::EVENTEDITED); 1922 changeEventDisplay(event,KOGlobals::EVENTEDITED);
1919 //updateUnmanagedViews(); 1923 //updateUnmanagedViews();
1920} 1924}
1921 1925
1922void CalendarView::eventAdded(Event *event) 1926void CalendarView::eventAdded(Event *event)
1923{ 1927{
1924 changeEventDisplay(event,KOGlobals::EVENTADDED); 1928 changeEventDisplay(event,KOGlobals::EVENTADDED);
1925} 1929}
1926 1930
1927void CalendarView::eventToBeDeleted(Event *) 1931void CalendarView::eventToBeDeleted(Event *)
1928{ 1932{
1929 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 1933 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
1930} 1934}
1931 1935
1932void CalendarView::eventDeleted() 1936void CalendarView::eventDeleted()
1933{ 1937{
1934 changeEventDisplay(0,KOGlobals::EVENTDELETED); 1938 changeEventDisplay(0,KOGlobals::EVENTDELETED);
1935} 1939}
1936void CalendarView::changeTodoDisplay(Todo *which, int action) 1940void CalendarView::changeTodoDisplay(Todo *which, int action)
1937{ 1941{
1938 changeIncidenceDisplay((Incidence *)which, action); 1942 changeIncidenceDisplay((Incidence *)which, action);
1939 mDateNavigator->updateView(); //LR 1943 mDateNavigator->updateView(); //LR
1940 //mDialogManager->updateSearchDialog(); 1944 //mDialogManager->updateSearchDialog();
1941 1945
1942 if (which) { 1946 if (which) {
1943 mViewManager->updateWNview(); 1947 mViewManager->updateWNview();
1944 //mTodoList->updateView(); 1948 //mTodoList->updateView();
1945 } 1949 }
1946 1950
1947} 1951}
1948 1952
1949void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 1953void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
1950{ 1954{
1951 updateUnmanagedViews(); 1955 updateUnmanagedViews();
1952 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 1956 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
1953 if ( action == KOGlobals::EVENTDELETED ) { //delete 1957 if ( action == KOGlobals::EVENTDELETED ) { //delete
1954 mCalendar->checkAlarmForIncidence( 0, true ); 1958 mCalendar->checkAlarmForIncidence( 0, true );
1955 if ( mEventViewerDialog ) 1959 if ( mEventViewerDialog )
1956 mEventViewerDialog->hide(); 1960 mEventViewerDialog->hide();
1957 } 1961 }
1958 else 1962 else
1959 mCalendar->checkAlarmForIncidence( which , false ); 1963 mCalendar->checkAlarmForIncidence( which , false );
1960} 1964}
1961 1965
1962// most of the changeEventDisplays() right now just call the view's 1966// most of the changeEventDisplays() right now just call the view's
1963// total update mode, but they SHOULD be recoded to be more refresh-efficient. 1967// total update mode, but they SHOULD be recoded to be more refresh-efficient.
1964void CalendarView::changeEventDisplay(Event *which, int action) 1968void CalendarView::changeEventDisplay(Event *which, int action)
1965{ 1969{
1966 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 1970 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
1967 changeIncidenceDisplay((Incidence *)which, action); 1971 changeIncidenceDisplay((Incidence *)which, action);
1968 mDateNavigator->updateView(); 1972 mDateNavigator->updateView();
1969 //mDialogManager->updateSearchDialog(); 1973 //mDialogManager->updateSearchDialog();
1970 1974
1971 if (which) { 1975 if (which) {
1972 // If there is an event view visible update the display 1976 // If there is an event view visible update the display
1973 mViewManager->currentView()->changeEventDisplay(which,action); 1977 mViewManager->currentView()->changeEventDisplay(which,action);
1974 // TODO: check, if update needed 1978 // TODO: check, if update needed
1975 // if (which->getTodoStatus()) { 1979 // if (which->getTodoStatus()) {
1976 mTodoList->updateView(); 1980 mTodoList->updateView();
1977 // } 1981 // }
1978 } else { 1982 } else {
1979 mViewManager->currentView()->updateView(); 1983 mViewManager->currentView()->updateView();
1980 } 1984 }
1981} 1985}
1982 1986
1983 1987
1984void CalendarView::updateTodoViews() 1988void CalendarView::updateTodoViews()
1985{ 1989{
1986 1990
1987 mTodoList->updateView(); 1991 mTodoList->updateView();
1988 mViewManager->currentView()->updateView(); 1992 mViewManager->currentView()->updateView();
1989 1993
1990} 1994}
1991 1995
1992 1996
1993void CalendarView::updateView(const QDate &start, const QDate &end) 1997void CalendarView::updateView(const QDate &start, const QDate &end)
1994{ 1998{
1995 mTodoList->updateView(); 1999 mTodoList->updateView();
1996 mViewManager->updateView(start, end); 2000 mViewManager->updateView(start, end);
1997 //mDateNavigator->updateView(); 2001 //mDateNavigator->updateView();
1998} 2002}
1999 2003
2000void CalendarView::updateView() 2004void CalendarView::updateView()
2001{ 2005{
2002 DateList tmpList = mNavigator->selectedDates(); 2006 DateList tmpList = mNavigator->selectedDates();
2003 2007
2004 // We assume that the navigator only selects consecutive days. 2008 // We assume that the navigator only selects consecutive days.
2005 updateView( tmpList.first(), tmpList.last() ); 2009 updateView( tmpList.first(), tmpList.last() );
2006} 2010}
2007 2011
2008void CalendarView::updateUnmanagedViews() 2012void CalendarView::updateUnmanagedViews()
2009{ 2013{
2010 mDateNavigator->updateDayMatrix(); 2014 mDateNavigator->updateDayMatrix();
2011} 2015}
2012 2016
2013int CalendarView::msgItemDelete() 2017int CalendarView::msgItemDelete()
2014{ 2018{
2015 return KMessageBox::warningContinueCancel(this, 2019 return KMessageBox::warningContinueCancel(this,
2016 i18n("This item will be\npermanently deleted."), 2020 i18n("This item will be\npermanently deleted."),
2017 i18n("KO/Pi Confirmation"),i18n("Delete")); 2021 i18n("KO/Pi Confirmation"),i18n("Delete"));
2018} 2022}
2019 2023
2020 2024
2021void CalendarView::edit_cut() 2025void CalendarView::edit_cut()
2022{ 2026{
2023 Event *anEvent=0; 2027 Event *anEvent=0;
2024 2028
2025 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2029 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2026 2030
2027 if (mViewManager->currentView()->isEventView()) { 2031 if (mViewManager->currentView()->isEventView()) {
2028 if ( incidence && incidence->type() == "Event" ) { 2032 if ( incidence && incidence->type() == "Event" ) {
2029 anEvent = static_cast<Event *>(incidence); 2033 anEvent = static_cast<Event *>(incidence);
2030 } 2034 }
2031 } 2035 }
2032 2036
2033 if (!anEvent) { 2037 if (!anEvent) {
2034 KNotifyClient::beep(); 2038 KNotifyClient::beep();
2035 return; 2039 return;
2036 } 2040 }
2037 DndFactory factory( mCalendar ); 2041 DndFactory factory( mCalendar );
2038 factory.cutEvent(anEvent); 2042 factory.cutEvent(anEvent);
2039 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2043 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2040} 2044}
2041 2045
2042void CalendarView::edit_copy() 2046void CalendarView::edit_copy()
2043{ 2047{
2044 Event *anEvent=0; 2048 Event *anEvent=0;
2045 2049
2046 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2050 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2047 2051
2048 if (mViewManager->currentView()->isEventView()) { 2052 if (mViewManager->currentView()->isEventView()) {
2049 if ( incidence && incidence->type() == "Event" ) { 2053 if ( incidence && incidence->type() == "Event" ) {
2050 anEvent = static_cast<Event *>(incidence); 2054 anEvent = static_cast<Event *>(incidence);
2051 } 2055 }
2052 } 2056 }
2053 2057
2054 if (!anEvent) { 2058 if (!anEvent) {
2055 KNotifyClient::beep(); 2059 KNotifyClient::beep();
2056 return; 2060 return;
2057 } 2061 }
2058 DndFactory factory( mCalendar ); 2062 DndFactory factory( mCalendar );
2059 factory.copyEvent(anEvent); 2063 factory.copyEvent(anEvent);
2060} 2064}
2061 2065
2062void CalendarView::edit_paste() 2066void CalendarView::edit_paste()
2063{ 2067{
2064 QDate date = mNavigator->selectedDates().first(); 2068 QDate date = mNavigator->selectedDates().first();
2065 2069
2066 DndFactory factory( mCalendar ); 2070 DndFactory factory( mCalendar );
2067 Event *pastedEvent = factory.pasteEvent( date ); 2071 Event *pastedEvent = factory.pasteEvent( date );
2068 2072
2069 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2073 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2070} 2074}
2071 2075
2072void CalendarView::edit_options() 2076void CalendarView::edit_options()
2073{ 2077{
2074 mDialogManager->showOptionsDialog(); 2078 mDialogManager->showOptionsDialog();
2075 //writeSettings(); 2079 //writeSettings();
2076} 2080}
2077void CalendarView::edit_sync_options() 2081void CalendarView::edit_sync_options()
2078{ 2082{
2079 //mDialogManager->showSyncOptions(); 2083 //mDialogManager->showSyncOptions();
2080 //KOPrefs::instance()->mSyncAlgoPrefs 2084 //KOPrefs::instance()->mSyncAlgoPrefs
2081 QDialog dia( this, "dia", true ); 2085 QDialog dia( this, "dia", true );
2082 dia.setCaption( i18n("Device: " ) +mCurrentSyncDevice ); 2086 dia.setCaption( i18n("Device: " ) +mCurrentSyncDevice );
2083 QButtonGroup gr ( 1, Qt::Horizontal, i18n("Sync preferences"), &dia); 2087 QButtonGroup gr ( 1, Qt::Horizontal, i18n("Sync preferences"), &dia);
2084 QVBoxLayout lay ( &dia ); 2088 QVBoxLayout lay ( &dia );
2085 lay.setSpacing( 2 ); 2089 lay.setSpacing( 2 );
2086 lay.setMargin( 3 ); 2090 lay.setMargin( 3 );
2087 lay.addWidget(&gr); 2091 lay.addWidget(&gr);
2088 QRadioButton loc ( i18n("Take local entry on conflict"), &gr ); 2092 QRadioButton loc ( i18n("Take local entry on conflict"), &gr );
2089 QRadioButton rem ( i18n("Take remote entry on conflict"), &gr ); 2093 QRadioButton rem ( i18n("Take remote entry on conflict"), &gr );
2090 QRadioButton newest( i18n("Take newest entry on conflict"), &gr ); 2094 QRadioButton newest( i18n("Take newest entry on conflict"), &gr );
2091 QRadioButton ask( i18n("Ask for every entry on conflict"), &gr ); 2095 QRadioButton ask( i18n("Ask for every entry on conflict"), &gr );
2092 QRadioButton f_loc( i18n("Force: Take local entry always"), &gr ); 2096 QRadioButton f_loc( i18n("Force: Take local entry always"), &gr );
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index dd978bf..5d7db4f 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -1,568 +1,570 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <time.h> 24#include <time.h>
25#ifndef _WIN32_ 25#ifndef _WIN32_
26#include <unistd.h> 26#include <unistd.h>
27#endif 27#endif
28#include <qdir.h> 28#include <qdir.h>
29#include <qtextstream.h> 29#include <qtextstream.h>
30#include <qtextcodec.h> 30#include <qtextcodec.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kconfig.h> 39#include <kconfig.h>
40#include <klocale.h> 40#include <klocale.h>
41#include <kdebug.h> 41#include <kdebug.h>
42#include <kemailsettings.h> 42#include <kemailsettings.h>
43#include <kstaticdeleter.h> 43#include <kstaticdeleter.h>
44#include <libkdepim/kpimglobalprefs.h>
44 45
45#include "koprefs.h" 46#include "koprefs.h"
46#include "mainwindow.h" 47#include "mainwindow.h"
47 48
48const char *germanwords[][2] = { 49const char *germanwords[][2] = {
49#include "wordsgerman.h" 50#include "wordsgerman.h"
50 "", "" 51 "", ""
51}; 52};
52 53
53KOPrefs *KOPrefs::mInstance = 0; 54KOPrefs *KOPrefs::mInstance = 0;
54static KStaticDeleter<KOPrefs> insd; 55static KStaticDeleter<KOPrefs> insd;
55 56
56KOPrefs::KOPrefs() : 57KOPrefs::KOPrefs() :
57 KPimPrefs("korganizerrc") 58 KPimPrefs("korganizerrc")
58{ 59{
59 mCategoryColors.setAutoDelete(true); 60 mCategoryColors.setAutoDelete(true);
60 mLocaleDict = 0; 61 mLocaleDict = 0;
61 fillMailDefaults(); 62 fillMailDefaults();
62 mDefaultCategoryColor = QColor(175,210,255);//196,196,196); 63 mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
63 QColor defaultHolidayColor = QColor(255,0,0); 64 QColor defaultHolidayColor = QColor(255,0,0);
64 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); 65 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
65 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); 66 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
66 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 67 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
67 QColor defaultTodoDueTodayColor = QColor(255,220,100); 68 QColor defaultTodoDueTodayColor = QColor(255,220,100);
68 QColor defaultTodoOverdueColor = QColor(255,153,125); 69 QColor defaultTodoOverdueColor = QColor(255,153,125);
69 70
70 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); 71 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold);
71 mDefaultViewFont = QFont("helvetica",10); 72 mDefaultViewFont = QFont("helvetica",10);
72 mDefaultMonthViewFont = QFont("helvetica",8); 73 mDefaultMonthViewFont = QFont("helvetica",8);
73 mMarcusBainsFont= QFont("helvetica",10); 74 mMarcusBainsFont= QFont("helvetica",10);
74 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); 75 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold);
75 mEditBoxFont = QFont("helvetica",12); 76 mEditBoxFont = QFont("helvetica",12);
76 mJornalViewFont = QFont("helvetica",12); 77 mJornalViewFont = QFont("helvetica",12);
77 78
78 KPrefs::setCurrentGroup("General"); 79 KPrefs::setCurrentGroup("General");
79 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 80 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
80 81
81 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 82 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
82 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 83 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
83 addItemBool("ShowIconSearch",&mShowIconSearch,true); 84 addItemBool("ShowIconSearch",&mShowIconSearch,true);
84 addItemBool("ShowIconList",&mShowIconList,true); 85 addItemBool("ShowIconList",&mShowIconList,true);
85 addItemBool("ShowIconDay1",&mShowIconDay1,true); 86 addItemBool("ShowIconDay1",&mShowIconDay1,true);
86 addItemBool("ShowIconDay5",&mShowIconDay5,true); 87 addItemBool("ShowIconDay5",&mShowIconDay5,true);
87 addItemBool("ShowIconDay7",&mShowIconDay7,true); 88 addItemBool("ShowIconDay7",&mShowIconDay7,true);
88 addItemBool("ShowIconMonth",&mShowIconMonth,true); 89 addItemBool("ShowIconMonth",&mShowIconMonth,true);
89 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 90 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
90 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 91 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
91 addItemBool("ShowIconBack",&mShowIconBack,true); 92 addItemBool("ShowIconBack",&mShowIconBack,true);
92 addItemBool("ShowIconToday",&mShowIconToday,true); 93 addItemBool("ShowIconToday",&mShowIconToday,true);
93 addItemBool("ShowIconForward",&mShowIconForward,true); 94 addItemBool("ShowIconForward",&mShowIconForward,true);
94 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 95 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
95 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false); 96 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false);
96 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 97 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
97 addItemBool("ShowIconNext",&mShowIconNext,true); 98 addItemBool("ShowIconNext",&mShowIconNext,true);
98 addItemBool("ShowIconJournal",&mShowIconJournal,true); 99 addItemBool("ShowIconJournal",&mShowIconJournal,true);
99 addItemBool("ShowIconStretch",&mShowIconStretch,true); 100 addItemBool("ShowIconStretch",&mShowIconStretch,true);
100 addItemBool("LanguageChanged",&mLanguageChanged,false); 101 addItemBool("LanguageChanged",&mLanguageChanged,false);
101 102
102 addItemBool("AskForQuit",&mAskForQuit,false); 103 addItemBool("AskForQuit",&mAskForQuit,false);
103 104
104#ifndef DESKTOP_VERSION 105#ifndef DESKTOP_VERSION
105 addItemBool("ShowFullMenu",&mShowFullMenu,false); 106 addItemBool("ShowFullMenu",&mShowFullMenu,false);
106#else 107#else
107 addItemBool("ShowFullMenu",&mShowFullMenu,true); 108 addItemBool("ShowFullMenu",&mShowFullMenu,true);
108#endif 109#endif
109 addItemBool("ToolBarHor",&mToolBarHor, true ); 110 addItemBool("ToolBarHor",&mToolBarHor, true );
110 addItemBool("ToolBarUp",&mToolBarUp, false ); 111 addItemBool("ToolBarUp",&mToolBarUp, false );
111 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 112 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
112 addItemInt("Whats Next Days",&mWhatsNextDays,3); 113 addItemInt("Whats Next Days",&mWhatsNextDays,3);
113 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 114 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
114 115
115 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 116 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
116 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 117 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
117 addItemInt("AllDay Size",&mAllDaySize,28); 118 addItemInt("AllDay Size",&mAllDaySize,28);
118 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 119 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
119 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 120 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
120 121
121 addItemStringList("LocationDefaults",&mLocationDefaults ); 122 addItemStringList("LocationDefaults",&mLocationDefaults );
122 addItemStringList("EventSummary User",&mEventSummaryUser); 123 addItemStringList("EventSummary User",&mEventSummaryUser);
123 addItemStringList("TodoSummary User",&mTodoSummaryUser); 124 addItemStringList("TodoSummary User",&mTodoSummaryUser);
124 125
125 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 126 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
126 addItemBool("Enable Project View",&mEnableProjectView,false); 127 addItemBool("Enable Project View",&mEnableProjectView,false);
127 addItemBool("Auto Save",&mAutoSave,false); 128 addItemBool("Auto Save",&mAutoSave,false);
128 addItemInt("Auto Save Interval",&mAutoSaveInterval,3); 129 addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
129 addItemBool("Confirm Deletes",&mConfirm,true); 130 addItemBool("Confirm Deletes",&mConfirm,true);
130 addItemString("Archive File",&mArchiveFile); 131 addItemString("Archive File",&mArchiveFile);
131 addItemString("Html Export File",&mHtmlExportFile, 132 addItemString("Html Export File",&mHtmlExportFile,
132 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); 133 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
133 addItemBool("Html With Save",&mHtmlWithSave,false); 134 addItemBool("Html With Save",&mHtmlWithSave,false);
134 135
135 KPrefs::setCurrentGroup("Personal Settings"); 136 KPrefs::setCurrentGroup("Personal Settings");
136 137
137 addItemInt("Mail Client",&mMailClient,MailClientKMail); 138 addItemInt("Mail Client",&mMailClient,MailClientKMail);
138 addItemBool("Use Control Center Email",&mEmailControlCenter,false); 139 addItemBool("Use Control Center Email",&mEmailControlCenter,false);
139 addItemBool("Bcc",&mBcc,false); 140 addItemBool("Bcc",&mBcc,false);
140 141
141 KPrefs::setCurrentGroup("Time & Date"); 142 KPrefs::setCurrentGroup("Time & Date");
142 143
143 // addItemString("Time Zone",&mTimeZone,"+0100"); 144 // addItemString("Time Zone",&mTimeZone,"+0100");
144 addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") ); 145 addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") );
145 // addItemInt("TimeZoneOffset",&mTimeZoneOffset,60); 146 // addItemInt("TimeZoneOffset",&mTimeZoneOffset,60);
146 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); 147 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true);
147 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); 148 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90);
148 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); 149 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304);
149 150
150 151
151 addItemInt("Default Start Time",&mStartTime,10); 152 addItemInt("Default Start Time",&mStartTime,10);
152 addItemInt("Default Duration",&mDefaultDuration,2); 153 addItemInt("Default Duration",&mDefaultDuration,2);
153 addItemInt("Default Alarm Time",&mAlarmTime,3); 154 addItemInt("Default Alarm Time",&mAlarmTime,3);
154 addItemInt("Daylight Savings",&mDaylightSavings,0); 155 addItemInt("Daylight Savings",&mDaylightSavings,0);
155 KPrefs::setCurrentGroup("AlarmSettings"); 156 KPrefs::setCurrentGroup("AlarmSettings");
156 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 157 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
157 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 158 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
158 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 159 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
159 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 160 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
160 161
161 162
162 KPrefs::setCurrentGroup("Calendar"); 163 KPrefs::setCurrentGroup("Calendar");
163 164
164 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 165 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
165 166
166 KPrefs::setCurrentGroup("Fonts"); 167 KPrefs::setCurrentGroup("Fonts");
167 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 168 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
168 addItemFont("TimeBar Font",&mTimeBarFont); 169 addItemFont("TimeBar Font",&mTimeBarFont);
169 addItemFont("MonthView Font",&mMonthViewFont); 170 addItemFont("MonthView Font",&mMonthViewFont);
170 addItemFont("AgendaView Font",&mAgendaViewFont); 171 addItemFont("AgendaView Font",&mAgendaViewFont);
171 addItemFont("MarcusBains Font",&mMarcusBainsFont); 172 addItemFont("MarcusBains Font",&mMarcusBainsFont);
172 addItemFont("TimeLabels Font",&mTimeLabelsFont); 173 addItemFont("TimeLabels Font",&mTimeLabelsFont);
173 addItemFont("TodoView Font",&mTodoViewFont); 174 addItemFont("TodoView Font",&mTodoViewFont);
174 addItemFont("ListView Font",&mListViewFont); 175 addItemFont("ListView Font",&mListViewFont);
175 addItemFont("DateNavigator Font",&mDateNavigatorFont); 176 addItemFont("DateNavigator Font",&mDateNavigatorFont);
176 addItemFont("EditBox Font",&mEditBoxFont); 177 addItemFont("EditBox Font",&mEditBoxFont);
177 addItemFont("JournalView Font",&mJornalViewFont); 178 addItemFont("JournalView Font",&mJornalViewFont);
178 addItemFont("WhatsNextView Font",&mWhatsNextFont); 179 addItemFont("WhatsNextView Font",&mWhatsNextFont);
179 addItemFont("EventView Font",&mEventViewFont); 180 addItemFont("EventView Font",&mEventViewFont);
180 181
181// KPrefs::setCurrentGroup("SyncProfiles"); 182// KPrefs::setCurrentGroup("SyncProfiles");
182// addItemString("LocalMachineName",&mLocalMachineName, "undefined"); 183// addItemString("LocalMachineName",&mLocalMachineName, "undefined");
183// addItemStringList("SyncProfileNames",&mSyncProfileNames); 184// addItemStringList("SyncProfileNames",&mSyncProfileNames);
184// addItemStringList("ExternSyncProfiles",&mExternSyncProfileNames); 185// addItemStringList("ExternSyncProfiles",&mExternSyncProfileNames);
185 186
186 KPrefs::setCurrentGroup("RemoteSyncing"); 187 KPrefs::setCurrentGroup("RemoteSyncing");
187// addItemBool("UsePasswd",&mUsePassWd,false); 188// addItemBool("UsePasswd",&mUsePassWd,false);
188// addItemBool("WriteBackFile",&mWriteBackFile,true); 189// addItemBool("WriteBackFile",&mWriteBackFile,true);
189// addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false); 190// addItemBool("WriteBackExistingOnly",&mWriteBackExistingOnly,false);
190// addItemBool("AskForPreferences",&mAskForPreferences,true); 191// addItemBool("AskForPreferences",&mAskForPreferences,true);
191// addItemBool("ShowSyncSummary",&mShowSyncSummary,true); 192// addItemBool("ShowSyncSummary",&mShowSyncSummary,true);
192 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 193 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
193 addItemInt("LastSyncTime",&mLastSyncTime,0); 194 addItemInt("LastSyncTime",&mLastSyncTime,0);
194 addItemInt("SyncAlgoPrefs",&mSyncAlgoPrefs,3); 195 addItemInt("SyncAlgoPrefs",&mSyncAlgoPrefs,3);
195 addItemInt("RingSyncAlgoPrefs",&mRingSyncAlgoPrefs,3); 196 addItemInt("RingSyncAlgoPrefs",&mRingSyncAlgoPrefs,3);
196 197
197#ifdef _WIN32_ 198#ifdef _WIN32_
198 QString hdp= locateLocal("data","korganizer")+"\\\\"; 199 QString hdp= locateLocal("data","korganizer")+"\\\\";
199#else 200#else
200 QString hdp= locateLocal("data","korganizer")+"/"; 201 QString hdp= locateLocal("data","korganizer")+"/";
201#endif 202#endif
202// addItemString("RemoteIP",&mRemoteIP, "192.168.0.65"); 203// addItemString("RemoteIP",&mRemoteIP, "192.168.0.65");
203// addItemString("RemoteUser",&mRemoteUser, "zaurus"); 204// addItemString("RemoteUser",&mRemoteUser, "zaurus");
204// addItemString("RemotePassWd",&mRemotePassWd, ""); 205// addItemString("RemotePassWd",&mRemotePassWd, "");
205// addItemString("RemoteFile", &mRemoteFile, hdp+"mycalendar.ics"); 206// addItemString("RemoteFile", &mRemoteFile, hdp+"mycalendar.ics");
206// addItemString("LocalTempFile",&mLocalTempFile, "/tmp/tempsyncfile.ics" ); 207// addItemString("LocalTempFile",&mLocalTempFile, "/tmp/tempsyncfile.ics" );
207 208
208 209
209 KPrefs::setCurrentGroup("LoadSaveFileNames"); 210 KPrefs::setCurrentGroup("LoadSaveFileNames");
210 211
211 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 212 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
212 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 213 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
213 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 214 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
214 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 215 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
215 addItemString("LastSyncedLocalFile", &mLastSyncedLocalFile ,hdp +"lastsync.ics" ); 216 addItemString("LastSyncedLocalFile", &mLastSyncedLocalFile ,hdp +"lastsync.ics" );
216 217
217 218
218 KPrefs::setCurrentGroup("Locale"); 219 KPrefs::setCurrentGroup("Locale");
219 addItemInt("PreferredLanguage",&mPreferredLanguage,0); 220 addItemInt("PreferredLanguage",&mPreferredLanguage,0);
220 addItemInt("PreferredTime",&mPreferredTime,0); 221 addItemInt("PreferredTime",&mPreferredTime,0);
221 addItemInt("PreferredDate",&mPreferredDate,0); 222 addItemInt("PreferredDate",&mPreferredDate,0);
222 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); 223 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false);
223 addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false); 224 addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false);
224 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 225 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
225 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); 226 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y");
226 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); 227 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y");
227 228
228 229
229 KPrefs::setCurrentGroup("Colors"); 230 KPrefs::setCurrentGroup("Colors");
230 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 231 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
231 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 232 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
232 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 233 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
233 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 234 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
234 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 235 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
235 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 236 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
236 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 237 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
237 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 238 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
238 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 239 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
239 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 240 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
240 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 241 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
241 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 242 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
242 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 243 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
243 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 244 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
244 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 245 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
245 addItemBool("UseAppColors",&mUseAppColors,false); 246 addItemBool("UseAppColors",&mUseAppColors,false);
246 247
247 248
248 249
249 KPrefs::setCurrentGroup("Views"); 250 KPrefs::setCurrentGroup("Views");
250 addItemInt("Hour Size",&mHourSize,8); 251 addItemInt("Hour Size",&mHourSize,8);
251 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 252 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
252 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 253 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
253 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 254 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
254 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 255 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
255 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 256 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
256 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 257 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
257 addItemBool("Enable ToolTips",&mEnableToolTips,false); 258 addItemBool("Enable ToolTips",&mEnableToolTips,false);
258 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 259 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
259 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 260 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
260 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 261 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
261 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 262 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
262 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); 263 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false);
263 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 264 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
264 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 265 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
265 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 266 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
266 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 267 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
267 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true); 268 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);
268 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 269 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
269 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 270 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
270 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 271 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
271 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 272 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
272 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 273 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
273 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); 274 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false);
274 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 275 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
275 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 276 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
276#ifdef DESKTOP_VERSION 277#ifdef DESKTOP_VERSION
277 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 278 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
278#else 279#else
279 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 280 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
280#endif 281#endif
281 addItemInt("Day Begins",&mDayBegins,7); 282 addItemInt("Day Begins",&mDayBegins,7);
282 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 283 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
283 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 284 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
284 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 285 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
285 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 286 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
286 287
287 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 288 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
288 addItemBool("Full View Month",&mFullViewMonth,true); 289 addItemBool("Full View Month",&mFullViewMonth,true);
289 addItemBool("Full View Todo",&mFullViewTodo,true); 290 addItemBool("Full View Todo",&mFullViewTodo,true);
290 addItemBool("Quick Todo",&mEnableQuickTodo,false); 291 addItemBool("Quick Todo",&mEnableQuickTodo,false);
291 292
292 addItemInt("Next X Days",&mNextXDays,3); 293 addItemInt("Next X Days",&mNextXDays,3);
293 294
294 KPrefs::setCurrentGroup("Printer"); 295 KPrefs::setCurrentGroup("Printer");
295 296
296 KPrefs::setCurrentGroup("Layout"); 297 KPrefs::setCurrentGroup("Layout");
297 298
298 addItemBool("CompactDialogs",&mCompactDialogs,false); 299 addItemBool("CompactDialogs",&mCompactDialogs,false);
299 addItemBool("VerticalScreen",&mVerticalScreen,true); 300 addItemBool("VerticalScreen",&mVerticalScreen,true);
300 301
301 KPrefs::setCurrentGroup("KOrganizer Plugins"); 302 KPrefs::setCurrentGroup("KOrganizer Plugins");
302 303
303 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 304 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
304 305
305 KPrefs::setCurrentGroup("Group Scheduling"); 306 KPrefs::setCurrentGroup("Group Scheduling");
306 307
307 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 308 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
308 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 309 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
309 addItemStringList("AdditionalMails",&mAdditionalMails,""); 310 addItemStringList("AdditionalMails",&mAdditionalMails,"");
310 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 311 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
311 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 312 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
312 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 313 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
313 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 314 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
314 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 315 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
315 316
316 KPrefs::setCurrentGroup( "Editors" ); 317 KPrefs::setCurrentGroup( "Editors" );
317 318
318 addItemStringList( "EventTemplates", &mEventTemplates ); 319 addItemStringList( "EventTemplates", &mEventTemplates );
319 addItemStringList( "TodoTemplates", &mTodoTemplates ); 320 addItemStringList( "TodoTemplates", &mTodoTemplates );
320 321
321 addItemInt("DestinationPolicy",&mDestination,standardDestination); 322 addItemInt("DestinationPolicy",&mDestination,standardDestination);
322 323
323 324
324 325
325} 326}
326 327
327 328
328KOPrefs::~KOPrefs() 329KOPrefs::~KOPrefs()
329{ 330{
330 if (mInstance == this) 331 if (mInstance == this)
331 mInstance = insd.setObject(0); 332 mInstance = insd.setObject(0);
332 setLocaleDict( 0 ); 333 setLocaleDict( 0 );
333 if ( mLocaleDict ) 334 if ( mLocaleDict )
334 delete mLocaleDict; 335 delete mLocaleDict;
335 //qDebug("KOPrefs::~KOPrefs() "); 336 //qDebug("KOPrefs::~KOPrefs() ");
336} 337}
337 338
338 339
339KOPrefs *KOPrefs::instance() 340KOPrefs *KOPrefs::instance()
340{ 341{
341 if (!mInstance) { 342 if (!mInstance) {
342 mInstance = insd.setObject(new KOPrefs()); 343 mInstance = insd.setObject(new KOPrefs());
343 mInstance->readConfig(); 344 mInstance->readConfig();
344 } 345 }
345 346
346 return mInstance; 347 return mInstance;
347} 348}
348 349
349void KOPrefs::usrSetDefaults() 350void KOPrefs::usrSetDefaults()
350{ 351{
351 352
352} 353}
353 354
354void KOPrefs::fillMailDefaults() 355void KOPrefs::fillMailDefaults()
355{ 356{
356 if (mName.isEmpty()) mName = i18n("Anonymous"); 357 if (mName.isEmpty()) mName = i18n("Anonymous");
357 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 358 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
358} 359}
359 360
360void KOPrefs::setTimeZoneIdDefault() 361void KOPrefs::setTimeZoneIdDefault()
361{ 362{
362 mTimeZoneId = i18n("+01:00 Europe/Oslo(CET)"); 363 mTimeZoneId = i18n("+01:00 Europe/Oslo(CET)");
363} 364}
364 365
365void KOPrefs::setCategoryDefaults() 366void KOPrefs::setCategoryDefaults()
366{ 367{
367 mCustomCategories.clear(); 368 mCustomCategories.clear();
368 mCustomCategories = getDefaultList(); 369 mCustomCategories = getDefaultList();
369 370
370 QStringList::Iterator it; 371 QStringList::Iterator it;
371 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 372 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
372 setCategoryColor(*it,mDefaultCategoryColor); 373 setCategoryColor(*it,mDefaultCategoryColor);
373 } 374 }
374} 375}
375 376
376QStringList KOPrefs::getDefaultList() 377QStringList KOPrefs::getDefaultList()
377{ 378{
378 QStringList retval ; 379 QStringList retval ;
379 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") 380 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer")
380 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") 381 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner")
381 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") 382 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts")
382 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") 383 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids")
383 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") 384 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel")
384 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") 385 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping")
385 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") 386 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University")
386 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; 387 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ;
387 retval.sort(); 388 retval.sort();
388 return retval; 389 return retval;
389} 390}
390 391
391void KOPrefs::usrReadConfig() 392void KOPrefs::usrReadConfig()
392{ 393{
394 mPreferredLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
393 mLocaleDict = 0; 395 mLocaleDict = 0;
394 // pending LR fix translation 396 // pending LR fix translation
395 // qDebug("KOPrefs::usrReadConfig() fix translation "); 397 // qDebug("KOPrefs::usrReadConfig() fix translation ");
396 if ( mPreferredLanguage > 0 && mPreferredLanguage < 4 ) { 398 if ( mPreferredLanguage > 0 && mPreferredLanguage < 4 ) {
397 if ( mPreferredLanguage == 1 ) { 399 if ( mPreferredLanguage == 1 ) {
398 mLocaleDict = new QDict<QString>; 400 mLocaleDict = new QDict<QString>;
399 int i = 0; 401 int i = 0;
400 QString fw ( germanwords[i] [0]); 402 QString fw ( germanwords[i] [0]);
401 while ( !fw.isEmpty() ) { 403 while ( !fw.isEmpty() ) {
402 mLocaleDict->insert( fw, new QString (germanwords[i] [1] )); 404 mLocaleDict->insert( fw, new QString (germanwords[i] [1] ));
403 ++i; 405 ++i;
404 fw = germanwords[i] [0]; 406 fw = germanwords[i] [0];
405 } 407 }
406 408
407 setLocaleDict( mLocaleDict ); 409 setLocaleDict( mLocaleDict );
408 } else { 410 } else {
409 QString fileName ; 411 QString fileName ;
410 if ( mPreferredLanguage == 3 ) 412 if ( mPreferredLanguage == 3 )
411 fileName = MainWindow::resourcePath()+"usertranslation.txt"; 413 fileName = MainWindow::resourcePath()+"usertranslation.txt";
412 else if ( mPreferredLanguage == 2 ) 414 else if ( mPreferredLanguage == 2 )
413 fileName = MainWindow::resourcePath()+"frenchtranslation.txt"; 415 fileName = MainWindow::resourcePath()+"frenchtranslation.txt";
414 QFile file( fileName ); 416 QFile file( fileName );
415 if (file.open( IO_ReadOnly ) ) { 417 if (file.open( IO_ReadOnly ) ) {
416 QTextStream ts( &file ); 418 QTextStream ts( &file );
417 ts.setEncoding( QTextStream::Latin1 ); 419 ts.setEncoding( QTextStream::Latin1 );
418 //ts.setCodec( QTextCodec::latin1 ); 420 //ts.setCodec( QTextCodec::latin1 );
419 QString text = ts.read(); 421 QString text = ts.read();
420 file.close(); 422 file.close();
421 text.replace( QRegExp("\\\\n"), "\n" ); 423 text.replace( QRegExp("\\\\n"), "\n" );
422 QString line; 424 QString line;
423 QString we; 425 QString we;
424 QString wt; 426 QString wt;
425 int br = 0; 427 int br = 0;
426 int nbr; 428 int nbr;
427 nbr = text.find ( "},", br ); 429 nbr = text.find ( "},", br );
428 line = text.mid( br, nbr - br ); 430 line = text.mid( br, nbr - br );
429 br = nbr+1; 431 br = nbr+1;
430 int se, ee, st, et; 432 int se, ee, st, et;
431 mLocaleDict = new QDict<QString>; 433 mLocaleDict = new QDict<QString>;
432 QString end = "{ \"\",\"\" }"; 434 QString end = "{ \"\",\"\" }";
433 while ( (line != end) && (br > 1) ) { 435 while ( (line != end) && (br > 1) ) {
434 //qDebug("%d *%s* ", br, line.latin1()); 436 //qDebug("%d *%s* ", br, line.latin1());
435 se = line.find("\"")+1; 437 se = line.find("\"")+1;
436 et = line.findRev("\"",-1); 438 et = line.findRev("\"",-1);
437 ee = line.find("\",\""); 439 ee = line.find("\",\"");
438 st = ee+3; 440 st = ee+3;
439 we = line.mid( se, ee-se ); 441 we = line.mid( se, ee-se );
440 wt = line.mid( st, et-st ); 442 wt = line.mid( st, et-st );
441 //qDebug("*%s* *%s* ", we.latin1(), wt.latin1()); 443 //qDebug("*%s* *%s* ", we.latin1(), wt.latin1());
442 mLocaleDict->insert( we, new QString (wt) ); 444 mLocaleDict->insert( we, new QString (wt) );
443 nbr = text.find ( "}", br ); 445 nbr = text.find ( "}", br );
444 line = text.mid( br, nbr - br ); 446 line = text.mid( br, nbr - br );
445 br = nbr+1; 447 br = nbr+1;
446 } 448 }
447 //qDebug("end *%s* ", end.latin1()); 449 //qDebug("end *%s* ", end.latin1());
448 450
449 setLocaleDict( mLocaleDict ); 451 setLocaleDict( mLocaleDict );
450 } else { 452 } else {
451 qDebug("KO: Cannot find translation file %s",fileName.latin1() ); 453 qDebug("KO: Cannot find translation file %s",fileName.latin1() );
452 } 454 }
453 455
454 } 456 }
455 } 457 }
456 config()->setGroup("General"); 458 config()->setGroup("General");
457 459
458 mCustomCategories = config()->readListEntry("Custom Categories"); 460 mCustomCategories = config()->readListEntry("Custom Categories");
459 if ( KOPrefs::instance()->mLanguageChanged ) { 461 if ( KOPrefs::instance()->mLanguageChanged ) {
460 mLocationDefaults.clear(); 462 mLocationDefaults.clear();
461 mEventSummaryUser.clear(); 463 mEventSummaryUser.clear();
462 mTodoSummaryUser.clear(); 464 mTodoSummaryUser.clear();
463 } 465 }
464 if (mLocationDefaults.isEmpty()) { 466 if (mLocationDefaults.isEmpty()) {
465 mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") 467 mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
466 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") 468 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
467 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 469 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
468 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 470 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
469 mLocationDefaults.sort(); 471 mLocationDefaults.sort();
470 } 472 }
471 473
472 if (mEventSummaryUser.isEmpty()) { 474 if (mEventSummaryUser.isEmpty()) {
473 mEventSummaryUser = getDefaultList() ; 475 mEventSummaryUser = getDefaultList() ;
474 } 476 }
475 if (mTodoSummaryUser.isEmpty()) { 477 if (mTodoSummaryUser.isEmpty()) {
476 mTodoSummaryUser = getDefaultList() ; 478 mTodoSummaryUser = getDefaultList() ;
477 } 479 }
478 480
479 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 481 if (mCustomCategories.isEmpty()) setCategoryDefaults();
480 482
481 config()->setGroup("Personal Settings"); 483 config()->setGroup("Personal Settings");
482 mName = config()->readEntry("user_name",""); 484 mName = config()->readEntry("user_name","");
483 mEmail = config()->readEntry("user_email",""); 485 mEmail = config()->readEntry("user_email","");
484 fillMailDefaults(); 486 fillMailDefaults();
485 487
486 config()->setGroup("Category Colors"); 488 config()->setGroup("Category Colors");
487 QStringList::Iterator it; 489 QStringList::Iterator it;
488 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 490 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
489 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 491 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
490 492
491 } 493 }
492 494
493 if (mTimeZoneId.isEmpty()) { 495 if (mTimeZoneId.isEmpty()) {
494 setTimeZoneIdDefault(); 496 setTimeZoneIdDefault();
495 } 497 }
496 KPimPrefs::usrReadConfig(); 498 KPimPrefs::usrReadConfig();
497} 499}
498 500
499 501
500void KOPrefs::usrWriteConfig() 502void KOPrefs::usrWriteConfig()
501{ 503{
502 config()->setGroup("General"); 504 config()->setGroup("General");
503 config()->writeEntry("Custom Categories",mCustomCategories); 505 config()->writeEntry("Custom Categories",mCustomCategories);
504 506
505 config()->setGroup("Personal Settings"); 507 config()->setGroup("Personal Settings");
506 config()->writeEntry("user_name",mName); 508 config()->writeEntry("user_name",mName);
507 config()->writeEntry("user_email",mEmail); 509 config()->writeEntry("user_email",mEmail);
508 510
509 config()->setGroup("Category Colors"); 511 config()->setGroup("Category Colors");
510 QDictIterator<QColor> it(mCategoryColors); 512 QDictIterator<QColor> it(mCategoryColors);
511 while (it.current()) { 513 while (it.current()) {
512 config()->writeEntry(it.currentKey(),*(it.current())); 514 config()->writeEntry(it.currentKey(),*(it.current()));
513 ++it; 515 ++it;
514 } 516 }
515 517
516 518
517 KPimPrefs::usrWriteConfig(); 519 KPimPrefs::usrWriteConfig();
518} 520}
519 521
520void KOPrefs::setCategoryColor(QString cat,const QColor & color) 522void KOPrefs::setCategoryColor(QString cat,const QColor & color)
521{ 523{
522 mCategoryColors.replace(cat,new QColor(color)); 524 mCategoryColors.replace(cat,new QColor(color));
523} 525}
524 526
525QColor *KOPrefs::categoryColor(QString cat) 527QColor *KOPrefs::categoryColor(QString cat)
526{ 528{
527 QColor *color = 0; 529 QColor *color = 0;
528 530
529 if (!cat.isEmpty()) color = mCategoryColors[cat]; 531 if (!cat.isEmpty()) color = mCategoryColors[cat];
530 532
531 if (color) return color; 533 if (color) return color;
532 else return &mDefaultCategoryColor; 534 else return &mDefaultCategoryColor;
533} 535}
534 536
535void KOPrefs::setFullName(const QString &name) 537void KOPrefs::setFullName(const QString &name)
536{ 538{
537 mName = name; 539 mName = name;
538} 540}
539 541
540void KOPrefs::setEmail(const QString &email) 542void KOPrefs::setEmail(const QString &email)
541{ 543{
542 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); 544 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() );
543 mEmail = email; 545 mEmail = email;
544} 546}
545 547
546QString KOPrefs::fullName() 548QString KOPrefs::fullName()
547{ 549{
548 if (mEmailControlCenter) { 550 if (mEmailControlCenter) {
549 KEMailSettings settings; 551 KEMailSettings settings;
550 return settings.getSetting(KEMailSettings::RealName); 552 return settings.getSetting(KEMailSettings::RealName);
551 } else { 553 } else {
552 return mName; 554 return mName;
553 } 555 }
554} 556}
555 557
556QString KOPrefs::email() 558QString KOPrefs::email()
557{ 559{
558 if (mEmailControlCenter) { 560 if (mEmailControlCenter) {
559 KEMailSettings settings; 561 KEMailSettings settings;
560 return settings.getSetting(KEMailSettings::EmailAddress); 562 return settings.getSetting(KEMailSettings::EmailAddress);
561 } else { 563 } else {
562 return mEmail; 564 return mEmail;
563 } 565 }
564} 566}
565KConfig* KOPrefs::getConfig() 567KConfig* KOPrefs::getConfig()
566{ 568{
567 return config(); 569 return config();
568} 570}
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 7dafcd8..b4b3b27 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -1,417 +1,421 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qbuttongroup.h> 27#include <qbuttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qvbox.h> 34#include <qvbox.h>
35#include <qhbox.h> 35#include <qhbox.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <qstrlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44 44
45#include <kcolorbutton.h> 45#include <kcolorbutton.h>
46#include <kdebug.h> 46#include <kdebug.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobal.h> 48#include <kglobal.h>
49#include <kfontdialog.h> 49#include <kfontdialog.h>
50#include <kfiledialog.h> 50#include <kfiledialog.h>
51#include <kmessagebox.h> 51#include <kmessagebox.h>
52#include <kcolordialog.h> 52#include <kcolordialog.h>
53#include <kiconloader.h> 53#include <kiconloader.h>
54#include <kemailsettings.h> 54#include <kemailsettings.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56 56
57#include <kurlrequester.h> 57#include <kurlrequester.h>
58#include <klineedit.h> 58#include <klineedit.h>
59 59
60#if defined(USE_SOLARIS) 60#if defined(USE_SOLARIS)
61#include <sys/param.h> 61#include <sys/param.h>
62 62
63#define ZONEINFODIR "/usr/share/lib/zoneinfo" 63#define ZONEINFODIR "/usr/share/lib/zoneinfo"
64#define INITFILE "/etc/default/init" 64#define INITFILE "/etc/default/init"
65#endif 65#endif
66 66
67#include "koprefs.h" 67#include "koprefs.h"
68 68
69#include "koprefsdialog.h" 69#include "koprefsdialog.h"
70#include "kpimglobalprefs.h" 70#include "kpimglobalprefs.h"
71 71
72 72
73KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : 73KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
74 KPrefsDialog(KOPrefs::instance(),parent,name,true) 74 KPrefsDialog(KOPrefs::instance(),parent,name,true)
75{ 75{
76 76
77 setCaption( i18n("Preferences - some settings need a restart (nr)")); 77 setCaption( i18n("Preferences - some settings need a restart (nr)"));
78 mCategoryDict.setAutoDelete(true); 78 mCategoryDict.setAutoDelete(true);
79 79
80 KGlobal::locale()->insertCatalogue("timezones"); 80 KGlobal::locale()->insertCatalogue("timezones");
81 81
82 setupGlobalTab(); 82 setupGlobalTab();
83 setupMainTab(); 83 setupMainTab();
84 setupLocaleTab(); 84 // setupLocaleTab();
85 setupTimeZoneTab(); 85 //setupTimeZoneTab();
86 setupTimeTab(); 86 setupTimeTab();
87 setupLocaleDateTab(); 87 //setupLocaleDateTab();
88 setupFontsTab(); 88 setupFontsTab();
89 setupColorsTab(); 89 setupColorsTab();
90 setupViewsTab(); 90 setupViewsTab();
91 //setupSyncTab(); 91 //setupSyncTab();
92 //setupSyncAlgTab(); 92 //setupSyncAlgTab();
93 //setupPrinterTab(); 93 //setupPrinterTab();
94 //setupGroupSchedulingTab(); 94 //setupGroupSchedulingTab();
95 //setupGroupAutomationTab(); 95 //setupGroupAutomationTab();
96} 96}
97 97
98 98
99KOPrefsDialog::~KOPrefsDialog() 99KOPrefsDialog::~KOPrefsDialog()
100{ 100{
101} 101}
102void KOPrefsDialog::setupGlobalTab() 102void KOPrefsDialog::setupGlobalTab()
103{ 103{
104 QFrame *topFrame = addPage(i18n("Global"),0,0); 104 QFrame *topFrame = addPage(i18n("Global"),0,0);
105 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); 105 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" );
106 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 106 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
107 topLayout->addWidget( kdelibcfg ); 107 topLayout->addWidget( kdelibcfg );
108 108
109 109
110} 110}
111void KOPrefsDialog::setupLocaleDateTab() 111void KOPrefsDialog::setupLocaleDateTab()
112{ 112{
113#if 0
113QFrame *topFrame = addPage(i18n("Date Format"),0,0); 114QFrame *topFrame = addPage(i18n("Date Format"),0,0);
114 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 115 QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
115 topLayout->setSpacing(spacingHint()); 116 topLayout->setSpacing(spacingHint());
116 topLayout->setMargin(marginHint()); 117 topLayout->setMargin(marginHint());
117 int iii = 0; 118 int iii = 0;
118 119
119 120
120 KPrefsDialogWidRadios *syncPrefsGroup = 121 KPrefsDialogWidRadios *syncPrefsGroup =
121 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 122 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
122 QString format; 123 QString format;
123 if ( QApplication::desktop()->width() < 480 ) 124 if ( QApplication::desktop()->width() < 480 )
124 format = "(%d.%m.%Y)"; 125 format = "(%d.%m.%Y)";
125 else 126 else
126 format = "(%d.%m.%Y|%A %d %B %Y)"; 127 format = "(%d.%m.%Y|%A %d %B %Y)";
127 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 128 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
128 if ( QApplication::desktop()->width() < 480 ) 129 if ( QApplication::desktop()->width() < 480 )
129 format = "(%m.%d.%Y)"; 130 format = "(%m.%d.%Y)";
130 else 131 else
131 format = "(%m.%d.%Y|%A %B %d %Y)"; 132 format = "(%m.%d.%Y|%A %B %d %Y)";
132 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 133 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
133 if ( QApplication::desktop()->width() < 480 ) 134 if ( QApplication::desktop()->width() < 480 )
134 format = "(%Y-%m-%d)"; 135 format = "(%Y-%m-%d)";
135 else 136 else
136 format = "(%Y-%m-%d|%A %Y %B %d)"; 137 format = "(%Y-%m-%d|%A %Y %B %d)";
137 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 138 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
138 syncPrefsGroup->addRadio(i18n("User defined")); 139 syncPrefsGroup->addRadio(i18n("User defined"));
139 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 140 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
140 ++iii; 141 ++iii;
141 ++iii; 142 ++iii;
142 QLabel * lab; 143 QLabel * lab;
143 mUserDateFormatLong = new QLineEdit(topFrame); 144 mUserDateFormatLong = new QLineEdit(topFrame);
144 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 145 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
145 topLayout->addWidget(lab ,iii,0); 146 topLayout->addWidget(lab ,iii,0);
146 topLayout->addWidget(mUserDateFormatLong,iii,1); 147 topLayout->addWidget(mUserDateFormatLong,iii,1);
147 ++iii; 148 ++iii;
148 mUserDateFormatShort = new QLineEdit(topFrame); 149 mUserDateFormatShort = new QLineEdit(topFrame);
149 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 150 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
150 topLayout->addWidget(lab ,iii,0); 151 topLayout->addWidget(lab ,iii,0);
151 topLayout->addWidget(mUserDateFormatShort,iii,1); 152 topLayout->addWidget(mUserDateFormatShort,iii,1);
152 ++iii; 153 ++iii;
153 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 154 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
154 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 155 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
155 ++iii; 156 ++iii;
156 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 157 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
157 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 158 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
158 ++iii; 159 ++iii;
159 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 160 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
160 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 161 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
161 ++iii; 162 ++iii;
163#endif
162 164
163} 165}
164 166
165void KOPrefsDialog::setupLocaleTab() 167void KOPrefsDialog::setupLocaleTab()
166{ 168{
169#if 0
167 QFrame *topFrame = addPage(i18n("Locale"),0,0); 170 QFrame *topFrame = addPage(i18n("Locale"),0,0);
168 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 171 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
169 topLayout->setSpacing(spacingHint()); 172 topLayout->setSpacing(spacingHint());
170 topLayout->setMargin(marginHint()); 173 topLayout->setMargin(marginHint());
171 int iii = 0; 174 int iii = 0;
172 KPrefsDialogWidRadios *syncPrefsGroup = 175 KPrefsDialogWidRadios *syncPrefsGroup =
173 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 176 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
174 syncPrefsGroup->addRadio(i18n("English")); 177 syncPrefsGroup->addRadio(i18n("English"));
175 syncPrefsGroup->addRadio(i18n("German")); 178 syncPrefsGroup->addRadio(i18n("German"));
176 syncPrefsGroup->addRadio(i18n("French")); 179 syncPrefsGroup->addRadio(i18n("French"));
177 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 180 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
178 if ( QApplication::desktop()->width() < 300 ) 181 if ( QApplication::desktop()->width() < 300 )
179 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 182 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
180 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 183 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
181 ++iii; 184 ++iii;
182 185
183 syncPrefsGroup = 186 syncPrefsGroup =
184 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); 187 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
185 if ( QApplication::desktop()->width() > 300 ) 188 if ( QApplication::desktop()->width() > 300 )
186 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 189 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
187 syncPrefsGroup->addRadio(i18n("24:00")); 190 syncPrefsGroup->addRadio(i18n("24:00"));
188 syncPrefsGroup->addRadio(i18n("12:00am")); 191 syncPrefsGroup->addRadio(i18n("12:00am"));
189 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 192 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
190 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 193 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
191 ++iii; 194 ++iii;
192 KPrefsDialogWidBool *sb; 195 KPrefsDialogWidBool *sb;
193 if ( QApplication::desktop()->width() < 300 ) { 196 if ( QApplication::desktop()->width() < 300 ) {
194 sb = 197 sb =
195 addWidBool(i18n("Week starts on Sunday"), 198 addWidBool(i18n("Week starts on Sunday"),
196 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); 199 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
197 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 200 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
198 ++iii; 201 ++iii;
199 sb = 202 sb =
200 addWidBool(i18n("Use short date in (WN/E) view"), 203 addWidBool(i18n("Use short date in (WN/E) view"),
201 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 204 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
202 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 205 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
203 } 206 }
204 else { 207 else {
205 QWidget * hb = new QWidget( topFrame ); 208 QWidget * hb = new QWidget( topFrame );
206 QHBoxLayout *hbLayout = new QHBoxLayout(hb); 209 QHBoxLayout *hbLayout = new QHBoxLayout(hb);
207 sb = 210 sb =
208 addWidBool(i18n("Week starts on Sunday"), 211 addWidBool(i18n("Week starts on Sunday"),
209 &(KOPrefs::instance()->mWeekStartsOnSunday),hb); 212 &(KOPrefs::instance()->mWeekStartsOnSunday),hb);
210 hbLayout->addWidget(sb->checkBox() ); 213 hbLayout->addWidget(sb->checkBox() );
211 sb = 214 sb =
212 addWidBool(i18n("Use short date in (WN/E) view"), 215 addWidBool(i18n("Use short date in (WN/E) view"),
213 &(KOPrefs::instance()->mShortDateInViewer),hb); 216 &(KOPrefs::instance()->mShortDateInViewer),hb);
214 hbLayout->addWidget(sb->checkBox() ); 217 hbLayout->addWidget(sb->checkBox() );
215 topLayout->addMultiCellWidget(hb, iii,iii,0,1); 218 topLayout->addMultiCellWidget(hb, iii,iii,0,1);
216 219
217 } 220 }
218 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION 221 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
219#if 0 222#if 0
220 ++iii; 223 ++iii;
221 sb = 224 sb =
222 addWidBool(i18n("Quick load/save (w/o Unicode)"), 225 addWidBool(i18n("Quick load/save (w/o Unicode)"),
223 &(KOPrefs::instance()->mUseQuicksave),topFrame); 226 &(KOPrefs::instance()->mUseQuicksave),topFrame);
224 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 227 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
225#endif 228#endif
229#endif
226} 230}
227void KOPrefsDialog::showSyncPage() 231void KOPrefsDialog::showSyncPage()
228{ 232{
229 showPage ( 2 ) ; 233 showPage ( 2 ) ;
230 234
231} 235}
232void KOPrefsDialog::setupSyncAlgTab() 236void KOPrefsDialog::setupSyncAlgTab()
233{ 237{
234#if 0 238#if 0
235 QLabel * lab; 239 QLabel * lab;
236 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); 240 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0);
237 mSetupSyncAlgTab = topFrame; 241 mSetupSyncAlgTab = topFrame;
238 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 242 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
239 topLayout->setSpacing(spacingHint()); 243 topLayout->setSpacing(spacingHint());
240 topLayout->setMargin(marginHint()); 244 topLayout->setMargin(marginHint());
241 int iii = 0; 245 int iii = 0;
242 246
243 KPrefsDialogWidBool *sb = 247 KPrefsDialogWidBool *sb =
244 addWidBool(i18n("Ask for preferences before syncing"), 248 addWidBool(i18n("Ask for preferences before syncing"),
245 &(KOPrefs::instance()->mAskForPreferences),topFrame); 249 &(KOPrefs::instance()->mAskForPreferences),topFrame);
246 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 250 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
247 251
248 ++iii; 252 ++iii;
249 253
250 KPrefsDialogWidRadios *syncPrefsGroup = 254 KPrefsDialogWidRadios *syncPrefsGroup =
251 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), 255 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs),
252 topFrame); 256 topFrame);
253 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); 257 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
254 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); 258 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
255 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); 259 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
256 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); 260 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
257 syncPrefsGroup->addRadio(i18n("Force take local entry always")); 261 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
258 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); 262 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
259 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 263 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
260 ++iii; 264 ++iii;
261 sb = 265 sb =
262 addWidBool(i18n("Show summary after syncing"), 266 addWidBool(i18n("Show summary after syncing"),
263 &(KOPrefs::instance()->mShowSyncSummary),topFrame); 267 &(KOPrefs::instance()->mShowSyncSummary),topFrame);
264 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 268 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
265 269
266 ++iii; 270 ++iii;
267#endif 271#endif
268 272
269 273
270 274
271} 275}
272 276
273 277
274void KOPrefsDialog::setupSyncTab() 278void KOPrefsDialog::setupSyncTab()
275{ 279{
276#if 0 280#if 0
277 QLabel * lab; 281 QLabel * lab;
278 QFrame *topFrame = addPage(i18n("Sync Network"),0,0); 282 QFrame *topFrame = addPage(i18n("Sync Network"),0,0);
279 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 283 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
280 topLayout->setSpacing(spacingHint()); 284 topLayout->setSpacing(spacingHint());
281 topLayout->setMargin(marginHint()); 285 topLayout->setMargin(marginHint());
282 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); 286 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame);
283 int iii = 0; 287 int iii = 0;
284 topLayout->addMultiCellWidget(lab , iii,iii,0,1); 288 topLayout->addMultiCellWidget(lab , iii,iii,0,1);
285 ++iii; 289 ++iii;
286 290
287 mRemoteIPEdit = new QLineEdit(topFrame); 291 mRemoteIPEdit = new QLineEdit(topFrame);
288 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); 292 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame);
289 topLayout->addWidget(lab ,iii,0); 293 topLayout->addWidget(lab ,iii,0);
290 topLayout->addWidget(mRemoteIPEdit,iii,1); 294 topLayout->addWidget(mRemoteIPEdit,iii,1);
291 ++iii; 295 ++iii;
292 mRemoteUser = new QLineEdit(topFrame); 296 mRemoteUser = new QLineEdit(topFrame);
293 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); 297 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame);
294 topLayout->addWidget(lab ,iii,0); 298 topLayout->addWidget(lab ,iii,0);
295 topLayout->addWidget(mRemoteUser, iii,1); 299 topLayout->addWidget(mRemoteUser, iii,1);
296 ++iii; 300 ++iii;
297 301
298 mRemoteFile = new QLineEdit(topFrame); 302 mRemoteFile = new QLineEdit(topFrame);
299 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); 303 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame);
300 topLayout->addWidget(lab ,iii,0); 304 topLayout->addWidget(lab ,iii,0);
301 topLayout->addWidget(mRemoteFile,iii,1); 305 topLayout->addWidget(mRemoteFile,iii,1);
302 ++iii; 306 ++iii;
303 307
304 mLocalTempFile = new QLineEdit(topFrame); 308 mLocalTempFile = new QLineEdit(topFrame);
305 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); 309 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame);
306 topLayout->addWidget(lab ,iii,0); 310 topLayout->addWidget(lab ,iii,0);
307 topLayout->addWidget(mLocalTempFile,iii,1); 311 topLayout->addWidget(mLocalTempFile,iii,1);
308 ++iii; 312 ++iii;
309 313
310 KPrefsDialogWidBool *wb = 314 KPrefsDialogWidBool *wb =
311 addWidBool(i18n("Write back synced file"), 315 addWidBool(i18n("Write back synced file"),
312 &(KOPrefs::instance()->mWriteBackFile),topFrame); 316 &(KOPrefs::instance()->mWriteBackFile),topFrame);
313 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); 317 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
314 ++iii; 318 ++iii;
315 wb = 319 wb =
316 addWidBool(i18n("Write back existing entries only"), 320 addWidBool(i18n("Write back existing entries only"),
317 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); 321 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame);
318 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); 322 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
319 ++iii; 323 ++iii;
320 324
321#endif 325#endif
322} 326}
323 327
324void KOPrefsDialog::setupMainTab() 328void KOPrefsDialog::setupMainTab()
325{ 329{
326 QFrame *topFrame = addPage(i18n("General"),0,0); 330 QFrame *topFrame = addPage(i18n("General"),0,0);
327 // DesktopIcon("identity",KIcon::SizeMedium)); 331 // DesktopIcon("identity",KIcon::SizeMedium));
328 332
329 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 333 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
330 topLayout->setSpacing(spacingHint()); 334 topLayout->setSpacing(spacingHint());
331 topLayout->setMargin(marginHint()); 335 topLayout->setMargin(marginHint());
332 336
333 // KPrefsDialogWidBool *emailControlCenter = 337 // KPrefsDialogWidBool *emailControlCenter =
334// addWidBool(i18n("&Use email settings from Control Center"), 338// addWidBool(i18n("&Use email settings from Control Center"),
335// &(KOPrefs::instance()->mEmailControlCenter),topFrame); 339// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
336// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); 340// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
337 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), 341 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
338 // SLOT(toggleEmailSettings(bool))); 342 // SLOT(toggleEmailSettings(bool)));
339 343
340 mNameEdit = new QLineEdit(topFrame); 344 mNameEdit = new QLineEdit(topFrame);
341 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 345 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
342 topLayout->addWidget(mNameLabel,0,0); 346 topLayout->addWidget(mNameLabel,0,0);
343 topLayout->addWidget(mNameEdit,0,1); 347 topLayout->addWidget(mNameEdit,0,1);
344 348
345 mEmailEdit = new QLineEdit(topFrame); 349 mEmailEdit = new QLineEdit(topFrame);
346 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 350 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
347 topLayout->addWidget(mEmailLabel,1,0); 351 topLayout->addWidget(mEmailLabel,1,0);
348 topLayout->addWidget(mEmailEdit,1,1); 352 topLayout->addWidget(mEmailEdit,1,1);
349 KPrefsDialogWidBool *wb; 353 KPrefsDialogWidBool *wb;
350 QHBox *dummy; 354 QHBox *dummy;
351 if ( QApplication::desktop()->width() > 480 ) { 355 if ( QApplication::desktop()->width() > 480 ) {
352 dummy = new QHBox(topFrame); 356 dummy = new QHBox(topFrame);
353 } else { 357 } else {
354 dummy = new QVBox(topFrame); 358 dummy = new QVBox(topFrame);
355 } 359 }
356 360
357 topLayout->addMultiCellWidget(dummy, 2,2,0,1); 361 topLayout->addMultiCellWidget(dummy, 2,2,0,1);
358 addWidBool(i18n("Full menu bar(nr)"), 362 addWidBool(i18n("Full menu bar(nr)"),
359 &(KOPrefs::instance()->mShowFullMenu),dummy); 363 &(KOPrefs::instance()->mShowFullMenu),dummy);
360 364
361 365
362 addWidBool(i18n("Mini icons in toolbar(nr)"), 366 addWidBool(i18n("Mini icons in toolbar(nr)"),
363 &(KOPrefs::instance()->mToolBarMiniIcons),dummy); 367 &(KOPrefs::instance()->mToolBarMiniIcons),dummy);
364 368
365 369
366 dummy = new QHBox(topFrame); 370 dummy = new QHBox(topFrame);
367 new QLabel(i18n("Days in What's Next:"),dummy); 371 new QLabel(i18n("Days in What's Next:"),dummy);
368 mWhatsNextSpin = new QSpinBox(1,14,1,dummy); 372 mWhatsNextSpin = new QSpinBox(1,14,1,dummy);
369 373
370 topLayout->addMultiCellWidget(dummy,3,3,0,1); 374 topLayout->addMultiCellWidget(dummy,3,3,0,1);
371 375
372 376
373 377
374 dummy = new QHBox(topFrame); 378 dummy = new QHBox(topFrame);
375 new QLabel(i18n("Days in Next-X-Days:"),dummy); 379 new QLabel(i18n("Days in Next-X-Days:"),dummy);
376 mNextXDaysSpin = new QSpinBox(2,14,1,dummy); 380 mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
377 381
378 topLayout->addMultiCellWidget(dummy,4,4,0,1); 382 topLayout->addMultiCellWidget(dummy,4,4,0,1);
379 383
380 QHBox *prioBox = new QHBox(topFrame); 384 QHBox *prioBox = new QHBox(topFrame);
381 // intervalBox->setSpacing(spacingHint()); 385 // intervalBox->setSpacing(spacingHint());
382 topLayout->addMultiCellWidget(prioBox,5,5,0,1); 386 topLayout->addMultiCellWidget(prioBox,5,5,0,1);
383 QString messa = i18n("Show topmost todo prios in What's Next:"); 387 QString messa = i18n("Show topmost todo prios in What's Next:");
384 388
385 if ( QApplication::desktop()->width() < 300 ) 389 if ( QApplication::desktop()->width() < 300 )
386 messa = i18n("Show topmost todo prios in What's N.:"); 390 messa = i18n("Show topmost todo prios in What's N.:");
387 QLabel *prioLabel = new QLabel(messa, prioBox); 391 QLabel *prioLabel = new QLabel(messa, prioBox);
388 mPrioSpin = new QSpinBox(0,5,1,prioBox); 392 mPrioSpin = new QSpinBox(0,5,1,prioBox);
389 if ( QApplication::desktop()->width() < 300 ) 393 if ( QApplication::desktop()->width() < 300 )
390 mPrioSpin->setFixedWidth( 40 ); 394 mPrioSpin->setFixedWidth( 40 );
391 395
392 // KPrefsDialogWidBool *bcc = 396 // KPrefsDialogWidBool *bcc =
393// addWidBool(i18n("Send copy to owner when mailing events"), 397// addWidBool(i18n("Send copy to owner when mailing events"),
394// &(KOPrefs::instance()->mBcc),topFrame); 398// &(KOPrefs::instance()->mBcc),topFrame);
395// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); 399// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
396 400
397 401
398 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); 402 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
399 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); 403 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
400 404
401 // addWidBool(i18n("Enable automatic saving of calendar"), 405 // addWidBool(i18n("Enable automatic saving of calendar"),
402 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); 406 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
403 407
404 QHBox *intervalBox = new QHBox(topFrame); 408 QHBox *intervalBox = new QHBox(topFrame);
405 // intervalBox->setSpacing(spacingHint()); 409 // intervalBox->setSpacing(spacingHint());
406 topLayout->addMultiCellWidget(intervalBox,6,6,0,1); 410 topLayout->addMultiCellWidget(intervalBox,6,6,0,1);
407 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); 411 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
408 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); 412 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
409 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); 413 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
410 /* 414 /*
411 QHBox * agendasize = new QHBox ( topFrame ); 415 QHBox * agendasize = new QHBox ( topFrame );
412 416
413 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 417 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
414 418
415 419
416 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); 420 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
417 topLayout->addMultiCellWidget(agendasize,7,7,0,1); 421 topLayout->addMultiCellWidget(agendasize,7,7,0,1);
@@ -434,561 +438,572 @@ void KOPrefsDialog::setupMainTab()
434 topFrame); 438 topFrame);
435 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); 439 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1);
436 440
437 441
438 mEnableGroupScheduling = 442 mEnableGroupScheduling =
439 addWidBool(i18n("Enable group scheduling"), 443 addWidBool(i18n("Enable group scheduling"),
440 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); 444 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame);
441 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); 445 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0);
442 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), 446 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()),
443 SLOT(warningGroupScheduling())); 447 SLOT(warningGroupScheduling()));
444 448
445 mEnableProjectView = 449 mEnableProjectView =
446 addWidBool(i18n("Enable project view"), 450 addWidBool(i18n("Enable project view"),
447 &(KOPrefs::instance()->mEnableProjectView),topFrame); 451 &(KOPrefs::instance()->mEnableProjectView),topFrame);
448 topLayout->addWidget(mEnableProjectView->checkBox(),9,0); 452 topLayout->addWidget(mEnableProjectView->checkBox(),9,0);
449 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), 453 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()),
450 SLOT(warningProjectView())); 454 SLOT(warningProjectView()));
451 455
452 // Can't be disabled anymore 456 // Can't be disabled anymore
453 mEnableGroupScheduling->checkBox()->hide(); 457 mEnableGroupScheduling->checkBox()->hide();
454 458
455 // Disable setting, because this feature now becomes stable 459 // Disable setting, because this feature now becomes stable
456 mEnableProjectView->checkBox()->hide(); 460 mEnableProjectView->checkBox()->hide();
457 461
458 KPrefsDialogWidRadios *defaultFormatGroup = 462 KPrefsDialogWidRadios *defaultFormatGroup =
459 addWidRadios(i18n("Default Calendar Format"), 463 addWidRadios(i18n("Default Calendar Format"),
460 &(KOPrefs::instance()->mDefaultFormat),topFrame); 464 &(KOPrefs::instance()->mDefaultFormat),topFrame);
461 defaultFormatGroup->addRadio(i18n("vCalendar")); 465 defaultFormatGroup->addRadio(i18n("vCalendar"));
462 defaultFormatGroup->addRadio(i18n("iCalendar")); 466 defaultFormatGroup->addRadio(i18n("iCalendar"));
463 467
464 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); 468 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1);
465 469
466 // Default format unconditionally is iCalendar 470 // Default format unconditionally is iCalendar
467 defaultFormatGroup->groupBox()->hide(); 471 defaultFormatGroup->groupBox()->hide();
468 472
469 KPrefsDialogWidRadios *mailClientGroup = 473 KPrefsDialogWidRadios *mailClientGroup =
470 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), 474 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient),
471 topFrame); 475 topFrame);
472 mailClientGroup->addRadio(i18n("KMail")); 476 mailClientGroup->addRadio(i18n("KMail"));
473 mailClientGroup->addRadio(i18n("Sendmail")); 477 mailClientGroup->addRadio(i18n("Sendmail"));
474 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); 478 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1);
475 479
476 KPrefsDialogWidBool *htmlsave = 480 KPrefsDialogWidBool *htmlsave =
477 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), 481 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave),
478 topFrame); 482 topFrame);
479 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); 483 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1);
480 484
481 KPrefsDialogWidRadios *destinationGroup = 485 KPrefsDialogWidRadios *destinationGroup =
482 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), 486 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination),
483 topFrame); 487 topFrame);
484 destinationGroup->addRadio(i18n("be added to the standard resource")); 488 destinationGroup->addRadio(i18n("be added to the standard resource"));
485 destinationGroup->addRadio(i18n("be asked which resource to use")); 489 destinationGroup->addRadio(i18n("be asked which resource to use"));
486 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); 490 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
487 491
488 topLayout->setRowStretch(14,1); 492 topLayout->setRowStretch(14,1);
489 */ 493 */
490} 494}
491 495
492 496
493void KOPrefsDialog::setupTimeTab() 497void KOPrefsDialog::setupTimeTab()
494{ 498{
495 QFrame *topFrame = addPage(i18n("Time"),0,0); 499 QFrame *topFrame = addPage(i18n("Time"),0,0);
496 // DesktopIcon("clock",KIcon::SizeMedium)); 500 // DesktopIcon("clock",KIcon::SizeMedium));
497 501
498 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 502 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
499 topLayout->setSpacing(spacingHint()); 503 topLayout->setSpacing(spacingHint());
500 topLayout->setMargin(marginHint()); 504 topLayout->setMargin(marginHint());
501 505
502 QHBox *dummy = new QHBox(topFrame); 506 QHBox *dummy = new QHBox(topFrame);
503 KPrefsDialogWidTime *dayBegins = 507 KPrefsDialogWidTime *dayBegins =
504 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 508 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
505 dummy); 509 dummy);
506 //topLayout->addWidget(dayBegins->label(),2,0); 510 //topLayout->addWidget(dayBegins->label(),2,0);
507 511
508 //topLayout->addWidget(dayBegins->spinBox(),2,1); 512 //topLayout->addWidget(dayBegins->spinBox(),2,1);
509 topLayout->addMultiCellWidget(dummy,0,0,0,1); 513 topLayout->addMultiCellWidget(dummy,0,0,0,1);
510 514
511 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 515 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
512 topFrame),1,0); 516 topFrame),1,0);
513 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 517 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
514 mStartTimeSpin->setSuffix(":00"); 518 mStartTimeSpin->setSuffix(":00");
515 topLayout->addWidget(mStartTimeSpin,1,1); 519 topLayout->addWidget(mStartTimeSpin,1,1);
516 520
517 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), 521 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"),
518 topFrame),2,0); 522 topFrame),2,0);
519 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); 523 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame);
520 mDefaultDurationSpin->setSuffix(":00"); 524 mDefaultDurationSpin->setSuffix(":00");
521 topLayout->addWidget(mDefaultDurationSpin,2,1); 525 topLayout->addWidget(mDefaultDurationSpin,2,1);
522 526
523 QStringList alarmList; 527 QStringList alarmList;
524 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 528 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
525 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 529 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
526 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 530 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
527 3,0); 531 3,0);
528 mAlarmTimeCombo = new QComboBox(topFrame); 532 mAlarmTimeCombo = new QComboBox(topFrame);
529 mAlarmTimeCombo->insertStringList(alarmList); 533 mAlarmTimeCombo->insertStringList(alarmList);
530 topLayout->addWidget(mAlarmTimeCombo,3,1); 534 topLayout->addWidget(mAlarmTimeCombo,3,1);
531 535
532 536
533 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 537 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal,
534 i18n("Working Hours"), 538 i18n("Working Hours"),
535 topFrame); 539 topFrame);
536 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); 540 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1);
537 workingHoursGroup->layout()->setSpacing( 0 ); 541 workingHoursGroup->layout()->setSpacing( 0 );
538 workingHoursGroup->layout()->setMargin( 4 ); 542 workingHoursGroup->layout()->setMargin( 4 );
539 QHBox *workStartBox = new QHBox(workingHoursGroup); 543 QHBox *workStartBox = new QHBox(workingHoursGroup);
540 // workStartBox->setMargin( 0 ); 544 // workStartBox->setMargin( 0 );
541 addWidTime(i18n("Daily starting hour:"), 545 addWidTime(i18n("Daily starting hour:"),
542 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 546 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
543 547
544 QHBox *workEndBox = new QHBox(workingHoursGroup); 548 QHBox *workEndBox = new QHBox(workingHoursGroup);
545 //workEndBox->setMargin( 0 ); 549 //workEndBox->setMargin( 0 );
546 addWidTime(i18n("Daily ending hour:"), 550 addWidTime(i18n("Daily ending hour:"),
547 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 551 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
548 QVBox *excludeBox = new QVBox(workingHoursGroup); 552 QVBox *excludeBox = new QVBox(workingHoursGroup);
549 //excludeBox->setMargin( 0 ); 553 //excludeBox->setMargin( 0 );
550 addWidBool(i18n("Exclude holidays"), 554 addWidBool(i18n("Exclude holidays"),
551 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 555 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
552 556
553 addWidBool(i18n("Exclude Saturdays"), 557 addWidBool(i18n("Exclude Saturdays"),
554 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 558 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
555 559
556// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 560// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
557 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 561 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
558 // topFrame); 562 // topFrame);
559// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 563// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
560 564
561 // topLayout->setRowStretch(6,1); 565 // topLayout->setRowStretch(6,1);
562} 566}
563 567
564 568
565void KOPrefsDialog::setupViewsTab() 569void KOPrefsDialog::setupViewsTab()
566{ 570{
567 571
568 QFrame *topFrame = addPage(i18n("Views"),0,0); 572 QFrame *topFrame = addPage(i18n("Views"),0,0);
569 // DesktopIcon("viewmag",KIcon::SizeMedium)); 573 // DesktopIcon("viewmag",KIcon::SizeMedium));
570 574
571 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 575 QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
572 topLayout->setSpacing(spacingHint()); 576 topLayout->setSpacing(spacingHint());
573 topLayout->setMargin(marginHint()); 577 topLayout->setMargin(marginHint());
574 578
575// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 579// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
576// topLayout->addLayout(dayBeginsLayout,0,0); 580// topLayout->addLayout(dayBeginsLayout,0,0);
577 581
578// KPrefsDialogWidTime *dayBegins = 582// KPrefsDialogWidTime *dayBegins =
579// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 583// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
580// topFrame); 584// topFrame);
581// dayBeginsLayout->addWidget(dayBegins->label()); 585// dayBeginsLayout->addWidget(dayBegins->label());
582// dayBeginsLayout->addStretch(1); 586// dayBeginsLayout->addStretch(1);
583// dayBeginsLayout->addWidget(dayBegins->spinBox()); 587// dayBeginsLayout->addWidget(dayBegins->spinBox());
584 588
585// QBoxLayout *nextDaysLayout = new QHBoxLayout; 589// QBoxLayout *nextDaysLayout = new QHBoxLayout;
586// topLayout->addLayout(nextDaysLayout,1,0); 590// topLayout->addLayout(nextDaysLayout,1,0);
587// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); 591// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
588// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); 592// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
589// nextDaysLayout->addStretch(1); 593// nextDaysLayout->addStretch(1);
590// nextDaysLayout->addWidget(mNextXDaysSpin); 594// nextDaysLayout->addWidget(mNextXDaysSpin);
591 595
592 596
593 int ii = 0; 597 int ii = 0;
594 KPrefsDialogWidBool *dummy = 598 KPrefsDialogWidBool *dummy =
595 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 599 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
596 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 600 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
597 topLayout->addWidget(dummy->checkBox(),ii++,0); 601 topLayout->addWidget(dummy->checkBox(),ii++,0);
598 602
599 dummy = 603 dummy =
600 addWidBool(i18n("Highlight current day in agenda"), 604 addWidBool(i18n("Highlight current day in agenda"),
601 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 605 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
602 topLayout->addWidget(dummy->checkBox(),ii++,0); 606 topLayout->addWidget(dummy->checkBox(),ii++,0);
603 607
604 dummy = 608 dummy =
605 addWidBool(i18n("Use light color for highlight current day"), 609 addWidBool(i18n("Use light color for highlight current day"),
606 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 610 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
607 topLayout->addWidget(dummy->checkBox(),ii++,0); 611 topLayout->addWidget(dummy->checkBox(),ii++,0);
608 612
609 KPrefsDialogWidBool *dailyRecur = 613 KPrefsDialogWidBool *dailyRecur =
610 addWidBool(i18n("Show events that recur daily in date nav."), 614 addWidBool(i18n("Show events that recur daily in date nav."),
611 &(KOPrefs::instance()->mDailyRecur),topFrame); 615 &(KOPrefs::instance()->mDailyRecur),topFrame);
612 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 616 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
613 617
614 KPrefsDialogWidBool *weeklyRecur = 618 KPrefsDialogWidBool *weeklyRecur =
615 addWidBool(i18n("Show ev. that recur weekly in date nav."), 619 addWidBool(i18n("Show ev. that recur weekly in date nav."),
616 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 620 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
617 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 621 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
618 if ( QApplication::desktop()->width() > 640 ) { 622 if ( QApplication::desktop()->width() > 640 ) {
619 623
620 KPrefsDialogWidBool *enableToolTips = 624 KPrefsDialogWidBool *enableToolTips =
621 addWidBool(i18n("Enable tooltips displaying summary of ev."), 625 addWidBool(i18n("Enable tooltips displaying summary of ev."),
622 &(KOPrefs::instance()->mEnableToolTips),topFrame); 626 &(KOPrefs::instance()->mEnableToolTips),topFrame);
623 topLayout->addWidget(enableToolTips->checkBox(),ii++,0); 627 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
624 628
625 } 629 }
626 KPrefsDialogWidBool *passwdk = 630
627 addWidBool(i18n("Show parent To-Do's in What's Next view"),
628 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
629 topLayout->addWidget(passwdk->checkBox(), ii++,0);
630
631 passwdk =
632 addWidBool(i18n("Show location in What's Next view"),
633 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
634 topLayout->addWidget(passwdk->checkBox(), ii++,0);
635
636 passwdk =
637 addWidBool(i18n("Show Sync Events in WN/Agenda view"),
638 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
639 topLayout->addWidget(passwdk->checkBox(), ii++,0);
640
641
642 KPrefsDialogWidBool *marcusBainsEnabled = 631 KPrefsDialogWidBool *marcusBainsEnabled =
643 addWidBool(i18n("Show Marcus Bains line"), 632 addWidBool(i18n("Show Marcus Bains line"),
644 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 633 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
645 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 634 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
646 635
647 636
648 // topLayout->addWidget(hourSizeGroup,ii++,0); 637 // topLayout->addWidget(hourSizeGroup,ii++,0);
649 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 638 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
650 //topLayout->setRowStretch(11,1); 639 //topLayout->setRowStretch(11,1);
651 640
652 641
653 642
654 643
655 644
656 645
657 topFrame = addPage(i18n("ViewChange"),0,0); 646 topFrame = addPage(i18n("ViewChange"),0,0);
658 // DesktopIcon("viewmag",KIcon::SizeMedium)); 647 // DesktopIcon("viewmag",KIcon::SizeMedium));
659 648
660 topLayout = new QGridLayout(topFrame,6,1); 649 topLayout = new QGridLayout(topFrame,6,1);
661 topLayout->setSpacing(spacingHint()); 650 topLayout->setSpacing(spacingHint());
662 topLayout->setMargin(marginHint()); 651 topLayout->setMargin(marginHint());
663 ii = 0; 652 ii = 0;
664 653
665 654
666 dummy = 655 dummy =
667 addWidBool(i18n("Hold fullscreen on view change"), 656 addWidBool(i18n("Hold fullscreen on view change"),
668 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 657 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
669 topLayout->addWidget(dummy->checkBox(),ii++,0); 658 topLayout->addWidget(dummy->checkBox(),ii++,0);
670 659
671 dummy = 660 dummy =
672 addWidBool(i18n("Hold non-fullscreen on view change"), 661 addWidBool(i18n("Hold non-fullscreen on view change"),
673 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 662 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
674 topLayout->addWidget(dummy->checkBox(),ii++,0); 663 topLayout->addWidget(dummy->checkBox(),ii++,0);
675 664
676 665
677 KPrefsDialogWidBool *fullViewTodo = 666 KPrefsDialogWidBool *fullViewTodo =
678 addWidBool(i18n("Event list view uses full window"), 667 addWidBool(i18n("Event list view uses full window"),
679 &(KOPrefs::instance()->mFullViewTodo),topFrame); 668 &(KOPrefs::instance()->mFullViewTodo),topFrame);
680 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 669 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
681 670
682 KPrefsDialogWidBool *fullViewMonth = 671 KPrefsDialogWidBool *fullViewMonth =
683 addWidBool(i18n("Next days view uses full window"), 672 addWidBool(i18n("Next days view uses full window"),
684 &(KOPrefs::instance()->mFullViewMonth),topFrame); 673 &(KOPrefs::instance()->mFullViewMonth),topFrame);
685 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 674 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
686 675
687 dummy = 676 dummy =
688 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 677 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
689 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 678 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
690 topLayout->addWidget(dummy->checkBox(),ii++,0); 679 topLayout->addWidget(dummy->checkBox(),ii++,0);
691 680
692 dummy = 681 dummy =
693 addWidBool(i18n("Set agenda to current time on change"), 682 addWidBool(i18n("Set agenda to current time on change"),
694 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 683 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
695 topLayout->addWidget(dummy->checkBox(),ii++,0); 684 topLayout->addWidget(dummy->checkBox(),ii++,0);
696 685
697 dummy = 686 dummy =
698 addWidBool(i18n("Listview uses monthly timespan"), 687 addWidBool(i18n("Listview uses monthly timespan"),
699 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 688 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
700 topLayout->addWidget(dummy->checkBox(),ii++,0); 689 topLayout->addWidget(dummy->checkBox(),ii++,0);
701 dummy = 690 dummy =
702 addWidBool(i18n("Highlight selection in Time Edit"), 691 addWidBool(i18n("Highlight selection in Time Edit"),
703 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 692 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
704 topLayout->addWidget( dummy->checkBox(), ii++,0); 693 topLayout->addWidget( dummy->checkBox(), ii++,0);
705 694
706 695
707 696
708 697
709 698
710 topFrame = addPage(i18n("Month View"),0,0); 699 topFrame = addPage(i18n("Month View"),0,0);
711 // DesktopIcon("viewmag",KIcon::SizeMedium)); 700 // DesktopIcon("viewmag",KIcon::SizeMedium));
712 701
713 topLayout = new QGridLayout(topFrame,5,1); 702 topLayout = new QGridLayout(topFrame,5,1);
714 topLayout->setSpacing(spacingHint()); 703 topLayout->setSpacing(spacingHint());
715 topLayout->setMargin(marginHint()); 704 topLayout->setMargin(marginHint());
716 ii = 0; 705 ii = 0;
717 QLabel *lab; 706 QLabel *lab;
718 QHBox *habo = new QHBox( topFrame ); 707 QHBox *habo = new QHBox( topFrame );
719 if ( QApplication::desktop()->width() < 320 ) { 708 if ( QApplication::desktop()->width() < 320 ) {
720 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 709 lab = new QLabel ( i18n("Show events that recur "), topFrame );
721 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 710 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
722 ii++; 711 ii++;
723 712
724 } else { 713 } else {
725 new QLabel ( i18n("Show events that recur "), habo ); 714 new QLabel ( i18n("Show events that recur "), habo );
726 715
727 } 716 }
728 dailyRecur = 717 dailyRecur =
729 addWidBool(i18n("daily"), 718 addWidBool(i18n("daily"),
730 &(KOPrefs::instance()->mMonthDailyRecur),habo); 719 &(KOPrefs::instance()->mMonthDailyRecur),habo);
731 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 720 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
732 721
733 weeklyRecur = 722 weeklyRecur =
734 addWidBool(i18n("weekly"), 723 addWidBool(i18n("weekly"),
735 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 724 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
736 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 725 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
737 ii++; 726 ii++;
738 727
739 728
740 habo = new QHBox( topFrame ); 729 habo = new QHBox( topFrame );
741 if ( QApplication::desktop()->width() < 320 ) { 730 if ( QApplication::desktop()->width() < 320 ) {
742 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 731 lab = new QLabel (i18n("Show in every cell ") , topFrame );
743 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 732 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
744 ii++; 733 ii++;
745 734
746 } else { 735 } else {
747 new QLabel ( i18n("Show in every cell "), habo ); 736 new QLabel ( i18n("Show in every cell "), habo );
748 } 737 }
749 weeklyRecur = 738 weeklyRecur =
750 addWidBool(i18n("short month"), 739 addWidBool(i18n("short month"),
751 &(KOPrefs::instance()->mMonthShowShort),habo); 740 &(KOPrefs::instance()->mMonthShowShort),habo);
752 weeklyRecur = 741 weeklyRecur =
753 addWidBool(i18n("icons"), 742 addWidBool(i18n("icons"),
754 &(KOPrefs::instance()->mMonthShowIcons),habo); 743 &(KOPrefs::instance()->mMonthShowIcons),habo);
755 744
756 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 745 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
757 ii++; 746 ii++;
758#ifdef DESKTOP_VERSION 747#ifdef DESKTOP_VERSION
759 KPrefsDialogWidBool *enableMonthScroll = 748 KPrefsDialogWidBool *enableMonthScroll =
760 addWidBool(i18n("Enable scrollbars in month view cells"), 749 addWidBool(i18n("Enable scrollbars in month view cells"),
761 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 750 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
762 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 751 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
763#endif 752#endif
764 753
765 dummy = 754 dummy =
766 addWidBool(i18n("Show Sat/Sun together"), 755 addWidBool(i18n("Show Sat/Sun together"),
767 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 756 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
768 topLayout->addWidget(dummy->checkBox(),ii++,0); 757 topLayout->addWidget(dummy->checkBox(),ii++,0);
769 758
770 KPrefsDialogWidBool *coloredCategoriesInMonthView = 759 KPrefsDialogWidBool *coloredCategoriesInMonthView =
771 addWidBool(i18n("Month view uses category colors"), 760 addWidBool(i18n("Month view uses category colors"),
772 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 761 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
773 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 762 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
774 763
775 dummy = 764 dummy =
776 addWidBool(i18n("Categorie colors are applied to text"), 765 addWidBool(i18n("Categorie colors are applied to text"),
777 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 766 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
778 topLayout->addWidget(dummy->checkBox(),ii++,0); 767 topLayout->addWidget(dummy->checkBox(),ii++,0);
779 coloredCategoriesInMonthView = 768 coloredCategoriesInMonthView =
780 addWidBool(i18n("Month view uses day colors"), 769 addWidBool(i18n("Month view uses day colors"),
781 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 770 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
782 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 771 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
783 772
784 KPrefsDialogWidColor *holidayColor = 773 KPrefsDialogWidColor *holidayColor =
785 addWidColor(i18n("Day color odd months"), 774 addWidColor(i18n("Day color odd months"),
786 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 775 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
787 topLayout->addWidget(holidayColor->label(),ii,0); 776 topLayout->addWidget(holidayColor->label(),ii,0);
788 topLayout->addWidget(holidayColor->button(),ii++,1); 777 topLayout->addWidget(holidayColor->button(),ii++,1);
789 778
790 holidayColor = 779 holidayColor =
791 addWidColor(i18n("Day color even months"), 780 addWidColor(i18n("Day color even months"),
792 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 781 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
793 topLayout->addWidget(holidayColor->label(),ii,0); 782 topLayout->addWidget(holidayColor->label(),ii,0);
794 topLayout->addWidget(holidayColor->button(),ii++,1); 783 topLayout->addWidget(holidayColor->button(),ii++,1);
795 784
796 785
797 holidayColor = 786 holidayColor =
798 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 787 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
799 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 788 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
800 topLayout->addWidget(holidayColor->label(),ii,0); 789 topLayout->addWidget(holidayColor->label(),ii,0);
801 topLayout->addWidget(holidayColor->button(),ii++,1); 790 topLayout->addWidget(holidayColor->button(),ii++,1);
802 791 // *********************** What'sNext View
792 topFrame = addPage(i18n("What's Next View"),0,0);
793 // DesktopIcon("viewmag",KIcon::SizeMedium));
794
795 topLayout = new QGridLayout(topFrame,4,1);
796 topLayout->setSpacing(spacingHint());
797 topLayout->setMargin(marginHint());
798 ii = 0;
799 KPrefsDialogWidBool *passwdk =
800 addWidBool(i18n("Show parent To-Do's in What's Next view"),
801 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
802 topLayout->addWidget(passwdk->checkBox(), ii++,0);
803
804 passwdk =
805 addWidBool(i18n("Show location in What's Next view"),
806 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
807 topLayout->addWidget(passwdk->checkBox(), ii++,0);
808
809 passwdk =
810 addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"),
811 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
812 topLayout->addWidget(passwdk->checkBox(), ii++,0);
813 passwdk =
814 addWidBool(i18n("Use short date in \nWhat's Next/Event view"),
815 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
816 topLayout->addMultiCellWidget(passwdk->checkBox(), ii,ii,0,1);
817
803 // *********************** Todo View 818 // *********************** Todo View
804 819
805 topFrame = addPage(i18n("Todo View"),0,0); 820 topFrame = addPage(i18n("Todo View"),0,0);
806 // DesktopIcon("viewmag",KIcon::SizeMedium)); 821 // DesktopIcon("viewmag",KIcon::SizeMedium));
807 822
808 topLayout = new QGridLayout(topFrame,4,1); 823 topLayout = new QGridLayout(topFrame,4,1);
809 topLayout->setSpacing(spacingHint()); 824 topLayout->setSpacing(spacingHint());
810 topLayout->setMargin(marginHint()); 825 topLayout->setMargin(marginHint());
811 ii = 0; 826 ii = 0;
812 827
813 KPrefsDialogWidBool *showCompletedTodo = 828 KPrefsDialogWidBool *showCompletedTodo =
814 addWidBool(i18n("To-do view shows completed Todos"), 829 addWidBool(i18n("To-do view shows completed Todos"),
815 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 830 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
816 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 831 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
817 dummy = 832 dummy =
818 addWidBool(i18n("To-do view shows complete as 'xx %'"), 833 addWidBool(i18n("To-do view shows complete as 'xx %'"),
819 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 834 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
820 topLayout->addWidget(dummy->checkBox(),ii++,0); 835 topLayout->addWidget(dummy->checkBox(),ii++,0);
821 836
822 dummy = 837 dummy =
823 addWidBool(i18n("Small To-do view uses smaller font"), 838 addWidBool(i18n("Small To-do view uses smaller font"),
824 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 839 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
825 topLayout->addWidget(dummy->checkBox(),ii++,0); 840 topLayout->addWidget(dummy->checkBox(),ii++,0);
826 841
827 842
828 843
829 dummy = 844 dummy =
830 addWidBool(i18n("Todo view uses category colors"), 845 addWidBool(i18n("Todo view uses category colors"),
831 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 846 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
832 topLayout->addWidget(dummy->checkBox(),ii++,0); 847 topLayout->addWidget(dummy->checkBox(),ii++,0);
833 848
834 849
835 QWidget* wid = new QWidget( topFrame ); 850 QWidget* wid = new QWidget( topFrame );
836 // Todo due today color 851 // Todo due today color
837 KPrefsDialogWidColor *todoDueTodayColor = 852 KPrefsDialogWidColor *todoDueTodayColor =
838 addWidColor(i18n("Todo due today color:"), 853 addWidColor(i18n("Todo due today color:"),
839 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 854 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
840 QHBoxLayout *widLayout = new QHBoxLayout(wid); 855 QHBoxLayout *widLayout = new QHBoxLayout(wid);
841 widLayout->addWidget( todoDueTodayColor->label() ); 856 widLayout->addWidget( todoDueTodayColor->label() );
842 widLayout->addWidget( todoDueTodayColor->button() ); 857 widLayout->addWidget( todoDueTodayColor->button() );
843 topLayout->addWidget(wid,ii++,0); 858 topLayout->addWidget(wid,ii++,0);
844 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 859 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
845 860
846 // Todo overdue color 861 // Todo overdue color
847 wid = new QWidget( topFrame ); 862 wid = new QWidget( topFrame );
848 widLayout = new QHBoxLayout(wid); 863 widLayout = new QHBoxLayout(wid);
849 KPrefsDialogWidColor *todoOverdueColor = 864 KPrefsDialogWidColor *todoOverdueColor =
850 addWidColor(i18n("Todo overdue color:"), 865 addWidColor(i18n("Todo overdue color:"),
851 &(KOPrefs::instance()->mTodoOverdueColor),wid); 866 &(KOPrefs::instance()->mTodoOverdueColor),wid);
852 widLayout->addWidget(todoOverdueColor->label()); 867 widLayout->addWidget(todoOverdueColor->label());
853 widLayout->addWidget(todoOverdueColor->button()); 868 widLayout->addWidget(todoOverdueColor->button());
854 topLayout->addWidget(wid,ii++,0); 869 topLayout->addWidget(wid,ii++,0);
855 870
856 dummy = 871 dummy =
857 addWidBool(i18n("Colors are applied to text"), 872 addWidBool(i18n("Colors are applied to text"),
858 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 873 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
859 topLayout->addWidget(dummy->checkBox(),ii++,0); 874 topLayout->addWidget(dummy->checkBox(),ii++,0);
860 875
861 dummy = 876 dummy =
862 addWidBool(i18n("Allday Agenda view shows todos"), 877 addWidBool(i18n("Allday Agenda view shows todos"),
863 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 878 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
864 topLayout->addWidget(dummy->checkBox(),ii++,0); 879 topLayout->addWidget(dummy->checkBox(),ii++,0);
865 880
866 881
867 882
868 883
869 topFrame = addPage(i18n("Alarm"),0,0); 884 topFrame = addPage(i18n("Alarm"),0,0);
870 // DesktopIcon("viewmag",KIcon::SizeMedium)); 885 // DesktopIcon("viewmag",KIcon::SizeMedium));
871 886
872 topLayout = new QGridLayout(topFrame,2,1); 887 topLayout = new QGridLayout(topFrame,2,1);
873 topLayout->setSpacing(spacingHint()); 888 topLayout->setSpacing(spacingHint());
874 topLayout->setMargin(marginHint()); 889 topLayout->setMargin(marginHint());
875 int iii = 0; 890 int iii = 0;
876 891
877 dummy = 892 dummy =
878 addWidBool(i18n("Use internal alarm notification"), 893 addWidBool(i18n("Use internal alarm notification"),
879 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 894 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
880 topLayout->addWidget(dummy->checkBox(),iii++,0); 895 topLayout->addWidget(dummy->checkBox(),iii++,0);
881 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); 896 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
882 897
883 topLayout->addWidget(lab ,iii++,0); 898 topLayout->addWidget(lab ,iii++,0);
884#ifndef DESKTOP_VERSION 899#ifndef DESKTOP_VERSION
885 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 900 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
886#else 901#else
887 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 902 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
888 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 903 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
889#endif 904#endif
890 905
891 QHBox* dummyBox = new QHBox(topFrame); 906 QHBox* dummyBox = new QHBox(topFrame);
892 new QLabel(i18n("Play beeps count:"),dummyBox); 907 new QLabel(i18n("Play beeps count:"),dummyBox);
893 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 908 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
894 topLayout->addWidget(dummyBox,iii++,0); 909 topLayout->addWidget(dummyBox,iii++,0);
895 910
896 dummyBox = new QHBox(topFrame); 911 dummyBox = new QHBox(topFrame);
897 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 912 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
898 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 913 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
899 topLayout->addWidget(dummyBox,iii++,0); 914 topLayout->addWidget(dummyBox,iii++,0);
900 915
901 dummyBox = new QHBox(topFrame); 916 dummyBox = new QHBox(topFrame);
902 new QLabel(i18n("Default suspend time in min:"),dummyBox); 917 new QLabel(i18n("Default suspend time in min:"),dummyBox);
903 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 918 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
904 topLayout->addWidget(dummyBox,iii++,0); 919 topLayout->addWidget(dummyBox,iii++,0);
905 920
906 dummyBox = new QHBox(topFrame); 921 dummyBox = new QHBox(topFrame);
907 new QLabel(i18n("Auto suspend count:"),dummyBox); 922 new QLabel(i18n("Auto suspend count:"),dummyBox);
908 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); 923 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
909 topLayout->addWidget(dummyBox,iii++,0); 924 topLayout->addWidget(dummyBox,iii++,0);
910 925
911 926
912 927
913 928
914 929
915 930
916 931
917 QHBox* hbo = new QHBox ( topFrame ); 932 QHBox* hbo = new QHBox ( topFrame );
918 mDefaultAlarmFile = new QLineEdit(hbo); 933 mDefaultAlarmFile = new QLineEdit(hbo);
919 QPushButton * loadTemplate = new QPushButton(hbo); 934 QPushButton * loadTemplate = new QPushButton(hbo);
920 QPixmap icon; 935 QPixmap icon;
921 if ( QApplication::desktop()->width() < 321 ) 936 if ( QApplication::desktop()->width() < 321 )
922 icon = SmallIcon("fileimport16"); 937 icon = SmallIcon("fileimport16");
923 else 938 else
924 icon = SmallIcon("fileimport"); 939 icon = SmallIcon("fileimport");
925 loadTemplate->setIconSet (icon ) ; 940 loadTemplate->setIconSet (icon ) ;
926 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); 941 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
927 int size = loadTemplate->sizeHint().height(); 942 int size = loadTemplate->sizeHint().height();
928 loadTemplate->setFixedSize( size, size ); 943 loadTemplate->setFixedSize( size, size );
929 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); 944 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
930 // topLayout->addWidget(lab ,iii++,0); 945 // topLayout->addWidget(lab ,iii++,0);
931 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); 946 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame);
932 topLayout->addWidget(lab ,iii++,0); 947 topLayout->addWidget(lab ,iii++,0);
933 topLayout->addWidget(hbo,iii++,0); 948 topLayout->addWidget(hbo,iii++,0);
934 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); 949 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame);
935 950
936// topLayout->addWidget(lab ,iii++,0); 951// topLayout->addWidget(lab ,iii++,0);
937// #ifndef DESKTOP_VERSION 952// #ifndef DESKTOP_VERSION
938// lab->setAlignment( AlignLeft|WordBreak|AlignTop); 953// lab->setAlignment( AlignLeft|WordBreak|AlignTop);
939// #else 954// #else
940// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 955// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
941// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 956// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
942// #endif 957// #endif
943 958
944 959
945} 960}
946 961
947void KOPrefsDialog::selectSoundFile() 962void KOPrefsDialog::selectSoundFile()
948{ 963{
949 QString fileName = mDefaultAlarmFile->text(); 964 QString fileName = mDefaultAlarmFile->text();
950 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); 965 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
951 if ( fileName.length() > 0 ) 966 if ( fileName.length() > 0 )
952 mDefaultAlarmFile->setText( fileName ); 967 mDefaultAlarmFile->setText( fileName );
953} 968}
954void KOPrefsDialog::setupFontsTab() 969void KOPrefsDialog::setupFontsTab()
955{ 970{
956 971
957 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 972 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
958 // DesktopIcon("fonts",KIcon::SizeMedium)); 973 // DesktopIcon("fonts",KIcon::SizeMedium));
959 974
960 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 975 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
961 topLayout->setSpacing(1); 976 topLayout->setSpacing(1);
962 topLayout->setMargin(3); 977 topLayout->setMargin(3);
963 KPrefsDialogWidFont * tVFont; 978 KPrefsDialogWidFont * tVFont;
964 int i = 0; 979 int i = 0;
965 KPrefsDialogWidFont *timeLabelsFont = 980 KPrefsDialogWidFont *timeLabelsFont =
966 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 981 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
967 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 982 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
968 topLayout->addWidget(timeLabelsFont->label(),i,0); 983 topLayout->addWidget(timeLabelsFont->label(),i,0);
969 topLayout->addWidget(timeLabelsFont->preview(),i,1); 984 topLayout->addWidget(timeLabelsFont->preview(),i,1);
970 topLayout->addWidget(timeLabelsFont->button(),i,2); 985 topLayout->addWidget(timeLabelsFont->button(),i,2);
971 ++i; 986 ++i;
972 987
973 988
974 timeLabelsFont = 989 timeLabelsFont =
975 addWidFont(i18n("Mon 15"),i18n("Date Labels:"), 990 addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
976 &(KOPrefs::instance()->mTimeLabelsFont),topFrame); 991 &(KOPrefs::instance()->mTimeLabelsFont),topFrame);
977 topLayout->addWidget(timeLabelsFont->label(),i,0); 992 topLayout->addWidget(timeLabelsFont->label(),i,0);
978 topLayout->addWidget(timeLabelsFont->preview(),i,1); 993 topLayout->addWidget(timeLabelsFont->preview(),i,1);
979 topLayout->addWidget(timeLabelsFont->button(),i,2); 994 topLayout->addWidget(timeLabelsFont->button(),i,2);
980 ++i; 995 ++i;
981 996
982 KPrefsDialogWidFont *timeBarFont = 997 KPrefsDialogWidFont *timeBarFont =
983 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), 998 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
984 &(KOPrefs::instance()->mTimeBarFont),topFrame); 999 &(KOPrefs::instance()->mTimeBarFont),topFrame);
985 topLayout->addWidget(timeBarFont->label(),i,0); 1000 topLayout->addWidget(timeBarFont->label(),i,0);
986 topLayout->addWidget(timeBarFont->preview(),i,1); 1001 topLayout->addWidget(timeBarFont->preview(),i,1);
987 topLayout->addWidget(timeBarFont->button(),i,2); 1002 topLayout->addWidget(timeBarFont->button(),i,2);
988 ++i; 1003 ++i;
989 1004
990 1005
991 KPrefsDialogWidFont *marcusBainsFont = 1006 KPrefsDialogWidFont *marcusBainsFont =
992 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), 1007 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"),
993 &(KOPrefs::instance()->mMarcusBainsFont),topFrame); 1008 &(KOPrefs::instance()->mMarcusBainsFont),topFrame);
994 topLayout->addWidget(marcusBainsFont->label(),i,0); 1009 topLayout->addWidget(marcusBainsFont->label(),i,0);
@@ -1147,475 +1162,476 @@ void KOPrefsDialog::setupColorsTab()
1147 topLayout->addWidget(agendaBgColor->label(),ii,0); 1162 topLayout->addWidget(agendaBgColor->label(),ii,0);
1148 topLayout->addWidget(agendaBgColor->button(),ii++,1); 1163 topLayout->addWidget(agendaBgColor->button(),ii++,1);
1149 1164
1150 // working hours color 1165 // working hours color
1151 KPrefsDialogWidColor *workingHoursColor = 1166 KPrefsDialogWidColor *workingHoursColor =
1152 addWidColor(i18n("Working hours color:"), 1167 addWidColor(i18n("Working hours color:"),
1153 &(KOPrefs::instance()->mWorkingHoursColor),topFrame); 1168 &(KOPrefs::instance()->mWorkingHoursColor),topFrame);
1154 topLayout->addWidget(workingHoursColor->label(),ii,0); 1169 topLayout->addWidget(workingHoursColor->label(),ii,0);
1155 topLayout->addWidget(workingHoursColor->button(),ii++,1); 1170 topLayout->addWidget(workingHoursColor->button(),ii++,1);
1156 1171
1157 KPrefsDialogWidBool *sb = 1172 KPrefsDialogWidBool *sb =
1158 addWidBool(i18n("Use colors for application:"), 1173 addWidBool(i18n("Use colors for application:"),
1159 &(KOPrefs::instance()->mUseAppColors),topFrame); 1174 &(KOPrefs::instance()->mUseAppColors),topFrame);
1160 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); 1175 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 );
1161 1176
1162 ii++; 1177 ii++;
1163 KPrefsDialogWidColor * workingHoursColor1 = 1178 KPrefsDialogWidColor * workingHoursColor1 =
1164 addWidColor(i18n("Buttons, menus, etc.:"), 1179 addWidColor(i18n("Buttons, menus, etc.:"),
1165 &(KOPrefs::instance()->mAppColor1),topFrame); 1180 &(KOPrefs::instance()->mAppColor1),topFrame);
1166 topLayout->addWidget(workingHoursColor1->label(),ii,0); 1181 topLayout->addWidget(workingHoursColor1->label(),ii,0);
1167 topLayout->addWidget(workingHoursColor1->button(),ii++,1); 1182 topLayout->addWidget(workingHoursColor1->button(),ii++,1);
1168 1183
1169 KPrefsDialogWidColor * workingHoursColor2 = 1184 KPrefsDialogWidColor * workingHoursColor2 =
1170 addWidColor(i18n("Frames, labels, etc.:"), 1185 addWidColor(i18n("Frames, labels, etc.:"),
1171 &(KOPrefs::instance()->mAppColor2),topFrame); 1186 &(KOPrefs::instance()->mAppColor2),topFrame);
1172 topLayout->addWidget(workingHoursColor2->label(),ii,0); 1187 topLayout->addWidget(workingHoursColor2->label(),ii,0);
1173 topLayout->addWidget(workingHoursColor2->button(),ii++,1); 1188 topLayout->addWidget(workingHoursColor2->button(),ii++,1);
1174 1189
1175 1190
1176 1191
1177} 1192}
1178 1193
1179void KOPrefsDialog::setCategoryColor() 1194void KOPrefsDialog::setCategoryColor()
1180{ 1195{
1181 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); 1196 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color()));
1182} 1197}
1183 1198
1184void KOPrefsDialog::updateCategoryColor() 1199void KOPrefsDialog::updateCategoryColor()
1185{ 1200{
1186 QString cat = mCategoryCombo->currentText(); 1201 QString cat = mCategoryCombo->currentText();
1187 QColor *color = mCategoryDict.find(cat); 1202 QColor *color = mCategoryDict.find(cat);
1188 if (!color) { 1203 if (!color) {
1189 color = KOPrefs::instance()->categoryColor(cat); 1204 color = KOPrefs::instance()->categoryColor(cat);
1190 } 1205 }
1191 if (color) { 1206 if (color) {
1192 mCategoryButton->setColor(*color); 1207 mCategoryButton->setColor(*color);
1193 } 1208 }
1194} 1209}
1195 1210
1196void KOPrefsDialog::setupPrinterTab() 1211void KOPrefsDialog::setupPrinterTab()
1197{ 1212{
1198 mPrinterTab = addPage(i18n("Printing"),0, 1213 mPrinterTab = addPage(i18n("Printing"),0,
1199 DesktopIcon("fileprint",KIcon::SizeMedium)); 1214 DesktopIcon("fileprint",KIcon::SizeMedium));
1200 1215
1201 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); 1216 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2);
1202 topLayout->setSpacing(spacingHint()); 1217 topLayout->setSpacing(spacingHint());
1203 topLayout->setMargin(marginHint()); 1218 topLayout->setMargin(marginHint());
1204 1219
1205 topLayout->setRowStretch(4,1); 1220 topLayout->setRowStretch(4,1);
1206} 1221}
1207 1222
1208void KOPrefsDialog::setupGroupSchedulingTab() 1223void KOPrefsDialog::setupGroupSchedulingTab()
1209{ 1224{
1210#if 0 1225#if 0
1211 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1226 QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
1212 DesktopIcon("personal",KIcon::SizeMedium)); 1227 DesktopIcon("personal",KIcon::SizeMedium));
1213 1228
1214 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1229 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
1215 topLayout->setSpacing(spacingHint()); 1230 topLayout->setSpacing(spacingHint());
1216 topLayout->setMargin(marginHint()); 1231 topLayout->setMargin(marginHint());
1217 1232
1218#if 0 1233#if 0
1219 KPrefsDialogWidRadios *schedulerGroup = 1234 KPrefsDialogWidRadios *schedulerGroup =
1220 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1235 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1221 topFrame); 1236 topFrame);
1222 schedulerGroup->addRadio("Dummy"); // Only for debugging 1237 schedulerGroup->addRadio("Dummy"); // Only for debugging
1223 schedulerGroup->addRadio(i18n("Mail client")); 1238 schedulerGroup->addRadio(i18n("Mail client"));
1224 1239
1225 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1240 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1226#endif 1241#endif
1227 1242
1228 KPrefsDialogWidRadios *sendGroup = 1243 KPrefsDialogWidRadios *sendGroup =
1229 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1244 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1230 topFrame); 1245 topFrame);
1231 sendGroup->addRadio(i18n("Send to outbox")); 1246 sendGroup->addRadio(i18n("Send to outbox"));
1232 sendGroup->addRadio(i18n("Send directly")); 1247 sendGroup->addRadio(i18n("Send directly"));
1233 1248
1234 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1249 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1235 1250
1236 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1251 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1237 mAMails = new QListView(topFrame); 1252 mAMails = new QListView(topFrame);
1238 mAMails->addColumn(i18n("Email"),300); 1253 mAMails->addColumn(i18n("Email"),300);
1239 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1254 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1240 1255
1241 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1256 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1242 aEmailsEdit = new QLineEdit(topFrame); 1257 aEmailsEdit = new QLineEdit(topFrame);
1243 aEmailsEdit->setEnabled(false); 1258 aEmailsEdit->setEnabled(false);
1244 topLayout->addWidget(aEmailsEdit,4,1); 1259 topLayout->addWidget(aEmailsEdit,4,1);
1245 1260
1246 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1261 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1247 topLayout->addWidget(add,5,0); 1262 topLayout->addWidget(add,5,0);
1248 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1263 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1249 topLayout->addWidget(del,5,1); 1264 topLayout->addWidget(del,5,1);
1250 1265
1251 //topLayout->setRowStretch(2,1); 1266 //topLayout->setRowStretch(2,1);
1252 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1267 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1253 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1268 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1254 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1269 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1255 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1270 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
1256#endif 1271#endif
1257} 1272}
1258 1273
1259void KOPrefsDialog::setupGroupAutomationTab() 1274void KOPrefsDialog::setupGroupAutomationTab()
1260{ 1275{
1261 return; 1276 return;
1262 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1277 QFrame *topFrame = addPage(i18n("Group Automation"),0,
1263 DesktopIcon("personal",KIcon::SizeMedium)); 1278 DesktopIcon("personal",KIcon::SizeMedium));
1264 1279
1265 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1280 QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
1266 topLayout->setSpacing(spacingHint()); 1281 topLayout->setSpacing(spacingHint());
1267 topLayout->setMargin(marginHint()); 1282 topLayout->setMargin(marginHint());
1268 1283
1269 KPrefsDialogWidRadios *autoRefreshGroup = 1284 KPrefsDialogWidRadios *autoRefreshGroup =
1270 addWidRadios(i18n("Auto Send Refresh"), 1285 addWidRadios(i18n("Auto Send Refresh"),
1271 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1286 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1272 autoRefreshGroup->addRadio(i18n("Never")); 1287 autoRefreshGroup->addRadio(i18n("Never"));
1273 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1288 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1274 //autoRefreshGroup->addRadio(i18n("selected emails")); 1289 //autoRefreshGroup->addRadio(i18n("selected emails"));
1275 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1290 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1276 1291
1277 KPrefsDialogWidRadios *autoInsertGroup = 1292 KPrefsDialogWidRadios *autoInsertGroup =
1278 addWidRadios(i18n("Auto Insert IMIP Replies"), 1293 addWidRadios(i18n("Auto Insert IMIP Replies"),
1279 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); 1294 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
1280 autoInsertGroup->addRadio(i18n("Never")); 1295 autoInsertGroup->addRadio(i18n("Never"));
1281 autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); 1296 autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
1282 //autoInsertGroup->addRadio(i18n("selected emails")); 1297 //autoInsertGroup->addRadio(i18n("selected emails"));
1283 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); 1298 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
1284 1299
1285 KPrefsDialogWidRadios *autoRequestGroup = 1300 KPrefsDialogWidRadios *autoRequestGroup =
1286 addWidRadios(i18n("Auto Insert IMIP Requests"), 1301 addWidRadios(i18n("Auto Insert IMIP Requests"),
1287 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); 1302 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
1288 autoRequestGroup->addRadio(i18n("Never")); 1303 autoRequestGroup->addRadio(i18n("Never"));
1289 autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); 1304 autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
1290 //autoInsertGroup->addRadio(i18n("selected emails")); 1305 //autoInsertGroup->addRadio(i18n("selected emails"));
1291 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); 1306 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0);
1292 1307
1293 KPrefsDialogWidRadios *autoFreeBusyGroup = 1308 KPrefsDialogWidRadios *autoFreeBusyGroup =
1294 addWidRadios(i18n("Auto Send FreeBusy Information"), 1309 addWidRadios(i18n("Auto Send FreeBusy Information"),
1295 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); 1310 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame);
1296 autoFreeBusyGroup->addRadio(i18n("Never")); 1311 autoFreeBusyGroup->addRadio(i18n("Never"));
1297 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); 1312 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook"));
1298 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1313 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1299 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); 1314 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0);
1300 1315
1301 KPrefsDialogWidRadios *autoFreeBusyReplyGroup = 1316 KPrefsDialogWidRadios *autoFreeBusyReplyGroup =
1302 addWidRadios(i18n("Auto Save FreeBusy Replies"), 1317 addWidRadios(i18n("Auto Save FreeBusy Replies"),
1303 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); 1318 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
1304 autoFreeBusyReplyGroup->addRadio(i18n("Never")); 1319 autoFreeBusyReplyGroup->addRadio(i18n("Never"));
1305 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); 1320 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
1306 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1321 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1307 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); 1322 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
1308} 1323}
1309 1324
1310void KOPrefsDialog::showPrinterTab() 1325void KOPrefsDialog::showPrinterTab()
1311{ 1326{
1312 showPage(pageIndex(mPrinterTab)); 1327 showPage(pageIndex(mPrinterTab));
1313} 1328}
1314 1329
1315 1330
1316void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, 1331void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
1317 const QStringList *tags) 1332 const QStringList *tags)
1318{ 1333{
1319 if (tags) { 1334 if (tags) {
1320 int i = tags->findIndex(text); 1335 int i = tags->findIndex(text);
1321 if (i > 0) combo->setCurrentItem(i); 1336 if (i > 0) combo->setCurrentItem(i);
1322 } else { 1337 } else {
1323 for(int i=0;i<combo->count();++i) { 1338 for(int i=0;i<combo->count();++i) {
1324 if (combo->text(i) == text) { 1339 if (combo->text(i) == text) {
1325 combo->setCurrentItem(i); 1340 combo->setCurrentItem(i);
1326 break; 1341 break;
1327 } 1342 }
1328 } 1343 }
1329 } 1344 }
1330} 1345}
1331 1346
1332void KOPrefsDialog::usrReadConfig() 1347void KOPrefsDialog::usrReadConfig()
1333{ 1348{
1334 kdelibcfg->readConfig(); 1349 kdelibcfg->readConfig();
1335 mNameEdit->setText(KOPrefs::instance()->fullName()); 1350 mNameEdit->setText(KOPrefs::instance()->fullName());
1336 mEmailEdit->setText(KOPrefs::instance()->email()); 1351 mEmailEdit->setText(KOPrefs::instance()->email());
1337 1352
1338 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); 1353 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
1339 QDate current ( 2001, 1,1); 1354 // QDate current ( 2001, 1,1);
1340 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); 1355 //mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1341 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); 1356 //mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1342 setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); 1357 //setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId));
1343 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); 1358 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1344 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); 1359 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
1345 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); 1360 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
1346 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); 1361 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
1347 // if (KOPrefs::instance()->mAllDaySize > 47 ) 1362 // if (KOPrefs::instance()->mAllDaySize > 47 )
1348 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2; 1363 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2;
1349 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize); 1364 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize);
1350 1365
1351 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); 1366 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
1352 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); 1367 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
1353 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); 1368 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
1354 // mAMails->clear(); 1369 // mAMails->clear();
1355 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); 1370 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
1356// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { 1371// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
1357// QListViewItem *item = new QListViewItem(mAMails); 1372// QListViewItem *item = new QListViewItem(mAMails);
1358// item->setText(0,*it); 1373// item->setText(0,*it);
1359// mAMails->insertItem(item); 1374// mAMails->insertItem(item);
1360// } 1375// }
1361 1376
1362 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP); 1377 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP);
1363 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser); 1378 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser);
1364 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd); 1379 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd);
1365 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile); 1380 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile);
1366 1381
1367 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); 1382 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
1368 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); 1383 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
1369 QString dummy = KOPrefs::instance()->mUserDateFormatLong; 1384 //QString dummy = KOPrefs::instance()->mUserDateFormatLong;
1370 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 1385 //mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
1371 dummy = KOPrefs::instance()->mUserDateFormatShort; 1386 //dummy = KOPrefs::instance()->mUserDateFormatShort;
1372 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); 1387 //mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
1373 updateCategories(); 1388 updateCategories();
1374 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); 1389 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
1375 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); 1390 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
1376 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); 1391 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
1377 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); 1392 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
1378} 1393}
1379 1394
1380 1395
1381void KOPrefsDialog::usrWriteConfig() 1396void KOPrefsDialog::usrWriteConfig()
1382{ 1397{
1383 1398
1384 kdelibcfg->writeConfig(); 1399 kdelibcfg->writeConfig();
1385 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); 1400 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text();
1386 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); 1401 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text();
1387 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text(); 1402 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text();
1388 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text(); 1403 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text();
1389 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text(); 1404 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text();
1390 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); 1405 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
1391 1406
1392 KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); 1407 //KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
1393 KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); 1408 //KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
1394 KOPrefs::instance()->setFullName(mNameEdit->text()); 1409 KOPrefs::instance()->setFullName(mNameEdit->text());
1395 KOPrefs::instance()->setEmail(mEmailEdit->text()); 1410 KOPrefs::instance()->setEmail(mEmailEdit->text());
1396 1411
1397 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); 1412 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
1398 1413
1399 KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText(); 1414 // KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText();
1400 QDate date; 1415 //QDate date;
1401 date = mStartDateSavingEdit->date(); 1416 //date = mStartDateSavingEdit->date();
1402 int sub = 0; 1417 //int sub = 0;
1403 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 1418 //if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1404 sub = 1; 1419 // sub = 1;
1405 KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub; 1420// KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub;
1406 date = mEndDateSavingEdit->date(); 1421// date = mEndDateSavingEdit->date();
1407 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 1422// if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1408 sub = 1; 1423// sub = 1;
1409 else 1424// else
1410 sub = 0; 1425// sub = 0;
1411 KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub; 1426// KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub;
1412 // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); 1427// // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value();
1413 1428
1414 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1429 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1415 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1430 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1416 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1431 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1417 1432
1418 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); 1433 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value();
1419 1434
1420 QDictIterator<QColor> it(mCategoryDict); 1435 QDictIterator<QColor> it(mCategoryDict);
1421 while (it.current()) { 1436 while (it.current()) {
1422 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1437 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1423 ++it; 1438 ++it;
1424 } 1439 }
1425 1440
1426 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1441 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1427 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1442 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1428 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1443 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1429 1444
1430 KOPrefs::instance()->mAdditionalMails.clear(); 1445 KOPrefs::instance()->mAdditionalMails.clear();
1431 // QListViewItem *item; 1446 // QListViewItem *item;
1432 // item = mAMails->firstChild(); 1447 // item = mAMails->firstChild();
1433 // while (item) 1448 // while (item)
1434 // { 1449 // {
1435 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); 1450 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
1436 // item = item->nextSibling(); 1451 // item = item->nextSibling();
1437 // } 1452 // }
1438 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); 1453 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
1439 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; 1454 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
1440 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; 1455 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
1441 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; 1456 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
1442 1457
1443} 1458}
1444 1459
1445void KOPrefsDialog::updateCategories() 1460void KOPrefsDialog::updateCategories()
1446{ 1461{
1447 mCategoryCombo->clear(); 1462 mCategoryCombo->clear();
1448 mCategoryDict.clear(); 1463 mCategoryDict.clear();
1449 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1464 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1450 updateCategoryColor(); 1465 updateCategoryColor();
1451} 1466}
1452 1467
1453void KOPrefsDialog::warningGroupScheduling() 1468void KOPrefsDialog::warningGroupScheduling()
1454{ 1469{
1455 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked()); 1470 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked());
1456} 1471}
1457 1472
1458void KOPrefsDialog::warningProjectView() 1473void KOPrefsDialog::warningProjectView()
1459{ 1474{
1460 warningExperimental(mEnableProjectView->checkBox()->isChecked()); 1475 warningExperimental(mEnableProjectView->checkBox()->isChecked());
1461} 1476}
1462 1477
1463void KOPrefsDialog::warningExperimental(bool on) 1478void KOPrefsDialog::warningExperimental(bool on)
1464{ 1479{
1465 if (on) { 1480 if (on) {
1466 KMessageBox::information(this,i18n("This is an experimental feature. " 1481 KMessageBox::information(this,i18n("This is an experimental feature. "
1467 "It may not work, it may do nothing useful and it may cause data loss. " 1482 "It may not work, it may do nothing useful and it may cause data loss. "
1468 "Use with care.\n" 1483 "Use with care.\n"
1469 "You have to restart KOrganizer for this setting to take effect.")); 1484 "You have to restart KOrganizer for this setting to take effect."));
1470 } else { 1485 } else {
1471 KMessageBox::information(this, 1486 KMessageBox::information(this,
1472 i18n("You have to restart KOrganizer for this setting to take effect.")); 1487 i18n("You have to restart KOrganizer for this setting to take effect."));
1473 } 1488 }
1474} 1489}
1475 1490
1476void KOPrefsDialog::toggleEmailSettings(bool on) 1491void KOPrefsDialog::toggleEmailSettings(bool on)
1477{ 1492{
1478 if (on) { 1493 if (on) {
1479 mEmailEdit->setEnabled(false); 1494 mEmailEdit->setEnabled(false);
1480 mNameEdit->setEnabled(false); 1495 mNameEdit->setEnabled(false);
1481 mEmailLabel->setEnabled(false); 1496 mEmailLabel->setEnabled(false);
1482 mNameLabel->setEnabled(false); 1497 mNameLabel->setEnabled(false);
1483 1498
1484 KEMailSettings settings; 1499 KEMailSettings settings;
1485 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); 1500 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
1486 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); 1501 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
1487 } else { 1502 } else {
1488 mEmailEdit->setEnabled(true); 1503 mEmailEdit->setEnabled(true);
1489 mNameEdit->setEnabled(true); 1504 mNameEdit->setEnabled(true);
1490 mEmailLabel->setEnabled(true); 1505 mEmailLabel->setEnabled(true);
1491 mNameLabel->setEnabled(true); 1506 mNameLabel->setEnabled(true);
1492 } 1507 }
1493} 1508}
1494 1509
1495void KOPrefsDialog::addItem() 1510void KOPrefsDialog::addItem()
1496{ 1511{
1497 // aEmailsEdit->setEnabled(true); 1512 // aEmailsEdit->setEnabled(true);
1498// QListViewItem *item = new QListViewItem(mAMails); 1513// QListViewItem *item = new QListViewItem(mAMails);
1499// mAMails->insertItem(item); 1514// mAMails->insertItem(item);
1500// mAMails->setSelected(item,true); 1515// mAMails->setSelected(item,true);
1501// aEmailsEdit->setText(i18n("(EmptyEmail)")); 1516// aEmailsEdit->setText(i18n("(EmptyEmail)"));
1502} 1517}
1503 1518
1504void KOPrefsDialog::removeItem() 1519void KOPrefsDialog::removeItem()
1505{ 1520{
1506// QListViewItem *item; 1521// QListViewItem *item;
1507// item = mAMails->selectedItem(); 1522// item = mAMails->selectedItem();
1508// if (!item) return; 1523// if (!item) return;
1509// mAMails->takeItem(item); 1524// mAMails->takeItem(item);
1510// item = mAMails->selectedItem(); 1525// item = mAMails->selectedItem();
1511// if (!item) { 1526// if (!item) {
1512// aEmailsEdit->setText(""); 1527// aEmailsEdit->setText("");
1513// aEmailsEdit->setEnabled(false); 1528// aEmailsEdit->setEnabled(false);
1514// } 1529// }
1515// if (mAMails->childCount() == 0) { 1530// if (mAMails->childCount() == 0) {
1516// aEmailsEdit->setEnabled(false); 1531// aEmailsEdit->setEnabled(false);
1517// } 1532// }
1518} 1533}
1519 1534
1520void KOPrefsDialog::updateItem() 1535void KOPrefsDialog::updateItem()
1521{ 1536{
1522 // QListViewItem *item; 1537 // QListViewItem *item;
1523// item = mAMails->selectedItem(); 1538// item = mAMails->selectedItem();
1524// if (!item) return; 1539// if (!item) return;
1525// item->setText(0,aEmailsEdit->text()); 1540// item->setText(0,aEmailsEdit->text());
1526} 1541}
1527 1542
1528void KOPrefsDialog::updateInput() 1543void KOPrefsDialog::updateInput()
1529{ 1544{
1530// QListViewItem *item; 1545// QListViewItem *item;
1531// item = mAMails->selectedItem(); 1546// item = mAMails->selectedItem();
1532// if (!item) return; 1547// if (!item) return;
1533// aEmailsEdit->setEnabled(true); 1548// aEmailsEdit->setEnabled(true);
1534// aEmailsEdit->setText(item->text(0)); 1549// aEmailsEdit->setText(item->text(0));
1535} 1550}
1536void KOPrefsDialog::updateTimezoneOffset( int index ) 1551void KOPrefsDialog::updateTimezoneOffset( int index )
1537{ 1552{
1538 /* 1553 /*
1539 qDebug("updateTimezoneOffset %d ", index); 1554 qDebug("updateTimezoneOffset %d ", index);
1540 if ( index < 24 ) { 1555 if ( index < 24 ) {
1541 mTimezoneOffsetSpin->setEnabled ( false ); 1556 mTimezoneOffsetSpin->setEnabled ( false );
1542 mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 ); 1557 mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 );
1543 1558
1544 1559
1545 } else { 1560 } else {
1546 if ( index == 24 ) { 1561 if ( index == 24 ) {
1547 mTimezoneOffsetSpin->setEnabled ( true ); 1562 mTimezoneOffsetSpin->setEnabled ( true );
1548 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); 1563 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1549 1564
1550 } else { 1565 } else {
1551 mTimezoneOffsetSpin->setEnabled ( false ); 1566 mTimezoneOffsetSpin->setEnabled ( false );
1552 mTimezoneOffsetSpin->setValue( 0 ); 1567 mTimezoneOffsetSpin->setValue( 0 );
1553 } 1568 }
1554 } 1569 }
1555 */ 1570 */
1556} 1571}
1557 1572
1558void KOPrefsDialog::setupTimeZoneTab() 1573void KOPrefsDialog::setupTimeZoneTab()
1559{ 1574{
1575#if 0
1560 QFrame *topFrame = addPage(i18n("Time Zone"),0,0); 1576 QFrame *topFrame = addPage(i18n("Time Zone"),0,0);
1561 // DesktopIcon("clock",KIcon::SizeMedium)); 1577 // DesktopIcon("clock",KIcon::SizeMedium));
1562 1578
1563 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1579 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1564 topLayout->setSpacing(spacingHint()); 1580 topLayout->setSpacing(spacingHint());
1565 topLayout->setMargin(marginHint()); 1581 topLayout->setMargin(marginHint());
1566 1582
1567 QHBox *timeZoneBox = new QHBox( topFrame ); 1583 QHBox *timeZoneBox = new QHBox( topFrame );
1568 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 1584 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
1569 1585
1570 new QLabel( i18n("Timezone:"), timeZoneBox ); 1586 new QLabel( i18n("Timezone:"), timeZoneBox );
1571 mTimeZoneCombo = new QComboBox( timeZoneBox ); 1587 mTimeZoneCombo = new QComboBox( timeZoneBox );
1572 if ( QApplication::desktop()->width() < 300 ) { 1588 if ( QApplication::desktop()->width() < 300 ) {
1573 mTimeZoneCombo->setMaximumWidth(150); 1589 mTimeZoneCombo->setMaximumWidth(150);
1574 } 1590 }
1575 1591
1576 QStringList list; 1592 QStringList list;
1577 list = KGlobal::locale()->timeZoneList(); 1593 list = KGlobal::locale()->timeZoneList();
1578 mTimeZoneCombo->insertStringList(list); 1594 mTimeZoneCombo->insertStringList(list);
1579 1595
1580 // find the currently set time zone and select it 1596 // find the currently set time zone and select it
1581 QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId; 1597 QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId;
1582 int nCurrentlySet = 11; 1598 int nCurrentlySet = 11;
1583 for (int i = 0; i < mTimeZoneCombo->count(); i++) 1599 for (int i = 0; i < mTimeZoneCombo->count(); i++)
1584 { 1600 {
1585 if (mTimeZoneCombo->text(i) == sCurrentlySet) 1601 if (mTimeZoneCombo->text(i) == sCurrentlySet)
1586 { 1602 {
1587 nCurrentlySet = i; 1603 nCurrentlySet = i;
1588 break; 1604 break;
1589 } 1605 }
1590 } 1606 }
1591 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 1607 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
1592 int iii = 1; 1608 int iii = 1;
1593 KPrefsDialogWidBool *sb = 1609 KPrefsDialogWidBool *sb =
1594 addWidBool(i18n("Timezone has daylight saving"), 1610 addWidBool(i18n("Timezone has daylight saving"),
1595 &(KOPrefs::instance()->mUseDaylightsaving),topFrame); 1611 &(KOPrefs::instance()->mUseDaylightsaving),topFrame);
1596 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 1612 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
1597 ++iii; 1613 ++iii;
1598 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); 1614 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
1599 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 1615 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1600 ++iii; 1616 ++iii;
1601 lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); 1617 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
1602 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 1618 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1603 ++iii; 1619 ++iii;
1604 lab = new QLabel( i18n("Daylight start:"), topFrame ); 1620 lab = new QLabel( i18n("Daylight start:"), topFrame );
1605 topLayout->addWidget(lab, iii,0); 1621 topLayout->addWidget(lab, iii,0);
1606 mStartDateSavingEdit = new KDateEdit(topFrame); 1622 mStartDateSavingEdit = new KDateEdit(topFrame);
1607 topLayout->addWidget(mStartDateSavingEdit, iii,1); 1623 topLayout->addWidget(mStartDateSavingEdit, iii,1);
1608 ++iii; 1624 ++iii;
1609 1625
1610 lab = new QLabel( i18n("Daylight end:"), topFrame ); 1626 lab = new QLabel( i18n("Daylight end:"), topFrame );
1611 topLayout->addWidget(lab, iii,0); 1627 topLayout->addWidget(lab, iii,0);
1612 mEndDateSavingEdit = new KDateEdit(topFrame); 1628 mEndDateSavingEdit = new KDateEdit(topFrame);
1613 topLayout->addWidget(mEndDateSavingEdit, iii,1); 1629 topLayout->addWidget(mEndDateSavingEdit, iii,1);
1614 ++iii; 1630 ++iii;
1615 QDate current ( 2001, 1,1); 1631 QDate current ( 2001, 1,1);
1616 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); 1632 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1617 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); 1633 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1618 1634#endif
1619 1635
1620} 1636}
1621 1637
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index b597a6a..1c4a186 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1,275 +1,277 @@
1#include <stdlib.h> 1#include <stdlib.h>
2 2
3#include <qaction.h> 3#include <qaction.h>
4#include <qpopupmenu.h> 4#include <qpopupmenu.h>
5#include <qpainter.h> 5#include <qpainter.h>
6#include <qwhatsthis.h> 6#include <qwhatsthis.h>
7#include <qmessagebox.h> 7#include <qmessagebox.h>
8#include <qlineedit.h> 8#include <qlineedit.h>
9#include <qfile.h> 9#include <qfile.h>
10#include <qdir.h> 10#include <qdir.h>
11#include <qapp.h> 11#include <qapp.h>
12#include <qfileinfo.h> 12#include <qfileinfo.h>
13#include <qlabel.h> 13#include <qlabel.h>
14#include <qmap.h> 14#include <qmap.h>
15#include <qwmatrix.h> 15#include <qwmatrix.h>
16#include <qtextbrowser.h> 16#include <qtextbrowser.h>
17#include <qtextstream.h> 17#include <qtextstream.h>
18#ifndef DESKTOP_VERSION 18#ifndef DESKTOP_VERSION
19#include <qpe/global.h> 19#include <qpe/global.h>
20#include <qpe/qpemenubar.h> 20#include <qpe/qpemenubar.h>
21#include <qpe/qpetoolbar.h> 21#include <qpe/qpetoolbar.h>
22#include <qpe/resource.h> 22#include <qpe/resource.h>
23#include <qpe/qpeapplication.h> 23#include <qpe/qpeapplication.h>
24#include <qtopia/alarmserver.h> 24#include <qtopia/alarmserver.h>
25#include <qtopia/qcopenvelope_qws.h> 25#include <qtopia/qcopenvelope_qws.h>
26#else 26#else
27#include <qmenubar.h> 27#include <qmenubar.h>
28#include <qtoolbar.h> 28#include <qtoolbar.h>
29#include <qapplication.h> 29#include <qapplication.h>
30//#include <resource.h> 30//#include <resource.h>
31 31
32#endif 32#endif
33#include <libkcal/calendarlocal.h> 33#include <libkcal/calendarlocal.h>
34#include <libkcal/todo.h> 34#include <libkcal/todo.h>
35#include <libkdepim/ksyncprofile.h> 35#include <libkdepim/ksyncprofile.h>
36#include <libkcal/kincidenceformatter.h> 36#include <libkcal/kincidenceformatter.h>
37#include <libkdepim/kpimglobalprefs.h>
37 38
38#include "calendarview.h" 39#include "calendarview.h"
39#include "koviewmanager.h" 40#include "koviewmanager.h"
40#include "datenavigator.h" 41#include "datenavigator.h"
41#include "koagendaview.h" 42#include "koagendaview.h"
42#include "koagenda.h" 43#include "koagenda.h"
43#include "kodialogmanager.h" 44#include "kodialogmanager.h"
44#include "kdialogbase.h" 45#include "kdialogbase.h"
45#include "kapplication.h" 46#include "kapplication.h"
46#include "kofilterview.h" 47#include "kofilterview.h"
47#include "kstandarddirs.h" 48#include "kstandarddirs.h"
48#include "koprefs.h" 49#include "koprefs.h"
49#include "kfiledialog.h" 50#include "kfiledialog.h"
50#include "koglobals.h" 51#include "koglobals.h"
51#include "kglobal.h" 52#include "kglobal.h"
52#include "klocale.h" 53#include "klocale.h"
53#include "kconfig.h" 54#include "kconfig.h"
54#include "simplealarmclient.h" 55#include "simplealarmclient.h"
55#include "externalapphandler.h" 56#include "externalapphandler.h"
56 57
57using namespace KCal; 58using namespace KCal;
58#ifndef _WIN32_ 59#ifndef _WIN32_
59#include <unistd.h> 60#include <unistd.h>
60#else 61#else
61#include "koimportoldialog.h" 62#include "koimportoldialog.h"
62#endif 63#endif
63#include "mainwindow.h" 64#include "mainwindow.h"
64 65
65int globalFlagBlockStartup; 66int globalFlagBlockStartup;
66MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : 67MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
67 QMainWindow( parent, name ) 68 QMainWindow( parent, name )
68{ 69{
69 70
70#ifdef DESKTOP_VERSION 71#ifdef DESKTOP_VERSION
71 setFont( QFont("Arial"), 14 ); 72 setFont( QFont("Arial"), 14 );
72#endif 73#endif
73 74
74 mClosed = false; 75 mClosed = false;
75 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 76 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
76 QString confFile = locateLocal("config","korganizerrc"); 77 QString confFile = locateLocal("config","korganizerrc");
77 QFileInfo finf ( confFile ); 78 QFileInfo finf ( confFile );
78 bool showWarning = !finf.exists(); 79 bool showWarning = !finf.exists();
79 setIcon(SmallIcon( "ko24" ) ); 80 setIcon(SmallIcon( "ko24" ) );
80 mBlockAtStartup = true; 81 mBlockAtStartup = true;
81 mFlagKeyPressed = false; 82 mFlagKeyPressed = false;
82 setCaption("KOrganizer/Pi"); 83 setCaption("KOrganizer/Pi");
83 KOPrefs *p = KOPrefs::instance(); 84 KOPrefs *p = KOPrefs::instance();
85 KPimGlobalPrefs::instance()->setGlobalConfig();
84 // if ( QApplication::desktop()->height() > 480 ) { 86 // if ( QApplication::desktop()->height() > 480 ) {
85// if ( p->mHourSize == 4 ) 87// if ( p->mHourSize == 4 )
86// p->mHourSize = 6; 88// p->mHourSize = 6;
87// } 89// }
88 if ( p->mHourSize > 18 ) 90 if ( p->mHourSize > 18 )
89 p->mHourSize = 18; 91 p->mHourSize = 18;
90 QMainWindow::ToolBarDock tbd; 92 QMainWindow::ToolBarDock tbd;
91 if ( p->mToolBarHor ) { 93 if ( p->mToolBarHor ) {
92 if ( p->mToolBarUp ) 94 if ( p->mToolBarUp )
93 tbd = Bottom; 95 tbd = Bottom;
94 else 96 else
95 tbd = Top; 97 tbd = Top;
96 } 98 }
97 else { 99 else {
98 if ( p->mToolBarUp ) 100 if ( p->mToolBarUp )
99 tbd = Right; 101 tbd = Right;
100 else 102 else
101 tbd = Left; 103 tbd = Left;
102 } 104 }
103 if ( KOPrefs::instance()->mUseAppColors ) 105 if ( KOPrefs::instance()->mUseAppColors )
104 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 106 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
105 globalFlagBlockStartup = 1; 107 globalFlagBlockStartup = 1;
106 iconToolBar = new QPEToolBar( this ); 108 iconToolBar = new QPEToolBar( this );
107 addToolBar (iconToolBar , tbd ); 109 addToolBar (iconToolBar , tbd );
108 mBlockSaveFlag = false; 110 mBlockSaveFlag = false;
109 mCalendarModifiedFlag = false; 111 mCalendarModifiedFlag = false;
110 112
111 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 113 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
112 splash->setAlignment ( AlignCenter ); 114 splash->setAlignment ( AlignCenter );
113 setCentralWidget( splash ); 115 setCentralWidget( splash );
114#ifndef DESKTOP_VERSION 116#ifndef DESKTOP_VERSION
115 showMaximized(); 117 showMaximized();
116#endif 118#endif
117 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 119 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
118 setDefaultPreferences(); 120 setDefaultPreferences();
119 mCalendar = new CalendarLocal(); 121 mCalendar = new CalendarLocal();
120 mView = new CalendarView( mCalendar, this,"mCalendar " ); 122 mView = new CalendarView( mCalendar, this,"mCalendar " );
121 mView->hide(); 123 mView->hide();
122 //mView->resize(splash->size() ); 124 //mView->resize(splash->size() );
123 initActions(); 125 initActions();
124#ifndef DESKTOP_VERSION 126#ifndef DESKTOP_VERSION
125 iconToolBar->show(); 127 iconToolBar->show();
126 qApp->processEvents(); 128 qApp->processEvents();
127#endif 129#endif
128 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 130 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
129 int vh = height() ; 131 int vh = height() ;
130 int vw = width(); 132 int vw = width();
131 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 133 //qDebug("Toolbar hei %d ",iconToolBar->height() );
132 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 134 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
133 vh -= iconToolBar->height(); 135 vh -= iconToolBar->height();
134 } else { 136 } else {
135 vw -= iconToolBar->height(); 137 vw -= iconToolBar->height();
136 } 138 }
137 //mView->setMaximumSize( splash->size() ); 139 //mView->setMaximumSize( splash->size() );
138 //mView->resize( splash->size() ); 140 //mView->resize( splash->size() );
139 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 141 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
140 mView->readSettings(); 142 mView->readSettings();
141 bool oldOpened = false; 143 bool oldOpened = false;
142 bool newFile = false; 144 bool newFile = false;
143 if( !QFile::exists( defaultFileName() ) ) { 145 if( !QFile::exists( defaultFileName() ) ) {
144 QFileInfo finfo ( defaultFileName() ); 146 QFileInfo finfo ( defaultFileName() );
145 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); 147 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics");
146 qDebug("oldfile %s ", oldFile.latin1()); 148 qDebug("oldfile %s ", oldFile.latin1());
147 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; 149 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n";
148 finfo.setFile( oldFile ); 150 finfo.setFile( oldFile );
149 if (finfo.exists() ) { 151 if (finfo.exists() ) {
150 KMessageBox::information( this, message); 152 KMessageBox::information( this, message);
151 mView->openCalendar( oldFile ); 153 mView->openCalendar( oldFile );
152 qApp->processEvents(); 154 qApp->processEvents();
153 } else { 155 } else {
154 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); 156 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics");
155 finfo.setFile( oldFile ); 157 finfo.setFile( oldFile );
156 if (finfo.exists() ) { 158 if (finfo.exists() ) {
157 KMessageBox::information( this, message); 159 KMessageBox::information( this, message);
158 mView->openCalendar( oldFile ); 160 mView->openCalendar( oldFile );
159 qApp->processEvents(); 161 qApp->processEvents();
160 } 162 }
161 } 163 }
162 mView->saveCalendar( defaultFileName() ); 164 mView->saveCalendar( defaultFileName() );
163 newFile = true; 165 newFile = true;
164 } 166 }
165 167
166 QTime neededSaveTime = QDateTime::currentDateTime().time(); 168 QTime neededSaveTime = QDateTime::currentDateTime().time();
167 if ( ! oldOpened ) 169 if ( ! oldOpened )
168 mView->openCalendar( defaultFileName() ); 170 mView->openCalendar( defaultFileName() );
169 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 171 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
170 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 172 qDebug("KO: Calendar loading time: %d ms",msNeeded );
171 173
172 if ( KOPrefs::instance()->mLanguageChanged ) { 174 if ( KOPrefs::instance()->mLanguageChanged ) {
173 KOPrefs::instance()->setCategoryDefaults(); 175 KOPrefs::instance()->setCategoryDefaults();
174 int count = mView->addCategories(); 176 int count = mView->addCategories();
175 KOPrefs::instance()->mLanguageChanged = false; 177 KOPrefs::instance()->mLanguageChanged = false;
176 } 178 }
177 processIncidenceSelection( 0 ); 179 processIncidenceSelection( 0 );
178 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), 180 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
179 SLOT( processIncidenceSelection( Incidence * ) ) ); 181 SLOT( processIncidenceSelection( Incidence * ) ) );
180 connect( mView, SIGNAL( modifiedChanged( bool ) ), 182 connect( mView, SIGNAL( modifiedChanged( bool ) ),
181 SLOT( slotModifiedChanged( bool ) ) ); 183 SLOT( slotModifiedChanged( bool ) ) );
182 184
183 185
184 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 186 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
185 mView->setModified( false ); 187 mView->setModified( false );
186 mBlockAtStartup = false; 188 mBlockAtStartup = false;
187 mView->setModified( false ); 189 mView->setModified( false );
188 setCentralWidget( mView ); 190 setCentralWidget( mView );
189 globalFlagBlockStartup = 0; 191 globalFlagBlockStartup = 0;
190 mView->show(); 192 mView->show();
191 delete splash; 193 delete splash;
192 if ( newFile ) 194 if ( newFile )
193 mView->updateConfig(); 195 mView->updateConfig();
194 // qApp->processEvents(); 196 // qApp->processEvents();
195 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 197 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
196 fillSyncMenu(); 198 fillSyncMenu();
197 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 199 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
198 if ( showWarning ) { 200 if ( showWarning ) {
199 KMessageBox::information( this, 201 KMessageBox::information( this,
200 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 202 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
201 qApp->processEvents(); 203 qApp->processEvents();
202 mView->dialogManager()->showSyncOptions(); 204 mView->dialogManager()->showSyncOptions();
203 } 205 }
204 206
205 //US listen for result adressed from Ka/Pi 207 //US listen for result adressed from Ka/Pi
206#ifndef DESKTOP_VERSION 208#ifndef DESKTOP_VERSION
207 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 209 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
208#endif 210#endif
209} 211}
210MainWindow::~MainWindow() 212MainWindow::~MainWindow()
211{ 213{
212 //qDebug("MainWindow::~MainWindow() "); 214 //qDebug("MainWindow::~MainWindow() ");
213 //save toolbar location 215 //save toolbar location
214 216
215 delete mCalendar; 217 delete mCalendar;
216 delete KOPrefs::instance(); 218 delete KOPrefs::instance();
217 delete KIncidenceFormatter::instance(); 219 delete KIncidenceFormatter::instance();
218 220
219 221
220} 222}
221void MainWindow::showMaximized () 223void MainWindow::showMaximized ()
222{ 224{
223#ifndef DESKTOP_VERSION 225#ifndef DESKTOP_VERSION
224 if ( ! globalFlagBlockStartup ) 226 if ( ! globalFlagBlockStartup )
225 if ( mClosed ) 227 if ( mClosed )
226 mView->goToday(); 228 mView->goToday();
227#endif 229#endif
228 QWidget::showMaximized () ; 230 QWidget::showMaximized () ;
229 mClosed = false; 231 mClosed = false;
230} 232}
231void MainWindow::closeEvent( QCloseEvent* ce ) 233void MainWindow::closeEvent( QCloseEvent* ce )
232{ 234{
233 235
234 236
235 237
236 if ( ! KOPrefs::instance()->mAskForQuit ) { 238 if ( ! KOPrefs::instance()->mAskForQuit ) {
237 saveOnClose(); 239 saveOnClose();
238 mClosed = true; 240 mClosed = true;
239 ce->accept(); 241 ce->accept();
240 return; 242 return;
241 243
242 } 244 }
243 245
244 switch( QMessageBox::information( this, "KO/Pi", 246 switch( QMessageBox::information( this, "KO/Pi",
245 i18n("Do you really want\nto close KO/Pi?"), 247 i18n("Do you really want\nto close KO/Pi?"),
246 i18n("Close"), i18n("No"), 248 i18n("Close"), i18n("No"),
247 0, 0 ) ) { 249 0, 0 ) ) {
248 case 0: 250 case 0:
249 saveOnClose(); 251 saveOnClose();
250 mClosed = true; 252 mClosed = true;
251 ce->accept(); 253 ce->accept();
252 break; 254 break;
253 case 1: 255 case 1:
254 ce->ignore(); 256 ce->ignore();
255 break; 257 break;
256 case 2: 258 case 2:
257 259
258 default: 260 default:
259 break; 261 break;
260 } 262 }
261 263
262 264
263} 265}
264 266
265void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) 267void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
266{ 268{
267 QDataStream stream( data, IO_ReadOnly ); 269 QDataStream stream( data, IO_ReadOnly );
268 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); 270 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" );
269 //QString datamess; 271 //QString datamess;
270 //qDebug("message "); 272 //qDebug("message ");
271 qDebug("KO: QCOP message received: %s ", cmsg.data() ); 273 qDebug("KO: QCOP message received: %s ", cmsg.data() );
272 274
273 if ( cmsg == "-writeFile" ) { 275 if ( cmsg == "-writeFile" ) {
274 // I made from the "-writeFile" an "-writeAlarm" 276 // I made from the "-writeFile" an "-writeAlarm"
275 mView->viewManager()->showWhatsNextView(); 277 mView->viewManager()->showWhatsNextView();
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
@@ -555,217 +555,217 @@ void KDEPIMConfigWidget::updateClientWidgets()
555 555
556 } 556 }
557 557
558 bool readonly; 558 bool readonly;
559 bool enabled; 559 bool enabled;
560 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 560 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
561 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 561 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
562 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 562 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
563 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 563 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
564 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 564 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
565 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) 565 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)))
566 { 566 {
567 readonly = false; 567 readonly = false;
568 } 568 }
569 else 569 else
570 { 570 {
571 readonly = true; 571 readonly = true;
572 } 572 }
573 573
574 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) 574 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC))
575 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) 575 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC))
576 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) 576 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC))
577 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) 577 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC))
578 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) 578 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC))
579 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) 579 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC)))
580 { 580 {
581 enabled = false; 581 enabled = false;
582 } 582 }
583 else 583 else
584 { 584 {
585 enabled = true; 585 enabled = true;
586 } 586 }
587 587
588 588
589 mChannel->setReadOnly(readonly); 589 mChannel->setReadOnly(readonly);
590 mMessage->setReadOnly(readonly); 590 mMessage->setReadOnly(readonly);
591 mParameters->setReadOnly(readonly); 591 mParameters->setReadOnly(readonly);
592 mMessage2->setReadOnly(readonly); 592 mMessage2->setReadOnly(readonly);
593 mParameters2->setReadOnly(readonly); 593 mParameters2->setReadOnly(readonly);
594 594
595 mChannel->setEnabled(enabled); 595 mChannel->setEnabled(enabled);
596 mMessage->setEnabled(enabled); 596 mMessage->setEnabled(enabled);
597 mParameters->setEnabled(enabled); 597 mParameters->setEnabled(enabled);
598 mMessage2->setEnabled(enabled); 598 mMessage2->setEnabled(enabled);
599 mParameters2->setEnabled(enabled); 599 mParameters2->setEnabled(enabled);
600 600
601 601
602 602
603 mClient->setCurrentItem(mCurrentClient); 603 mClient->setCurrentItem(mCurrentClient);
604 604
605 605
606 // enable/disable the extra message/parameter field 606 // enable/disable the extra message/parameter field
607 if (mCurrentApp == ExternalAppHandler::EMAIL) 607 if (mCurrentApp == ExternalAppHandler::EMAIL)
608 { 608 {
609 } 609 }
610 else 610 else
611 { 611 {
612 mMessage2->setText( "" ); 612 mMessage2->setText( "" );
613 mParameters2->setText( "" ); 613 mParameters2->setText( "" );
614 } 614 }
615 615
616 if (enabled == true) { 616 if (enabled == true) {
617 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 617 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
618 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 618 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
619 } 619 }
620 620
621 621
622 blockSignals( blocked ); 622 blockSignals( blocked );
623 623
624} 624}
625 625
626void KDEPIMConfigWidget::usrReadConfig() 626void KDEPIMConfigWidget::usrReadConfig()
627{ 627{
628 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); 628 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
629 629
630 bool blocked = signalsBlocked(); 630 bool blocked = signalsBlocked();
631 blockSignals( true ); 631 blockSignals( true );
632 632
633 QString dummy = prefs->mUserDateFormatLong; 633 QString dummy = prefs->mUserDateFormatLong;
634 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 634 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
635 dummy = prefs->mUserDateFormatShort; 635 dummy = prefs->mUserDateFormatShort;
636 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); 636 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
637 637
638 QDate current ( 2001, 1,1); 638 QDate current ( 2001, 1,1);
639 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); 639 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1));
640 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); 640 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1));
641 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); 641 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId));
642 642
643 643
644 644
645 645
646 mEmailClient = prefs->mEmailClient; 646 mEmailClient = prefs->mEmailClient;
647 mEmailOtherChannel = prefs->mEmailOtherChannel; 647 mEmailOtherChannel = prefs->mEmailOtherChannel;
648 mEmailOtherMessage = prefs->mEmailOtherMessage; 648 mEmailOtherMessage = prefs->mEmailOtherMessage;
649 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; 649 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters;
650 mEmailOtherMessage2 = prefs->mEmailOtherMessage2; 650 mEmailOtherMessage2 = prefs->mEmailOtherMessage2;
651 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; 651 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2;
652 652
653 mPhoneClient = prefs->mPhoneClient; 653 mPhoneClient = prefs->mPhoneClient;
654 mPhoneOtherChannel = prefs->mPhoneOtherChannel; 654 mPhoneOtherChannel = prefs->mPhoneOtherChannel;
655 mPhoneOtherMessage = prefs->mPhoneOtherMessage; 655 mPhoneOtherMessage = prefs->mPhoneOtherMessage;
656 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; 656 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters;
657 657
658 mFaxClient = prefs->mFaxClient; 658 mFaxClient = prefs->mFaxClient;
659 mFaxOtherChannel = prefs->mFaxOtherChannel; 659 mFaxOtherChannel = prefs->mFaxOtherChannel;
660 mFaxOtherMessage = prefs->mFaxOtherMessage; 660 mFaxOtherMessage = prefs->mFaxOtherMessage;
661 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; 661 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters;
662 662
663 mSMSClient = prefs->mSMSClient; 663 mSMSClient = prefs->mSMSClient;
664 mSMSOtherChannel = prefs->mSMSOtherChannel; 664 mSMSOtherChannel = prefs->mSMSOtherChannel;
665 mSMSOtherMessage = prefs->mSMSOtherMessage; 665 mSMSOtherMessage = prefs->mSMSOtherMessage;
666 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; 666 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters;
667 667
668 mPagerClient = prefs->mPagerClient; 668 mPagerClient = prefs->mPagerClient;
669 mPagerOtherChannel = prefs->mPagerOtherChannel; 669 mPagerOtherChannel = prefs->mPagerOtherChannel;
670 mPagerOtherMessage = prefs->mPagerOtherMessage; 670 mPagerOtherMessage = prefs->mPagerOtherMessage;
671 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; 671 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters;
672 672
673 mSipClient = prefs->mPagerClient; 673 mSipClient = prefs->mPagerClient;
674 mSipOtherChannel = prefs->mSipOtherChannel; 674 mSipOtherChannel = prefs->mSipOtherChannel;
675 mSipOtherMessage = prefs->mSipOtherMessage; 675 mSipOtherMessage = prefs->mSipOtherMessage;
676 mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; 676 mSipOtherMessageParameters = prefs->mSipOtherMessageParameters;
677 677
678 mCurrentApp = ExternalAppHandler::EMAIL; 678 mCurrentApp = ExternalAppHandler::EMAIL;
679 mCurrentClient = mEmailClient; 679 mCurrentClient = mEmailClient;
680 680
681 updateClientWidgets(); 681 updateClientWidgets();
682 682
683 blockSignals( blocked ); 683 blockSignals( blocked );
684 684
685} 685}
686 686
687void KDEPIMConfigWidget::usrWriteConfig() 687void KDEPIMConfigWidget::usrWriteConfig()
688{ 688{
689 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); 689 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
690 690
691 saveEditFieldSettings(); 691 saveEditFieldSettings();
692 692
693 693
694 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); 694 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
695 prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); 695 prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
696 696
697 prefs->mTimeZoneId = mTimeZoneCombo->currentText(); 697 prefs->mTimeZoneId = mTimeZoneCombo->currentText();
698 QDate date; 698 QDate date;
699 date = mStartDateSavingEdit->date(); 699 date = mStartDateSavingEdit->date();
700 int sub = 0; 700 int sub = 0;
701 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 701 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
702 sub = 1; 702 sub = 1;
703 prefs->mDaylightsavingStart = date.dayOfYear()-sub; 703 prefs->mDaylightsavingStart = date.dayOfYear()-sub;
704 date = mEndDateSavingEdit->date(); 704 date = mEndDateSavingEdit->date();
705 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 705 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
706 sub = 1; 706 sub = 1;
707 else 707 else
708 sub = 0; 708 sub = 0;
709 prefs->mDaylightsavingEnd = date.dayOfYear()-sub; 709 prefs->mDaylightsavingEnd = date.dayOfYear()-sub;
710 710
711 711
712 prefs->mEmailClient = mEmailClient; 712 prefs->mEmailClient = mEmailClient;
713 prefs->mEmailOtherChannel = mEmailOtherChannel; 713 prefs->mEmailOtherChannel = mEmailOtherChannel;
714 prefs->mEmailOtherMessage = mEmailOtherMessage; 714 prefs->mEmailOtherMessage = mEmailOtherMessage;
715 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; 715 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters;
716 prefs->mEmailOtherMessage2 = mEmailOtherMessage2; 716 prefs->mEmailOtherMessage2 = mEmailOtherMessage2;
717 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; 717 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2;
718 718
719 prefs->mPhoneClient = mPhoneClient; 719 prefs->mPhoneClient = mPhoneClient;
720 prefs->mPhoneOtherChannel = mPhoneOtherChannel; 720 prefs->mPhoneOtherChannel = mPhoneOtherChannel;
721 prefs->mPhoneOtherMessage = mPhoneOtherMessage; 721 prefs->mPhoneOtherMessage = mPhoneOtherMessage;
722 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; 722 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters;
723 723
724 prefs->mFaxClient = mFaxClient; 724 prefs->mFaxClient = mFaxClient;
725 prefs->mFaxOtherChannel = mFaxOtherChannel; 725 prefs->mFaxOtherChannel = mFaxOtherChannel;
726 prefs->mFaxOtherMessage = mFaxOtherMessage; 726 prefs->mFaxOtherMessage = mFaxOtherMessage;
727 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; 727 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters;
728 728
729 prefs->mSMSClient = mSMSClient; 729 prefs->mSMSClient = mSMSClient;
730 prefs->mSMSOtherChannel = mSMSOtherChannel; 730 prefs->mSMSOtherChannel = mSMSOtherChannel;
731 prefs->mSMSOtherMessage = mSMSOtherMessage; 731 prefs->mSMSOtherMessage = mSMSOtherMessage;
732 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; 732 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters;
733 733
734 prefs->mPagerClient = mPagerClient; 734 prefs->mPagerClient = mPagerClient;
735 prefs->mPagerOtherChannel = mPagerOtherChannel; 735 prefs->mPagerOtherChannel = mPagerOtherChannel;
736 prefs->mPagerOtherMessage = mPagerOtherMessage; 736 prefs->mPagerOtherMessage = mPagerOtherMessage;
737 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; 737 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters;
738 738
739 739
740 prefs->mSipClient = mSipClient; 740 prefs->mSipClient = mSipClient;
741 prefs->mSipOtherChannel = mSipOtherChannel; 741 prefs->mSipOtherChannel = mSipOtherChannel;
742 prefs->mSipOtherMessage = mSipOtherMessage; 742 prefs->mSipOtherMessage = mSipOtherMessage;
743 prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; 743 prefs->mSipOtherMessageParameters = mSipOtherMessageParameters;
744 744
745 //release the cache that other views can access the changed values instantanious 745 //release the cache that other views can access the changed values instantanious
746 ExternalAppHandler::instance()->loadConfig(); 746 ExternalAppHandler::instance()->loadConfig();
747 747 KPimGlobalPrefs::instance()->setGlobalConfig();
748} 748}
749 749
750 750
751void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, 751void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text,
752 const QStringList *tags) 752 const QStringList *tags)
753{ 753{
754 if (tags) { 754 if (tags) {
755 int i = tags->findIndex(text); 755 int i = tags->findIndex(text);
756 if (i > 0) combo->setCurrentItem(i); 756 if (i > 0) combo->setCurrentItem(i);
757 } else { 757 } else {
758 for(int i=0;i<combo->count();++i) { 758 for(int i=0;i<combo->count();++i) {
759 if (combo->text(i) == text) { 759 if (combo->text(i) == text) {
760 combo->setCurrentItem(i); 760 combo->setCurrentItem(i);
761 break; 761 break;
762 } 762 }
763 } 763 }
764 } 764 }
765} 765}
766 766
767 767
768void KDEPIMConfigWidget::textChanged( const QString& text ) 768void KDEPIMConfigWidget::textChanged( const QString& text )
769{ 769{
770 emit changed( true ); 770 emit changed( true );
771} 771}
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 12a503d..a896a0f 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -1,115 +1,132 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <kglobal.h> 31#include <kglobal.h>
32#include <kconfig.h> 32#include <kconfig.h>
33#include <klocale.h> 33#include <klocale.h>
34#include <kdebug.h> 34#include <kdebug.h>
35#include <kstaticdeleter.h> 35#include <kstaticdeleter.h>
36 36
37#include "kpimglobalprefs.h" 37#include "kpimglobalprefs.h"
38 38
39KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; 39KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0;
40static KStaticDeleter<KPimGlobalPrefs> staticDeleter; 40static KStaticDeleter<KPimGlobalPrefs> staticDeleter;
41 41
42 42
43KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) 43KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
44 : KPrefs("microkdeglobalrc") 44 : KPrefs("microkdeglobalrc")
45{ 45{
46 46
47 KPrefs::setCurrentGroup("Locale"); 47 KPrefs::setCurrentGroup("Locale");
48 addItemInt("PreferredLanguage",&mPreferredLanguage,0); 48 addItemInt("PreferredLanguage",&mPreferredLanguage,0);
49 addItemInt("PreferredTime",&mPreferredTime,0); 49 addItemInt("PreferredTime",&mPreferredTime,0);
50 addItemInt("PreferredDate",&mPreferredDate,0); 50 addItemInt("PreferredDate",&mPreferredDate,0);
51 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); 51 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false);
52 //addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false); 52 //addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false);
53 // addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 53 // addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
54 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); 54 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y");
55 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); 55 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y");
56 56
57 KPrefs::setCurrentGroup("Time & Date"); 57 KPrefs::setCurrentGroup("Time & Date");
58 58
59 addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") ); 59 addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") );
60 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); 60 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true);
61 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); 61 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90);
62 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); 62 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304);
63 63
64 64
65 65
66 66
67 KPrefs::setCurrentGroup( "ExternalApplications" ); 67 KPrefs::setCurrentGroup( "ExternalApplications" );
68 68
69 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC ); 69 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC );
70 addItemString( "EmailChannel", &mEmailOtherChannel, "" ); 70 addItemString( "EmailChannel", &mEmailOtherChannel, "" );
71 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); 71 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" );
72 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); 72 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" );
73 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" ); 73 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" );
74 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" ); 74 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" );
75 75
76 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC ); 76 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC );
77 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" ); 77 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" );
78 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" ); 78 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" );
79 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" ); 79 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" );
80 80
81 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC ); 81 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC );
82 addItemString( "FaxChannel", &mFaxOtherChannel, "" ); 82 addItemString( "FaxChannel", &mFaxOtherChannel, "" );
83 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" ); 83 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" );
84 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" ); 84 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" );
85 85
86 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC ); 86 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC );
87 addItemString( "SMSChannel", &mSMSOtherChannel, "" ); 87 addItemString( "SMSChannel", &mSMSOtherChannel, "" );
88 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" ); 88 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" );
89 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" ); 89 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" );
90 90
91 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); 91 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC );
92 addItemString( "PagerChannel", &mPagerOtherChannel, "" ); 92 addItemString( "PagerChannel", &mPagerOtherChannel, "" );
93 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); 93 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" );
94 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); 94 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" );
95 95
96 addItemInt( "SIPChannelType", &mSipClient, NONE_SIC ); 96 addItemInt( "SIPChannelType", &mSipClient, NONE_SIC );
97 addItemString( "SIPChannel", &mSipOtherChannel, "" ); 97 addItemString( "SIPChannel", &mSipOtherChannel, "" );
98 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); 98 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" );
99 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); 99 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" );
100 100
101} 101}
102 102
103void KPimGlobalPrefs::setGlobalConfig()
104{
105
106 KGlobal::locale()->setHore24Format( !mPreferredTime );
107 KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday );
108 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate );
109 KGlobal::locale()->setLanguage( mPreferredLanguage );
110 QString dummy = mUserDateFormatLong;
111 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
112 dummy = mUserDateFormatShort;
113 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
114 KGlobal::locale()->setDaylightSaving( mUseDaylightsaving,
115 mDaylightsavingStart,
116 mDaylightsavingEnd );
117 KGlobal::locale()->setTimezone( mTimeZoneId );
118
119}
103KPimGlobalPrefs::~KPimGlobalPrefs() 120KPimGlobalPrefs::~KPimGlobalPrefs()
104{ 121{
105} 122}
106 123
107KPimGlobalPrefs *KPimGlobalPrefs::instance() 124KPimGlobalPrefs *KPimGlobalPrefs::instance()
108{ 125{
109 if ( !sInstance ) { 126 if ( !sInstance ) {
110 sInstance = staticDeleter.setObject( new KPimGlobalPrefs() ); 127 sInstance = staticDeleter.setObject( new KPimGlobalPrefs() );
111 sInstance->readConfig(); 128 sInstance->readConfig();
112 } 129 }
113 130
114 return sInstance; 131 return sInstance;
115} 132}
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h
index dad78e6..84ba689 100644
--- a/libkdepim/kpimglobalprefs.h
+++ b/libkdepim/kpimglobalprefs.h
@@ -1,137 +1,135 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#ifndef KPIMGLOBALPREFS_H 31#ifndef KPIMGLOBALPREFS_H
32#define KPIMGLOBALPREFS_H 32#define KPIMGLOBALPREFS_H
33 33
34#include "kprefs.h" 34#include "kprefs.h"
35 35
36class KPimGlobalPrefs : public KPrefs 36class KPimGlobalPrefs : public KPrefs
37{ 37{
38 public: 38 public:
39 39
40 void setGlobalConfig();
40 static KPimGlobalPrefs *instance(); 41 static KPimGlobalPrefs *instance();
41 42
42 43
43 virtual ~KPimGlobalPrefs(); 44 virtual ~KPimGlobalPrefs();
44 45
45 46
46 enum EMailClients { 47 enum EMailClients {
47 NONE_EMC = 0, 48 NONE_EMC = 0,
48 OTHER_EMC = 1, 49 OTHER_EMC = 1,
49 OMPI_EMC = 2, 50 OMPI_EMC = 2,
50 QTOPIA_EMC = 3, 51 QTOPIA_EMC = 3,
51 OPIE_EMC = 4 52 OPIE_EMC = 4
52 }; 53 };
53 54
54 enum PhoneClients { 55 enum PhoneClients {
55 NONE_PHC = 0, 56 NONE_PHC = 0,
56 OTHER_PHC = 1, 57 OTHER_PHC = 1,
57 KPPI_PHC = 2 58 KPPI_PHC = 2
58 }; 59 };
59 60
60 enum FaxClients { 61 enum FaxClients {
61 NONE_FAC = 0, 62 NONE_FAC = 0,
62 OTHER_FAC = 1 63 OTHER_FAC = 1
63 }; 64 };
64 65
65 enum SMSClients { 66 enum SMSClients {
66 NONE_SMC = 0, 67 NONE_SMC = 0,
67 OTHER_SMC = 1 68 OTHER_SMC = 1
68 }; 69 };
69 70
70 enum PagerClients { 71 enum PagerClients {
71 NONE_PAC = 0, 72 NONE_PAC = 0,
72 OTHER_PAC = 1 73 OTHER_PAC = 1
73 }; 74 };
74 75
75 enum SIPClients { 76 enum SIPClients {
76 NONE_SIC = 0, 77 NONE_SIC = 0,
77 OTHER_SIC = 1 78 OTHER_SIC = 1
78 }; 79 };
79 80
80 private: 81 private:
81 KPimGlobalPrefs( const QString &name = QString::null ); 82 KPimGlobalPrefs( const QString &name = QString::null );
82 83
83 static KPimGlobalPrefs *sInstance; 84 static KPimGlobalPrefs *sInstance;
84 85
85 86
86 public: 87 public:
87 //US I copied the following "locale" settings from KOPrefs 88 //US I copied the following "locale" settings from KOPrefs
88 int mPreferredDate; 89 int mPreferredDate;
89 QString mUserDateFormatLong; 90 QString mUserDateFormatLong;
90 QString mUserDateFormatShort; 91 QString mUserDateFormatShort;
91 int mPreferredLanguage; 92 int mPreferredLanguage;
92 int mPreferredTime; 93 int mPreferredTime;
93 bool mWeekStartsOnSunday; 94 bool mWeekStartsOnSunday;
94 QString mTimeZoneId; 95 QString mTimeZoneId;
95 bool mUseDaylightsaving; 96 bool mUseDaylightsaving;
96 int mDaylightsavingStart; 97 int mDaylightsavingStart;
97 int mDaylightsavingEnd; 98 int mDaylightsavingEnd;
98 99
99
100
101
102 int mEmailClient; 100 int mEmailClient;
103 QString mEmailOtherChannel; 101 QString mEmailOtherChannel;
104 QString mEmailOtherMessage; 102 QString mEmailOtherMessage;
105 QString mEmailOtherMessageParameters; 103 QString mEmailOtherMessageParameters;
106 QString mEmailOtherMessage2; 104 QString mEmailOtherMessage2;
107 QString mEmailOtherMessageParameters2; 105 QString mEmailOtherMessageParameters2;
108 106
109 int mPhoneClient; 107 int mPhoneClient;
110 QString mPhoneOtherChannel; 108 QString mPhoneOtherChannel;
111 QString mPhoneOtherMessage; 109 QString mPhoneOtherMessage;
112 QString mPhoneOtherMessageParameters; 110 QString mPhoneOtherMessageParameters;
113 111
114 int mFaxClient; 112 int mFaxClient;
115 QString mFaxOtherChannel; 113 QString mFaxOtherChannel;
116 QString mFaxOtherMessage; 114 QString mFaxOtherMessage;
117 QString mFaxOtherMessageParameters; 115 QString mFaxOtherMessageParameters;
118 116
119 int mSMSClient; 117 int mSMSClient;
120 QString mSMSOtherChannel; 118 QString mSMSOtherChannel;
121 QString mSMSOtherMessage; 119 QString mSMSOtherMessage;
122 QString mSMSOtherMessageParameters; 120 QString mSMSOtherMessageParameters;
123 121
124 int mPagerClient; 122 int mPagerClient;
125 QString mPagerOtherChannel; 123 QString mPagerOtherChannel;
126 QString mPagerOtherMessage; 124 QString mPagerOtherMessage;
127 QString mPagerOtherMessageParameters; 125 QString mPagerOtherMessageParameters;
128 126
129 int mSipClient; 127 int mSipClient;
130 QString mSipOtherChannel; 128 QString mSipOtherChannel;
131 QString mSipOtherMessage; 129 QString mSipOtherMessage;
132 QString mSipOtherMessageParameters; 130 QString mSipOtherMessageParameters;
133 131
134 132
135}; 133};
136 134
137#endif 135#endif