summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcard/ContentLine.cpp8
-rw-r--r--kaddressbook/kabprefs.cpp1
-rw-r--r--kaddressbook/mainembedded.cpp1
-rw-r--r--kmicromail/main.cpp4
-rw-r--r--korganizer/main.cpp2
-rw-r--r--korganizer/mainwindow.cpp6
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp33
-rw-r--r--libkdepim/kpimglobalprefs.cpp3
-rw-r--r--libkdepim/kpimglobalprefs.h1
-rw-r--r--microkde/kglobalsettings.cpp2
-rw-r--r--pwmanager/pwmanager/main.cpp1
11 files changed, 48 insertions, 14 deletions
diff --git a/kabc/vcard/ContentLine.cpp b/kabc/vcard/ContentLine.cpp
index 2f88cde..0a2f97d 100644
--- a/kabc/vcard/ContentLine.cpp
+++ b/kabc/vcard/ContentLine.cpp
@@ -100,250 +100,256 @@ ContentLine::ContentLine(const ContentLine & x)
100 100
101ContentLine::ContentLine(const QCString & s) 101ContentLine::ContentLine(const QCString & s)
102 :Entity(s), 102 :Entity(s),
103 value_(0), 103 value_(0),
104 paramType_( ParamUnknown ), 104 paramType_( ParamUnknown ),
105 valueType_( ValueUnknown ), 105 valueType_( ValueUnknown ),
106 entityType_( EntityUnknown ) 106 entityType_( EntityUnknown )
107{ 107{
108 paramList_.setAutoDelete( TRUE ); 108 paramList_.setAutoDelete( TRUE );
109} 109}
110 110
111 ContentLine & 111 ContentLine &
112ContentLine::operator = (ContentLine & x) 112ContentLine::operator = (ContentLine & x)
113{ 113{
114 if (*this == x) return *this; 114 if (*this == x) return *this;
115 115
116 ParamListIterator it(x.paramList_); 116 ParamListIterator it(x.paramList_);
117 for (; it.current(); ++it) 117 for (; it.current(); ++it)
118 { 118 {
119 Param *p = new Param; 119 Param *p = new Param;
120 p->setName( it.current()->name() ); 120 p->setName( it.current()->name() );
121 p->setValue( it.current()->value() ); 121 p->setValue( it.current()->value() );
122 paramList_.append(p); 122 paramList_.append(p);
123 } 123 }
124 124
125 value_ = x.value_->clone(); 125 value_ = x.value_->clone();
126 126
127 Entity::operator = (x); 127 Entity::operator = (x);
128 return *this; 128 return *this;
129} 129}
130 130
131 ContentLine & 131 ContentLine &
132ContentLine::operator = (const QCString & s) 132ContentLine::operator = (const QCString & s)
133{ 133{
134 Entity::operator = (s); 134 Entity::operator = (s);
135 delete value_; 135 delete value_;
136 value_ = 0; 136 value_ = 0;
137 return *this; 137 return *this;
138} 138}
139 139
140 bool 140 bool
141ContentLine::operator == (ContentLine & x) 141ContentLine::operator == (ContentLine & x)
142{ 142{
143 x.parse(); 143 x.parse();
144 144
145 QPtrListIterator<Param> it(x.paramList()); 145 QPtrListIterator<Param> it(x.paramList());
146 146
147 if (!paramList_.find(it.current())) 147 if (!paramList_.find(it.current()))
148 return false; 148 return false;
149 149
150 return true; 150 return true;
151} 151}
152 152
153ContentLine::~ContentLine() 153ContentLine::~ContentLine()
154{ 154{
155 delete value_; 155 delete value_;
156 value_ = 0; 156 value_ = 0;
157} 157}
158 158
159 void 159 void
160ContentLine::_parse() 160ContentLine::_parse()
161{ 161{
162 vDebug("parse"); 162 vDebug("parse");
163 163
164 // Unqote newlines 164 // Unfold folded lines
165 // NLR
166 strRep_ = strRep_.replace( QRegExp( "\\r" ), "" );
167 // Unqote newlines
165 strRep_ = strRep_.replace( QRegExp( "\\\\n" ), "\n" ); 168 strRep_ = strRep_.replace( QRegExp( "\\\\n" ), "\n" );
169 //NLR
170 strRep_ = strRep_.replace( QRegExp( "\\\\r" ), "\r" );
166 171
167 int split = strRep_.find(':'); 172 int split = strRep_.find(':');
168 173
169 if (split == -1) { // invalid content line 174 if (split == -1) { // invalid content line
170 vDebug("No ':'"); 175 vDebug("No ':'");
171 return; 176 return;
172 } 177 }
173 178
174 QCString firstPart(strRep_.left(split)); 179 QCString firstPart(strRep_.left(split));
175 QCString valuePart(strRep_.mid(split + 1)); 180 QCString valuePart(strRep_.mid(split + 1));
176 181
177 split = firstPart.find('.'); 182 split = firstPart.find('.');
178 183
179 if (split != -1) { 184 if (split != -1) {
180 group_ = firstPart.left(split); 185 group_ = firstPart.left(split);
181 firstPart= firstPart.mid(split + 1); 186 firstPart= firstPart.mid(split + 1);
182 } 187 }
183 188
184 vDebug("Group == " + group_); 189 vDebug("Group == " + group_);
185 vDebug("firstPart == " + firstPart); 190 vDebug("firstPart == " + firstPart);
186 vDebug("valuePart == " + valuePart); 191 vDebug("valuePart == " + valuePart);
187 192
188 // Now we have the group, the name and param list together and the value. 193 // Now we have the group, the name and param list together and the value.
189 194
190 QStrList l; 195 QStrList l;
191 196
192 RTokenise(firstPart, ";", l); 197 RTokenise(firstPart, ";", l);
193 198
194 if (l.count() == 0) {// invalid - no name ! 199 if (l.count() == 0) {// invalid - no name !
195 vDebug("No name for this content line !"); 200 vDebug("No name for this content line !");
196 return; 201 return;
197 } 202 }
198 203
199 name_ = l.at(0); 204 name_ = l.at(0);
200 205
201 // Now we have the name, so the rest of 'l' is the params. 206 // Now we have the name, so the rest of 'l' is the params.
202 // Remove the name part. 207 // Remove the name part.
203 l.remove(0u); 208 l.remove(0u);
204 209
205 entityType_= EntityNameToEntityType(name_); 210 entityType_= EntityNameToEntityType(name_);
206 paramType_= EntityTypeToParamType(entityType_); 211 paramType_= EntityTypeToParamType(entityType_);
207 212
208 unsigned int i = 0; 213 unsigned int i = 0;
209 214
210 // For each parameter, create a new parameter of the correct type. 215 // For each parameter, create a new parameter of the correct type.
211 216
212 QStrListIterator it(l); 217 QStrListIterator it(l);
213 218
214 for (; it.current(); ++it, i++) { 219 for (; it.current(); ++it, i++) {
215 220
216 QCString str = *it; 221 QCString str = *it;
217 222
218 split = str.find("="); 223 split = str.find("=");
219 if (split < 0 ) { 224 if (split < 0 ) {
220 vDebug("No '=' in paramter."); 225 vDebug("No '=' in paramter.");
221 continue; 226 continue;
222 } 227 }
223 228
224 QCString paraName = str.left(split); 229 QCString paraName = str.left(split);
225 QCString paraValue = str.mid(split + 1); 230 QCString paraValue = str.mid(split + 1);
226 231
227 QStrList paraValues; 232 QStrList paraValues;
228 RTokenise(paraValue, ",", paraValues); 233 RTokenise(paraValue, ",", paraValues);
229 234
230 QStrListIterator it2( paraValues ); 235 QStrListIterator it2( paraValues );
231 236
232 for(; it2.current(); ++it2) { 237 for(; it2.current(); ++it2) {
233 238
234 Param *p = new Param; 239 Param *p = new Param;
235 p->setName( paraName ); 240 p->setName( paraName );
236 p->setValue( *it2 ); 241 p->setValue( *it2 );
237 242
238 paramList_.append(p); 243 paramList_.append(p);
239 } 244 }
240 } 245 }
241 246
242 // Create a new value of the correct type. 247 // Create a new value of the correct type.
243 248
244 valueType_ = EntityTypeToValueType(entityType_); 249 valueType_ = EntityTypeToValueType(entityType_);
245 250
246 //kdDebug(5710) << "valueType: " << valueType_ << endl; 251 //kdDebug(5710) << "valueType: " << valueType_ << endl;
247 252
248 switch (valueType_) { 253 switch (valueType_) {
249 254
250 case ValueSound: value_ = new SoundValue;break; 255 case ValueSound: value_ = new SoundValue;break;
251 case ValueAgent: value_ = new AgentValue;break; 256 case ValueAgent: value_ = new AgentValue;break;
252 case ValueAddress: value_ = new AdrValue; break; 257 case ValueAddress: value_ = new AdrValue; break;
253 case ValueTel: value_ = new TelValue; break; 258 case ValueTel: value_ = new TelValue; break;
254 case ValueTextBin: value_ = new TextBinValue;break; 259 case ValueTextBin: value_ = new TextBinValue;break;
255 case ValueOrg: value_ = new OrgValue; break; 260 case ValueOrg: value_ = new OrgValue; break;
256 case ValueN: value_ = new NValue; break; 261 case ValueN: value_ = new NValue; break;
257 case ValueUTC: value_ = new UTCValue; break; 262 case ValueUTC: value_ = new UTCValue; break;
258 case ValueURI: value_ = new URIValue; break; 263 case ValueURI: value_ = new URIValue; break;
259 case ValueClass: value_ = new ClassValue;break; 264 case ValueClass: value_ = new ClassValue;break;
260 case ValueFloat: value_ = new FloatValue;break; 265 case ValueFloat: value_ = new FloatValue;break;
261 case ValueImage: value_ = new ImageValue;break; 266 case ValueImage: value_ = new ImageValue;break;
262 case ValueDate: value_ = new DateValue; break; 267 case ValueDate: value_ = new DateValue; break;
263 case ValueTextList: value_ = new TextListValue;break; 268 case ValueTextList: value_ = new TextListValue;break;
264 case ValueGeo: value_ = new GeoValue; break; 269 case ValueGeo: value_ = new GeoValue; break;
265 case ValueText: 270 case ValueText:
266 case ValueUnknown: 271 case ValueUnknown:
267 default: value_ = new TextValue; break; 272 default: value_ = new TextValue; break;
268 } 273 }
269 274
270 *value_ = valuePart; 275 *value_ = valuePart;
271} 276}
272 277
273 void 278 void
274ContentLine::_assemble() 279ContentLine::_assemble()
275{ 280{
276 //strRep_.truncate(0); 281 //strRep_.truncate(0);
277 QString line; 282 QString line;
278 if (!group_.isEmpty()) 283 if (!group_.isEmpty())
279 line = group_ + '.'; 284 line = group_ + '.';
280 line += name_; 285 line += name_;
281 ParamListIterator it(paramList_); 286 ParamListIterator it(paramList_);
282 for (; it.current(); ++it) 287 for (; it.current(); ++it)
283 line += ";" + it.current()->asString(); 288 line += ";" + it.current()->asString();
284 289
285 if (value_ != 0) 290 if (value_ != 0)
286 line += ":" + value_->asString(); 291 line += ":" + value_->asString();
287 292
293 line = line.replace( QRegExp( "\r" ), "\\r" );
288 line = line.replace( QRegExp( "\n" ), "\\n" ); 294 line = line.replace( QRegExp( "\n" ), "\\n" );
289 295
290 // Fold lines longer than 72 chars 296 // Fold lines longer than 72 chars
291 const int maxLen = 72; 297 const int maxLen = 72;
292 uint cursor = 0; 298 uint cursor = 0;
293 QString cut; 299 QString cut;
294 while( line.length() > ( cursor + 1 ) * maxLen ) { 300 while( line.length() > ( cursor + 1 ) * maxLen ) {
295 cut += line.mid( cursor * maxLen, maxLen ); 301 cut += line.mid( cursor * maxLen, maxLen );
296 cut += "\r\n "; 302 cut += "\r\n ";
297 ++cursor; 303 ++cursor;
298 } 304 }
299 cut += line.mid( cursor * maxLen ); 305 cut += line.mid( cursor * maxLen );
300 strRep_ = cut.latin1(); 306 strRep_ = cut.latin1();
301 //qDebug("ContentLine::_assemble()\n%s*****", strRep_.data()); 307 //qDebug("ContentLine::_assemble()\n%s*****", strRep_.data());
302#if 0 308#if 0
303 vDebug("Assemble (argl) - my name is \"" + name_ + "\""); 309 vDebug("Assemble (argl) - my name is \"" + name_ + "\"");
304 strRep_.truncate(0); 310 strRep_.truncate(0);
305 311
306 QCString line; 312 QCString line;
307 313
308 if (!group_.isEmpty()) 314 if (!group_.isEmpty())
309 line += group_ + '.'; 315 line += group_ + '.';
310 316
311 line += name_; 317 line += name_;
312 318
313 vDebug("Adding parameters"); 319 vDebug("Adding parameters");
314 ParamListIterator it(paramList_); 320 ParamListIterator it(paramList_);
315 321
316 for (; it.current(); ++it) 322 for (; it.current(); ++it)
317 line += ";" + it.current()->asString(); 323 line += ";" + it.current()->asString();
318 324
319 vDebug("Adding value"); 325 vDebug("Adding value");
320 if (value_ != 0) 326 if (value_ != 0)
321 line += ":" + value_->asString(); 327 line += ":" + value_->asString();
322 else 328 else
323 vDebug("No value"); 329 vDebug("No value");
324 330
325 // Quote newlines 331 // Quote newlines
326 line = line.replace( QRegExp( "\n" ), "\\n" ); 332 line = line.replace( QRegExp( "\n" ), "\\n" );
327 333
328 // Fold lines longer than 72 chars 334 // Fold lines longer than 72 chars
329 const int maxLen = 72; 335 const int maxLen = 72;
330 uint cursor = 0; 336 uint cursor = 0;
331 while( line.length() > ( cursor + 1 ) * maxLen ) { 337 while( line.length() > ( cursor + 1 ) * maxLen ) {
332 strRep_ += line.mid( cursor * maxLen, maxLen ); 338 strRep_ += line.mid( cursor * maxLen, maxLen );
333 strRep_ += "\r\n "; 339 strRep_ += "\r\n ";
334 ++cursor; 340 ++cursor;
335 } 341 }
336 strRep_ += line.mid( cursor * maxLen ); 342 strRep_ += line.mid( cursor * maxLen );
337 qDebug("ContentLine::_assemble()\n%s*****", strRep_.data()); 343 qDebug("ContentLine::_assemble()\n%s*****", strRep_.data());
338#endif 344#endif
339} 345}
340 346
341 void 347 void
342ContentLine::clear() 348ContentLine::clear()
343{ 349{
344 group_.truncate(0); 350 group_.truncate(0);
345 name_.truncate(0); 351 name_.truncate(0);
346 paramList_.clear(); 352 paramList_.clear();
347 delete value_; 353 delete value_;
348 value_ = 0; 354 value_ = 0;
349} 355}
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index 01e84d0..b96d28a 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -1,122 +1,121 @@
1/* 1/*
2 This file is part of KAddressBook. 2 This file is part of KAddressBook.
3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com> 3 Copyright (c) 2002 Mike Pilone <mpilone@slac.com>
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//US#ifdef KAB_EMBEDDED 24//US#ifdef KAB_EMBEDDED
25//#include <qstring.h> 25//#include <qstring.h>
26//#endif //KAB_EMBEDDED 26//#endif //KAB_EMBEDDED
27 27
28#include <qtextstream.h> 28#include <qtextstream.h>
29#include <qfile.h> 29#include <qfile.h>
30#include <qregexp.h> 30#include <qregexp.h>
31#include <stdlib.h> 31#include <stdlib.h>
32#include <libkdepim/kpimglobalprefs.h> 32#include <libkdepim/kpimglobalprefs.h>
33 33
34#include <kconfig.h> 34#include <kconfig.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kstaticdeleter.h> 36#include <kstaticdeleter.h>
37#include <kglobalsettings.h> 37#include <kglobalsettings.h>
38//US#include <kdebug.h> // defines kdDebug() 38//US#include <kdebug.h> // defines kdDebug()
39 39
40#include "kabprefs.h" 40#include "kabprefs.h"
41 41
42#ifdef DESKTOP_VERSION 42#ifdef DESKTOP_VERSION
43#include <qapplication.h> 43#include <qapplication.h>
44#endif 44#endif
45 45
46KABPrefs *KABPrefs::sInstance = 0; 46KABPrefs *KABPrefs::sInstance = 0;
47static KStaticDeleter<KABPrefs> staticDeleterAB; 47static KStaticDeleter<KABPrefs> staticDeleterAB;
48 48
49KABPrefs::KABPrefs() 49KABPrefs::KABPrefs()
50 : KPimPrefs("kaddressbookrc") 50 : KPimPrefs("kaddressbookrc")
51{ 51{
52 KPrefs::setCurrentGroup( "Views" ); 52 KPrefs::setCurrentGroup( "Views" );
53 addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); 53 addItemBool( "HonorSingleClick", &mHonorSingleClick, false );
54 54
55 KPrefs::setCurrentGroup( "General" ); 55 KPrefs::setCurrentGroup( "General" );
56 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); 56 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true );
57 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); 57 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 );
58
59#ifdef KAB_EMBEDDED 58#ifdef KAB_EMBEDDED
60 addItemBool("AskForQuit",&mAskForQuit,true); 59 addItemBool("AskForQuit",&mAskForQuit,true);
61 addItemBool("ToolBarHor",&mToolBarHor, true ); 60 addItemBool("ToolBarHor",&mToolBarHor, true );
62 addItemBool("ToolBarUp",&mToolBarUp, false ); 61 addItemBool("ToolBarUp",&mToolBarUp, false );
63 addItemBool("SearchWithReturn",&mSearchWithReturn, false ); 62 addItemBool("SearchWithReturn",&mSearchWithReturn, false );
64 addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont()); 63 addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont());
65 64
66 65
67#endif //KAB_EMBEDDED 66#endif //KAB_EMBEDDED
68 67
69 KPrefs::setCurrentGroup( "MainWindow" ); 68 KPrefs::setCurrentGroup( "MainWindow" );
70 bool m_visible = false; 69 bool m_visible = false;
71#ifdef DESKTOP_VERSION 70#ifdef DESKTOP_VERSION
72 m_visible = true; 71 m_visible = true;
73#endif 72#endif
74 addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible ); 73 addItemBool( "FullMenuBarVisible", &mFullMenuBarVisible, m_visible );
75 addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); 74 addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false );
76 addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); 75 addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true );
77 addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); 76 addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter );
78 addItemIntList( "DetailsSplitter", &mDetailsSplitter ); 77 addItemIntList( "DetailsSplitter", &mDetailsSplitter );
79 addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); 78 addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true );
80 79
81 80
82 KPrefs::setCurrentGroup( "Extensions_General" ); 81 KPrefs::setCurrentGroup( "Extensions_General" );
83 QStringList defaultExtensions; 82 QStringList defaultExtensions;
84 defaultExtensions << "merge"; 83 defaultExtensions << "merge";
85 defaultExtensions << "distribution_list_editor"; 84 defaultExtensions << "distribution_list_editor";
86 addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); 85 addItemInt( "CurrentExtension", &mCurrentExtension, 0 );
87 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions ); 86 addItemStringList( "ActiveExtensions", &mActiveExtensions, defaultExtensions );
88 87
89 KPrefs::setCurrentGroup( "Views" ); 88 KPrefs::setCurrentGroup( "Views" );
90 QString defaultView = i18n( "Default Table View" ); 89 QString defaultView = i18n( "Default Table View" );
91 addItemString( "CurrentView", &mCurrentView, defaultView ); 90 addItemString( "CurrentView", &mCurrentView, defaultView );
92 addItemStringList( "ViewNames", &mViewNames, defaultView ); 91 addItemStringList( "ViewNames", &mViewNames, defaultView );
93 92
94 KPrefs::setCurrentGroup( "Filters" ); 93 KPrefs::setCurrentGroup( "Filters" );
95 addItemInt( "CurrentFilter", &mCurrentFilter, 0 ); 94 addItemInt( "CurrentFilter", &mCurrentFilter, 0 );
96 95
97} 96}
98 97
99KABPrefs::~KABPrefs() 98KABPrefs::~KABPrefs()
100{ 99{
101 //qDebug("KABPrefs::~KABPrefs() "); 100 //qDebug("KABPrefs::~KABPrefs() ");
102 if (sInstance == this) 101 if (sInstance == this)
103 sInstance = staticDeleterAB.setObject(0); 102 sInstance = staticDeleterAB.setObject(0);
104} 103}
105 104
106KABPrefs *KABPrefs::instance() 105KABPrefs *KABPrefs::instance()
107{ 106{
108 if ( !sInstance ) { 107 if ( !sInstance ) {
109#ifdef KAB_EMBEDDED 108#ifdef KAB_EMBEDDED
110 sInstance = staticDeleterAB.setObject( new KABPrefs() ); 109 sInstance = staticDeleterAB.setObject( new KABPrefs() );
111#else //KAB_EMBEDDED 110#else //KAB_EMBEDDED
112 //US the following line has changed ???. Why 111 //US the following line has changed ???. Why
113 staticDeleterAB.setObject( sInstance, new KABPrefs() ); 112 staticDeleterAB.setObject( sInstance, new KABPrefs() );
114#endif //KAB_EMBEDDED 113#endif //KAB_EMBEDDED
115 sInstance->readConfig(); 114 sInstance->readConfig();
116 } 115 }
117 116
118 return sInstance; 117 return sInstance;
119} 118}
120 119
121void KABPrefs::setCategoryDefaults() 120void KABPrefs::setCategoryDefaults()
122{ 121{
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index d9968f3..336e350 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -15,88 +15,89 @@
15#include <kstandarddirs.h> 15#include <kstandarddirs.h>
16#include <qregexp.h> 16#include <qregexp.h>
17#include <kglobal.h> 17#include <kglobal.h>
18#include <stdio.h> 18#include <stdio.h>
19#include <qdir.h> 19#include <qdir.h>
20#include "kabprefs.h" 20#include "kabprefs.h"
21#include "kaddressbookmain.h" 21#include "kaddressbookmain.h"
22#include "externalapphandler.h" 22#include "externalapphandler.h"
23#include <libkdepim/kpimglobalprefs.h> 23#include <libkdepim/kpimglobalprefs.h>
24void dumpMissing(); 24void dumpMissing();
25int main( int argc, char **argv ) 25int main( int argc, char **argv )
26{ 26{
27#ifndef DESKTOP_VERSION 27#ifndef DESKTOP_VERSION
28 QPEApplication a( argc, argv ); 28 QPEApplication a( argc, argv );
29 a.setKeepRunning (); 29 a.setKeepRunning ();
30#else 30#else
31 QApplication a( argc, argv ); 31 QApplication a( argc, argv );
32 QApplication::setStyle( new QPlatinumStyle ()); 32 QApplication::setStyle( new QPlatinumStyle ());
33#ifdef _WIN32_ 33#ifdef _WIN32_
34 QString hdir ( getenv( "HOME") ); 34 QString hdir ( getenv( "HOME") );
35 if ( hdir.isEmpty() ) { 35 if ( hdir.isEmpty() ) {
36 QString hd ("C:/" ); 36 QString hd ("C:/" );
37 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); 37 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd );
38 if ( QDir::homeDirPath().lower() == hd.lower() ) { 38 if ( QDir::homeDirPath().lower() == hd.lower() ) {
39 _putenv( "HOME=C:"); 39 _putenv( "HOME=C:");
40 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); 40 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) );
41 } 41 }
42 } else { 42 } else {
43 QDir app_dir; 43 QDir app_dir;
44 if ( !app_dir.exists(hdir) ) 44 if ( !app_dir.exists(hdir) )
45 app_dir.mkdir (hdir); 45 app_dir.mkdir (hdir);
46 } 46 }
47#endif 47#endif
48#endif 48#endif
49 49
50 bool exitHelp = false; 50 bool exitHelp = false;
51 if ( argc > 1 ) { 51 if ( argc > 1 ) {
52 QString command = argv[1]; 52 QString command = argv[1];
53 if ( command == "-help" ){ 53 if ( command == "-help" ){
54 printf("KA/E command line commands:\n"); 54 printf("KA/E command line commands:\n");
55 printf(" no command: Start KA/E in usual way\n"); 55 printf(" no command: Start KA/E in usual way\n");
56 printf(" -help: This output\n"); 56 printf(" -help: This output\n");
57 printf(" KA/E is exiting now. Bye!\n"); 57 printf(" KA/E is exiting now. Bye!\n");
58 exitHelp = true; 58 exitHelp = true;
59 } 59 }
60 } 60 }
61 if ( ! exitHelp ) { 61 if ( ! exitHelp ) {
62 62
63 KGlobal::setAppName( "kaddressbook" ); 63 KGlobal::setAppName( "kaddressbook" );
64#ifndef DESKTOP_VERSION 64#ifndef DESKTOP_VERSION
65 if ( QApplication::desktop()->width() > 320 ) 65 if ( QApplication::desktop()->width() > 320 )
66 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); 66 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
67 else 67 else
68 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); 68 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
69#else 69#else
70 QString fileName ; 70 QString fileName ;
71 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; 71 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
72 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 72 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
73 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 73 QApplication::addLibraryPath ( qApp->applicationDirPath () );
74 74
75#endif 75#endif
76 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); 76 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
77 // init language 77 // init language
78 KPimGlobalPrefs::instance()->setGlobalConfig(); 78 KPimGlobalPrefs::instance()->setGlobalConfig();
79 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont );
79 KAddressBookMain m ; 80 KAddressBookMain m ;
80//US MainWindow m; 81//US MainWindow m;
81#ifndef DESKTOP_VERSION 82#ifndef DESKTOP_VERSION
82 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 83 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
83#endif 84#endif
84 85
85 86
86#ifndef DESKTOP_VERSION 87#ifndef DESKTOP_VERSION
87 a.showMainWidget( &m ); 88 a.showMainWidget( &m );
88 89
89#else 90#else
90 a.setMainWidget( &m ); 91 a.setMainWidget( &m );
91 m.resize (640, 480 ); 92 m.resize (640, 480 );
92 m.show(); 93 m.show();
93#endif 94#endif
94 a.exec(); 95 a.exec();
95 96
96 dumpMissing(); 97 dumpMissing();
97 98
98 KPimGlobalPrefs::instance()->writeConfig(); 99 KPimGlobalPrefs::instance()->writeConfig();
99 } 100 }
100 qDebug("KA: Bye! "); 101 qDebug("KA: Bye! ");
101} 102}
102 103
diff --git a/kmicromail/main.cpp b/kmicromail/main.cpp
index 1789da0..fe4bc76 100644
--- a/kmicromail/main.cpp
+++ b/kmicromail/main.cpp
@@ -1,67 +1,69 @@
1// CHANGED 2004-08-06 Lutz Rogowski 1// CHANGED 2004-08-06 Lutz Rogowski
2 2
3 3
4#ifndef DESKTOP_VERSION 4#ifndef DESKTOP_VERSION
5#include <qpe/qpeapplication.h> 5#include <qpe/qpeapplication.h>
6#include <libkdepim/externalapphandler.h> 6#include <libkdepim/externalapphandler.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#else 8#else
9#include <qapplication.h> 9#include <qapplication.h>
10#include <qstring.h> 10#include <qstring.h>
11#include <qwindowsstyle.h> 11#include <qwindowsstyle.h>
12#include <qplatinumstyle.h> 12#include <qplatinumstyle.h>
13#include <qsgistyle.h> 13#include <qsgistyle.h>
14#endif 14#endif
15#include "opiemail.h" 15#include "opiemail.h"
16#include <qdir.h> 16#include <qdir.h>
17#include <kstandarddirs.h> 17#include <kstandarddirs.h>
18#include <kglobal.h> 18#include <kglobal.h>
19#include <stdio.h> 19#include <stdio.h>
20#include "mainwindow.h" 20#include "mainwindow.h"
21#include "koprefs.h" 21#include "koprefs.h"
22#include <libkdepim/kpimglobalprefs.h> 22#include <libkdepim/kpimglobalprefs.h>
23void dumpMissing(); 23void dumpMissing();
24//using namespace Opie::Core; 24//using namespace Opie::Core;
25int main( int argc, char **argv ) { 25int main( int argc, char **argv ) {
26 26
27#ifndef DESKTOP_VERSION 27#ifndef DESKTOP_VERSION
28 QPEApplication a( argc, argv ); 28 QPEApplication a( argc, argv );
29 a.setKeepRunning (); 29 a.setKeepRunning ();
30#else 30#else
31 QApplication a( argc, argv ); 31 QApplication a( argc, argv );
32 QApplication::setStyle( new QPlatinumStyle ()); 32 QApplication::setStyle( new QPlatinumStyle ());
33#endif 33#endif
34 a.setFont( KOPrefs::instance()->mAppFont ); 34 //a.setFont( KOPrefs::instance()->mAppFont );
35 KGlobal::setAppName( "kopiemail" ); 35 KGlobal::setAppName( "kopiemail" );
36 QString fileName ; 36 QString fileName ;
37#ifndef DESKTOP_VERSION 37#ifndef DESKTOP_VERSION
38 fileName = getenv("QPEDIR"); 38 fileName = getenv("QPEDIR");
39 if ( QApplication::desktop()->width() > 320 ) 39 if ( QApplication::desktop()->width() > 320 )
40 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/icons22/"); 40 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/icons22/");
41 else 41 else
42 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/"); 42 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kopiemail/");
43#else 43#else
44 fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/icons22/"; 44 fileName = qApp->applicationDirPath () + "/kdepim/kopiemail/icons22/";
45 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 45 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
46#endif 46#endif
47 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kopiemail"))); 47 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kopiemail")));
48 KPimGlobalPrefs::instance()->setGlobalConfig(); 48 KPimGlobalPrefs::instance()->setGlobalConfig();
49 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont );
50 QApplication::setFont( KOPrefs::instance()->mAppFont );
49 OpieMail mw; 51 OpieMail mw;
50#ifndef DESKTOP_VERSION 52#ifndef DESKTOP_VERSION
51 //qDebug("CONNECT "); 53 //qDebug("CONNECT ");
52 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&mw, SLOT(message( const QCString&, const QByteArray& ))); 54 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&mw, SLOT(message( const QCString&, const QByteArray& )));
53 // QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 55 // QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
54 a.showMainWidget(&mw ); 56 a.showMainWidget(&mw );
55#else 57#else
56 a.setMainWidget(&mw ); 58 a.setMainWidget(&mw );
57 mw.show(); 59 mw.show();
58 //m.resize( 800, 600 ); 60 //m.resize( 800, 600 );
59 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); 61 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
60#endif 62#endif
61 int rv = a.exec(); 63 int rv = a.exec();
62 dumpMissing(); 64 dumpMissing();
63 65
64 KPimGlobalPrefs::instance()->writeConfig(); 66 KPimGlobalPrefs::instance()->writeConfig();
65 return rv; 67 return rv;
66 68
67} 69}
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index 4b207d9..ee9589c 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -20,91 +20,93 @@
20#include <kglobal.h> 20#include <kglobal.h>
21#include <stdio.h> 21#include <stdio.h>
22#include "mainwindow.h" 22#include "mainwindow.h"
23#include <libkdepim/kpimglobalprefs.h> 23#include <libkdepim/kpimglobalprefs.h>
24void dumpMissing(); 24void dumpMissing();
25int main( int argc, char **argv ) 25int main( int argc, char **argv )
26{ 26{
27#ifndef DESKTOP_VERSION 27#ifndef DESKTOP_VERSION
28 QPEApplication a( argc, argv ); 28 QPEApplication a( argc, argv );
29 a.setKeepRunning (); 29 a.setKeepRunning ();
30#else 30#else
31 QApplication a( argc, argv ); 31 QApplication a( argc, argv );
32 QApplication::setStyle( new QPlatinumStyle ()); 32 QApplication::setStyle( new QPlatinumStyle ());
33#ifdef _WIN32_ 33#ifdef _WIN32_
34 QString hdir ( getenv( "HOME") ); 34 QString hdir ( getenv( "HOME") );
35 if ( hdir.isEmpty() ) { 35 if ( hdir.isEmpty() ) {
36 QString hd ("C:/" ); 36 QString hd ("C:/" );
37 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); 37 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd );
38 if ( QDir::homeDirPath().lower() == hd.lower() ) { 38 if ( QDir::homeDirPath().lower() == hd.lower() ) {
39 _putenv( "HOME=C:"); 39 _putenv( "HOME=C:");
40 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); 40 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) );
41 } 41 }
42 } else { 42 } else {
43 QDir app_dir; 43 QDir app_dir;
44 if ( !app_dir.exists(hdir) ) 44 if ( !app_dir.exists(hdir) )
45 app_dir.mkdir (hdir); 45 app_dir.mkdir (hdir);
46 } 46 }
47#endif 47#endif
48#endif 48#endif
49 bool exitHelp = false; 49 bool exitHelp = false;
50 if ( argc > 1 ) { 50 if ( argc > 1 ) {
51 QString command = argv[1]; 51 QString command = argv[1];
52 if ( command == "-help" ){ 52 if ( command == "-help" ){
53 printf("KO/Pi command line commands:\n"); 53 printf("KO/Pi command line commands:\n");
54 printf(" no command: Start KO/Pi in usual way\n"); 54 printf(" no command: Start KO/Pi in usual way\n");
55 printf(" -help: This output\n"); 55 printf(" -help: This output\n");
56 printf("Next Option: Open or Show after start:\n"); 56 printf("Next Option: Open or Show after start:\n");
57 printf(" -newTodo: New Todo dialog\n"); 57 printf(" -newTodo: New Todo dialog\n");
58 printf(" -newEvent: New Event dialog\n"); 58 printf(" -newEvent: New Event dialog\n");
59 printf(" -showList: List view\n"); 59 printf(" -showList: List view\n");
60 printf(" -showDay: Day view\n"); 60 printf(" -showDay: Day view\n");
61 printf(" -showWWeek: Work Week view\n"); 61 printf(" -showWWeek: Work Week view\n");
62 printf(" -showWeek: Week view\n"); 62 printf(" -showWeek: Week view\n");
63 printf(" -showTodo: Todo view\n"); 63 printf(" -showTodo: Todo view\n");
64 printf(" -showJournal: Journal view\n"); 64 printf(" -showJournal: Journal view\n");
65 printf(" -showKO: Next Days view\n"); 65 printf(" -showKO: Next Days view\n");
66 printf(" -showWNext: What's Next view\n"); 66 printf(" -showWNext: What's Next view\n");
67 printf(" -showNextXView: Next X View\n"); 67 printf(" -showNextXView: Next X View\n");
68 printf(" -new[Y] and -show[X] may be used togehther\n"); 68 printf(" -new[Y] and -show[X] may be used togehther\n");
69 printf(" KO/Pi is exiting now. Bye!\n"); 69 printf(" KO/Pi is exiting now. Bye!\n");
70 exitHelp = true; 70 exitHelp = true;
71 } 71 }
72 } 72 }
73 if ( ! exitHelp ) { 73 if ( ! exitHelp ) {
74 KGlobal::setAppName( "korganizer" ); 74 KGlobal::setAppName( "korganizer" );
75 QString fileName ; 75 QString fileName ;
76#ifndef DESKTOP_VERSION 76#ifndef DESKTOP_VERSION
77 fileName = getenv("QPEDIR"); 77 fileName = getenv("QPEDIR");
78 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); 78 KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/");
79#else 79#else
80 fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; 80 fileName = qApp->applicationDirPath () + "/kdepim/korganizer/";
81 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 81 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
82#endif 82#endif
83 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); 83 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer")));
84
85 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont );
84 MainWindow m; 86 MainWindow m;
85#ifndef DESKTOP_VERSION 87#ifndef DESKTOP_VERSION
86 88
87 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); 89 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
88 a.showMainWidget(&m ); 90 a.showMainWidget(&m );
89#else 91#else
90 a.setMainWidget(&m ); 92 a.setMainWidget(&m );
91 m.show(); 93 m.show();
92 //m.resize( 800, 600 ); 94 //m.resize( 800, 600 );
93 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); 95 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
94#endif 96#endif
95 if ( argc > 1 ) { 97 if ( argc > 1 ) {
96 QCString command = argv[1]; 98 QCString command = argv[1];
97 if ( argc > 2 ) 99 if ( argc > 2 )
98 command += argv[2]; 100 command += argv[2];
99 qApp->processEvents(); 101 qApp->processEvents();
100 m.recieve(command, QByteArray() ); 102 m.recieve(command, QByteArray() );
101 103
102 } 104 }
103 105
104 a.exec(); 106 a.exec();
105 dumpMissing(); 107 dumpMissing();
106 108
107 KPimGlobalPrefs::instance()->writeConfig(); 109 KPimGlobalPrefs::instance()->writeConfig();
108 } 110 }
109 qDebug("KO: Bye! "); 111 qDebug("KO: Bye! ");
110} 112}
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 18a4b12..ab0e4d6 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -71,133 +71,129 @@ using namespace KCal;
71#endif 71#endif
72#endif 72#endif
73#include "mainwindow.h" 73#include "mainwindow.h"
74 74
75 75
76class KOex2phonePrefs : public QDialog 76class KOex2phonePrefs : public QDialog
77{ 77{
78 public: 78 public:
79 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 79 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
80 QDialog( parent, name, true ) 80 QDialog( parent, name, true )
81 { 81 {
82 setCaption( i18n("Export to phone options") ); 82 setCaption( i18n("Export to phone options") );
83 QVBoxLayout* lay = new QVBoxLayout( this ); 83 QVBoxLayout* lay = new QVBoxLayout( this );
84 lay->setSpacing( 3 ); 84 lay->setSpacing( 3 );
85 lay->setMargin( 3 ); 85 lay->setMargin( 3 );
86 QLabel *lab; 86 QLabel *lab;
87 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 87 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
88 lab->setAlignment (AlignHCenter ); 88 lab->setAlignment (AlignHCenter );
89 QHBox* temphb; 89 QHBox* temphb;
90 temphb = new QHBox( this ); 90 temphb = new QHBox( this );
91 new QLabel( i18n("I/O device: "), temphb ); 91 new QLabel( i18n("I/O device: "), temphb );
92 mPhoneDevice = new QLineEdit( temphb); 92 mPhoneDevice = new QLineEdit( temphb);
93 lay->addWidget( temphb ); 93 lay->addWidget( temphb );
94 temphb = new QHBox( this ); 94 temphb = new QHBox( this );
95 new QLabel( i18n("Connection: "), temphb ); 95 new QLabel( i18n("Connection: "), temphb );
96 mPhoneConnection = new QLineEdit( temphb); 96 mPhoneConnection = new QLineEdit( temphb);
97 lay->addWidget( temphb ); 97 lay->addWidget( temphb );
98 temphb = new QHBox( this ); 98 temphb = new QHBox( this );
99 new QLabel( i18n("Model(opt.): "), temphb ); 99 new QLabel( i18n("Model(opt.): "), temphb );
100 mPhoneModel = new QLineEdit( temphb); 100 mPhoneModel = new QLineEdit( temphb);
101 lay->addWidget( temphb ); 101 lay->addWidget( temphb );
102 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); 102 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this );
103 mWriteBackFuture->setChecked( true ); 103 mWriteBackFuture->setChecked( true );
104 lay->addWidget( mWriteBackFuture ); 104 lay->addWidget( mWriteBackFuture );
105 temphb = new QHBox( this ); 105 temphb = new QHBox( this );
106 new QLabel( i18n("Max. weeks in future: ") , temphb ); 106 new QLabel( i18n("Max. weeks in future: ") , temphb );
107 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); 107 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb);
108 mWriteBackFutureWeeks->setValue( 8 ); 108 mWriteBackFutureWeeks->setValue( 8 );
109 lay->addWidget( temphb ); 109 lay->addWidget( temphb );
110 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); 110 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) );
111 lab->setAlignment (AlignHCenter ); 111 lab->setAlignment (AlignHCenter );
112 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 112 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
113 lay->addWidget( ok ); 113 lay->addWidget( ok );
114 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 114 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
115 lay->addWidget( cancel ); 115 lay->addWidget( cancel );
116 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 116 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
117 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 117 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
118 resize( 220, 240 ); 118 resize( 220, 240 );
119 qApp->processEvents(); 119 qApp->processEvents();
120 int dw = QApplication::desktop()->width(); 120 int dw = QApplication::desktop()->width();
121 int dh = QApplication::desktop()->height(); 121 int dh = QApplication::desktop()->height();
122 move( (dw-width())/2, (dh - height() )/2 ); 122 move( (dw-width())/2, (dh - height() )/2 );
123 } 123 }
124 124
125public: 125public:
126 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 126 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
127 QCheckBox* mWriteBackFuture; 127 QCheckBox* mWriteBackFuture;
128 QSpinBox* mWriteBackFutureWeeks; 128 QSpinBox* mWriteBackFutureWeeks;
129}; 129};
130 130
131int globalFlagBlockStartup; 131int globalFlagBlockStartup;
132MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : 132MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
133 QMainWindow( parent, name ) 133 QMainWindow( parent, name )
134{ 134{
135 135
136
137#ifdef DESKTOP_VERSION
138 setFont( QFont("Arial"), 14 );
139#endif
140 mClosed = false; 136 mClosed = false;
141 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 137 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
142 QString confFile = locateLocal("config","korganizerrc"); 138 QString confFile = locateLocal("config","korganizerrc");
143 QFileInfo finf ( confFile ); 139 QFileInfo finf ( confFile );
144 bool showWarning = !finf.exists(); 140 bool showWarning = !finf.exists();
145 setIcon(SmallIcon( "ko24" ) ); 141 setIcon(SmallIcon( "ko24" ) );
146 mBlockAtStartup = true; 142 mBlockAtStartup = true;
147 mFlagKeyPressed = false; 143 mFlagKeyPressed = false;
148 setCaption("KOrganizer/Pi"); 144 setCaption("KOrganizer/Pi");
149 KOPrefs *p = KOPrefs::instance(); 145 KOPrefs *p = KOPrefs::instance();
150 KPimGlobalPrefs::instance()->setGlobalConfig(); 146 KPimGlobalPrefs::instance()->setGlobalConfig();
151 if ( p->mHourSize > 22 ) 147 if ( p->mHourSize > 22 )
152 p->mHourSize = 22; 148 p->mHourSize = 22;
153 QMainWindow::ToolBarDock tbd; 149 QMainWindow::ToolBarDock tbd;
154 if ( p->mToolBarHor ) { 150 if ( p->mToolBarHor ) {
155 if ( p->mToolBarUp ) 151 if ( p->mToolBarUp )
156 tbd = Bottom; 152 tbd = Bottom;
157 else 153 else
158 tbd = Top; 154 tbd = Top;
159 } 155 }
160 else { 156 else {
161 if ( p->mToolBarUp ) 157 if ( p->mToolBarUp )
162 tbd = Right; 158 tbd = Right;
163 else 159 else
164 tbd = Left; 160 tbd = Left;
165 } 161 }
166 if ( KOPrefs::instance()->mUseAppColors ) 162 if ( KOPrefs::instance()->mUseAppColors )
167 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 163 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
168 globalFlagBlockStartup = 1; 164 globalFlagBlockStartup = 1;
169 iconToolBar = new QPEToolBar( this ); 165 iconToolBar = new QPEToolBar( this );
170 addToolBar (iconToolBar , tbd ); 166 addToolBar (iconToolBar , tbd );
171 mCalendarModifiedFlag = false; 167 mCalendarModifiedFlag = false;
172 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 168 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
173 splash->setAlignment ( AlignCenter ); 169 splash->setAlignment ( AlignCenter );
174 setCentralWidget( splash ); 170 setCentralWidget( splash );
175#ifndef DESKTOP_VERSION 171#ifndef DESKTOP_VERSION
176 showMaximized(); 172 showMaximized();
177#endif 173#endif
178 174
179 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 175 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
180 setDefaultPreferences(); 176 setDefaultPreferences();
181 mCalendar = new CalendarLocal(); 177 mCalendar = new CalendarLocal();
182 mView = new CalendarView( mCalendar, this,"mCalendar " ); 178 mView = new CalendarView( mCalendar, this,"mCalendar " );
183 mView->hide(); 179 mView->hide();
184 //mView->resize(splash->size() ); 180 //mView->resize(splash->size() );
185 initActions(); 181 initActions();
186 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); 182 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu);
187 mSyncManager->setBlockSave(false); 183 mSyncManager->setBlockSave(false);
188 mView->setSyncManager(mSyncManager); 184 mView->setSyncManager(mSyncManager);
189#ifndef DESKTOP_VERSION 185#ifndef DESKTOP_VERSION
190 iconToolBar->show(); 186 iconToolBar->show();
191 qApp->processEvents(); 187 qApp->processEvents();
192#endif 188#endif
193 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 189 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
194 int vh = height() ; 190 int vh = height() ;
195 int vw = width(); 191 int vw = width();
196 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 192 //qDebug("Toolbar hei %d ",iconToolBar->height() );
197 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 193 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
198 vh -= iconToolBar->height(); 194 vh -= iconToolBar->height();
199 } else { 195 } else {
200 vw -= iconToolBar->height(); 196 vw -= iconToolBar->height();
201 } 197 }
202 //mView->setMaximumSize( splash->size() ); 198 //mView->setMaximumSize( splash->size() );
203 //mView->resize( splash->size() ); 199 //mView->resize( splash->size() );
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 6eaf2f2..bbed38d 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,147 +1,149 @@
1/* 1/*
2 This file is part of KdePim/Pi. 2 This file is part of KdePim/Pi.
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#include <qlayout.h> 31#include <qlayout.h>
32#include <qtabwidget.h> 32#include <qtabwidget.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qgroupbox.h> 34#include <qgroupbox.h>
35#include <qlabel.h> 35#include <qlabel.h>
36#include <qlineedit.h> 36#include <qlineedit.h>
37#include <qbuttongroup.h> 37#include <qbuttongroup.h>
38#include <qfile.h> 38#include <qfile.h>
39#include <qvbox.h> 39#include <qvbox.h>
40#include <qdir.h> 40#include <qdir.h>
41#include <qregexp.h> 41#include <qregexp.h>
42 42
43#include <kdialog.h> 43#include <kdialog.h>
44#include <kprefsdialog.h>
44#include <klocale.h> 45#include <klocale.h>
45#include <kdateedit.h> 46#include <kdateedit.h>
46#include <kglobal.h> 47#include <kglobal.h>
47#include <stdlib.h> 48#include <stdlib.h>
48 49
49/*US 50/*US
50#include <qcheckbox.h> 51#include <qcheckbox.h>
51#include <qframe.h> 52#include <qframe.h>
52#include <qpushbutton.h> 53#include <qpushbutton.h>
53#include <qcombobox.h> 54#include <qcombobox.h>
54#include <qlineedit.h> 55#include <qlineedit.h>
55#include <qlabel.h> 56#include <qlabel.h>
56#include <qfile.h> 57#include <qfile.h>
57 58
58#include <kconfig.h> 59#include <kconfig.h>
59#include <kdebug.h> 60#include <kdebug.h>
60#include <kdialog.h> 61#include <kdialog.h>
61#include <klistview.h> 62#include <klistview.h>
62#include <klocale.h> 63#include <klocale.h>
63#include <kglobal.h> 64#include <kglobal.h>
64#include <kmessagebox.h> 65#include <kmessagebox.h>
65#include <kstandarddirs.h> 66#include <kstandarddirs.h>
66 67
67#ifndef KAB_EMBEDDED 68#ifndef KAB_EMBEDDED
68#include <ktrader.h> 69#include <ktrader.h>
69#else // KAB_EMBEDDED 70#else // KAB_EMBEDDED
70#include <mergewidget.h> 71#include <mergewidget.h>
71#include <distributionlistwidget.h> 72#include <distributionlistwidget.h>
72#endif // KAB_EMBEDDED 73#endif // KAB_EMBEDDED
73 74
74#include "addresseewidget.h" 75#include "addresseewidget.h"
75#include "extensionconfigdialog.h" 76#include "extensionconfigdialog.h"
76#include "extensionwidget.h" 77#include "extensionwidget.h"
77*/ 78*/
78 79
79#include "qapplication.h" 80#include "qapplication.h"
80 81
81#include "kpimglobalprefs.h" 82#include "kpimglobalprefs.h"
82 83
83#include "kdepimconfigwidget.h" 84#include "kdepimconfigwidget.h"
85#include <kprefs.h>
84 86
85 87
86KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 88KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
87 : KPrefsWidget(prefs, parent, name ) 89 : KPrefsWidget(prefs, parent, name )
88{ 90{
89 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 91 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
90 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 92 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
91 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 93 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
92 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 94 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
93 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 95 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
94 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 96 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
95 97
96 98
97 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 99 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
98 KDialog::spacingHint() ); 100 KDialog::spacingHint() );
99 101
100 tabWidget = new QTabWidget( this ); 102 tabWidget = new QTabWidget( this );
101 topLayout->addWidget( tabWidget ); 103 topLayout->addWidget( tabWidget );
102 104
103 105
104 setupLocaleTab(); 106 setupLocaleTab();
105 setupLocaleDateTab(); 107 setupLocaleDateTab();
106 setupTimeZoneTab(); 108 setupTimeZoneTab();
107 setupExternalAppTab(); 109 setupExternalAppTab();
108 setupStoreTab(); 110 setupStoreTab();
109 111
110} 112}
111void KDEPIMConfigWidget::showTimeZoneTab() 113void KDEPIMConfigWidget::showTimeZoneTab()
112{ 114{
113 tabWidget->setCurrentPage ( 3 ) ; 115 tabWidget->setCurrentPage ( 3 ) ;
114} 116}
115void KDEPIMConfigWidget::setupStoreTab() 117void KDEPIMConfigWidget::setupStoreTab()
116{ 118{
117 QVBox *storePage = new QVBox( this ); 119 QVBox *storePage = new QVBox( this );
118 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); 120 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage );
119 new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); 121 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
120 mStoreUrl = new KURLRequester( storePage ); 122 mStoreUrl = new KURLRequester( storePage );
121 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 123 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
122 new QLabel( i18n("New dirs are created automatically"), storePage ); 124 new QLabel( i18n("New dirs are created automatically"), storePage );
123 QHBox *bb = new QHBox( storePage ); 125 QHBox *bb = new QHBox( storePage );
124 QPushButton * pb; 126 QPushButton * pb;
125 if ( QApplication::desktop()->width() < 640 ) 127 if ( QApplication::desktop()->width() < 640 )
126 pb = new QPushButton ( i18n("Save"), bb ); 128 pb = new QPushButton ( i18n("Save"), bb );
127 else 129 else
128 pb = new QPushButton ( i18n("Save settings"), bb ); 130 pb = new QPushButton ( i18n("Save settings"), bb );
129 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 131 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
130 pb = new QPushButton ( i18n("Save standard"), bb ); 132 pb = new QPushButton ( i18n("Save standard"), bb );
131 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 133 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
132 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); 134 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
133 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); 135 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
134 tabWidget->addTab( storePage, i18n( "Data storage path" ) ); 136 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
135} 137}
136void KDEPIMConfigWidget::setStandardStore() 138void KDEPIMConfigWidget::setStandardStore()
137{ 139{
138 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 140 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
139 saveStoreSettings(); 141 saveStoreSettings();
140} 142}
141void KDEPIMConfigWidget::saveStoreSettings() 143void KDEPIMConfigWidget::saveStoreSettings()
142{ 144{
143 if ( !mStoreUrl->url().isEmpty() ) { 145 if ( !mStoreUrl->url().isEmpty() ) {
144 KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" ); 146 KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" );
145 cfg.setGroup("Global"); 147 cfg.setGroup("Global");
146 cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() ); 148 cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() );
147 qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); "); 149 qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); ");
@@ -287,201 +289,222 @@ void KDEPIMConfigWidget::setupLocaleDateTab()
287 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 289 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
288 ++iii; 290 ++iii;
289 291
290 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 292 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
291 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 293 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
292 294
293 295
294 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 296 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
295} 297}
296 298
297void KDEPIMConfigWidget::setupLocaleTab() 299void KDEPIMConfigWidget::setupLocaleTab()
298{ 300{
299 301
300 QWidget *topFrame = new QWidget( this ); 302 QWidget *topFrame = new QWidget( this );
301 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 303 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
302 304
303 topLayout->setSpacing(KDialog::spacingHint()); 305 topLayout->setSpacing(KDialog::spacingHint());
304 topLayout->setMargin(KDialog::marginHint()); 306 topLayout->setMargin(KDialog::marginHint());
305 int iii = 0; 307 int iii = 0;
306 KPrefsWidRadios *syncPrefsGroup = 308 KPrefsWidRadios *syncPrefsGroup =
307 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 309 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
308 syncPrefsGroup->addRadio(i18n("English")); 310 syncPrefsGroup->addRadio(i18n("English"));
309 syncPrefsGroup->addRadio(i18n("German")); 311 syncPrefsGroup->addRadio(i18n("German"));
310 syncPrefsGroup->addRadio(i18n("French")); 312 syncPrefsGroup->addRadio(i18n("French"));
311 syncPrefsGroup->addRadio(i18n("Italian")); 313 syncPrefsGroup->addRadio(i18n("Italian"));
312 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 314 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
313 if ( QApplication::desktop()->width() < 300 ) { 315 if ( QApplication::desktop()->width() < 300 ) {
314 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 316 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
315 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 317 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
316 } 318 }
317 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 319 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
318 ++iii; 320 ++iii;
319 321
320 322
321 tabWidget->addTab( topFrame, i18n( "Language" ) ); 323 tabWidget->addTab( topFrame, i18n( "Language" ) );
322 topFrame = new QWidget( this ); 324 topFrame = new QWidget( this );
323 topLayout = new QGridLayout(topFrame,4,2); 325 topLayout = new QGridLayout(topFrame,4,2);
324 326
325 topLayout->setSpacing(KDialog::spacingHint()); 327 topLayout->setSpacing(KDialog::spacingHint());
326 topLayout->setMargin(KDialog::marginHint()); 328 topLayout->setMargin(KDialog::marginHint());
327 iii = 0; 329 iii = 0;
328 syncPrefsGroup = 330 syncPrefsGroup =
329 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); 331 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame);
330 if ( QApplication::desktop()->width() > 300 ) 332 if ( QApplication::desktop()->width() > 300 )
331 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 333 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
332 syncPrefsGroup->addRadio(i18n("24:00")); 334 syncPrefsGroup->addRadio(i18n("24:00"));
333 syncPrefsGroup->addRadio(i18n("12:00am")); 335 syncPrefsGroup->addRadio(i18n("12:00am"));
334 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 336 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
335 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 337 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
336 ++iii; 338 ++iii;
337 339
338 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), 340 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"),
339 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); 341 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame);
340 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 342 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
341 ++iii; 343 ++iii;
342 344
343 345
344 tabWidget->addTab( topFrame, i18n( "Time Format" ) ); 346 tabWidget->addTab( topFrame, i18n( "Time Format" ) );
345 347
346} 348}
347 349
348 350
349void KDEPIMConfigWidget::setupTimeZoneTab() 351void KDEPIMConfigWidget::setupTimeZoneTab()
350{ 352{
351 QWidget *topFrame = new QWidget( this ); 353 QWidget *topFrame;
352 QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2); 354 QGridLayout *topLayout ;
355
356
357
358
359
360
361 topFrame = new QWidget( this );
362 topLayout = new QGridLayout( topFrame, 5, 2);
353 topLayout->setSpacing(KDialog::spacingHintSmall()); 363 topLayout->setSpacing(KDialog::spacingHintSmall());
354 topLayout->setMargin(KDialog::marginHintSmall()); 364 topLayout->setMargin(KDialog::marginHintSmall());
355 365
356 QHBox *timeZoneBox = new QHBox( topFrame ); 366 QHBox *timeZoneBox = new QHBox( topFrame );
357 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 367 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
358 368
359 new QLabel( i18n("Timezone:"), timeZoneBox ); 369 new QLabel( i18n("Timezone:"), timeZoneBox );
360 mTimeZoneCombo = new QComboBox( timeZoneBox ); 370 mTimeZoneCombo = new QComboBox( timeZoneBox );
361 if ( QApplication::desktop()->width() < 300 ) { 371 if ( QApplication::desktop()->width() < 300 ) {
362 mTimeZoneCombo->setMaximumWidth(150); 372 mTimeZoneCombo->setMaximumWidth(150);
363 } 373 }
364 374
365 QStringList list; 375 QStringList list;
366 list = KGlobal::locale()->timeZoneList(); 376 list = KGlobal::locale()->timeZoneList();
367 mTimeZoneCombo->insertStringList(list); 377 mTimeZoneCombo->insertStringList(list);
368 378
369 // find the currently set time zone and select it 379 // find the currently set time zone and select it
370 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; 380 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId;
371 int nCurrentlySet = 11; 381 int nCurrentlySet = 11;
372 for (int i = 0; i < mTimeZoneCombo->count(); i++) 382 for (int i = 0; i < mTimeZoneCombo->count(); i++)
373 { 383 {
374 if (mTimeZoneCombo->text(i) == sCurrentlySet) 384 if (mTimeZoneCombo->text(i) == sCurrentlySet)
375 { 385 {
376 nCurrentlySet = i; 386 nCurrentlySet = i;
377 break; 387 break;
378 } 388 }
379 } 389 }
380 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 390 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
381 int iii = 1; 391 int iii = 1;
382 KPrefsWidBool *sb = 392 KPrefsWidBool *sb =
383 addWidBool(i18n("Add 30 min to selected Timezone"), 393 addWidBool(i18n("Add 30 min to selected Timezone"),
384 &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame); 394 &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame);
385 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 395 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
386 ++iii; 396 ++iii;
387 sb = 397 sb =
388 addWidBool(i18n("Timezone has daylight saving"), 398 addWidBool(i18n("Timezone has daylight saving"),
389 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); 399 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame);
390 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 400 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
391 ++iii; 401 ++iii;
392 QLabel* lab; 402 QLabel* lab;
393 403
394 lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); 404 lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
395 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 405 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
396 ++iii; 406 ++iii;
397 407
398 lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); 408 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
399 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 409 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
400 ++iii; 410 ++iii;
401 lab = new QLabel( i18n("Daylight start:"), topFrame ); 411 lab = new QLabel( i18n("Daylight start:"), topFrame );
402 topLayout->addWidget(lab, iii,0); 412 topLayout->addWidget(lab, iii,0);
403 mStartDateSavingEdit = new KDateEdit(topFrame); 413 mStartDateSavingEdit = new KDateEdit(topFrame);
404 topLayout->addWidget(mStartDateSavingEdit, iii,1); 414 topLayout->addWidget(mStartDateSavingEdit, iii,1);
405 ++iii; 415 ++iii;
406 416
407 lab = new QLabel( i18n("Daylight end:"), topFrame ); 417 lab = new QLabel( i18n("Daylight end:"), topFrame );
408 topLayout->addWidget(lab, iii,0); 418 topLayout->addWidget(lab, iii,0);
409 mEndDateSavingEdit = new KDateEdit(topFrame); 419 mEndDateSavingEdit = new KDateEdit(topFrame);
410 topLayout->addWidget(mEndDateSavingEdit, iii,1); 420 topLayout->addWidget(mEndDateSavingEdit, iii,1);
411 ++iii; 421 ++iii;
412 QDate current ( 2001, 1,1); 422 QDate current ( 2001, 1,1);
413 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); 423 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1));
414 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); 424 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1));
415 425
416 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 426 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
417 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 427 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
418 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); 428 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) );
419
420
421
422 tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); 429 tabWidget->addTab( topFrame, i18n( "Time Zone" ) );
423 430
431
432 topFrame = new QWidget( this );
433 topLayout = new QGridLayout( topFrame, 3, 2);
434 topLayout->setSpacing(KDialog::spacingHintSmall());
435 topLayout->setMargin(KDialog::marginHintSmall());
436 tabWidget->addTab( topFrame, i18n( "Fonts" ) );
437
438 QLabel* labb = new QLabel( i18n("Global application font for all apps:"), topFrame );
439 topLayout->addMultiCellWidget(labb,0,0,0,2);
440 int i = 1;
441 KPrefsWidFont *timeLabelsFont =
442 addWidFont(i18n("Kx/Pi"),i18n("Application Font"),
443 &(KPimGlobalPrefs::instance()->mApplicationFont),topFrame);
444 topLayout->addWidget(timeLabelsFont->label(),i,0);
445 topLayout->addWidget(timeLabelsFont->preview(),i,1);
446 topLayout->addWidget(timeLabelsFont->button(),i,2);
424} 447}
425 448
426void KDEPIMConfigWidget::externalapp_changed( int newApp ) 449void KDEPIMConfigWidget::externalapp_changed( int newApp )
427{ 450{
428 // first store the current data 451 // first store the current data
429 saveEditFieldSettings(); 452 saveEditFieldSettings();
430 453
431 // set mCurrentApp 454 // set mCurrentApp
432 mCurrentApp = (ExternalAppHandler::Types)newApp; 455 mCurrentApp = (ExternalAppHandler::Types)newApp;
433 456
434 // set mCurrentClient 457 // set mCurrentClient
435 switch(mCurrentApp) 458 switch(mCurrentApp)
436 { 459 {
437 case(ExternalAppHandler::EMAIL): 460 case(ExternalAppHandler::EMAIL):
438 mCurrentClient = mEmailClient; 461 mCurrentClient = mEmailClient;
439 break; 462 break;
440 case(ExternalAppHandler::PHONE): 463 case(ExternalAppHandler::PHONE):
441 mCurrentClient = mPhoneClient; 464 mCurrentClient = mPhoneClient;
442 break; 465 break;
443 case(ExternalAppHandler::SMS): 466 case(ExternalAppHandler::SMS):
444 mCurrentClient = mSMSClient; 467 mCurrentClient = mSMSClient;
445 break; 468 break;
446 case(ExternalAppHandler::FAX): 469 case(ExternalAppHandler::FAX):
447 mCurrentClient = mFaxClient; 470 mCurrentClient = mFaxClient;
448 break; 471 break;
449 case(ExternalAppHandler::PAGER): 472 case(ExternalAppHandler::PAGER):
450 mCurrentClient = mPagerClient; 473 mCurrentClient = mPagerClient;
451 break; 474 break;
452 case(ExternalAppHandler::SIP): 475 case(ExternalAppHandler::SIP):
453 mCurrentClient = mSipClient; 476 mCurrentClient = mSipClient;
454 break; 477 break;
455 default: 478 default:
456 return; 479 return;
457 } 480 }
458 481
459 // and at last update the widgets 482 // and at last update the widgets
460 updateClientWidgets(); 483 updateClientWidgets();
461} 484}
462 485
463 486
464 487
465void KDEPIMConfigWidget::client_changed( int newClient ) 488void KDEPIMConfigWidget::client_changed( int newClient )
466{ 489{
467 if (newClient == mCurrentClient) 490 if (newClient == mCurrentClient)
468 return; 491 return;
469 492
470 // first store the current data 493 // first store the current data
471 saveEditFieldSettings(); 494 saveEditFieldSettings();
472 495
473 496
474 //then reset the clientvariable 497 //then reset the clientvariable
475 mCurrentClient = newClient; 498 mCurrentClient = newClient;
476 499
477 // and at last update the widgets 500 // and at last update the widgets
478 updateClientWidgets(); 501 updateClientWidgets();
479 502
480 KPrefsWidget::modified(); 503 KPrefsWidget::modified();
481} 504}
482 505
483void KDEPIMConfigWidget::saveEditFieldSettings() 506void KDEPIMConfigWidget::saveEditFieldSettings()
484{ 507{
485 508
486 switch(mCurrentApp) 509 switch(mCurrentApp)
487 { 510 {
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 81e3cb1..ac7d205 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -1,115 +1,118 @@
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 <kglobalsettings.h>
35#include <kstaticdeleter.h> 36#include <kstaticdeleter.h>
36 37
37#include <qregexp.h> 38#include <qregexp.h>
38#include <qfile.h> 39#include <qfile.h>
39#include <stdlib.h> 40#include <stdlib.h>
40#include <qtextstream.h> 41#include <qtextstream.h>
41#include <qapplication.h> 42#include <qapplication.h>
42#include "kpimglobalprefs.h" 43#include "kpimglobalprefs.h"
43 44
44KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; 45KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0;
45static KStaticDeleter<KPimGlobalPrefs> staticDeleterGP; 46static KStaticDeleter<KPimGlobalPrefs> staticDeleterGP;
46 47
47 48
48KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) 49KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
49 : KPrefs("microkdeglobalrc") 50 : KPrefs("microkdeglobalrc")
50{ 51{
51 mLocaleDict = 0; 52 mLocaleDict = 0;
53 KPrefs::setCurrentGroup("Fonts");
54 addItemFont("ApplicationFont",&mApplicationFont,KGlobalSettings::generalFont() );
52 KPrefs::setCurrentGroup("Locale"); 55 KPrefs::setCurrentGroup("Locale");
53 addItemInt("PreferredLanguage",&mPreferredLanguage,0); 56 addItemInt("PreferredLanguage",&mPreferredLanguage,0);
54 addItemInt("PreferredTime",&mPreferredTime,0); 57 addItemInt("PreferredTime",&mPreferredTime,0);
55 addItemInt("PreferredDate",&mPreferredDate,0); 58 addItemInt("PreferredDate",&mPreferredDate,0);
56 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); 59 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false);
57 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); 60 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y");
58 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); 61 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y");
59 62
60 KPrefs::setCurrentGroup("Time & Date"); 63 KPrefs::setCurrentGroup("Time & Date");
61 64
62 addItemString("TimeZoneName",&mTimeZoneId, ("+01:00 Europe/Oslo(CET)") ); 65 addItemString("TimeZoneName",&mTimeZoneId, ("+01:00 Europe/Oslo(CET)") );
63 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); 66 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true);
64 addItemBool("TimeZoneAdd30min",&mTimeZoneAdd30min,false); 67 addItemBool("TimeZoneAdd30min",&mTimeZoneAdd30min,false);
65 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); 68 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90);
66 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); 69 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304);
67 70
68 KPrefs::setCurrentGroup( "ExternalApplications" ); 71 KPrefs::setCurrentGroup( "ExternalApplications" );
69 72
70 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC ); 73 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC );
71 addItemString( "EmailChannel", &mEmailOtherChannel, "" ); 74 addItemString( "EmailChannel", &mEmailOtherChannel, "" );
72 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); 75 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" );
73 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); 76 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" );
74 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" ); 77 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" );
75 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" ); 78 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" );
76 79
77 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC ); 80 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC );
78 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" ); 81 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" );
79 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" ); 82 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" );
80 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" ); 83 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" );
81 84
82 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC ); 85 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC );
83 addItemString( "FaxChannel", &mFaxOtherChannel, "" ); 86 addItemString( "FaxChannel", &mFaxOtherChannel, "" );
84 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" ); 87 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" );
85 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" ); 88 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" );
86 89
87 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC ); 90 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC );
88 addItemString( "SMSChannel", &mSMSOtherChannel, "" ); 91 addItemString( "SMSChannel", &mSMSOtherChannel, "" );
89 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" ); 92 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" );
90 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" ); 93 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" );
91 94
92 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); 95 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC );
93 addItemString( "PagerChannel", &mPagerOtherChannel, "" ); 96 addItemString( "PagerChannel", &mPagerOtherChannel, "" );
94 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); 97 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" );
95 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); 98 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" );
96 99
97 addItemInt( "SIPChannelType", &mSipClient, KPPI_SIC ); 100 addItemInt( "SIPChannelType", &mSipClient, KPPI_SIC );
98 addItemString( "SIPChannel", &mSipOtherChannel, "" ); 101 addItemString( "SIPChannel", &mSipOtherChannel, "" );
99 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); 102 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" );
100 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); 103 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" );
101 104
102 KPrefs::setCurrentGroup( "PhoneAccess" ); 105 KPrefs::setCurrentGroup( "PhoneAccess" );
103 addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm"); 106 addItemString("Ex2PhoneDevice",&mEx2PhoneDevice,"/dev/ircomm");
104 addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda"); 107 addItemString("Ex2PhoneConnection",&mEx2PhoneConnection,"irda");
105 addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i"); 108 addItemString("Ex2PhoneModel",&mEx2PhoneModel,"6310i");
106 109
107} 110}
108 111
109void KPimGlobalPrefs::setGlobalConfig() 112void KPimGlobalPrefs::setGlobalConfig()
110{ 113{
111 if ( mLocaleDict == 0 ) { 114 if ( mLocaleDict == 0 ) {
112 QString fileName ; 115 QString fileName ;
113 QString name = KGlobal::getAppName() +"/"; 116 QString name = KGlobal::getAppName() +"/";
114#ifndef DESKTOP_VERSION 117#ifndef DESKTOP_VERSION
115 fileName= QString(getenv("QPEDIR"))+"/pics/kdepim/"+name; 118 fileName= QString(getenv("QPEDIR"))+"/pics/kdepim/"+name;
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h
index 5e27e85..bf17338 100644
--- a/libkdepim/kpimglobalprefs.h
+++ b/libkdepim/kpimglobalprefs.h
@@ -40,104 +40,105 @@ class KPimGlobalPrefs : public KPrefs
40 40
41 void setGlobalConfig(); 41 void setGlobalConfig();
42 static KPimGlobalPrefs *instance(); 42 static KPimGlobalPrefs *instance();
43 43
44 44
45 virtual ~KPimGlobalPrefs(); 45 virtual ~KPimGlobalPrefs();
46 46
47 47
48 enum EMailClients { 48 enum EMailClients {
49 NONE_EMC = 0, 49 NONE_EMC = 0,
50 OTHER_EMC = 1, 50 OTHER_EMC = 1,
51 OMPI_EMC = 2, 51 OMPI_EMC = 2,
52 QTOPIA_EMC = 3, 52 QTOPIA_EMC = 3,
53 OPIE_EMC = 4, 53 OPIE_EMC = 4,
54 OPIE_MAILIT_EMC = 5 54 OPIE_MAILIT_EMC = 5
55 }; 55 };
56 56
57 enum PhoneClients { 57 enum PhoneClients {
58 NONE_PHC = 0, 58 NONE_PHC = 0,
59 OTHER_PHC = 1, 59 OTHER_PHC = 1,
60 KPPI_PHC = 2 60 KPPI_PHC = 2
61 }; 61 };
62 62
63 enum FaxClients { 63 enum FaxClients {
64 NONE_FAC = 0, 64 NONE_FAC = 0,
65 OTHER_FAC = 1 65 OTHER_FAC = 1
66 }; 66 };
67 67
68 enum SMSClients { 68 enum SMSClients {
69 NONE_SMC = 0, 69 NONE_SMC = 0,
70 OTHER_SMC = 1 70 OTHER_SMC = 1
71 }; 71 };
72 72
73 enum PagerClients { 73 enum PagerClients {
74 NONE_PAC = 0, 74 NONE_PAC = 0,
75 OTHER_PAC = 1 75 OTHER_PAC = 1
76 }; 76 };
77 77
78 enum SIPClients { 78 enum SIPClients {
79 NONE_SIC = 0, 79 NONE_SIC = 0,
80 OTHER_SIC = 1, 80 OTHER_SIC = 1,
81 KPPI_SIC = 2 81 KPPI_SIC = 2
82 }; 82 };
83 83
84 private: 84 private:
85 KPimGlobalPrefs( const QString &name = QString::null ); 85 KPimGlobalPrefs( const QString &name = QString::null );
86 86
87 static KPimGlobalPrefs *sInstance; 87 static KPimGlobalPrefs *sInstance;
88 QDict<QString> *mLocaleDict; 88 QDict<QString> *mLocaleDict;
89 89
90 90
91 public: 91 public:
92 //US I copied the following "locale" settings from KOPrefs 92 //US I copied the following "locale" settings from KOPrefs
93 int mPreferredDate; 93 int mPreferredDate;
94 QString mUserDateFormatLong; 94 QString mUserDateFormatLong;
95 QString mUserDateFormatShort; 95 QString mUserDateFormatShort;
96 int mPreferredLanguage; 96 int mPreferredLanguage;
97 int mPreferredTime; 97 int mPreferredTime;
98 bool mWeekStartsOnSunday; 98 bool mWeekStartsOnSunday;
99 QString mTimeZoneId; 99 QString mTimeZoneId;
100 bool mUseDaylightsaving; 100 bool mUseDaylightsaving;
101 int mDaylightsavingStart; 101 int mDaylightsavingStart;
102 int mDaylightsavingEnd; 102 int mDaylightsavingEnd;
103 bool mTimeZoneAdd30min; 103 bool mTimeZoneAdd30min;
104 QFont mApplicationFont;
104 105
105 int mEmailClient; 106 int mEmailClient;
106 QString mEmailOtherChannel; 107 QString mEmailOtherChannel;
107 QString mEmailOtherMessage; 108 QString mEmailOtherMessage;
108 QString mEmailOtherMessageParameters; 109 QString mEmailOtherMessageParameters;
109 QString mEmailOtherMessage2; 110 QString mEmailOtherMessage2;
110 QString mEmailOtherMessageParameters2; 111 QString mEmailOtherMessageParameters2;
111 112
112 int mPhoneClient; 113 int mPhoneClient;
113 QString mPhoneOtherChannel; 114 QString mPhoneOtherChannel;
114 QString mPhoneOtherMessage; 115 QString mPhoneOtherMessage;
115 QString mPhoneOtherMessageParameters; 116 QString mPhoneOtherMessageParameters;
116 117
117 int mFaxClient; 118 int mFaxClient;
118 QString mFaxOtherChannel; 119 QString mFaxOtherChannel;
119 QString mFaxOtherMessage; 120 QString mFaxOtherMessage;
120 QString mFaxOtherMessageParameters; 121 QString mFaxOtherMessageParameters;
121 122
122 int mSMSClient; 123 int mSMSClient;
123 QString mSMSOtherChannel; 124 QString mSMSOtherChannel;
124 QString mSMSOtherMessage; 125 QString mSMSOtherMessage;
125 QString mSMSOtherMessageParameters; 126 QString mSMSOtherMessageParameters;
126 127
127 int mPagerClient; 128 int mPagerClient;
128 QString mPagerOtherChannel; 129 QString mPagerOtherChannel;
129 QString mPagerOtherMessage; 130 QString mPagerOtherMessage;
130 QString mPagerOtherMessageParameters; 131 QString mPagerOtherMessageParameters;
131 132
132 int mSipClient; 133 int mSipClient;
133 QString mSipOtherChannel; 134 QString mSipOtherChannel;
134 QString mSipOtherMessage; 135 QString mSipOtherMessage;
135 QString mSipOtherMessageParameters; 136 QString mSipOtherMessageParameters;
136 137
137 QString mEx2PhoneDevice; 138 QString mEx2PhoneDevice;
138 QString mEx2PhoneConnection; 139 QString mEx2PhoneConnection;
139 QString mEx2PhoneModel; 140 QString mEx2PhoneModel;
140 141
141}; 142};
142 143
143#endif 144#endif
diff --git a/microkde/kglobalsettings.cpp b/microkde/kglobalsettings.cpp
index fbbf814..e57defe 100644
--- a/microkde/kglobalsettings.cpp
+++ b/microkde/kglobalsettings.cpp
@@ -1,44 +1,44 @@
1#include "kglobalsettings.h" 1#include "kglobalsettings.h"
2#include "kconfig.h" 2#include "kconfig.h"
3#include "kglobal.h" 3#include "kglobal.h"
4#include "kconfigbase.h" 4#include "kconfigbase.h"
5 5
6#include <qapplication.h> 6#include <qapplication.h>
7 7
8QFont KGlobalSettings::generalFont() 8QFont KGlobalSettings::generalFont()
9{ 9{
10 int size = 12; 10 int size = 12;
11 if (QApplication::desktop()->width() < 480 ) 11 if (QApplication::desktop()->width() < 480 )
12 size = 10; 12 size = 10;
13 QFont f = QApplication::font(); 13 QFont f = QApplication::font();
14 //qDebug("pointsize %d ", f.pointSize()); 14 //qDebug("pointsize %d %s", f.pointSize(),f.family().latin1());
15 f.setPointSize( size ); 15 f.setPointSize( size );
16 return f; 16 return f;
17} 17}
18QFont KGlobalSettings::toolBarFont() 18QFont KGlobalSettings::toolBarFont()
19{ 19{
20 return QApplication::font(); 20 return QApplication::font();
21} 21}
22 22
23QColor KGlobalSettings::toolBarHighlightColor() 23QColor KGlobalSettings::toolBarHighlightColor()
24{ 24{
25 return QColor( "black" ); 25 return QColor( "black" );
26} 26}
27 27
28QRect KGlobalSettings::desktopGeometry( QWidget * ) 28QRect KGlobalSettings::desktopGeometry( QWidget * )
29{ 29{
30 return QApplication::desktop()->rect(); 30 return QApplication::desktop()->rect();
31} 31}
32 32
33 /** 33 /**
34 * Returns whether KDE runs in single (default) or double click 34 * Returns whether KDE runs in single (default) or double click
35 * mode. 35 * mode.
36 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html 36 * see http://developer.kde.org/documentation/standards/kde/style/mouse/index.html
37 * @return true if single click mode, or false if double click mode. 37 * @return true if single click mode, or false if double click mode.
38 **/ 38 **/
39bool KGlobalSettings::singleClick() 39bool KGlobalSettings::singleClick()
40{ 40{
41 KConfig *c = KGlobal::config(); 41 KConfig *c = KGlobal::config();
42 KConfigGroupSaver cgs( c, "KDE" ); 42 KConfigGroupSaver cgs( c, "KDE" );
43 return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK); 43 return c->readBoolEntry("SingleClick", KDE_DEFAULT_SINGLECLICK);
44} 44}
diff --git a/pwmanager/pwmanager/main.cpp b/pwmanager/pwmanager/main.cpp
index 6e449c6..ee26082 100644
--- a/pwmanager/pwmanager/main.cpp
+++ b/pwmanager/pwmanager/main.cpp
@@ -134,89 +134,90 @@ static void addAuthors(KAboutData *aboutData)
134 aboutData->addCredit("Wickey", 134 aboutData->addCredit("Wickey",
135 I18N_NOOP("graphics-design in older versions."), 135 I18N_NOOP("graphics-design in older versions."),
136 "wickey@gmx.at"); 136 "wickey@gmx.at");
137 aboutData->addCredit("Ian MacGregor", 137 aboutData->addCredit("Ian MacGregor",
138 I18N_NOOP( 138 I18N_NOOP(
139 "original documentation author.")); 139 "original documentation author."));
140} 140}
141#endif 141#endif
142 142
143int main(int argc, char *argv[]) 143int main(int argc, char *argv[])
144{ 144{
145 printDebugConfigureInfo(); 145 printDebugConfigureInfo();
146#ifndef PWM_EMBEDDED 146#ifndef PWM_EMBEDDED
147 KAboutData aboutData(PACKAGE_NAME, PROG_NAME, 147 KAboutData aboutData(PACKAGE_NAME, PROG_NAME,
148 PACKAGE_VER, description, KAboutData::License_File, 148 PACKAGE_VER, description, KAboutData::License_File,
149 "(c) 2003, 2004 Michael Buesch and the PwManager Team", 0, 149 "(c) 2003, 2004 Michael Buesch and the PwManager Team", 0,
150 "http://passwordmanager.sourceforge.net/", 150 "http://passwordmanager.sourceforge.net/",
151 "mbuesch@freenet.de"); 151 "mbuesch@freenet.de");
152 addAuthors(&aboutData); 152 addAuthors(&aboutData);
153 153
154 KCmdLineArgs::init(argc, argv, &aboutData); 154 KCmdLineArgs::init(argc, argv, &aboutData);
155 KCmdLineArgs::addCmdLineOptions(options); 155 KCmdLineArgs::addCmdLineOptions(options);
156 156
157 KUniqueApplication::addCmdLineOptions(); 157 KUniqueApplication::addCmdLineOptions();
158 if (!KUniqueApplication::start()) { 158 if (!KUniqueApplication::start()) {
159 printInfo("already running."); 159 printInfo("already running.");
160 return EXIT_SUCCESS; 160 return EXIT_SUCCESS;
161 } 161 }
162 PwMApplication a; 162 PwMApplication a;
163 aboutData.setLicenseTextFile(LICENSE_FILE); 163 aboutData.setLicenseTextFile(LICENSE_FILE);
164 return a.exec(); 164 return a.exec();
165#else 165#else
166 166
167 bool exitHelp = false; 167 bool exitHelp = false;
168 if ( argc > 1 ) { 168 if ( argc > 1 ) {
169 QString command = argv[1]; 169 QString command = argv[1];
170 if ( command == "-help" ){ 170 if ( command == "-help" ){
171 printf("PWM/PI command line commands:\n"); 171 printf("PWM/PI command line commands:\n");
172 printf(" no command: Start PWM/PI in usual way\n"); 172 printf(" no command: Start PWM/PI in usual way\n");
173 printf(" -help: This output\n"); 173 printf(" -help: This output\n");
174 printf(" PWM/PI is exiting now. Bye!\n"); 174 printf(" PWM/PI is exiting now. Bye!\n");
175 exitHelp = true; 175 exitHelp = true;
176 } 176 }
177 } 177 }
178 if ( ! exitHelp ) { 178 if ( ! exitHelp ) {
179 179
180 PwMApplication a(argc, argv); 180 PwMApplication a(argc, argv);
181 181
182 KGlobal::setAppName( "pwmanager" ); 182 KGlobal::setAppName( "pwmanager" );
183#ifndef DESKTOP_VERSION 183#ifndef DESKTOP_VERSION
184 //qDebug("width %d ",QApplication::desktop()->width() ); 184 //qDebug("width %d ",QApplication::desktop()->width() );
185 if ( QApplication::desktop()->width() > 320 ) 185 if ( QApplication::desktop()->width() > 320 )
186 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons22/"); 186 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons22/");
187 else 187 else
188 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons16/"); 188 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/pwmanager/icons16/");
189#else 189#else
190 QString fileName ; 190 QString fileName ;
191 fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/"; 191 fileName = qApp->applicationDirPath () + "/kdepim/pwmanager/icons22/";
192 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 192 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
193 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 193 QApplication::addLibraryPath ( qApp->applicationDirPath () );
194 194
195#endif 195#endif
196 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager"))); 196 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "pwmanager")));
197 KPimGlobalPrefs::instance()->setGlobalConfig(); 197 KPimGlobalPrefs::instance()->setGlobalConfig();
198 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont );
198 199
199 a.newInstance(); 200 a.newInstance();
200 201
201 //US KAddressBookMain m ; 202 //US KAddressBookMain m ;
202 203
203 //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 204 //US QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
204 /*US 205 /*US
205#ifndef DESKTOP_VERSION 206#ifndef DESKTOP_VERSION
206 a.showMainWidget( &m ); 207 a.showMainWidget( &m );
207#else 208#else
208 a.setMainWidget( &m ); 209 a.setMainWidget( &m );
209 m.resize (640, 480 ); 210 m.resize (640, 480 );
210 m.show(); 211 m.show();
211#endif 212#endif
212 */ 213 */
213 QObject::connect( &a, SIGNAL( lastWindowClosed()), &a, SLOT (quit())); 214 QObject::connect( &a, SIGNAL( lastWindowClosed()), &a, SLOT (quit()));
214 a.exec(); 215 a.exec();
215 dumpMissing(); 216 dumpMissing();
216 KPimGlobalPrefs::instance()->writeConfig(); 217 KPimGlobalPrefs::instance()->writeConfig();
217 } 218 }
218 qDebug("PWMPI: Bye! "); 219 qDebug("PWMPI: Bye! ");
219 220
220#endif 221#endif
221 222
222} 223}