author | zautrix <zautrix> | 2005-03-29 21:36:59 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-29 21:36:59 (UTC) |
commit | c4357089980802187203b6e418f0f267043d7041 (patch) (unidiff) | |
tree | b73f0d95e90f41979ca65e33803d258c77959db9 | |
parent | 4a567b23fa5b4e3165839a478dca8eab513959a2 (diff) | |
download | kdepimpi-c4357089980802187203b6e418f0f267043d7041.zip kdepimpi-c4357089980802187203b6e418f0f267043d7041.tar.gz kdepimpi-c4357089980802187203b6e418f0f267043d7041.tar.bz2 |
fix
-rw-r--r-- | kaddressbook/kabcore.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 3650b20..1433568 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -301,129 +301,129 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
301 | mIncSearchWidget = 0; | 301 | mIncSearchWidget = 0; |
302 | mMiniSplitter = 0; | 302 | mMiniSplitter = 0; |
303 | mExtensionBarSplitter = 0; | 303 | mExtensionBarSplitter = 0; |
304 | mIsPart = !parent->inherits( "KAddressBookMain" ); | 304 | mIsPart = !parent->inherits( "KAddressBookMain" ); |
305 | mAddressBook = KABC::StdAddressBook::self(); | 305 | mAddressBook = KABC::StdAddressBook::self(); |
306 | KABC::StdAddressBook::setAutomaticSave( false ); | 306 | KABC::StdAddressBook::setAutomaticSave( false ); |
307 | 307 | ||
308 | #ifndef KAB_EMBEDDED | 308 | #ifndef KAB_EMBEDDED |
309 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); | 309 | mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); |
310 | #endif //KAB_EMBEDDED | 310 | #endif //KAB_EMBEDDED |
311 | 311 | ||
312 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), | 312 | connect( mAddressBook, SIGNAL( addressBookChanged( AddressBook * ) ), |
313 | SLOT( addressBookChanged() ) ); | 313 | SLOT( addressBookChanged() ) ); |
314 | 314 | ||
315 | #if 0 | 315 | #if 0 |
316 | // LR moved to addressbook init method | 316 | // LR moved to addressbook init method |
317 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, | 317 | mAddressBook->addCustomField( i18n( "Department" ), KABC::Field::Organization, |
318 | "X-Department", "KADDRESSBOOK" ); | 318 | "X-Department", "KADDRESSBOOK" ); |
319 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, | 319 | mAddressBook->addCustomField( i18n( "Profession" ), KABC::Field::Organization, |
320 | "X-Profession", "KADDRESSBOOK" ); | 320 | "X-Profession", "KADDRESSBOOK" ); |
321 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, | 321 | mAddressBook->addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, |
322 | "X-AssistantsName", "KADDRESSBOOK" ); | 322 | "X-AssistantsName", "KADDRESSBOOK" ); |
323 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, | 323 | mAddressBook->addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, |
324 | "X-ManagersName", "KADDRESSBOOK" ); | 324 | "X-ManagersName", "KADDRESSBOOK" ); |
325 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, | 325 | mAddressBook->addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, |
326 | "X-SpousesName", "KADDRESSBOOK" ); | 326 | "X-SpousesName", "KADDRESSBOOK" ); |
327 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, | 327 | mAddressBook->addCustomField( i18n( "Office" ), KABC::Field::Personal, |
328 | "X-Office", "KADDRESSBOOK" ); | 328 | "X-Office", "KADDRESSBOOK" ); |
329 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, | 329 | mAddressBook->addCustomField( i18n( "IM Address" ), KABC::Field::Personal, |
330 | "X-IMAddress", "KADDRESSBOOK" ); | 330 | "X-IMAddress", "KADDRESSBOOK" ); |
331 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, | 331 | mAddressBook->addCustomField( i18n( "Anniversary" ), KABC::Field::Personal, |
332 | "X-Anniversary", "KADDRESSBOOK" ); | 332 | "X-Anniversary", "KADDRESSBOOK" ); |
333 | 333 | ||
334 | //US added this field to become compatible with Opie/qtopia addressbook | 334 | //US added this field to become compatible with Opie/qtopia addressbook |
335 | // values can be "female" or "male" or "". An empty field represents undefined. | 335 | // values can be "female" or "male" or "". An empty field represents undefined. |
336 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, | 336 | mAddressBook->addCustomField( i18n( "Gender" ), KABC::Field::Personal, |
337 | "X-Gender", "KADDRESSBOOK" ); | 337 | "X-Gender", "KADDRESSBOOK" ); |
338 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, | 338 | mAddressBook->addCustomField( i18n( "Children" ), KABC::Field::Personal, |
339 | "X-Children", "KADDRESSBOOK" ); | 339 | "X-Children", "KADDRESSBOOK" ); |
340 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, | 340 | mAddressBook->addCustomField( i18n( "FreeBusyUrl" ), KABC::Field::Personal, |
341 | "X-FreeBusyUrl", "KADDRESSBOOK" ); | 341 | "X-FreeBusyUrl", "KADDRESSBOOK" ); |
342 | #endif | 342 | #endif |
343 | initGUI(); | 343 | initGUI(); |
344 | 344 | ||
345 | mIncSearchWidget->setFocus(); | 345 | mIncSearchWidget->setFocus(); |
346 | 346 | ||
347 | 347 | ||
348 | connect( mViewManager, SIGNAL( selected( const QString& ) ), | 348 | connect( mViewManager, SIGNAL( selected( const QString& ) ), |
349 | SLOT( setContactSelected( const QString& ) ) ); | 349 | SLOT( setContactSelected( const QString& ) ) ); |
350 | connect( mViewManager, SIGNAL( executed( const QString& ) ), | 350 | connect( mViewManager, SIGNAL( executed( const QString& ) ), |
351 | SLOT( executeContact( const QString& ) ) ); | 351 | SLOT( executeContact( const QString& ) ) ); |
352 | 352 | ||
353 | connect( mViewManager, SIGNAL( deleteRequest( ) ), | 353 | connect( mViewManager, SIGNAL( deleteRequest( ) ), |
354 | SLOT( deleteContacts( ) ) ); | 354 | SLOT( deleteContacts( ) ) ); |
355 | connect( mViewManager, SIGNAL( modified() ), | 355 | connect( mViewManager, SIGNAL( modified() ), |
356 | SLOT( setModified() ) ); | 356 | SLOT( setModified() ) ); |
357 | 357 | ||
358 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); | 358 | connect( mExtensionManager, SIGNAL( modified( const KABC::Addressee::List& ) ), this, SLOT( extensionModified( const KABC::Addressee::List& ) ) ); |
359 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); | 359 | connect( mExtensionManager, SIGNAL( changedActiveExtension( int ) ), this, SLOT( extensionChanged( int ) ) ); |
360 | 360 | ||
361 | connect( mXXPortManager, SIGNAL( modified() ), | 361 | connect( mXXPortManager, SIGNAL( modified() ), |
362 | SLOT( setModified() ) ); | 362 | SLOT( setModified() ) ); |
363 | 363 | ||
364 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), | 364 | connect( mJumpButtonBar, SIGNAL( jumpToLetter( const QString& ) ), |
365 | SLOT( incrementalSearch( const QString& ) ) ); | 365 | SLOT( incrementalSearchJump( const QString& ) ) ); |
366 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), | 366 | connect( mIncSearchWidget, SIGNAL( fieldChanged() ), |
367 | mJumpButtonBar, SLOT( recreateButtons() ) ); | 367 | mJumpButtonBar, SLOT( recreateButtons() ) ); |
368 | 368 | ||
369 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), | 369 | connect( mDetails, SIGNAL( sendEmail( const QString& ) ), |
370 | SLOT( sendMail( const QString& ) ) ); | 370 | SLOT( sendMail( const QString& ) ) ); |
371 | 371 | ||
372 | 372 | ||
373 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); | 373 | connect( ExternalAppHandler::instance(), SIGNAL (requestForNameEmailUidList(const QString&, const QString&)),this, SLOT(requestForNameEmailUidList(const QString&, const QString&))); |
374 | 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&))); | 374 | 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&))); |
375 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); | 375 | connect( ExternalAppHandler::instance(), SIGNAL (requestForBirthdayList(const QString&, const QString&)),this, SLOT(requestForBirthdayList(const QString&, const QString&))); |
376 | connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); | 376 | connect( ExternalAppHandler::instance(), SIGNAL (nextView()),this, SLOT(setDetailsToggle())); |
377 | connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog())); | 377 | connect( ExternalAppHandler::instance(), SIGNAL (callContactdialog()),this, SLOT(callContactdialog())); |
378 | 378 | ||
379 | 379 | ||
380 | #ifndef KAB_EMBEDDED | 380 | #ifndef KAB_EMBEDDED |
381 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), | 381 | connect( mViewManager, SIGNAL( urlDropped( const KURL& ) ), |
382 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); | 382 | mXXPortManager, SLOT( importVCard( const KURL& ) ) ); |
383 | 383 | ||
384 | connect( mDetails, SIGNAL( browse( const QString& ) ), | 384 | connect( mDetails, SIGNAL( browse( const QString& ) ), |
385 | SLOT( browse( const QString& ) ) ); | 385 | SLOT( browse( const QString& ) ) ); |
386 | 386 | ||
387 | 387 | ||
388 | mAddressBookService = new KAddressBookService( this ); | 388 | mAddressBookService = new KAddressBookService( this ); |
389 | 389 | ||
390 | #endif //KAB_EMBEDDED | 390 | #endif //KAB_EMBEDDED |
391 | 391 | ||
392 | mMessageTimer = new QTimer( this ); | 392 | mMessageTimer = new QTimer( this ); |
393 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); | 393 | connect( mMessageTimer, SIGNAL( timeout() ), this, SLOT( setCaptionBack() ) ); |
394 | mEditorDialog = 0; | 394 | mEditorDialog = 0; |
395 | createAddresseeEditorDialog( this ); | 395 | createAddresseeEditorDialog( this ); |
396 | setModified( false ); | 396 | setModified( false ); |
397 | mBRdisabled = false; | 397 | mBRdisabled = false; |
398 | #ifndef DESKTOP_VERSION | 398 | #ifndef DESKTOP_VERSION |
399 | infrared = 0; | 399 | infrared = 0; |
400 | #endif | 400 | #endif |
401 | //toggleBeamReceive( ); | 401 | //toggleBeamReceive( ); |
402 | //mMainWindow->toolBar()->show(); | 402 | //mMainWindow->toolBar()->show(); |
403 | // we have a toolbar repainting error on the Zaurus when starting KA/Pi | 403 | // we have a toolbar repainting error on the Zaurus when starting KA/Pi |
404 | QTimer::singleShot( 10, this , SLOT ( updateToolBar())); | 404 | QTimer::singleShot( 10, this , SLOT ( updateToolBar())); |
405 | } | 405 | } |
406 | 406 | ||
407 | void KABCore::updateToolBar() | 407 | void KABCore::updateToolBar() |
408 | { | 408 | { |
409 | static int iii = 0; | 409 | static int iii = 0; |
410 | ++iii; | 410 | ++iii; |
411 | mMainWindow->toolBar()->repaintMe(); | 411 | mMainWindow->toolBar()->repaintMe(); |
412 | if ( iii < 4 ) | 412 | if ( iii < 4 ) |
413 | QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar())); | 413 | QTimer::singleShot( 100*iii, this , SLOT ( updateToolBar())); |
414 | } | 414 | } |
415 | KABCore::~KABCore() | 415 | KABCore::~KABCore() |
416 | { | 416 | { |
417 | // save(); | 417 | // save(); |
418 | //saveSettings(); | 418 | //saveSettings(); |
419 | //KABPrefs::instance()->writeConfig(); | 419 | //KABPrefs::instance()->writeConfig(); |
420 | delete AddresseeConfig::instance(); | 420 | delete AddresseeConfig::instance(); |
421 | mAddressBook = 0; | 421 | mAddressBook = 0; |
422 | KABC::StdAddressBook::close(); | 422 | KABC::StdAddressBook::close(); |
423 | 423 | ||
424 | delete syncManager; | 424 | delete syncManager; |
425 | #ifndef DESKTOP_VERSION | 425 | #ifndef DESKTOP_VERSION |
426 | if ( infrared ) | 426 | if ( infrared ) |
427 | delete infrared; | 427 | delete infrared; |
428 | #endif | 428 | #endif |
429 | } | 429 | } |
@@ -1112,128 +1112,132 @@ void KABCore::setCategories() | |||
1112 | QStringList uids; | 1112 | QStringList uids; |
1113 | XXPortSelectDialog dlgx( this, false, this ); | 1113 | XXPortSelectDialog dlgx( this, false, this ); |
1114 | if ( dlgx.exec() ) | 1114 | if ( dlgx.exec() ) |
1115 | uids = dlgx.uids(); | 1115 | uids = dlgx.uids(); |
1116 | else | 1116 | else |
1117 | return; | 1117 | return; |
1118 | if ( uids.isEmpty() ) | 1118 | if ( uids.isEmpty() ) |
1119 | return; | 1119 | return; |
1120 | // qDebug("count %d ", uids.count()); | 1120 | // qDebug("count %d ", uids.count()); |
1121 | 1121 | ||
1122 | 1122 | ||
1123 | KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true ); | 1123 | KPIM::CategorySelectDialog dlg( KABPrefs::instance(), this, "", true ); |
1124 | if ( !dlg.exec() ) { | 1124 | if ( !dlg.exec() ) { |
1125 | message( i18n("Setting categories cancelled") ); | 1125 | message( i18n("Setting categories cancelled") ); |
1126 | return; | 1126 | return; |
1127 | } | 1127 | } |
1128 | bool merge = false; | 1128 | bool merge = false; |
1129 | QString msg = i18n( "Merge with existing categories?" ); | 1129 | QString msg = i18n( "Merge with existing categories?" ); |
1130 | if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes ) | 1130 | if ( KMessageBox::questionYesNo( this, msg ) == KMessageBox::Yes ) |
1131 | merge = true; | 1131 | merge = true; |
1132 | 1132 | ||
1133 | message( i18n("Setting categories ... please wait!") ); | 1133 | message( i18n("Setting categories ... please wait!") ); |
1134 | QStringList categories = dlg.selectedCategories(); | 1134 | QStringList categories = dlg.selectedCategories(); |
1135 | 1135 | ||
1136 | //QStringList uids = mViewManager->selectedUids(); | 1136 | //QStringList uids = mViewManager->selectedUids(); |
1137 | QStringList::Iterator it; | 1137 | QStringList::Iterator it; |
1138 | for ( it = uids.begin(); it != uids.end(); ++it ) { | 1138 | for ( it = uids.begin(); it != uids.end(); ++it ) { |
1139 | KABC::Addressee addr = mAddressBook->findByUid( *it ); | 1139 | KABC::Addressee addr = mAddressBook->findByUid( *it ); |
1140 | if ( !addr.isEmpty() ) { | 1140 | if ( !addr.isEmpty() ) { |
1141 | if ( !merge ) | 1141 | if ( !merge ) |
1142 | addr.setCategories( categories ); | 1142 | addr.setCategories( categories ); |
1143 | else { | 1143 | else { |
1144 | QStringList addrCategories = addr.categories(); | 1144 | QStringList addrCategories = addr.categories(); |
1145 | QStringList::Iterator catIt; | 1145 | QStringList::Iterator catIt; |
1146 | for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { | 1146 | for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) { |
1147 | if ( !addrCategories.contains( *catIt ) ) | 1147 | if ( !addrCategories.contains( *catIt ) ) |
1148 | addrCategories.append( *catIt ); | 1148 | addrCategories.append( *catIt ); |
1149 | } | 1149 | } |
1150 | addr.setCategories( addrCategories ); | 1150 | addr.setCategories( addrCategories ); |
1151 | } | 1151 | } |
1152 | mAddressBook->insertAddressee( addr ); | 1152 | mAddressBook->insertAddressee( addr ); |
1153 | } | 1153 | } |
1154 | } | 1154 | } |
1155 | 1155 | ||
1156 | if ( uids.count() > 0 ) | 1156 | if ( uids.count() > 0 ) |
1157 | setModified( true ); | 1157 | setModified( true ); |
1158 | message( i18n("Setting categories completed!") ); | 1158 | message( i18n("Setting categories completed!") ); |
1159 | } | 1159 | } |
1160 | 1160 | ||
1161 | void KABCore::setSearchFields( const KABC::Field::List &fields ) | 1161 | void KABCore::setSearchFields( const KABC::Field::List &fields ) |
1162 | { | 1162 | { |
1163 | mIncSearchWidget->setFields( fields ); | 1163 | mIncSearchWidget->setFields( fields ); |
1164 | } | 1164 | } |
1165 | 1165 | ||
1166 | void KABCore::incrementalSearch( const QString& text ) | 1166 | void KABCore::incrementalSearch( const QString& text ) |
1167 | { | 1167 | { |
1168 | QString stext; | 1168 | QString stext; |
1169 | if ( KABPrefs::instance()->mAutoSearchWithWildcard ) { | 1169 | if ( KABPrefs::instance()->mAutoSearchWithWildcard ) { |
1170 | stext = "*" + text; | 1170 | stext = "*" + text; |
1171 | } else { | 1171 | } else { |
1172 | stext = text; | 1172 | stext = text; |
1173 | } | 1173 | } |
1174 | mViewManager->doSearch( stext, mIncSearchWidget->currentField() ); | 1174 | mViewManager->doSearch( stext, mIncSearchWidget->currentField() ); |
1175 | } | 1175 | } |
1176 | void KABCore::incrementalSearchJump( const QString& text ) | ||
1177 | { | ||
1178 | mViewManager->doSearch( text, mIncSearchWidget->currentField() ); | ||
1179 | } | ||
1176 | 1180 | ||
1177 | void KABCore::setModified() | 1181 | void KABCore::setModified() |
1178 | { | 1182 | { |
1179 | setModified( true ); | 1183 | setModified( true ); |
1180 | } | 1184 | } |
1181 | 1185 | ||
1182 | void KABCore::setModifiedWOrefresh() | 1186 | void KABCore::setModifiedWOrefresh() |
1183 | { | 1187 | { |
1184 | // qDebug("KABCore::setModifiedWOrefresh() "); | 1188 | // qDebug("KABCore::setModifiedWOrefresh() "); |
1185 | mModified = true; | 1189 | mModified = true; |
1186 | mActionSave->setEnabled( mModified ); | 1190 | mActionSave->setEnabled( mModified ); |
1187 | 1191 | ||
1188 | 1192 | ||
1189 | } | 1193 | } |
1190 | void KABCore::setModified( bool modified ) | 1194 | void KABCore::setModified( bool modified ) |
1191 | { | 1195 | { |
1192 | mModified = modified; | 1196 | mModified = modified; |
1193 | mActionSave->setEnabled( mModified ); | 1197 | mActionSave->setEnabled( mModified ); |
1194 | 1198 | ||
1195 | if ( modified ) | 1199 | if ( modified ) |
1196 | mJumpButtonBar->recreateButtons(); | 1200 | mJumpButtonBar->recreateButtons(); |
1197 | 1201 | ||
1198 | mViewManager->refreshView(); | 1202 | mViewManager->refreshView(); |
1199 | 1203 | ||
1200 | } | 1204 | } |
1201 | 1205 | ||
1202 | bool KABCore::modified() const | 1206 | bool KABCore::modified() const |
1203 | { | 1207 | { |
1204 | return mModified; | 1208 | return mModified; |
1205 | } | 1209 | } |
1206 | 1210 | ||
1207 | void KABCore::contactModified( const KABC::Addressee &addr ) | 1211 | void KABCore::contactModified( const KABC::Addressee &addr ) |
1208 | { | 1212 | { |
1209 | addrModified( addr ); | 1213 | addrModified( addr ); |
1210 | #if 0 // debug only | 1214 | #if 0 // debug only |
1211 | KABC::Addressee ad = addr; | 1215 | KABC::Addressee ad = addr; |
1212 | ad.computeCsum( "123"); | 1216 | ad.computeCsum( "123"); |
1213 | #endif | 1217 | #endif |
1214 | } | 1218 | } |
1215 | 1219 | ||
1216 | void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails ) | 1220 | void KABCore::addrModified( const KABC::Addressee &addr ,bool updateDetails ) |
1217 | { | 1221 | { |
1218 | 1222 | ||
1219 | Command *command = 0; | 1223 | Command *command = 0; |
1220 | QString uid; | 1224 | QString uid; |
1221 | 1225 | ||
1222 | // check if it exists already | 1226 | // check if it exists already |
1223 | KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); | 1227 | KABC::Addressee origAddr = mAddressBook->findByUid( addr.uid() ); |
1224 | if ( origAddr.isEmpty() ) | 1228 | if ( origAddr.isEmpty() ) |
1225 | command = new PwNewCommand( mAddressBook, addr ); | 1229 | command = new PwNewCommand( mAddressBook, addr ); |
1226 | else { | 1230 | else { |
1227 | command = new PwEditCommand( mAddressBook, origAddr, addr ); | 1231 | command = new PwEditCommand( mAddressBook, origAddr, addr ); |
1228 | uid = addr.uid(); | 1232 | uid = addr.uid(); |
1229 | } | 1233 | } |
1230 | 1234 | ||
1231 | UndoStack::instance()->push( command ); | 1235 | UndoStack::instance()->push( command ); |
1232 | RedoStack::instance()->clear(); | 1236 | RedoStack::instance()->clear(); |
1233 | if ( updateDetails ) | 1237 | if ( updateDetails ) |
1234 | mDetails->setAddressee( addr ); | 1238 | mDetails->setAddressee( addr ); |
1235 | setModified( true ); | 1239 | setModified( true ); |
1236 | } | 1240 | } |
1237 | 1241 | ||
1238 | void KABCore::newContact() | 1242 | void KABCore::newContact() |
1239 | { | 1243 | { |
diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 47ea152..d89daee 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h | |||
@@ -192,128 +192,129 @@ class KABCore : public QWidget, public KSyncInterface | |||
192 | 192 | ||
193 | /** | 193 | /** |
194 | Select all contacts in the view. | 194 | Select all contacts in the view. |
195 | */ | 195 | */ |
196 | void selectAllContacts(); | 196 | void selectAllContacts(); |
197 | 197 | ||
198 | /** | 198 | /** |
199 | Deletes all selected contacts from the address book. | 199 | Deletes all selected contacts from the address book. |
200 | */ | 200 | */ |
201 | void deleteContacts(); | 201 | void deleteContacts(); |
202 | 202 | ||
203 | /** | 203 | /** |
204 | Deletes given contacts from the address book. | 204 | Deletes given contacts from the address book. |
205 | 205 | ||
206 | @param uids The uids of the contacts, which shall be deleted. | 206 | @param uids The uids of the contacts, which shall be deleted. |
207 | */ | 207 | */ |
208 | void deleteContacts( const QStringList &uids ); | 208 | void deleteContacts( const QStringList &uids ); |
209 | 209 | ||
210 | /** | 210 | /** |
211 | Copys the selected contacts into clipboard for later pasting. | 211 | Copys the selected contacts into clipboard for later pasting. |
212 | */ | 212 | */ |
213 | void copyContacts(); | 213 | void copyContacts(); |
214 | 214 | ||
215 | /** | 215 | /** |
216 | Cuts the selected contacts and stores them for later pasting. | 216 | Cuts the selected contacts and stores them for later pasting. |
217 | */ | 217 | */ |
218 | void cutContacts(); | 218 | void cutContacts(); |
219 | 219 | ||
220 | /** | 220 | /** |
221 | Paste contacts from clipboard into the address book. | 221 | Paste contacts from clipboard into the address book. |
222 | */ | 222 | */ |
223 | void pasteContacts(); | 223 | void pasteContacts(); |
224 | 224 | ||
225 | /** | 225 | /** |
226 | Paste given contacts into the address book. | 226 | Paste given contacts into the address book. |
227 | 227 | ||
228 | @param list The list of addressee, which shall be pasted. | 228 | @param list The list of addressee, which shall be pasted. |
229 | */ | 229 | */ |
230 | void pasteContacts( KABC::Addressee::List &list ); | 230 | void pasteContacts( KABC::Addressee::List &list ); |
231 | 231 | ||
232 | /** | 232 | /** |
233 | Sets the whoAmI contact, that is used by many other programs to | 233 | Sets the whoAmI contact, that is used by many other programs to |
234 | get personal information about the current user. | 234 | get personal information about the current user. |
235 | */ | 235 | */ |
236 | void setWhoAmI(); | 236 | void setWhoAmI(); |
237 | 237 | ||
238 | /** | 238 | /** |
239 | Displays the category dialog and applies the result to all | 239 | Displays the category dialog and applies the result to all |
240 | selected contacts. | 240 | selected contacts. |
241 | */ | 241 | */ |
242 | void setCategories(); | 242 | void setCategories(); |
243 | void manageCategories(); | 243 | void manageCategories(); |
244 | void editCategories(); | 244 | void editCategories(); |
245 | 245 | ||
246 | /** | 246 | /** |
247 | Sets the field list of the Incremental Search Widget. | 247 | Sets the field list of the Incremental Search Widget. |
248 | */ | 248 | */ |
249 | void setSearchFields( const KABC::Field::List &fields ); | 249 | void setSearchFields( const KABC::Field::List &fields ); |
250 | 250 | ||
251 | /** | 251 | /** |
252 | Search with the current search field for a contact, that matches | 252 | Search with the current search field for a contact, that matches |
253 | the given text, and selects it in the view. | 253 | the given text, and selects it in the view. |
254 | */ | 254 | */ |
255 | void incrementalSearch( const QString& text ); | 255 | void incrementalSearch( const QString& text ); |
256 | void incrementalSearchJump( const QString& text ); | ||
256 | 257 | ||
257 | /** | 258 | /** |
258 | Marks the address book as modified. | 259 | Marks the address book as modified. |
259 | */ | 260 | */ |
260 | void setModified(); | 261 | void setModified(); |
261 | /** | 262 | /** |
262 | Marks the address book as modified without refreshing the view. | 263 | Marks the address book as modified without refreshing the view. |
263 | */ | 264 | */ |
264 | void setModifiedWOrefresh(); | 265 | void setModifiedWOrefresh(); |
265 | 266 | ||
266 | /** | 267 | /** |
267 | Marks the address book as modified concerning the argument. | 268 | Marks the address book as modified concerning the argument. |
268 | */ | 269 | */ |
269 | void setModified( bool modified ); | 270 | void setModified( bool modified ); |
270 | 271 | ||
271 | /** | 272 | /** |
272 | Returns whether the address book is modified. | 273 | Returns whether the address book is modified. |
273 | */ | 274 | */ |
274 | bool modified() const; | 275 | bool modified() const; |
275 | 276 | ||
276 | /** | 277 | /** |
277 | Called whenever an contact is modified in the contact editor | 278 | Called whenever an contact is modified in the contact editor |
278 | dialog or the quick edit. | 279 | dialog or the quick edit. |
279 | */ | 280 | */ |
280 | void contactModified( const KABC::Addressee &addr ); | 281 | void contactModified( const KABC::Addressee &addr ); |
281 | void addrModified( const KABC::Addressee &addr, bool updateDetails = true ); | 282 | void addrModified( const KABC::Addressee &addr, bool updateDetails = true ); |
282 | 283 | ||
283 | /** | 284 | /** |
284 | DCOP METHODS. | 285 | DCOP METHODS. |
285 | */ | 286 | */ |
286 | void addEmail( QString addr ); | 287 | void addEmail( QString addr ); |
287 | void importVCard( const KURL& url, bool showPreview ); | 288 | void importVCard( const KURL& url, bool showPreview ); |
288 | void importVCard( const QString& vCard, bool showPreview ); | 289 | void importVCard( const QString& vCard, bool showPreview ); |
289 | void newContact(); | 290 | void newContact(); |
290 | QString getNameByPhone( const QString& phone ); | 291 | QString getNameByPhone( const QString& phone ); |
291 | /** | 292 | /** |
292 | END DCOP METHODS | 293 | END DCOP METHODS |
293 | */ | 294 | */ |
294 | 295 | ||
295 | /** | 296 | /** |
296 | Saves the contents of the AddressBook back to disk. | 297 | Saves the contents of the AddressBook back to disk. |
297 | */ | 298 | */ |
298 | void save(); | 299 | void save(); |
299 | 300 | ||
300 | /** | 301 | /** |
301 | Undos the last command using the undo stack. | 302 | Undos the last command using the undo stack. |
302 | */ | 303 | */ |
303 | void undo(); | 304 | void undo(); |
304 | 305 | ||
305 | /** | 306 | /** |
306 | Redos the last command that was undone, using the redo stack. | 307 | Redos the last command that was undone, using the redo stack. |
307 | */ | 308 | */ |
308 | void redo(); | 309 | void redo(); |
309 | 310 | ||
310 | /** | 311 | /** |
311 | Shows the edit dialog for the given uid. If the uid is QString::null, | 312 | Shows the edit dialog for the given uid. If the uid is QString::null, |
312 | the method will try to find a selected addressee in the view. | 313 | the method will try to find a selected addressee in the view. |
313 | */ | 314 | */ |
314 | void editContact( const QString &uid /*US = QString::null*/ ); | 315 | void editContact( const QString &uid /*US = QString::null*/ ); |
315 | //US added a second method without defaultparameter | 316 | //US added a second method without defaultparameter |
316 | void editContact2(); | 317 | void editContact2(); |
317 | 318 | ||
318 | /** | 319 | /** |
319 | Shows or edits the detail view for the given uid. If the uid is QString::null, | 320 | Shows or edits the detail view for the given uid. If the uid is QString::null, |