-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 | |||
@@ -966,215 +966,215 @@ QDateTime Addressee::birthday() const | |||
966 | QString Addressee::birthdayLabel() | 966 | QString Addressee::birthdayLabel() |
967 | { | 967 | { |
968 | return i18n("Birthday"); | 968 | return i18n("Birthday"); |
969 | } | 969 | } |
970 | 970 | ||
971 | 971 | ||
972 | QString Addressee::homeAddressStreetLabel() | 972 | QString Addressee::homeAddressStreetLabel() |
973 | { | 973 | { |
974 | return i18n("Home Address Street"); | 974 | return i18n("Home Address Street"); |
975 | } | 975 | } |
976 | 976 | ||
977 | 977 | ||
978 | QString Addressee::homeAddressLocalityLabel() | 978 | QString Addressee::homeAddressLocalityLabel() |
979 | { | 979 | { |
980 | return i18n("Home Address Locality"); | 980 | return i18n("Home Address Locality"); |
981 | } | 981 | } |
982 | 982 | ||
983 | 983 | ||
984 | QString Addressee::homeAddressRegionLabel() | 984 | QString Addressee::homeAddressRegionLabel() |
985 | { | 985 | { |
986 | return i18n("Home Address Region"); | 986 | return i18n("Home Address Region"); |
987 | } | 987 | } |
988 | 988 | ||
989 | 989 | ||
990 | QString Addressee::homeAddressPostalCodeLabel() | 990 | QString Addressee::homeAddressPostalCodeLabel() |
991 | { | 991 | { |
992 | return i18n("Home Address Postal Code"); | 992 | return i18n("Home Address Postal Code"); |
993 | } | 993 | } |
994 | 994 | ||
995 | 995 | ||
996 | QString Addressee::homeAddressCountryLabel() | 996 | QString Addressee::homeAddressCountryLabel() |
997 | { | 997 | { |
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 ) |
1149 | { | 1149 | { |
1150 | if ( geo == mData->geo ) return; | 1150 | if ( geo == mData->geo ) return; |
1151 | detach(); | 1151 | detach(); |
1152 | mData->empty = false; | 1152 | mData->empty = false; |
1153 | mData->geo = geo; | 1153 | mData->geo = geo; |
1154 | } | 1154 | } |
1155 | 1155 | ||
1156 | Geo Addressee::geo() const | 1156 | Geo Addressee::geo() const |
1157 | { | 1157 | { |
1158 | return mData->geo; | 1158 | return mData->geo; |
1159 | } | 1159 | } |
1160 | 1160 | ||
1161 | QString Addressee::geoLabel() | 1161 | QString Addressee::geoLabel() |
1162 | { | 1162 | { |
1163 | return i18n("Geographic Position"); | 1163 | return i18n("Geographic Position"); |
1164 | } | 1164 | } |
1165 | 1165 | ||
1166 | 1166 | ||
1167 | void Addressee::setTitle( const QString &title ) | 1167 | void Addressee::setTitle( const QString &title ) |
1168 | { | 1168 | { |
1169 | if ( title == mData->title ) return; | 1169 | if ( title == mData->title ) return; |
1170 | detach(); | 1170 | detach(); |
1171 | mData->empty = false; | 1171 | mData->empty = false; |
1172 | mData->title = title; | 1172 | mData->title = title; |
1173 | } | 1173 | } |
1174 | 1174 | ||
1175 | QString Addressee::title() const | 1175 | QString Addressee::title() const |
1176 | { | 1176 | { |
1177 | return mData->title; | 1177 | return mData->title; |
1178 | } | 1178 | } |
1179 | 1179 | ||
1180 | QString Addressee::titleLabel() | 1180 | QString Addressee::titleLabel() |
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp index 05d604f..aae923c 100644 --- a/kabc/addresseeview.cpp +++ b/kabc/addresseeview.cpp | |||
@@ -491,195 +491,197 @@ void AddresseeView::setAddressee( const KABC::Addressee& mAddressee ) | |||
491 | "%7" // dynamic part | 491 | "%7" // dynamic part |
492 | "%8" // notes | 492 | "%8" // notes |
493 | "</table>" | 493 | "</table>" |
494 | "</body>" | 494 | "</body>" |
495 | "</html>") | 495 | "</html>") |
496 | //US | 496 | //US |
497 | .arg( /*KGlobalSettings::textColor().name()*/ "black" ) | 497 | .arg( /*KGlobalSettings::textColor().name()*/ "black" ) |
498 | //US | 498 | //US |
499 | .arg( /*KGlobalSettings::baseColor().name()*/ "white" ) | 499 | .arg( /*KGlobalSettings::baseColor().name()*/ "white" ) |
500 | .arg( picString ) | 500 | .arg( picString ) |
501 | .arg( name ) | 501 | .arg( name ) |
502 | .arg( aRole ) | 502 | .arg( aRole ) |
503 | .arg( aOrga ) | 503 | .arg( aOrga ) |
504 | .arg( dynamicPart ) | 504 | .arg( dynamicPart ) |
505 | .arg( notes ); | 505 | .arg( notes ); |
506 | 506 | ||
507 | } else { // no picture! | 507 | } else { // no picture! |
508 | 508 | ||
509 | mText = "<table width=\"100%\">\n"; | 509 | mText = "<table width=\"100%\">\n"; |
510 | //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; | 510 | //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; |
511 | #ifdef DESKTOP_VERSION | 511 | #ifdef DESKTOP_VERSION |
512 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"left\"><h1>"; | 512 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"left\"><h1>"; |
513 | mText += "<font color=\"#FFFFFF\">" + name +"</font></h1>"; | 513 | mText += "<font color=\"#FFFFFF\">" + name +"</font></h1>"; |
514 | #else | 514 | #else |
515 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"left\"><h3>"; | 515 | mText += "<tr bgcolor=\"#5699CD\"><td align=\"left\"><h3>"; |
516 | mText += "<font color=\"#FFFFFF\"> " + name +"</font></h3>"; | 516 | mText += "<font color=\"#FFFFFF\"> " + name +"</font></h3>"; |
517 | #endif | 517 | #endif |
518 | 518 | ||
519 | mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; | 519 | mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; |
520 | 520 | ||
521 | mText += "<table><td colspan=\"2\"> </td>"; | 521 | mText += "<table><td colspan=\"2\"> </td>"; |
522 | /* | 522 | /* |
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 | ||
654 | AddresseeChooser::AddresseeChooser( KABC::Addressee loc, KABC::Addressee rem, bool takeloc, QWidget *parent, const char *name ) : KDialogBase(parent,name, | 656 | AddresseeChooser::AddresseeChooser( KABC::Addressee loc, KABC::Addressee rem, bool takeloc, QWidget *parent, const char *name ) : KDialogBase(parent,name, |
655 | true ,i18n("Conflict! Please choose Adressee!"),Ok|User1|Close,Close, false) | 657 | true ,i18n("Conflict! Please choose Adressee!"),Ok|User1|Close,Close, false) |
656 | { | 658 | { |
657 | findButton( Close )->setText( i18n("Cancel Sync")); | 659 | findButton( Close )->setText( i18n("Cancel Sync")); |
658 | findButton( Ok )->setText( i18n("Remote")); | 660 | findButton( Ok )->setText( i18n("Remote")); |
659 | findButton( User1 )->setText( i18n("Local")); | 661 | findButton( User1 )->setText( i18n("Local")); |
660 | QWidget* topframe = new QWidget( this ); | 662 | QWidget* topframe = new QWidget( this ); |
661 | setMainWidget( topframe ); | 663 | setMainWidget( topframe ); |
662 | QBoxLayout* bl; | 664 | QBoxLayout* bl; |
663 | if ( QApplication::desktop()->width() < 640 ) { | 665 | if ( QApplication::desktop()->width() < 640 ) { |
664 | bl = new QVBoxLayout( topframe ); | 666 | bl = new QVBoxLayout( topframe ); |
665 | } else { | 667 | } else { |
666 | bl = new QHBoxLayout( topframe ); | 668 | bl = new QHBoxLayout( topframe ); |
667 | } | 669 | } |
668 | QVBox* subframe = new QVBox( topframe ); | 670 | QVBox* subframe = new QVBox( topframe ); |
669 | bl->addWidget(subframe ); | 671 | bl->addWidget(subframe ); |
670 | QLabel* lab = new QLabel( i18n("Local Addressee"), subframe ); | 672 | QLabel* lab = new QLabel( i18n("Local Addressee"), subframe ); |
671 | if ( takeloc ) | 673 | if ( takeloc ) |
672 | lab->setBackgroundColor(Qt::green.light() ); | 674 | lab->setBackgroundColor(Qt::green.light() ); |
673 | AddresseeView * av = new AddresseeView( subframe ); | 675 | AddresseeView * av = new AddresseeView( subframe ); |
674 | av->setAddressee( loc ); | 676 | av->setAddressee( loc ); |
675 | subframe = new QVBox( topframe ); | 677 | subframe = new QVBox( topframe ); |
676 | bl->addWidget(subframe ); | 678 | bl->addWidget(subframe ); |
677 | lab = new QLabel( i18n("Remote Addressee"), subframe ); | 679 | lab = new QLabel( i18n("Remote Addressee"), subframe ); |
678 | if ( !takeloc ) | 680 | if ( !takeloc ) |
679 | lab->setBackgroundColor(Qt::green.light() ); | 681 | lab->setBackgroundColor(Qt::green.light() ); |
680 | av = new AddresseeView( subframe ); | 682 | av = new AddresseeView( subframe ); |
681 | av->setAddressee( rem ); | 683 | av->setAddressee( rem ); |
682 | QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote())); | 684 | QObject::connect(findButton( Ok ),SIGNAL(clicked()),this, SLOT(slot_remote())); |
683 | QObject::connect(this,SIGNAL(user1Clicked()),this, SLOT(slot_local())); | 685 | QObject::connect(this,SIGNAL(user1Clicked()),this, SLOT(slot_local())); |
684 | #ifndef DESKTOP_VERSION | 686 | #ifndef DESKTOP_VERSION |
685 | showMaximized(); | 687 | showMaximized(); |