author | zautrix <zautrix> | 2005-10-29 22:45:39 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-29 22:45:39 (UTC) |
commit | b06fa1090f3fa7a71ab2710be444815df8bd6c17 (patch) (side-by-side diff) | |
tree | 16f5aed10d0c78c255ae732959e3dd184ae5e218 | |
parent | a4f17bd35c56280c45bda847b42b7d3a003b0a42 (diff) | |
download | kdepimpi-b06fa1090f3fa7a71ab2710be444815df8bd6c17.zip kdepimpi-b06fa1090f3fa7a71ab2710be444815df8bd6c17.tar.gz kdepimpi-b06fa1090f3fa7a71ab2710be444815df8bd6c17.tar.bz2 |
commit
-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 @@ -1071,49 +1071,49 @@ QString Addressee::homeFaxLabel() QString Addressee::businessFaxLabel() { return i18n("Fax (Work)"); } QString Addressee::isdnLabel() { return i18n("ISDN"); } QString Addressee::pagerLabel() { return i18n("Pager"); } QString Addressee::otherPhoneLabel() { return i18n("Other Phone"); } QString Addressee::sipLabel() { - return i18n("SIP"); + return i18n("SiP"); } QString Addressee::emailLabel() { return i18n("Email Address"); } void Addressee::setMailer( const QString &mailer ) { if ( mailer == mData->mailer ) return; detach(); mData->empty = false; mData->mailer = mailer; } QString Addressee::mailer() const { return mData->mailer; } QString Addressee::mailerLabel() { return i18n("Mail Client"); diff --git a/kabc/addresseeview.cpp b/kabc/addresseeview.cpp index 5c24acf..cde19a1 100644 --- a/kabc/addresseeview.cpp +++ b/kabc/addresseeview.cpp @@ -527,65 +527,90 @@ mText = "<table width=\"100%\">\n"; .arg( i18n(" ") ) .arg( name ); */ if ( ! mAddressee.role().isEmpty() ) mText += QString("<tr><td align=\"right\"><b>%1</b></td>" "<td align=\"left\">%2</td></tr>" ) .arg( i18n(" ") ) .arg( mAddressee.role()); if ( ! mAddressee.organization().isEmpty() ) mText += QString("<tr><td align=\"right\"><b>%1</b></td>" "<td align=\"left\">%2</td></tr>" ) .arg( i18n(" ") ) .arg( mAddressee.organization()); mText += dynamicPart; mText += notes; mText += "</table>"; } // at last display it... setText( mText ); } -QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones ,bool preferred ) +QString AddresseeView::getPhoneNumbers( KABC::PhoneNumber::List phones_unsorted ,bool preferred ) { ExternalAppHandler* eah = ExternalAppHandler::instance(); bool kphoneAvail = eah->isPhoneAppAvailable(); bool kfaxAvail = eah->isFaxAppAvailable(); bool ksmsAvail = eah->isSMSAppAvailable(); bool kpagerAvail = eah->isPagerAppAvailable(); bool ksipAvail = eah->isSIPAppAvailable(); QString dynamicPart; KABC::PhoneNumber::List::ConstIterator phoneIt; QString extension; int phonetype; QString sms; + + KABC::PhoneNumber::List::Iterator it; + KABC::PhoneNumber::List phones ; + + PhoneNumber::TypeList tList = PhoneNumber::supportedTypeList(); + int i = 0; + int max = tList.count(); + while ( i < max-1 ) { + for ( it = phones_unsorted.begin(); it != phones_unsorted.end(); ++it ) { + if ( (*it).type() == tList[i] ) { + phones.append( (*it ) ); + break; + } + } + ++i; + } + for ( it = phones_unsorted.begin(); it != phones_unsorted.end(); ++it ) { + if ( (*it).type() == tList[ max-1 ] ) + phones.append( (*it ) ); + } + for ( phoneIt = phones.begin(); phoneIt != phones.end(); ++phoneIt ) { phonetype = (*phoneIt).type(); - if ( ((phonetype & KABC::PhoneNumber::Pref) == 0 ) == preferred ) + bool con = false; + if ( ((phonetype & KABC::PhoneNumber::Pref) == 0 ) == preferred ) con = true; + if ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell ) con = !preferred;; + if ( con ) continue; + if (ksmsAvail && ( ((phonetype & KABC::PhoneNumber::Car) == KABC::PhoneNumber::Car) || ((phonetype & KABC::PhoneNumber::Cell) == KABC::PhoneNumber::Cell) ) ) { sms = QString("<a href=\"smsto:%1 \">(sms)</a>" ) .arg( (*phoneIt).number() ); } else sms = ""; extension = QString::null; if ((phonetype & KABC::PhoneNumber::Fax) == KABC::PhoneNumber::Fax) { if (kfaxAvail) extension = "faxto:"; } else if ((phonetype & KABC::PhoneNumber::Pager) == KABC::PhoneNumber::Pager) { if (kpagerAvail) extension = "pagerto:"; } #if 0 else if ((phonetype & KABC::PhoneNumber::Sip) == KABC::PhoneNumber::Sip) { if (ksipAvail) extension = "sipto:"; diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp index 6db1bcf..897c56d 100644 --- a/kabc/phonenumber.cpp +++ b/kabc/phonenumber.cpp @@ -78,59 +78,62 @@ int PhoneNumber::getCompatType( int type ) return Cell; } if ((type & Home) == Home) { if ((type & Pref) == Pref) return (Home | Pref); if ((type & Fax) == Fax) return (Home | Fax); return (Home); } if ((type & Work) == Work) { if ((type & Pref) == Pref) return (Work| Pref); if ((type & Fax) == Fax) return (Fax |Work); if ((type & Msg) == Msg) { if ((type & Voice) == Voice) return ( Msg | Voice |Work); return ( Msg | Work); } return Work; } if ((type & Pcs) == Pcs) { if ((type & Pref) == Pref) return Pcs | Pref; + if ((type & Voice) == Voice) + return Pcs | Voice; return Pcs; } if ((type & Car) == Car) return Car; if ((type & Pager) == Pager) return Pager; if ((type & Isdn) == Isdn) return Isdn; +#if 0 if ((type & Video) == Video) return Video; - +#endif if ((type & Msg) == Msg) return Msg; if ((type & Fax) == Fax) return Fax; if ((type & Pref) == Pref) return Pref; return Voice; } bool PhoneNumber::simplifyNumber() { QString Number; int i; Number = mNumber.stripWhiteSpace (); mNumber = ""; for ( i = 0; i < Number.length(); ++i) { if ( Number.at(i).isDigit() || Number.at(i) == '+'|| Number.at(i) == '*'|| Number.at(i) == '#' ) mNumber += Number.at(i); } return ( mNumber.length() > 0 ); } // make cellphone compatible @@ -205,104 +208,106 @@ QString PhoneNumber::typeLabel() const } } return label; } QString PhoneNumber::label() const { return typeLabel( type() ); } PhoneNumber::TypeList PhoneNumber::typeList() { TypeList list; list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video << Bbs << Modem << Car << Isdn << Pcs << Pager; return list; } PhoneNumber::TypeList PhoneNumber::supportedTypeList() { static TypeList list; if ( list.count() == 0 ) - 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; + 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; return list; } QStringList PhoneNumber::supportedTypeListNames() { static QStringList list; if ( list.count() == 0 ) - 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"); + 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"); return list; } int PhoneNumber::typeListIndex4Type(int type ) { TypeList list = supportedTypeList(); int i = 0; while ( i < list.count() ) { if ( list [i] == type ) return i; ++i; } return list.count()-1; } QString PhoneNumber::label( int type ) { return typeLabel( type ); } QString PhoneNumber::typeLabel( int type ) { if ((type & Cell) == Cell) return i18n("Mobile"); if ((type & Home) == Home) { if ((type & Pref) == Pref) return i18n("Home"); if ((type & Fax) == Fax) return i18n("Fax (Home)"); return i18n("Home2"); } if ((type & Work) == Work) { if ((type & Pref) == Pref) return i18n("Work"); if ((type & Fax) == Fax) return i18n("Fax (Work)"); if ((type & Msg) == Msg) { if ((type & Voice) == Voice) return i18n("Assistent"); return i18n("Company"); } return i18n("Work2"); } if ((type & Pcs) == Pcs) { if ((type & Pref) == Pref) - return i18n("SIP"); - return i18n("VoIP"); + return i18n("SiP"); + if ((type & Voice) == Voice) + return i18n("VoIP"); + return i18n("SiP2"); } if ((type & Car) == Car) return i18n("Mobile2"); if ((type & Pager) == Pager) return i18n("Pager"); if ((type & Isdn) == Isdn) return i18n("ISDN"); if ((type & Video) == Video) return i18n("Video"); if ((type & Msg) == Msg) return i18n("Callback"); if ((type & Fax) == Fax) return i18n("Fax (Other)"); if ((type & Pref) == Pref) return i18n("Primary"); return i18n("Other"); #if 0 diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index aa61fb8..f134d5b 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp @@ -625,49 +625,49 @@ void SimpleAlarmDaemonImpl::confTimer( int time ) minutes = mCustomMinutes; mRunningTimerText = mCustomText.stripWhiteSpace (); int in = mRunningTimerText.find( " " ); mRunningTimerText = mRunningTimerText.left ( in ); } else { mess += mTimerPopUp->text( minutes ); disp = mTimerPopUp->text( minutes ); mRunningTimerText = mTimerPopUp->text( minutes ); minutes -= 10; } } //minutes = 1; mRunningTimer = QDateTime::currentDateTime().addSecs( minutes * 60 ); timerMesssage = mess; AlarmServer::addAlarm ( mRunningTimer,"koalarm",timerMesssage.utf8()); mTimerStartLabel->setText( disp + "\n\nTimer started!" ); int w = mTimerStartLabel->sizeHint().width()+20; int h = mTimerStartLabel->sizeHint().height()+40 ; int dw = QApplication::desktop()->width(); int dh = QApplication::desktop()->height(); mTimerStartLabel->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); mTimerStartLabel->show(); - QTimer::singleShot( 5000, mTimerStartLabel, SLOT ( hide() ) ); + QTimer::singleShot( 4000, mTimerStartLabel, SLOT ( hide() ) ); mTimerTime = 1; } void SimpleAlarmDaemonImpl::confFontSize( int size ) { mFontsizePopup->setItemChecked( mPopupFontSize, false ); mPopupFontSize = size; mFontsizePopup->setItemChecked( mPopupFontSize, true ); QFont fon = mTimerPopUp->font(); fon.setPointSize( mPopupFontSize ); mTimerPopUp->setFont( fon ); mPopUp->setFont( fon ); fon.setBold( true ); fon.setPointSize( mPopupFontSize * 2 ); mTimerStartLabel->setFont( fon ); } void SimpleAlarmDaemonImpl::writeFile() { QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); //QCopEnvelope e("QPE/Application/kopi", "-writeFile"); } void SimpleAlarmDaemonImpl::showWN() { |