summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Unidiff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 5ef61b1..e34951a 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -306,193 +306,193 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
306 KABC::StdAddressBook::setAutomaticSave( false ); 306 KABC::StdAddressBook::setAutomaticSave( false );
307 307
308#ifndef KAB_EMBEDDED 308#ifndef KAB_EMBEDDED
309 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); 309 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler );
310#endif //KAB_EMBEDDED 310#endif //KAB_EMBEDDED
311 311
312 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), 312 connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ),
313 SLOT( addressBookChanged() ) ); 313 SLOT( addressBookChanged() ) );
314 314
315#if 0 315#if 0
316 // LR moved to addressbook init method 316 // LR moved to addressbook init method
317 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, 317 mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization,
318 "X-Department", "KADDRESSBOOK" ); 318 "X-Department", "KADDRESSBOOK" );
319 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, 319 mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization,
320 "X-Profession", "KADDRESSBOOK" ); 320 "X-Profession", "KADDRESSBOOK" );
321 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, 321 mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization,
322 "X-AssistantsName", "KADDRESSBOOK" ); 322 "X-AssistantsName", "KADDRESSBOOK" );
323 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, 323 mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization,
324 "X-ManagersName", "KADDRESSBOOK" ); 324 "X-ManagersName", "KADDRESSBOOK" );
325 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, 325 mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal,
326 "X-SpousesName", "KADDRESSBOOK" ); 326 "X-SpousesName", "KADDRESSBOOK" );
327 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, 327 mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal,
328 "X-Office", "KADDRESSBOOK" ); 328 "X-Office", "KADDRESSBOOK" );
329 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, 329 mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal,
330 "X-IMAddress", "KADDRESSBOOK" ); 330 "X-IMAddress", "KADDRESSBOOK" );
331 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, 331 mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal,
332 "X-Anniversary", "KADDRESSBOOK" ); 332 "X-Anniversary", "KADDRESSBOOK" );
333 333
334 //US added this field to become compatible with Opie/qtopia addressbook 334 //US added this field to become compatible with Opie/qtopia addressbook
335 // values can be "female" or "male" or "". An empty field represents undefined. 335 // values can be "female" or "male" or "". An empty field represents undefined.
336 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, 336 mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal,
337 "X-Gender", "KADDRESSBOOK" ); 337 "X-Gender", "KADDRESSBOOK" );
338 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, 338 mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal,
339 "X-Children", "KADDRESSBOOK" ); 339 "X-Children", "KADDRESSBOOK" );
340 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, 340 mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal,
341 "X-FreeBusyUrl", "KADDRESSBOOK" ); 341 "X-FreeBusyUrl", "KADDRESSBOOK" );
342#endif 342#endif
343 initGUI(); 343 initGUI();
344 344
345 mIncSearchWidget->setFocus(); 345 mIncSearchWidget->setFocus();
346 346
347 347
348 connect( mViewManager, SIGNAL( selected( const QString& ) ), 348 connect( mViewManager, SIGNAL( selected( const QString& ) ),
349 SLOT( setContactSelected( const QString& ) ) ); 349 SLOT( setContactSelected( const QString& ) ) );
350 connect( mViewManager, SIGNAL( executed( const QString& ) ), 350 connect( mViewManager, SIGNAL( executed( const QString& ) ),
351 SLOT( executeContact( const QString& ) ) ); 351 SLOT( executeContact( const QString& ) ) );
352 352
353 connect( mViewManager, SIGNAL( deleteRequest( ) ), 353 connect( mViewManager, SIGNAL( deleteRequest( ) ),
354 SLOT( deleteContacts( ) ) ); 354 SLOT( deleteContacts( ) ) );
355 connect( mViewManager, SIGNAL( modified() ), 355 connect( mViewManager, SIGNAL( modified() ),
356 SLOT( setModified() ) ); 356 SLOT( setModified() ) );
357 357
358 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); 358 connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) );
359 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); 359 connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) );
360 360
361 connect( mXXPortManager, SIGNAL( modified() ), 361 connect( mXXPortManager, SIGNAL( modified() ),
362 SLOT( setModified() ) ); 362 SLOT( setModified() ) );
363 363
364 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), 364 connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ),
365 SLOT( incrementalSearchJump( const QString& ) ) ); 365 SLOT( incrementalSearchJump( const QString& ) ) );
366 connect( mIncSearchWidget, SIGNAL( fieldChanged() ), 366 connect( mIncSearchWidget, SIGNAL( fieldChanged() ),
367 mJumpButtonBar, SLOT( recreateButtons() ) ); 367 mJumpButtonBar, SLOT( recreateButtons() ) );
368 368
369 connect( mDetails, SIGNAL( sendEmail( const QString& ) ), 369 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
370 SLOT( sendMail( const QString& ) ) ); 370 SLOT( sendMail( const QString& ) ) );
371 371
372 372
373 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); 373 connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&)));
374 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&))); 374 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 (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); 375 connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&)));
376 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); 376 connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle()));
377 connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog())); 377 connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog()));
378 378
379 379
380#ifndef KAB_EMBEDDED 380#ifndef KAB_EMBEDDED
381 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), 381 connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
382 mXXPortManager, SLOT( importVCard( const KURL& ) ) ); 382 mXXPortManager, SLOT( importVCard( const KURL& ) ) );
383 383
384 connect( mDetails, SIGNAL( browse( const QString& ) ), 384 connect( mDetails, SIGNAL( browse( const QString& ) ),
385 SLOT( browse( const QString& ) ) ); 385 SLOT( browse( const QString& ) ) );
386 386
387 387
388 mAddressBookService = new KAddressBookService( this ); 388 mAddressBookService = new KAddressBookService( this );
389 389
390#endif //KAB_EMBEDDED 390#endif //KAB_EMBEDDED
391 391
392 mMessageTimer = new QTimer( this ); 392 mMessageTimer = new QTimer( this );
393 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); 393 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) );
394 mEditorDialog = 0; 394 mEditorDialog = 0;
395 createAddresseeEditorDialog( this ); 395 createAddresseeEditorDialog( this );
396 setModified( false ); 396 setModified( false );
397 mBRdisabled = false; 397 mBRdisabled = false;
398#ifndef DESKTOP_VERSION 398#ifndef DESKTOP_VERSION
399 infrared = 0; 399 infrared = 0;
400#endif 400#endif
401 //toggleBeamReceive( ); 401 //toggleBeamReceive( );
402 //mMainWindow->toolBar()->show(); 402 mMainWindow->toolBar()->show();
403 // we have a toolbar repainting error on the Zaurus when starting KA/Pi 403 // we have a toolbar repainting error on the Zaurus when starting KA/Pi
404 QTimer::singleShot( 10, this , SLOT ( updateToolBar())); 404 QTimer::singleShot( 10, this , SLOT ( updateToolBar()));
405} 405}
406 406
407void KABCore::updateToolBar() 407void KABCore::updateToolBar()
408{ 408{
409 static int iii = 0; 409 static int iii = 0;
410 ++iii; 410 ++iii;
411 mMainWindow->toolBar()->repaintMe(); 411 mMainWindow->toolBar()->repaintMe();
412 if ( iii < 4 ) 412 if ( iii < 4 )
413 QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar())); 413 QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar()));
414} 414}
415KABCore::~KABCore() 415KABCore::~KABCore()
416{ 416{
417 // save(); 417 // save();
418 //saveSettings(); 418 //saveSettings();
419 //KABPrefs::instance()->writeConfig(); 419 //KABPrefs::instance()->writeConfig();
420 delete AddresseeConfig::instance(); 420 delete AddresseeConfig::instance();
421 mAddressBook = 0; 421 mAddressBook = 0;
422 KABC::StdAddressBook::close(); 422 KABC::StdAddressBook::close();
423 423
424 delete syncManager; 424 delete syncManager;
425#ifndef DESKTOP_VERSION 425#ifndef DESKTOP_VERSION
426 if ( infrared ) 426 if ( infrared )
427 delete infrared; 427 delete infrared;
428#endif 428#endif
429} 429}
430void KABCore::receive( const QCString& cmsg, const QByteArray& data ) 430void KABCore::receive( const QCString& cmsg, const QByteArray& data )
431{ 431{
432 //qDebug("KA: QCOP message received: %s ", cmsg.data() ); 432 //qDebug("KA: QCOP message received: %s ", cmsg.data() );
433 if ( cmsg == "setDocument(QString)" ) { 433 if ( cmsg == "setDocument(QString)" ) {
434 QDataStream stream( data, IO_ReadOnly ); 434 QDataStream stream( data, IO_ReadOnly );
435 QString fileName; 435 QString fileName;
436 stream >> fileName; 436 stream >> fileName;
437 recieve( fileName ); 437 recieve( fileName );
438 return; 438 return;
439 } 439 }
440} 440}
441void KABCore::toggleBeamReceive( ) 441void KABCore::toggleBeamReceive( )
442{ 442{
443 if ( mBRdisabled ) 443 if ( mBRdisabled )
444 return; 444 return;
445#ifndef DESKTOP_VERSION 445#ifndef DESKTOP_VERSION
446 if ( infrared ) { 446 if ( infrared ) {
447 qDebug("KA: AB disable BeamReceive "); 447 qDebug("KA: AB disable BeamReceive ");
448 delete infrared; 448 delete infrared;
449 infrared = 0; 449 infrared = 0;
450 mActionBR->setChecked(false); 450 mActionBR->setChecked(false);
451 return; 451 return;
452 } 452 }
453 qDebug("KA: AB enable BeamReceive "); 453 qDebug("KA: AB enable BeamReceive ");
454 mActionBR->setChecked(true); 454 mActionBR->setChecked(true);
455 455
456 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; 456 infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ;
457 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); 457 QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& )));
458#endif 458#endif
459} 459}
460 460
461 461
462void KABCore::disableBR(bool b) 462void KABCore::disableBR(bool b)
463{ 463{
464#ifndef DESKTOP_VERSION 464#ifndef DESKTOP_VERSION
465 if ( b ) { 465 if ( b ) {
466 if ( infrared ) { 466 if ( infrared ) {
467 toggleBeamReceive( ); 467 toggleBeamReceive( );
468 } 468 }
469 mBRdisabled = true; 469 mBRdisabled = true;
470 } else { 470 } else {
471 if ( mBRdisabled ) { 471 if ( mBRdisabled ) {
472 mBRdisabled = false; 472 mBRdisabled = false;
473 //toggleBeamReceive( ); 473 //toggleBeamReceive( );
474 } 474 }
475 } 475 }
476#endif 476#endif
477 477
478} 478}
479void KABCore::recieve( QString fn ) 479void KABCore::recieve( QString fn )
480{ 480{
481 //qDebug("KABCore::recieve "); 481 //qDebug("KABCore::recieve ");
482 int count = mAddressBook->importFromFile( fn, true ); 482 int count = mAddressBook->importFromFile( fn, true );
483 if ( count ) 483 if ( count )
484 setModified( true ); 484 setModified( true );
485 mViewManager->refreshView(); 485 mViewManager->refreshView();
486 message(i18n("%1 contact(s) received!").arg( count )); 486 message(i18n("%1 contact(s) received!").arg( count ));
487 topLevelWidget()->showMaximized(); 487 topLevelWidget()->showMaximized();
488 topLevelWidget()->raise(); 488 topLevelWidget()->raise();
489} 489}
490void KABCore::restoreSettings() 490void KABCore::restoreSettings()
491{ 491{
492 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce; 492 mMultipleViewsAtOnce = KABPrefs::instance()->mMultipleViewsAtOnce;
493 493
494 bool state; 494 bool state;
495 495
496 if (mMultipleViewsAtOnce) 496 if (mMultipleViewsAtOnce)
497 state = KABPrefs::instance()->mDetailsPageVisible; 497 state = KABPrefs::instance()->mDetailsPageVisible;
498 else 498 else
@@ -2080,192 +2080,193 @@ void KABCore::initActions()
2080 SLOT( setFormattedName() ), actionCollection(), 2080 SLOT( setFormattedName() ), actionCollection(),
2081 "set_formatted" ); 2081 "set_formatted" );
2082 2082
2083 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this, 2083 mActionManageCategories= new KAction( i18n( "Manage new categories..." ), 0, this,
2084 SLOT( manageCategories() ), actionCollection(), 2084 SLOT( manageCategories() ), actionCollection(),
2085 "remove_voice" ); 2085 "remove_voice" );
2086 2086
2087 2087
2088 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this, 2088 mActionImportOL = new KAction( i18n( "Import from Outlook..." ), 0, this,
2089 SLOT( importFromOL() ), actionCollection(), 2089 SLOT( importFromOL() ), actionCollection(),
2090 "import_OL" ); 2090 "import_OL" );
2091#ifdef KAB_EMBEDDED 2091#ifdef KAB_EMBEDDED
2092 mActionLicence = new KAction( i18n( "Licence" ), 0, 2092 mActionLicence = new KAction( i18n( "Licence" ), 0,
2093 this, SLOT( showLicence() ), actionCollection(), 2093 this, SLOT( showLicence() ), actionCollection(),
2094 "licence_about_data" ); 2094 "licence_about_data" );
2095 mActionFaq = new KAction( i18n( "Faq" ), 0, 2095 mActionFaq = new KAction( i18n( "Faq" ), 0,
2096 this, SLOT( faq() ), actionCollection(), 2096 this, SLOT( faq() ), actionCollection(),
2097 "faq_about_data" ); 2097 "faq_about_data" );
2098 mActionWN = new KAction( i18n( "What's New?" ), 0, 2098 mActionWN = new KAction( i18n( "What's New?" ), 0,
2099 this, SLOT( whatsnew() ), actionCollection(), 2099 this, SLOT( whatsnew() ), actionCollection(),
2100 "wn" ); 2100 "wn" );
2101 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, 2101 mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0,
2102 this, SLOT( synchowto() ), actionCollection(), 2102 this, SLOT( synchowto() ), actionCollection(),
2103 "sync" ); 2103 "sync" );
2104 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, 2104 mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0,
2105 this, SLOT( kdesynchowto() ), actionCollection(), 2105 this, SLOT( kdesynchowto() ), actionCollection(),
2106 "kdesync" ); 2106 "kdesync" );
2107 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, 2107 mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0,
2108 this, SLOT( multisynchowto() ), actionCollection(), 2108 this, SLOT( multisynchowto() ), actionCollection(),
2109 "multisync" ); 2109 "multisync" );
2110 2110
2111 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, 2111 mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0,
2112 this, SLOT( createAboutData() ), actionCollection(), 2112 this, SLOT( createAboutData() ), actionCollection(),
2113 "kaddressbook_about_data" ); 2113 "kaddressbook_about_data" );
2114#endif //KAB_EMBEDDED 2114#endif //KAB_EMBEDDED
2115 2115
2116 clipboardDataChanged(); 2116 clipboardDataChanged();
2117 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2117 connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2118 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); 2118 connect( RedoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) );
2119} 2119}
2120 2120
2121//US we need this function, to plug all actions into the correct menues. 2121//US we need this function, to plug all actions into the correct menues.
2122// KDE uses a XML format to plug the actions, but we work her without this overhead. 2122// KDE uses a XML format to plug the actions, but we work her without this overhead.
2123void KABCore::addActionsManually() 2123void KABCore::addActionsManually()
2124{ 2124{
2125//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 2125//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
2126 2126
2127#ifdef KAB_EMBEDDED 2127#ifdef KAB_EMBEDDED
2128 QPopupMenu *fileMenu = new QPopupMenu( this ); 2128 QPopupMenu *fileMenu = new QPopupMenu( this );
2129 QPopupMenu *editMenu = new QPopupMenu( this ); 2129 QPopupMenu *editMenu = new QPopupMenu( this );
2130 QPopupMenu *helpMenu = new QPopupMenu( this ); 2130 QPopupMenu *helpMenu = new QPopupMenu( this );
2131 2131
2132 KToolBar* tb = mMainWindow->toolBar(); 2132 KToolBar* tb = mMainWindow->toolBar();
2133 mMainWindow->setToolBarsMovable (false ); 2133 mMainWindow->setToolBarsMovable (false );
2134#ifndef DESKTOP_VERSION 2134#ifndef DESKTOP_VERSION
2135 if ( KABPrefs::instance()->mFullMenuBarVisible ) { 2135 if ( KABPrefs::instance()->mFullMenuBarVisible ) {
2136#endif 2136#endif
2137 QMenuBar* mb = mMainWindow->menuBar(); 2137 QMenuBar* mb = mMainWindow->menuBar();
2138 2138
2139 //US setup menubar. 2139 //US setup menubar.
2140 //Disable the following block if you do not want to have a menubar. 2140 //Disable the following block if you do not want to have a menubar.
2141 mb->insertItem( i18n("&File"), fileMenu ); 2141 mb->insertItem( i18n("&File"), fileMenu );
2142 mb->insertItem( i18n("&Edit"), editMenu ); 2142 mb->insertItem( i18n("&Edit"), editMenu );
2143 mb->insertItem( i18n("&View"), viewMenu ); 2143 mb->insertItem( i18n("&View"), viewMenu );
2144 mb->insertItem( i18n("&Settings"), settingsMenu ); 2144 mb->insertItem( i18n("&Settings"), settingsMenu );
2145#ifdef DESKTOP_VERSION 2145#ifdef DESKTOP_VERSION
2146 mb->insertItem( i18n("Synchronize"), syncMenu ); 2146 mb->insertItem( i18n("Synchronize"), syncMenu );
2147#else 2147#else
2148 mb->insertItem( i18n("Sync"), syncMenu ); 2148 mb->insertItem( i18n("Sync"), syncMenu );
2149#endif 2149#endif
2150 //mb->insertItem( i18n("&Change"), changeMenu ); 2150 //mb->insertItem( i18n("&Change"), changeMenu );
2151 mb->insertItem( i18n("&Help"), helpMenu ); 2151 mb->insertItem( i18n("&Help"), helpMenu );
2152 mIncSearchWidget = new IncSearchWidget( tb ); 2152 mIncSearchWidget = new IncSearchWidget( tb );
2153 // tb->insertWidget(-1, 0, mIncSearchWidget); 2153 // tb->insertWidget(-1, 0, mIncSearchWidget);
2154#ifndef DESKTOP_VERSION 2154#ifndef DESKTOP_VERSION
2155 } else { 2155 } else {
2156 //US setup toolbar 2156 //US setup toolbar
2157 QPEMenuBar *menuBarTB = new QPEMenuBar( tb ); 2157 QPEMenuBar *menuBarTB = new QPEMenuBar( tb );
2158 QPopupMenu *popupBarTB = new QPopupMenu( this ); 2158 QPopupMenu *popupBarTB = new QPopupMenu( this );
2159 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB); 2159 menuBarTB->insertItem( SmallIcon( "z_menu" ) , popupBarTB);
2160 tb->insertWidget(-1, 0, menuBarTB); 2160 tb->insertWidget(-1, 0, menuBarTB);
2161 mIncSearchWidget = new IncSearchWidget( tb ); 2161 mIncSearchWidget = new IncSearchWidget( tb );
2162 tb->enableMoving(false); 2162 tb->enableMoving(false);
2163 popupBarTB->insertItem( i18n("&File"), fileMenu ); 2163 popupBarTB->insertItem( i18n("&File"), fileMenu );
2164 popupBarTB->insertItem( i18n("&Edit"), editMenu ); 2164 popupBarTB->insertItem( i18n("&Edit"), editMenu );
2165 popupBarTB->insertItem( i18n("&View"), viewMenu ); 2165 popupBarTB->insertItem( i18n("&View"), viewMenu );
2166 popupBarTB->insertItem( i18n("&Settings"), settingsMenu ); 2166 popupBarTB->insertItem( i18n("&Settings"), settingsMenu );
2167 popupBarTB->insertItem( i18n("Synchronize"), syncMenu ); 2167 popupBarTB->insertItem( i18n("Synchronize"), syncMenu );
2168 mViewManager->getFilterAction()->plug ( popupBarTB); 2168 mViewManager->getFilterAction()->plug ( popupBarTB);
2169 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu ); 2169 //popupBarTB->insertItem( i18n("&Change selected"), changeMenu );
2170 popupBarTB->insertItem( i18n("&Help"), helpMenu ); 2170 popupBarTB->insertItem( i18n("&Help"), helpMenu );
2171 if (QApplication::desktop()->width() > 320 ) { 2171 if (QApplication::desktop()->width() > 320 ) {
2172 // mViewManager->getFilterAction()->plug ( tb); 2172 // mViewManager->getFilterAction()->plug ( tb);
2173 } 2173 }
2174 } 2174 }
2175#endif 2175#endif
2176 mIncSearchWidget->setSize();
2176 // mActionQuit->plug ( mMainWindow->toolBar()); 2177 // mActionQuit->plug ( mMainWindow->toolBar());
2177 2178
2178 2179
2179 2180
2180 //US Now connect the actions with the menue entries. 2181 //US Now connect the actions with the menue entries.
2181#ifdef DESKTOP_VERSION 2182#ifdef DESKTOP_VERSION
2182 mActionPrint->plug( fileMenu ); 2183 mActionPrint->plug( fileMenu );
2183 mActionPrintDetails->plug( fileMenu ); 2184 mActionPrintDetails->plug( fileMenu );
2184 fileMenu->insertSeparator(); 2185 fileMenu->insertSeparator();
2185#endif 2186#endif
2186 mActionMail->plug( fileMenu ); 2187 mActionMail->plug( fileMenu );
2187 fileMenu->insertSeparator(); 2188 fileMenu->insertSeparator();
2188 2189
2189 mActionNewContact->plug( editMenu ); 2190 mActionNewContact->plug( editMenu );
2190 mActionNewContact->plug( tb ); 2191 mActionNewContact->plug( tb );
2191 2192
2192 mActionEditAddressee->plug( editMenu ); 2193 mActionEditAddressee->plug( editMenu );
2193 editMenu->insertSeparator(); 2194 editMenu->insertSeparator();
2194 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) || 2195 // if ((KGlobal::getDesktopSize() > KGlobal::Small ) ||
2195 // (!KABPrefs::instance()->mMultipleViewsAtOnce )) 2196 // (!KABPrefs::instance()->mMultipleViewsAtOnce ))
2196 mActionEditAddressee->plug( tb ); 2197 mActionEditAddressee->plug( tb );
2197 2198
2198 // fileMenu->insertSeparator(); 2199 // fileMenu->insertSeparator();
2199 mActionSave->plug( fileMenu ); 2200 mActionSave->plug( fileMenu );
2200 fileMenu->insertItem( "&Import", ImportMenu ); 2201 fileMenu->insertItem( "&Import", ImportMenu );
2201 fileMenu->insertItem( "&Export", ExportMenu ); 2202 fileMenu->insertItem( "&Export", ExportMenu );
2202 editMenu->insertItem( i18n("&Change"), changeMenu ); 2203 editMenu->insertItem( i18n("&Change"), changeMenu );
2203 editMenu->insertSeparator(); 2204 editMenu->insertSeparator();
2204#ifndef DESKTOP_VERSION 2205#ifndef DESKTOP_VERSION
2205 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu ); 2206 if ( Ir::supported() ) fileMenu->insertItem( i18n("&Beam"), beamMenu );
2206#endif 2207#endif
2207#if 0 2208#if 0
2208 // PENDING fix MailVCard 2209 // PENDING fix MailVCard
2209 fileMenu->insertSeparator(); 2210 fileMenu->insertSeparator();
2210 mActionMailVCard->plug( fileMenu ); 2211 mActionMailVCard->plug( fileMenu );
2211#endif 2212#endif
2212#ifndef DESKTOP_VERSION 2213#ifndef DESKTOP_VERSION
2213 if ( Ir::supported() ) mActionBR->plug( beamMenu ); 2214 if ( Ir::supported() ) mActionBR->plug( beamMenu );
2214 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu ); 2215 if ( Ir::supported() ) mActionBeamVCard->plug( beamMenu );
2215 if ( Ir::supported() ) mActionBeam->plug( beamMenu ); 2216 if ( Ir::supported() ) mActionBeam->plug( beamMenu );
2216#endif 2217#endif
2217 fileMenu->insertSeparator(); 2218 fileMenu->insertSeparator();
2218 mActionQuit->plug( fileMenu ); 2219 mActionQuit->plug( fileMenu );
2219#ifdef _OL_IMPORT_ 2220#ifdef _OL_IMPORT_
2220 mActionImportOL->plug( ImportMenu ); 2221 mActionImportOL->plug( ImportMenu );
2221#endif 2222#endif
2222 // edit menu 2223 // edit menu
2223 mActionUndo->plug( editMenu ); 2224 mActionUndo->plug( editMenu );
2224 mActionRedo->plug( editMenu ); 2225 mActionRedo->plug( editMenu );
2225 editMenu->insertSeparator(); 2226 editMenu->insertSeparator();
2226 mActionCut->plug( editMenu ); 2227 mActionCut->plug( editMenu );
2227 mActionCopy->plug( editMenu ); 2228 mActionCopy->plug( editMenu );
2228 mActionPaste->plug( editMenu ); 2229 mActionPaste->plug( editMenu );
2229 mActionDelete->plug( editMenu ); 2230 mActionDelete->plug( editMenu );
2230 editMenu->insertSeparator(); 2231 editMenu->insertSeparator();
2231 mActionSelectAll->plug( editMenu ); 2232 mActionSelectAll->plug( editMenu );
2232 2233
2233 mActionSetFormattedName->plug( changeMenu ); 2234 mActionSetFormattedName->plug( changeMenu );
2234 mActionRemoveVoice->plug( changeMenu ); 2235 mActionRemoveVoice->plug( changeMenu );
2235 // settingsmings menu 2236 // settingsmings menu
2236//US special menuentry to configure the addressbook resources. On KDE 2237//US special menuentry to configure the addressbook resources. On KDE
2237// you do that through the control center !!! 2238// you do that through the control center !!!
2238 // settingsMenu->insertSeparator(); 2239 // settingsMenu->insertSeparator();
2239 2240
2240 mActionConfigKAddressbook->plug( settingsMenu, 0 ); 2241 mActionConfigKAddressbook->plug( settingsMenu, 0 );
2241 mActionConfigResources->plug( settingsMenu,1 ); 2242 mActionConfigResources->plug( settingsMenu,1 );
2242 settingsMenu->insertSeparator(2); 2243 settingsMenu->insertSeparator(2);
2243 2244
2244 if ( mIsPart ) { 2245 if ( mIsPart ) {
2245 //US not implemented yet 2246 //US not implemented yet
2246 //mActionConfigShortcuts->plug( settingsMenu ); 2247 //mActionConfigShortcuts->plug( settingsMenu );
2247 //mActionConfigureToolbars->plug( settingsMenu ); 2248 //mActionConfigureToolbars->plug( settingsMenu );
2248 2249
2249 } else { 2250 } else {
2250 //US not implemented yet 2251 //US not implemented yet
2251 //mActionKeyBindings->plug( settingsMenu ); 2252 //mActionKeyBindings->plug( settingsMenu );
2252 } 2253 }
2253 2254
2254 mActionEditCategories->plug( settingsMenu ); 2255 mActionEditCategories->plug( settingsMenu );
2255 mActionManageCategories->plug( settingsMenu ); 2256 mActionManageCategories->plug( settingsMenu );
2256 mActionJumpBar->plug( viewMenu,0 ); 2257 mActionJumpBar->plug( viewMenu,0 );
2257 mActionDetails->plug( viewMenu,0 ); 2258 mActionDetails->plug( viewMenu,0 );
2258 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop ) 2259 //if (!KABPrefs::instance()->mMultipleViewsAtOnce || KGlobal::getDesktopSize() == KGlobal::Desktop )
2259 mActionDetails->plug( tb ); 2260 mActionDetails->plug( tb );
2260 settingsMenu->insertSeparator(); 2261 settingsMenu->insertSeparator();
2261#ifndef DESKTOP_VERSION 2262#ifndef DESKTOP_VERSION
2262 if ( Ir::supported() ) mActionBR->plug(settingsMenu ); 2263 if ( Ir::supported() ) mActionBR->plug(settingsMenu );
2263 settingsMenu->insertSeparator(); 2264 settingsMenu->insertSeparator();
2264#endif 2265#endif
2265 2266
2266 mActionWhoAmI->plug( settingsMenu ); 2267 mActionWhoAmI->plug( settingsMenu );
2267 //mActionEditCategories->plug( changeMenu ); 2268 //mActionEditCategories->plug( changeMenu );
2268 mActionCategories->plug( changeMenu ); 2269 mActionCategories->plug( changeMenu );
2269 //mActionManageCategories->plug( changeMenu ); 2270 //mActionManageCategories->plug( changeMenu );
2270 2271
2271 //mActionCategories->plug( settingsMenu ); 2272 //mActionCategories->plug( settingsMenu );