author | zautrix <zautrix> | 2005-08-23 13:59:59 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-23 13:59:59 (UTC) |
commit | 02fa432f183ad2b18380de0e41399efe3b867dba (patch) (unidiff) | |
tree | d13d3941ef4d6abc90790d5b6039a92787ea7987 /kaddressbook | |
parent | 72d600e2c3b3405e5f37615a56560811c0cf9a78 (diff) | |
download | kdepimpi-02fa432f183ad2b18380de0e41399efe3b867dba.zip kdepimpi-02fa432f183ad2b18380de0e41399efe3b867dba.tar.gz kdepimpi-02fa432f183ad2b18380de0e41399efe3b867dba.tar.bz2 |
fixx
-rw-r--r-- | kaddressbook/kabcore.cpp | 28 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 4 | ||||
-rw-r--r-- | kaddressbook/kaddressbookmain.cpp | 4 | ||||
-rw-r--r-- | kaddressbook/mainembedded.cpp | 5 |
4 files changed, 33 insertions, 8 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index b9830b1..c670b1f 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -400,15 +400,38 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
400 | #ifndef DESKTOP_VERSION | 400 | #ifndef DESKTOP_VERSION |
401 | infrared = 0; | 401 | infrared = 0; |
402 | #endif | 402 | #endif |
403 | //toggleBeamReceive( ); | 403 | //toggleBeamReceive( ); |
404 | mMainWindow->toolBar()->show(); | 404 | mMainWindow->toolBar()->show(); |
405 | // we have a toolbar repainting error on the Zaurus when starting KA/Pi | 405 | // we have a toolbar repainting error on the Zaurus when starting KA/Pi |
406 | QTimer::singleShot( 10, this , SLOT ( updateToolBar())); | 406 | //QTimer::singleShot( 10, this , SLOT ( updateToolBar())); |
407 | QTimer::singleShot( 100, this, SLOT ( loadDataAfterStart() )); | ||
408 | } | ||
409 | void KABCore::receiveStart( const QCString& cmsg, const QByteArray& data ) | ||
410 | { | ||
411 | qDebug("KO: QCOP start message received: %s ", cmsg.data() ); | ||
412 | mCStringMess = cmsg; | ||
413 | mByteData = data; | ||
407 | } | 414 | } |
408 | 415 | ||
416 | void KABCore::loadDataAfterStart() | ||
417 | { | ||
418 | qDebug("KABCore::loadDataAfterStart() "); | ||
419 | ((StdAddressBook*)mAddressBook)->init( true ); | ||
420 | mViewManager->refreshView(); | ||
421 | |||
422 | #ifndef DESKTOP_VERSION | ||
423 | disconnect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT (receiveStart ( const QCString &, const QByteArray & ))); | ||
424 | |||
425 | QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | ||
426 | if ( !mCStringMess.isEmpty() ) | ||
427 | ExternalAppHandler::instance()->appMessage( mCStringMess, mByteData ); | ||
428 | #endif | ||
429 | QTimer::singleShot( 10, this , SLOT ( updateToolBar())); | ||
430 | setCaptionBack(); | ||
431 | } | ||
409 | void KABCore::updateToolBar() | 432 | void KABCore::updateToolBar() |
410 | { | 433 | { |
411 | static int iii = 0; | 434 | static int iii = 0; |
412 | ++iii; | 435 | ++iii; |
413 | mMainWindow->toolBar()->repaintMe(); | 436 | mMainWindow->toolBar()->repaintMe(); |
414 | if ( iii < 4 ) | 437 | if ( iii < 4 ) |
@@ -2442,13 +2465,12 @@ void KABCore::removeVoice() | |||
2442 | for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { | 2465 | for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { |
2443 | if ( (*it).tagged() ) { | 2466 | if ( (*it).tagged() ) { |
2444 | (*it).removeVoice(); | 2467 | (*it).removeVoice(); |
2445 | } | 2468 | } |
2446 | } | 2469 | } |
2447 | message(i18n("Refreshing view...") ); | 2470 | message(i18n("Refreshing view...") ); |
2448 | qApp->processEvents(); | ||
2449 | mViewManager->refreshView( "" ); | 2471 | mViewManager->refreshView( "" ); |
2450 | Addressee add; | 2472 | Addressee add; |
2451 | mDetails->setAddressee( add ); | 2473 | mDetails->setAddressee( add ); |
2452 | message(i18n("Remove voice completed!") ); | 2474 | message(i18n("Remove voice completed!") ); |
2453 | 2475 | ||
2454 | 2476 | ||
@@ -2474,13 +2496,12 @@ void KABCore::setFormattedName() | |||
2474 | if ( (*it).uid().left( 2 ) == "la" ) | 2496 | if ( (*it).uid().left( 2 ) == "la" ) |
2475 | if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) | 2497 | if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) |
2476 | continue; | 2498 | continue; |
2477 | ++count; | 2499 | ++count; |
2478 | if ( count %10 == 0 ) | 2500 | if ( count %10 == 0 ) |
2479 | message(i18n("Changing contact #%1").arg( count ) ); | 2501 | message(i18n("Changing contact #%1").arg( count ) ); |
2480 | qApp->processEvents(); | ||
2481 | QString fName; | 2502 | QString fName; |
2482 | if ( setpref.simple->isChecked() ) | 2503 | if ( setpref.simple->isChecked() ) |
2483 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName ); | 2504 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName ); |
2484 | else if ( setpref.full->isChecked() ) | 2505 | else if ( setpref.full->isChecked() ) |
2485 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName ); | 2506 | fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName ); |
2486 | else if ( setpref.reverse->isChecked() ) | 2507 | else if ( setpref.reverse->isChecked() ) |
@@ -2494,13 +2515,12 @@ void KABCore::setFormattedName() | |||
2494 | (*it).setChanged( true ); | 2515 | (*it).setChanged( true ); |
2495 | modified = true; | 2516 | modified = true; |
2496 | (*it).setRevision( QDateTime::currentDateTime() ); | 2517 | (*it).setRevision( QDateTime::currentDateTime() ); |
2497 | } | 2518 | } |
2498 | } | 2519 | } |
2499 | message(i18n("Refreshing view...") ); | 2520 | message(i18n("Refreshing view...") ); |
2500 | qApp->processEvents(); | ||
2501 | if ( modified ) | 2521 | if ( modified ) |
2502 | setModified( true ); | 2522 | setModified( true ); |
2503 | Addressee add; | 2523 | Addressee add; |
2504 | mDetails->setAddressee( add ); | 2524 | mDetails->setAddressee( add ); |
2505 | if ( count == 0 ) | 2525 | if ( count == 0 ) |
2506 | message(i18n("No contact changed!") ); | 2526 | message(i18n("No contact changed!") ); |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index ceeeda7..42b7709 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -351,24 +351,26 @@ class KABCore : public QWidget, public KSyncInterface | |||
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 recieve(QString cmsg ); | 358 | void recieve(QString cmsg ); |
358 | void getFile( bool success ); | 359 | void getFile( bool success ); |
359 | void syncFileRequest(); | 360 | void syncFileRequest(); |
360 | void setDetailsVisible( bool visible ); | 361 | void setDetailsVisible( bool visible ); |
361 | void setDetailsToState(); | 362 | void setDetailsToState(); |
362 | 363 | ||
363 | void saveSettings(); | 364 | void saveSettings(); |
364 | 365 | ||
365 | private slots: | 366 | private slots: |
366 | void updateToolBar(); | 367 | void updateToolBar(); |
367 | void updateMainWindow(); | 368 | void updateMainWindow(); |
368 | 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 ); | ||
369 | void toggleBeamReceive( ); | 371 | void toggleBeamReceive( ); |
370 | void disableBR(bool); | 372 | void disableBR(bool); |
371 | void setJumpButtonBarVisible( bool visible ); | 373 | void setJumpButtonBarVisible( bool visible ); |
372 | void setJumpButtonBar( bool visible ); | 374 | void setJumpButtonBar( bool visible ); |
373 | void setCaptionBack(); | 375 | void setCaptionBack(); |
374 | void resizeAndCallContactdialog(); | 376 | void resizeAndCallContactdialog(); |
@@ -389,12 +391,14 @@ class KABCore : public QWidget, public KSyncInterface | |||
389 | 391 | ||
390 | void slotEditorDestroyed( const QString &uid ); | 392 | void slotEditorDestroyed( const QString &uid ); |
391 | void configurationChanged(); | 393 | void configurationChanged(); |
392 | void addressBookChanged(); | 394 | void addressBookChanged(); |
393 | 395 | ||
394 | private: | 396 | private: |
397 | QCString mCStringMess; | ||
398 | QByteArray mByteData; | ||
395 | QString mEmailSourceChannel; | 399 | QString mEmailSourceChannel; |
396 | QString mEmailSourceUID; | 400 | QString mEmailSourceUID; |
397 | void resizeEvent(QResizeEvent* e ); | 401 | void resizeEvent(QResizeEvent* e ); |
398 | bool mBRdisabled; | 402 | bool mBRdisabled; |
399 | #ifndef DESKTOP_VERSION | 403 | #ifndef DESKTOP_VERSION |
400 | QCopChannel* infrared; | 404 | QCopChannel* infrared; |
diff --git a/kaddressbook/kaddressbookmain.cpp b/kaddressbook/kaddressbookmain.cpp index 519dc92..8fe3ee0 100644 --- a/kaddressbook/kaddressbookmain.cpp +++ b/kaddressbook/kaddressbookmain.cpp | |||
@@ -80,14 +80,16 @@ KAddressBookMain::KAddressBookMain() : DCOPObject( "KAddressBookIface" ), KMainW | |||
80 | 80 | ||
81 | createGUI( "kaddressbookui.rc", false ); | 81 | createGUI( "kaddressbookui.rc", false ); |
82 | 82 | ||
83 | 83 | ||
84 | #endif //KAB_EMBEDDED | 84 | #endif //KAB_EMBEDDED |
85 | setAutoSaveSettings(); | 85 | setAutoSaveSettings(); |
86 | qApp->processEvents(); | ||
87 | mCore->restoreSettings(); | 86 | mCore->restoreSettings(); |
87 | #ifndef DESKTOP_VERSION | ||
88 | QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), mCore, SLOT (receiveStart ( const QCString &, const QByteArray & ))); | ||
89 | #endif | ||
88 | } | 90 | } |
89 | 91 | ||
90 | KAddressBookMain::~KAddressBookMain() | 92 | KAddressBookMain::~KAddressBookMain() |
91 | { | 93 | { |
92 | // mCore->saveSettings(); | 94 | // mCore->saveSettings(); |
93 | } | 95 | } |
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index 93ba53c..2f3531d 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -76,24 +76,23 @@ int main( int argc, char **argv ) | |||
76 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); | 76 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); |
77 | // init language | 77 | // init language |
78 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 78 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
79 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); | 79 | QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); |
80 | KAddressBookMain m ; | 80 | KAddressBookMain m ; |
81 | //US MainWindow m; | 81 | //US MainWindow m; |
82 | #ifndef DESKTOP_VERSION | 82 | |
83 | QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | ||
84 | #endif | ||
85 | 83 | ||
86 | 84 | ||
87 | #ifndef DESKTOP_VERSION | 85 | #ifndef DESKTOP_VERSION |
88 | a.showMainWidget( &m ); | 86 | a.showMainWidget( &m ); |
89 | 87 | ||
90 | #else | 88 | #else |
91 | a.setMainWidget( &m ); | 89 | a.setMainWidget( &m ); |
92 | m.show(); | 90 | m.show(); |
93 | #endif | 91 | #endif |
92 | m.setCaption(i18n("Loading addressbook data ... please wait" )); | ||
94 | a.exec(); | 93 | a.exec(); |
95 | #ifdef DESKTOP_VERSION | 94 | #ifdef DESKTOP_VERSION |
96 | KConfig *config = KABPrefs::instance()->getConfig(); | 95 | KConfig *config = KABPrefs::instance()->getConfig(); |
97 | config->setGroup("WidgetLayout"); | 96 | config->setGroup("WidgetLayout"); |
98 | QStringList list ;//= config->readListEntry("MainLayout"); | 97 | QStringList list ;//= config->readListEntry("MainLayout"); |
99 | int x,y,w,h; | 98 | int x,y,w,h; |