summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-08-23 20:09:28 (UTC)
committer zautrix <zautrix>2005-08-23 20:09:28 (UTC)
commit6f5464760f5fb1e4c13027464cfe4943b85d29a0 (patch) (unidiff)
tree3c074b7e313d965516b60b9ba97fe27a7ee774a1 /kaddressbook
parent13a736b71dec27ef7ffef06b91f34d220d89cce6 (diff)
downloadkdepimpi-6f5464760f5fb1e4c13027464cfe4943b85d29a0.zip
kdepimpi-6f5464760f5fb1e4c13027464cfe4943b85d29a0.tar.gz
kdepimpi-6f5464760f5fb1e4c13027464cfe4943b85d29a0.tar.bz2
fixx
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp6
-rw-r--r--kaddressbook/kaddressbookmain.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 77321aa..af12f2b 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -219,403 +219,403 @@ class KABFormatPrefs : public QDialog
219 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format ); 219 reverse = new QRadioButton(i18n("Reverse: Bond, James"), format );
220 company = new QRadioButton(i18n("Organization: MI6"), format ); 220 company = new QRadioButton(i18n("Organization: MI6"), format );
221 simple->setChecked( true ); 221 simple->setChecked( true );
222 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this); 222 setCompany = new QCheckBox(i18n("Set formatted name to\norganization, if name empty"), this);
223 lay->addWidget( setCompany ); 223 lay->addWidget( setCompany );
224 QPushButton * ok = new QPushButton( i18n("Select contact list"), this ); 224 QPushButton * ok = new QPushButton( i18n("Select contact list"), this );
225 lay->addWidget( ok ); 225 lay->addWidget( ok );
226 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 226 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
227 lay->addWidget( cancel ); 227 lay->addWidget( cancel );
228 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 228 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
229 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 229 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
230 //resize( 200, 200 ); 230 //resize( 200, 200 );
231 231
232 } 232 }
233public: 233public:
234 QRadioButton* simple, *full, *reverse, *company; 234 QRadioButton* simple, *full, *reverse, *company;
235 QCheckBox* setCompany; 235 QCheckBox* setCompany;
236}; 236};
237 237
238 238
239 239
240class KAex2phonePrefs : public QDialog 240class KAex2phonePrefs : public QDialog
241{ 241{
242 public: 242 public:
243 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 243 KAex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
244 QDialog( parent, name, true ) 244 QDialog( parent, name, true )
245 { 245 {
246 setCaption( i18n("Export to phone options") ); 246 setCaption( i18n("Export to phone options") );
247 QVBoxLayout* lay = new QVBoxLayout( this ); 247 QVBoxLayout* lay = new QVBoxLayout( this );
248 lay->setSpacing( 3 ); 248 lay->setSpacing( 3 );
249 lay->setMargin( 3 ); 249 lay->setMargin( 3 );
250 QLabel *lab; 250 QLabel *lab;
251 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 251 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
252 lab->setAlignment (AlignHCenter ); 252 lab->setAlignment (AlignHCenter );
253 QHBox* temphb; 253 QHBox* temphb;
254 temphb = new QHBox( this ); 254 temphb = new QHBox( this );
255 new QLabel( i18n("I/O device: "), temphb ); 255 new QLabel( i18n("I/O device: "), temphb );
256 mPhoneDevice = new QLineEdit( temphb); 256 mPhoneDevice = new QLineEdit( temphb);
257 lay->addWidget( temphb ); 257 lay->addWidget( temphb );
258 temphb = new QHBox( this ); 258 temphb = new QHBox( this );
259 new QLabel( i18n("Connection: "), temphb ); 259 new QLabel( i18n("Connection: "), temphb );
260 mPhoneConnection = new QLineEdit( temphb); 260 mPhoneConnection = new QLineEdit( temphb);
261 lay->addWidget( temphb ); 261 lay->addWidget( temphb );
262 temphb = new QHBox( this ); 262 temphb = new QHBox( this );
263 new QLabel( i18n("Model(opt.): "), temphb ); 263 new QLabel( i18n("Model(opt.): "), temphb );
264 mPhoneModel = new QLineEdit( temphb); 264 mPhoneModel = new QLineEdit( temphb);
265 lay->addWidget( temphb ); 265 lay->addWidget( temphb );
266 // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this ); 266 // mWriteToSim = new QCheckBox( i18n("Write Contacts to SIM card\n(if not, write to phone memory)"), this );
267 // lay->addWidget( mWriteToSim ); 267 // lay->addWidget( mWriteToSim );
268 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) ); 268 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ncontact data on phone!"), this ) );
269 lab->setAlignment (AlignHCenter); 269 lab->setAlignment (AlignHCenter);
270 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 270 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
271 lay->addWidget( ok ); 271 lay->addWidget( ok );
272 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 272 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
273 lay->addWidget( cancel ); 273 lay->addWidget( cancel );
274 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 274 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
275 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 275 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
276 resize( 220, 240 ); 276 resize( 220, 240 );
277 277
278 } 278 }
279 279
280public: 280public:
281 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 281 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
282 QCheckBox* mWriteToSim; 282 QCheckBox* mWriteToSim;
283}; 283};
284 284
285 285
286bool pasteWithNewUid = true; 286bool pasteWithNewUid = true;
287 287
288#ifdef KAB_EMBEDDED 288#ifdef KAB_EMBEDDED
289KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) 289KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name )
290 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 290 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
291 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/ 291 mExtensionManager( 0 ),mConfigureDialog( 0 ),/*US mLdapSearchDialog( 0 ),*/
292 mReadWrite( readWrite ), mModified( false ), mMainWindow(client) 292 mReadWrite( readWrite ), mModified( false ), mMainWindow(client)
293#else //KAB_EMBEDDED 293#else //KAB_EMBEDDED
294KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) 294KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name )
295 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 295 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
296 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), 296 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ),
297 mReadWrite( readWrite ), mModified( false ) 297 mReadWrite( readWrite ), mModified( false )
298#endif //KAB_EMBEDDED 298#endif //KAB_EMBEDDED
299{ 299{
300 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 300 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
301 // syncManager->setBlockSave(false); 301 // syncManager->setBlockSave(false);
302 mIncSearchWidget = 0; 302 mIncSearchWidget = 0;
303 mMiniSplitter = 0; 303 mMiniSplitter = 0;
304 mExtensionBarSplitter = 0; 304 mExtensionBarSplitter = 0;
305 mIsPart = !parent->inherits( "KAddressBookMain" ); 305 mIsPart = !parent->inherits( "KAddressBookMain" );
306 mAddressBook = KABC::StdAddressBook::selfNoLoad(); 306 mAddressBook = KABC::StdAddressBook::selfNoLoad();
307 KABC::StdAddressBook::setAutomaticSave( false ); 307 KABC::StdAddressBook::setAutomaticSave( false );
308 308
309#ifndef KAB_EMBEDDED 309#ifndef KAB_EMBEDDED
310 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); 310 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler );
311#endif //KAB_EMBEDDED 311#endif //KAB_EMBEDDED
312 312
313 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), 313 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ),
314 SLOT( addressBookChanged() ) ); 314 SLOT( addressBookChanged() ) );
315 315
316#if 0 316#if 0
317 // LR moved to addressbook init method 317 // LR moved to addressbook init method
318 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, 318 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization,
319 "X-Department", "KADDRESSBOOK" ); 319 "X-Department", "KADDRESSBOOK" );
320 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, 320 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization,
321 "X-Profession", "KADDRESSBOOK" ); 321 "X-Profession", "KADDRESSBOOK" );
322 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, 322 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization,
323 "X-AssistantsName", "KADDRESSBOOK" ); 323 "X-AssistantsName", "KADDRESSBOOK" );
324 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, 324 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization,
325 "X-ManagersName", "KADDRESSBOOK" ); 325 "X-ManagersName", "KADDRESSBOOK" );
326 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, 326 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal,
327 "X-SpousesName", "KADDRESSBOOK" ); 327 "X-SpousesName", "KADDRESSBOOK" );
328 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, 328 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal,
329 "X-Office", "KADDRESSBOOK" ); 329 "X-Office", "KADDRESSBOOK" );
330 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, 330 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal,
331 "X-IMAddress", "KADDRESSBOOK" ); 331 "X-IMAddress", "KADDRESSBOOK" );
332 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, 332 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal,
333 "X-Anniversary", "KADDRESSBOOK" ); 333 "X-Anniversary", "KADDRESSBOOK" );
334 334
335 //US added this field to become compatible with Opie/qtopia addressbook 335 //US added this field to become compatible with Opie/qtopia addressbook
336 // values can be "female" or "male" or "". An empty field represents undefined. 336 // values can be "female" or "male" or "". An empty field represents undefined.
337 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, 337 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal,
338 "X-Gender", "KADDRESSBOOK" ); 338 "X-Gender", "KADDRESSBOOK" );
339 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, 339 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal,
340 "X-Children", "KADDRESSBOOK" ); 340 "X-Children", "KADDRESSBOOK" );
341 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, 341 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal,
342 "X-FreeBusyUrl", "KADDRESSBOOK" ); 342 "X-FreeBusyUrl", "KADDRESSBOOK" );
343#endif 343#endif
344 initGUI(); 344 initGUI();
345 345
346 mIncSearchWidget->setFocus(); 346 mIncSearchWidget->setFocus();
347 347
348 348
349 connect( mViewManager, SIGNAL( selected( const QString& ) ), 349 connect( mViewManager, SIGNAL( selected( const QString& ) ),
350 SLOT( setContactSelected( const QString& ) ) ); 350 SLOT( setContactSelected( const QString& ) ) );
351 connect( mViewManager, SIGNAL( executed( const QString& ) ), 351 connect( mViewManager, SIGNAL( executed( const QString& ) ),
352 SLOT( executeContact( const QString& ) ) ); 352 SLOT( executeContact( const QString& ) ) );
353 353
354 connect( mViewManager, SIGNAL( deleteRequest( ) ), 354 connect( mViewManager, SIGNAL( deleteRequest( ) ),
355 SLOT( deleteContacts( ) ) ); 355 SLOT( deleteContacts( ) ) );
356 connect( mViewManager, SIGNAL( modified() ), 356 connect( mViewManager, SIGNAL( modified() ),
357 SLOT( setModified() ) ); 357 SLOT( setModified() ) );
358 358
359 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); 359 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) );
360 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); 360 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) );
361 361
362 connect( mXXPortManager, SIGNAL( modified() ), 362 connect( mXXPortManager, SIGNAL( modified() ),
363 SLOT( setModified() ) ); 363 SLOT( setModified() ) );
364 364
365 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), 365 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ),
366 SLOT( incrementalSearchJump( const QString& ) ) ); 366 SLOT( incrementalSearchJump( const QString& ) ) );
367 connect( mIncSearchWidget, SIGNAL( fieldChanged() ), 367 connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
368 mJumpButtonBar, SLOT( recreateButtons() ) ); 368 mJumpButtonBar, SLOT( recreateButtons() ) );
369 369
370 connect( mDetails, SIGNAL( sendEmail( const QString& ) ), 370 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
371 SLOT( sendMail( const QString& ) ) ); 371 SLOT( sendMail( const QString& ) ) );
372 372
373 373
374 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); 374 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&)));
375 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&))); 375 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&)));
376 connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); 376 connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&)));
377 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); 377 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle()));
378 connect( ExternalAppHandler::instance(), SIGNAL (doRingSync()),this, SLOT( doRingSync())); 378 connect( ExternalAppHandler::instance(), SIGNAL (doRingSync()),this, SLOT( doRingSync()));
379 connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog())); 379 connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog()));
380 380
381 381
382#ifndef KAB_EMBEDDED 382#ifndef KAB_EMBEDDED
383 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), 383 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
384 mXXPortManager, SLOT( importVCard( const KURL& ) ) ); 384 mXXPortManager, SLOT( importVCard( const KURL& ) ) );
385 385
386 connect( mDetails, SIGNAL( browse( const QString& ) ), 386 connect( mDetails, SIGNAL( browse( const QString& ) ),
387 SLOT( browse( const QString& ) ) ); 387 SLOT( browse( const QString& ) ) );
388 388
389 389
390 mAddressBookService = new KAddressBookService( this ); 390 mAddressBookService = new KAddressBookService( this );
391 391
392#endif //KAB_EMBEDDED 392#endif //KAB_EMBEDDED
393 393
394 mMessageTimer = new QTimer( this ); 394 mMessageTimer = new QTimer( this );
395 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); 395 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) );
396 mEditorDialog = 0; 396 mEditorDialog = 0;
397 createAddresseeEditorDialog( this ); 397 createAddresseeEditorDialog( this );
398 setModified( false ); 398 setModified( false );
399 mBRdisabled = false; 399 mBRdisabled = false;
400#ifndef DESKTOP_VERSION 400#ifndef DESKTOP_VERSION
401 infrared = 0; 401 infrared = 0;
402#endif 402#endif
403 //toggleBeamReceive( ); 403 //toggleBeamReceive( );
404 mMainWindow->toolBar()->show(); 404 mMainWindow->toolBar()->show();
405 // we have a toolbar repainting error on the Zaurus when starting KA/Pi 405 // we have a toolbar repainting error on the Zaurus when starting KA/Pi
406 //QTimer::singleShot( 10, this , SLOT ( updateToolBar())); 406 //QTimer::singleShot( 10, this , SLOT ( updateToolBar()));
407 QTimer::singleShot( 100, this, SLOT ( loadDataAfterStart() )); 407 QTimer::singleShot( 100, this, SLOT ( loadDataAfterStart() ));
408} 408}
409void KABCore::receiveStart( const QCString& cmsg, const QByteArray& data ) 409void KABCore::receiveStart( const QCString& cmsg, const QByteArray& data )
410{ 410{
411 qDebug("KO: QCOP start message received: %s ", cmsg.data() ); 411 //qDebug("KO: QCOP start message received: %s ", cmsg.data() );
412 mCStringMess = cmsg; 412 mCStringMess = cmsg;
413 mByteData = data; 413 mByteData = data;
414} 414}
415 415
416void KABCore::loadDataAfterStart() 416void KABCore::loadDataAfterStart()
417{ 417{
418 qDebug("KABCore::loadDataAfterStart() "); 418 //qDebug("KABCore::loadDataAfterStart() ");
419 ((StdAddressBook*)mAddressBook)->init( true ); 419 ((StdAddressBook*)mAddressBook)->init( true );
420 mViewManager->refreshView(); 420 mViewManager->refreshView();
421 421
422#ifndef DESKTOP_VERSION 422#ifndef DESKTOP_VERSION
423 disconnect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT (receiveStart ( const QCString &, const QByteArray & ))); 423 disconnect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT (receiveStart ( const QCString &, const QByteArray & )));
424 424
425 QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 425 QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
426 if ( !mCStringMess.isEmpty() ) 426 if ( !mCStringMess.isEmpty() )
427 ExternalAppHandler::instance()->appMessage( mCStringMess, mByteData ); 427 ExternalAppHandler::instance()->appMessage( mCStringMess, mByteData );
428#endif 428#endif
429 QTimer::singleShot( 10, this , SLOT ( updateToolBar())); 429 // QTimer::singleShot( 10, this , SLOT ( updateToolBar()));
430 setCaptionBack(); 430 setCaptionBack();
431} 431}
432void KABCore::updateToolBar() 432void KABCore::updateToolBar()
433{ 433{
434 static int iii = 0; 434 static int iii = 0;
435 ++iii; 435 ++iii;
436 mMainWindow->toolBar()->repaintMe(); 436 mMainWindow->toolBar()->repaintMe();
437 if ( iii < 4 ) 437 if ( iii < 4 )
438 QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar())); 438 QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar()));
439} 439}
440KABCore::~KABCore() 440KABCore::~KABCore()
441{ 441{
442 // save(); 442 // save();
443 //saveSettings(); 443 //saveSettings();
444 //KABPrefs::instance()->writeConfig(); 444 //KABPrefs::instance()->writeConfig();
445 delete AddresseeConfig::instance(); 445 delete AddresseeConfig::instance();
446 mAddressBook = 0; 446 mAddressBook = 0;
447 KABC::StdAddressBook::close(); 447 KABC::StdAddressBook::close();
448 448
449 delete syncManager; 449 delete syncManager;
450#ifndef DESKTOP_VERSION 450#ifndef DESKTOP_VERSION
451 if ( infrared ) 451 if ( infrared )
452 delete infrared; 452 delete infrared;
453#endif 453#endif
454} 454}
455void KABCore::receive( const QCString& cmsg, const QByteArray& data ) 455void KABCore::receive( const QCString& cmsg, const QByteArray& data )
456{ 456{
457 //qDebug("KA: QCOP message received: %s ", cmsg.data() ); 457 //qDebug("KA: QCOP message received: %s ", cmsg.data() );
458 if ( cmsg == "setDocument(QString)" ) { 458 if ( cmsg == "setDocument(QString)" ) {
459 QDataStream stream( data, IO_ReadOnly ); 459 QDataStream stream( data, IO_ReadOnly );
460 QString fileName; 460 QString fileName;
461 stream >> fileName; 461 stream >> fileName;
462 recieve( fileName ); 462 recieve( fileName );
463 return; 463 return;
464 } 464 }
465} 465}
466void KABCore::toggleBeamReceive( ) 466void KABCore::toggleBeamReceive( )
467{ 467{
468 if ( mBRdisabled ) 468 if ( mBRdisabled )
469 return; 469 return;
470#ifndef DESKTOP_VERSION 470#ifndef DESKTOP_VERSION
471 if ( infrared ) { 471 if ( infrared ) {
472 qDebug("KA: AB disable BeamReceive "); 472 qDebug("KA: AB disable BeamReceive ");
473 delete infrared; 473 delete infrared;
474 infrared = 0; 474 infrared = 0;
475 mActionBR->setChecked(false); 475 mActionBR->setChecked(false);
476 return; 476 return;
477 } 477 }
478 qDebug("KA: AB enable BeamReceive "); 478 qDebug("KA: AB enable BeamReceive ");
479 mActionBR->setChecked(true); 479 mActionBR->setChecked(true);
480 480
481 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; 481 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ;
482 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); 482 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& )));
483#endif 483#endif
484} 484}
485 485
486 486
487void KABCore::disableBR(bool b) 487void KABCore::disableBR(bool b)
488{ 488{
489#ifndef DESKTOP_VERSION 489#ifndef DESKTOP_VERSION
490 if ( b ) { 490 if ( b ) {
491 if ( infrared ) { 491 if ( infrared ) {
492 toggleBeamReceive( ); 492 toggleBeamReceive( );
493 } 493 }
494 mBRdisabled = true; 494 mBRdisabled = true;
495 } else { 495 } else {
496 if ( mBRdisabled ) { 496 if ( mBRdisabled ) {
497 mBRdisabled = false; 497 mBRdisabled = false;
498 //toggleBeamReceive( ); 498 //toggleBeamReceive( );
499 } 499 }
500 } 500 }
501#endif 501#endif
502 502
503} 503}
504void KABCore::recieve( QString fn ) 504void KABCore::recieve( QString fn )
505{ 505{
506 //qDebug("KABCore::recieve "); 506 //qDebug("KABCore::recieve ");
507 int count = mAddressBook->importFromFile( fn, true ); 507 int count = mAddressBook->importFromFile( fn, true );
508 if ( count ) 508 if ( count )
509 setModified( true ); 509 setModified( true );
510 mViewManager->refreshView(); 510 mViewManager->refreshView();
511 message(i18n("%1 contact(s) received!").arg( count )); 511 message(i18n("%1 contact(s) received!").arg( count ));
512 topLevelWidget()->showMaximized(); 512 topLevelWidget()->showMaximized();
513 topLevelWidget()->raise(); 513 topLevelWidget()->raise();
514} 514}
515void KABCore::restoreSettings() 515void KABCore::restoreSettings()
516{ 516{
517 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; 517 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce;
518 518
519 bool state; 519 bool state;
520 520
521 if (mMultipleViewsAtOnce) 521 if (mMultipleViewsAtOnce)
522 state = KABPrefs::instance()->mDetailsPageVisible; 522 state = KABPrefs::instance()->mDetailsPageVisible;
523 else 523 else
524 state = false; 524 state = false;
525 525
526 mActionDetails->setChecked( state ); 526 mActionDetails->setChecked( state );
527 setDetailsVisible( state ); 527 setDetailsVisible( state );
528 528
529 state = KABPrefs::instance()->mJumpButtonBarVisible; 529 state = KABPrefs::instance()->mJumpButtonBarVisible;
530 530
531 mActionJumpBar->setChecked( state ); 531 mActionJumpBar->setChecked( state );
532 setJumpButtonBarVisible( state ); 532 setJumpButtonBarVisible( state );
533/*US 533/*US
534 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter; 534 QValueList<int> splitterSize = KABPrefs::instance()->mDetailsSplitter;
535 if ( splitterSize.count() == 0 ) { 535 if ( splitterSize.count() == 0 ) {
536 splitterSize.append( width() / 2 ); 536 splitterSize.append( width() / 2 );
537 splitterSize.append( width() / 2 ); 537 splitterSize.append( width() / 2 );
538 } 538 }
539 mMiniSplitter->setSizes( splitterSize ); 539 mMiniSplitter->setSizes( splitterSize );
540 if ( mExtensionBarSplitter ) { 540 if ( mExtensionBarSplitter ) {
541 splitterSize = KABPrefs::instance()->mExtensionsSplitter; 541 splitterSize = KABPrefs::instance()->mExtensionsSplitter;
542 if ( splitterSize.count() == 0 ) { 542 if ( splitterSize.count() == 0 ) {
543 splitterSize.append( width() / 2 ); 543 splitterSize.append( width() / 2 );
544 splitterSize.append( width() / 2 ); 544 splitterSize.append( width() / 2 );
545 } 545 }
546 mExtensionBarSplitter->setSizes( splitterSize ); 546 mExtensionBarSplitter->setSizes( splitterSize );
547 547
548 } 548 }
549*/ 549*/
550 mViewManager->restoreSettings(); 550 mViewManager->restoreSettings();
551 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField ); 551 mIncSearchWidget->setCurrentItem( KABPrefs::instance()->mCurrentIncSearchField );
552 mExtensionManager->restoreSettings(); 552 mExtensionManager->restoreSettings();
553#ifdef DESKTOP_VERSION 553#ifdef DESKTOP_VERSION
554 int wid = width(); 554 int wid = width();
555 if ( wid < 10 ) 555 if ( wid < 10 )
556 wid = 400; 556 wid = 400;
557#else 557#else
558 int wid = QApplication::desktop()->width(); 558 int wid = QApplication::desktop()->width();
559 if ( wid < 640 ) 559 if ( wid < 640 )
560 wid = QApplication::desktop()->height(); 560 wid = QApplication::desktop()->height();
561#endif 561#endif
562 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter; 562 QValueList<int> splitterSize;// = KABPrefs::instance()->mDetailsSplitter;
563 if ( true /*splitterSize.count() == 0*/ ) { 563 if ( true /*splitterSize.count() == 0*/ ) {
564 splitterSize.append( wid / 2 ); 564 splitterSize.append( wid / 2 );
565 splitterSize.append( wid / 2 ); 565 splitterSize.append( wid / 2 );
566 } 566 }
567 mMiniSplitter->setSizes( splitterSize ); 567 mMiniSplitter->setSizes( splitterSize );
568 if ( mExtensionBarSplitter ) { 568 if ( mExtensionBarSplitter ) {
569 //splitterSize = KABPrefs::instance()->mExtensionsSplitter; 569 //splitterSize = KABPrefs::instance()->mExtensionsSplitter;
570 if ( true /*splitterSize.count() == 0*/ ) { 570 if ( true /*splitterSize.count() == 0*/ ) {
571 splitterSize.append( wid / 2 ); 571 splitterSize.append( wid / 2 );
572 splitterSize.append( wid / 2 ); 572 splitterSize.append( wid / 2 );
573 } 573 }
574 mExtensionBarSplitter->setSizes( splitterSize ); 574 mExtensionBarSplitter->setSizes( splitterSize );
575 575
576 } 576 }
577#ifdef DESKTOP_VERSION 577#ifdef DESKTOP_VERSION
578 KConfig *config = KABPrefs::instance()->getConfig(); 578 KConfig *config = KABPrefs::instance()->getConfig();
579 config->setGroup("WidgetLayout"); 579 config->setGroup("WidgetLayout");
580 QStringList list; 580 QStringList list;
581 list = config->readListEntry("MainLayout"); 581 list = config->readListEntry("MainLayout");
582 int x,y,w,h; 582 int x,y,w,h;
583 if ( ! list.isEmpty() ) { 583 if ( ! list.isEmpty() ) {
584 x = list[0].toInt(); 584 x = list[0].toInt();
585 y = list[1].toInt(); 585 y = list[1].toInt();
586 w = list[2].toInt(); 586 w = list[2].toInt();
587 h = list[3].toInt(); 587 h = list[3].toInt();
588 KApplication::testCoords( &x,&y,&w,&h ); 588 KApplication::testCoords( &x,&y,&w,&h );
589 topLevelWidget()->setGeometry(x,y,w,h); 589 topLevelWidget()->setGeometry(x,y,w,h);
590 590
591 } else { 591 } else {
592 topLevelWidget()->setGeometry( 40 ,40 , 640, 440); 592 topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
593 } 593 }
594#endif 594#endif
595} 595}
596 596
597void KABCore::saveSettings() 597void KABCore::saveSettings()
598{ 598{
599 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked(); 599 KABPrefs::instance()->mJumpButtonBarVisible = mActionJumpBar->isChecked();
600 if ( mExtensionBarSplitter ) 600 if ( mExtensionBarSplitter )
601 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); 601 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
602 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked(); 602 KABPrefs::instance()->mDetailsPageVisible = mActionDetails->isChecked();
603 KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes(); 603 KABPrefs::instance()->mDetailsSplitter = mMiniSplitter->sizes();
604#ifndef KAB_EMBEDDED 604#ifndef KAB_EMBEDDED
605 605
606 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); 606 KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes();
607 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); 607 KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes();
608#endif //KAB_EMBEDDED 608#endif //KAB_EMBEDDED
609 mExtensionManager->saveSettings(); 609 mExtensionManager->saveSettings();
610 mViewManager->saveSettings(); 610 mViewManager->saveSettings();
611 611
612 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); 612 KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem();
613 613
614 KABPrefs::instance()->writeConfig(); 614 KABPrefs::instance()->writeConfig();
615 qDebug("KA: KABCore::saveSettings() "); 615 qDebug("KA: KABCore::saveSettings() ");
616} 616}
617 617
618KABC::AddressBook *KABCore::addressBook() const 618KABC::AddressBook *KABCore::addressBook() const
619{ 619{
620 return mAddressBook; 620 return mAddressBook;
621} 621}
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp
index 8fe3ee0..c417226 100644
--- a/kaddressbook/kaddressbookmain.cpp
+++ b/kaddressbook/kaddressbookmain.cpp
@@ -1,235 +1,235 @@
1/* 1/*
2 This file is part of KAddressbook. 2 This file is part of KAddressbook.
3 Copyright (c) 1999 Don Sanders <dsanders@kde.org> 3 Copyright (c) 1999 Don Sanders <dsanders@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#ifdef KAB_EMBEDDED 24#ifdef KAB_EMBEDDED
25#include "kabprefs.h" 25#include "kabprefs.h"
26#include <kglobal.h> 26#include <kglobal.h>
27#include <qmessagebox.h> 27#include <qmessagebox.h>
28#include <qtoolbar.h> 28#include <qtoolbar.h>
29#include <qapplication.h> 29#include <qapplication.h>
30#else //KAB_EMBEDDED 30#else //KAB_EMBEDDED
31#include <kedittoolbar.h> 31#include <kedittoolbar.h>
32#include <kkeydialog.h> 32#include <kkeydialog.h>
33#include <kmessagebox.h> 33#include <kmessagebox.h>
34#include <kstatusbar.h> 34#include <kstatusbar.h>
35#endif //KAB_EMBEDDED 35#endif //KAB_EMBEDDED
36#include <klocale.h> 36#include <klocale.h>
37 37
38#include "kabcore.h" 38#include "kabcore.h"
39#include "kaddressbookmain.h" 39#include "kaddressbookmain.h"
40#include "kactioncollection.h" 40#include "kactioncollection.h"
41 41
42#ifdef KAB_EMBEDDED 42#ifdef KAB_EMBEDDED
43KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "adrressbook" ) 43KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "abmain" )
44#else //KAB_EMBEDDED 44#else //KAB_EMBEDDED
45//MOC_SKIP_BEGIN 45//MOC_SKIP_BEGIN
46KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 ) 46KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 )
47//MOC_SKIP_END 47//MOC_SKIP_END
48#endif //KAB_EMBEDDED 48#endif //KAB_EMBEDDED
49{ 49{
50 setIcon(SmallIcon( "ka24" ) ); 50 setIcon(SmallIcon( "ka24" ) );
51#if 0 51#if 0
52 //US for embedded systems, create the toolbar before we initiate KABCore. 52 //US for embedded systems, create the toolbar before we initiate KABCore.
53 // KABCore will fill the toolbar with menues and icons 53 // KABCore will fill the toolbar with menues and icons
54 QMainWindow::ToolBarDock tbd; 54 QMainWindow::ToolBarDock tbd;
55 tbd = Top; 55 tbd = Top;
56 iconToolBar = new QToolBar( this ); 56 iconToolBar = new QToolBar( this );
57 addToolBar (iconToolBar , tbd ); 57 addToolBar (iconToolBar , tbd );
58 iconToolBar->setHorizontalStretchable(true); 58 iconToolBar->setHorizontalStretchable(true);
59//US iconToolBar->setWidth(300); 59//US iconToolBar->setWidth(300);
60#endif // 0 60#endif // 0
61 61
62 mCore = new KABCore( this, true, this ); 62 mCore = new KABCore( this, true, this );
63 63
64#ifdef KAB_EMBEDDED 64#ifdef KAB_EMBEDDED
65 setCaption( i18n( "KAddressbook/Pi" ) ); 65 setCaption( i18n( "KAddressbook/Pi" ) );
66#else //KAB_EMBEDDED 66#else //KAB_EMBEDDED
67 setCaption( i18n( "Address Book Browser" ) ); 67 setCaption( i18n( "Address Book Browser" ) );
68#endif //KAB_EMBEDDED 68#endif //KAB_EMBEDDED
69 69
70 //mCore->restoreSettings(); 70 //mCore->restoreSettings();
71 71
72 initActions(); 72 initActions();
73 73
74 setCentralWidget( mCore ); 74 setCentralWidget( mCore );
75 75
76//US statusBar()->show(); 76//US statusBar()->show();
77 77
78#ifndef KAB_EMBEDDED 78#ifndef KAB_EMBEDDED
79 setStandardToolBarMenuEnabled(true); 79 setStandardToolBarMenuEnabled(true);
80 80
81 createGUI( "kaddressbookui.rc", false ); 81 createGUI( "kaddressbookui.rc", false );
82 82
83 83
84#endif //KAB_EMBEDDED 84#endif //KAB_EMBEDDED
85 setAutoSaveSettings(); 85 setAutoSaveSettings();
86 mCore->restoreSettings(); 86 mCore->restoreSettings();
87#ifndef DESKTOP_VERSION 87#ifndef DESKTOP_VERSION
88 QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), mCore, SLOT (receiveStart ( const QCString &, const QByteArray & ))); 88 QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), mCore, SLOT (receiveStart ( const QCString &, const QByteArray & )));
89#endif 89#endif
90} 90}
91 91
92KAddressBookMain::~KAddressBookMain() 92KAddressBookMain::~KAddressBookMain()
93{ 93{
94 // mCore->saveSettings(); 94 // mCore->saveSettings();
95} 95}
96 96
97void KAddressBookMain::showMinimized () 97void KAddressBookMain::showMinimized ()
98{ 98{
99 QWidget::showMinimized () ; 99 QWidget::showMinimized () ;
100} 100}
101void KAddressBookMain::addEmail( QString addr ) 101void KAddressBookMain::addEmail( QString addr )
102{ 102{
103 mCore->addEmail( addr ); 103 mCore->addEmail( addr );
104} 104}
105 105
106#ifndef KAB_EMBEDDED 106#ifndef KAB_EMBEDDED
107ASYNC KAddressBookMain::showContactEditor( QString uid ) 107ASYNC KAddressBookMain::showContactEditor( QString uid )
108{ 108{
109 mCore->editContact( uid ); 109 mCore->editContact( uid );
110} 110}
111#endif //KAB_EMBEDDED 111#endif //KAB_EMBEDDED
112void KAddressBookMain::newContact() 112void KAddressBookMain::newContact()
113{ 113{
114 mCore->newContact(); 114 mCore->newContact();
115} 115}
116 116
117QString KAddressBookMain::getNameByPhone( QString phone ) 117QString KAddressBookMain::getNameByPhone( QString phone )
118{ 118{
119 return mCore->getNameByPhone( phone ); 119 return mCore->getNameByPhone( phone );
120} 120}
121 121
122void KAddressBookMain::save() 122void KAddressBookMain::save()
123{ 123{
124 mCore->save(); 124 mCore->save();
125} 125}
126 126
127void KAddressBookMain::exit() 127void KAddressBookMain::exit()
128{ 128{
129 close( ); 129 close( );
130} 130}
131 131
132void KAddressBookMain::saveProperties( KConfig* ) 132void KAddressBookMain::saveProperties( KConfig* )
133{ 133{
134} 134}
135 135
136void KAddressBookMain::readProperties( KConfig* ) 136void KAddressBookMain::readProperties( KConfig* )
137{ 137{
138} 138}
139 139
140void KAddressBookMain::initActions() 140void KAddressBookMain::initActions()
141{ 141{
142#ifndef KAB_EMBEDDED 142#ifndef KAB_EMBEDDED
143 KStdAction::quit( this, SLOT( close() ), actionCollection() ); 143 KStdAction::quit( this, SLOT( close() ), actionCollection() );
144 KStdAction::configureToolbars( this, SLOT( configureToolbars() ), actionCollection() ); 144 KStdAction::configureToolbars( this, SLOT( configureToolbars() ), actionCollection() );
145#else //KAB_EMBEDDED 145#else //KAB_EMBEDDED
146 //US: transfered the setup of the actions into KABCore 146 //US: transfered the setup of the actions into KABCore
147#endif //KAB_EMBEDDED 147#endif //KAB_EMBEDDED
148 148
149 149
150} 150}
151 151
152//US new method to setup menues and toolbars on embedded systems 152//US new method to setup menues and toolbars on embedded systems
153#ifdef KAB_EMBEDDED 153#ifdef KAB_EMBEDDED
154/* 154/*
155QToolBar * KAddressBookMain::getIconToolBar() 155QToolBar * KAddressBookMain::getIconToolBar()
156{ 156{
157 return iconToolBar; 157 return iconToolBar;
158} 158}
159*/ 159*/
160 160
161void KAddressBookMain::createGUI() 161void KAddressBookMain::createGUI()
162{ 162{
163 163
164 164
165 165
166} 166}
167#endif //KAB_EMBEDDED 167#endif //KAB_EMBEDDED
168 168
169void KAddressBookMain::configureToolbars() 169void KAddressBookMain::configureToolbars()
170{ 170{
171#ifndef KAB_EMBEDDED 171#ifndef KAB_EMBEDDED
172 saveMainWindowSettings( KGlobal::config(), "MainWindow" ); 172 saveMainWindowSettings( KGlobal::config(), "MainWindow" );
173 173
174 KEditToolbar dlg( factory() ); 174 KEditToolbar dlg( factory() );
175 connect( &dlg, SIGNAL( newToolbarConfig() ), SLOT( slotNewToolbarConfig() ) ); 175 connect( &dlg, SIGNAL( newToolbarConfig() ), SLOT( slotNewToolbarConfig() ) );
176 176
177 dlg.exec(); 177 dlg.exec();
178#else //KAB_EMBEDDED 178#else //KAB_EMBEDDED
179 qDebug("KAddressBookMain::configureToolbars() not implemented by ulf" ); 179 qDebug("KAddressBookMain::configureToolbars() not implemented by ulf" );
180#endif //KAB_EMBEDDED 180#endif //KAB_EMBEDDED
181} 181}
182 182
183void KAddressBookMain::slotNewToolbarConfig() 183void KAddressBookMain::slotNewToolbarConfig()
184{ 184{
185#ifndef KAB_EMBEDDED 185#ifndef KAB_EMBEDDED
186 applyMainWindowSettings( KGlobal::config(), "MainWindow" ); 186 applyMainWindowSettings( KGlobal::config(), "MainWindow" );
187#else //KAB_EMBEDDED 187#else //KAB_EMBEDDED
188 qDebug("KAddressBookMain::slotNewToolbarConfig() not implemented by ulf" ); 188 qDebug("KAddressBookMain::slotNewToolbarConfig() not implemented by ulf" );
189#endif //KAB_EMBEDDED 189#endif //KAB_EMBEDDED
190} 190}
191 191
192void KAddressBookMain::configureKeys() 192void KAddressBookMain::configureKeys()
193{ 193{
194#ifndef KAB_EMBEDDED 194#ifndef KAB_EMBEDDED
195 KKeyDialog::configureKeys( actionCollection(), xmlFile(), true, this ); 195 KKeyDialog::configureKeys( actionCollection(), xmlFile(), true, this );
196#else //KAB_EMBEDDED 196#else //KAB_EMBEDDED
197 qDebug("KAddressBookMain::configureKeys() not implemented by ulf" ); 197 qDebug("KAddressBookMain::configureKeys() not implemented by ulf" );
198#endif //KAB_EMBEDDED 198#endif //KAB_EMBEDDED
199} 199}
200 200
201void KAddressBookMain::closeEvent( QCloseEvent* ce ) 201void KAddressBookMain::closeEvent( QCloseEvent* ce )
202{ 202{
203 bool mModified = mCore->modified(); 203 bool mModified = mCore->modified();
204 bool mAskForQuit = KABPrefs::instance()->mAskForQuit; 204 bool mAskForQuit = KABPrefs::instance()->mAskForQuit;
205 205
206 QString mess = i18n( "Close KA/Pi?"); 206 QString mess = i18n( "Close KA/Pi?");
207 if ( mModified == true ) 207 if ( mModified == true )
208 mess += i18n( "\nChanges will be saved!"); 208 mess += i18n( "\nChanges will be saved!");
209 else 209 else
210 mess += i18n( "\nNo unsaved changes detected!\nNothing will be saved!"); 210 mess += i18n( "\nNo unsaved changes detected!\nNothing will be saved!");
211 211
212 bool mQuit = true; 212 bool mQuit = true;
213 213
214 214
215 if (mAskForQuit) 215 if (mAskForQuit)
216 { 216 {
217 217
218 int res = QMessageBox::information( this, "KA/Pi", mess , i18n("Yes!"), i18n("No"), 0, 0 ); 218 int res = QMessageBox::information( this, "KA/Pi", mess , i18n("Yes!"), i18n("No"), 0, 0 );
219 if (res == 0) 219 if (res == 0)
220 mQuit = true; 220 mQuit = true;
221 else 221 else
222 mQuit = false; 222 mQuit = false;
223 } 223 }
224 224
225 if (mQuit == false) 225 if (mQuit == false)
226 return; 226 return;
227 227
228 if (mModified == true) 228 if (mModified == true)
229 { 229 {
230 save(); 230 save();
231 mCore->saveSettings(); 231 mCore->saveSettings();
232 //KABPrefs::instance()->writeConfig(); 232 //KABPrefs::instance()->writeConfig();
233 } 233 }
234 234
235 ce->accept(); 235 ce->accept();