-rw-r--r-- | libkdepim/ksyncmanager.cpp | 72 |
1 files changed, 45 insertions, 27 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index fad9a76..568c2a9 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -78,3 +78,3 @@ KSyncManager::~KSyncManager() -//LR ok + void KSyncManager::fillSyncMenu() @@ -103,2 +103,3 @@ void KSyncManager::fillSyncMenu() prof << i18n("Local_file"); + prof << i18n("Last_file"); KSyncProfile* temp = new KSyncProfile (); @@ -108,2 +109,4 @@ void KSyncManager::fillSyncMenu() temp->writeConfig(&config); + temp->setName( prof[2] ); + temp->writeConfig(&config); config.setGroup("General"); @@ -128,4 +131,5 @@ void KSyncManager::fillSyncMenu() else if (!app_dir.exists(QDir::homeDirPath()+"/Applications/dtm" ) ) { - mSyncMenu->setItemEnabled( 1000, false ); + mSyncMenu->removeItem( 1000 ); } + mSyncMenu->removeItem( 1002 ); } @@ -197,3 +201,3 @@ void KSyncManager::slotSyncMenu( int action ) if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) ) - mLastSyncedLocalFile = temp->getRemoteFileNameAB(); + mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB(); break; @@ -201,3 +205,3 @@ void KSyncManager::slotSyncMenu( int action ) if ( syncWithFile( temp->getRemoteFileName( ), false ) ) - mLastSyncedLocalFile = temp->getRemoteFileName(); + mPrefs->mLastSyncedLocalFile = temp->getRemoteFileName(); break; @@ -205,3 +209,3 @@ void KSyncManager::slotSyncMenu( int action ) if ( syncWithFile( temp->getRemoteFileNamePWM( ), false ) ) - mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); + mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); break; @@ -241,2 +245,3 @@ void KSyncManager::slotSyncMenu( int action ) } + void KSyncManager::enableQuick() @@ -287,3 +292,2 @@ void KSyncManager::enableQuick() } - //connect( mServerSocket, SIGNAL ( saveFile() ),this, SIGNAL ( save() ) ); connect( mServerSocket, SIGNAL ( request_file() ),this, SIGNAL ( request_file() ) ); @@ -295,3 +299,3 @@ void KSyncManager::syncLocalFile() - QString fn =mLastSyncedLocalFile; + QString fn =mPrefs->mLastSyncedLocalFile; QString ext; @@ -323,2 +327,3 @@ void KSyncManager::syncLocalFile() } + bool KSyncManager::syncWithFile( QString fn , bool quick ) @@ -355,3 +360,3 @@ bool KSyncManager::syncWithFile( QString fn , bool quick ) if ( ! quick ) - mLastSyncedLocalFile = fn; + mPrefs->mLastSyncedLocalFile = fn; } @@ -359,2 +364,3 @@ bool KSyncManager::syncWithFile( QString fn , bool quick ) } + void KSyncManager::quickSyncLocalFile() @@ -362,3 +368,3 @@ void KSyncManager::quickSyncLocalFile() - if ( syncWithFile( mLastSyncedLocalFile, false ) ) { + if ( syncWithFile( mPrefs->mLastSyncedLocalFile, false ) ) { qDebug("quick syncLocalFile() successful "); @@ -367,2 +373,3 @@ void KSyncManager::quickSyncLocalFile() } + void KSyncManager::multiSync( bool askforPrefs ) @@ -373,3 +380,3 @@ void KSyncManager::multiSync( bool 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("Sync"), + if ( QMessageBox::information( mParent, i18n("KDE-Pim Sync"), question, @@ -382,3 +389,3 @@ void KSyncManager::multiSync( bool askforPrefs ) mCurrentSyncDevice = i18n("Multiple profiles") ; - mSyncAlgoPrefs = mRingSyncAlgoPrefs; + mSyncAlgoPrefs = mPrefs->mRingSyncAlgoPrefs; if ( askforPrefs ) { @@ -396,3 +403,3 @@ void KSyncManager::multiSync( bool askforPrefs ) if ( num ) - mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync completed!").arg(num) ); + mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync complete!").arg(num) ); else @@ -401,2 +408,3 @@ void KSyncManager::multiSync( bool askforPrefs ) } + int KSyncManager::ringSync() @@ -454,3 +462,3 @@ int KSyncManager::ringSync() if ( syncWithFile( temp->getRemoteFileNameAB( ), false ) ) - mLastSyncedLocalFile = temp->getRemoteFileNameAB(); + mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNameAB(); break; @@ -458,3 +466,3 @@ int KSyncManager::ringSync() if ( syncWithFile( temp->getRemoteFileName( ), false ) ) - mLastSyncedLocalFile = temp->getRemoteFileName(); + mPrefs->mLastSyncedLocalFile = temp->getRemoteFileName(); break; @@ -462,3 +470,3 @@ int KSyncManager::ringSync() if ( syncWithFile( temp->getRemoteFileNamePWM( ), false ) ) - mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); + mPrefs->mLastSyncedLocalFile = temp->getRemoteFileNamePWM(); break; @@ -474,2 +482,17 @@ int KSyncManager::ringSync() syncPhone(); + } else if ( temp->getIsPiSync() ) { + if ( mTargetApp == KAPI ) { + mPassWordPiSync = temp->getRemotePwAB(); + mActiveSyncPort = temp->getRemotePortAB(); + mActiveSyncIP = temp->getRemoteIPAB(); + } else if ( mTargetApp == KOPI ) { + mPassWordPiSync = temp->getRemotePw(); + mActiveSyncPort = temp->getRemotePort(); + mActiveSyncIP = temp->getRemoteIP(); + } else { + mPassWordPiSync = temp->getRemotePwPWM(); + mActiveSyncPort = temp->getRemotePortPWM(); + mActiveSyncIP = temp->getRemoteIPPWM(); + } + syncPi(); } else @@ -560,3 +583,3 @@ void KSyncManager::syncRemote( KSyncProfile* prof, bool ask) i18n("Okay!")) ; - mParent->topLevelWidget()->setCaption (""); + mParent->topLevelWidget()->setCaption ("KDE-Pim"); return; @@ -566,9 +589,4 @@ void KSyncManager::syncRemote( KSyncProfile* prof, bool ask) - - if ( syncWithFile( localTempFile, true ) ) { -// Event* e = mView->getLastSyncEvent(); -// e->setReadOnly( false ); -// e->setLocation( KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); -// e->setReadOnly( true ); + if ( mWriteBackFile ) { @@ -646,2 +664,3 @@ void KSyncManager::edit_sync_options() } + QString KSyncManager::getPassword( ) @@ -687,3 +706,3 @@ void KSyncManager::confSync() mLocalMachineName = sp->getLocalMachineName (); - fillSyncMenu(); + QTimer::singleShot ( 1, this, SLOT ( fillSyncMenu() ) ); } @@ -692,2 +711,3 @@ void KSyncManager::syncSharp() { + if ( ! syncExternalApplication("sharp") ) @@ -714,6 +734,4 @@ void KSyncManager::syncPhone() { - emit save(); - qDebug("pending syncPhone(); "); - //mView->syncPhone(); + syncExternalApplication("phone"); @@ -769,2 +787,3 @@ QString KSyncManager::syncFileName() + void KSyncManager::syncPi() @@ -1155,2 +1174 @@ void KCommandSocket::deleteSocket() } - |