-rw-r--r-- | kaddressbook/kabcore.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/kaddressbookmain.cpp | 2 |
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 | |||
@@ -283,275 +283,275 @@ public: | |||
283 | }; | 283 | }; |
284 | 284 | ||
285 | 285 | ||
286 | bool pasteWithNewUid = true; | 286 | bool pasteWithNewUid = true; |
287 | 287 | ||
288 | #ifdef KAB_EMBEDDED | 288 | #ifdef KAB_EMBEDDED |
289 | KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, const char *name ) | 289 | KABCore::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 |
294 | KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) | 294 | KABCore::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 | } |
409 | void KABCore::receiveStart( const QCString& cmsg, const QByteArray& data ) | 409 | void 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 | ||
416 | void KABCore::loadDataAfterStart() | 416 | void 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 | } |
432 | void KABCore::updateToolBar() | 432 | void 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 | } |
440 | KABCore::~KABCore() | 440 | KABCore::~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 | } |
455 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) | 455 | void 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 | } |
466 | void KABCore::toggleBeamReceive( ) | 466 | void 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 | ||
487 | void KABCore::disableBR(bool b) | 487 | void 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 | } |
504 | void KABCore::recieve( QString fn ) | 504 | void 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 | } |
515 | void KABCore::restoreSettings() | 515 | void 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 |
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp index 8fe3ee0..c417226 100644 --- a/kaddressbook/kaddressbookmain.cpp +++ b/kaddressbook/kaddressbookmain.cpp | |||
@@ -1,171 +1,171 @@ | |||
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 |
43 | KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "adrressbook" ) | 43 | KAddressBookMain::KAddressBookMain() : KMainWindow( 0, "abmain" ) |
44 | #else //KAB_EMBEDDED | 44 | #else //KAB_EMBEDDED |
45 | //MOC_SKIP_BEGIN | 45 | //MOC_SKIP_BEGIN |
46 | KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainWindow( 0 ) | 46 | KAddressBookMain::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 | ||
92 | KAddressBookMain::~KAddressBookMain() | 92 | KAddressBookMain::~KAddressBookMain() |
93 | { | 93 | { |
94 | // mCore->saveSettings(); | 94 | // mCore->saveSettings(); |
95 | } | 95 | } |
96 | 96 | ||
97 | void KAddressBookMain::showMinimized () | 97 | void KAddressBookMain::showMinimized () |
98 | { | 98 | { |
99 | QWidget::showMinimized () ; | 99 | QWidget::showMinimized () ; |
100 | } | 100 | } |
101 | void KAddressBookMain::addEmail( QString addr ) | 101 | void 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 |
107 | ASYNC KAddressBookMain::showContactEditor( QString uid ) | 107 | ASYNC KAddressBookMain::showContactEditor( QString uid ) |
108 | { | 108 | { |
109 | mCore->editContact( uid ); | 109 | mCore->editContact( uid ); |
110 | } | 110 | } |
111 | #endif //KAB_EMBEDDED | 111 | #endif //KAB_EMBEDDED |
112 | void KAddressBookMain::newContact() | 112 | void KAddressBookMain::newContact() |
113 | { | 113 | { |
114 | mCore->newContact(); | 114 | mCore->newContact(); |
115 | } | 115 | } |
116 | 116 | ||
117 | QString KAddressBookMain::getNameByPhone( QString phone ) | 117 | QString KAddressBookMain::getNameByPhone( QString phone ) |
118 | { | 118 | { |
119 | return mCore->getNameByPhone( phone ); | 119 | return mCore->getNameByPhone( phone ); |
120 | } | 120 | } |
121 | 121 | ||
122 | void KAddressBookMain::save() | 122 | void KAddressBookMain::save() |
123 | { | 123 | { |
124 | mCore->save(); | 124 | mCore->save(); |
125 | } | 125 | } |
126 | 126 | ||
127 | void KAddressBookMain::exit() | 127 | void KAddressBookMain::exit() |
128 | { | 128 | { |
129 | close( ); | 129 | close( ); |
130 | } | 130 | } |
131 | 131 | ||
132 | void KAddressBookMain::saveProperties( KConfig* ) | 132 | void KAddressBookMain::saveProperties( KConfig* ) |
133 | { | 133 | { |
134 | } | 134 | } |
135 | 135 | ||
136 | void KAddressBookMain::readProperties( KConfig* ) | 136 | void KAddressBookMain::readProperties( KConfig* ) |
137 | { | 137 | { |
138 | } | 138 | } |
139 | 139 | ||
140 | void KAddressBookMain::initActions() | 140 | void 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 | /* |
155 | QToolBar * KAddressBookMain::getIconToolBar() | 155 | QToolBar * KAddressBookMain::getIconToolBar() |
156 | { | 156 | { |
157 | return iconToolBar; | 157 | return iconToolBar; |
158 | } | 158 | } |
159 | */ | 159 | */ |
160 | 160 | ||
161 | void KAddressBookMain::createGUI() | 161 | void KAddressBookMain::createGUI() |
162 | { | 162 | { |
163 | 163 | ||
164 | 164 | ||
165 | 165 | ||
166 | } | 166 | } |
167 | #endif //KAB_EMBEDDED | 167 | #endif //KAB_EMBEDDED |
168 | 168 | ||
169 | void KAddressBookMain::configureToolbars() | 169 | void KAddressBookMain::configureToolbars() |
170 | { | 170 | { |
171 | #ifndef KAB_EMBEDDED | 171 | #ifndef KAB_EMBEDDED |