summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index b4e0b07..d5de9cb 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2491,192 +2491,193 @@ void KABCore::setFormattedName()
2491 else 2491 else
2492 message(i18n("%1 contacts changed!").arg( count ) ); 2492 message(i18n("%1 contacts changed!").arg( count ) );
2493} 2493}
2494 2494
2495void KABCore::clipboardDataChanged() 2495void KABCore::clipboardDataChanged()
2496{ 2496{
2497 2497
2498 if ( mReadWrite ) 2498 if ( mReadWrite )
2499 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() ); 2499 mActionPaste->setEnabled( !QApplication::clipboard()->text().isEmpty() );
2500 2500
2501} 2501}
2502 2502
2503void KABCore::updateActionMenu() 2503void KABCore::updateActionMenu()
2504{ 2504{
2505 UndoStack *undo = UndoStack::instance(); 2505 UndoStack *undo = UndoStack::instance();
2506 RedoStack *redo = RedoStack::instance(); 2506 RedoStack *redo = RedoStack::instance();
2507 2507
2508 if ( undo->isEmpty() ) 2508 if ( undo->isEmpty() )
2509 mActionUndo->setText( i18n( "Undo" ) ); 2509 mActionUndo->setText( i18n( "Undo" ) );
2510 else 2510 else
2511 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) ); 2511 mActionUndo->setText( i18n( "Undo %1" ).arg( undo->top()->name() ) );
2512 2512
2513 mActionUndo->setEnabled( !undo->isEmpty() ); 2513 mActionUndo->setEnabled( !undo->isEmpty() );
2514 2514
2515 if ( !redo->top() ) 2515 if ( !redo->top() )
2516 mActionRedo->setText( i18n( "Redo" ) ); 2516 mActionRedo->setText( i18n( "Redo" ) );
2517 else 2517 else
2518 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) ); 2518 mActionRedo->setText( i18n( "Redo %1" ).arg( redo->top()->name() ) );
2519 2519
2520 mActionRedo->setEnabled( !redo->isEmpty() ); 2520 mActionRedo->setEnabled( !redo->isEmpty() );
2521} 2521}
2522 2522
2523void KABCore::configureKeyBindings() 2523void KABCore::configureKeyBindings()
2524{ 2524{
2525#ifndef KAB_EMBEDDED 2525#ifndef KAB_EMBEDDED
2526 KKeyDialog::configure( actionCollection(), true ); 2526 KKeyDialog::configure( actionCollection(), true );
2527#else //KAB_EMBEDDED 2527#else //KAB_EMBEDDED
2528 qDebug("KABCore::configureKeyBindings() not implemented"); 2528 qDebug("KABCore::configureKeyBindings() not implemented");
2529#endif //KAB_EMBEDDED 2529#endif //KAB_EMBEDDED
2530} 2530}
2531 2531
2532#ifdef KAB_EMBEDDED 2532#ifdef KAB_EMBEDDED
2533void KABCore::configureResources() 2533void KABCore::configureResources()
2534{ 2534{
2535 KRES::KCMKResources dlg( this, "" , 0 ); 2535 KRES::KCMKResources dlg( this, "" , 0 );
2536 2536
2537 if ( !dlg.exec() ) 2537 if ( !dlg.exec() )
2538 return; 2538 return;
2539 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") ); 2539 KMessageBox::information( this, i18n("Please restart to get the \nchanged resources (re)loaded!\n") );
2540} 2540}
2541#endif //KAB_EMBEDDED 2541#endif //KAB_EMBEDDED
2542 2542
2543 2543
2544/* this method will be called through the QCop interface from Ko/Pi to select addresses 2544/* this method will be called through the QCop interface from Ko/Pi to select addresses
2545 * for the attendees list of an event. 2545 * for the attendees list of an event.
2546 */ 2546 */
2547void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) 2547void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid)
2548{ 2548{
2549 qDebug("KABCore::requestForNameEmailUidList "); 2549 qDebug("KABCore::requestForNameEmailUidList ");
2550 bool ok = false; 2550 bool ok = false;
2551 mEmailSourceChannel = sourceChannel; 2551 mEmailSourceChannel = sourceChannel;
2552 mEmailSourceUID = uid; 2552 mEmailSourceUID = uid;
2553 QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) ); 2553 QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) );
2554 //callContactdialog(); 2554 //callContactdialog();
2555#if 0 2555#if 0
2556 int wid = uid.toInt( &ok ); 2556 int wid = uid.toInt( &ok );
2557 qDebug("UID %s ", uid.latin1()); 2557 qDebug("UID %s ", uid.latin1());
2558 if ( ok ) { 2558 if ( ok ) {
2559 if ( wid != QApplication::desktop()->width() ) { 2559 if ( wid != QApplication::desktop()->width() ) {
2560 qDebug("KA/Pi: Request from different desktop geometry. Resizing ..."); 2560 qDebug("KA/Pi: Request from different desktop geometry. Resizing ...");
2561 message( i18n("Resizing, please wait...") ); 2561 message( i18n("Resizing, please wait...") );
2562 mMainWindow->showMinimized(); 2562 mMainWindow->showMinimized();
2563 /* 2563 /*
2564 { 2564 {
2565 QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); 2565 QCopEnvelope e("QPE/Application/kapi", "callContactdialog()");
2566 } 2566 }
2567 */ 2567 */
2568 QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) ); 2568 QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) );
2569 return; 2569 return;
2570 } 2570 }
2571 2571
2572 } else { 2572 } else {
2573 qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid "); 2573 qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid ");
2574 } 2574 }
2575 callContactdialog(); 2575 callContactdialog();
2576 //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); 2576 //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()");
2577#endif 2577#endif
2578} 2578}
2579void KABCore::resizeAndCallContactdialog() 2579void KABCore::resizeAndCallContactdialog()
2580{ 2580{
2581 updateMainWindow(); 2581 updateMainWindow();
2582 QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) ); 2582 QTimer::singleShot( 10,this, SLOT ( callContactdialog() ) );
2583} 2583}
2584 2584
2585void KABCore::doRingSync() 2585void KABCore::doRingSync()
2586{ 2586{
2587 topLevelWidget()->raise();
2587 syncManager->multiSync( false ); 2588 syncManager->multiSync( false );
2588} 2589}
2589void KABCore::callContactdialog() 2590void KABCore::callContactdialog()
2590{ 2591{
2591 static bool running = false; 2592 static bool running = false;
2592 if (running) return; 2593 if (running) return;
2593 running = true; 2594 running = true;
2594 QStringList nameList; 2595 QStringList nameList;
2595 QStringList emailList; 2596 QStringList emailList;
2596 QStringList uidList; 2597 QStringList uidList;
2597 qDebug(" KABCore::callContactdialog:DESKTOP WIDTH %d ", QApplication::desktop()->width() ); 2598 qDebug(" KABCore::callContactdialog:DESKTOP WIDTH %d ", QApplication::desktop()->width() );
2598 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); 2599 KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this);
2599 uint i=0; 2600 uint i=0;
2600 for (i=0; i < list.count(); i++) 2601 for (i=0; i < list.count(); i++)
2601 { 2602 {
2602 nameList.append(list[i].realName()); 2603 nameList.append(list[i].realName());
2603 emailList.append(list[i].preferredEmail()); 2604 emailList.append(list[i].preferredEmail());
2604 uidList.append(list[i].uid()); 2605 uidList.append(list[i].uid());
2605 } 2606 }
2606 QString uid = mEmailSourceUID; 2607 QString uid = mEmailSourceUID;
2607 //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); 2608 //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1());
2608 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList); 2609 bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList);
2609 running = false; 2610 running = false;
2610} 2611}
2611/* this method will be called through the QCop interface from Ko/Pi to select birthdays 2612/* this method will be called through the QCop interface from Ko/Pi to select birthdays
2612 * to put them into the calendar. 2613 * to put them into the calendar.
2613 */ 2614 */
2614void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid) 2615void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid)
2615{ 2616{
2616 // qDebug("KABCore::requestForBirthdayList"); 2617 // qDebug("KABCore::requestForBirthdayList");
2617 QStringList birthdayList; 2618 QStringList birthdayList;
2618 QStringList anniversaryList; 2619 QStringList anniversaryList;
2619 QStringList realNameList; 2620 QStringList realNameList;
2620 QStringList preferredEmailList; 2621 QStringList preferredEmailList;
2621 QStringList assembledNameList; 2622 QStringList assembledNameList;
2622 QStringList uidList; 2623 QStringList uidList;
2623 2624
2624 KABC::AddressBook::Iterator it; 2625 KABC::AddressBook::Iterator it;
2625 2626
2626 int count = 0; 2627 int count = 0;
2627 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { 2628 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) {
2628 ++count; 2629 ++count;
2629 } 2630 }
2630 QProgressBar bar(count,0 ); 2631 QProgressBar bar(count,0 );
2631 int w = 300; 2632 int w = 300;
2632 if ( QApplication::desktop()->width() < 320 ) 2633 if ( QApplication::desktop()->width() < 320 )
2633 w = 220; 2634 w = 220;
2634 int h = bar.sizeHint().height() ; 2635 int h = bar.sizeHint().height() ;
2635 int dw = QApplication::desktop()->width(); 2636 int dw = QApplication::desktop()->width();
2636 int dh = QApplication::desktop()->height(); 2637 int dh = QApplication::desktop()->height();
2637 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2638 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2638 bar.show(); 2639 bar.show();
2639 bar.setCaption (i18n("Collecting birthdays - close to abort!") ); 2640 bar.setCaption (i18n("Collecting birthdays - close to abort!") );
2640 qApp->processEvents(); 2641 qApp->processEvents();
2641 2642
2642 QDate bday; 2643 QDate bday;
2643 QString anni; 2644 QString anni;
2644 QString formattedbday; 2645 QString formattedbday;
2645 2646
2646 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) 2647 for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it )
2647 { 2648 {
2648 if ( ! bar.isVisible() ) 2649 if ( ! bar.isVisible() )
2649 return; 2650 return;
2650 bar.setProgress( count++ ); 2651 bar.setProgress( count++ );
2651 qApp->processEvents(); 2652 qApp->processEvents();
2652 bday = (*it).birthday().date(); 2653 bday = (*it).birthday().date();
2653 anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" ); 2654 anni = (*it).custom("KADDRESSBOOK", "X-Anniversary" );
2654 2655
2655 if ( bday.isValid() || !anni.isEmpty()) 2656 if ( bday.isValid() || !anni.isEmpty())
2656 { 2657 {
2657 if (bday.isValid()) 2658 if (bday.isValid())
2658 formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate); 2659 formattedbday = KGlobal::locale()->formatDate(bday, true, KLocale::ISODate);
2659 else 2660 else
2660 formattedbday = "NOTVALID"; 2661 formattedbday = "NOTVALID";
2661 if (anni.isEmpty()) 2662 if (anni.isEmpty())
2662 anni = "INVALID"; 2663 anni = "INVALID";
2663 2664
2664 birthdayList.append(formattedbday); 2665 birthdayList.append(formattedbday);
2665 anniversaryList.append(anni); //should be ISODate 2666 anniversaryList.append(anni); //should be ISODate
2666 realNameList.append((*it).realName()); 2667 realNameList.append((*it).realName());
2667 preferredEmailList.append((*it).preferredEmail()); 2668 preferredEmailList.append((*it).preferredEmail());
2668 assembledNameList.append((*it).assembledName()); 2669 assembledNameList.append((*it).assembledName());
2669 uidList.append((*it).uid()); 2670 uidList.append((*it).uid());
2670 2671
2671 //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() ); 2672 //qDebug("found birthday in KA/Pi: %s,%s,%s,%s: %s, %s", (*it).realName().latin1(), (*it).preferredEmail().latin1(), (*it).assembledName().latin1(), (*it).uid().latin1(), formattedbday.latin1(), anni.latin1() );
2672 } 2673 }
2673 } 2674 }
2674 2675
2675 bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList); 2676 bool res = ExternalAppHandler::instance()->returnBirthdayListFromKAPI(sourceChannel, uid, birthdayList, anniversaryList, realNameList, preferredEmailList, assembledNameList, uidList);
2676 2677
2677} 2678}
2678 2679
2679/* this method will be called through the QCop interface from other apps to show details of a contact. 2680/* this method will be called through the QCop interface from other apps to show details of a contact.
2680 */ 2681 */
2681void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid) 2682void KABCore::requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid)
2682{ 2683{