summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore 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
@@ -204,6 +204,7 @@ public:
204 QCheckBox* mWriteToSim; 204 QCheckBox* mWriteToSim;
205}; 205};
206 206
207
207bool pasteWithNewUid = true; 208bool pasteWithNewUid = true;
208 209
209#ifdef KAB_EMBEDDED 210#ifdef KAB_EMBEDDED
@@ -222,7 +223,6 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
222 // syncManager->setBlockSave(false); 223 // syncManager->setBlockSave(false);
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 );
228 228
@@ -307,6 +307,9 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
307 mAddressBookService = new KAddressBookService( this ); 307 mAddressBookService = new KAddressBookService( this );
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 );
312 setModified( false ); 315 setModified( false );
@@ -328,8 +331,9 @@ KABCore::~KABCore()
328void KABCore::recieve( QString fn ) 331void 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}
335void KABCore::restoreSettings() 339void KABCore::restoreSettings()
@@ -697,6 +701,7 @@ void KABCore::export2phone()
697 if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) ) 701 if ( ! mAddressBook->export2PhoneFormat( uids ,fileName ) )
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
702} 707}
@@ -712,9 +717,9 @@ QString KABCore::getPhoneFile()
712void KABCore::writeToPhone( ) 717void 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()
720{ 725{
@@ -831,7 +836,7 @@ void KABCore::beamDone( Ir *ir )
831 delete ir; 836 delete 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
837 842
@@ -1195,7 +1200,7 @@ void KABCore::save()
1195 QString text = i18n( "There was an error while attempting to save\n the " 1200 QString text = i18n( "There was an error while attempting to save\n the "
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 );
1201 if ( !b || !b->save() ) { 1206 if ( !b || !b->save() ) {
@@ -1208,16 +1213,12 @@ void KABCore::save()
1208 } 1213 }
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{
1223 UndoStack::instance()->undo(); 1224 UndoStack::instance()->undo();
@@ -2155,7 +2156,7 @@ void KABCore::requestForBirthdayList(const QString& sourceChannel, const QString
2155 int dh = QApplication::desktop()->height(); 2156 int dh = QApplication::desktop()->height();
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
2161 QDate bday; 2162 QDate bday;
@@ -2809,9 +2810,8 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource)
2809} 2810}
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()
2817{ 2817{
@@ -2870,5 +2870,6 @@ QString KABCore::sentSyncFile()
2870 2870
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
@@ -29,6 +29,7 @@
29#ifndef KAB_EMBEDDED 29#ifndef KAB_EMBEDDED
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>
34#include <qpopupmenu.h> 35#include <qpopupmenu.h>
@@ -143,7 +144,6 @@ class KABCore : public QWidget, public KSyncInterface
143 void createAboutData(); 144 void createAboutData();
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();
149 void whatsnew() ; 149 void whatsnew() ;
@@ -370,6 +370,7 @@ class KABCore : public QWidget, public KSyncInterface
370 void addressBookChanged(); 370 void addressBookChanged();
371 371
372 private: 372 private:
373 QTimer *mMessageTimer;
373 void initGUI(); 374 void initGUI();
374 void initActions(); 375 void initActions();
375 QString getPhoneFile(); 376 QString getPhoneFile();