summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-12-02 09:42:53 (UTC)
committer zautrix <zautrix>2005-12-02 09:42:53 (UTC)
commita75d2c26aba6cffae8c3f61e173940240042427b (patch) (unidiff)
tree68f4b61c150bc263a98c78fdf8671bbbc17cdaf8 /kaddressbook
parent64be8d64fc26d1025a24150d065197ba5d608f3d (diff)
downloadkdepimpi-a75d2c26aba6cffae8c3f61e173940240042427b.zip
kdepimpi-a75d2c26aba6cffae8c3f61e173940240042427b.tar.gz
kdepimpi-a75d2c26aba6cffae8c3f61e173940240042427b.tar.bz2
more sync
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp6
-rw-r--r--kaddressbook/kabcore.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 5d377bf..7d8586a 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1892,97 +1892,97 @@ void KABCore::initGUI()
1892 1892
1893 mExtensionManager = new ExtensionManager( this, mMiniSplitter ); 1893 mExtensionManager = new ExtensionManager( this, mMiniSplitter );
1894#endif 1894#endif
1895 //eh->hide(); 1895 //eh->hide();
1896 // topLayout->addWidget(mExtensionManager ); 1896 // topLayout->addWidget(mExtensionManager );
1897 1897
1898 1898
1899/*US 1899/*US
1900#ifndef KAB_NOSPLITTER 1900#ifndef KAB_NOSPLITTER
1901 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1901 QHBoxLayout *topLayout = new QHBoxLayout( this );
1902//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1902//US topLayout->setSpacing( KDialogBase::spacingHint() );
1903 topLayout->setSpacing( 10 ); 1903 topLayout->setSpacing( 10 );
1904 1904
1905 mDetailsSplitter = new QSplitter( this ); 1905 mDetailsSplitter = new QSplitter( this );
1906 1906
1907 QVBox *viewSpace = new QVBox( mDetailsSplitter ); 1907 QVBox *viewSpace = new QVBox( mDetailsSplitter );
1908 1908
1909 mViewManager = new ViewManager( this, viewSpace ); 1909 mViewManager = new ViewManager( this, viewSpace );
1910 viewSpace->setStretchFactor( mViewManager, 1 ); 1910 viewSpace->setStretchFactor( mViewManager, 1 );
1911 1911
1912 mDetails = new ViewContainer( mDetailsSplitter ); 1912 mDetails = new ViewContainer( mDetailsSplitter );
1913 1913
1914 topLayout->addWidget( mDetailsSplitter ); 1914 topLayout->addWidget( mDetailsSplitter );
1915 topLayout->setStretchFactor( mDetailsSplitter, 100 ); 1915 topLayout->setStretchFactor( mDetailsSplitter, 100 );
1916#else //KAB_NOSPLITTER 1916#else //KAB_NOSPLITTER
1917 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1917 QHBoxLayout *topLayout = new QHBoxLayout( this );
1918//US topLayout->setSpacing( KDialogBase::spacingHint() ); 1918//US topLayout->setSpacing( KDialogBase::spacingHint() );
1919 topLayout->setSpacing( 10 ); 1919 topLayout->setSpacing( 10 );
1920 1920
1921// mDetailsSplitter = new QSplitter( this ); 1921// mDetailsSplitter = new QSplitter( this );
1922 1922
1923 QVBox *viewSpace = new QVBox( this ); 1923 QVBox *viewSpace = new QVBox( this );
1924 1924
1925 mViewManager = new ViewManager( this, viewSpace ); 1925 mViewManager = new ViewManager( this, viewSpace );
1926 viewSpace->setStretchFactor( mViewManager, 1 ); 1926 viewSpace->setStretchFactor( mViewManager, 1 );
1927 1927
1928 mDetails = new ViewContainer( this ); 1928 mDetails = new ViewContainer( this );
1929 1929
1930 topLayout->addWidget( viewSpace ); 1930 topLayout->addWidget( viewSpace );
1931// topLayout->setStretchFactor( mDetailsSplitter, 100 ); 1931// topLayout->setStretchFactor( mDetailsSplitter, 100 );
1932 topLayout->addWidget( mDetails ); 1932 topLayout->addWidget( mDetails );
1933#endif //KAB_NOSPLITTER 1933#endif //KAB_NOSPLITTER
1934*/ 1934*/
1935 1935
1936 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 1936 syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
1937 syncManager->setBlockSave(false); 1937 syncManager->setBlockSave(false);
1938 1938
1939 connect(syncManager , SIGNAL( request_file(const QString &) ), this, SLOT( syncFileRequest(const QString &) ) ); 1939 connect(syncManager , SIGNAL( request_file(const QString &) ), this, SLOT( syncFileRequest(const QString &) ) );
1940 connect(syncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 1940 connect(syncManager , SIGNAL( getFile( bool ,const QString &)), this, SLOT(getFile( bool ,const QString &) ) );
1941 QString sync_file = sentSyncFile(); 1941 QString sync_file = sentSyncFile();
1942 //qDebug("KABCore::initGUI()::setting tmp sync file to:%s ",sync_file.latin1()); 1942 //qDebug("KABCore::initGUI()::setting tmp sync file to:%s ",sync_file.latin1());
1943 syncManager->setDefaultFileName( sync_file ); 1943 syncManager->setDefaultFileName( sync_file );
1944 //connect(syncManager , SIGNAL( ), this, SLOT( ) ); 1944 //connect(syncManager , SIGNAL( ), this, SLOT( ) );
1945 1945
1946#endif //KAB_EMBEDDED 1946#endif //KAB_EMBEDDED
1947 initActions(); 1947 initActions();
1948 1948
1949#ifdef KAB_EMBEDDED 1949#ifdef KAB_EMBEDDED
1950 addActionsManually(); 1950 addActionsManually();
1951 //US make sure the export and import menues are initialized before creating the xxPortManager. 1951 //US make sure the export and import menues are initialized before creating the xxPortManager.
1952 mXXPortManager = new XXPortManager( this, this ); 1952 mXXPortManager = new XXPortManager( this, this );
1953 1953
1954 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() ); 1954 // LR mIncSearchWidget = new IncSearchWidget( mMainWindow->getIconToolBar() );
1955 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget); 1955 //mMainWindow->toolBar()->insertWidget(-1, 4, mIncSearchWidget);
1956 // mActionQuit->plug ( mMainWindow->toolBar()); 1956 // mActionQuit->plug ( mMainWindow->toolBar());
1957 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() ); 1957 //mIncSearchWidget = new IncSearchWidget( mMainWindow->toolBar() );
1958 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget); 1958 //mMainWindow->toolBar()->insertWidget(-1, 0, mIncSearchWidget);
1959 // mIncSearchWidget->hide(); 1959 // mIncSearchWidget->hide();
1960 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ), 1960 connect( mIncSearchWidget, SIGNAL( doSearch( const QString& ) ),
1961 SLOT( incrementalSearch( const QString& ) ) ); 1961 SLOT( incrementalSearch( const QString& ) ) );
1962 connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) ); 1962 connect( mIncSearchWidget, SIGNAL( scrollUP() ),mViewManager, SLOT( scrollUP() ) );
1963 connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) ); 1963 connect( mIncSearchWidget, SIGNAL( scrollDOWN() ),mViewManager, SLOT( scrollDOWN() ) );
1964 1964
1965 mJumpButtonBar = new JumpButtonBar( this, this ); 1965 mJumpButtonBar = new JumpButtonBar( this, this );
1966 1966
1967 topLayout->addWidget( mJumpButtonBar ); 1967 topLayout->addWidget( mJumpButtonBar );
1968//US topLayout->setStretchFactor( mJumpButtonBar, 10 ); 1968//US topLayout->setStretchFactor( mJumpButtonBar, 10 );
1969 1969
1970// mMainWindow->getIconToolBar()->raise(); 1970// mMainWindow->getIconToolBar()->raise();
1971 1971
1972#endif //KAB_EMBEDDED 1972#endif //KAB_EMBEDDED
1973 1973
1974} 1974}
1975void KABCore::initActions() 1975void KABCore::initActions()
1976{ 1976{
1977//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart); 1977//US qDebug("KABCore::initActions(): mIsPart %i", mIsPart);
1978 1978
1979#ifndef KAB_EMBEDDED 1979#ifndef KAB_EMBEDDED
1980 connect( QApplication::clipboard(), SIGNAL( dataChanged() ), 1980 connect( QApplication::clipboard(), SIGNAL( dataChanged() ),
1981 SLOT( clipboardDataChanged() ) ); 1981 SLOT( clipboardDataChanged() ) );
1982#endif //KAB_EMBEDDED 1982#endif //KAB_EMBEDDED
1983 1983
1984 // file menu 1984 // file menu
1985 1985
1986 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() ); 1986 mActionMail = KStdAction::mail( this, SLOT( sendMail() ), actionCollection() );
1987 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() ); 1987 //mActionPrint = KStdAction::print( this, SLOT( print() ), actionCollection() );
1988 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager, 1988 mActionPrint = new KAction( i18n( "&Print View" ), "fileprint", CTRL + Key_P, mViewManager,
@@ -3415,86 +3415,86 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource)
3415 } 3415 }
3416 disableBR( false ); 3416 disableBR( false );
3417 return syncOK; 3417 return syncOK;
3418 3418
3419} 3419}
3420void KABCore::message( QString m, bool startTimer) 3420void KABCore::message( QString m, bool startTimer)
3421{ 3421{
3422 topLevelWidget()->setCaption( m ); 3422 topLevelWidget()->setCaption( m );
3423 qApp->processEvents(); 3423 qApp->processEvents();
3424 if ( startTimer ) 3424 if ( startTimer )
3425 mMessageTimer->start( 15000, true ); 3425 mMessageTimer->start( 15000, true );
3426 else 3426 else
3427 mMessageTimer->stop(); 3427 mMessageTimer->stop();
3428} 3428}
3429bool KABCore::syncPhone() 3429bool KABCore::syncPhone()
3430{ 3430{
3431 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); 3431 QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice();
3432 QString fileName = getPhoneFile(); 3432 QString fileName = getPhoneFile();
3433 if ( !PhoneAccess::readFromPhone( fileName) ) { 3433 if ( !PhoneAccess::readFromPhone( fileName) ) {
3434 message(i18n("Phone access failed!")); 3434 message(i18n("Phone access failed!"));
3435 return false; 3435 return false;
3436 } 3436 }
3437 AddressBook abLocal( fileName,"syncContact"); 3437 AddressBook abLocal( fileName,"syncContact");
3438 bool syncOK = false; 3438 bool syncOK = false;
3439 { 3439 {
3440 abLocal.importFromFile( fileName ); 3440 abLocal.importFromFile( fileName );
3441 qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); 3441 qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1());
3442 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 3442 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
3443 abLocal.preparePhoneSync( mCurrentSyncDevice, true ); 3443 abLocal.preparePhoneSync( mCurrentSyncDevice, true );
3444 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); 3444 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true );
3445 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 3445 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
3446 syncManager->hideProgressBar(); 3446 syncManager->hideProgressBar();
3447 if ( syncOK ) { 3447 if ( syncOK ) {
3448 if ( syncManager->mWriteBackFile ) { 3448 if ( syncManager->mWriteBackFile ) {
3449 abLocal.removeSyncAddressees( true ); 3449 abLocal.removeSyncAddressees( true );
3450 abLocal.saveABphone( fileName ); 3450 abLocal.saveABphone( fileName );
3451 abLocal.findNewExtIds( fileName, mCurrentSyncDevice ); 3451 abLocal.findNewExtIds( fileName, mCurrentSyncDevice );
3452 //abLocal.preparePhoneSync( mCurrentSyncDevice, false ); 3452 //abLocal.preparePhoneSync( mCurrentSyncDevice, false );
3453 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true ); 3453 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice, true );
3454 } 3454 }
3455 } 3455 }
3456 setModified(); 3456 setModified();
3457 } 3457 }
3458 abLocal.removeResources(); 3458 abLocal.removeResources();
3459 if ( syncOK ) 3459 if ( syncOK )
3460 mViewManager->refreshView(); 3460 mViewManager->refreshView();
3461 return syncOK; 3461 return syncOK;
3462} 3462}
3463void KABCore::getFile( bool success ) 3463void KABCore::getFile( bool success ,const QString & resource)
3464{ 3464{
3465 if ( ! success ) { 3465 if ( ! success ) {
3466 message( i18n("Error receiving file. Nothing changed!") ); 3466 message( i18n("Error receiving file. Nothing changed!") );
3467 return; 3467 return;
3468 } 3468 }
3469 int count = mAddressBook->importFromFile( sentSyncFile() , false, true ); 3469 int count = mAddressBook->importFromFile( sentSyncFile() , false, true ,resource);
3470 if ( count ) 3470 if ( count )
3471 setModified( true ); 3471 setModified( true );
3472 message( i18n("Pi-Sync successful!") ); 3472 message( i18n("Pi-Sync successful!") );
3473 mViewManager->refreshView(); 3473 mViewManager->refreshView();
3474} 3474}
3475void KABCore::syncFileRequest(const QString & resource) 3475void KABCore::syncFileRequest(const QString & resource)
3476{ 3476{
3477 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) { 3477 if ( KABPrefs::instance()->mPassiveSyncWithDesktop ) {
3478 syncManager->slotSyncMenu( 999 ); 3478 syncManager->slotSyncMenu( 999 );
3479 } 3479 }
3480 3480
3481 if ( resource == "ALL" ) { 3481 if ( resource == "ALL" ) {
3482 mAddressBook->export2File( sentSyncFile() ); 3482 mAddressBook->export2File( sentSyncFile() );
3483 } 3483 }
3484 else 3484 else
3485 mAddressBook->export2File( sentSyncFile(), resource); 3485 mAddressBook->export2File( sentSyncFile(), resource);
3486} 3486}
3487QString KABCore::sentSyncFile() 3487QString KABCore::sentSyncFile()
3488{ 3488{
3489#ifdef DESKTOP_VERSION 3489#ifdef DESKTOP_VERSION
3490 return locateLocal( "tmp", "copysyncab.vcf" ); 3490 return locateLocal( "tmp", "copysyncab.vcf" );
3491#else 3491#else
3492 return QString( "/tmp/copysyncab.vcf" ); 3492 return QString( "/tmp/copysyncab.vcf" );
3493#endif 3493#endif
3494} 3494}
3495 3495
3496void KABCore::setCaptionBack() 3496void KABCore::setCaptionBack()
3497{ 3497{
3498 mMessageTimer->stop(); 3498 mMessageTimer->stop();
3499 topLevelWidget()->setCaption( i18n("KA/Pi") ); 3499 topLevelWidget()->setCaption( i18n("KA/Pi") );
3500} 3500}
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h
index 2d1505f..e69cb60 100644
--- a/kaddressbook/kabcore.h
+++ b/kaddressbook/kabcore.h
@@ -311,97 +311,97 @@ class KABCore : public QWidget, public KSyncInterface
311 311
312 /** 312 /**
313 Shows the edit dialog for the given uid. If the uid is QString::null, 313 Shows the edit dialog for the given uid. If the uid is QString::null,
314 the method will try to find a selected addressee in the view. 314 the method will try to find a selected addressee in the view.
315 */ 315 */
316 void editContact( const QString &uid /*US = QString::null*/ ); 316 void editContact( const QString &uid /*US = QString::null*/ );
317//US added a second method without defaultparameter 317//US added a second method without defaultparameter
318 void editContact2(); 318 void editContact2();
319 319
320 /** 320 /**
321 Shows or edits the detail view for the given uid. If the uid is QString::null, 321 Shows or edits the detail view for the given uid. If the uid is QString::null,
322 the method will try to find a selected addressee in the view. 322 the method will try to find a selected addressee in the view.
323 */ 323 */
324 void executeContact( const QString &uid /*US = QString::null*/ ); 324 void executeContact( const QString &uid /*US = QString::null*/ );
325 325
326 /** 326 /**
327 Launches the configuration dialog. 327 Launches the configuration dialog.
328 */ 328 */
329 void openConfigDialog(); 329 void openConfigDialog();
330 void openConfigGlobalDialog(); 330 void openConfigGlobalDialog();
331 331
332 /** 332 /**
333 Launches the ldap search dialog. 333 Launches the ldap search dialog.
334 */ 334 */
335 void openLDAPDialog(); 335 void openLDAPDialog();
336 336
337 /** 337 /**
338 Creates a KAddressBookPrinter, which will display the print 338 Creates a KAddressBookPrinter, which will display the print
339 dialog and do the printing. 339 dialog and do the printing.
340 */ 340 */
341 void print(); 341 void print();
342 342
343 /** 343 /**
344 Registers a new GUI client, so plugins can register its actions. 344 Registers a new GUI client, so plugins can register its actions.
345 */ 345 */
346 void addGUIClient( KXMLGUIClient *client ); 346 void addGUIClient( KXMLGUIClient *client );
347 347
348 void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); 348 void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid);
349 void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); 349 void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid);
350 void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); 350 void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid);
351 351
352 352
353 signals: 353 signals:
354 void contactSelected( const QString &name ); 354 void contactSelected( const QString &name );
355 void contactSelected( const QPixmap &pixmap ); 355 void contactSelected( const QPixmap &pixmap );
356 public slots: 356 public slots:
357 void loadDataAfterStart(); 357 void loadDataAfterStart();
358 void recieve(QString cmsg ); 358 void recieve(QString cmsg );
359 void getFile( bool success ); 359 void getFile( bool success,const QString & );
360 void syncFileRequest(const QString &); 360 void syncFileRequest(const QString &);
361 void setDetailsVisible( bool visible ); 361 void setDetailsVisible( bool visible );
362 void setDetailsToState(); 362 void setDetailsToState();
363 363
364 void saveSettings(); 364 void saveSettings();
365 365
366 private slots: 366 private slots:
367 void updateToolBar(); 367 void updateToolBar();
368 void updateMainWindow(); 368 void updateMainWindow();
369 void receive( const QCString& cmsg, const QByteArray& data ); 369 void receive( const QCString& cmsg, const QByteArray& data );
370 void receiveStart( const QCString& cmsg, const QByteArray& data ); 370 void receiveStart( const QCString& cmsg, const QByteArray& data );
371 void toggleBeamReceive( ); 371 void toggleBeamReceive( );
372 void disableBR(bool); 372 void disableBR(bool);
373 void setJumpButtonBarVisible( bool visible ); 373 void setJumpButtonBarVisible( bool visible );
374 void setJumpButtonBar( bool visible ); 374 void setJumpButtonBar( bool visible );
375 void setCaptionBack(); 375 void setCaptionBack();
376 void resizeAndCallContactdialog(); 376 void resizeAndCallContactdialog();
377 void callContactdialog(); 377 void callContactdialog();
378 void doRingSync(); 378 void doRingSync();
379 379
380 void importFromOL(); 380 void importFromOL();
381 void extensionModified( const KABC::Addressee::List &list ); 381 void extensionModified( const KABC::Addressee::List &list );
382 void extensionChanged( int id ); 382 void extensionChanged( int id );
383 void clipboardDataChanged(); 383 void clipboardDataChanged();
384 void updateActionMenu(); 384 void updateActionMenu();
385 void configureKeyBindings(); 385 void configureKeyBindings();
386 void removeVoice(); 386 void removeVoice();
387 void setFormattedName(); 387 void setFormattedName();
388#ifdef KAB_EMBEDDED 388#ifdef KAB_EMBEDDED
389 void configureResources(); 389 void configureResources();
390#endif //KAB_EMBEDDED 390#endif //KAB_EMBEDDED
391 391
392 void slotEditorDestroyed( const QString &uid ); 392 void slotEditorDestroyed( const QString &uid );
393 void configurationChanged(); 393 void configurationChanged();
394 void addressBookChanged(); 394 void addressBookChanged();
395 395
396 private: 396 private:
397 QCString mCStringMess; 397 QCString mCStringMess;
398 QByteArray mByteData; 398 QByteArray mByteData;
399 QString mEmailSourceChannel; 399 QString mEmailSourceChannel;
400 QString mEmailSourceUID; 400 QString mEmailSourceUID;
401 void resizeEvent(QResizeEvent* e ); 401 void resizeEvent(QResizeEvent* e );
402 bool mBRdisabled; 402 bool mBRdisabled;
403#ifndef DESKTOP_VERSION 403#ifndef DESKTOP_VERSION
404 QCopChannel* infrared; 404 QCopChannel* infrared;
405#endif 405#endif
406 QTimer *mMessageTimer; 406 QTimer *mMessageTimer;
407 void initGUI(); 407 void initGUI();