summaryrefslogtreecommitdiffabout
path: root/libkdepim
Side-by-side diff
Diffstat (limited to 'libkdepim') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/externalapphandler.cpp12
-rw-r--r--libkdepim/externalapphandler.h1
-rw-r--r--libkdepim/ksyncmanager.cpp2
3 files changed, 12 insertions, 3 deletions
diff --git a/libkdepim/externalapphandler.cpp b/libkdepim/externalapphandler.cpp
index 0e9c5e5..2ce6926 100644
--- a/libkdepim/externalapphandler.cpp
+++ b/libkdepim/externalapphandler.cpp
@@ -9,48 +9,49 @@
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
/*
Enhanced Version of the file for platform independent KDE tools.
Copyright (c) 2004 Ulf Schenk
$Id$
*/
#include <stdlib.h>
#include <qfile.h>
+#include <qtimer.h>
#include <qmap.h>
#include <qregexp.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#include <qtopia/qcopenvelope_qws.h>
#else
#include <qapplication.h>
#endif
#include <kstaticdeleter.h>
#include <kmessagebox.h>
#include "externalapphandler.h"
#include "kpimglobalprefs.h"
//uncomment line to get debug output
//#define DEBUG_EXT_APP_HANDLER
/*********************************************************************************
*
********************************************************************************/
@@ -1108,57 +1109,62 @@ void ExternalAppHandler::passParameters(QCopEnvelope* e, const QString& paramete
useValMap = true;
}
else
{
// qDebug("pass parameter << %s", key.latin1());
(*e) << key;
}
}
if (useValMap == true)
(*e) << valmap;
#endif
}
/**************************************************************************
*
**************************************************************************/
void ExternalAppHandler::appMessage( const QCString& cmsg, const QByteArray& data )
{
-
+ qDebug("ExternalAppHandler::appMessage %s %x", cmsg.data(), this);
if ( cmsg == "nextView()" ) {
qDebug("nextView()");
- emit nextView();
+ QTimer::singleShot( 0, this, SIGNAL ( nextView() ));
return;
}
if ( cmsg == "callContactdialog()" ) {
qDebug("callContactdialog()");
- emit callContactdialog();
+ QTimer::singleShot( 0, this, SIGNAL ( callContactdialog() ));
+ return;
+ }
+ if ( cmsg == "doRingSync" ) {
+ qDebug("doRingSync");
+ QTimer::singleShot( 0, this, SIGNAL ( doRingSync() ));
return;
}
bool res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
if (!res)
res = mBirthdayListFromKAPITransfer->appMessage( cmsg, data );
if (!res)
res = mDisplayDetails->appMessage( cmsg, data );
// if (!res)
// res = mNameEmailUidListFromKAPITransfer->appMessage( cmsg, data );
}
bool ExternalAppHandler::requestNameEmailUidListFromKAPI(const QString& sourceChannel, const QString& sessionuid)
{
mNameEmailUidListFromKAPITransfer->setSourceChannel(sourceChannel);
// maybe we are sending to KA/Pi fom a different worldd...
// it may be that the QAplication::desktop()->width() values in KA/Pi are not the same as in our application
// for that reason we send the current QApplication::desktop()->width() to KA/Pi
//qDebug("UID %s ", sessionuid.latin1());
//return mNameEmailUidListFromKAPITransfer->sendMessageToTarget(QString::number ( QApplication::desktop()->width() ));
diff --git a/libkdepim/externalapphandler.h b/libkdepim/externalapphandler.h
index 097f306..b899ad7 100644
--- a/libkdepim/externalapphandler.h
+++ b/libkdepim/externalapphandler.h
@@ -214,48 +214,49 @@ class ExternalAppHandler : public QObject
bool requestDetailsFromKAPI(const QString& name, const QString& email, const QString& uid);
bool requestBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid);
bool returnBirthdayListFromKAPI(const QString& sourceChannel, const QString& sessionuid,
const QStringList& birthdayList, const QStringList& anniversaryList,
const QStringList& realNameList, const QStringList& emailList,
const QStringList& assembledNameList, const QStringList& uidList);
//loadConfig clears the cache and checks again if the applications are available or not
void loadConfig();
QList<DefaultAppItem> getAvailableDefaultItems(Types);
DefaultAppItem* getDefaultItem(Types, int);
public slots:
void appMessage( const QCString& msg, const QByteArray& data );
signals:
void callContactdialog();
void nextView();
+ void doRingSync();
// Emmitted when the target app receives a request from the source app
void requestForNameEmailUidList(const QString& sourceChannel, const QString& uid);
// Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi
// The first parameter is a uniqueid. It can be used to identify the event
void receivedNameEmailUidListEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList);
void requestFindByEmail(const QString& sourceChannel, const QString& uid, const QString& email);
void receivedFindByEmailEvent(const QString& uid, const QStringList& nameList, const QStringList& emailList, const QStringList& uidList);
void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid);
// Emmitted when the target app receives a request from the source app
void requestForBirthdayList(const QString& sourceChannel, const QString& uid);
// Emitted when the source app recieves a list of name/email pairs (=addresses) from another target app. Usually Ka/Pi
// The first parameter is a uniqueid. It can be used to identify the event
void receivedBirthdayListEvent(const QString& uid, const QStringList& birthdayList,
const QStringList& anniversaryList, const QStringList& realNameList,
const QStringList& emailList, const QStringList& assembledNameList,
const QStringList& uidList);
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index db815d6..038e032 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -500,57 +500,59 @@ bool KSyncManager::syncWithFile( QString fn , bool quick )
if ( ret = mImplementation->sync( this, fn, mSyncAlgoPrefs ) )
mParent->topLevelWidget()->setCaption( i18n("Synchronization successful") );
else
mParent->topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") );
if ( ! quick )
mPrefs->mLastSyncedLocalFile = fn;
}
return ret;
}
void KSyncManager::quickSyncLocalFile()
{
if ( syncWithFile( mPrefs->mLastSyncedLocalFile, true ) ) {
qDebug("KSM::quick syncLocalFile() successful ");
}
}
void KSyncManager::multiSync( bool askforPrefs )
{
if (blockSave())
return;
setBlockSave(true);
+ if ( askforPrefs ) {
QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!");
if ( QMessageBox::information( mParent, i18n("KDE-Pim Sync"),
question,
i18n("Yes"), i18n("No"),
0, 0 ) != 0 ) {
setBlockSave(false);
mParent->topLevelWidget()->setCaption(i18n("Aborted! Nothing synced!"));
return;
}
+ }
mCurrentSyncDevice = i18n("Multiple profiles") ;
mSyncAlgoPrefs = mPrefs->mRingSyncAlgoPrefs;
if ( askforPrefs ) {
if ( !edit_sync_options()) {
mParent->topLevelWidget()->setCaption( i18n("Syncing aborted.") );
return;
}
mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs;
}
mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") );
qApp->processEvents();
int num = ringSync() ;
if ( num > 1 )
ringSync();
setBlockSave(false);
if ( num )
emit save();
if ( num )
mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync complete!").arg(num) );
else
mParent->topLevelWidget()->setCaption(i18n("Nothing synced! No profiles defined for multisync!"));
return;
}