author | zautrix <zautrix> | 2005-10-28 11:31:59 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-28 11:31:59 (UTC) |
commit | b27cb619bb9005ad4345d38bbee3b1c3d0eda1b2 (patch) (unidiff) | |
tree | a7ac6002208ddedcd9dc13cd0e91294519883007 /kabc | |
parent | 5ceebb8563f134c789e9082d1bc49723beb28c8c (diff) | |
download | kdepimpi-b27cb619bb9005ad4345d38bbee3b1c3d0eda1b2.zip kdepimpi-b27cb619bb9005ad4345d38bbee3b1c3d0eda1b2.tar.gz kdepimpi-b27cb619bb9005ad4345d38bbee3b1c3d0eda1b2.tar.bz2 |
commit
-rw-r--r-- | kabc/addressee.cpp | 4 | ||||
-rw-r--r-- | kabc/addresseeview.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 19c78ee..789a694 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -998,151 +998,151 @@ QString Addressee::homeAddressCountryLabel() | |||
998 | return i18n("Home Address Country"); | 998 | return i18n("Home Address Country"); |
999 | } | 999 | } |
1000 | 1000 | ||
1001 | 1001 | ||
1002 | QString Addressee::homeAddressLabelLabel() | 1002 | QString Addressee::homeAddressLabelLabel() |
1003 | { | 1003 | { |
1004 | return i18n("Home Address Label"); | 1004 | return i18n("Home Address Label"); |
1005 | } | 1005 | } |
1006 | 1006 | ||
1007 | 1007 | ||
1008 | QString Addressee::businessAddressStreetLabel() | 1008 | QString Addressee::businessAddressStreetLabel() |
1009 | { | 1009 | { |
1010 | return i18n("Business Address Street"); | 1010 | return i18n("Business Address Street"); |
1011 | } | 1011 | } |
1012 | 1012 | ||
1013 | 1013 | ||
1014 | QString Addressee::businessAddressLocalityLabel() | 1014 | QString Addressee::businessAddressLocalityLabel() |
1015 | { | 1015 | { |
1016 | return i18n("Business Address Locality"); | 1016 | return i18n("Business Address Locality"); |
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | 1019 | ||
1020 | QString Addressee::businessAddressRegionLabel() | 1020 | QString Addressee::businessAddressRegionLabel() |
1021 | { | 1021 | { |
1022 | return i18n("Business Address Region"); | 1022 | return i18n("Business Address Region"); |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | 1025 | ||
1026 | QString Addressee::businessAddressPostalCodeLabel() | 1026 | QString Addressee::businessAddressPostalCodeLabel() |
1027 | { | 1027 | { |
1028 | return i18n("Business Address Postal Code"); | 1028 | return i18n("Business Address Postal Code"); |
1029 | } | 1029 | } |
1030 | 1030 | ||
1031 | 1031 | ||
1032 | QString Addressee::businessAddressCountryLabel() | 1032 | QString Addressee::businessAddressCountryLabel() |
1033 | { | 1033 | { |
1034 | return i18n("Business Address Country"); | 1034 | return i18n("Business Address Country"); |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | 1037 | ||
1038 | QString Addressee::businessAddressLabelLabel() | 1038 | QString Addressee::businessAddressLabelLabel() |
1039 | { | 1039 | { |
1040 | return i18n("Business Address Label"); | 1040 | return i18n("Business Address Label"); |
1041 | } | 1041 | } |
1042 | 1042 | ||
1043 | 1043 | ||
1044 | QString Addressee::homePhoneLabel() | 1044 | QString Addressee::homePhoneLabel() |
1045 | { | 1045 | { |
1046 | return i18n("Home Phone"); | 1046 | return i18n("Home Phone"); |
1047 | } | 1047 | } |
1048 | 1048 | ||
1049 | 1049 | ||
1050 | QString Addressee::businessPhoneLabel() | 1050 | QString Addressee::businessPhoneLabel() |
1051 | { | 1051 | { |
1052 | return i18n("Work Phone"); | 1052 | return i18n("Work Phone"); |
1053 | } | 1053 | } |
1054 | 1054 | ||
1055 | 1055 | ||
1056 | QString Addressee::mobilePhoneLabel() | 1056 | QString Addressee::mobilePhoneLabel() |
1057 | { | 1057 | { |
1058 | return i18n("Mobile Phone"); | 1058 | return i18n("Mobile Phone"); |
1059 | } | 1059 | } |
1060 | QString Addressee::mobileWorkPhoneLabel() | 1060 | QString Addressee::mobileWorkPhoneLabel() |
1061 | { | 1061 | { |
1062 | return i18n("Mobile2 (work)"); | 1062 | return i18n("Mobile2 (Work)"); |
1063 | } | 1063 | } |
1064 | QString Addressee::mobileHomePhoneLabel() | 1064 | QString Addressee::mobileHomePhoneLabel() |
1065 | { | 1065 | { |
1066 | return i18n("Mobile (Home)"); | 1066 | return i18n("Mobile (Home)"); |
1067 | } | 1067 | } |
1068 | 1068 | ||
1069 | 1069 | ||
1070 | QString Addressee::homeFaxLabel() | 1070 | QString Addressee::homeFaxLabel() |
1071 | { | 1071 | { |
1072 | return i18n("Fax (Home)"); | 1072 | return i18n("Fax (Home)"); |
1073 | } | 1073 | } |
1074 | 1074 | ||
1075 | 1075 | ||
1076 | QString Addressee::businessFaxLabel() | 1076 | QString Addressee::businessFaxLabel() |
1077 | { | 1077 | { |
1078 | return i18n("Fax (Work)"); | 1078 | return i18n("Fax (Work)"); |
1079 | } | 1079 | } |
1080 | 1080 | ||
1081 | 1081 | ||
1082 | QString Addressee::carPhoneLabel() | 1082 | QString Addressee::carPhoneLabel() |
1083 | { | 1083 | { |
1084 | return i18n("Mobile2 (car)"); | 1084 | return i18n("Mobile2 (Car)"); |
1085 | } | 1085 | } |
1086 | 1086 | ||
1087 | 1087 | ||
1088 | QString Addressee::isdnLabel() | 1088 | QString Addressee::isdnLabel() |
1089 | { | 1089 | { |
1090 | return i18n("ISDN"); | 1090 | return i18n("ISDN"); |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | 1093 | ||
1094 | QString Addressee::pagerLabel() | 1094 | QString Addressee::pagerLabel() |
1095 | { | 1095 | { |
1096 | return i18n("Pager"); | 1096 | return i18n("Pager"); |
1097 | } | 1097 | } |
1098 | 1098 | ||
1099 | QString Addressee::sipLabel() | 1099 | QString Addressee::sipLabel() |
1100 | { | 1100 | { |
1101 | return i18n("SIP"); | 1101 | return i18n("SIP"); |
1102 | } | 1102 | } |
1103 | 1103 | ||
1104 | QString Addressee::emailLabel() | 1104 | QString Addressee::emailLabel() |
1105 | { | 1105 | { |
1106 | return i18n("Email Address"); | 1106 | return i18n("Email Address"); |
1107 | } | 1107 | } |
1108 | 1108 | ||
1109 | 1109 | ||
1110 | void Addressee::setMailer( const QString &mailer ) | 1110 | void Addressee::setMailer( const QString &mailer ) |
1111 | { | 1111 | { |
1112 | if ( mailer == mData->mailer ) return; | 1112 | if ( mailer == mData->mailer ) return; |
1113 | detach(); | 1113 | detach(); |
1114 | mData->empty = false; | 1114 | mData->empty = false; |
1115 | mData->mailer = mailer; | 1115 | mData->mailer = mailer; |
1116 | } | 1116 | } |
1117 | 1117 | ||
1118 | QString Addressee::mailer() const | 1118 | QString Addressee::mailer() const |
1119 | { | 1119 | { |
1120 | return mData->mailer; | 1120 | return mData->mailer; |
1121 | } | 1121 | } |
1122 | 1122 | ||
1123 | QString Addressee::mailerLabel() | 1123 | QString Addressee::mailerLabel() |
1124 | { | 1124 | { |
1125 | return i18n("Mail Client"); | 1125 | return i18n("Mail Client"); |
1126 | } | 1126 | } |
1127 | 1127 | ||
1128 | 1128 | ||
1129 | void Addressee::setTimeZone( const TimeZone &timeZone ) | 1129 | void Addressee::setTimeZone( const TimeZone &timeZone ) |
1130 | { | 1130 | { |
1131 | if ( timeZone == mData->timeZone ) return; | 1131 | if ( timeZone == mData->timeZone ) return; |
1132 | detach(); | 1132 | detach(); |
1133 | mData->empty = false; | 1133 | mData->empty = false; |
1134 | mData->timeZone = timeZone; | 1134 | mData->timeZone = timeZone; |
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | TimeZone Addressee::timeZone() const | 1137 | TimeZone Addressee::timeZone() const |
1138 | { | 1138 | { |
1139 | return mData->timeZone; | 1139 | return mData->timeZone; |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | QString Addressee::timeZoneLabel() | 1142 | QString Addressee::timeZoneLabel() |
1143 | { | 1143 | { |
1144 | return i18n("Time Zone"); | 1144 | return i18n("Time Zone"); |
1145 | } | 1145 | } |
1146 | 1146 | ||
1147 | 1147 | ||
1148 | void Addressee::setGeo( const Geo &geo ) | 1148 | void Addressee::setGeo( const Geo &geo ) |
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp index 05d604f..aae923c 100644 --- a/kabc/addresseeview.cpp +++ b/kabc/addresseeview.cpp | |||
@@ -523,131 +523,133 @@ mText = "<table width=\"100%\">\n"; | |||
523 | mText += QString("<tr><td align=\"right\"><b2>%1</b2></td>" | 523 | mText += QString("<tr><td align=\"right\"><b2>%1</b2></td>" |
524 | "<td align=\"left\"><b>%2</b></td></tr>" ) | 524 | "<td align=\"left\"><b>%2</b></td></tr>" ) |
525 | .arg( i18n(" ") ) | 525 | .arg( i18n(" ") ) |
526 | .arg( name ); | 526 | .arg( name ); |
527 | */ | 527 | */ |
528 | if ( ! mAddressee.role().isEmpty() ) | 528 | if ( ! mAddressee.role().isEmpty() ) |
529 | mText += QString("<tr><td align=\"right\"><b>%1</b></td>" | 529 | mText += QString("<tr><td align=\"right\"><b>%1</b></td>" |
530 | "<td align=\"left\">%2</td></tr>" ) | 530 | "<td align=\"left\">%2</td></tr>" ) |
531 | .arg( i18n(" ") ) | 531 | .arg( i18n(" ") ) |
532 | .arg( mAddressee.role()); | 532 | .arg( mAddressee.role()); |
533 | if ( ! mAddressee.organization().isEmpty() ) | 533 | if ( ! mAddressee.organization().isEmpty() ) |
534 | mText += QString("<tr><td align=\"right\"><b>%1</b></td>" | 534 | mText += QString("<tr><td align=\"right\"><b>%1</b></td>" |
535 | "<td align=\"left\">%2</td></tr>" ) | 535 | "<td align=\"left\">%2</td></tr>" ) |
536 | .arg( i18n(" ") ) | 536 | .arg( i18n(" ") ) |
537 | .arg( mAddressee.organization()); | 537 | .arg( mAddressee.organization()); |
538 | mText += dynamicPart; | 538 | mText += dynamicPart; |
539 | mText += notes; | 539 | mText += notes; |
540 | mText += "</table>"; | 540 | mText += "</table>"; |
541 | 541 | ||
542 | } | 542 | } |
543 | 543 | ||
544 | // at last display it... | 544 | // at last display it... |
545 | setText( mText ); | 545 | setText( mText ); |
546 | 546 | ||
547 | } | 547 | } |
548 | 548 | ||
549 | QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones ,bool preferred ) | 549 | QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones ,bool preferred ) |
550 | { | 550 | { |
551 | ExternalAppHandler* eah = ExternalAppHandler::instance(); | 551 | ExternalAppHandler* eah = ExternalAppHandler::instance(); |
552 | bool kphoneAvail = eah->isPhoneAppAvailable(); | 552 | bool kphoneAvail = eah->isPhoneAppAvailable(); |
553 | bool kfaxAvail = eah->isFaxAppAvailable(); | 553 | bool kfaxAvail = eah->isFaxAppAvailable(); |
554 | bool ksmsAvail = eah->isSMSAppAvailable(); | 554 | bool ksmsAvail = eah->isSMSAppAvailable(); |
555 | bool kpagerAvail = eah->isPagerAppAvailable(); | 555 | bool kpagerAvail = eah->isPagerAppAvailable(); |
556 | bool ksipAvail = eah->isSIPAppAvailable(); | 556 | bool ksipAvail = eah->isSIPAppAvailable(); |
557 | QString dynamicPart; | 557 | QString dynamicPart; |
558 | KABC::PhoneNumber::List::ConstIterator phoneIt; | 558 | KABC::PhoneNumber::List::ConstIterator phoneIt; |
559 | QString extension; | 559 | QString extension; |
560 | int phonetype; | 560 | int phonetype; |
561 | QString sms; | 561 | QString sms; |
562 | for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { | 562 | for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { |
563 | phonetype = (*phoneIt).type(); | 563 | phonetype = (*phoneIt).type(); |
564 | if ( ((phonetype & KABC::PhoneNumber::Pref) == 0 ) == preferred ) | 564 | if ( ((phonetype & KABC::PhoneNumber::Pref) == 0 ) == preferred ) |
565 | continue; | 565 | continue; |
566 | if (ksmsAvail && | 566 | if (ksmsAvail && |
567 | ( | 567 | ( |
568 | ((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) || | 568 | ((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) || |
569 | ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell) | 569 | ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell) |
570 | ) | 570 | ) |
571 | ) | 571 | ) |
572 | { | 572 | { |
573 | sms = QString("<a href=\"smsto:%1 \">(sms)</a>" ) | 573 | sms = QString("<a href=\"smsto:%1 \">(sms)</a>" ) |
574 | .arg( (*phoneIt).number() ); | 574 | .arg( (*phoneIt).number() ); |
575 | 575 | ||
576 | } | 576 | } |
577 | else | 577 | else |
578 | sms = ""; | 578 | sms = ""; |
579 | 579 | ||
580 | extension = QString::null; | 580 | extension = QString::null; |
581 | if ((phonetype & KABC::PhoneNumber::Fax) == KABC::PhoneNumber::Fax) { | 581 | if ((phonetype & KABC::PhoneNumber::Fax) == KABC::PhoneNumber::Fax) { |
582 | if (kfaxAvail) extension = "faxto:"; | 582 | if (kfaxAvail) extension = "faxto:"; |
583 | } | 583 | } |
584 | else if ((phonetype & KABC::PhoneNumber::Pager) == KABC::PhoneNumber::Pager) { | 584 | else if ((phonetype & KABC::PhoneNumber::Pager) == KABC::PhoneNumber::Pager) { |
585 | if (kpagerAvail) extension = "pagerto:"; | 585 | if (kpagerAvail) extension = "pagerto:"; |
586 | } | 586 | } |
587 | #if 0 | ||
587 | else if ((phonetype & KABC::PhoneNumber::Sip) == KABC::PhoneNumber::Sip) { | 588 | else if ((phonetype & KABC::PhoneNumber::Sip) == KABC::PhoneNumber::Sip) { |
588 | if (ksipAvail) extension = "sipto:"; | 589 | if (ksipAvail) extension = "sipto:"; |
589 | } | 590 | } |
591 | #endif | ||
590 | else if (kphoneAvail) { | 592 | else if (kphoneAvail) { |
591 | extension = "phoneto:"; | 593 | extension = "phoneto:"; |
592 | } | 594 | } |
593 | else | 595 | else |
594 | extension = QString::null; | 596 | extension = QString::null; |
595 | 597 | ||
596 | if ( !extension.isEmpty() ) { | 598 | if ( !extension.isEmpty() ) { |
597 | dynamicPart += QString( | 599 | dynamicPart += QString( |
598 | "<tr><td align=\"right\"><b>%1</b></td>" | 600 | "<tr><td align=\"right\"><b>%1</b></td>" |
599 | "<td align=\"left\"><a href=\"%2%3 \">%4</a> %5</td></tr>" ) | 601 | "<td align=\"left\"><a href=\"%2%3 \">%4</a> %5</td></tr>" ) |
600 | .arg( KABC::PhoneNumber::typeLabel( phonetype ) ) | 602 | .arg( KABC::PhoneNumber::typeLabel( phonetype ) ) |
601 | .arg( extension ) | 603 | .arg( extension ) |
602 | .arg( (*phoneIt).number() ) | 604 | .arg( (*phoneIt).number() ) |
603 | .arg( (*phoneIt).number() ) | 605 | .arg( (*phoneIt).number() ) |
604 | .arg( sms ); | 606 | .arg( sms ); |
605 | 607 | ||
606 | } else { | 608 | } else { |
607 | dynamicPart += QString( | 609 | dynamicPart += QString( |
608 | "<tr><td align=\"right\"><b>%1</b></td>" | 610 | "<tr><td align=\"right\"><b>%1</b></td>" |
609 | "<td align=\"left\">%2 %3</td></tr>" ) | 611 | "<td align=\"left\">%2 %3</td></tr>" ) |
610 | .arg( KABC::PhoneNumber::typeLabel( phonetype ) ) | 612 | .arg( KABC::PhoneNumber::typeLabel( phonetype ) ) |
611 | .arg( (*phoneIt).number() ) | 613 | .arg( (*phoneIt).number() ) |
612 | .arg( sms ); | 614 | .arg( sms ); |
613 | } | 615 | } |
614 | } | 616 | } |
615 | return dynamicPart; | 617 | return dynamicPart; |
616 | } | 618 | } |
617 | /* | 619 | /* |
618 | KABC::Addressee AddresseeView::addressee() const | 620 | KABC::Addressee AddresseeView::addressee() const |
619 | { | 621 | { |
620 | return mAddressee; | 622 | return mAddressee; |
621 | } | 623 | } |
622 | */ | 624 | */ |
623 | void AddresseeView::addTag(const QString & tag,const QString & text) | 625 | void AddresseeView::addTag(const QString & tag,const QString & text) |
624 | { | 626 | { |
625 | if ( text.isEmpty() ) | 627 | if ( text.isEmpty() ) |
626 | return; | 628 | return; |
627 | int number=text.contains("\n"); | 629 | int number=text.contains("\n"); |
628 | QString str = "<" + tag + ">"; | 630 | QString str = "<" + tag + ">"; |
629 | QString tmpText=text; | 631 | QString tmpText=text; |
630 | QString tmpStr=str; | 632 | QString tmpStr=str; |
631 | if(number !=-1) | 633 | if(number !=-1) |
632 | { | 634 | { |
633 | if (number > 0) { | 635 | if (number > 0) { |
634 | int pos=0; | 636 | int pos=0; |
635 | QString tmp; | 637 | QString tmp; |
636 | for(int i=0;i<=number;i++) { | 638 | for(int i=0;i<=number;i++) { |
637 | pos=tmpText.find("\n"); | 639 | pos=tmpText.find("\n"); |
638 | tmp=tmpText.left(pos); | 640 | tmp=tmpText.left(pos); |
639 | tmpText=tmpText.right(tmpText.length()-pos-1); | 641 | tmpText=tmpText.right(tmpText.length()-pos-1); |
640 | tmpStr+=tmp+"<br>"; | 642 | tmpStr+=tmp+"<br>"; |
641 | } | 643 | } |
642 | } | 644 | } |
643 | else tmpStr += tmpText; | 645 | else tmpStr += tmpText; |
644 | tmpStr+="</" + tag + ">"; | 646 | tmpStr+="</" + tag + ">"; |
645 | mText.append(tmpStr); | 647 | mText.append(tmpStr); |
646 | } | 648 | } |
647 | else | 649 | else |
648 | { | 650 | { |
649 | str += text + "</" + tag + ">"; | 651 | str += text + "</" + tag + ">"; |
650 | mText.append(str); | 652 | mText.append(str); |
651 | } | 653 | } |
652 | } | 654 | } |
653 | 655 | ||