-rw-r--r-- | kaddressbook/kabcore.cpp | 38 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 4 |
2 files changed, 35 insertions, 7 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 27aca2d..3f9b546 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -374,6 +374,7 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const 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&))); connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); + connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog())); #ifndef KAB_EMBEDDED @@ -835,6 +836,7 @@ void KABCore::resizeEvent(QResizeEvent* e ) mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); } if ( QApplication::desktop()->width() <= 640 ) { + mMainWindow->showMinimized(); //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); mViewManager->getFilterAction()->setComboWidth( 150 ); if ( mIncSearchWidget ) @@ -861,6 +863,7 @@ void KABCore::resizeEvent(QResizeEvent* e ) } } } + QWidget::resizeEvent( e ); } void KABCore::export2phone() @@ -2505,23 +2508,44 @@ void KABCore::configureResources() */ void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QString& uid) { - QStringList nameList; - QStringList emailList; - QStringList uidList; + bool ok = false; + mEmailSourceChannel = sourceChannel; int wid = uid.toInt( &ok ); + qDebug("UID %s ", uid.latin1()); if ( ok ) { if ( wid != QApplication::desktop()->width() ) { qDebug("KA/Pi: Request from different desktop geometry. Resizing ..."); message( i18n("Resizing, please wait...") ); - raise(); - qApp->processEvents(); + mMainWindow->showMinimized(); + /* + { + QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); + } + */ + QTimer::singleShot( 1,this, SLOT ( resizeAndCallContactdialog() ) ); + return; } } else { qDebug("KABCore::requestForNameEmailUidList:: Got invalid uid "); } + callContactdialog(); + //QCopEnvelope e("QPE/Application/kapi", "callContactdialog()"); + +} +void KABCore::resizeAndCallContactdialog() +{ + updateMainWindow(); + QTimer::singleShot( 100,this, SLOT ( callContactdialog() ) ); +} +void KABCore::callContactdialog() +{ + QStringList nameList; + QStringList emailList; + QStringList uidList; + qDebug("WIDTH %d ", QApplication::desktop()->width() ); KABC::Addressee::List list = KABC::AddresseeDialog::getAddressees(this); uint i=0; for (i=0; i < list.count(); i++) @@ -2530,11 +2554,11 @@ void KABCore::requestForNameEmailUidList(const QString& sourceChannel, const QSt emailList.append(list[i].preferredEmail()); uidList.append(list[i].uid()); } + QString uid = "unnamed"; //qDebug("%s %s ", sourceChannel.latin1(), uid.latin1()); - bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(sourceChannel, uid, nameList, emailList, uidList); + bool res = ExternalAppHandler::instance()->returnNameEmailUidListFromKAPI(mEmailSourceChannel, uid, nameList, emailList, uidList); } - /* this method will be called through the QCop interface from Ko/Pi to select birthdays * to put them into the calendar. */ diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index c185117..47ea152 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -368,6 +368,9 @@ class KABCore : public QWidget, public KSyncInterface void setJumpButtonBarVisible( bool visible ); void setJumpButtonBar( bool visible ); void setCaptionBack(); + void resizeAndCallContactdialog(); + void callContactdialog(); + void importFromOL(); void extensionModified( const KABC::Addressee::List &list ); void extensionChanged( int id ); @@ -385,6 +388,7 @@ class KABCore : public QWidget, public KSyncInterface void addressBookChanged(); private: + QString mEmailSourceChannel; void resizeEvent(QResizeEvent* e ); bool mBRdisabled; #ifndef DESKTOP_VERSION |