summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-22 04:45:07 (UTC)
committer zautrix <zautrix>2004-09-22 04:45:07 (UTC)
commitbbeffa56ee51d30b84bcadaf22234b8227958f31 (patch) (unidiff)
tree040ce64f3e618ef4b76ddfa80d34a245d59ef1b5
parenta56783aace3496c8b40008d0dec4c42437165e54 (diff)
downloadkdepimpi-bbeffa56ee51d30b84bcadaf22234b8227958f31.zip
kdepimpi-bbeffa56ee51d30b84bcadaf22234b8227958f31.tar.gz
kdepimpi-bbeffa56ee51d30b84bcadaf22234b8227958f31.tar.bz2
desktop compile fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp3
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp1
-rw-r--r--libkdepim/kpimglobalprefs.cpp1
-rw-r--r--libkdepim/kprefswidget.h1
-rw-r--r--libkdepim/libkdepim.pro2
5 files changed, 7 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 1b40d71..df634d0 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1,552 +1,553 @@
1/* 1/*
2 This file is part of KAddressbook. 2 This file is part of KAddressbook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@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 "kabcore.h" 31#include "kabcore.h"
32 32
33#include <stdaddressbook.h> 33#include <stdaddressbook.h>
34#include <klocale.h> 34#include <klocale.h>
35#include <kfiledialog.h> 35#include <kfiledialog.h>
36#include <qtimer.h>
36#include <qprogressbar.h> 37#include <qprogressbar.h>
37 38
38#ifndef KAB_EMBEDDED 39#ifndef KAB_EMBEDDED
39#include <qclipboard.h> 40#include <qclipboard.h>
40#include <qdir.h> 41#include <qdir.h>
41#include <qfile.h> 42#include <qfile.h>
42#include <qapplicaton.h> 43#include <qapplicaton.h>
43#include <qprogressbar.h> 44#include <qprogressbar.h>
44#include <qlayout.h> 45#include <qlayout.h>
45#include <qregexp.h> 46#include <qregexp.h>
46#include <qvbox.h> 47#include <qvbox.h>
47#include <kabc/addresseelist.h> 48#include <kabc/addresseelist.h>
48#include <kabc/errorhandler.h> 49#include <kabc/errorhandler.h>
49#include <kabc/resource.h> 50#include <kabc/resource.h>
50#include <kabc/vcardconverter.h> 51#include <kabc/vcardconverter.h>
51#include <kapplication.h> 52#include <kapplication.h>
52#include <kactionclasses.h> 53#include <kactionclasses.h>
53#include <kcmultidialog.h> 54#include <kcmultidialog.h>
54#include <kdebug.h> 55#include <kdebug.h>
55#include <kdeversion.h> 56#include <kdeversion.h>
56#include <kkeydialog.h> 57#include <kkeydialog.h>
57#include <kmessagebox.h> 58#include <kmessagebox.h>
58#include <kprinter.h> 59#include <kprinter.h>
59#include <kprotocolinfo.h> 60#include <kprotocolinfo.h>
60#include <kresources/selectdialog.h> 61#include <kresources/selectdialog.h>
61#include <kstandarddirs.h> 62#include <kstandarddirs.h>
62#include <ktempfile.h> 63#include <ktempfile.h>
63#include <kxmlguiclient.h> 64#include <kxmlguiclient.h>
64#include <kaboutdata.h> 65#include <kaboutdata.h>
65#include <libkdepim/categoryselectdialog.h> 66#include <libkdepim/categoryselectdialog.h>
66 67
67#include "addresseeutil.h" 68#include "addresseeutil.h"
68#include "addresseeeditordialog.h" 69#include "addresseeeditordialog.h"
69#include "extensionmanager.h" 70#include "extensionmanager.h"
70#include "kstdaction.h" 71#include "kstdaction.h"
71#include "kaddressbookservice.h" 72#include "kaddressbookservice.h"
72#include "ldapsearchdialog.h" 73#include "ldapsearchdialog.h"
73#include "printing/printingwizard.h" 74#include "printing/printingwizard.h"
74#else // KAB_EMBEDDED 75#else // KAB_EMBEDDED
75 76
76#include <kapplication.h> 77#include <kapplication.h>
77#include "KDGanttMinimizeSplitter.h" 78#include "KDGanttMinimizeSplitter.h"
78#include "kaddressbookmain.h" 79#include "kaddressbookmain.h"
79#include "kactioncollection.h" 80#include "kactioncollection.h"
80#include "addresseedialog.h" 81#include "addresseedialog.h"
81//US 82//US
82#include <addresseeview.h> 83#include <addresseeview.h>
83 84
84#include <qapp.h> 85#include <qapp.h>
85#include <qmenubar.h> 86#include <qmenubar.h>
86//#include <qtoolbar.h> 87//#include <qtoolbar.h>
87#include <qmessagebox.h> 88#include <qmessagebox.h>
88#include <kdebug.h> 89#include <kdebug.h>
89#include <kiconloader.h> // needed for SmallIcon 90#include <kiconloader.h> // needed for SmallIcon
90#include <kresources/kcmkresources.h> 91#include <kresources/kcmkresources.h>
91#include <ktoolbar.h> 92#include <ktoolbar.h>
92 93
93 94
94//#include <qlabel.h> 95//#include <qlabel.h>
95 96
96 97
97#ifndef DESKTOP_VERSION 98#ifndef DESKTOP_VERSION
98#include <qpe/ir.h> 99#include <qpe/ir.h>
99#include <qpe/qpemenubar.h> 100#include <qpe/qpemenubar.h>
100#include <qtopia/qcopenvelope_qws.h> 101#include <qtopia/qcopenvelope_qws.h>
101#else 102#else
102 103
103#include <qmenubar.h> 104#include <qmenubar.h>
104#endif 105#endif
105 106
106#endif // KAB_EMBEDDED 107#endif // KAB_EMBEDDED
107#include "kcmconfigs/kcmkabconfig.h" 108#include "kcmconfigs/kcmkabconfig.h"
108#include "kcmconfigs/kcmkdepimconfig.h" 109#include "kcmconfigs/kcmkdepimconfig.h"
109#include "kpimglobalprefs.h" 110#include "kpimglobalprefs.h"
110#include "externalapphandler.h" 111#include "externalapphandler.h"
111 112
112 113
113#include <kresources/selectdialog.h> 114#include <kresources/selectdialog.h>
114#include <kmessagebox.h> 115#include <kmessagebox.h>
115 116
116#include <picture.h> 117#include <picture.h>
117#include <resource.h> 118#include <resource.h>
118 119
119//US#include <qsplitter.h> 120//US#include <qsplitter.h>
120#include <qmap.h> 121#include <qmap.h>
121#include <qdir.h> 122#include <qdir.h>
122#include <qfile.h> 123#include <qfile.h>
123#include <qvbox.h> 124#include <qvbox.h>
124#include <qlayout.h> 125#include <qlayout.h>
125#include <qclipboard.h> 126#include <qclipboard.h>
126#include <qtextstream.h> 127#include <qtextstream.h>
127 128
128#include <libkdepim/categoryselectdialog.h> 129#include <libkdepim/categoryselectdialog.h>
129#include <kabc/vcardconverter.h> 130#include <kabc/vcardconverter.h>
130 131
131 132
132#include "addresseeutil.h" 133#include "addresseeutil.h"
133#include "undocmds.h" 134#include "undocmds.h"
134#include "addresseeeditordialog.h" 135#include "addresseeeditordialog.h"
135#include "viewmanager.h" 136#include "viewmanager.h"
136#include "details/detailsviewcontainer.h" 137#include "details/detailsviewcontainer.h"
137#include "kabprefs.h" 138#include "kabprefs.h"
138#include "xxportmanager.h" 139#include "xxportmanager.h"
139#include "incsearchwidget.h" 140#include "incsearchwidget.h"
140#include "jumpbuttonbar.h" 141#include "jumpbuttonbar.h"
141#include "extensionmanager.h" 142#include "extensionmanager.h"
142#include "addresseeconfig.h" 143#include "addresseeconfig.h"
143#include <kcmultidialog.h> 144#include <kcmultidialog.h>
144 145
145#ifdef _WIN32_ 146#ifdef _WIN32_
146 147
147#include "kaimportoldialog.h" 148#include "kaimportoldialog.h"
148#else 149#else
149#include <unistd.h> 150#include <unistd.h>
150#endif 151#endif
151// sync includes 152// sync includes
152#include <libkdepim/ksyncprofile.h> 153#include <libkdepim/ksyncprofile.h>
153#include <libkdepim/ksyncprefsdialog.h> 154#include <libkdepim/ksyncprefsdialog.h>
154 155
155 156
156bool pasteWithNewUid = true; 157bool pasteWithNewUid = true;
157 158
158#ifdef KAB_EMBEDDED 159#ifdef KAB_EMBEDDED
159KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) 160KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name )
160 : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), 161 : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ),
161 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ 162 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/
162 mReadWrite( readWrite ), mModified( false ), mMainWindow(client) 163 mReadWrite( readWrite ), mModified( false ), mMainWindow(client)
163#else //KAB_EMBEDDED 164#else //KAB_EMBEDDED
164KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) 165KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name )
165 : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), 166 : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ),
166 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), 167 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ),
167 mReadWrite( readWrite ), mModified( false ) 168 mReadWrite( readWrite ), mModified( false )
168#endif //KAB_EMBEDDED 169#endif //KAB_EMBEDDED
169{ 170{
170 171
171 mBlockSaveFlag = false; 172 mBlockSaveFlag = false;
172 mExtensionBarSplitter = 0; 173 mExtensionBarSplitter = 0;
173 mIsPart = !parent->inherits( "KAddressBookMain" ); 174 mIsPart = !parent->inherits( "KAddressBookMain" );
174 175
175 mAddressBook = KABC::StdAddressBook::self(); 176 mAddressBook = KABC::StdAddressBook::self();
176 KABC::StdAddressBook::setAutomaticSave( false ); 177 KABC::StdAddressBook::setAutomaticSave( false );
177 178
178#ifndef KAB_EMBEDDED 179#ifndef KAB_EMBEDDED
179 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); 180 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler );
180#endif //KAB_EMBEDDED 181#endif //KAB_EMBEDDED
181 182
182 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), 183 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ),
183 SLOT( addressBookChanged() ) ); 184 SLOT( addressBookChanged() ) );
184 185
185#if 0 186#if 0
186 // LP moved to addressbook init method 187 // LP moved to addressbook init method
187 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, 188 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization,
188 "X-Department", "KADDRESSBOOK" ); 189 "X-Department", "KADDRESSBOOK" );
189 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, 190 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization,
190 "X-Profession", "KADDRESSBOOK" ); 191 "X-Profession", "KADDRESSBOOK" );
191 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, 192 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization,
192 "X-AssistantsName", "KADDRESSBOOK" ); 193 "X-AssistantsName", "KADDRESSBOOK" );
193 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, 194 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization,
194 "X-ManagersName", "KADDRESSBOOK" ); 195 "X-ManagersName", "KADDRESSBOOK" );
195 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, 196 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal,
196 "X-SpousesName", "KADDRESSBOOK" ); 197 "X-SpousesName", "KADDRESSBOOK" );
197 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, 198 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal,
198 "X-Office", "KADDRESSBOOK" ); 199 "X-Office", "KADDRESSBOOK" );
199 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, 200 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal,
200 "X-IMAddress", "KADDRESSBOOK" ); 201 "X-IMAddress", "KADDRESSBOOK" );
201 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, 202 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal,
202 "X-Anniversary", "KADDRESSBOOK" ); 203 "X-Anniversary", "KADDRESSBOOK" );
203 204
204 //US added this field to become compatible with Opie/qtopia addressbook 205 //US added this field to become compatible with Opie/qtopia addressbook
205 // values can be "female" or "male" or "". An empty field represents undefined. 206 // values can be "female" or "male" or "". An empty field represents undefined.
206 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, 207 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal,
207 "X-Gender", "KADDRESSBOOK" ); 208 "X-Gender", "KADDRESSBOOK" );
208 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, 209 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal,
209 "X-Children", "KADDRESSBOOK" ); 210 "X-Children", "KADDRESSBOOK" );
210 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, 211 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal,
211 "X-FreeBusyUrl", "KADDRESSBOOK" ); 212 "X-FreeBusyUrl", "KADDRESSBOOK" );
212#endif 213#endif
213 initGUI(); 214 initGUI();
214 215
215 mIncSearchWidget->setFocus(); 216 mIncSearchWidget->setFocus();
216 217
217 218
218 connect( mViewManager, SIGNAL( selected( const QString& ) ), 219 connect( mViewManager, SIGNAL( selected( const QString& ) ),
219 SLOT( setContactSelected( const QString& ) ) ); 220 SLOT( setContactSelected( const QString& ) ) );
220 connect( mViewManager, SIGNAL( executed( const QString& ) ), 221 connect( mViewManager, SIGNAL( executed( const QString& ) ),
221 SLOT( executeContact( const QString& ) ) ); 222 SLOT( executeContact( const QString& ) ) );
222 223
223 connect( mViewManager, SIGNAL( deleteRequest( ) ), 224 connect( mViewManager, SIGNAL( deleteRequest( ) ),
224 SLOT( deleteContacts( ) ) ); 225 SLOT( deleteContacts( ) ) );
225 connect( mViewManager, SIGNAL( modified() ), 226 connect( mViewManager, SIGNAL( modified() ),
226 SLOT( setModified() ) ); 227 SLOT( setModified() ) );
227 228
228 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); 229 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) );
229 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); 230 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) );
230 231
231 connect( mXXPortManager, SIGNAL( modified() ), 232 connect( mXXPortManager, SIGNAL( modified() ),
232 SLOT( setModified() ) ); 233 SLOT( setModified() ) );
233 234
234 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), 235 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ),
235 SLOT( incrementalSearch( const QString& ) ) ); 236 SLOT( incrementalSearch( const QString& ) ) );
236 connect( mIncSearchWidget, SIGNAL( fieldChanged() ), 237 connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
237 mJumpButtonBar, SLOT( recreateButtons() ) ); 238 mJumpButtonBar, SLOT( recreateButtons() ) );
238 239
239 connect( mDetails, SIGNAL( sendEmail( const QString& ) ), 240 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
240 SLOT( sendMail( const QString& ) ) ); 241 SLOT( sendMail( const QString& ) ) );
241 242
242 243
243 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); 244 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&)));
244 connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); 245 connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)));
245 246
246 247
247#ifndef KAB_EMBEDDED 248#ifndef KAB_EMBEDDED
248 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), 249 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
249 mXXPortManager, SLOT( importVCard( const KURL& ) ) ); 250 mXXPortManager, SLOT( importVCard( const KURL& ) ) );
250 251
251 connect( mDetails, SIGNAL( browse( const QString& ) ), 252 connect( mDetails, SIGNAL( browse( const QString& ) ),
252 SLOT( browse( const QString& ) ) ); 253 SLOT( browse( const QString& ) ) );
253 254
254 255
255 mAddressBookService = new KAddressBookService( this ); 256 mAddressBookService = new KAddressBookService( this );
256 257
257#endif //KAB_EMBEDDED 258#endif //KAB_EMBEDDED
258 mEditorDialog = 0; 259 mEditorDialog = 0;
259 createAddresseeEditorDialog( this ); 260 createAddresseeEditorDialog( this );
260 setModified( false ); 261 setModified( false );
261} 262}
262 263
263KABCore::~KABCore() 264KABCore::~KABCore()
264{ 265{
265 // save(); 266 // save();
266 //saveSettings(); 267 //saveSettings();
267 //KABPrefs::instance()->writeConfig(); 268 //KABPrefs::instance()->writeConfig();
268 delete AddresseeConfig::instance(); 269 delete AddresseeConfig::instance();
269 mAddressBook = 0; 270 mAddressBook = 0;
270 KABC::StdAddressBook::close(); 271 KABC::StdAddressBook::close();
271} 272}
272 273
273void KABCore::restoreSettings() 274void KABCore::restoreSettings()
274{ 275{
275 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; 276 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce;
276 277
277 bool state; 278 bool state;
278 279
279 if (mMultipleViewsAtOnce) 280 if (mMultipleViewsAtOnce)
280 state = KABPrefs::instance()->mDetailsPageVisible; 281 state = KABPrefs::instance()->mDetailsPageVisible;
281 else 282 else
282 state = false; 283 state = false;
283 284
284 mActionDetails->setChecked( state ); 285 mActionDetails->setChecked( state );
285 setDetailsVisible( state ); 286 setDetailsVisible( state );
286 287
287 state = KABPrefs::instance()->mJumpButtonBarVisible; 288 state = KABPrefs::instance()->mJumpButtonBarVisible;
288 289
289 mActionJumpBar->setChecked( state ); 290 mActionJumpBar->setChecked( state );
290 setJumpButtonBarVisible( state ); 291 setJumpButtonBarVisible( state );
291/*US 292/*US
292 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; 293 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter;
293 if ( splitterSize.count() == 0 ) { 294 if ( splitterSize.count() == 0 ) {
294 splitterSize.append( width() / 2 ); 295 splitterSize.append( width() / 2 );
295 splitterSize.append( width() / 2 ); 296 splitterSize.append( width() / 2 );
296 } 297 }
297 mMiniSplitter->setSizes( splitterSize ); 298 mMiniSplitter->setSizes( splitterSize );
298 if ( mExtensionBarSplitter ) { 299 if ( mExtensionBarSplitter ) {
299 splitterSize = KABPrefs::instance()->mExtensionsSplitter; 300 splitterSize = KABPrefs::instance()->mExtensionsSplitter;
300 if ( splitterSize.count() == 0 ) { 301 if ( splitterSize.count() == 0 ) {
301 splitterSize.append( width() / 2 ); 302 splitterSize.append( width() / 2 );
302 splitterSize.append( width() / 2 ); 303 splitterSize.append( width() / 2 );
303 } 304 }
304 mExtensionBarSplitter->setSizes( splitterSize ); 305 mExtensionBarSplitter->setSizes( splitterSize );
305 306
306 } 307 }
307*/ 308*/
308 mViewManager->restoreSettings(); 309 mViewManager->restoreSettings();
309 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); 310 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField );
310 mExtensionManager->restoreSettings(); 311 mExtensionManager->restoreSettings();
311#ifdef DESKTOP_VERSION 312#ifdef DESKTOP_VERSION
312 int wid = width(); 313 int wid = width();
313 if ( wid < 10 ) 314 if ( wid < 10 )
314 wid = 400; 315 wid = 400;
315#else 316#else
316 int wid = QApplication::desktop()->width(); 317 int wid = QApplication::desktop()->width();
317 if ( wid < 640 ) 318 if ( wid < 640 )
318 wid = QApplication::desktop()->height(); 319 wid = QApplication::desktop()->height();
319#endif 320#endif
320 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; 321 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter;
321 if ( true /*splitterSize.count() == 0*/ ) { 322 if ( true /*splitterSize.count() == 0*/ ) {
322 splitterSize.append( wid / 2 ); 323 splitterSize.append( wid / 2 );
323 splitterSize.append( wid / 2 ); 324 splitterSize.append( wid / 2 );
324 } 325 }
325 mMiniSplitter->setSizes( splitterSize ); 326 mMiniSplitter->setSizes( splitterSize );
326 if ( mExtensionBarSplitter ) { 327 if ( mExtensionBarSplitter ) {
327 //splitterSize = KABPrefs::instance()->mExtensionsSplitter; 328 //splitterSize = KABPrefs::instance()->mExtensionsSplitter;
328 if ( true /*splitterSize.count() == 0*/ ) { 329 if ( true /*splitterSize.count() == 0*/ ) {
329 splitterSize.append( wid / 2 ); 330 splitterSize.append( wid / 2 );
330 splitterSize.append( wid / 2 ); 331 splitterSize.append( wid / 2 );
331 } 332 }
332 mExtensionBarSplitter->setSizes( splitterSize ); 333 mExtensionBarSplitter->setSizes( splitterSize );
333 334
334 } 335 }
335 336
336 337
337} 338}
338 339
339void KABCore::saveSettings() 340void KABCore::saveSettings()
340{ 341{
341 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); 342 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked();
342 if ( mExtensionBarSplitter ) 343 if ( mExtensionBarSplitter )
343 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); 344 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
344 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); 345 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked();
345 KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); 346 KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes();
346#ifndef KAB_EMBEDDED 347#ifndef KAB_EMBEDDED
347 348
348 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); 349 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
349 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); 350 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes();
350#endif //KAB_EMBEDDED 351#endif //KAB_EMBEDDED
351 mExtensionManager->saveSettings(); 352 mExtensionManager->saveSettings();
352 mViewManager->saveSettings(); 353 mViewManager->saveSettings();
353 354
354 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); 355 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem();
355} 356}
356 357
357KABC::AddressBook *KABCore::addressBook() const 358KABC::AddressBook *KABCore::addressBook() const
358{ 359{
359 return mAddressBook; 360 return mAddressBook;
360} 361}
361 362
362KConfig *KABCore::config() 363KConfig *KABCore::config()
363{ 364{
364#ifndef KAB_EMBEDDED 365#ifndef KAB_EMBEDDED
365 return KABPrefs::instance()->config(); 366 return KABPrefs::instance()->config();
366#else //KAB_EMBEDDED 367#else //KAB_EMBEDDED
367 return KABPrefs::instance()->getConfig(); 368 return KABPrefs::instance()->getConfig();
368#endif //KAB_EMBEDDED 369#endif //KAB_EMBEDDED
369} 370}
370 371
371KActionCollection *KABCore::actionCollection() const 372KActionCollection *KABCore::actionCollection() const
372{ 373{
373 return mGUIClient->actionCollection(); 374 return mGUIClient->actionCollection();
374} 375}
375 376
376KABC::Field *KABCore::currentSearchField() const 377KABC::Field *KABCore::currentSearchField() const
377{ 378{
378 if (mIncSearchWidget) 379 if (mIncSearchWidget)
379 return mIncSearchWidget->currentField(); 380 return mIncSearchWidget->currentField();
380 else 381 else
381 return 0; 382 return 0;
382} 383}
383 384
384QStringList KABCore::selectedUIDs() const 385QStringList KABCore::selectedUIDs() const
385{ 386{
386 return mViewManager->selectedUids(); 387 return mViewManager->selectedUids();
387} 388}
388 389
389KABC::Resource *KABCore::requestResource( QWidget *parent ) 390KABC::Resource *KABCore::requestResource( QWidget *parent )
390{ 391{
391 QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); 392 QPtrList<KABC::Resource> kabcResources = addressBook()->resources();
392 393
393 QPtrList<KRES::Resource> kresResources; 394 QPtrList<KRES::Resource> kresResources;
394 QPtrListIterator<KABC::Resource> resIt( kabcResources ); 395 QPtrListIterator<KABC::Resource> resIt( kabcResources );
395 KABC::Resource *resource; 396 KABC::Resource *resource;
396 while ( ( resource = resIt.current() ) != 0 ) { 397 while ( ( resource = resIt.current() ) != 0 ) {
397 ++resIt; 398 ++resIt;
398 if ( !resource->readOnly() ) { 399 if ( !resource->readOnly() ) {
399 KRES::Resource *res = static_cast<KRES::Resource*>( resource ); 400 KRES::Resource *res = static_cast<KRES::Resource*>( resource );
400 if ( res ) 401 if ( res )
401 kresResources.append( res ); 402 kresResources.append( res );
402 } 403 }
403 } 404 }
404 405
405 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); 406 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent );
406 return static_cast<KABC::Resource*>( res ); 407 return static_cast<KABC::Resource*>( res );
407} 408}
408 409
409#ifndef KAB_EMBEDDED 410#ifndef KAB_EMBEDDED
410KAboutData *KABCore::createAboutData() 411KAboutData *KABCore::createAboutData()
411#else //KAB_EMBEDDED 412#else //KAB_EMBEDDED
412void KABCore::createAboutData() 413void KABCore::createAboutData()
413#endif //KAB_EMBEDDED 414#endif //KAB_EMBEDDED
414{ 415{
415#ifndef KAB_EMBEDDED 416#ifndef KAB_EMBEDDED
416 KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ), 417 KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ),
417 "3.1", I18N_NOOP( "The KDE Address Book" ), 418 "3.1", I18N_NOOP( "The KDE Address Book" ),
418 KAboutData::License_GPL_V2, 419 KAboutData::License_GPL_V2,
419 I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) ); 420 I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) );
420 about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" ); 421 about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" );
421 about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) ); 422 about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) );
422 about->addAuthor( "Cornelius Schumacher", 423 about->addAuthor( "Cornelius Schumacher",
423 I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ), 424 I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ),
424 "schumacher@kde.org" ); 425 "schumacher@kde.org" );
425 about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ), 426 about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ),
426 "mpilone@slac.com" ); 427 "mpilone@slac.com" );
427 about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) ); 428 about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) );
428 about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) ); 429 about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) );
429 about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ), 430 about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ),
430 "michel@klaralvdalens-datakonsult.se" ); 431 "michel@klaralvdalens-datakonsult.se" );
431 about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ), 432 about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ),
432 "hansen@kde.org" ); 433 "hansen@kde.org" );
433 434
434 return about; 435 return about;
435#endif //KAB_EMBEDDED 436#endif //KAB_EMBEDDED
436 437
437 QString version; 438 QString version;
438#include <../version> 439#include <../version>
439 QMessageBox::about( this, "About KAddressbook/Pi", 440 QMessageBox::about( this, "About KAddressbook/Pi",
440 "KAddressbook/Platform-independent\n" 441 "KAddressbook/Platform-independent\n"
441 "(KA/Pi) " +version + " - " + 442 "(KA/Pi) " +version + " - " +
442#ifdef DESKTOP_VERSION 443#ifdef DESKTOP_VERSION
443 "Desktop Edition\n" 444 "Desktop Edition\n"
444#else 445#else
445 "PDA-Edition\n" 446 "PDA-Edition\n"
446 "for: Zaurus 5500 / 7x0 / 8x0\n" 447 "for: Zaurus 5500 / 7x0 / 8x0\n"
447#endif 448#endif
448 449
449 "(c) 2004 Ulf Schenk\n" 450 "(c) 2004 Ulf Schenk\n"
450 "(c) 2004 Lutz Rogowski\n" 451 "(c) 2004 Lutz Rogowski\n"
451 "(c) 1997-2003, The KDE PIM Team\n" 452 "(c) 1997-2003, The KDE PIM Team\n"
452 "Tobias Koenig Current maintainer\ntokoe@kde.org\n" 453 "Tobias Koenig Current maintainer\ntokoe@kde.org\n"
453 "Don Sanders Original author\n" 454 "Don Sanders Original author\n"
454 "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n" 455 "Cornelius Schumacher Co-maintainer\nschumacher@kde.org\n"
455 "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n" 456 "Mike Pilone GUI and framework redesign\nmpilone@slac.com\n"
456 "Greg Stern DCOP interface\n" 457 "Greg Stern DCOP interface\n"
457 "Mark Westcot Contact pinning\n" 458 "Mark Westcot Contact pinning\n"
458 "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n" 459 "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n"
459 "Steffen Hansen LDAP Lookup\nhansen@kde.org\n" 460 "Steffen Hansen LDAP Lookup\nhansen@kde.org\n"
460#ifdef _WIN32_ 461#ifdef _WIN32_
461 "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n" 462 "(c) 2004 Lutz Rogowski Import from OL\nrogowski@kde.org\n"
462#endif 463#endif
463 ); 464 );
464} 465}
465 466
466void KABCore::setContactSelected( const QString &uid ) 467void KABCore::setContactSelected( const QString &uid )
467{ 468{
468 KABC::Addressee addr = mAddressBook->findByUid( uid ); 469 KABC::Addressee addr = mAddressBook->findByUid( uid );
469 if ( !mDetails->isHidden() ) 470 if ( !mDetails->isHidden() )
470 mDetails->setAddressee( addr ); 471 mDetails->setAddressee( addr );
471 472
472 if ( !addr.isEmpty() ) { 473 if ( !addr.isEmpty() ) {
473 emit contactSelected( addr.formattedName() ); 474 emit contactSelected( addr.formattedName() );
474 KABC::Picture pic = addr.photo(); 475 KABC::Picture pic = addr.photo();
475 if ( pic.isIntern() ) { 476 if ( pic.isIntern() ) {
476//US emit contactSelected( pic.data() ); 477//US emit contactSelected( pic.data() );
477//US instead use: 478//US instead use:
478 QPixmap px; 479 QPixmap px;
479 if (pic.data().isNull() != true) 480 if (pic.data().isNull() != true)
480 { 481 {
481 px.convertFromImage(pic.data()); 482 px.convertFromImage(pic.data());
482 } 483 }
483 484
484 emit contactSelected( px ); 485 emit contactSelected( px );
485 } 486 }
486 } 487 }
487 488
488 489
489 mExtensionManager->setSelectionChanged(); 490 mExtensionManager->setSelectionChanged();
490 491
491 // update the actions 492 // update the actions
492 bool selected = !uid.isEmpty(); 493 bool selected = !uid.isEmpty();
493 494
494 if ( mReadWrite ) { 495 if ( mReadWrite ) {
495 mActionCut->setEnabled( selected ); 496 mActionCut->setEnabled( selected );
496 mActionPaste->setEnabled( selected ); 497 mActionPaste->setEnabled( selected );
497 } 498 }
498 499
499 mActionCopy->setEnabled( selected ); 500 mActionCopy->setEnabled( selected );
500 mActionDelete->setEnabled( selected ); 501 mActionDelete->setEnabled( selected );
501 mActionEditAddressee->setEnabled( selected ); 502 mActionEditAddressee->setEnabled( selected );
502 mActionMail->setEnabled( selected ); 503 mActionMail->setEnabled( selected );
503 mActionMailVCard->setEnabled( selected ); 504 mActionMailVCard->setEnabled( selected );
504 //if (mActionBeam) 505 //if (mActionBeam)
505 //mActionBeam->setEnabled( selected ); 506 //mActionBeam->setEnabled( selected );
506 507
507 if (mActionBeamVCard) 508 if (mActionBeamVCard)
508 mActionBeamVCard->setEnabled( selected ); 509 mActionBeamVCard->setEnabled( selected );
509 510
510 mActionWhoAmI->setEnabled( selected ); 511 mActionWhoAmI->setEnabled( selected );
511 mActionCategories->setEnabled( selected ); 512 mActionCategories->setEnabled( selected );
512} 513}
513 514
514void KABCore::sendMail() 515void KABCore::sendMail()
515{ 516{
516 sendMail( mViewManager->selectedEmails().join( ", " ) ); 517 sendMail( mViewManager->selectedEmails().join( ", " ) );
517} 518}
518 519
519void KABCore::sendMail( const QString& emaillist ) 520void KABCore::sendMail( const QString& emaillist )
520{ 521{
521 // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... " 522 // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... "
522 if (emaillist.contains(",") > 0) 523 if (emaillist.contains(",") > 0)
523 ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); 524 ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null );
524 else 525 else
525 ExternalAppHandler::instance()->mailToOneContact( emaillist ); 526 ExternalAppHandler::instance()->mailToOneContact( emaillist );
526} 527}
527 528
528 529
529 530
530void KABCore::mailVCard() 531void KABCore::mailVCard()
531{ 532{
532 QStringList uids = mViewManager->selectedUids(); 533 QStringList uids = mViewManager->selectedUids();
533 if ( !uids.isEmpty() ) 534 if ( !uids.isEmpty() )
534 mailVCard( uids ); 535 mailVCard( uids );
535} 536}
536 537
537void KABCore::mailVCard( const QStringList& uids ) 538void KABCore::mailVCard( const QStringList& uids )
538{ 539{
539 QStringList urls; 540 QStringList urls;
540 541
541// QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); 542// QString tmpdir = locateLocal("tmp", KGlobal::getAppName());
542 543
543 QString dirName = "/tmp/" + KApplication::randomString( 8 ); 544 QString dirName = "/tmp/" + KApplication::randomString( 8 );
544 545
545 546
546 547
547 QDir().mkdir( dirName, true ); 548 QDir().mkdir( dirName, true );
548 549
549 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) { 550 for( QStringList::ConstIterator it = uids.begin(); it != uids.end(); ++it ) {
550 KABC::Addressee a = mAddressBook->findByUid( *it ); 551 KABC::Addressee a = mAddressBook->findByUid( *it );
551 552
552 if ( a.isEmpty() ) 553 if ( a.isEmpty() )
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 073ab74..03034b4 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,550 +1,551 @@
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 <qregexp.h>
39 40
40#include <kdialog.h> 41#include <kdialog.h>
41#include <klocale.h> 42#include <klocale.h>
42#include <kdateedit.h> 43#include <kdateedit.h>
43#include <kglobal.h> 44#include <kglobal.h>
44#include <stdlib.h> 45#include <stdlib.h>
45 46
46/*US 47/*US
47#include <qcheckbox.h> 48#include <qcheckbox.h>
48#include <qframe.h> 49#include <qframe.h>
49#include <qpushbutton.h> 50#include <qpushbutton.h>
50#include <qcombobox.h> 51#include <qcombobox.h>
51#include <qlineedit.h> 52#include <qlineedit.h>
52#include <qlabel.h> 53#include <qlabel.h>
53#include <qfile.h> 54#include <qfile.h>
54 55
55#include <kconfig.h> 56#include <kconfig.h>
56#include <kdebug.h> 57#include <kdebug.h>
57#include <kdialog.h> 58#include <kdialog.h>
58#include <klistview.h> 59#include <klistview.h>
59#include <klocale.h> 60#include <klocale.h>
60#include <kglobal.h> 61#include <kglobal.h>
61#include <kmessagebox.h> 62#include <kmessagebox.h>
62#include <kstandarddirs.h> 63#include <kstandarddirs.h>
63 64
64#ifndef KAB_EMBEDDED 65#ifndef KAB_EMBEDDED
65#include <ktrader.h> 66#include <ktrader.h>
66#else // KAB_EMBEDDED 67#else // KAB_EMBEDDED
67#include <mergewidget.h> 68#include <mergewidget.h>
68#include <distributionlistwidget.h> 69#include <distributionlistwidget.h>
69#endif // KAB_EMBEDDED 70#endif // KAB_EMBEDDED
70 71
71#include "addresseewidget.h" 72#include "addresseewidget.h"
72#include "extensionconfigdialog.h" 73#include "extensionconfigdialog.h"
73#include "extensionwidget.h" 74#include "extensionwidget.h"
74*/ 75*/
75 76
76#include "qapplication.h" 77#include "qapplication.h"
77 78
78#include "kpimglobalprefs.h" 79#include "kpimglobalprefs.h"
79 80
80#include "kdepimconfigwidget.h" 81#include "kdepimconfigwidget.h"
81 82
82 83
83KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 84KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
84 : KPrefsWidget(prefs, parent, name ) 85 : KPrefsWidget(prefs, parent, name )
85{ 86{
86 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 87 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
87 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 88 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
88 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 89 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
89 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 90 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
90 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 91 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
91 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 92 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
92 93
93 94
94 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 95 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
95 KDialog::spacingHint() ); 96 KDialog::spacingHint() );
96 97
97 tabWidget = new QTabWidget( this ); 98 tabWidget = new QTabWidget( this );
98 topLayout->addWidget( tabWidget ); 99 topLayout->addWidget( tabWidget );
99 100
100 101
101 setupLocaleTab(); 102 setupLocaleTab();
102 setupLocaleDateTab(); 103 setupLocaleDateTab();
103 setupTimeZoneTab(); 104 setupTimeZoneTab();
104 setupExternalAppTab(); 105 setupExternalAppTab();
105 106
106} 107}
107void KDEPIMConfigWidget::showTimeZoneTab() 108void KDEPIMConfigWidget::showTimeZoneTab()
108{ 109{
109 tabWidget->setCurrentPage ( 2 ) ; 110 tabWidget->setCurrentPage ( 2 ) ;
110} 111}
111void KDEPIMConfigWidget::setupExternalAppTab() 112void KDEPIMConfigWidget::setupExternalAppTab()
112{ 113{
113 QWidget *externalAppsPage = new QWidget( this ); 114 QWidget *externalAppsPage = new QWidget( this );
114 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 115 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
115 KDialog::spacingHintSmall() ); 116 KDialog::spacingHintSmall() );
116 117
117 mExternalApps = new QComboBox( externalAppsPage ); 118 mExternalApps = new QComboBox( externalAppsPage );
118 119
119 QMap<ExternalAppHandler::Types, QString>::Iterator it; 120 QMap<ExternalAppHandler::Types, QString>::Iterator it;
120 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 121 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
121 mExternalApps->insertItem( it.data(), it.key() ); 122 mExternalApps->insertItem( it.data(), it.key() );
122 123
123 layout->addWidget( mExternalApps ); 124 layout->addWidget( mExternalApps );
124 125
125 connect( mExternalApps, SIGNAL( activated( int ) ), 126 connect( mExternalApps, SIGNAL( activated( int ) ),
126 this, SLOT (externalapp_changed( int ) ) ); 127 this, SLOT (externalapp_changed( int ) ) );
127 128
128 129
129 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 130 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
130 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 131 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
131 132
132 133
133 mClient = new QComboBox( mExternalAppGroupBox ); 134 mClient = new QComboBox( mExternalAppGroupBox );
134 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 135 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
135 136
136 connect( mClient, SIGNAL( activated( int ) ), 137 connect( mClient, SIGNAL( activated( int ) ),
137 this, SLOT (client_changed( int ) ) ); 138 this, SLOT (client_changed( int ) ) );
138 139
139 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 140 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
140 boxLayout->addWidget( lab, 1, 0 ); 141 boxLayout->addWidget( lab, 1, 0 );
141 mChannel = new QLineEdit(mExternalAppGroupBox); 142 mChannel = new QLineEdit(mExternalAppGroupBox);
142 mChannel->setReadOnly(true); 143 mChannel->setReadOnly(true);
143 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 144 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
144 145
145 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 146 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
146 boxLayout->addWidget( lab, 3, 0 ); 147 boxLayout->addWidget( lab, 3, 0 );
147 mMessage = new QLineEdit(mExternalAppGroupBox); 148 mMessage = new QLineEdit(mExternalAppGroupBox);
148 mMessage->setReadOnly(true); 149 mMessage->setReadOnly(true);
149 boxLayout->addWidget( mMessage , 4, 0); 150 boxLayout->addWidget( mMessage , 4, 0);
150 151
151 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 152 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
152 boxLayout->addWidget( lab, 3, 1 ); 153 boxLayout->addWidget( lab, 3, 1 );
153 mParameters = new QLineEdit(mExternalAppGroupBox); 154 mParameters = new QLineEdit(mExternalAppGroupBox);
154 mParameters->setReadOnly(true); 155 mParameters->setReadOnly(true);
155 boxLayout->addWidget( mParameters, 4, 1 ); 156 boxLayout->addWidget( mParameters, 4, 1 );
156 157
157 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); 158 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
158 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); 159 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
159 160
160 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 161 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
161 boxLayout->addWidget( lab, 6, 0 ); 162 boxLayout->addWidget( lab, 6, 0 );
162 mMessage2 = new QLineEdit(mExternalAppGroupBox); 163 mMessage2 = new QLineEdit(mExternalAppGroupBox);
163 mMessage2->setReadOnly(true); 164 mMessage2->setReadOnly(true);
164 boxLayout->addWidget( mMessage2 , 7, 0); 165 boxLayout->addWidget( mMessage2 , 7, 0);
165 166
166 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 167 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
167 boxLayout->addWidget( lab, 6, 1 ); 168 boxLayout->addWidget( lab, 6, 1 );
168 mParameters2 = new QLineEdit(mExternalAppGroupBox); 169 mParameters2 = new QLineEdit(mExternalAppGroupBox);
169 mParameters2->setReadOnly(true); 170 mParameters2->setReadOnly(true);
170 boxLayout->addWidget( mParameters2, 7, 1 ); 171 boxLayout->addWidget( mParameters2, 7, 1 );
171 172
172 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); 173 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
173 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); 174 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
174 175
175 176
176 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 177 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
177 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 178 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
178 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 179 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
179 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 180 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
180 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 181 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
181 182
182 183
183 layout->addWidget( mExternalAppGroupBox ); 184 layout->addWidget( mExternalAppGroupBox );
184 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 185 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
185 186
186} 187}
187 188
188 189
189void KDEPIMConfigWidget::setupLocaleDateTab() 190void KDEPIMConfigWidget::setupLocaleDateTab()
190{ 191{
191 QWidget *topFrame = new QWidget( this ); 192 QWidget *topFrame = new QWidget( this );
192 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 193 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
193 194
194 topLayout->setSpacing(KDialog::spacingHint()); 195 topLayout->setSpacing(KDialog::spacingHint());
195 topLayout->setMargin(KDialog::marginHint()); 196 topLayout->setMargin(KDialog::marginHint());
196 int iii = 0; 197 int iii = 0;
197 198
198 199
199 KPrefsWidRadios *syncPrefsGroup = 200 KPrefsWidRadios *syncPrefsGroup =
200 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 201 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
201 QString format; 202 QString format;
202 if ( QApplication::desktop()->width() < 480 ) 203 if ( QApplication::desktop()->width() < 480 )
203 format = "(%d.%m.%Y)"; 204 format = "(%d.%m.%Y)";
204 else 205 else
205 format = "(%d.%m.%Y|%A %d %B %Y)"; 206 format = "(%d.%m.%Y|%A %d %B %Y)";
206 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 207 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
207 if ( QApplication::desktop()->width() < 480 ) 208 if ( QApplication::desktop()->width() < 480 )
208 format = "(%m.%d.%Y)"; 209 format = "(%m.%d.%Y)";
209 else 210 else
210 format = "(%m.%d.%Y|%A %B %d %Y)"; 211 format = "(%m.%d.%Y|%A %B %d %Y)";
211 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 212 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
212 if ( QApplication::desktop()->width() < 480 ) 213 if ( QApplication::desktop()->width() < 480 )
213 format = "(%Y-%m-%d)"; 214 format = "(%Y-%m-%d)";
214 else 215 else
215 format = "(%Y-%m-%d|%A %Y %B %d)"; 216 format = "(%Y-%m-%d|%A %Y %B %d)";
216 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 217 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
217 syncPrefsGroup->addRadio(i18n("User defined")); 218 syncPrefsGroup->addRadio(i18n("User defined"));
218 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 219 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
219 ++iii; 220 ++iii;
220 ++iii; 221 ++iii;
221 QLabel * lab; 222 QLabel * lab;
222 mUserDateFormatLong = new QLineEdit(topFrame); 223 mUserDateFormatLong = new QLineEdit(topFrame);
223 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 224 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
224 topLayout->addWidget(lab ,iii,0); 225 topLayout->addWidget(lab ,iii,0);
225 topLayout->addWidget(mUserDateFormatLong,iii,1); 226 topLayout->addWidget(mUserDateFormatLong,iii,1);
226 ++iii; 227 ++iii;
227 mUserDateFormatShort = new QLineEdit(topFrame); 228 mUserDateFormatShort = new QLineEdit(topFrame);
228 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 229 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
229 topLayout->addWidget(lab ,iii,0); 230 topLayout->addWidget(lab ,iii,0);
230 topLayout->addWidget(mUserDateFormatShort,iii,1); 231 topLayout->addWidget(mUserDateFormatShort,iii,1);
231 ++iii; 232 ++iii;
232 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 233 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
233 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 234 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
234 ++iii; 235 ++iii;
235 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 236 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
236 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 237 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
237 ++iii; 238 ++iii;
238 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 239 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
239 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 240 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
240 ++iii; 241 ++iii;
241 242
242 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 243 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
243 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 244 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
244 245
245 246
246 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 247 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
247} 248}
248 249
249void KDEPIMConfigWidget::setupLocaleTab() 250void KDEPIMConfigWidget::setupLocaleTab()
250{ 251{
251 252
252 QWidget *topFrame = new QWidget( this ); 253 QWidget *topFrame = new QWidget( this );
253 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 254 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
254 255
255 topLayout->setSpacing(KDialog::spacingHint()); 256 topLayout->setSpacing(KDialog::spacingHint());
256 topLayout->setMargin(KDialog::marginHint()); 257 topLayout->setMargin(KDialog::marginHint());
257 int iii = 0; 258 int iii = 0;
258 KPrefsWidRadios *syncPrefsGroup = 259 KPrefsWidRadios *syncPrefsGroup =
259 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 260 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
260 syncPrefsGroup->addRadio(i18n("English")); 261 syncPrefsGroup->addRadio(i18n("English"));
261 syncPrefsGroup->addRadio(i18n("German")); 262 syncPrefsGroup->addRadio(i18n("German"));
262 syncPrefsGroup->addRadio(i18n("French")); 263 syncPrefsGroup->addRadio(i18n("French"));
263 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 264 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
264 if ( QApplication::desktop()->width() < 300 ) 265 if ( QApplication::desktop()->width() < 300 )
265 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 266 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
266 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 267 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
267 ++iii; 268 ++iii;
268 269
269 syncPrefsGroup = 270 syncPrefsGroup =
270 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); 271 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame);
271 if ( QApplication::desktop()->width() > 300 ) 272 if ( QApplication::desktop()->width() > 300 )
272 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 273 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
273 syncPrefsGroup->addRadio(i18n("24:00")); 274 syncPrefsGroup->addRadio(i18n("24:00"));
274 syncPrefsGroup->addRadio(i18n("12:00am")); 275 syncPrefsGroup->addRadio(i18n("12:00am"));
275 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 276 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
276 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 277 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
277 ++iii; 278 ++iii;
278 279
279 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), 280 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"),
280 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); 281 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame);
281 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 282 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
282 ++iii; 283 ++iii;
283 284
284 285
285 tabWidget->addTab( topFrame, i18n( "Locale" ) ); 286 tabWidget->addTab( topFrame, i18n( "Locale" ) );
286 287
287} 288}
288 289
289 290
290void KDEPIMConfigWidget::setupTimeZoneTab() 291void KDEPIMConfigWidget::setupTimeZoneTab()
291{ 292{
292 QWidget *topFrame = new QWidget( this ); 293 QWidget *topFrame = new QWidget( this );
293 QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2); 294 QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2);
294 topLayout->setSpacing(KDialog::spacingHint()); 295 topLayout->setSpacing(KDialog::spacingHint());
295 topLayout->setMargin(KDialog::marginHint()); 296 topLayout->setMargin(KDialog::marginHint());
296 297
297 QHBox *timeZoneBox = new QHBox( topFrame ); 298 QHBox *timeZoneBox = new QHBox( topFrame );
298 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 299 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
299 300
300 new QLabel( i18n("Timezone:"), timeZoneBox ); 301 new QLabel( i18n("Timezone:"), timeZoneBox );
301 mTimeZoneCombo = new QComboBox( timeZoneBox ); 302 mTimeZoneCombo = new QComboBox( timeZoneBox );
302 if ( QApplication::desktop()->width() < 300 ) { 303 if ( QApplication::desktop()->width() < 300 ) {
303 mTimeZoneCombo->setMaximumWidth(150); 304 mTimeZoneCombo->setMaximumWidth(150);
304 } 305 }
305 306
306 QStringList list; 307 QStringList list;
307 list = KGlobal::locale()->timeZoneList(); 308 list = KGlobal::locale()->timeZoneList();
308 mTimeZoneCombo->insertStringList(list); 309 mTimeZoneCombo->insertStringList(list);
309 310
310 // find the currently set time zone and select it 311 // find the currently set time zone and select it
311 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; 312 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId;
312 int nCurrentlySet = 11; 313 int nCurrentlySet = 11;
313 for (int i = 0; i < mTimeZoneCombo->count(); i++) 314 for (int i = 0; i < mTimeZoneCombo->count(); i++)
314 { 315 {
315 if (mTimeZoneCombo->text(i) == sCurrentlySet) 316 if (mTimeZoneCombo->text(i) == sCurrentlySet)
316 { 317 {
317 nCurrentlySet = i; 318 nCurrentlySet = i;
318 break; 319 break;
319 } 320 }
320 } 321 }
321 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 322 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
322 int iii = 1; 323 int iii = 1;
323 KPrefsWidBool *sb = 324 KPrefsWidBool *sb =
324 addWidBool(i18n("Timezone has daylight saving"), 325 addWidBool(i18n("Timezone has daylight saving"),
325 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); 326 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame);
326 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 327 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
327 ++iii; 328 ++iii;
328 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); 329 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
329 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 330 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
330 ++iii; 331 ++iii;
331 lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); 332 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
332 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 333 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
333 ++iii; 334 ++iii;
334 lab = new QLabel( i18n("Daylight start:"), topFrame ); 335 lab = new QLabel( i18n("Daylight start:"), topFrame );
335 topLayout->addWidget(lab, iii,0); 336 topLayout->addWidget(lab, iii,0);
336 mStartDateSavingEdit = new KDateEdit(topFrame); 337 mStartDateSavingEdit = new KDateEdit(topFrame);
337 topLayout->addWidget(mStartDateSavingEdit, iii,1); 338 topLayout->addWidget(mStartDateSavingEdit, iii,1);
338 ++iii; 339 ++iii;
339 340
340 lab = new QLabel( i18n("Daylight end:"), topFrame ); 341 lab = new QLabel( i18n("Daylight end:"), topFrame );
341 topLayout->addWidget(lab, iii,0); 342 topLayout->addWidget(lab, iii,0);
342 mEndDateSavingEdit = new KDateEdit(topFrame); 343 mEndDateSavingEdit = new KDateEdit(topFrame);
343 topLayout->addWidget(mEndDateSavingEdit, iii,1); 344 topLayout->addWidget(mEndDateSavingEdit, iii,1);
344 ++iii; 345 ++iii;
345 QDate current ( 2001, 1,1); 346 QDate current ( 2001, 1,1);
346 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); 347 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1));
347 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); 348 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1));
348 349
349 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 350 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
350 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 351 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
351 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); 352 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) );
352 353
353 354
354 355
355 tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); 356 tabWidget->addTab( topFrame, i18n( "Time Zone" ) );
356 357
357} 358}
358 359
359void KDEPIMConfigWidget::externalapp_changed( int newApp ) 360void KDEPIMConfigWidget::externalapp_changed( int newApp )
360{ 361{
361 // first store the current data 362 // first store the current data
362 saveEditFieldSettings(); 363 saveEditFieldSettings();
363 364
364 // set mCurrentApp 365 // set mCurrentApp
365 mCurrentApp = (ExternalAppHandler::Types)newApp; 366 mCurrentApp = (ExternalAppHandler::Types)newApp;
366 367
367 // set mCurrentClient 368 // set mCurrentClient
368 switch(mCurrentApp) 369 switch(mCurrentApp)
369 { 370 {
370 case(ExternalAppHandler::EMAIL): 371 case(ExternalAppHandler::EMAIL):
371 mCurrentClient = mEmailClient; 372 mCurrentClient = mEmailClient;
372 break; 373 break;
373 case(ExternalAppHandler::PHONE): 374 case(ExternalAppHandler::PHONE):
374 mCurrentClient = mPhoneClient; 375 mCurrentClient = mPhoneClient;
375 break; 376 break;
376 case(ExternalAppHandler::SMS): 377 case(ExternalAppHandler::SMS):
377 mCurrentClient = mSMSClient; 378 mCurrentClient = mSMSClient;
378 break; 379 break;
379 case(ExternalAppHandler::FAX): 380 case(ExternalAppHandler::FAX):
380 mCurrentClient = mFaxClient; 381 mCurrentClient = mFaxClient;
381 break; 382 break;
382 case(ExternalAppHandler::PAGER): 383 case(ExternalAppHandler::PAGER):
383 mCurrentClient = mPagerClient; 384 mCurrentClient = mPagerClient;
384 break; 385 break;
385 case(ExternalAppHandler::SIP): 386 case(ExternalAppHandler::SIP):
386 mCurrentClient = mSipClient; 387 mCurrentClient = mSipClient;
387 break; 388 break;
388 default: 389 default:
389 return; 390 return;
390 } 391 }
391 392
392 // and at last update the widgets 393 // and at last update the widgets
393 updateClientWidgets(); 394 updateClientWidgets();
394} 395}
395 396
396 397
397 398
398void KDEPIMConfigWidget::client_changed( int newClient ) 399void KDEPIMConfigWidget::client_changed( int newClient )
399{ 400{
400 if (newClient == mCurrentClient) 401 if (newClient == mCurrentClient)
401 return; 402 return;
402 403
403 // first store the current data 404 // first store the current data
404 saveEditFieldSettings(); 405 saveEditFieldSettings();
405 406
406 407
407 //then reset the clientvariable 408 //then reset the clientvariable
408 mCurrentClient = newClient; 409 mCurrentClient = newClient;
409 410
410 // and at last update the widgets 411 // and at last update the widgets
411 updateClientWidgets(); 412 updateClientWidgets();
412 413
413 KPrefsWidget::modified(); 414 KPrefsWidget::modified();
414} 415}
415 416
416void KDEPIMConfigWidget::saveEditFieldSettings() 417void KDEPIMConfigWidget::saveEditFieldSettings()
417{ 418{
418 419
419 switch(mCurrentApp) 420 switch(mCurrentApp)
420 { 421 {
421 case(ExternalAppHandler::EMAIL): 422 case(ExternalAppHandler::EMAIL):
422 mEmailClient = mClient->currentItem(); 423 mEmailClient = mClient->currentItem();
423 break; 424 break;
424 case(ExternalAppHandler::PHONE): 425 case(ExternalAppHandler::PHONE):
425 mPhoneClient= mClient->currentItem(); 426 mPhoneClient= mClient->currentItem();
426 break; 427 break;
427 case(ExternalAppHandler::SMS): 428 case(ExternalAppHandler::SMS):
428 mSMSClient = mClient->currentItem(); 429 mSMSClient = mClient->currentItem();
429 break; 430 break;
430 case(ExternalAppHandler::FAX): 431 case(ExternalAppHandler::FAX):
431 mFaxClient = mClient->currentItem(); 432 mFaxClient = mClient->currentItem();
432 break; 433 break;
433 case(ExternalAppHandler::PAGER): 434 case(ExternalAppHandler::PAGER):
434 mPagerClient = mClient->currentItem(); 435 mPagerClient = mClient->currentItem();
435 break; 436 break;
436 case(ExternalAppHandler::SIP): 437 case(ExternalAppHandler::SIP):
437 mSipClient = mClient->currentItem(); 438 mSipClient = mClient->currentItem();
438 break; 439 break;
439 default: 440 default:
440 return; 441 return;
441 } 442 }
442 443
443 //store the current data back to the apropriate membervariables if we had set it to "other" 444 //store the current data back to the apropriate membervariables if we had set it to "other"
444 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 445 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
445 { 446 {
446 mEmailOtherChannel = mChannel->text(); 447 mEmailOtherChannel = mChannel->text();
447 mEmailOtherMessage = mMessage->text(); 448 mEmailOtherMessage = mMessage->text();
448 mEmailOtherMessageParameters = mParameters->text(); 449 mEmailOtherMessageParameters = mParameters->text();
449 mEmailOtherMessage2 = mMessage2->text(); 450 mEmailOtherMessage2 = mMessage2->text();
450 mEmailOtherMessageParameters2 = mParameters2->text(); 451 mEmailOtherMessageParameters2 = mParameters2->text();
451 } 452 }
452 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 453 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
453 { 454 {
454 mPhoneOtherChannel = mChannel->text(); 455 mPhoneOtherChannel = mChannel->text();
455 mPhoneOtherMessage = mMessage->text(); 456 mPhoneOtherMessage = mMessage->text();
456 mPhoneOtherMessageParameters = mParameters->text(); 457 mPhoneOtherMessageParameters = mParameters->text();
457 } 458 }
458 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 459 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
459 { 460 {
460 mSMSOtherChannel = mChannel->text(); 461 mSMSOtherChannel = mChannel->text();
461 mSMSOtherMessage = mMessage->text(); 462 mSMSOtherMessage = mMessage->text();
462 mSMSOtherMessageParameters = mParameters->text(); 463 mSMSOtherMessageParameters = mParameters->text();
463 } 464 }
464 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 465 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
465 { 466 {
466 mFaxOtherChannel = mChannel->text(); 467 mFaxOtherChannel = mChannel->text();
467 mFaxOtherMessage = mMessage->text(); 468 mFaxOtherMessage = mMessage->text();
468 mFaxOtherMessageParameters = mParameters->text(); 469 mFaxOtherMessageParameters = mParameters->text();
469 } 470 }
470 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 471 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
471 { 472 {
472 mPagerOtherChannel = mChannel->text(); 473 mPagerOtherChannel = mChannel->text();
473 mPagerOtherMessage = mMessage->text(); 474 mPagerOtherMessage = mMessage->text();
474 mPagerOtherMessageParameters = mParameters->text(); 475 mPagerOtherMessageParameters = mParameters->text();
475 } 476 }
476 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) 477 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))
477 { 478 {
478 mSipOtherChannel = mChannel->text(); 479 mSipOtherChannel = mChannel->text();
479 mSipOtherMessage = mMessage->text(); 480 mSipOtherMessage = mMessage->text();
480 mSipOtherMessageParameters = mParameters->text(); 481 mSipOtherMessageParameters = mParameters->text();
481 } 482 }
482 483
483 484
484} 485}
485 486
486void KDEPIMConfigWidget::updateClientWidgets() 487void KDEPIMConfigWidget::updateClientWidgets()
487{ 488{
488 bool blocked = signalsBlocked(); 489 bool blocked = signalsBlocked();
489 blockSignals( true ); 490 blockSignals( true );
490 491
491 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display 492 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display
492 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); 493 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp );
493 if (it == mExternalAppsMap.end()) 494 if (it == mExternalAppsMap.end())
494 return; 495 return;
495 496
496 // update group box 497 // update group box
497 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); 498 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data()));
498 499
499 //update the entries in the client combobox 500 //update the entries in the client combobox
500 mClient->clear(); 501 mClient->clear();
501 502
502 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); 503 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp);
503 DefaultAppItem* dai; 504 DefaultAppItem* dai;
504 for ( dai=items.first(); dai != 0; dai=items.next() ) 505 for ( dai=items.first(); dai != 0; dai=items.next() )
505 { 506 {
506 mClient->insertItem( i18n(dai->_label), dai->_id ); 507 mClient->insertItem( i18n(dai->_label), dai->_id );
507 508
508 if (dai->_id == mCurrentClient) 509 if (dai->_id == mCurrentClient)
509 { 510 {
510 //restore the edit fields with the data of the local membervariables if we had set it to "other". 511 //restore the edit fields with the data of the local membervariables if we had set it to "other".
511 //Otherwise take the default data from externalapphandler. 512 //Otherwise take the default data from externalapphandler.
512 mChannel->setText(dai->_channel); 513 mChannel->setText(dai->_channel);
513 mMessage->setText(dai->_message); 514 mMessage->setText(dai->_message);
514 mParameters->setText(dai->_parameters); 515 mParameters->setText(dai->_parameters);
515 mMessage2->setText(dai->_message2); 516 mMessage2->setText(dai->_message2);
516 mParameters2->setText(dai->_parameters2); 517 mParameters2->setText(dai->_parameters2);
517 518
518 519
519 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 520 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
520 { 521 {
521 mChannel->setText(mEmailOtherChannel); 522 mChannel->setText(mEmailOtherChannel);
522 mMessage->setText(mEmailOtherMessage); 523 mMessage->setText(mEmailOtherMessage);
523 mParameters->setText(mEmailOtherMessageParameters); 524 mParameters->setText(mEmailOtherMessageParameters);
524 mMessage2->setText(mEmailOtherMessage2); 525 mMessage2->setText(mEmailOtherMessage2);
525 mParameters2->setText(mEmailOtherMessageParameters2); 526 mParameters2->setText(mEmailOtherMessageParameters2);
526 } 527 }
527 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 528 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
528 { 529 {
529 mChannel->setText(mPhoneOtherChannel); 530 mChannel->setText(mPhoneOtherChannel);
530 mMessage->setText(mPhoneOtherMessage); 531 mMessage->setText(mPhoneOtherMessage);
531 mParameters->setText(mPhoneOtherMessageParameters); 532 mParameters->setText(mPhoneOtherMessageParameters);
532 } 533 }
533 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 534 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
534 { 535 {
535 mChannel->setText(mSMSOtherChannel); 536 mChannel->setText(mSMSOtherChannel);
536 mMessage->setText(mSMSOtherMessage); 537 mMessage->setText(mSMSOtherMessage);
537 mParameters->setText(mSMSOtherMessageParameters); 538 mParameters->setText(mSMSOtherMessageParameters);
538 } 539 }
539 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 540 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
540 { 541 {
541 mChannel->setText(mFaxOtherChannel); 542 mChannel->setText(mFaxOtherChannel);
542 mMessage->setText(mFaxOtherMessage); 543 mMessage->setText(mFaxOtherMessage);
543 mParameters->setText(mFaxOtherMessageParameters); 544 mParameters->setText(mFaxOtherMessageParameters);
544 } 545 }
545 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 546 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
546 { 547 {
547 mChannel->setText(mPagerOtherChannel); 548 mChannel->setText(mPagerOtherChannel);
548 mMessage->setText(mPagerOtherMessage); 549 mMessage->setText(mPagerOtherMessage);
549 mParameters->setText(mPagerOtherMessageParameters); 550 mParameters->setText(mPagerOtherMessageParameters);
550 } 551 }
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index a896a0f..b2b7663 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -1,132 +1,133 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <kglobal.h> 31#include <kglobal.h>
32#include <kconfig.h> 32#include <kconfig.h>
33#include <klocale.h> 33#include <klocale.h>
34#include <kdebug.h> 34#include <kdebug.h>
35#include <kstaticdeleter.h> 35#include <kstaticdeleter.h>
36 36
37#include <qregexp.h>
37#include "kpimglobalprefs.h" 38#include "kpimglobalprefs.h"
38 39
39KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; 40KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0;
40static KStaticDeleter<KPimGlobalPrefs> staticDeleter; 41static KStaticDeleter<KPimGlobalPrefs> staticDeleter;
41 42
42 43
43KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) 44KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
44 : KPrefs("microkdeglobalrc") 45 : KPrefs("microkdeglobalrc")
45{ 46{
46 47
47 KPrefs::setCurrentGroup("Locale"); 48 KPrefs::setCurrentGroup("Locale");
48 addItemInt("PreferredLanguage",&mPreferredLanguage,0); 49 addItemInt("PreferredLanguage",&mPreferredLanguage,0);
49 addItemInt("PreferredTime",&mPreferredTime,0); 50 addItemInt("PreferredTime",&mPreferredTime,0);
50 addItemInt("PreferredDate",&mPreferredDate,0); 51 addItemInt("PreferredDate",&mPreferredDate,0);
51 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); 52 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false);
52 //addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false); 53 //addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false);
53 // addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 54 // addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
54 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); 55 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y");
55 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); 56 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y");
56 57
57 KPrefs::setCurrentGroup("Time & Date"); 58 KPrefs::setCurrentGroup("Time & Date");
58 59
59 addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") ); 60 addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") );
60 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); 61 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true);
61 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); 62 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90);
62 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); 63 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304);
63 64
64 65
65 66
66 67
67 KPrefs::setCurrentGroup( "ExternalApplications" ); 68 KPrefs::setCurrentGroup( "ExternalApplications" );
68 69
69 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC ); 70 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC );
70 addItemString( "EmailChannel", &mEmailOtherChannel, "" ); 71 addItemString( "EmailChannel", &mEmailOtherChannel, "" );
71 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); 72 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" );
72 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); 73 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" );
73 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" ); 74 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" );
74 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" ); 75 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" );
75 76
76 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC ); 77 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC );
77 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" ); 78 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" );
78 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" ); 79 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" );
79 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" ); 80 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" );
80 81
81 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC ); 82 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC );
82 addItemString( "FaxChannel", &mFaxOtherChannel, "" ); 83 addItemString( "FaxChannel", &mFaxOtherChannel, "" );
83 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" ); 84 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" );
84 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" ); 85 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" );
85 86
86 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC ); 87 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC );
87 addItemString( "SMSChannel", &mSMSOtherChannel, "" ); 88 addItemString( "SMSChannel", &mSMSOtherChannel, "" );
88 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" ); 89 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" );
89 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" ); 90 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" );
90 91
91 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); 92 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC );
92 addItemString( "PagerChannel", &mPagerOtherChannel, "" ); 93 addItemString( "PagerChannel", &mPagerOtherChannel, "" );
93 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); 94 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" );
94 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); 95 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" );
95 96
96 addItemInt( "SIPChannelType", &mSipClient, NONE_SIC ); 97 addItemInt( "SIPChannelType", &mSipClient, NONE_SIC );
97 addItemString( "SIPChannel", &mSipOtherChannel, "" ); 98 addItemString( "SIPChannel", &mSipOtherChannel, "" );
98 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); 99 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" );
99 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); 100 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" );
100 101
101} 102}
102 103
103void KPimGlobalPrefs::setGlobalConfig() 104void KPimGlobalPrefs::setGlobalConfig()
104{ 105{
105 106
106 KGlobal::locale()->setHore24Format( !mPreferredTime ); 107 KGlobal::locale()->setHore24Format( !mPreferredTime );
107 KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday ); 108 KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday );
108 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate ); 109 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate );
109 KGlobal::locale()->setLanguage( mPreferredLanguage ); 110 KGlobal::locale()->setLanguage( mPreferredLanguage );
110 QString dummy = mUserDateFormatLong; 111 QString dummy = mUserDateFormatLong;
111 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); 112 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
112 dummy = mUserDateFormatShort; 113 dummy = mUserDateFormatShort;
113 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); 114 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
114 KGlobal::locale()->setDaylightSaving( mUseDaylightsaving, 115 KGlobal::locale()->setDaylightSaving( mUseDaylightsaving,
115 mDaylightsavingStart, 116 mDaylightsavingStart,
116 mDaylightsavingEnd ); 117 mDaylightsavingEnd );
117 KGlobal::locale()->setTimezone( mTimeZoneId ); 118 KGlobal::locale()->setTimezone( mTimeZoneId );
118 119
119} 120}
120KPimGlobalPrefs::~KPimGlobalPrefs() 121KPimGlobalPrefs::~KPimGlobalPrefs()
121{ 122{
122} 123}
123 124
124KPimGlobalPrefs *KPimGlobalPrefs::instance() 125KPimGlobalPrefs *KPimGlobalPrefs::instance()
125{ 126{
126 if ( !sInstance ) { 127 if ( !sInstance ) {
127 sInstance = staticDeleter.setObject( new KPimGlobalPrefs() ); 128 sInstance = staticDeleter.setObject( new KPimGlobalPrefs() );
128 sInstance->readConfig(); 129 sInstance->readConfig();
129 } 130 }
130 131
131 return sInstance; 132 return sInstance;
132} 133}
diff --git a/libkdepim/kprefswidget.h b/libkdepim/kprefswidget.h
index 8a24515..8543a39 100644
--- a/libkdepim/kprefswidget.h
+++ b/libkdepim/kprefswidget.h
@@ -1,454 +1,455 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23// $Id$ 23// $Id$
24 24
25#ifndef _KPREFSWIDGET_H 25#ifndef _KPREFSWIDGET_H
26#define _KPREFSWIDGET_H 26#define _KPREFSWIDGET_H
27 27
28#include <qptrlist.h> 28#include <qptrlist.h>
29#include <qlineedit.h> 29#include <qlineedit.h>
30#include <qpushbutton.h>
30 31
31#include <qwidget.h> 32#include <qwidget.h>
32 33
33class KPrefs; 34class KPrefs;
34 35
35class KColorButton; 36class KColorButton;
36class QCheckBox; 37class QCheckBox;
37class QLabel; 38class QLabel;
38class QSpinBox; 39class QSpinBox;
39class QButtonGroup; 40class QButtonGroup;
40 41
41/** 42/**
42 @short Base class for widgets used by @ref KPrefsDialog. 43 @short Base class for widgets used by @ref KPrefsDialog.
43 @author Cornelius Schumacher 44 @author Cornelius Schumacher
44 @see KPrefsDialog 45 @see KPrefsDialog
45 46
46 This class provides the interface for the preferences widgets used by 47 This class provides the interface for the preferences widgets used by
47 KPrefsDialog. 48 KPrefsDialog.
48*/ 49*/
49class KPrefsWid : public QObject 50class KPrefsWid : public QObject
50{ 51{
51 Q_OBJECT 52 Q_OBJECT
52 public: 53 public:
53 /** 54 /**
54 This function is called to read value of the setting from the 55 This function is called to read value of the setting from the
55 stored configuration and display it in the widget. 56 stored configuration and display it in the widget.
56 */ 57 */
57 virtual void readConfig() = 0; 58 virtual void readConfig() = 0;
58 /** 59 /**
59 This function is called to write the current setting of the widget to the 60 This function is called to write the current setting of the widget to the
60 stored configuration. 61 stored configuration.
61 */ 62 */
62 virtual void writeConfig() = 0; 63 virtual void writeConfig() = 0;
63 64
64 //connect to this signal if you want to be notified of changes 65 //connect to this signal if you want to be notified of changes
65 signals: 66 signals:
66 void modified(); 67 void modified();
67 68
68}; 69};
69 70
70/** 71/**
71 @short Widget for bool settings in @ref KPrefsDialog. 72 @short Widget for bool settings in @ref KPrefsDialog.
72 73
73 This class provides a widget for configuring bool values. It is meant to be 74 This class provides a widget for configuring bool values. It is meant to be
74 used by KPrefsDialog. The user is responsible for the layout management. 75 used by KPrefsDialog. The user is responsible for the layout management.
75*/ 76*/
76class KPrefsWidBool : public KPrefsWid 77class KPrefsWidBool : public KPrefsWid
77{ 78{
78 public: 79 public:
79 /** 80 /**
80 Create a bool widget consisting of a QCheckbox. 81 Create a bool widget consisting of a QCheckbox.
81 82
82 @param text Text of QCheckBox. 83 @param text Text of QCheckBox.
83 @param reference Pointer to variable read and written by this widget. 84 @param reference Pointer to variable read and written by this widget.
84 @param parent Parent widget. 85 @param parent Parent widget.
85 */ 86 */
86 KPrefsWidBool(const QString &text,bool *reference,QWidget *parent); 87 KPrefsWidBool(const QString &text,bool *reference,QWidget *parent);
87 88
88 /** 89 /**
89 Return the QCheckbox used by this widget. 90 Return the QCheckbox used by this widget.
90 */ 91 */
91 QCheckBox *checkBox(); 92 QCheckBox *checkBox();
92 93
93 void readConfig(); 94 void readConfig();
94 void writeConfig(); 95 void writeConfig();
95 96
96 private: 97 private:
97 bool *mReference; 98 bool *mReference;
98 99
99 QCheckBox *mCheck; 100 QCheckBox *mCheck;
100}; 101};
101 102
102/** 103/**
103 @short Widget for time settings in @ref KPrefsDialog. 104 @short Widget for time settings in @ref KPrefsDialog.
104 105
105 This class provides a widget for configuring time values. It is meant to be 106 This class provides a widget for configuring time values. It is meant to be
106 used by KPrefsDialog. The user is responsible for the layout management. 107 used by KPrefsDialog. The user is responsible for the layout management.
107*/ 108*/
108class KPrefsWidTime : public KPrefsWid 109class KPrefsWidTime : public KPrefsWid
109{ 110{
110 public: 111 public:
111 /** 112 /**
112 Create a time widget consisting of a label and a spinbox. 113 Create a time widget consisting of a label and a spinbox.
113 114
114 @param text Text of Label. 115 @param text Text of Label.
115 @param reference Pointer to variable read and written by this widget. 116 @param reference Pointer to variable read and written by this widget.
116 @param parent Parent widget. 117 @param parent Parent widget.
117 */ 118 */
118 KPrefsWidTime(const QString &text,int *reference,QWidget *parent); 119 KPrefsWidTime(const QString &text,int *reference,QWidget *parent);
119 120
120 /** 121 /**
121 Return QLabel used by this widget. 122 Return QLabel used by this widget.
122 */ 123 */
123 QLabel *label(); 124 QLabel *label();
124 /** 125 /**
125 Return QSpinBox used by this widget. 126 Return QSpinBox used by this widget.
126 */ 127 */
127 QSpinBox *spinBox(); 128 QSpinBox *spinBox();
128 129
129 void readConfig(); 130 void readConfig();
130 void writeConfig(); 131 void writeConfig();
131 132
132 private: 133 private:
133 int *mReference; 134 int *mReference;
134 135
135 QLabel *mLabel; 136 QLabel *mLabel;
136 QSpinBox *mSpin; 137 QSpinBox *mSpin;
137}; 138};
138 139
139/** 140/**
140 @short Widget for color settings in @ref KPrefsDialog. 141 @short Widget for color settings in @ref KPrefsDialog.
141 142
142 This class provides a widget for configuring color values. It is meant to be 143 This class provides a widget for configuring color values. It is meant to be
143 used by KPrefsDialog. The user is responsible for the layout management. 144 used by KPrefsDialog. The user is responsible for the layout management.
144*/ 145*/
145class KPrefsWidColor : public KPrefsWid 146class KPrefsWidColor : public KPrefsWid
146{ 147{
147 public: 148 public:
148 /** 149 /**
149 Create a color widget consisting of a test field and a button for opening 150 Create a color widget consisting of a test field and a button for opening
150 a color dialog. 151 a color dialog.
151 152
152 @param text Text of button. 153 @param text Text of button.
153 @param reference Pointer to variable read and written by this widget. 154 @param reference Pointer to variable read and written by this widget.
154 @param parent Parent widget. 155 @param parent Parent widget.
155 */ 156 */
156 KPrefsWidColor(const QString &text,QColor *reference,QWidget *parent); 157 KPrefsWidColor(const QString &text,QColor *reference,QWidget *parent);
157 /** 158 /**
158 Destruct color setting widget. 159 Destruct color setting widget.
159 */ 160 */
160 ~KPrefsWidColor(); 161 ~KPrefsWidColor();
161 162
162 /** 163 /**
163 Return QLabel for the button 164 Return QLabel for the button
164 */ 165 */
165 QLabel *label(); 166 QLabel *label();
166 /** 167 /**
167 Return button opening the color dialog. 168 Return button opening the color dialog.
168 */ 169 */
169 KColorButton *button(); 170 KColorButton *button();
170 171
171 void readConfig(); 172 void readConfig();
172 void writeConfig(); 173 void writeConfig();
173 174
174 private: 175 private:
175 QColor *mReference; 176 QColor *mReference;
176 177
177 QLabel *mLabel; 178 QLabel *mLabel;
178 KColorButton *mButton; 179 KColorButton *mButton;
179}; 180};
180 181
181/** 182/**
182 @short Widget for font settings in @ref KPrefsDialog. 183 @short Widget for font settings in @ref KPrefsDialog.
183 184
184 This class provides a widget for configuring font values. It is meant to be 185 This class provides a widget for configuring font values. It is meant to be
185 used by KPrefsDialog. The user is responsible for the layout management. 186 used by KPrefsDialog. The user is responsible for the layout management.
186*/ 187*/
187class KPrefsWidFont : public KPrefsWid 188class KPrefsWidFont : public KPrefsWid
188{ 189{
189 Q_OBJECT 190 Q_OBJECT
190 public: 191 public:
191 /** 192 /**
192 Create a font widget consisting of a test field and a button for opening 193 Create a font widget consisting of a test field and a button for opening
193 a font dialog. 194 a font dialog.
194 195
195 @param label Text of label. 196 @param label Text of label.
196 @param reference Pointer to variable read and written by this widget. 197 @param reference Pointer to variable read and written by this widget.
197 @param parent Parent widget. 198 @param parent Parent widget.
198 */ 199 */
199 KPrefsWidFont(const QString &sampleText,const QString &labelText, 200 KPrefsWidFont(const QString &sampleText,const QString &labelText,
200 QFont *reference,QWidget *parent); 201 QFont *reference,QWidget *parent);
201 /** 202 /**
202 Destruct font setting widget. 203 Destruct font setting widget.
203 */ 204 */
204 ~KPrefsWidFont(); 205 ~KPrefsWidFont();
205 206
206 /** 207 /**
207 Return label. 208 Return label.
208 */ 209 */
209 QLabel *label(); 210 QLabel *label();
210 /** 211 /**
211 Return QFrame used as preview field. 212 Return QFrame used as preview field.
212 */ 213 */
213 QLabel *preview(); 214 QLabel *preview();
214 /** 215 /**
215 Return button opening the font dialog. 216 Return button opening the font dialog.
216 */ 217 */
217 QPushButton *button(); 218 QPushButton *button();
218 219
219 void readConfig(); 220 void readConfig();
220 void writeConfig(); 221 void writeConfig();
221 222
222 protected slots: 223 protected slots:
223 void selectFont(); 224 void selectFont();
224 225
225 private: 226 private:
226 QFont *mReference; 227 QFont *mReference;
227 228
228 QLabel *mLabel; 229 QLabel *mLabel;
229 QLabel *mPreview; 230 QLabel *mPreview;
230 QPushButton *mButton; 231 QPushButton *mButton;
231}; 232};
232 233
233/** 234/**
234 @short Widget for settings represented by a group of radio buttons in 235 @short Widget for settings represented by a group of radio buttons in
235 @ref KPrefsDialog. 236 @ref KPrefsDialog.
236 237
237 This class provides a widget for configuring selections. It is meant to be 238 This class provides a widget for configuring selections. It is meant to be
238 used by KPrefsDialog. The user is responsible for the layout management. The 239 used by KPrefsDialog. The user is responsible for the layout management. The
239 setting is interpreted as an int value, corresponding to the position of the 240 setting is interpreted as an int value, corresponding to the position of the
240 radio button. The position of the button is defined by the sequence of @ref 241 radio button. The position of the button is defined by the sequence of @ref
241 addRadio() calls, starting with 0. 242 addRadio() calls, starting with 0.
242*/ 243*/
243class KPrefsWidRadios : public KPrefsWid 244class KPrefsWidRadios : public KPrefsWid
244{ 245{
245 public: 246 public:
246 /** 247 /**
247 Create a widget for selection of an option. It consists of a box with 248 Create a widget for selection of an option. It consists of a box with
248 several radio buttons. 249 several radio buttons.
249 250
250 @param text Text of main box. 251 @param text Text of main box.
251 @param reference Pointer to variable read and written by this widget. 252 @param reference Pointer to variable read and written by this widget.
252 @param parent Parent widget. 253 @param parent Parent widget.
253 */ 254 */
254 KPrefsWidRadios(const QString &text,int *reference,QWidget *parent); 255 KPrefsWidRadios(const QString &text,int *reference,QWidget *parent);
255 virtual ~KPrefsWidRadios(); 256 virtual ~KPrefsWidRadios();
256 257
257 /** 258 /**
258 Add a radio button. 259 Add a radio button.
259 260
260 @param text Text of the button. 261 @param text Text of the button.
261 */ 262 */
262 void addRadio(const QString &text); 263 void addRadio(const QString &text);
263 264
264 /** 265 /**
265 Return the box widget used by this widget. 266 Return the box widget used by this widget.
266 */ 267 */
267 QButtonGroup *groupBox(); 268 QButtonGroup *groupBox();
268 269
269 void readConfig(); 270 void readConfig();
270 void writeConfig(); 271 void writeConfig();
271 272
272 private: 273 private:
273 int *mReference; 274 int *mReference;
274 275
275 QButtonGroup *mBox; 276 QButtonGroup *mBox;
276}; 277};
277 278
278 279
279/** 280/**
280 @short Widget for string settings in @ref KPrefsDialog. 281 @short Widget for string settings in @ref KPrefsDialog.
281 282
282 This class provides a widget for configuring string values. It is meant to be 283 This class provides a widget for configuring string values. It is meant to be
283 used by KPrefsDialog. The user is responsible for the layout management. 284 used by KPrefsDialog. The user is responsible for the layout management.
284*/ 285*/
285class KPrefsWidString : public KPrefsWid 286class KPrefsWidString : public KPrefsWid
286{ 287{
287 public: 288 public:
288 /** 289 /**
289 Create a string widget consisting of a test label and a line edit. 290 Create a string widget consisting of a test label and a line edit.
290 291
291 @param text Text of label. 292 @param text Text of label.
292 @param reference Pointer to variable read and written by this widget. 293 @param reference Pointer to variable read and written by this widget.
293 @param parent Parent widget. 294 @param parent Parent widget.
294 */ 295 */
295 KPrefsWidString(const QString &text,QString *reference,QWidget *parent,QLineEdit::EchoMode echomode=QLineEdit::Normal); 296 KPrefsWidString(const QString &text,QString *reference,QWidget *parent,QLineEdit::EchoMode echomode=QLineEdit::Normal);
296 /** 297 /**
297 Destructor. 298 Destructor.
298 */ 299 */
299 virtual ~KPrefsWidString(); 300 virtual ~KPrefsWidString();
300 301
301 /** 302 /**
302 Return label used by this widget. 303 Return label used by this widget.
303 */ 304 */
304 QLabel *label(); 305 QLabel *label();
305 /** 306 /**
306 Return QLineEdit used by this widget. 307 Return QLineEdit used by this widget.
307 */ 308 */
308 QLineEdit *lineEdit(); 309 QLineEdit *lineEdit();
309 310
310 void readConfig(); 311 void readConfig();
311 void writeConfig(); 312 void writeConfig();
312 313
313 private: 314 private:
314 QString *mReference; 315 QString *mReference;
315 316
316 QLabel *mLabel; 317 QLabel *mLabel;
317 QLineEdit *mEdit; 318 QLineEdit *mEdit;
318}; 319};
319 320
320 321
321/** 322/**
322 @short Base class for a preferences widget. 323 @short Base class for a preferences widget.
323 324
324 This class provides the framework for a preferences widget. You have to 325 This class provides the framework for a preferences widget. You have to
325 subclass it and add the code to create the actual configuration widgets and 326 subclass it and add the code to create the actual configuration widgets and
326 do the layout management. 327 do the layout management.
327 328
328 KPrefsWidget provides functions to add subclasses of @ref KPrefsWid. For 329 KPrefsWidget provides functions to add subclasses of @ref KPrefsWid. For
329 these widgets the reading, writing and setting to default values is handled 330 these widgets the reading, writing and setting to default values is handled
330 automatically. Custom widgets have to be handled in the functions @ref 331 automatically. Custom widgets have to be handled in the functions @ref
331 usrReadConfig() and @ref usrWriteConfig(). 332 usrReadConfig() and @ref usrWriteConfig().
332*/ 333*/
333class KPrefsWidget : public QWidget 334class KPrefsWidget : public QWidget
334{ 335{
335 Q_OBJECT 336 Q_OBJECT
336 public: 337 public:
337 /** 338 /**
338 Create a KPrefsDialog for a KPrefs object. 339 Create a KPrefsDialog for a KPrefs object.
339 340
340 @param prefs KPrefs object used to access te configuration. 341 @param prefs KPrefs object used to access te configuration.
341 @param parent Parent widget. 342 @param parent Parent widget.
342 @param name Widget name. 343 @param name Widget name.
343 */ 344 */
344 KPrefsWidget(KPrefs *prefs,QWidget *parent=0,const char *name=0); 345 KPrefsWidget(KPrefs *prefs,QWidget *parent=0,const char *name=0);
345 /** 346 /**
346 Destructor. 347 Destructor.
347 */ 348 */
348 virtual ~KPrefsWidget(); 349 virtual ~KPrefsWidget();
349 350
350 /** 351 /**
351 Register a custom KPrefsWid object. 352 Register a custom KPrefsWid object.
352 */ 353 */
353 void addWid(KPrefsWid *); 354 void addWid(KPrefsWid *);
354 /** 355 /**
355 Register a @ref KPrefsWidBool object. 356 Register a @ref KPrefsWidBool object.
356 357
357 @param text Text of bool widget. 358 @param text Text of bool widget.
358 @param reference Reference to variable storing the setting. 359 @param reference Reference to variable storing the setting.
359 @param parent Parent widget. 360 @param parent Parent widget.
360 */ 361 */
361 KPrefsWidBool *addWidBool(const QString &text,bool *reference,QWidget *parent); 362 KPrefsWidBool *addWidBool(const QString &text,bool *reference,QWidget *parent);
362 /** 363 /**
363 Register a @ref KPrefsWidTime object. 364 Register a @ref KPrefsWidTime object.
364 365
365 @param text Text of time widget. 366 @param text Text of time widget.
366 @param reference Reference to variable storing the setting. 367 @param reference Reference to variable storing the setting.
367 @param parent Parent widget. 368 @param parent Parent widget.
368 */ 369 */
369 KPrefsWidTime *addWidTime(const QString &text,int *reference,QWidget *parent); 370 KPrefsWidTime *addWidTime(const QString &text,int *reference,QWidget *parent);
370 /** 371 /**
371 Register a @ref KPrefsWidColor object. 372 Register a @ref KPrefsWidColor object.
372 373
373 @param text Text of color widget. 374 @param text Text of color widget.
374 @param reference Reference to variable storing the setting. 375 @param reference Reference to variable storing the setting.
375 @param parent Parent widget. 376 @param parent Parent widget.
376 */ 377 */
377 KPrefsWidColor *addWidColor(const QString &text,QColor *reference,QWidget *parent); 378 KPrefsWidColor *addWidColor(const QString &text,QColor *reference,QWidget *parent);
378 /** 379 /**
379 Register a @ref KPrefsWidRadios object. 380 Register a @ref KPrefsWidRadios object.
380 381
381 @param text Text of radio button box widget. 382 @param text Text of radio button box widget.
382 @param reference Reference to variable storing the setting. 383 @param reference Reference to variable storing the setting.
383 @param parent Parent widget. 384 @param parent Parent widget.
384 */ 385 */
385 KPrefsWidRadios *addWidRadios(const QString &text,int *reference,QWidget *parent); 386 KPrefsWidRadios *addWidRadios(const QString &text,int *reference,QWidget *parent);
386 /** 387 /**
387 Register a @ref KPrefsWidString object. 388 Register a @ref KPrefsWidString object.
388 389
389 @param text Text of string widget. 390 @param text Text of string widget.
390 @param reference Reference to variable storing the setting. 391 @param reference Reference to variable storing the setting.
391 @param parent Parent widget. 392 @param parent Parent widget.
392 */ 393 */
393 KPrefsWidString *addWidString(const QString &text,QString *reference,QWidget *parent); 394 KPrefsWidString *addWidString(const QString &text,QString *reference,QWidget *parent);
394 /** 395 /**
395 Register a password @ref KPrefsWidString object, with echomode set to QLineEdit::Password. 396 Register a password @ref KPrefsWidString object, with echomode set to QLineEdit::Password.
396 397
397 @param text Text of string widget. 398 @param text Text of string widget.
398 @param reference Reference to variable storing the setting. 399 @param reference Reference to variable storing the setting.
399 @param parent Parent widget. 400 @param parent Parent widget.
400 */ 401 */
401 KPrefsWidString *addWidPassword (const QString &text,QString *reference,QWidget *parent); 402 KPrefsWidString *addWidPassword (const QString &text,QString *reference,QWidget *parent);
402 /** 403 /**
403 Register a @ref KPrefsWidFont object. 404 Register a @ref KPrefsWidFont object.
404 405
405 @param sampleText Sample text of font widget. 406 @param sampleText Sample text of font widget.
406 @param buttonText Button text of font widget. 407 @param buttonText Button text of font widget.
407 @param reference Reference to variable storing the setting. 408 @param reference Reference to variable storing the setting.
408 @param parent Parent widget. 409 @param parent Parent widget.
409 */ 410 */
410 KPrefsWidFont *addWidFont(const QString &sampleText,const QString &buttonText, 411 KPrefsWidFont *addWidFont(const QString &sampleText,const QString &buttonText,
411 QFont *reference,QWidget *parent); 412 QFont *reference,QWidget *parent);
412 413
413 public slots: 414 public slots:
414 /** Set all widgets to default values. */ 415 /** Set all widgets to default values. */
415 void setDefaults(); 416 void setDefaults();
416 417
417 /** Read preferences from config file. */ 418 /** Read preferences from config file. */
418 void readConfig(); 419 void readConfig();
419 420
420 /** Write preferences to config file. */ 421 /** Write preferences to config file. */
421 void writeConfig(); 422 void writeConfig();
422 423
423 /** connect this slot to all UI elements */ 424 /** connect this slot to all UI elements */
424 void modified(); 425 void modified();
425 426
426 signals: 427 signals:
427 /** Emitted when the a changed configuration has been stored. */ 428 /** Emitted when the a changed configuration has been stored. */
428 //US void configChanged(); 429 //US void configChanged();
429 void changed( bool ); 430 void changed( bool );
430 431
431 protected slots: 432 protected slots:
432 /** Apply changes to preferences */ 433 /** Apply changes to preferences */
433 //US void slotApply(); 434 //US void slotApply();
434 435
435 //US void accept(); 436 //US void accept();
436 /** Accept changes to preferences and close dialog */ 437 /** Accept changes to preferences and close dialog */
437 //US void slotOk(); 438 //US void slotOk();
438 439
439 /** Set preferences to default values */ 440 /** Set preferences to default values */
440 //US void slotDefault(); 441 //US void slotDefault();
441 442
442 protected: 443 protected:
443 /** Implement this to read custom configuration widgets. */ 444 /** Implement this to read custom configuration widgets. */
444 virtual void usrReadConfig() {} 445 virtual void usrReadConfig() {}
445 /** Implement this to write custom configuration widgets. */ 446 /** Implement this to write custom configuration widgets. */
446 virtual void usrWriteConfig() {} 447 virtual void usrWriteConfig() {}
447 448
448 private: 449 private:
449 KPrefs *mPrefs; 450 KPrefs *mPrefs;
450 451
451 QPtrList<KPrefsWid> mPrefsWids; 452 QPtrList<KPrefsWid> mPrefsWids;
452}; 453};
453 454
454#endif 455#endif
diff --git a/libkdepim/libkdepim.pro b/libkdepim/libkdepim.pro
index 1fedac7..7231842 100644
--- a/libkdepim/libkdepim.pro
+++ b/libkdepim/libkdepim.pro
@@ -1,55 +1,57 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG = qt warn_on 2 CONFIG = qt warn_on
3DEFINES +=KORG_NOKABC 3DEFINES +=KORG_NOKABC
4TARGET = microkdepim 4TARGET = microkdepim
5INCLUDEPATH += ../microkde ../microkde/kdecore ../microkde/kdeui . .. 5INCLUDEPATH += ../microkde ../microkde/kdecore ../microkde/kdeui . ..
6DESTDIR=../bin 6DESTDIR=../bin
7 7
8DEFINES += DESKTOP_VERSION 8DEFINES += DESKTOP_VERSION
9include( ../variables.pri ) 9include( ../variables.pri )
10unix : { 10unix : {
11OBJECTS_DIR = obj/unix 11OBJECTS_DIR = obj/unix
12MOC_DIR = moc/unix 12MOC_DIR = moc/unix
13} 13}
14win32: { 14win32: {
15DEFINES += _WIN32_ 15DEFINES += _WIN32_
16OBJECTS_DIR = obj/win 16OBJECTS_DIR = obj/win
17MOC_DIR = moc/win 17MOC_DIR = moc/win
18} 18}
19INTERFACES = \ 19INTERFACES = \
20 20
21HEADERS = \ 21HEADERS = \
22 categoryeditdialog.h \ 22 categoryeditdialog.h \
23 categoryeditdialog_base.h \ 23 categoryeditdialog_base.h \
24 categoryselectdialog.h \ 24 categoryselectdialog.h \
25 categoryselectdialog_base.h \ 25 categoryselectdialog_base.h \
26 externalapphandler.h \ 26 externalapphandler.h \
27 kdateedit.h \ 27 kdateedit.h \
28 kdatepicker.h \ 28 kdatepicker.h \
29 kinputdialog.h \ 29 kinputdialog.h \
30 kpimprefs.h \ 30 kpimprefs.h \
31 kpimglobalprefs.h \ 31 kpimglobalprefs.h \
32 kprefsdialog.h \ 32 kprefsdialog.h \
33 kprefswidget.h \
33 ksyncprofile.h \ 34 ksyncprofile.h \
34 ksyncprefsdialog.h \ 35 ksyncprefsdialog.h \
35 kcmconfigs/kcmkdepimconfig.h \ 36 kcmconfigs/kcmkdepimconfig.h \
36 kcmconfigs/kdepimconfigwidget.h 37 kcmconfigs/kdepimconfigwidget.h
37 38
38SOURCES = \ 39SOURCES = \
39 categoryeditdialog.cpp \ 40 categoryeditdialog.cpp \
40 categoryeditdialog_base.cpp \ 41 categoryeditdialog_base.cpp \
41 categoryselectdialog.cpp \ 42 categoryselectdialog.cpp \
42 categoryselectdialog_base.cpp \ 43 categoryselectdialog_base.cpp \
43 externalapphandler.cpp \ 44 externalapphandler.cpp \
44 kdateedit.cpp \ 45 kdateedit.cpp \
45 kdatepicker.cpp \ 46 kdatepicker.cpp \
46 kinputdialog.cpp \ 47 kinputdialog.cpp \
47 kpimprefs.cpp \ 48 kpimprefs.cpp \
48 kpimglobalprefs.cpp \ 49 kpimglobalprefs.cpp \
49 kprefsdialog.cpp \ 50 kprefsdialog.cpp \
51 kprefswidget.cpp \
50 ksyncprofile.cpp \ 52 ksyncprofile.cpp \
51 ksyncprefsdialog.cpp \ 53 ksyncprefsdialog.cpp \
52 kcmconfigs/kcmkdepimconfig.cpp \ 54 kcmconfigs/kcmkdepimconfig.cpp \
53 kcmconfigs/kdepimconfigwidget.cpp 55 kcmconfigs/kdepimconfigwidget.cpp
54 56
55 57