-rw-r--r-- | kabc/addressee.cpp | 2 | ||||
-rw-r--r-- | kabc/addresseeview.cpp | 29 | ||||
-rw-r--r-- | kabc/phonenumber.cpp | 15 | ||||
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 2 |
4 files changed, 39 insertions, 9 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 2f4a9af..6cfac80 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -1063,65 +1063,65 @@ QString Addressee::mobileWorkPhoneLabel() | |||
1063 | } | 1063 | } |
1064 | 1064 | ||
1065 | 1065 | ||
1066 | QString Addressee::homeFaxLabel() | 1066 | QString Addressee::homeFaxLabel() |
1067 | { | 1067 | { |
1068 | return i18n("Fax (Home)"); | 1068 | return i18n("Fax (Home)"); |
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | 1071 | ||
1072 | QString Addressee::businessFaxLabel() | 1072 | QString Addressee::businessFaxLabel() |
1073 | { | 1073 | { |
1074 | return i18n("Fax (Work)"); | 1074 | return i18n("Fax (Work)"); |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | 1077 | ||
1078 | QString Addressee::isdnLabel() | 1078 | QString Addressee::isdnLabel() |
1079 | { | 1079 | { |
1080 | return i18n("ISDN"); | 1080 | return i18n("ISDN"); |
1081 | } | 1081 | } |
1082 | 1082 | ||
1083 | 1083 | ||
1084 | QString Addressee::pagerLabel() | 1084 | QString Addressee::pagerLabel() |
1085 | { | 1085 | { |
1086 | return i18n("Pager"); | 1086 | return i18n("Pager"); |
1087 | } | 1087 | } |
1088 | QString Addressee::otherPhoneLabel() | 1088 | QString Addressee::otherPhoneLabel() |
1089 | { | 1089 | { |
1090 | return i18n("Other Phone"); | 1090 | return i18n("Other Phone"); |
1091 | } | 1091 | } |
1092 | 1092 | ||
1093 | QString Addressee::sipLabel() | 1093 | QString Addressee::sipLabel() |
1094 | { | 1094 | { |
1095 | return i18n("SIP"); | 1095 | return i18n("SiP"); |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | QString Addressee::emailLabel() | 1098 | QString Addressee::emailLabel() |
1099 | { | 1099 | { |
1100 | return i18n("Email Address"); | 1100 | return i18n("Email Address"); |
1101 | } | 1101 | } |
1102 | 1102 | ||
1103 | 1103 | ||
1104 | void Addressee::setMailer( const QString &mailer ) | 1104 | void Addressee::setMailer( const QString &mailer ) |
1105 | { | 1105 | { |
1106 | if ( mailer == mData->mailer ) return; | 1106 | if ( mailer == mData->mailer ) return; |
1107 | detach(); | 1107 | detach(); |
1108 | mData->empty = false; | 1108 | mData->empty = false; |
1109 | mData->mailer = mailer; | 1109 | mData->mailer = mailer; |
1110 | } | 1110 | } |
1111 | 1111 | ||
1112 | QString Addressee::mailer() const | 1112 | QString Addressee::mailer() const |
1113 | { | 1113 | { |
1114 | return mData->mailer; | 1114 | return mData->mailer; |
1115 | } | 1115 | } |
1116 | 1116 | ||
1117 | QString Addressee::mailerLabel() | 1117 | QString Addressee::mailerLabel() |
1118 | { | 1118 | { |
1119 | return i18n("Mail Client"); | 1119 | return i18n("Mail Client"); |
1120 | } | 1120 | } |
1121 | 1121 | ||
1122 | 1122 | ||
1123 | void Addressee::setTimeZone( const TimeZone &timeZone ) | 1123 | void Addressee::setTimeZone( const TimeZone &timeZone ) |
1124 | { | 1124 | { |
1125 | if ( timeZone == mData->timeZone ) return; | 1125 | if ( timeZone == mData->timeZone ) return; |
1126 | detach(); | 1126 | detach(); |
1127 | mData->empty = false; | 1127 | mData->empty = false; |
diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp index 5c24acf..cde19a1 100644 --- a/kabc/addresseeview.cpp +++ b/kabc/addresseeview.cpp | |||
@@ -519,81 +519,106 @@ mText = "<table width=\"100%\">\n"; | |||
519 | #endif | 519 | #endif |
520 | 520 | ||
521 | mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; | 521 | mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; |
522 | 522 | ||
523 | mText += "<table><td colspan=\"2\"> </td>"; | 523 | mText += "<table><td colspan=\"2\"> </td>"; |
524 | /* | 524 | /* |
525 | mText += QString("<tr><td align=\"right\"><b2>%1</b2></td>" | 525 | mText += QString("<tr><td align=\"right\"><b2>%1</b2></td>" |
526 | "<td align=\"left\"><b>%2</b></td></tr>" ) | 526 | "<td align=\"left\"><b>%2</b></td></tr>" ) |
527 | .arg( i18n(" ") ) | 527 | .arg( i18n(" ") ) |
528 | .arg( name ); | 528 | .arg( name ); |
529 | */ | 529 | */ |
530 | if ( ! mAddressee.role().isEmpty() ) | 530 | if ( ! mAddressee.role().isEmpty() ) |
531 | mText += QString("<tr><td align=\"right\"><b>%1</b></td>" | 531 | mText += QString("<tr><td align=\"right\"><b>%1</b></td>" |
532 | "<td align=\"left\">%2</td></tr>" ) | 532 | "<td align=\"left\">%2</td></tr>" ) |
533 | .arg( i18n(" ") ) | 533 | .arg( i18n(" ") ) |
534 | .arg( mAddressee.role()); | 534 | .arg( mAddressee.role()); |
535 | if ( ! mAddressee.organization().isEmpty() ) | 535 | if ( ! mAddressee.organization().isEmpty() ) |
536 | mText += QString("<tr><td align=\"right\"><b>%1</b></td>" | 536 | mText += QString("<tr><td align=\"right\"><b>%1</b></td>" |
537 | "<td align=\"left\">%2</td></tr>" ) | 537 | "<td align=\"left\">%2</td></tr>" ) |
538 | .arg( i18n(" ") ) | 538 | .arg( i18n(" ") ) |
539 | .arg( mAddressee.organization()); | 539 | .arg( mAddressee.organization()); |
540 | mText += dynamicPart; | 540 | mText += dynamicPart; |
541 | mText += notes; | 541 | mText += notes; |
542 | mText += "</table>"; | 542 | mText += "</table>"; |
543 | 543 | ||
544 | } | 544 | } |
545 | 545 | ||
546 | // at last display it... | 546 | // at last display it... |
547 | setText( mText ); | 547 | setText( mText ); |
548 | 548 | ||
549 | } | 549 | } |
550 | 550 | ||
551 | QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones ,bool preferred ) | 551 | QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones_unsorted ,bool preferred ) |
552 | { | 552 | { |
553 | ExternalAppHandler* eah = ExternalAppHandler::instance(); | 553 | ExternalAppHandler* eah = ExternalAppHandler::instance(); |
554 | bool kphoneAvail = eah->isPhoneAppAvailable(); | 554 | bool kphoneAvail = eah->isPhoneAppAvailable(); |
555 | bool kfaxAvail = eah->isFaxAppAvailable(); | 555 | bool kfaxAvail = eah->isFaxAppAvailable(); |
556 | bool ksmsAvail = eah->isSMSAppAvailable(); | 556 | bool ksmsAvail = eah->isSMSAppAvailable(); |
557 | bool kpagerAvail = eah->isPagerAppAvailable(); | 557 | bool kpagerAvail = eah->isPagerAppAvailable(); |
558 | bool ksipAvail = eah->isSIPAppAvailable(); | 558 | bool ksipAvail = eah->isSIPAppAvailable(); |
559 | QString dynamicPart; | 559 | QString dynamicPart; |
560 | KABC::PhoneNumber::List::ConstIterator phoneIt; | 560 | KABC::PhoneNumber::List::ConstIterator phoneIt; |
561 | QString extension; | 561 | QString extension; |
562 | int phonetype; | 562 | int phonetype; |
563 | QString sms; | 563 | QString sms; |
564 | |||
565 | KABC::PhoneNumber::List::Iterator it; | ||
566 | KABC::PhoneNumber::List phones ; | ||
567 | |||
568 | PhoneNumber::TypeList tList = PhoneNumber::supportedTypeList(); | ||
569 | int i = 0; | ||
570 | int max = tList.count(); | ||
571 | while ( i < max-1 ) { | ||
572 | for ( it = phones_unsorted.begin(); it != phones_unsorted.end(); ++it ) { | ||
573 | if ( (*it).type() == tList[i] ) { | ||
574 | phones.append( (*it ) ); | ||
575 | break; | ||
576 | } | ||
577 | } | ||
578 | ++i; | ||
579 | } | ||
580 | for ( it = phones_unsorted.begin(); it != phones_unsorted.end(); ++it ) { | ||
581 | if ( (*it).type() == tList[ max-1 ] ) | ||
582 | phones.append( (*it ) ); | ||
583 | } | ||
584 | |||
564 | for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { | 585 | for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { |
565 | phonetype = (*phoneIt).type(); | 586 | phonetype = (*phoneIt).type(); |
566 | if ( ((phonetype & KABC::PhoneNumber::Pref) == 0 ) == preferred ) | 587 | bool con = false; |
588 | if ( ((phonetype & KABC::PhoneNumber::Pref) == 0 ) == preferred ) con = true; | ||
589 | if ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell ) con = !preferred;; | ||
590 | if ( con ) | ||
567 | continue; | 591 | continue; |
592 | |||
568 | if (ksmsAvail && | 593 | if (ksmsAvail && |
569 | ( | 594 | ( |
570 | ((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) || | 595 | ((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) || |
571 | ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell) | 596 | ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell) |
572 | ) | 597 | ) |
573 | ) | 598 | ) |
574 | { | 599 | { |
575 | sms = QString("<a href=\"smsto:%1 \">(sms)</a>" ) | 600 | sms = QString("<a href=\"smsto:%1 \">(sms)</a>" ) |
576 | .arg( (*phoneIt).number() ); | 601 | .arg( (*phoneIt).number() ); |
577 | 602 | ||
578 | } | 603 | } |
579 | else | 604 | else |
580 | sms = ""; | 605 | sms = ""; |
581 | 606 | ||
582 | extension = QString::null; | 607 | extension = QString::null; |
583 | if ((phonetype & KABC::PhoneNumber::Fax) == KABC::PhoneNumber::Fax) { | 608 | if ((phonetype & KABC::PhoneNumber::Fax) == KABC::PhoneNumber::Fax) { |
584 | if (kfaxAvail) extension = "faxto:"; | 609 | if (kfaxAvail) extension = "faxto:"; |
585 | } | 610 | } |
586 | else if ((phonetype & KABC::PhoneNumber::Pager) == KABC::PhoneNumber::Pager) { | 611 | else if ((phonetype & KABC::PhoneNumber::Pager) == KABC::PhoneNumber::Pager) { |
587 | if (kpagerAvail) extension = "pagerto:"; | 612 | if (kpagerAvail) extension = "pagerto:"; |
588 | } | 613 | } |
589 | #if 0 | 614 | #if 0 |
590 | else if ((phonetype & KABC::PhoneNumber::Sip) == KABC::PhoneNumber::Sip) { | 615 | else if ((phonetype & KABC::PhoneNumber::Sip) == KABC::PhoneNumber::Sip) { |
591 | if (ksipAvail) extension = "sipto:"; | 616 | if (ksipAvail) extension = "sipto:"; |
592 | } | 617 | } |
593 | #endif | 618 | #endif |
594 | else if (kphoneAvail) { | 619 | else if (kphoneAvail) { |
595 | extension = "phoneto:"; | 620 | extension = "phoneto:"; |
596 | } | 621 | } |
597 | else | 622 | else |
598 | extension = QString::null; | 623 | extension = QString::null; |
599 | 624 | ||
diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp index 6db1bcf..897c56d 100644 --- a/kabc/phonenumber.cpp +++ b/kabc/phonenumber.cpp | |||
@@ -70,75 +70,78 @@ void PhoneNumber::makeCompat() | |||
70 | mType = getCompatType( mType ); | 70 | mType = getCompatType( mType ); |
71 | } | 71 | } |
72 | int PhoneNumber::getCompatType( int type ) | 72 | int PhoneNumber::getCompatType( int type ) |
73 | { | 73 | { |
74 | 74 | ||
75 | if ((type & Cell) == Cell) { | 75 | if ((type & Cell) == Cell) { |
76 | if ((type & Work) == Work) | 76 | if ((type & Work) == Work) |
77 | return Car; | 77 | return Car; |
78 | return Cell; | 78 | return Cell; |
79 | } | 79 | } |
80 | if ((type & Home) == Home) { | 80 | if ((type & Home) == Home) { |
81 | if ((type & Pref) == Pref) | 81 | if ((type & Pref) == Pref) |
82 | return (Home | Pref); | 82 | return (Home | Pref); |
83 | if ((type & Fax) == Fax) | 83 | if ((type & Fax) == Fax) |
84 | return (Home | Fax); | 84 | return (Home | Fax); |
85 | return (Home); | 85 | return (Home); |
86 | } | 86 | } |
87 | if ((type & Work) == Work) { | 87 | if ((type & Work) == Work) { |
88 | if ((type & Pref) == Pref) | 88 | if ((type & Pref) == Pref) |
89 | return (Work| Pref); | 89 | return (Work| Pref); |
90 | if ((type & Fax) == Fax) | 90 | if ((type & Fax) == Fax) |
91 | return (Fax |Work); | 91 | return (Fax |Work); |
92 | if ((type & Msg) == Msg) { | 92 | if ((type & Msg) == Msg) { |
93 | if ((type & Voice) == Voice) | 93 | if ((type & Voice) == Voice) |
94 | return ( Msg | Voice |Work); | 94 | return ( Msg | Voice |Work); |
95 | return ( Msg | Work); | 95 | return ( Msg | Work); |
96 | } | 96 | } |
97 | return Work; | 97 | return Work; |
98 | } | 98 | } |
99 | if ((type & Pcs) == Pcs) { | 99 | if ((type & Pcs) == Pcs) { |
100 | if ((type & Pref) == Pref) | 100 | if ((type & Pref) == Pref) |
101 | return Pcs | Pref; | 101 | return Pcs | Pref; |
102 | if ((type & Voice) == Voice) | ||
103 | return Pcs | Voice; | ||
102 | return Pcs; | 104 | return Pcs; |
103 | } | 105 | } |
104 | if ((type & Car) == Car) | 106 | if ((type & Car) == Car) |
105 | return Car; | 107 | return Car; |
106 | if ((type & Pager) == Pager) | 108 | if ((type & Pager) == Pager) |
107 | return Pager; | 109 | return Pager; |
108 | if ((type & Isdn) == Isdn) | 110 | if ((type & Isdn) == Isdn) |
109 | return Isdn; | 111 | return Isdn; |
112 | #if 0 | ||
110 | if ((type & Video) == Video) | 113 | if ((type & Video) == Video) |
111 | return Video; | 114 | return Video; |
112 | 115 | #endif | |
113 | if ((type & Msg) == Msg) | 116 | if ((type & Msg) == Msg) |
114 | return Msg; | 117 | return Msg; |
115 | if ((type & Fax) == Fax) | 118 | if ((type & Fax) == Fax) |
116 | return Fax; | 119 | return Fax; |
117 | 120 | ||
118 | if ((type & Pref) == Pref) | 121 | if ((type & Pref) == Pref) |
119 | return Pref; | 122 | return Pref; |
120 | 123 | ||
121 | return Voice; | 124 | return Voice; |
122 | 125 | ||
123 | } | 126 | } |
124 | bool PhoneNumber::simplifyNumber() | 127 | bool PhoneNumber::simplifyNumber() |
125 | { | 128 | { |
126 | QString Number; | 129 | QString Number; |
127 | int i; | 130 | int i; |
128 | Number = mNumber.stripWhiteSpace (); | 131 | Number = mNumber.stripWhiteSpace (); |
129 | mNumber = ""; | 132 | mNumber = ""; |
130 | for ( i = 0; i < Number.length(); ++i) { | 133 | for ( i = 0; i < Number.length(); ++i) { |
131 | if ( Number.at(i).isDigit() || Number.at(i) == '+'|| Number.at(i) == '*'|| Number.at(i) == '#' ) | 134 | if ( Number.at(i).isDigit() || Number.at(i) == '+'|| Number.at(i) == '*'|| Number.at(i) == '#' ) |
132 | mNumber += Number.at(i); | 135 | mNumber += Number.at(i); |
133 | } | 136 | } |
134 | return ( mNumber.length() > 0 ); | 137 | return ( mNumber.length() > 0 ); |
135 | } | 138 | } |
136 | // make cellphone compatible | 139 | // make cellphone compatible |
137 | void PhoneNumber::simplifyType() | 140 | void PhoneNumber::simplifyType() |
138 | { | 141 | { |
139 | if ( mType & Fax ) mType = Fax; | 142 | if ( mType & Fax ) mType = Fax; |
140 | else if ( mType & Cell ) mType = Cell; | 143 | else if ( mType & Cell ) mType = Cell; |
141 | else if ( mType & Work ) mType = Work ; | 144 | else if ( mType & Work ) mType = Work ; |
142 | else if ( mType & Home ) mType = Home; | 145 | else if ( mType & Home ) mType = Home; |
143 | else mType = Pref; | 146 | else mType = Pref; |
144 | } | 147 | } |
@@ -197,120 +200,122 @@ QString PhoneNumber::typeLabel() const | |||
197 | TypeList list = typeList(); | 200 | TypeList list = typeList(); |
198 | 201 | ||
199 | TypeList::Iterator it; | 202 | TypeList::Iterator it; |
200 | for ( it = list.begin(); it != list.end(); ++it ) { | 203 | for ( it = list.begin(); it != list.end(); ++it ) { |
201 | if ( ( type() & (*it) ) && ( (*it) != Pref ) ) { | 204 | if ( ( type() & (*it) ) && ( (*it) != Pref ) ) { |
202 | label.append( ( first ? "" : "/" ) + typeLabel( *it ) ); | 205 | label.append( ( first ? "" : "/" ) + typeLabel( *it ) ); |
203 | if ( first ) | 206 | if ( first ) |
204 | first = false; | 207 | first = false; |
205 | } | 208 | } |
206 | } | 209 | } |
207 | 210 | ||
208 | return label; | 211 | return label; |
209 | } | 212 | } |
210 | 213 | ||
211 | QString PhoneNumber::label() const | 214 | QString PhoneNumber::label() const |
212 | { | 215 | { |
213 | return typeLabel( type() ); | 216 | return typeLabel( type() ); |
214 | } | 217 | } |
215 | 218 | ||
216 | PhoneNumber::TypeList PhoneNumber::typeList() | 219 | PhoneNumber::TypeList PhoneNumber::typeList() |
217 | { | 220 | { |
218 | TypeList list; | 221 | TypeList list; |
219 | 222 | ||
220 | list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video | 223 | list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video |
221 | << Bbs << Modem << Car << Isdn << Pcs << Pager; | 224 | << Bbs << Modem << Car << Isdn << Pcs << Pager; |
222 | 225 | ||
223 | return list; | 226 | return list; |
224 | } | 227 | } |
225 | PhoneNumber::TypeList PhoneNumber::supportedTypeList() | 228 | PhoneNumber::TypeList PhoneNumber::supportedTypeList() |
226 | { | 229 | { |
227 | static TypeList list; | 230 | static TypeList list; |
228 | if ( list.count() == 0 ) | 231 | if ( list.count() == 0 ) |
229 | list << (Home| Pref) << (Work| Pref) << Cell <<(Pcs|Pref)<< Pcs<< Home << Work << Car << (Work| Msg | Voice) << (Work| Msg) << (Home | Fax) << (Work| Fax) << Fax<< Pager << Isdn << Video << Msg << Pref << Voice; | 232 | list << (Home| Pref) << (Work| Pref) << Cell <<(Pcs|Pref)<< (Pcs|Voice)<< Home << Work << Car << Pcs <<(Work| Msg | Voice) << (Work| Msg) << (Home | Fax) << (Work| Fax) << Fax<< Pager << Isdn << Msg << Pref << Voice; |
230 | return list; | 233 | return list; |
231 | } | 234 | } |
232 | QStringList PhoneNumber::supportedTypeListNames() | 235 | QStringList PhoneNumber::supportedTypeListNames() |
233 | { | 236 | { |
234 | static QStringList list; | 237 | static QStringList list; |
235 | if ( list.count() == 0 ) | 238 | if ( list.count() == 0 ) |
236 | list << i18n("Home") << i18n("Work") << i18n("Mobile") << i18n("SIP") << i18n("VoIP") <<i18n("Home2")<< i18n("Work2") << i18n("Mobile2") << i18n("Assistent") << i18n("Company") << i18n("Fax (Home)") << i18n("Fax (Work)") << i18n("Fax (Other)") << i18n("Pager") << i18n("ISDN") << i18n("Video") << i18n("Callback") << i18n("Primary")<< i18n("Other"); | 239 | list << i18n("Home") << i18n("Work") << i18n("Mobile") << i18n("SIP") << i18n("VoIP") <<i18n("Home2")<< i18n("Work2") << i18n("Mobile2") << i18n("SIP2") << i18n("Assistent") << i18n("Company") << i18n("Fax (Home)") << i18n("Fax (Work)") << i18n("Fax (Other)") << i18n("Pager") << i18n("ISDN") << i18n("Callback") << i18n("Primary")<< i18n("Other"); |
237 | return list; | 240 | return list; |
238 | } | 241 | } |
239 | 242 | ||
240 | int PhoneNumber::typeListIndex4Type(int type ) | 243 | int PhoneNumber::typeListIndex4Type(int type ) |
241 | { | 244 | { |
242 | TypeList list = supportedTypeList(); | 245 | TypeList list = supportedTypeList(); |
243 | int i = 0; | 246 | int i = 0; |
244 | while ( i < list.count() ) { | 247 | while ( i < list.count() ) { |
245 | if ( list [i] == type ) | 248 | if ( list [i] == type ) |
246 | return i; | 249 | return i; |
247 | ++i; | 250 | ++i; |
248 | } | 251 | } |
249 | return list.count()-1; | 252 | return list.count()-1; |
250 | } | 253 | } |
251 | 254 | ||
252 | QString PhoneNumber::label( int type ) | 255 | QString PhoneNumber::label( int type ) |
253 | { | 256 | { |
254 | return typeLabel( type ); | 257 | return typeLabel( type ); |
255 | } | 258 | } |
256 | 259 | ||
257 | QString PhoneNumber::typeLabel( int type ) | 260 | QString PhoneNumber::typeLabel( int type ) |
258 | { | 261 | { |
259 | if ((type & Cell) == Cell) | 262 | if ((type & Cell) == Cell) |
260 | return i18n("Mobile"); | 263 | return i18n("Mobile"); |
261 | if ((type & Home) == Home) { | 264 | if ((type & Home) == Home) { |
262 | if ((type & Pref) == Pref) | 265 | if ((type & Pref) == Pref) |
263 | return i18n("Home"); | 266 | return i18n("Home"); |
264 | if ((type & Fax) == Fax) | 267 | if ((type & Fax) == Fax) |
265 | return i18n("Fax (Home)"); | 268 | return i18n("Fax (Home)"); |
266 | return i18n("Home2"); | 269 | return i18n("Home2"); |
267 | } | 270 | } |
268 | 271 | ||
269 | if ((type & Work) == Work) { | 272 | if ((type & Work) == Work) { |
270 | if ((type & Pref) == Pref) | 273 | if ((type & Pref) == Pref) |
271 | return i18n("Work"); | 274 | return i18n("Work"); |
272 | if ((type & Fax) == Fax) | 275 | if ((type & Fax) == Fax) |
273 | return i18n("Fax (Work)"); | 276 | return i18n("Fax (Work)"); |
274 | if ((type & Msg) == Msg) { | 277 | if ((type & Msg) == Msg) { |
275 | if ((type & Voice) == Voice) | 278 | if ((type & Voice) == Voice) |
276 | return i18n("Assistent"); | 279 | return i18n("Assistent"); |
277 | return i18n("Company"); | 280 | return i18n("Company"); |
278 | } | 281 | } |
279 | return i18n("Work2"); | 282 | return i18n("Work2"); |
280 | } | 283 | } |
281 | if ((type & Pcs) == Pcs) { | 284 | if ((type & Pcs) == Pcs) { |
282 | if ((type & Pref) == Pref) | 285 | if ((type & Pref) == Pref) |
283 | return i18n("SIP"); | 286 | return i18n("SiP"); |
284 | return i18n("VoIP"); | 287 | if ((type & Voice) == Voice) |
288 | return i18n("VoIP"); | ||
289 | return i18n("SiP2"); | ||
285 | } | 290 | } |
286 | if ((type & Car) == Car) | 291 | if ((type & Car) == Car) |
287 | return i18n("Mobile2"); | 292 | return i18n("Mobile2"); |
288 | if ((type & Pager) == Pager) | 293 | if ((type & Pager) == Pager) |
289 | return i18n("Pager"); | 294 | return i18n("Pager"); |
290 | if ((type & Isdn) == Isdn) | 295 | if ((type & Isdn) == Isdn) |
291 | return i18n("ISDN"); | 296 | return i18n("ISDN"); |
292 | if ((type & Video) == Video) | 297 | if ((type & Video) == Video) |
293 | return i18n("Video"); | 298 | return i18n("Video"); |
294 | 299 | ||
295 | if ((type & Msg) == Msg) | 300 | if ((type & Msg) == Msg) |
296 | return i18n("Callback"); | 301 | return i18n("Callback"); |
297 | if ((type & Fax) == Fax) | 302 | if ((type & Fax) == Fax) |
298 | return i18n("Fax (Other)"); | 303 | return i18n("Fax (Other)"); |
299 | 304 | ||
300 | if ((type & Pref) == Pref) | 305 | if ((type & Pref) == Pref) |
301 | return i18n("Primary"); | 306 | return i18n("Primary"); |
302 | 307 | ||
303 | 308 | ||
304 | return i18n("Other"); | 309 | return i18n("Other"); |
305 | 310 | ||
306 | 311 | ||
307 | #if 0 | 312 | #if 0 |
308 | 313 | ||
309 | 314 | ||
310 | 315 | ||
311 | QString typeString; | 316 | QString typeString; |
312 | 317 | ||
313 | 318 | ||
314 | if ((type & Cell) == Cell) | 319 | if ((type & Cell) == Cell) |
315 | typeString += i18n("Mobile") +" "; | 320 | typeString += i18n("Mobile") +" "; |
316 | if ((type & Home) == Home) | 321 | if ((type & Home) == Home) |
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index aa61fb8..f134d5b 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp | |||
@@ -617,65 +617,65 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) | |||
617 | mCustomText = lEdit.text(); | 617 | mCustomText = lEdit.text(); |
618 | mCustomMinutes = spinh.value()*60+spinm.value(); | 618 | mCustomMinutes = spinh.value()*60+spinm.value(); |
619 | if ( mCustomMinutes == 0 ) | 619 | if ( mCustomMinutes == 0 ) |
620 | mCustomMinutes = 1; | 620 | mCustomMinutes = 1; |
621 | if ( mCustomMinutes > 1440 ) | 621 | if ( mCustomMinutes > 1440 ) |
622 | mCustomMinutes = 1440; | 622 | mCustomMinutes = 1440; |
623 | mess += mCustomText; | 623 | mess += mCustomText; |
624 | disp = mCustomText; | 624 | disp = mCustomText; |
625 | minutes = mCustomMinutes; | 625 | minutes = mCustomMinutes; |
626 | mRunningTimerText = mCustomText.stripWhiteSpace (); | 626 | mRunningTimerText = mCustomText.stripWhiteSpace (); |
627 | int in = mRunningTimerText.find( " " ); | 627 | int in = mRunningTimerText.find( " " ); |
628 | mRunningTimerText = mRunningTimerText.left ( in ); | 628 | mRunningTimerText = mRunningTimerText.left ( in ); |
629 | } | 629 | } |
630 | else { | 630 | else { |
631 | mess += mTimerPopUp->text( minutes ); | 631 | mess += mTimerPopUp->text( minutes ); |
632 | disp = mTimerPopUp->text( minutes ); | 632 | disp = mTimerPopUp->text( minutes ); |
633 | mRunningTimerText = mTimerPopUp->text( minutes ); | 633 | mRunningTimerText = mTimerPopUp->text( minutes ); |
634 | minutes -= 10; | 634 | minutes -= 10; |
635 | } | 635 | } |
636 | } | 636 | } |
637 | //minutes = 1; | 637 | //minutes = 1; |
638 | 638 | ||
639 | mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); | 639 | mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); |
640 | timerMesssage = mess; | 640 | timerMesssage = mess; |
641 | AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8()); | 641 | AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8()); |
642 | mTimerStartLabel->setText( disp + "\n\nTimer started!" ); | 642 | mTimerStartLabel->setText( disp + "\n\nTimer started!" ); |
643 | int w = mTimerStartLabel->sizeHint().width()+20; | 643 | int w = mTimerStartLabel->sizeHint().width()+20; |
644 | int h = mTimerStartLabel->sizeHint().height()+40 ; | 644 | int h = mTimerStartLabel->sizeHint().height()+40 ; |
645 | int dw = QApplication::desktop()->width(); | 645 | int dw = QApplication::desktop()->width(); |
646 | int dh = QApplication::desktop()->height(); | 646 | int dh = QApplication::desktop()->height(); |
647 | mTimerStartLabel->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 647 | mTimerStartLabel->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
648 | mTimerStartLabel->show(); | 648 | mTimerStartLabel->show(); |
649 | QTimer::singleShot( 5000, mTimerStartLabel, SLOT ( hide() ) ); | 649 | QTimer::singleShot( 4000, mTimerStartLabel, SLOT ( hide() ) ); |
650 | mTimerTime = 1; | 650 | mTimerTime = 1; |
651 | } | 651 | } |
652 | 652 | ||
653 | void SimpleAlarmDaemonImpl::confFontSize( int size ) | 653 | void SimpleAlarmDaemonImpl::confFontSize( int size ) |
654 | { | 654 | { |
655 | 655 | ||
656 | mFontsizePopup->setItemChecked( mPopupFontSize, false ); | 656 | mFontsizePopup->setItemChecked( mPopupFontSize, false ); |
657 | mPopupFontSize = size; | 657 | mPopupFontSize = size; |
658 | mFontsizePopup->setItemChecked( mPopupFontSize, true ); | 658 | mFontsizePopup->setItemChecked( mPopupFontSize, true ); |
659 | QFont fon = mTimerPopUp->font(); | 659 | QFont fon = mTimerPopUp->font(); |
660 | fon.setPointSize( mPopupFontSize ); | 660 | fon.setPointSize( mPopupFontSize ); |
661 | mTimerPopUp->setFont( fon ); | 661 | mTimerPopUp->setFont( fon ); |
662 | mPopUp->setFont( fon ); | 662 | mPopUp->setFont( fon ); |
663 | fon.setBold( true ); | 663 | fon.setBold( true ); |
664 | fon.setPointSize( mPopupFontSize * 2 ); | 664 | fon.setPointSize( mPopupFontSize * 2 ); |
665 | mTimerStartLabel->setFont( fon ); | 665 | mTimerStartLabel->setFont( fon ); |
666 | } | 666 | } |
667 | void SimpleAlarmDaemonImpl::writeFile() | 667 | void SimpleAlarmDaemonImpl::writeFile() |
668 | { | 668 | { |
669 | QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); | 669 | QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); |
670 | //QCopEnvelope e("QPE/Application/kopi", "-writeFile"); | 670 | //QCopEnvelope e("QPE/Application/kopi", "-writeFile"); |
671 | } | 671 | } |
672 | void SimpleAlarmDaemonImpl::showWN() | 672 | void SimpleAlarmDaemonImpl::showWN() |
673 | { | 673 | { |
674 | QCopEnvelope e("QPE/Application/kopi", "-showWN"); | 674 | QCopEnvelope e("QPE/Application/kopi", "-showWN"); |
675 | } | 675 | } |
676 | void SimpleAlarmDaemonImpl::newTodo() | 676 | void SimpleAlarmDaemonImpl::newTodo() |
677 | { | 677 | { |
678 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); | 678 | QCopEnvelope e("QPE/Application/kopi", "-newTodo"); |
679 | } | 679 | } |
680 | 680 | ||
681 | void SimpleAlarmDaemonImpl::newEvent() | 681 | void SimpleAlarmDaemonImpl::newEvent() |