-rw-r--r-- | kaddressbook/kabcore.cpp | 7 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 4445310..d651224 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -296,130 +296,137 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
296 | "X-Gender", "KADDRESSBOOK" ); | 296 | "X-Gender", "KADDRESSBOOK" ); |
297 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, | 297 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, |
298 | "X-Children", "KADDRESSBOOK" ); | 298 | "X-Children", "KADDRESSBOOK" ); |
299 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, | 299 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, |
300 | "X-FreeBusyUrl", "KADDRESSBOOK" ); | 300 | "X-FreeBusyUrl", "KADDRESSBOOK" ); |
301 | #endif | 301 | #endif |
302 | initGUI(); | 302 | initGUI(); |
303 | 303 | ||
304 | mIncSearchWidget->setFocus(); | 304 | mIncSearchWidget->setFocus(); |
305 | 305 | ||
306 | 306 | ||
307 | connect( mViewManager, SIGNAL( selected( const QString& ) ), | 307 | connect( mViewManager, SIGNAL( selected( const QString& ) ), |
308 | SLOT( setContactSelected( const QString& ) ) ); | 308 | SLOT( setContactSelected( const QString& ) ) ); |
309 | connect( mViewManager, SIGNAL( executed( const QString& ) ), | 309 | connect( mViewManager, SIGNAL( executed( const QString& ) ), |
310 | SLOT( executeContact( const QString& ) ) ); | 310 | SLOT( executeContact( const QString& ) ) ); |
311 | 311 | ||
312 | connect( mViewManager, SIGNAL( deleteRequest( ) ), | 312 | connect( mViewManager, SIGNAL( deleteRequest( ) ), |
313 | SLOT( deleteContacts( ) ) ); | 313 | SLOT( deleteContacts( ) ) ); |
314 | connect( mViewManager, SIGNAL( modified() ), | 314 | connect( mViewManager, SIGNAL( modified() ), |
315 | SLOT( setModified() ) ); | 315 | SLOT( setModified() ) ); |
316 | 316 | ||
317 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); | 317 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); |
318 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); | 318 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); |
319 | 319 | ||
320 | connect( mXXPortManager, SIGNAL( modified() ), | 320 | connect( mXXPortManager, SIGNAL( modified() ), |
321 | SLOT( setModified() ) ); | 321 | SLOT( setModified() ) ); |
322 | 322 | ||
323 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), | 323 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), |
324 | SLOT( incrementalSearch( const QString& ) ) ); | 324 | SLOT( incrementalSearch( const QString& ) ) ); |
325 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), | 325 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), |
326 | mJumpButtonBar, SLOT( recreateButtons() ) ); | 326 | mJumpButtonBar, SLOT( recreateButtons() ) ); |
327 | 327 | ||
328 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), | 328 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), |
329 | SLOT( sendMail( const QString& ) ) ); | 329 | SLOT( sendMail( const QString& ) ) ); |
330 | 330 | ||
331 | 331 | ||
332 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); | 332 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); |
333 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); | 333 | connect( ExternalAppHandler::instance(), SIGNAL (requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&)),this, SLOT(requestForDetails(const QString&, const QString&, const QString&, const QString&, const QString&))); |
334 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); | 334 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); |
335 | connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); | 335 | connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); |
336 | 336 | ||
337 | 337 | ||
338 | #ifndef KAB_EMBEDDED | 338 | #ifndef KAB_EMBEDDED |
339 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), | 339 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), |
340 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); | 340 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); |
341 | 341 | ||
342 | connect( mDetails, SIGNAL( browse( const QString& ) ), | 342 | connect( mDetails, SIGNAL( browse( const QString& ) ), |
343 | SLOT( browse( const QString& ) ) ); | 343 | SLOT( browse( const QString& ) ) ); |
344 | 344 | ||
345 | 345 | ||
346 | mAddressBookService = new KAddressBookService( this ); | 346 | mAddressBookService = new KAddressBookService( this ); |
347 | 347 | ||
348 | #endif //KAB_EMBEDDED | 348 | #endif //KAB_EMBEDDED |
349 | 349 | ||
350 | mMessageTimer = new QTimer( this ); | 350 | mMessageTimer = new QTimer( this ); |
351 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); | 351 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); |
352 | mEditorDialog = 0; | 352 | mEditorDialog = 0; |
353 | createAddresseeEditorDialog( this ); | 353 | createAddresseeEditorDialog( this ); |
354 | setModified( false ); | 354 | setModified( false ); |
355 | mBRdisabled = false; | 355 | mBRdisabled = false; |
356 | #ifndef DESKTOP_VERSION | 356 | #ifndef DESKTOP_VERSION |
357 | infrared = 0; | 357 | infrared = 0; |
358 | #endif | 358 | #endif |
359 | //toggleBeamReceive( ); | 359 | //toggleBeamReceive( ); |
360 | |||
361 | // we have a toolbar repainting error on the Zaurus when starting KA/Pi | ||
362 | QTimer::singleShot( 1, this , SLOT ( updateToolBar())); | ||
360 | } | 363 | } |
361 | 364 | ||
365 | void KABCore::updateToolBar() | ||
366 | { | ||
367 | mMainWindow->toolBar()->repaint(); | ||
368 | } | ||
362 | KABCore::~KABCore() | 369 | KABCore::~KABCore() |
363 | { | 370 | { |
364 | // save(); | 371 | // save(); |
365 | //saveSettings(); | 372 | //saveSettings(); |
366 | //KABPrefs::instance()->writeConfig(); | 373 | //KABPrefs::instance()->writeConfig(); |
367 | delete AddresseeConfig::instance(); | 374 | delete AddresseeConfig::instance(); |
368 | mAddressBook = 0; | 375 | mAddressBook = 0; |
369 | KABC::StdAddressBook::close(); | 376 | KABC::StdAddressBook::close(); |
370 | 377 | ||
371 | delete syncManager; | 378 | delete syncManager; |
372 | #ifndef DESKTOP_VERSION | 379 | #ifndef DESKTOP_VERSION |
373 | if ( infrared ) | 380 | if ( infrared ) |
374 | delete infrared; | 381 | delete infrared; |
375 | #endif | 382 | #endif |
376 | } | 383 | } |
377 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) | 384 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) |
378 | { | 385 | { |
379 | qDebug("KA: QCOP message received: %s ", cmsg.data() ); | 386 | qDebug("KA: QCOP message received: %s ", cmsg.data() ); |
380 | if ( cmsg == "setDocument(QString)" ) { | 387 | if ( cmsg == "setDocument(QString)" ) { |
381 | QDataStream stream( data, IO_ReadOnly ); | 388 | QDataStream stream( data, IO_ReadOnly ); |
382 | QString fileName; | 389 | QString fileName; |
383 | stream >> fileName; | 390 | stream >> fileName; |
384 | recieve( fileName ); | 391 | recieve( fileName ); |
385 | return; | 392 | return; |
386 | } | 393 | } |
387 | } | 394 | } |
388 | void KABCore::toggleBeamReceive( ) | 395 | void KABCore::toggleBeamReceive( ) |
389 | { | 396 | { |
390 | if ( mBRdisabled ) | 397 | if ( mBRdisabled ) |
391 | return; | 398 | return; |
392 | #ifndef DESKTOP_VERSION | 399 | #ifndef DESKTOP_VERSION |
393 | if ( infrared ) { | 400 | if ( infrared ) { |
394 | qDebug("AB disable BeamReceive "); | 401 | qDebug("AB disable BeamReceive "); |
395 | delete infrared; | 402 | delete infrared; |
396 | infrared = 0; | 403 | infrared = 0; |
397 | mActionBR->setChecked(false); | 404 | mActionBR->setChecked(false); |
398 | return; | 405 | return; |
399 | } | 406 | } |
400 | qDebug("AB enable BeamReceive "); | 407 | qDebug("AB enable BeamReceive "); |
401 | mActionBR->setChecked(true); | 408 | mActionBR->setChecked(true); |
402 | 409 | ||
403 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; | 410 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; |
404 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); | 411 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); |
405 | #endif | 412 | #endif |
406 | } | 413 | } |
407 | 414 | ||
408 | 415 | ||
409 | void KABCore::disableBR(bool b) | 416 | void KABCore::disableBR(bool b) |
410 | { | 417 | { |
411 | #ifndef DESKTOP_VERSION | 418 | #ifndef DESKTOP_VERSION |
412 | if ( b ) { | 419 | if ( b ) { |
413 | if ( infrared ) { | 420 | if ( infrared ) { |
414 | toggleBeamReceive( ); | 421 | toggleBeamReceive( ); |
415 | } | 422 | } |
416 | mBRdisabled = true; | 423 | mBRdisabled = true; |
417 | } else { | 424 | } else { |
418 | if ( mBRdisabled ) { | 425 | if ( mBRdisabled ) { |
419 | mBRdisabled = false; | 426 | mBRdisabled = false; |
420 | //toggleBeamReceive( ); | 427 | //toggleBeamReceive( ); |
421 | } | 428 | } |
422 | } | 429 | } |
423 | #endif | 430 | #endif |
424 | 431 | ||
425 | } | 432 | } |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index d2ee45d..0a52838 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -299,128 +299,129 @@ class KABCore : public QWidget, public KSyncInterface | |||
299 | */ | 299 | */ |
300 | void save(); | 300 | void save(); |
301 | 301 | ||
302 | /** | 302 | /** |
303 | Undos the last command using the undo stack. | 303 | Undos the last command using the undo stack. |
304 | */ | 304 | */ |
305 | void undo(); | 305 | void undo(); |
306 | 306 | ||
307 | /** | 307 | /** |
308 | Redos the last command that was undone, using the redo stack. | 308 | Redos the last command that was undone, using the redo stack. |
309 | */ | 309 | */ |
310 | void redo(); | 310 | void redo(); |
311 | 311 | ||
312 | /** | 312 | /** |
313 | Shows the edit dialog for the given uid. If the uid is QString::null, | 313 | Shows the edit dialog for the given uid. If the uid is QString::null, |
314 | the method will try to find a selected addressee in the view. | 314 | the method will try to find a selected addressee in the view. |
315 | */ | 315 | */ |
316 | void editContact( const QString &uid /*US = QString::null*/ ); | 316 | void editContact( const QString &uid /*US = QString::null*/ ); |
317 | //US added a second method without defaultparameter | 317 | //US added a second method without defaultparameter |
318 | void editContact2(); | 318 | void editContact2(); |
319 | 319 | ||
320 | /** | 320 | /** |
321 | Shows or edits the detail view for the given uid. If the uid is QString::null, | 321 | Shows or edits the detail view for the given uid. If the uid is QString::null, |
322 | the method will try to find a selected addressee in the view. | 322 | the method will try to find a selected addressee in the view. |
323 | */ | 323 | */ |
324 | void executeContact( const QString &uid /*US = QString::null*/ ); | 324 | void executeContact( const QString &uid /*US = QString::null*/ ); |
325 | 325 | ||
326 | /** | 326 | /** |
327 | Launches the configuration dialog. | 327 | Launches the configuration dialog. |
328 | */ | 328 | */ |
329 | void openConfigDialog(); | 329 | void openConfigDialog(); |
330 | 330 | ||
331 | /** | 331 | /** |
332 | Launches the ldap search dialog. | 332 | Launches the ldap search dialog. |
333 | */ | 333 | */ |
334 | void openLDAPDialog(); | 334 | void openLDAPDialog(); |
335 | 335 | ||
336 | /** | 336 | /** |
337 | Creates a KAddressBookPrinter, which will display the print | 337 | Creates a KAddressBookPrinter, which will display the print |
338 | dialog and do the printing. | 338 | dialog and do the printing. |
339 | */ | 339 | */ |
340 | void print(); | 340 | void print(); |
341 | 341 | ||
342 | /** | 342 | /** |
343 | Registers a new GUI client, so plugins can register its actions. | 343 | Registers a new GUI client, so plugins can register its actions. |
344 | */ | 344 | */ |
345 | void addGUIClient( KXMLGUIClient *client ); | 345 | void addGUIClient( KXMLGUIClient *client ); |
346 | 346 | ||
347 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); | 347 | void requestForNameEmailUidList(const QString& sourceChannel, const QString& sessionuid); |
348 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); | 348 | void requestForDetails(const QString& sourceChannel, const QString& sessionuid, const QString& name, const QString& email, const QString& uid); |
349 | void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); | 349 | void requestForBirthdayList(const QString& sourceChannel, const QString& sessionuid); |
350 | 350 | ||
351 | 351 | ||
352 | signals: | 352 | signals: |
353 | void contactSelected( const QString &name ); | 353 | void contactSelected( const QString &name ); |
354 | void contactSelected( const QPixmap &pixmap ); | 354 | void contactSelected( const QPixmap &pixmap ); |
355 | public slots: | 355 | public slots: |
356 | void recieve(QString cmsg ); | 356 | void recieve(QString cmsg ); |
357 | void getFile( bool success ); | 357 | void getFile( bool success ); |
358 | void syncFileRequest(); | 358 | void syncFileRequest(); |
359 | void setDetailsVisible( bool visible ); | 359 | void setDetailsVisible( bool visible ); |
360 | void setDetailsToState(); | 360 | void setDetailsToState(); |
361 | // void slotSyncMenu( int ); | 361 | // void slotSyncMenu( int ); |
362 | private slots: | 362 | private slots: |
363 | void updateToolBar(); | ||
363 | void receive( const QCString& cmsg, const QByteArray& data ); | 364 | void receive( const QCString& cmsg, const QByteArray& data ); |
364 | void toggleBeamReceive( ); | 365 | void toggleBeamReceive( ); |
365 | void disableBR(bool); | 366 | void disableBR(bool); |
366 | void setJumpButtonBarVisible( bool visible ); | 367 | void setJumpButtonBarVisible( bool visible ); |
367 | void setCaptionBack(); | 368 | void setCaptionBack(); |
368 | void importFromOL(); | 369 | void importFromOL(); |
369 | void extensionModified( const KABC::Addressee::List &list ); | 370 | void extensionModified( const KABC::Addressee::List &list ); |
370 | void extensionChanged( int id ); | 371 | void extensionChanged( int id ); |
371 | void clipboardDataChanged(); | 372 | void clipboardDataChanged(); |
372 | void updateActionMenu(); | 373 | void updateActionMenu(); |
373 | void configureKeyBindings(); | 374 | void configureKeyBindings(); |
374 | void removeVoice(); | 375 | void removeVoice(); |
375 | #ifdef KAB_EMBEDDED | 376 | #ifdef KAB_EMBEDDED |
376 | void configureResources(); | 377 | void configureResources(); |
377 | #endif //KAB_EMBEDDED | 378 | #endif //KAB_EMBEDDED |
378 | 379 | ||
379 | void slotEditorDestroyed( const QString &uid ); | 380 | void slotEditorDestroyed( const QString &uid ); |
380 | void configurationChanged(); | 381 | void configurationChanged(); |
381 | void addressBookChanged(); | 382 | void addressBookChanged(); |
382 | 383 | ||
383 | private: | 384 | private: |
384 | bool mBRdisabled; | 385 | bool mBRdisabled; |
385 | #ifndef DESKTOP_VERSION | 386 | #ifndef DESKTOP_VERSION |
386 | QCopChannel* infrared; | 387 | QCopChannel* infrared; |
387 | #endif | 388 | #endif |
388 | QTimer *mMessageTimer; | 389 | QTimer *mMessageTimer; |
389 | void initGUI(); | 390 | void initGUI(); |
390 | void initActions(); | 391 | void initActions(); |
391 | QString getPhoneFile(); | 392 | QString getPhoneFile(); |
392 | 393 | ||
393 | AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, | 394 | AddresseeEditorDialog *createAddresseeEditorDialog( QWidget *parent, |
394 | const char *name = 0 ); | 395 | const char *name = 0 ); |
395 | 396 | ||
396 | KXMLGUIClient *mGUIClient; | 397 | KXMLGUIClient *mGUIClient; |
397 | 398 | ||
398 | KABC::AddressBook *mAddressBook; | 399 | KABC::AddressBook *mAddressBook; |
399 | 400 | ||
400 | ViewManager *mViewManager; | 401 | ViewManager *mViewManager; |
401 | // QSplitter *mDetailsSplitter; | 402 | // QSplitter *mDetailsSplitter; |
402 | KDGanttMinimizeSplitter *mExtensionBarSplitter; | 403 | KDGanttMinimizeSplitter *mExtensionBarSplitter; |
403 | ViewContainer *mDetails; | 404 | ViewContainer *mDetails; |
404 | KDGanttMinimizeSplitter* mMiniSplitter; | 405 | KDGanttMinimizeSplitter* mMiniSplitter; |
405 | XXPortManager *mXXPortManager; | 406 | XXPortManager *mXXPortManager; |
406 | JumpButtonBar *mJumpButtonBar; | 407 | JumpButtonBar *mJumpButtonBar; |
407 | IncSearchWidget *mIncSearchWidget; | 408 | IncSearchWidget *mIncSearchWidget; |
408 | ExtensionManager *mExtensionManager; | 409 | ExtensionManager *mExtensionManager; |
409 | 410 | ||
410 | KCMultiDialog *mConfigureDialog; | 411 | KCMultiDialog *mConfigureDialog; |
411 | 412 | ||
412 | #ifndef KAB_EMBEDDED | 413 | #ifndef KAB_EMBEDDED |
413 | LDAPSearchDialog *mLdapSearchDialog; | 414 | LDAPSearchDialog *mLdapSearchDialog; |
414 | #endif //KAB_EMBEDDED | 415 | #endif //KAB_EMBEDDED |
415 | // QDict<AddresseeEditorDialog> mEditorDict; | 416 | // QDict<AddresseeEditorDialog> mEditorDict; |
416 | AddresseeEditorDialog *mEditorDialog; | 417 | AddresseeEditorDialog *mEditorDialog; |
417 | bool mReadWrite; | 418 | bool mReadWrite; |
418 | bool mModified; | 419 | bool mModified; |
419 | bool mIsPart; | 420 | bool mIsPart; |
420 | bool mMultipleViewsAtOnce; | 421 | bool mMultipleViewsAtOnce; |
421 | 422 | ||
422 | 423 | ||
423 | //US file menu | 424 | //US file menu |
424 | KAction *mActionMail; | 425 | KAction *mActionMail; |
425 | KAction *mActionBeam; | 426 | KAction *mActionBeam; |
426 | KToggleAction *mActionBR; | 427 | KToggleAction *mActionBR; |