summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Side-by-side diff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp40
-rw-r--r--kaddressbook/kabcore.h4
2 files changed, 36 insertions, 8 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 27aca2d..3f9b546 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -369,16 +369,17 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
SLOT( sendMail( const QString& ) ) );
connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&)));
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
connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ),
mXXPortManager, SLOT( importVCard( const KURL& ) ) );
connect( mDetails, SIGNAL( browse( const QString& ) ),
SLOT( browse( const QString& ) ) );
@@ -830,16 +831,17 @@ void KABCore::resizeEvent(QResizeEvent* e )
//qDebug("KABCore::resizeEvent(QResizeEvent* e ) ");
if ( QApplication::desktop()->width() >= 480 ) {
if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480
if ( mMiniSplitter->orientation() == Qt::Vertical ) {
mMiniSplitter->setOrientation( Qt::Horizontal);
mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
}
if ( QApplication::desktop()->width() <= 640 ) {
+ mMainWindow->showMinimized();
//mMainWindow->setMaximumSize( QApplication::desktop()->size() );
mViewManager->getFilterAction()->setComboWidth( 150 );
if ( mIncSearchWidget )
mIncSearchWidget->setSize();
QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
}
} else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640
@@ -856,16 +858,17 @@ void KABCore::resizeEvent(QResizeEvent* e )
}
} else {
mViewManager->getFilterAction()->setComboWidth( 0 );
}
QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
}
}
}
+ QWidget::resizeEvent( e );
}
void KABCore::export2phone()
{
QStringList uids;
XXPortSelectDialog dlg( this, false, this );
if ( dlg.exec() )
@@ -2500,46 +2503,67 @@ void KABCore::configureResources()
#endif //KAB_EMBEDDED
/* this method will be called through the QCop interface from Ko/Pi to select addresses
* for the attendees list of an event.
*/
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++)
{
nameList.append(list[i].realName());
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.
*/
void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString& uid)
{
// qDebug("KABCore::requestForBirthdayList");
QStringList birthdayList;
QStringList anniversaryList;
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index c185117..47ea152 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -363,16 +363,19 @@ class KABCore : public QWidget, public KSyncInterface
void updateToolBar();
void updateMainWindow();
void receive( const QCString& cmsg, const QByteArray& data );
void toggleBeamReceive( );
void disableBR(bool);
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 );
void clipboardDataChanged();
void updateActionMenu();
void configureKeyBindings();
void removeVoice();
void setFormattedName();
@@ -380,16 +383,17 @@ class KABCore : public QWidget, public KSyncInterface
void configureResources();
#endif //KAB_EMBEDDED
void slotEditorDestroyed( const QString &uid );
void configurationChanged();
void addressBookChanged();
private:
+ QString mEmailSourceChannel;
void resizeEvent(QResizeEvent* e );
bool mBRdisabled;
#ifndef DESKTOP_VERSION
QCopChannel* infrared;
#endif
QTimer *mMessageTimer;
void initGUI();
void initActions();