author | drw <drw> | 2005-02-07 20:57:24 (UTC) |
---|---|---|
committer | drw <drw> | 2005-02-07 20:57:24 (UTC) |
commit | 7631c91d6c495a6c60e87a9ab131280f31ee4c87 (patch) (unidiff) | |
tree | e28891ee563e7d33fd057e8afac477b0a16cf084 | |
parent | 9f7017a1a571991763ed53066b64988cefdff07b (diff) | |
download | opie-7631c91d6c495a6c60e87a9ab131280f31ee4c87.zip opie-7631c91d6c495a6c60e87a9ab131280f31ee4c87.tar.gz opie-7631c91d6c495a6c60e87a9ab131280f31ee4c87.tar.bz2 |
Implement contact duplication
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 7c52ef2..75e539a 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -329,64 +329,76 @@ void AddressbookWindow::edit( int /*uid*/ ) | |||
329 | 329 | ||
330 | void AddressbookWindow::add( const Opie::OPimRecord& ) | 330 | void AddressbookWindow::add( const Opie::OPimRecord& ) |
331 | { | 331 | { |
332 | } | 332 | } |
333 | 333 | ||
334 | void AddressbookWindow::slotItemNew() | 334 | void AddressbookWindow::slotItemNew() |
335 | { | 335 | { |
336 | Opie::OPimContact cnt; | 336 | Opie::OPimContact cnt; |
337 | if( !syncing ) { | 337 | if( !syncing ) { |
338 | editEntry( NewEntry ); | 338 | editEntry( NewEntry ); |
339 | } else { | 339 | } else { |
340 | QMessageBox::warning(this, tr("Contacts"), | 340 | QMessageBox::warning(this, tr("Contacts"), |
341 | tr("Can not edit data, currently syncing")); | 341 | tr("Can not edit data, currently syncing")); |
342 | } | 342 | } |
343 | } | 343 | } |
344 | 344 | ||
345 | void AddressbookWindow::slotItemEdit() | 345 | void AddressbookWindow::slotItemEdit() |
346 | { | 346 | { |
347 | if(!syncing) { | 347 | if(!syncing) { |
348 | if (m_actionPersonal->isOn()) { | 348 | if (m_actionPersonal->isOn()) { |
349 | editPersonal(); | 349 | editPersonal(); |
350 | } else { | 350 | } else { |
351 | editEntry( EditEntry ); | 351 | editEntry( EditEntry ); |
352 | } | 352 | } |
353 | } else { | 353 | } else { |
354 | QMessageBox::warning( this, tr("Contacts"), | 354 | QMessageBox::warning( this, tr("Contacts"), |
355 | tr("Can not edit data, currently syncing") ); | 355 | tr("Can not edit data, currently syncing") ); |
356 | } | 356 | } |
357 | } | 357 | } |
358 | 358 | ||
359 | void AddressbookWindow::slotItemDuplicate() | 359 | void AddressbookWindow::slotItemDuplicate() |
360 | { | 360 | { |
361 | if(!syncing) | ||
362 | { | ||
363 | Opie::OPimContact entry = m_abView->currentEntry(); | ||
364 | entry.assignUid(); | ||
365 | m_abView->addEntry( entry ); | ||
366 | m_abView->setCurrentUid( entry.uid() ); | ||
367 | } | ||
368 | else | ||
369 | { | ||
370 | QMessageBox::warning( this, tr("Contacts"), | ||
371 | tr("Can not edit data, currently syncing") ); | ||
372 | } | ||
361 | } | 373 | } |
362 | 374 | ||
363 | void AddressbookWindow::slotItemDelete() | 375 | void AddressbookWindow::slotItemDelete() |
364 | { | 376 | { |
365 | if(!syncing) { | 377 | if(!syncing) { |
366 | Opie::OPimContact tmpEntry = m_abView ->currentEntry(); | 378 | Opie::OPimContact tmpEntry = m_abView ->currentEntry(); |
367 | 379 | ||
368 | // get a name, do the best we can... | 380 | // get a name, do the best we can... |
369 | QString strName = tmpEntry.fullName(); | 381 | QString strName = tmpEntry.fullName(); |
370 | if ( strName.isEmpty() ) { | 382 | if ( strName.isEmpty() ) { |
371 | strName = tmpEntry.company(); | 383 | strName = tmpEntry.company(); |
372 | if ( strName.isEmpty() ) | 384 | if ( strName.isEmpty() ) |
373 | strName = "No Name"; | 385 | strName = "No Name"; |
374 | } | 386 | } |
375 | 387 | ||
376 | 388 | ||
377 | if ( QPEMessageBox::confirmDelete( this, tr( "Contacts" ), | 389 | if ( QPEMessageBox::confirmDelete( this, tr( "Contacts" ), |
378 | strName ) ) { | 390 | strName ) ) { |
379 | m_abView->removeEntry( tmpEntry.uid() ); | 391 | m_abView->removeEntry( tmpEntry.uid() ); |
380 | } | 392 | } |
381 | } else { | 393 | } else { |
382 | QMessageBox::warning( this, tr("Contacts"), | 394 | QMessageBox::warning( this, tr("Contacts"), |
383 | tr("Can not edit data, currently syncing") ); | 395 | tr("Can not edit data, currently syncing") ); |
384 | } | 396 | } |
385 | } | 397 | } |
386 | 398 | ||
387 | static const char * beamfile = "/tmp/obex/contact.vcf"; | 399 | static const char * beamfile = "/tmp/obex/contact.vcf"; |
388 | 400 | ||
389 | void AddressbookWindow::slotItemBeam() | 401 | void AddressbookWindow::slotItemBeam() |
390 | { | 402 | { |
391 | QString beamFilename; | 403 | QString beamFilename; |
392 | Opie::OPimContact c; | 404 | Opie::OPimContact c; |