author | eilers <eilers> | 2003-02-17 14:21:01 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-02-17 14:21:01 (UTC) |
commit | 24344a3c43b20e1cd8b9ecbf73031b744cdf8197 (patch) (unidiff) | |
tree | 5e0520bf19687a8d2685e2ad64b3ccbffb7fe170 | |
parent | 28e1528173b8fc08cc32d44921621e70cb4da968 (diff) | |
download | opie-24344a3c43b20e1cd8b9ecbf73031b744cdf8197.zip opie-24344a3c43b20e1cd8b9ecbf73031b744cdf8197.tar.gz opie-24344a3c43b20e1cd8b9ecbf73031b744cdf8197.tar.bz2 |
Cardview improved ..
-rw-r--r-- | libopie/pim/ocontact.cpp | 11 | ||||
-rw-r--r-- | libopie2/opiepim/ocontact.cpp | 11 |
2 files changed, 12 insertions, 10 deletions
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp index 9230b8b..178559b 100644 --- a/libopie/pim/ocontact.cpp +++ b/libopie/pim/ocontact.cpp | |||
@@ -463,41 +463,42 @@ QString OContact::toRichText() const | |||
463 | + Qtopia::escapeString(defEmail) + "<br>"; | 463 | + Qtopia::escapeString(defEmail) + "<br>"; |
464 | 464 | ||
465 | text += "<hr>"; | 465 | text += "<hr>"; |
466 | 466 | ||
467 | // business address | 467 | // business address |
468 | if ( !businessStreet().isEmpty() || !businessCity().isEmpty() || | 468 | if ( !businessStreet().isEmpty() || !businessCity().isEmpty() || |
469 | !businessZip().isEmpty() || !businessCountry().isEmpty() ) { | 469 | !businessZip().isEmpty() || !businessCountry().isEmpty() ) { |
470 | text += "<br>"; | 470 | text += "<br>"; |
471 | text += QObject::tr( "<b>Work Address:</b>" ); | 471 | text += QObject::tr( "<b>Work Address:</b>" ); |
472 | text += "<br>"; | 472 | text += "<br>"; |
473 | marker = true; | 473 | marker = true; |
474 | } | 474 | } |
475 | 475 | ||
476 | if ( !(value = businessStreet()).isEmpty() ) | 476 | if ( !(value = businessStreet()).isEmpty() ) |
477 | text += Qtopia::escapeString(value) + "<br>"; | 477 | text += Qtopia::escapeString(value) + "<br>"; |
478 | state = businessState(); | 478 | state = businessState(); |
479 | if ( !(value = businessZip()).isEmpty() ) | ||
480 | text += Qtopia::escapeString(value) + " "; | ||
479 | if ( !(value = businessCity()).isEmpty() ) { | 481 | if ( !(value = businessCity()).isEmpty() ) { |
480 | text += Qtopia::escapeString(value); | 482 | text += Qtopia::escapeString(value); |
481 | if ( state ) | 483 | if ( state ) |
482 | text += ", " + Qtopia::escapeString(state); | 484 | text += ", " + Qtopia::escapeString(state); |
483 | text += "<br>"; | 485 | text += "<br>"; |
484 | } else if ( !state.isEmpty() ) | 486 | } else if ( !state.isEmpty() ) |
485 | text += Qtopia::escapeString(state) + "<br>"; | 487 | text += Qtopia::escapeString(state) + "<br>"; |
486 | if ( !(value = businessZip()).isEmpty() ) | 488 | |
487 | text += Qtopia::escapeString(value) + "<br>"; | ||
488 | if ( !(value = businessCountry()).isEmpty() ) | 489 | if ( !(value = businessCountry()).isEmpty() ) |
489 | text += Qtopia::escapeString(value) + "<br>"; | 490 | text += Qtopia::escapeString(value) + "<br>"; |
490 | 491 | ||
491 | // rest of Business data | 492 | // rest of Business data |
492 | str = office(); | 493 | str = office(); |
493 | if ( !str.isEmpty() ){ | 494 | if ( !str.isEmpty() ){ |
494 | text += "<b>" + QObject::tr("Office: ") + "</b>" | 495 | text += "<b>" + QObject::tr("Office: ") + "</b>" |
495 | + Qtopia::escapeString(str) + "<br>"; | 496 | + Qtopia::escapeString(str) + "<br>"; |
496 | marker = true; | 497 | marker = true; |
497 | } | 498 | } |
498 | str = businessWebpage(); | 499 | str = businessWebpage(); |
499 | if ( !str.isEmpty() ){ | 500 | if ( !str.isEmpty() ){ |
500 | text += "<b>" + QObject::tr("Business Web Page: ") + "</b>" | 501 | text += "<b>" + QObject::tr("Business Web Page: ") + "</b>" |
501 | + Qtopia::escapeString(str) + "<br>"; | 502 | + Qtopia::escapeString(str) + "<br>"; |
502 | marker = true; | 503 | marker = true; |
503 | } | 504 | } |
@@ -524,41 +525,41 @@ QString OContact::toRichText() const | |||
524 | text += "<b>" + QObject::tr("Business Pager: ") + "</b>" | 525 | text += "<b>" + QObject::tr("Business Pager: ") + "</b>" |
525 | + Qtopia::escapeString(str) + "<br>"; | 526 | + Qtopia::escapeString(str) + "<br>"; |
526 | marker = true; | 527 | marker = true; |
527 | } | 528 | } |
528 | 529 | ||
529 | // home address | 530 | // home address |
530 | if ( !homeStreet().isEmpty() || !homeCity().isEmpty() || | 531 | if ( !homeStreet().isEmpty() || !homeCity().isEmpty() || |
531 | !homeZip().isEmpty() || !homeCountry().isEmpty() ) { | 532 | !homeZip().isEmpty() || !homeCountry().isEmpty() ) { |
532 | text += "<br>"; | 533 | text += "<br>"; |
533 | text += QObject::tr( "<b>Home Address:</b>" ); | 534 | text += QObject::tr( "<b>Home Address:</b>" ); |
534 | text += "<br>"; | 535 | text += "<br>"; |
535 | } | 536 | } |
536 | 537 | ||
537 | if ( !(value = homeStreet()).isEmpty() ) | 538 | if ( !(value = homeStreet()).isEmpty() ) |
538 | text += Qtopia::escapeString(value) + "<br>"; | 539 | text += Qtopia::escapeString(value) + "<br>"; |
539 | state = homeState(); | 540 | state = homeState(); |
541 | if ( !(value = homeZip()).isEmpty() ) | ||
542 | text += Qtopia::escapeString(value) + " "; | ||
540 | if ( !(value = homeCity()).isEmpty() ) { | 543 | if ( !(value = homeCity()).isEmpty() ) { |
541 | text += Qtopia::escapeString(value); | 544 | text += Qtopia::escapeString(value); |
542 | if ( !state.isEmpty() ) | 545 | if ( !state.isEmpty() ) |
543 | text += ", " + Qtopia::escapeString(state); | 546 | text += ", " + Qtopia::escapeString(state); |
544 | text += "<br>"; | 547 | text += "<br>"; |
545 | } else if (!state.isEmpty()) | 548 | } else if (!state.isEmpty()) |
546 | text += Qtopia::escapeString(state) + "<br>"; | 549 | text += Qtopia::escapeString(state) + "<br>"; |
547 | if ( !(value = homeZip()).isEmpty() ) | ||
548 | text += Qtopia::escapeString(value) + "<br>"; | ||
549 | if ( !(value = homeCountry()).isEmpty() ) | 550 | if ( !(value = homeCountry()).isEmpty() ) |
550 | text += Qtopia::escapeString(value) + "<br>"; | 551 | text += Qtopia::escapeString(value) + "<br>"; |
551 | 552 | ||
552 | // rest of Home data | 553 | // rest of Home data |
553 | str = homeWebpage(); | 554 | str = homeWebpage(); |
554 | if ( !str.isEmpty() ){ | 555 | if ( !str.isEmpty() ){ |
555 | text += "<b>" + QObject::tr("Home Web Page: ") + "</b>" | 556 | text += "<b>" + QObject::tr("Home Web Page: ") + "</b>" |
556 | + Qtopia::escapeString(str) + "<br>"; | 557 | + Qtopia::escapeString(str) + "<br>"; |
557 | marker = true; | 558 | marker = true; |
558 | } | 559 | } |
559 | str = homePhone(); | 560 | str = homePhone(); |
560 | if ( !str.isEmpty() ){ | 561 | if ( !str.isEmpty() ){ |
561 | text += "<b>" + QObject::tr("Home Phone: ") + "</b>" | 562 | text += "<b>" + QObject::tr("Home Phone: ") + "</b>" |
562 | + Qtopia::escapeString(str) + "<br>"; | 563 | + Qtopia::escapeString(str) + "<br>"; |
563 | marker = true; | 564 | marker = true; |
564 | } | 565 | } |
@@ -620,33 +621,33 @@ QString OContact::toRichText() const | |||
620 | if ( !str.isEmpty() ) | 621 | if ( !str.isEmpty() ) |
621 | text += "<b>" + QObject::tr("Children: ") + "</b>" | 622 | text += "<b>" + QObject::tr("Children: ") + "</b>" |
622 | + Qtopia::escapeString(str) + "<br>"; | 623 | + Qtopia::escapeString(str) + "<br>"; |
623 | 624 | ||
624 | str = nickname(); | 625 | str = nickname(); |
625 | if ( !str.isEmpty() ) | 626 | if ( !str.isEmpty() ) |
626 | text += "<b>" + QObject::tr("Nickname: ") + "</b>" | 627 | text += "<b>" + QObject::tr("Nickname: ") + "</b>" |
627 | + Qtopia::escapeString(str) + "<br>"; | 628 | + Qtopia::escapeString(str) + "<br>"; |
628 | 629 | ||
629 | if ( categoryNames().count() ){ | 630 | if ( categoryNames().count() ){ |
630 | text += "<b>" + QObject::tr( "Category:") + "</b> "; | 631 | text += "<b>" + QObject::tr( "Category:") + "</b> "; |
631 | text += categoryNames().join(", "); | 632 | text += categoryNames().join(", "); |
632 | text += "<br>"; | 633 | text += "<br>"; |
633 | } | 634 | } |
634 | 635 | ||
635 | // notes last | 636 | // notes last |
636 | if ( (value = notes()) ) { | 637 | if ( !(value = notes()).isEmpty() ) { |
637 | text += "<br><hr><b>" + QObject::tr( "Notes:") + "</b> "; | 638 | text += "<br><hr><b>" + QObject::tr( "Notes:") + "</b> "; |
638 | QRegExp reg("\n"); | 639 | QRegExp reg("\n"); |
639 | 640 | ||
640 | //QString tmp = Qtopia::escapeString(value); | 641 | //QString tmp = Qtopia::escapeString(value); |
641 | QString tmp = QStyleSheet::convertFromPlainText(value); | 642 | QString tmp = QStyleSheet::convertFromPlainText(value); |
642 | //tmp.replace( reg, "<br>" ); | 643 | //tmp.replace( reg, "<br>" ); |
643 | text += "<br>" + tmp + "<br>"; | 644 | text += "<br>" + tmp + "<br>"; |
644 | } | 645 | } |
645 | return text; | 646 | return text; |
646 | } | 647 | } |
647 | 648 | ||
648 | /*! | 649 | /*! |
649 | \internal | 650 | \internal |
650 | */ | 651 | */ |
651 | void OContact::insert( int key, const QString &v ) | 652 | void OContact::insert( int key, const QString &v ) |
652 | { | 653 | { |
diff --git a/libopie2/opiepim/ocontact.cpp b/libopie2/opiepim/ocontact.cpp index 9230b8b..178559b 100644 --- a/libopie2/opiepim/ocontact.cpp +++ b/libopie2/opiepim/ocontact.cpp | |||
@@ -463,41 +463,42 @@ QString OContact::toRichText() const | |||
463 | + Qtopia::escapeString(defEmail) + "<br>"; | 463 | + Qtopia::escapeString(defEmail) + "<br>"; |
464 | 464 | ||
465 | text += "<hr>"; | 465 | text += "<hr>"; |
466 | 466 | ||
467 | // business address | 467 | // business address |
468 | if ( !businessStreet().isEmpty() || !businessCity().isEmpty() || | 468 | if ( !businessStreet().isEmpty() || !businessCity().isEmpty() || |
469 | !businessZip().isEmpty() || !businessCountry().isEmpty() ) { | 469 | !businessZip().isEmpty() || !businessCountry().isEmpty() ) { |
470 | text += "<br>"; | 470 | text += "<br>"; |
471 | text += QObject::tr( "<b>Work Address:</b>" ); | 471 | text += QObject::tr( "<b>Work Address:</b>" ); |
472 | text += "<br>"; | 472 | text += "<br>"; |
473 | marker = true; | 473 | marker = true; |
474 | } | 474 | } |
475 | 475 | ||
476 | if ( !(value = businessStreet()).isEmpty() ) | 476 | if ( !(value = businessStreet()).isEmpty() ) |
477 | text += Qtopia::escapeString(value) + "<br>"; | 477 | text += Qtopia::escapeString(value) + "<br>"; |
478 | state = businessState(); | 478 | state = businessState(); |
479 | if ( !(value = businessZip()).isEmpty() ) | ||
480 | text += Qtopia::escapeString(value) + " "; | ||
479 | if ( !(value = businessCity()).isEmpty() ) { | 481 | if ( !(value = businessCity()).isEmpty() ) { |
480 | text += Qtopia::escapeString(value); | 482 | text += Qtopia::escapeString(value); |
481 | if ( state ) | 483 | if ( state ) |
482 | text += ", " + Qtopia::escapeString(state); | 484 | text += ", " + Qtopia::escapeString(state); |
483 | text += "<br>"; | 485 | text += "<br>"; |
484 | } else if ( !state.isEmpty() ) | 486 | } else if ( !state.isEmpty() ) |
485 | text += Qtopia::escapeString(state) + "<br>"; | 487 | text += Qtopia::escapeString(state) + "<br>"; |
486 | if ( !(value = businessZip()).isEmpty() ) | 488 | |
487 | text += Qtopia::escapeString(value) + "<br>"; | ||
488 | if ( !(value = businessCountry()).isEmpty() ) | 489 | if ( !(value = businessCountry()).isEmpty() ) |
489 | text += Qtopia::escapeString(value) + "<br>"; | 490 | text += Qtopia::escapeString(value) + "<br>"; |
490 | 491 | ||
491 | // rest of Business data | 492 | // rest of Business data |
492 | str = office(); | 493 | str = office(); |
493 | if ( !str.isEmpty() ){ | 494 | if ( !str.isEmpty() ){ |
494 | text += "<b>" + QObject::tr("Office: ") + "</b>" | 495 | text += "<b>" + QObject::tr("Office: ") + "</b>" |
495 | + Qtopia::escapeString(str) + "<br>"; | 496 | + Qtopia::escapeString(str) + "<br>"; |
496 | marker = true; | 497 | marker = true; |
497 | } | 498 | } |
498 | str = businessWebpage(); | 499 | str = businessWebpage(); |
499 | if ( !str.isEmpty() ){ | 500 | if ( !str.isEmpty() ){ |
500 | text += "<b>" + QObject::tr("Business Web Page: ") + "</b>" | 501 | text += "<b>" + QObject::tr("Business Web Page: ") + "</b>" |
501 | + Qtopia::escapeString(str) + "<br>"; | 502 | + Qtopia::escapeString(str) + "<br>"; |
502 | marker = true; | 503 | marker = true; |
503 | } | 504 | } |
@@ -524,41 +525,41 @@ QString OContact::toRichText() const | |||
524 | text += "<b>" + QObject::tr("Business Pager: ") + "</b>" | 525 | text += "<b>" + QObject::tr("Business Pager: ") + "</b>" |
525 | + Qtopia::escapeString(str) + "<br>"; | 526 | + Qtopia::escapeString(str) + "<br>"; |
526 | marker = true; | 527 | marker = true; |
527 | } | 528 | } |
528 | 529 | ||
529 | // home address | 530 | // home address |
530 | if ( !homeStreet().isEmpty() || !homeCity().isEmpty() || | 531 | if ( !homeStreet().isEmpty() || !homeCity().isEmpty() || |
531 | !homeZip().isEmpty() || !homeCountry().isEmpty() ) { | 532 | !homeZip().isEmpty() || !homeCountry().isEmpty() ) { |
532 | text += "<br>"; | 533 | text += "<br>"; |
533 | text += QObject::tr( "<b>Home Address:</b>" ); | 534 | text += QObject::tr( "<b>Home Address:</b>" ); |
534 | text += "<br>"; | 535 | text += "<br>"; |
535 | } | 536 | } |
536 | 537 | ||
537 | if ( !(value = homeStreet()).isEmpty() ) | 538 | if ( !(value = homeStreet()).isEmpty() ) |
538 | text += Qtopia::escapeString(value) + "<br>"; | 539 | text += Qtopia::escapeString(value) + "<br>"; |
539 | state = homeState(); | 540 | state = homeState(); |
541 | if ( !(value = homeZip()).isEmpty() ) | ||
542 | text += Qtopia::escapeString(value) + " "; | ||
540 | if ( !(value = homeCity()).isEmpty() ) { | 543 | if ( !(value = homeCity()).isEmpty() ) { |
541 | text += Qtopia::escapeString(value); | 544 | text += Qtopia::escapeString(value); |
542 | if ( !state.isEmpty() ) | 545 | if ( !state.isEmpty() ) |
543 | text += ", " + Qtopia::escapeString(state); | 546 | text += ", " + Qtopia::escapeString(state); |
544 | text += "<br>"; | 547 | text += "<br>"; |
545 | } else if (!state.isEmpty()) | 548 | } else if (!state.isEmpty()) |
546 | text += Qtopia::escapeString(state) + "<br>"; | 549 | text += Qtopia::escapeString(state) + "<br>"; |
547 | if ( !(value = homeZip()).isEmpty() ) | ||
548 | text += Qtopia::escapeString(value) + "<br>"; | ||
549 | if ( !(value = homeCountry()).isEmpty() ) | 550 | if ( !(value = homeCountry()).isEmpty() ) |
550 | text += Qtopia::escapeString(value) + "<br>"; | 551 | text += Qtopia::escapeString(value) + "<br>"; |
551 | 552 | ||
552 | // rest of Home data | 553 | // rest of Home data |
553 | str = homeWebpage(); | 554 | str = homeWebpage(); |
554 | if ( !str.isEmpty() ){ | 555 | if ( !str.isEmpty() ){ |
555 | text += "<b>" + QObject::tr("Home Web Page: ") + "</b>" | 556 | text += "<b>" + QObject::tr("Home Web Page: ") + "</b>" |
556 | + Qtopia::escapeString(str) + "<br>"; | 557 | + Qtopia::escapeString(str) + "<br>"; |
557 | marker = true; | 558 | marker = true; |
558 | } | 559 | } |
559 | str = homePhone(); | 560 | str = homePhone(); |
560 | if ( !str.isEmpty() ){ | 561 | if ( !str.isEmpty() ){ |
561 | text += "<b>" + QObject::tr("Home Phone: ") + "</b>" | 562 | text += "<b>" + QObject::tr("Home Phone: ") + "</b>" |
562 | + Qtopia::escapeString(str) + "<br>"; | 563 | + Qtopia::escapeString(str) + "<br>"; |
563 | marker = true; | 564 | marker = true; |
564 | } | 565 | } |
@@ -620,33 +621,33 @@ QString OContact::toRichText() const | |||
620 | if ( !str.isEmpty() ) | 621 | if ( !str.isEmpty() ) |
621 | text += "<b>" + QObject::tr("Children: ") + "</b>" | 622 | text += "<b>" + QObject::tr("Children: ") + "</b>" |
622 | + Qtopia::escapeString(str) + "<br>"; | 623 | + Qtopia::escapeString(str) + "<br>"; |
623 | 624 | ||
624 | str = nickname(); | 625 | str = nickname(); |
625 | if ( !str.isEmpty() ) | 626 | if ( !str.isEmpty() ) |
626 | text += "<b>" + QObject::tr("Nickname: ") + "</b>" | 627 | text += "<b>" + QObject::tr("Nickname: ") + "</b>" |
627 | + Qtopia::escapeString(str) + "<br>"; | 628 | + Qtopia::escapeString(str) + "<br>"; |
628 | 629 | ||
629 | if ( categoryNames().count() ){ | 630 | if ( categoryNames().count() ){ |
630 | text += "<b>" + QObject::tr( "Category:") + "</b> "; | 631 | text += "<b>" + QObject::tr( "Category:") + "</b> "; |
631 | text += categoryNames().join(", "); | 632 | text += categoryNames().join(", "); |
632 | text += "<br>"; | 633 | text += "<br>"; |
633 | } | 634 | } |
634 | 635 | ||
635 | // notes last | 636 | // notes last |
636 | if ( (value = notes()) ) { | 637 | if ( !(value = notes()).isEmpty() ) { |
637 | text += "<br><hr><b>" + QObject::tr( "Notes:") + "</b> "; | 638 | text += "<br><hr><b>" + QObject::tr( "Notes:") + "</b> "; |
638 | QRegExp reg("\n"); | 639 | QRegExp reg("\n"); |
639 | 640 | ||
640 | //QString tmp = Qtopia::escapeString(value); | 641 | //QString tmp = Qtopia::escapeString(value); |
641 | QString tmp = QStyleSheet::convertFromPlainText(value); | 642 | QString tmp = QStyleSheet::convertFromPlainText(value); |
642 | //tmp.replace( reg, "<br>" ); | 643 | //tmp.replace( reg, "<br>" ); |
643 | text += "<br>" + tmp + "<br>"; | 644 | text += "<br>" + tmp + "<br>"; |
644 | } | 645 | } |
645 | return text; | 646 | return text; |
646 | } | 647 | } |
647 | 648 | ||
648 | /*! | 649 | /*! |
649 | \internal | 650 | \internal |
650 | */ | 651 | */ |
651 | void OContact::insert( int key, const QString &v ) | 652 | void OContact::insert( int key, const QString &v ) |
652 | { | 653 | { |