-rw-r--r-- | kaddressbook/kabcore.cpp | 31 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 3 |
2 files changed, 18 insertions, 16 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 087e9e3..3ab06c4 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -205,4 +205,5 @@ public: }; + bool pasteWithNewUid = true; @@ -223,5 +224,4 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const mExtensionBarSplitter = 0; mIsPart = !parent->inherits( "KAddressBookMain" ); - mAddressBook = KABC::StdAddressBook::self(); KABC::StdAddressBook::setAutomaticSave( false ); @@ -308,4 +308,7 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const #endif //KAB_EMBEDDED + + mMessageTimer = new QTimer( this ); + connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); mEditorDialog = 0; createAddresseeEditorDialog( this ); @@ -329,6 +332,7 @@ void KABCore::recieve( QString fn ) { //qDebug("KABCore::recieve "); - mAddressBook->importFromFile( fn, true ); + int count = mAddressBook->importFromFile( fn, true ); mViewManager->refreshView(); + message(i18n("%1 contact(s) received!").arg( count )); topLevelWidget()->raise(); } @@ -698,4 +702,5 @@ void KABCore::export2phone() return; + message(i18n("Exporting to phone...")); QTimer::singleShot( 1, this , SLOT ( writeToPhone())); @@ -713,7 +718,7 @@ void KABCore::writeToPhone( ) { if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) - qDebug("Export okay "); + message(i18n("Export to phone finished!")); else - qDebug("Error export contacts "); + qDebug(i18n("Error exporting to phone")); } void KABCore::beamVCard() @@ -832,5 +837,5 @@ void KABCore::beamDone( Ir *ir ) #endif topLevelWidget()->raise(); - message( i18n("Beaming successful!") ); + message( i18n("Beaming finished!") ); } @@ -1196,5 +1201,5 @@ void KABCore::save() "address book. Please check that some \nother application is " "not using it. " ); - statusMessage(i18n("Saving addressbook ... ")); + message(i18n("Saving addressbook ... ")); #ifndef KAB_EMBEDDED KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook ); @@ -1209,14 +1214,10 @@ void KABCore::save() #endif //KAB_EMBEDDED - statusMessage(i18n("Addressbook saved!")); + message(i18n("Addressbook saved!")); setModified( false ); syncManager->setBlockSave(false); } -void KABCore::statusMessage(QString mess , int time ) -{ - //topLevelWidget()->setCaption( mess ); - // pending setting timer to revome message -} + void KABCore::undo() { @@ -2156,5 +2157,5 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); bar.show(); - bar.setCaption (i18n("collecting birthdays - close to abort!") ); + bar.setCaption (i18n("Collecting birthdays - close to abort!") ); qApp->processEvents(); @@ -2810,7 +2811,6 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource) void KABCore::message( QString m ) { - topLevelWidget()->setCaption( m ); - QTimer::singleShot( 15000, this , SLOT ( setCaptionBack())); + mMessageTimer->start( 15000, true ); } bool KABCore::syncPhone() @@ -2871,4 +2871,5 @@ QString KABCore::sentSyncFile() void KABCore::setCaptionBack() { + mMessageTimer->stop(); topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); } diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 5871d39..c7be343 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -30,4 +30,5 @@ #endif //KAB_EMBEDDED #include <qdict.h> +#include <qtimer.h> #include <qwidget.h> @@ -144,5 +145,4 @@ class KABCore : public QWidget, public KSyncInterface #endif //KAB_EMBEDDED - void statusMessage(QString, int time = 0 ); void showLicence(); void faq(); @@ -371,4 +371,5 @@ class KABCore : public QWidget, public KSyncInterface private: + QTimer *mMessageTimer; void initGUI(); void initActions(); |