-rw-r--r-- | korganizer/mainwindow.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index c3c4c26..062c95f 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -868,65 +868,71 @@ void MainWindow::fillSyncMenu() mView->setupExternSyncProfiles(); } int MainWindow::ringSync() { int syncedProfiles = 0; int i; QTime timer; KConfig config ( locateLocal( "config","syncprofilesrc" ) ); QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; KSyncProfile* temp = new KSyncProfile (); KOPrefs::instance()->mAskForPreferences = false; for ( i = 0; i < syncProfileNames.count(); ++i ) { mCurrentSyncProfile = i; temp->setName(syncProfileNames[mCurrentSyncProfile]); temp->readConfig(&config); if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); ++syncedProfiles; // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); KOPrefs::instance()->mShowSyncSummary = false; mView->setSyncDevice(syncProfileNames[i] ); mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); if ( i == 0 ) { syncSharp(); } else { if ( temp->getIsLocalFileSync() ) { if ( syncWithFile( temp->getRemoteFileName( ), true ) ) KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); } else { - syncRemote( temp, false ); + if ( temp->getIsPhoneSync() ) { + KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; + KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); + KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); + syncPhone(); + } else + syncRemote( temp, false ); } } timer.start(); setCaption(i18n("Multiple sync in progress ... please wait!") ); while ( timer.elapsed () < 2000 ) { qApp->processEvents(); #ifndef _WIN32_ sleep (1); #endif } } } delete temp; return syncedProfiles; } void MainWindow::multiSync( bool askforPrefs ) { if (mBlockSaveFlag) return; mBlockSaveFlag = true; 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( this, i18n("KO/Pi Sync"), question, i18n("Yes"), i18n("No"), 0, 0 ) != 0 ) { mBlockSaveFlag = false; setCaption(i18n("Aborted! Nothing synced!")); return; @@ -2008,42 +2014,50 @@ void MainWindow::syncSSH() setCaption ("KO/Pi"); return; } else { setCaption ( i18n( "Syncronization sucessfully completed" ) ); } } } return; #if 0 system ("scp zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics /home/polo/Applications/korganizer/z_sync.ics"); while ( timer.elapsed() < 5000 ) qApp->processEvents(); qDebug("MainWindow::merging) "); mView->syncCalendar( "/home/polo/Applications/korganizer/z_sync.ics", 0 ); while ( mBlockSaveFlag ) qApp->processEvents(); save(); system ("scp /home/polo/Applications/korganizer/mycalendar.ics zaurus@192.168.0.65:/home/zaurus/Applications/korganizer/mycalendar.ics"); #endif } void MainWindow::syncSharp() { if ( mCalendarModifiedFlag ) save(); mView->syncSharp(); slotModifiedChanged( true ); } +void MainWindow::syncPhone() +{ + if ( mCalendarModifiedFlag ) + save(); + mView->syncPhone(); + slotModifiedChanged( true ); + +} void MainWindow::printSel( ) { mView->viewManager()->agendaView()->agenda()->printSelection(); } void MainWindow::printCal() { mView->print();//mCp->showDialog(); } |