-rw-r--r-- | kaddressbook/kabcore.cpp | 32 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 4 |
2 files changed, 30 insertions, 6 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 5ebd3a4..bdc5bd8 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1905,16 +1905,22 @@ void KABCore::initActions() this, SLOT( faq() ), actionCollection(), "faq_about_data" ); mActionWN = new KAction( i18n( "What's New?" ), 0, this, SLOT( whatsnew() ), actionCollection(), "wn" ); mActionSyncHowto = new KAction( i18n( "Sync HowTo" ), 0, this, SLOT( synchowto() ), actionCollection(), "sync" ); + mActionKdeSyncHowto = new KAction( i18n( "Kde Sync HowTo" ), 0, + this, SLOT( kdesynchowto() ), actionCollection(), + "kdesync" ); + mActionMultiSyncHowto = new KAction( i18n( "Multi Sync HowTo" ), 0, + this, SLOT( multisynchowto() ), actionCollection(), + "multisync" ); mActionAboutKAddressbook = new KAction( i18n( "&About KAddressBook" ), "kaddressbook2", 0, this, SLOT( createAboutData() ), actionCollection(), "kaddressbook_about_data" ); #endif //KAB_EMBEDDED clipboardDataChanged(); connect( UndoStack::instance(), SIGNAL( changed() ), SLOT( updateActionMenu() ) ); @@ -2046,18 +2052,20 @@ void KABCore::addActionsManually() settingsMenu->insertSeparator(); mActionWhoAmI->plug( settingsMenu ); mActionCategories->plug( settingsMenu ); mActionWN->plug( helpMenu ); mActionSyncHowto->plug( helpMenu ); - mActionLicence->plug( helpMenu ); + mActionKdeSyncHowto->plug( helpMenu ); + mActionMultiSyncHowto->plug( helpMenu ); mActionFaq->plug( helpMenu ); + mActionLicence->plug( helpMenu ); mActionAboutKAddressbook->plug( helpMenu ); if (KGlobal::getDesktopSize() > KGlobal::Small ) { mActionSave->plug( tb ); mViewManager->getFilterAction()->plug ( tb); if (KGlobal::getDesktopSize() == KGlobal::Desktop ) { mActionUndo->plug( tb ); @@ -2345,17 +2353,24 @@ void KABCore::requestForDetails(const QString& sourceChannel, const QString& ses void KABCore::whatsnew() { KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); } void KABCore::synchowto() { KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); } - +void KABCore::kdesynchowto() +{ + KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); +} +void KABCore::multisynchowto() +{ + KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); +} void KABCore::faq() { KApplication::showFile( "KA/Pi FAQ", "kdepim/kaddressbook/kapiFAQ.txt" ); } #include <libkcal/syncdefines.h> KABC::Addressee KABCore::getLastSyncAddressee() @@ -2773,20 +2788,24 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo addresseeRSync.setNote( "" ) ; addresseeLSync.setNote( "" ); if ( mGlobalSyncMode == SYNC_MODE_NORMAL) remote->insertAddressee( addresseeRSync, false ); local->insertAddressee( addresseeLSync, false ); QString mes; mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR ); - if ( syncManager->mShowSyncSummary ) { - KMessageBox::information(this, mes, i18n("KA/Pi Synchronization") ); - } qDebug( mes ); + if ( syncManager->mShowSyncSummary ) { + if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, + i18n("KA/Pi Synchronization"),i18n("Write back"))) { + qDebug("cancelled "); + return false; + } + } return syncOK; } //this is a overwritten callbackmethods from the syncinterface bool KABCore::sync(KSyncManager* manager, QString filename, int mode) { @@ -2869,17 +2888,18 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource) abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); if ( syncOK ) { if ( syncManager->mWriteBackFile ) { abLocal.removeSyncAddressees( false ); abLocal.saveAB(); abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); } - } + } else + message( i18n("Sync cancelled or failed.") ); setModified(); } if ( syncOK ) mViewManager->refreshView(); disableBR( false ); return syncOK; } diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 6831ec9..c01d598 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -147,16 +147,18 @@ class KABCore : public QWidget, public KSyncInterface void createAboutData(); #endif //KAB_EMBEDDED void setDetailsToggle(); void showLicence(); void faq(); void whatsnew() ; void synchowto() ; + void multisynchowto() ; + void kdesynchowto() ; void writeToPhone(); /** Is called whenever a contact is selected in the view. */ void setContactSelected( const QString &uid ); /** @@ -449,16 +451,18 @@ class KABCore : public QWidget, public KSyncInterface KToggleAction *mActionDetails; KAction *mActionWhoAmI; KAction *mActionCategories; KAction *mActionAboutKAddressbook; KAction *mActionLicence; KAction *mActionFaq; KAction *mActionWN; KAction *mActionSyncHowto; + KAction *mActionKdeSyncHowto; + KAction *mActionMultiSyncHowto; KAction *mActionDeleteView; QPopupMenu *viewMenu; QPopupMenu *filterMenu; QPopupMenu *settingsMenu; QPopupMenu *changeMenu; //US QAction *mActionSave; |