author | zautrix <zautrix> | 2005-08-23 13:59:59 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-23 13:59:59 (UTC) |
commit | 02fa432f183ad2b18380de0e41399efe3b867dba (patch) (side-by-side diff) | |
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 #ifndef DESKTOP_VERSION infrared = 0; #endif //toggleBeamReceive( ); mMainWindow->toolBar()->show(); // we have a toolbar repainting error on the Zaurus when starting KA/Pi - QTimer::singleShot( 10, this , SLOT ( updateToolBar())); + //QTimer::singleShot( 10, this , SLOT ( updateToolBar())); + QTimer::singleShot( 100, this, SLOT ( loadDataAfterStart() )); +} +void KABCore::receiveStart( const QCString& cmsg, const QByteArray& data ) +{ + qDebug("KO: QCOP start message received: %s ", cmsg.data() ); + mCStringMess = cmsg; + mByteData = data; } +void KABCore::loadDataAfterStart() +{ + qDebug("KABCore::loadDataAfterStart() "); + ((StdAddressBook*)mAddressBook)->init( true ); + mViewManager->refreshView(); + +#ifndef DESKTOP_VERSION + disconnect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), this, SLOT (receiveStart ( const QCString &, const QByteArray & ))); + + QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); + if ( !mCStringMess.isEmpty() ) + ExternalAppHandler::instance()->appMessage( mCStringMess, mByteData ); +#endif + QTimer::singleShot( 10, this , SLOT ( updateToolBar())); + setCaptionBack(); +} void KABCore::updateToolBar() { static int iii = 0; ++iii; mMainWindow->toolBar()->repaintMe(); if ( iii < 4 ) @@ -2442,13 +2465,12 @@ void KABCore::removeVoice() for ( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { if ( (*it).tagged() ) { (*it).removeVoice(); } } message(i18n("Refreshing view...") ); - qApp->processEvents(); mViewManager->refreshView( "" ); Addressee add; mDetails->setAddressee( add ); message(i18n("Remove voice completed!") ); @@ -2474,13 +2496,12 @@ void KABCore::setFormattedName() if ( (*it).uid().left( 2 ) == "la" ) if ( (*it).uid().left( 19 ) == QString("last-syncAddressee-") ) continue; ++count; if ( count %10 == 0 ) message(i18n("Changing contact #%1").arg( count ) ); - qApp->processEvents(); QString fName; if ( setpref.simple->isChecked() ) fName = NameEditDialog::formattedName( (*it), NameEditDialog::SimpleName ); else if ( setpref.full->isChecked() ) fName = NameEditDialog::formattedName( (*it), NameEditDialog::FullName ); else if ( setpref.reverse->isChecked() ) @@ -2494,13 +2515,12 @@ void KABCore::setFormattedName() (*it).setChanged( true ); modified = true; (*it).setRevision( QDateTime::currentDateTime() ); } } message(i18n("Refreshing view...") ); - qApp->processEvents(); if ( modified ) setModified( true ); Addressee add; mDetails->setAddressee( add ); if ( count == 0 ) 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 signals: void contactSelected( const QString &name ); void contactSelected( const QPixmap &pixmap ); public slots: + void loadDataAfterStart(); void recieve(QString cmsg ); void getFile( bool success ); void syncFileRequest(); void setDetailsVisible( bool visible ); void setDetailsToState(); void saveSettings(); private slots: void updateToolBar(); void updateMainWindow(); void receive( const QCString& cmsg, const QByteArray& data ); + void receiveStart( const QCString& cmsg, const QByteArray& data ); void toggleBeamReceive( ); void disableBR(bool); void setJumpButtonBarVisible( bool visible ); void setJumpButtonBar( bool visible ); void setCaptionBack(); void resizeAndCallContactdialog(); @@ -389,12 +391,14 @@ class KABCore : public QWidget, public KSyncInterface void slotEditorDestroyed( const QString &uid ); void configurationChanged(); void addressBookChanged(); private: + QCString mCStringMess; + QByteArray mByteData; QString mEmailSourceChannel; QString mEmailSourceUID; void resizeEvent(QResizeEvent* e ); bool mBRdisabled; #ifndef DESKTOP_VERSION 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 createGUI( "kaddressbookui.rc", false ); #endif //KAB_EMBEDDED setAutoSaveSettings(); - qApp->processEvents(); mCore->restoreSettings(); +#ifndef DESKTOP_VERSION + QObject::connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), mCore, SLOT (receiveStart ( const QCString &, const QByteArray & ))); +#endif } KAddressBookMain::~KAddressBookMain() { // mCore->saveSettings(); } 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 ) KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); // init language KPimGlobalPrefs::instance()->setGlobalConfig(); QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); KAddressBookMain m ; //US MainWindow m; -#ifndef DESKTOP_VERSION - QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); -#endif + #ifndef DESKTOP_VERSION a.showMainWidget( &m ); #else a.setMainWidget( &m ); m.show(); #endif + m.setCaption(i18n("Loading addressbook data ... please wait" )); a.exec(); #ifdef DESKTOP_VERSION KConfig *config = KABPrefs::instance()->getConfig(); config->setGroup("WidgetLayout"); QStringList list ;//= config->readListEntry("MainLayout"); int x,y,w,h; |