summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp31
-rw-r--r--kaddressbook/kabcore.h3
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:
205}; 205};
206 206
207
207bool pasteWithNewUid = true; 208bool pasteWithNewUid = true;
208 209
@@ -223,5 +224,4 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
223 mExtensionBarSplitter = 0; 224 mExtensionBarSplitter = 0;
224 mIsPart = !parent->inherits( "KAddressBookMain" ); 225 mIsPart = !parent->inherits( "KAddressBookMain" );
225
226 mAddressBook = KABC::StdAddressBook::self(); 226 mAddressBook = KABC::StdAddressBook::self();
227 KABC::StdAddressBook::setAutomaticSave( false ); 227 KABC::StdAddressBook::setAutomaticSave( false );
@@ -308,4 +308,7 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
308 308
309#endif //KAB_EMBEDDED 309#endif //KAB_EMBEDDED
310
311 mMessageTimer = new QTimer( this );
312 connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) );
310 mEditorDialog = 0; 313 mEditorDialog = 0;
311 createAddresseeEditorDialog( this ); 314 createAddresseeEditorDialog( this );
@@ -329,6 +332,7 @@ void KABCore::recieve( QString fn )
329{ 332{
330 //qDebug("KABCore::recieve "); 333 //qDebug("KABCore::recieve ");
331 mAddressBook->importFromFile( fn, true ); 334 int count = mAddressBook->importFromFile( fn, true );
332 mViewManager->refreshView(); 335 mViewManager->refreshView();
336 message(i18n("%1 contact(s) received!").arg( count ));
333 topLevelWidget()->raise(); 337 topLevelWidget()->raise();
334} 338}
@@ -698,4 +702,5 @@ void KABCore::export2phone()
698 return; 702 return;
699 703
704 message(i18n("Exporting to phone..."));
700 QTimer::singleShot( 1, this , SLOT ( writeToPhone())); 705 QTimer::singleShot( 1, this , SLOT ( writeToPhone()));
701 706
@@ -713,7 +718,7 @@ void KABCore::writeToPhone( )
713{ 718{
714 if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) 719 if ( PhoneAccess::writeToPhone( getPhoneFile() ) )
715 qDebug("Export okay "); 720 message(i18n("Export to phone finished!"));
716 else 721 else
717 qDebug("Error export contacts "); 722 qDebug(i18n("Error exporting to phone"));
718} 723}
719void KABCore::beamVCard() 724void KABCore::beamVCard()
@@ -832,5 +837,5 @@ void KABCore::beamDone( Ir *ir )
832#endif 837#endif
833 topLevelWidget()->raise(); 838 topLevelWidget()->raise();
834 message( i18n("Beaming successful!") ); 839 message( i18n("Beaming finished!") );
835} 840}
836 841
@@ -1196,5 +1201,5 @@ void KABCore::save()
1196 "address book. Please check that some \nother application is " 1201 "address book. Please check that some \nother application is "
1197 "not using it. " ); 1202 "not using it. " );
1198 statusMessage(i18n("Saving addressbook ... ")); 1203 message(i18n("Saving addressbook ... "));
1199#ifndef KAB_EMBEDDED 1204#ifndef KAB_EMBEDDED
1200 KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook ); 1205 KABC::StdAddressBook *b = dynamic_cast<KABC::StdAddressBook*>( mAddressBook );
@@ -1209,14 +1214,10 @@ void KABCore::save()
1209#endif //KAB_EMBEDDED 1214#endif //KAB_EMBEDDED
1210 1215
1211 statusMessage(i18n("Addressbook saved!")); 1216 message(i18n("Addressbook saved!"));
1212 setModified( false ); 1217 setModified( false );
1213 syncManager->setBlockSave(false); 1218 syncManager->setBlockSave(false);
1214} 1219}
1215 1220
1216void KABCore::statusMessage(QString mess , int time ) 1221
1217{
1218 //topLevelWidget()->setCaption( mess );
1219 // pending setting timer to revome message
1220}
1221void KABCore::undo() 1222void KABCore::undo()
1222{ 1223{
@@ -2156,5 +2157,5 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString
2156 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 2157 bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
2157 bar.show(); 2158 bar.show();
2158 bar.setCaption (i18n("collecting birthdays - close to abort!") ); 2159 bar.setCaption (i18n("Collecting birthdays - close to abort!") );
2159 qApp->processEvents(); 2160 qApp->processEvents();
2160 2161
@@ -2810,7 +2811,6 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource)
2810void KABCore::message( QString m ) 2811void KABCore::message( QString m )
2811{ 2812{
2812
2813 topLevelWidget()->setCaption( m ); 2813 topLevelWidget()->setCaption( m );
2814 QTimer::singleShot( 15000, this , SLOT ( setCaptionBack())); 2814 mMessageTimer->start( 15000, true );
2815} 2815}
2816bool KABCore::syncPhone() 2816bool KABCore::syncPhone()
@@ -2871,4 +2871,5 @@ QString KABCore::sentSyncFile()
2871void KABCore::setCaptionBack() 2871void KABCore::setCaptionBack()
2872{ 2872{
2873 mMessageTimer->stop();
2873 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); 2874 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") );
2874} 2875}
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 @@
30#endif //KAB_EMBEDDED 30#endif //KAB_EMBEDDED
31#include <qdict.h> 31#include <qdict.h>
32#include <qtimer.h>
32 33
33#include <qwidget.h> 34#include <qwidget.h>
@@ -144,5 +145,4 @@ class KABCore : public QWidget, public KSyncInterface
144#endif //KAB_EMBEDDED 145#endif //KAB_EMBEDDED
145 146
146 void statusMessage(QString, int time = 0 );
147 void showLicence(); 147 void showLicence();
148 void faq(); 148 void faq();
@@ -371,4 +371,5 @@ class KABCore : public QWidget, public KSyncInterface
371 371
372 private: 372 private:
373 QTimer *mMessageTimer;
373 void initGUI(); 374 void initGUI();
374 void initActions(); 375 void initActions();