summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorulf69 <ulf69>2004-08-10 16:25:06 (UTC)
committer ulf69 <ulf69>2004-08-10 16:25:06 (UTC)
commit972b441aa3435f4f9df6de2a36ba2d03a7de5bbc (patch) (unidiff)
tree62ba0f85b223a10ec82cee5d7ddcfda84a0af21a /kaddressbook
parentc56c4729e32a9c8ba8709493b3ea11cf7cf229d3 (diff)
downloadkdepimpi-972b441aa3435f4f9df6de2a36ba2d03a7de5bbc.zip
kdepimpi-972b441aa3435f4f9df6de2a36ba2d03a7de5bbc.tar.gz
kdepimpi-972b441aa3435f4f9df6de2a36ba2d03a7de5bbc.tar.bz2
removed unneedded references to qtopia/services.h
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index fe4841a..d6f0cee 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1,469 +1,467 @@
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#include "kabcore.h" 24#include "kabcore.h"
25 25
26#include <stdaddressbook.h> 26#include <stdaddressbook.h>
27#include <klocale.h> 27#include <klocale.h>
28 28
29#ifndef KAB_EMBEDDED 29#ifndef KAB_EMBEDDED
30#include <qclipboard.h> 30#include <qclipboard.h>
31#include <qdir.h> 31#include <qdir.h>
32#include <qfile.h> 32#include <qfile.h>
33#include <qapplicaton.h> 33#include <qapplicaton.h>
34#include <qlayout.h> 34#include <qlayout.h>
35#include <qregexp.h> 35#include <qregexp.h>
36#include <qvbox.h> 36#include <qvbox.h>
37#include <kabc/addresseelist.h> 37#include <kabc/addresseelist.h>
38#include <kabc/errorhandler.h> 38#include <kabc/errorhandler.h>
39#include <kabc/resource.h> 39#include <kabc/resource.h>
40#include <kabc/vcardconverter.h> 40#include <kabc/vcardconverter.h>
41#include <kapplication.h> 41#include <kapplication.h>
42#include <kactionclasses.h> 42#include <kactionclasses.h>
43#include <kcmultidialog.h> 43#include <kcmultidialog.h>
44#include <kdebug.h> 44#include <kdebug.h>
45#include <kdeversion.h> 45#include <kdeversion.h>
46#include <kkeydialog.h> 46#include <kkeydialog.h>
47#include <kmessagebox.h> 47#include <kmessagebox.h>
48#include <kprinter.h> 48#include <kprinter.h>
49#include <kprotocolinfo.h> 49#include <kprotocolinfo.h>
50#include <kresources/selectdialog.h> 50#include <kresources/selectdialog.h>
51#include <kstandarddirs.h> 51#include <kstandarddirs.h>
52#include <ktempfile.h> 52#include <ktempfile.h>
53#include <kxmlguiclient.h> 53#include <kxmlguiclient.h>
54#include <kaboutdata.h> 54#include <kaboutdata.h>
55#include <libkdepim/categoryselectdialog.h> 55#include <libkdepim/categoryselectdialog.h>
56 56
57#include "addresseeutil.h" 57#include "addresseeutil.h"
58#include "addresseeeditordialog.h" 58#include "addresseeeditordialog.h"
59#include "extensionmanager.h" 59#include "extensionmanager.h"
60#include "kstdaction.h" 60#include "kstdaction.h"
61#include "kaddressbookservice.h" 61#include "kaddressbookservice.h"
62#include "ldapsearchdialog.h" 62#include "ldapsearchdialog.h"
63#include "printing/printingwizard.h" 63#include "printing/printingwizard.h"
64#else // KAB_EMBEDDED 64#else // KAB_EMBEDDED
65 65
66#include <kapplication.h> 66#include <kapplication.h>
67#include "KDGanttMinimizeSplitter.h" 67#include "KDGanttMinimizeSplitter.h"
68#include "kaddressbookmain.h" 68#include "kaddressbookmain.h"
69#include "kactioncollection.h" 69#include "kactioncollection.h"
70#include <qapp.h> 70#include <qapp.h>
71#include <qmenubar.h> 71#include <qmenubar.h>
72//#include <qtoolbar.h> 72//#include <qtoolbar.h>
73#include <qmessagebox.h> 73#include <qmessagebox.h>
74#include <kdebug.h> 74#include <kdebug.h>
75#include <kiconloader.h> // needed for SmallIcon 75#include <kiconloader.h> // needed for SmallIcon
76#include <kresources/kcmkresources.h> 76#include <kresources/kcmkresources.h>
77#include <ktoolbar.h> 77#include <ktoolbar.h>
78 78
79 79
80//#include <qlabel.h> 80//#include <qlabel.h>
81 81
82 82
83#ifndef DESKTOP_VERSION 83#ifndef DESKTOP_VERSION
84#include <qtopia/services.h>
85#include <qtopia/qcopenvelope_qws.h>
86#include <qpe/ir.h> 84#include <qpe/ir.h>
87#endif 85#endif
88 86
89#endif // KAB_EMBEDDED 87#endif // KAB_EMBEDDED
90#include "kcmconfigs/kcmkabconfig.h" 88#include "kcmconfigs/kcmkabconfig.h"
91#include "kcmconfigs/kcmkdepimconfig.h" 89#include "kcmconfigs/kcmkdepimconfig.h"
92#include "kpimglobalprefs.h" 90#include "kpimglobalprefs.h"
93#include "externalapphandler.h" 91#include "externalapphandler.h"
94 92
95 93
96#include <kresources/selectdialog.h> 94#include <kresources/selectdialog.h>
97#include <kmessagebox.h> 95#include <kmessagebox.h>
98 96
99#include <picture.h> 97#include <picture.h>
100#include <resource.h> 98#include <resource.h>
101 99
102//US#include <qsplitter.h> 100//US#include <qsplitter.h>
103#include <qmap.h> 101#include <qmap.h>
104#include <qdir.h> 102#include <qdir.h>
105#include <qfile.h> 103#include <qfile.h>
106#include <qvbox.h> 104#include <qvbox.h>
107#include <qlayout.h> 105#include <qlayout.h>
108#include <qclipboard.h> 106#include <qclipboard.h>
109#include <qtextstream.h> 107#include <qtextstream.h>
110 108
111#include <libkdepim/categoryselectdialog.h> 109#include <libkdepim/categoryselectdialog.h>
112#include <kabc/vcardconverter.h> 110#include <kabc/vcardconverter.h>
113 111
114 112
115#include "addresseeutil.h" 113#include "addresseeutil.h"
116#include "undocmds.h" 114#include "undocmds.h"
117#include "addresseeeditordialog.h" 115#include "addresseeeditordialog.h"
118#include "viewmanager.h" 116#include "viewmanager.h"
119#include "details/detailsviewcontainer.h" 117#include "details/detailsviewcontainer.h"
120#include "kabprefs.h" 118#include "kabprefs.h"
121#include "xxportmanager.h" 119#include "xxportmanager.h"
122#include "incsearchwidget.h" 120#include "incsearchwidget.h"
123#include "jumpbuttonbar.h" 121#include "jumpbuttonbar.h"
124#include "extensionmanager.h" 122#include "extensionmanager.h"
125#include "addresseeconfig.h" 123#include "addresseeconfig.h"
126#include <kcmultidialog.h> 124#include <kcmultidialog.h>
127 125
128#ifdef _WIN32_ 126#ifdef _WIN32_
129 127
130#include "kaimportoldialog.h" 128#include "kaimportoldialog.h"
131#endif 129#endif
132 130
133bool pasteWithNewUid = true; 131bool pasteWithNewUid = true;
134 132
135#ifdef KAB_EMBEDDED 133#ifdef KAB_EMBEDDED
136KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) 134KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name )
137 : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), 135 : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ),
138 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ 136 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/
139 mReadWrite( readWrite ), mModified( false ), mMainWindow(client) 137 mReadWrite( readWrite ), mModified( false ), mMainWindow(client)
140#else //KAB_EMBEDDED 138#else //KAB_EMBEDDED
141KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) 139KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name )
142 : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ), 140 : QWidget( parent, name ), mGUIClient( client ), mViewManager( 0 ),
143 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), 141 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ),
144 mReadWrite( readWrite ), mModified( false ) 142 mReadWrite( readWrite ), mModified( false )
145#endif //KAB_EMBEDDED 143#endif //KAB_EMBEDDED
146{ 144{
147 145
148 mExtensionBarSplitter = 0; 146 mExtensionBarSplitter = 0;
149 mIsPart = !parent->inherits( "KAddressBookMain" ); 147 mIsPart = !parent->inherits( "KAddressBookMain" );
150 148
151 mAddressBook = KABC::StdAddressBook::self(); 149 mAddressBook = KABC::StdAddressBook::self();
152 KABC::StdAddressBook::setAutomaticSave( false ); 150 KABC::StdAddressBook::setAutomaticSave( false );
153 151
154#ifndef KAB_EMBEDDED 152#ifndef KAB_EMBEDDED
155 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); 153 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler );
156#endif //KAB_EMBEDDED 154#endif //KAB_EMBEDDED
157 155
158 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), 156 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ),
159 SLOT( addressBookChanged() ) ); 157 SLOT( addressBookChanged() ) );
160 158
161 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, 159 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization,
162 "X-Department", "KADDRESSBOOK" ); 160 "X-Department", "KADDRESSBOOK" );
163 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, 161 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization,
164 "X-Profession", "KADDRESSBOOK" ); 162 "X-Profession", "KADDRESSBOOK" );
165 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, 163 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization,
166 "X-AssistantsName", "KADDRESSBOOK" ); 164 "X-AssistantsName", "KADDRESSBOOK" );
167 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, 165 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization,
168 "X-ManagersName", "KADDRESSBOOK" ); 166 "X-ManagersName", "KADDRESSBOOK" );
169 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, 167 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal,
170 "X-SpousesName", "KADDRESSBOOK" ); 168 "X-SpousesName", "KADDRESSBOOK" );
171 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, 169 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal,
172 "X-Office", "KADDRESSBOOK" ); 170 "X-Office", "KADDRESSBOOK" );
173 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, 171 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal,
174 "X-IMAddress", "KADDRESSBOOK" ); 172 "X-IMAddress", "KADDRESSBOOK" );
175 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, 173 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal,
176 "X-Anniversary", "KADDRESSBOOK" ); 174 "X-Anniversary", "KADDRESSBOOK" );
177 175
178 //US added this field to become compatible with Opie/qtopia addressbook 176 //US added this field to become compatible with Opie/qtopia addressbook
179 // values can be "female" or "male" or "". An empty field represents undefined. 177 // values can be "female" or "male" or "". An empty field represents undefined.
180 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, 178 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal,
181 "X-Gender", "KADDRESSBOOK" ); 179 "X-Gender", "KADDRESSBOOK" );
182 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, 180 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal,
183 "X-Children", "KADDRESSBOOK" ); 181 "X-Children", "KADDRESSBOOK" );
184 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, 182 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal,
185 "X-FreeBusyUrl", "KADDRESSBOOK" ); 183 "X-FreeBusyUrl", "KADDRESSBOOK" );
186 184
187 initGUI(); 185 initGUI();
188 186
189 mIncSearchWidget->setFocus(); 187 mIncSearchWidget->setFocus();
190 188
191 189
192 connect( mViewManager, SIGNAL( selected( const QString& ) ), 190 connect( mViewManager, SIGNAL( selected( const QString& ) ),
193 SLOT( setContactSelected( const QString& ) ) ); 191 SLOT( setContactSelected( const QString& ) ) );
194 connect( mViewManager, SIGNAL( executed( const QString& ) ), 192 connect( mViewManager, SIGNAL( executed( const QString& ) ),
195 SLOT( editContact( const QString& ) ) ); 193 SLOT( editContact( const QString& ) ) );
196 connect( mViewManager, SIGNAL( deleteRequest( ) ), 194 connect( mViewManager, SIGNAL( deleteRequest( ) ),
197 SLOT( deleteContacts( ) ) ); 195 SLOT( deleteContacts( ) ) );
198 connect( mViewManager, SIGNAL( modified() ), 196 connect( mViewManager, SIGNAL( modified() ),
199 SLOT( setModified() ) ); 197 SLOT( setModified() ) );
200 198
201 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); 199 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) );
202 200
203 connect( mXXPortManager, SIGNAL( modified() ), 201 connect( mXXPortManager, SIGNAL( modified() ),
204 SLOT( setModified() ) ); 202 SLOT( setModified() ) );
205 203
206 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), 204 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ),
207 SLOT( incrementalSearch( const QString& ) ) ); 205 SLOT( incrementalSearch( const QString& ) ) );
208 connect( mIncSearchWidget, SIGNAL( fieldChanged() ), 206 connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
209 mJumpButtonBar, SLOT( recreateButtons() ) ); 207 mJumpButtonBar, SLOT( recreateButtons() ) );
210 208
211 connect( mDetails, SIGNAL( sendEmail( const QString& ) ), 209 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
212 SLOT( sendMail( const QString& ) ) ); 210 SLOT( sendMail( const QString& ) ) );
213 211
214#ifndef KAB_EMBEDDED 212#ifndef KAB_EMBEDDED
215 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), 213 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
216 mXXPortManager, SLOT( importVCard( const KURL& ) ) ); 214 mXXPortManager, SLOT( importVCard( const KURL& ) ) );
217 215
218 connect( mDetails, SIGNAL( browse( const QString& ) ), 216 connect( mDetails, SIGNAL( browse( const QString& ) ),
219 SLOT( browse( const QString& ) ) ); 217 SLOT( browse( const QString& ) ) );
220 218
221 mAddressBookService = new KAddressBookService( this ); 219 mAddressBookService = new KAddressBookService( this );
222 220
223#endif //KAB_EMBEDDED 221#endif //KAB_EMBEDDED
224 mEditorDialog = 0; 222 mEditorDialog = 0;
225 createAddresseeEditorDialog( this ); 223 createAddresseeEditorDialog( this );
226 setModified( false ); 224 setModified( false );
227} 225}
228 226
229KABCore::~KABCore() 227KABCore::~KABCore()
230{ 228{
231 // save(); 229 // save();
232 //saveSettings(); 230 //saveSettings();
233 //KABPrefs::instance()->writeConfig(); 231 //KABPrefs::instance()->writeConfig();
234 delete AddresseeConfig::instance(); 232 delete AddresseeConfig::instance();
235 mAddressBook = 0; 233 mAddressBook = 0;
236 KABC::StdAddressBook::close(); 234 KABC::StdAddressBook::close();
237} 235}
238 236
239void KABCore::restoreSettings() 237void KABCore::restoreSettings()
240{ 238{
241 bool state = KABPrefs::instance()->mJumpButtonBarVisible; 239 bool state = KABPrefs::instance()->mJumpButtonBarVisible;
242 240
243 mActionJumpBar->setChecked( state ); 241 mActionJumpBar->setChecked( state );
244 setJumpButtonBarVisible( state ); 242 setJumpButtonBarVisible( state );
245 243
246 state = KABPrefs::instance()->mDetailsPageVisible; 244 state = KABPrefs::instance()->mDetailsPageVisible;
247 245
248 mActionDetails->setChecked( state ); 246 mActionDetails->setChecked( state );
249 setDetailsVisible( state ); 247 setDetailsVisible( state );
250 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; 248 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter;
251 if ( splitterSize.count() == 0 ) { 249 if ( splitterSize.count() == 0 ) {
252 splitterSize.append( width() / 2 ); 250 splitterSize.append( width() / 2 );
253 splitterSize.append( width() / 2 ); 251 splitterSize.append( width() / 2 );
254 } 252 }
255 mMiniSplitter->setSizes( splitterSize ); 253 mMiniSplitter->setSizes( splitterSize );
256 if ( mExtensionBarSplitter ) { 254 if ( mExtensionBarSplitter ) {
257 splitterSize = KABPrefs::instance()->mExtensionsSplitter; 255 splitterSize = KABPrefs::instance()->mExtensionsSplitter;
258 if ( splitterSize.count() == 0 ) { 256 if ( splitterSize.count() == 0 ) {
259 splitterSize.append( width() / 2 ); 257 splitterSize.append( width() / 2 );
260 splitterSize.append( width() / 2 ); 258 splitterSize.append( width() / 2 );
261 } 259 }
262 mExtensionBarSplitter->setSizes( splitterSize ); 260 mExtensionBarSplitter->setSizes( splitterSize );
263 261
264 } 262 }
265#ifndef KAB_EMBEDDED 263#ifndef KAB_EMBEDDED
266 QValueList<int> splitterSize = KABPrefs::instance()->mExtensionsSplitter; 264 QValueList<int> splitterSize = KABPrefs::instance()->mExtensionsSplitter;
267 if ( splitterSize.count() == 0 ) { 265 if ( splitterSize.count() == 0 ) {
268 splitterSize.append( width() / 2 ); 266 splitterSize.append( width() / 2 );
269 splitterSize.append( width() / 2 ); 267 splitterSize.append( width() / 2 );
270 } 268 }
271 mExtensionBarSplitter->setSizes( splitterSize ); 269 mExtensionBarSplitter->setSizes( splitterSize );
272 270
273 splitterSize = KABPrefs::instance()->mDetailsSplitter; 271 splitterSize = KABPrefs::instance()->mDetailsSplitter;
274 if ( splitterSize.count() == 0 ) { 272 if ( splitterSize.count() == 0 ) {
275 splitterSize.append( height() / 2 ); 273 splitterSize.append( height() / 2 );
276 splitterSize.append( height() / 2 ); 274 splitterSize.append( height() / 2 );
277 } 275 }
278 mDetailsSplitter->setSizes( splitterSize ); 276 mDetailsSplitter->setSizes( splitterSize );
279 277
280 mExtensionManager->restoreSettings(); 278 mExtensionManager->restoreSettings();
281 279
282#endif //KAB_EMBEDDED 280#endif //KAB_EMBEDDED
283 281
284 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); 282 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField );
285 283
286 mViewManager->restoreSettings(); 284 mViewManager->restoreSettings();
287 mExtensionManager->restoreSettings(); 285 mExtensionManager->restoreSettings();
288} 286}
289 287
290void KABCore::saveSettings() 288void KABCore::saveSettings()
291{ 289{
292 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); 290 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked();
293 if ( mExtensionBarSplitter ) 291 if ( mExtensionBarSplitter )
294 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); 292 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
295 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); 293 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked();
296 KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); 294 KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes();
297#ifndef KAB_EMBEDDED 295#ifndef KAB_EMBEDDED
298 296
299 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); 297 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
300 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); 298 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes();
301#endif //KAB_EMBEDDED 299#endif //KAB_EMBEDDED
302 mExtensionManager->saveSettings(); 300 mExtensionManager->saveSettings();
303 mViewManager->saveSettings(); 301 mViewManager->saveSettings();
304 302
305 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); 303 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem();
306 304
307} 305}
308 306
309KABC::AddressBook *KABCore::addressBook() const 307KABC::AddressBook *KABCore::addressBook() const
310{ 308{
311 return mAddressBook; 309 return mAddressBook;
312} 310}
313 311
314KConfig *KABCore::config() 312KConfig *KABCore::config()
315{ 313{
316#ifndef KAB_EMBEDDED 314#ifndef KAB_EMBEDDED
317 return KABPrefs::instance()->config(); 315 return KABPrefs::instance()->config();
318#else //KAB_EMBEDDED 316#else //KAB_EMBEDDED
319 return KABPrefs::instance()->getConfig(); 317 return KABPrefs::instance()->getConfig();
320#endif //KAB_EMBEDDED 318#endif //KAB_EMBEDDED
321} 319}
322 320
323KActionCollection *KABCore::actionCollection() const 321KActionCollection *KABCore::actionCollection() const
324{ 322{
325 return mGUIClient->actionCollection(); 323 return mGUIClient->actionCollection();
326} 324}
327 325
328KABC::Field *KABCore::currentSearchField() const 326KABC::Field *KABCore::currentSearchField() const
329{ 327{
330 if (mIncSearchWidget) 328 if (mIncSearchWidget)
331 return mIncSearchWidget->currentField(); 329 return mIncSearchWidget->currentField();
332 else 330 else
333 return 0; 331 return 0;
334} 332}
335 333
336QStringList KABCore::selectedUIDs() const 334QStringList KABCore::selectedUIDs() const
337{ 335{
338 return mViewManager->selectedUids(); 336 return mViewManager->selectedUids();
339} 337}
340 338
341KABC::Resource *KABCore::requestResource( QWidget *parent ) 339KABC::Resource *KABCore::requestResource( QWidget *parent )
342{ 340{
343 QPtrList<KABC::Resource> kabcResources = addressBook()->resources(); 341 QPtrList<KABC::Resource> kabcResources = addressBook()->resources();
344 342
345 QPtrList<KRES::Resource> kresResources; 343 QPtrList<KRES::Resource> kresResources;
346 QPtrListIterator<KABC::Resource> resIt( kabcResources ); 344 QPtrListIterator<KABC::Resource> resIt( kabcResources );
347 KABC::Resource *resource; 345 KABC::Resource *resource;
348 while ( ( resource = resIt.current() ) != 0 ) { 346 while ( ( resource = resIt.current() ) != 0 ) {
349 ++resIt; 347 ++resIt;
350 if ( !resource->readOnly() ) { 348 if ( !resource->readOnly() ) {
351 KRES::Resource *res = static_cast<KRES::Resource*>( resource ); 349 KRES::Resource *res = static_cast<KRES::Resource*>( resource );
352 if ( res ) 350 if ( res )
353 kresResources.append( res ); 351 kresResources.append( res );
354 } 352 }
355 } 353 }
356 354
357 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent ); 355 KRES::Resource *res = KRES::SelectDialog::getResource( kresResources, parent );
358 return static_cast<KABC::Resource*>( res ); 356 return static_cast<KABC::Resource*>( res );
359} 357}
360 358
361#ifndef KAB_EMBEDDED 359#ifndef KAB_EMBEDDED
362KAboutData *KABCore::createAboutData() 360KAboutData *KABCore::createAboutData()
363#else //KAB_EMBEDDED 361#else //KAB_EMBEDDED
364void KABCore::createAboutData() 362void KABCore::createAboutData()
365#endif //KAB_EMBEDDED 363#endif //KAB_EMBEDDED
366{ 364{
367#ifndef KAB_EMBEDDED 365#ifndef KAB_EMBEDDED
368 KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ), 366 KAboutData *about = new KAboutData( "kaddressbook", I18N_NOOP( "KAddressBook" ),
369 "3.1", I18N_NOOP( "The KDE Address Book" ), 367 "3.1", I18N_NOOP( "The KDE Address Book" ),
370 KAboutData::License_GPL_V2, 368 KAboutData::License_GPL_V2,
371 I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) ); 369 I18N_NOOP( "(c) 1997-2003, The KDE PIM Team" ) );
372 about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" ); 370 about->addAuthor( "Tobias Koenig", I18N_NOOP( "Current maintainer " ), "tokoe@kde.org" );
373 about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) ); 371 about->addAuthor( "Don Sanders", I18N_NOOP( "Original author " ) );
374 about->addAuthor( "Cornelius Schumacher", 372 about->addAuthor( "Cornelius Schumacher",
375 I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ), 373 I18N_NOOP( "Co-maintainer, libkabc port, CSV import/export " ),
376 "schumacher@kde.org" ); 374 "schumacher@kde.org" );
377 about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ), 375 about->addAuthor( "Mike Pilone", I18N_NOOP( "GUI and framework redesign " ),
378 "mpilone@slac.com" ); 376 "mpilone@slac.com" );
379 about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) ); 377 about->addAuthor( "Greg Stern", I18N_NOOP( "DCOP interface" ) );
380 about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) ); 378 about->addAuthor( "Mark Westcott", I18N_NOOP( "Contact pinning" ) );
381 about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ), 379 about->addAuthor( "Michel Boyer de la Giroday", I18N_NOOP( "LDAP Lookup\n" ),
382 "michel@klaralvdalens-datakonsult.se" ); 380 "michel@klaralvdalens-datakonsult.se" );
383 about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ), 381 about->addAuthor( "Steffen Hansen", I18N_NOOP( "LDAP Lookup " ),
384 "hansen@kde.org" ); 382 "hansen@kde.org" );
385 383
386 return about; 384 return about;
387#endif //KAB_EMBEDDED 385#endif //KAB_EMBEDDED
388 386
389 QString version; 387 QString version;
390#include <../version> 388#include <../version>
391 QMessageBox::about( this, "About KAddressbook/Pi", 389 QMessageBox::about( this, "About KAddressbook/Pi",
392 "KAddressbook/Platform-independent\n" 390 "KAddressbook/Platform-independent\n"
393 "(KA/Pi) " +version + " - " + 391 "(KA/Pi) " +version + " - " +
394#ifdef DESKTOP_VERSION 392#ifdef DESKTOP_VERSION
395 "Desktop Edition\n" 393 "Desktop Edition\n"
396#else 394#else
397 "PDA-Edition\n" 395 "PDA-Edition\n"
398 "for: Zaurus 5500 / 7x0 / 8x0\n" 396 "for: Zaurus 5500 / 7x0 / 8x0\n"
399#endif 397#endif
400 398
401 "(c) 2004 Ulf Schenk\n" 399 "(c) 2004 Ulf Schenk\n"
402 "(c) 1997-2003, The KDE PIM Team\n" 400 "(c) 1997-2003, The KDE PIM Team\n"
403 "Tobias Koenig Current maintainer tokoe@kde.org\n" 401 "Tobias Koenig Current maintainer tokoe@kde.org\n"
404 "Don Sanders Original author\n" 402 "Don Sanders Original author\n"
405 "Cornelius Schumacher Co-maintainer schumacher@kde.org\n" 403 "Cornelius Schumacher Co-maintainer schumacher@kde.org\n"
406 "Mike Pilone GUI and framework redesign mpilone@slac.com\n" 404 "Mike Pilone GUI and framework redesign mpilone@slac.com\n"
407 "Greg Stern DCOP interface\n" 405 "Greg Stern DCOP interface\n"
408 "Mark Westcot Contact pinning\n" 406 "Mark Westcot Contact pinning\n"
409 "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n" 407 "Michel Boyer de la Giroday LDAP Lookup\n" "michel@klaralvdalens-datakonsult.se\n"
410 "Steffen Hansen LDAP Lookup hansen@kde.org\n" 408 "Steffen Hansen LDAP Lookup hansen@kde.org\n"
411#ifdef _WIN32_ 409#ifdef _WIN32_
412 "(c) 2004 Lutz Rogowski Import from OL rogowski@kde.org\n" 410 "(c) 2004 Lutz Rogowski Import from OL rogowski@kde.org\n"
413#endif 411#endif
414 ); 412 );
415} 413}
416 414
417void KABCore::setContactSelected( const QString &uid ) 415void KABCore::setContactSelected( const QString &uid )
418{ 416{
419 KABC::Addressee addr = mAddressBook->findByUid( uid ); 417 KABC::Addressee addr = mAddressBook->findByUid( uid );
420 if ( !mDetails->isHidden() ) 418 if ( !mDetails->isHidden() )
421 mDetails->setAddressee( addr ); 419 mDetails->setAddressee( addr );
422 420
423 if ( !addr.isEmpty() ) { 421 if ( !addr.isEmpty() ) {
424 emit contactSelected( addr.formattedName() ); 422 emit contactSelected( addr.formattedName() );
425 KABC::Picture pic = addr.photo(); 423 KABC::Picture pic = addr.photo();
426 if ( pic.isIntern() ) { 424 if ( pic.isIntern() ) {
427//US emit contactSelected( pic.data() ); 425//US emit contactSelected( pic.data() );
428//US instead use: 426//US instead use:
429 QPixmap px; 427 QPixmap px;
430 if (pic.data().isNull() != true) 428 if (pic.data().isNull() != true)
431 { 429 {
432 px.convertFromImage(pic.data()); 430 px.convertFromImage(pic.data());
433 } 431 }
434 432
435 emit contactSelected( px ); 433 emit contactSelected( px );
436 } 434 }
437 } 435 }
438 436
439 437
440 mExtensionManager->setSelectionChanged(); 438 mExtensionManager->setSelectionChanged();
441 439
442 // update the actions 440 // update the actions
443 bool selected = !uid.isEmpty(); 441 bool selected = !uid.isEmpty();
444 442
445 if ( mReadWrite ) { 443 if ( mReadWrite ) {
446 mActionCut->setEnabled( selected ); 444 mActionCut->setEnabled( selected );
447 mActionPaste->setEnabled( selected ); 445 mActionPaste->setEnabled( selected );
448 } 446 }
449 447
450 mActionCopy->setEnabled( selected ); 448 mActionCopy->setEnabled( selected );
451 mActionDelete->setEnabled( selected ); 449 mActionDelete->setEnabled( selected );
452 mActionEditAddressee->setEnabled( selected ); 450 mActionEditAddressee->setEnabled( selected );
453 mActionMail->setEnabled( selected ); 451 mActionMail->setEnabled( selected );
454 mActionMailVCard->setEnabled( selected ); 452 mActionMailVCard->setEnabled( selected );
455 //if (mActionBeam) 453 //if (mActionBeam)
456 //mActionBeam->setEnabled( selected ); 454 //mActionBeam->setEnabled( selected );
457 455
458 if (mActionBeamVCard) 456 if (mActionBeamVCard)
459 mActionBeamVCard->setEnabled( selected ); 457 mActionBeamVCard->setEnabled( selected );
460 458
461 mActionWhoAmI->setEnabled( selected ); 459 mActionWhoAmI->setEnabled( selected );
462 mActionCategories->setEnabled( selected ); 460 mActionCategories->setEnabled( selected );
463} 461}
464 462
465void KABCore::sendMail() 463void KABCore::sendMail()
466{ 464{
467 sendMail( mViewManager->selectedEmails().join( ", " ) ); 465 sendMail( mViewManager->selectedEmails().join( ", " ) );
468} 466}
469 467