-rw-r--r-- | kabc/addressee.cpp | 17 | ||||
-rw-r--r-- | kabc/addressee.h | 3 | ||||
-rw-r--r-- | kabc/field.cpp | 6 | ||||
-rw-r--r-- | kalarmd/simplealarmdaemonimpl.cpp | 2 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 28 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 21 |
6 files changed, 36 insertions, 41 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 7f592e9..155ce24 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -30,49 +30,48 @@ $Id$ | |||
30 | 30 | ||
31 | #include <ksharedptr.h> | 31 | #include <ksharedptr.h> |
32 | #include <kdebug.h> | 32 | #include <kdebug.h> |
33 | #include <kapplication.h> | 33 | #include <kapplication.h> |
34 | #include <klocale.h> | 34 | #include <klocale.h> |
35 | #include <kidmanager.h> | 35 | #include <kidmanager.h> |
36 | //US | 36 | //US |
37 | #include <kstandarddirs.h> | 37 | #include <kstandarddirs.h> |
38 | #include <libkcal/syncdefines.h> | 38 | #include <libkcal/syncdefines.h> |
39 | 39 | ||
40 | //US #include "resource.h" | 40 | //US #include "resource.h" |
41 | #include "addressee.h" | 41 | #include "addressee.h" |
42 | 42 | ||
43 | using namespace KABC; | 43 | using namespace KABC; |
44 | 44 | ||
45 | static bool matchBinaryPattern( int value, int pattern ); | 45 | static bool matchBinaryPattern( int value, int pattern ); |
46 | static bool matchBinaryPatternA( int value, int pattern ); | 46 | static bool matchBinaryPatternA( int value, int pattern ); |
47 | static bool matchBinaryPatternP( int value, int pattern ); | 47 | static bool matchBinaryPatternP( int value, int pattern ); |
48 | 48 | ||
49 | struct Addressee::AddresseeData : public KShared | 49 | struct Addressee::AddresseeData : public KShared |
50 | { | 50 | { |
51 | QString uid; | 51 | QString uid; |
52 | QString name; | 52 | QString name; |
53 | QString formattedName; | 53 | QString formattedName; |
54 | QString defaultFormattedName; | ||
55 | QString familyName; | 54 | QString familyName; |
56 | QString givenName; | 55 | QString givenName; |
57 | QString additionalName; | 56 | QString additionalName; |
58 | QString prefix; | 57 | QString prefix; |
59 | QString suffix; | 58 | QString suffix; |
60 | QString nickName; | 59 | QString nickName; |
61 | QDateTime birthday; | 60 | QDateTime birthday; |
62 | QString mailer; | 61 | QString mailer; |
63 | TimeZone timeZone; | 62 | TimeZone timeZone; |
64 | Geo geo; | 63 | Geo geo; |
65 | QString title; | 64 | QString title; |
66 | QString role; | 65 | QString role; |
67 | QString organization; | 66 | QString organization; |
68 | QString note; | 67 | QString note; |
69 | QString productId; | 68 | QString productId; |
70 | QDateTime revision; | 69 | QDateTime revision; |
71 | QString sortString; | 70 | QString sortString; |
72 | QString externalUID; | 71 | QString externalUID; |
73 | QString originalExternalUID; | 72 | QString originalExternalUID; |
74 | KURL url; | 73 | KURL url; |
75 | Secrecy secrecy; | 74 | Secrecy secrecy; |
76 | Picture logo; | 75 | Picture logo; |
77 | Picture photo; | 76 | Picture photo; |
78 | Sound sound; | 77 | Sound sound; |
@@ -727,75 +726,59 @@ void Addressee::setName( const QString &name ) | |||
727 | if ( name == mData->name ) return; | 726 | if ( name == mData->name ) return; |
728 | detach(); | 727 | detach(); |
729 | mData->empty = false; | 728 | mData->empty = false; |
730 | mData->name = name; | 729 | mData->name = name; |
731 | } | 730 | } |
732 | 731 | ||
733 | QString Addressee::name() const | 732 | QString Addressee::name() const |
734 | { | 733 | { |
735 | return mData->name; | 734 | return mData->name; |
736 | } | 735 | } |
737 | 736 | ||
738 | QString Addressee::nameLabel() | 737 | QString Addressee::nameLabel() |
739 | { | 738 | { |
740 | return i18n("Name"); | 739 | return i18n("Name"); |
741 | } | 740 | } |
742 | 741 | ||
743 | 742 | ||
744 | void Addressee::setFormattedName( const QString &formattedName ) | 743 | void Addressee::setFormattedName( const QString &formattedName ) |
745 | { | 744 | { |
746 | if ( formattedName == mData->formattedName ) return; | 745 | if ( formattedName == mData->formattedName ) return; |
747 | detach(); | 746 | detach(); |
748 | mData->empty = false; | 747 | mData->empty = false; |
749 | mData->formattedName = formattedName; | 748 | mData->formattedName = formattedName; |
750 | } | 749 | } |
751 | void Addressee::setDefaultFormattedName( const QString &formattedName ) | ||
752 | { | ||
753 | if ( formattedName == mData->defaultFormattedName ) return; | ||
754 | detach(); | ||
755 | mData->empty = false; | ||
756 | mData->defaultFormattedName = formattedName; | ||
757 | } | ||
758 | 750 | ||
759 | QString Addressee::formattedName() const | 751 | QString Addressee::formattedName() const |
760 | { | 752 | { |
761 | return mData->formattedName; | 753 | return mData->formattedName; |
762 | } | 754 | } |
763 | QString Addressee::defaultFormattedName() const | ||
764 | { | ||
765 | return mData->defaultFormattedName; | ||
766 | } | ||
767 | 755 | ||
768 | QString Addressee::formattedNameLabel() | 756 | QString Addressee::formattedNameLabel() |
769 | { | 757 | { |
770 | return i18n("Formatted Name"); | 758 | return i18n("Formatted Name"); |
771 | } | 759 | } |
772 | 760 | ||
773 | QString Addressee::defaultFormattedNameLabel() | ||
774 | { | ||
775 | return i18n("Def.Formatted Name"); | ||
776 | } | ||
777 | |||
778 | 761 | ||
779 | void Addressee::setFamilyName( const QString &familyName ) | 762 | void Addressee::setFamilyName( const QString &familyName ) |
780 | { | 763 | { |
781 | if ( familyName == mData->familyName ) return; | 764 | if ( familyName == mData->familyName ) return; |
782 | detach(); | 765 | detach(); |
783 | mData->empty = false; | 766 | mData->empty = false; |
784 | mData->familyName = familyName; | 767 | mData->familyName = familyName; |
785 | } | 768 | } |
786 | 769 | ||
787 | QString Addressee::familyName() const | 770 | QString Addressee::familyName() const |
788 | { | 771 | { |
789 | return mData->familyName; | 772 | return mData->familyName; |
790 | } | 773 | } |
791 | 774 | ||
792 | QString Addressee::familyNameLabel() | 775 | QString Addressee::familyNameLabel() |
793 | { | 776 | { |
794 | return i18n("Family Name"); | 777 | return i18n("Family Name"); |
795 | } | 778 | } |
796 | 779 | ||
797 | 780 | ||
798 | void Addressee::setGivenName( const QString &givenName ) | 781 | void Addressee::setGivenName( const QString &givenName ) |
799 | { | 782 | { |
800 | if ( givenName == mData->givenName ) return; | 783 | if ( givenName == mData->givenName ) return; |
801 | detach(); | 784 | detach(); |
diff --git a/kabc/addressee.h b/kabc/addressee.h index 0d688f8..a2fbcf5 100644 --- a/kabc/addressee.h +++ b/kabc/addressee.h | |||
@@ -133,59 +133,56 @@ class Addressee | |||
133 | */ | 133 | */ |
134 | const QString uid() const; | 134 | const QString uid() const; |
135 | /** | 135 | /** |
136 | Return translated label for uid field. | 136 | Return translated label for uid field. |
137 | */ | 137 | */ |
138 | static QString uidLabel(); | 138 | static QString uidLabel(); |
139 | 139 | ||
140 | /** | 140 | /** |
141 | Set name. | 141 | Set name. |
142 | */ | 142 | */ |
143 | void setName( const QString &name ); | 143 | void setName( const QString &name ); |
144 | /** | 144 | /** |
145 | Return name. | 145 | Return name. |
146 | */ | 146 | */ |
147 | QString name() const; | 147 | QString name() const; |
148 | /** | 148 | /** |
149 | Return translated label for name field. | 149 | Return translated label for name field. |
150 | */ | 150 | */ |
151 | static QString nameLabel(); | 151 | static QString nameLabel(); |
152 | 152 | ||
153 | /** | 153 | /** |
154 | Set formatted name. | 154 | Set formatted name. |
155 | */ | 155 | */ |
156 | void setFormattedName( const QString &formattedName ); | 156 | void setFormattedName( const QString &formattedName ); |
157 | void setDefaultFormattedName( const QString &formattedName ); | ||
158 | /** | 157 | /** |
159 | Return formatted name. | 158 | Return formatted name. |
160 | */ | 159 | */ |
161 | QString formattedName() const; | 160 | QString formattedName() const; |
162 | QString defaultFormattedName() const; | ||
163 | /** | 161 | /** |
164 | Return translated label for formattedName field. | 162 | Return translated label for formattedName field. |
165 | */ | 163 | */ |
166 | static QString formattedNameLabel(); | 164 | static QString formattedNameLabel(); |
167 | static QString defaultFormattedNameLabel(); | ||
168 | 165 | ||
169 | /** | 166 | /** |
170 | Set family name. | 167 | Set family name. |
171 | */ | 168 | */ |
172 | void setFamilyName( const QString &familyName ); | 169 | void setFamilyName( const QString &familyName ); |
173 | /** | 170 | /** |
174 | Return family name. | 171 | Return family name. |
175 | */ | 172 | */ |
176 | QString familyName() const; | 173 | QString familyName() const; |
177 | /** | 174 | /** |
178 | Return translated label for familyName field. | 175 | Return translated label for familyName field. |
179 | */ | 176 | */ |
180 | static QString familyNameLabel(); | 177 | static QString familyNameLabel(); |
181 | 178 | ||
182 | /** | 179 | /** |
183 | Set given name. | 180 | Set given name. |
184 | */ | 181 | */ |
185 | void setGivenName( const QString &givenName ); | 182 | void setGivenName( const QString &givenName ); |
186 | /** | 183 | /** |
187 | Return given name. | 184 | Return given name. |
188 | */ | 185 | */ |
189 | QString givenName() const; | 186 | QString givenName() const; |
190 | /** | 187 | /** |
191 | Return translated label for givenName field. | 188 | Return translated label for givenName field. |
diff --git a/kabc/field.cpp b/kabc/field.cpp index 5c561c3..fd51026 100644 --- a/kabc/field.cpp +++ b/kabc/field.cpp | |||
@@ -66,92 +66,89 @@ class Field::FieldImpl | |||
66 | HomeAddressLabel, | 66 | HomeAddressLabel, |
67 | BusinessAddressStreet, | 67 | BusinessAddressStreet, |
68 | BusinessAddressLocality, | 68 | BusinessAddressLocality, |
69 | BusinessAddressRegion, | 69 | BusinessAddressRegion, |
70 | BusinessAddressPostalCode, | 70 | BusinessAddressPostalCode, |
71 | BusinessAddressCountry, | 71 | BusinessAddressCountry, |
72 | BusinessAddressLabel, | 72 | BusinessAddressLabel, |
73 | HomePhone, | 73 | HomePhone, |
74 | BusinessPhone, | 74 | BusinessPhone, |
75 | MobilePhone, | 75 | MobilePhone, |
76 | HomeFax, | 76 | HomeFax, |
77 | BusinessFax, | 77 | BusinessFax, |
78 | CarPhone, | 78 | CarPhone, |
79 | Isdn, | 79 | Isdn, |
80 | Pager, | 80 | Pager, |
81 | Email, | 81 | Email, |
82 | Mailer, | 82 | Mailer, |
83 | Title, | 83 | Title, |
84 | Role, | 84 | Role, |
85 | Organization, | 85 | Organization, |
86 | Note, | 86 | Note, |
87 | Url, | 87 | Url, |
88 | Resource, | 88 | Resource, |
89 | Sip, | 89 | Sip, |
90 | DefaultFormattedName, | ||
91 | MobileWorkPhone, | 90 | MobileWorkPhone, |
92 | MobileHomePhone | 91 | MobileHomePhone |
93 | }; | 92 | }; |
94 | 93 | ||
95 | int fieldId() { return mFieldId; } | 94 | int fieldId() { return mFieldId; } |
96 | int category() { return mCategory; } | 95 | int category() { return mCategory; } |
97 | 96 | ||
98 | QString label() { return mLabel; } | 97 | QString label() { return mLabel; } |
99 | QString key() { return mKey; } | 98 | QString key() { return mKey; } |
100 | QString app() { return mApp; } | 99 | QString app() { return mApp; } |
101 | 100 | ||
102 | private: | 101 | private: |
103 | int mFieldId; | 102 | int mFieldId; |
104 | int mCategory; | 103 | int mCategory; |
105 | 104 | ||
106 | QString mLabel; | 105 | QString mLabel; |
107 | QString mKey; | 106 | QString mKey; |
108 | QString mApp; | 107 | QString mApp; |
109 | }; | 108 | }; |
110 | 109 | ||
111 | 110 | ||
112 | Field::List Field::mAllFields; | 111 | Field::List Field::mAllFields; |
113 | Field::List Field::mDefaultFields; | 112 | Field::List Field::mDefaultFields; |
114 | Field::List Field::mCustomFields; | 113 | Field::List Field::mCustomFields; |
115 | 114 | ||
116 | 115 | ||
117 | Field::Field( FieldImpl *impl ) | 116 | Field::Field( FieldImpl *impl ) |
118 | { | 117 | { |
119 | mImpl = impl; | 118 | mImpl = impl; |
120 | } | 119 | } |
121 | 120 | ||
122 | Field::~Field() | 121 | Field::~Field() |
123 | { | 122 | { |
124 | delete mImpl; | 123 | delete mImpl; |
125 | } | 124 | } |
126 | 125 | ||
127 | QString Field::label() | 126 | QString Field::label() |
128 | { | 127 | { |
129 | switch ( mImpl->fieldId() ) { | 128 | switch ( mImpl->fieldId() ) { |
130 | case FieldImpl::FormattedName: | 129 | case FieldImpl::FormattedName: |
131 | return Addressee::formattedNameLabel(); | 130 | return Addressee::formattedNameLabel(); |
132 | case FieldImpl::DefaultFormattedName: | ||
133 | return Addressee::defaultFormattedNameLabel(); | ||
134 | case FieldImpl::FamilyName: | 131 | case FieldImpl::FamilyName: |
135 | return Addressee::familyNameLabel(); | 132 | return Addressee::familyNameLabel(); |
136 | case FieldImpl::GivenName: | 133 | case FieldImpl::GivenName: |
137 | return Addressee::givenNameLabel(); | 134 | return Addressee::givenNameLabel(); |
138 | case FieldImpl::AdditionalName: | 135 | case FieldImpl::AdditionalName: |
139 | return Addressee::additionalNameLabel(); | 136 | return Addressee::additionalNameLabel(); |
140 | case FieldImpl::Prefix: | 137 | case FieldImpl::Prefix: |
141 | return Addressee::prefixLabel(); | 138 | return Addressee::prefixLabel(); |
142 | case FieldImpl::Suffix: | 139 | case FieldImpl::Suffix: |
143 | return Addressee::suffixLabel(); | 140 | return Addressee::suffixLabel(); |
144 | case FieldImpl::NickName: | 141 | case FieldImpl::NickName: |
145 | return Addressee::nickNameLabel(); | 142 | return Addressee::nickNameLabel(); |
146 | case FieldImpl::Birthday: | 143 | case FieldImpl::Birthday: |
147 | return Addressee::birthdayLabel(); | 144 | return Addressee::birthdayLabel(); |
148 | case FieldImpl::HomeAddressStreet: | 145 | case FieldImpl::HomeAddressStreet: |
149 | return Addressee::homeAddressStreetLabel(); | 146 | return Addressee::homeAddressStreetLabel(); |
150 | case FieldImpl::HomeAddressLocality: | 147 | case FieldImpl::HomeAddressLocality: |
151 | return Addressee::homeAddressLocalityLabel(); | 148 | return Addressee::homeAddressLocalityLabel(); |
152 | case FieldImpl::HomeAddressRegion: | 149 | case FieldImpl::HomeAddressRegion: |
153 | return Addressee::homeAddressRegionLabel(); | 150 | return Addressee::homeAddressRegionLabel(); |
154 | case FieldImpl::HomeAddressPostalCode: | 151 | case FieldImpl::HomeAddressPostalCode: |
155 | return Addressee::homeAddressPostalCodeLabel(); | 152 | return Addressee::homeAddressPostalCodeLabel(); |
156 | case FieldImpl::HomeAddressCountry: | 153 | case FieldImpl::HomeAddressCountry: |
157 | return Addressee::homeAddressCountryLabel(); | 154 | return Addressee::homeAddressCountryLabel(); |
@@ -227,50 +224,48 @@ QString Field::categoryLabel( int category ) | |||
227 | case All: | 224 | case All: |
228 | return i18n("All"); | 225 | return i18n("All"); |
229 | case Frequent: | 226 | case Frequent: |
230 | return i18n("Frequent"); | 227 | return i18n("Frequent"); |
231 | case Address: | 228 | case Address: |
232 | return i18n("Address"); | 229 | return i18n("Address"); |
233 | case Email: | 230 | case Email: |
234 | return i18n("Email"); | 231 | return i18n("Email"); |
235 | case Personal: | 232 | case Personal: |
236 | return i18n("Personal"); | 233 | return i18n("Personal"); |
237 | case Organization: | 234 | case Organization: |
238 | return i18n("Organization"); | 235 | return i18n("Organization"); |
239 | case CustomCategory: | 236 | case CustomCategory: |
240 | return i18n("Custom"); | 237 | return i18n("Custom"); |
241 | default: | 238 | default: |
242 | return i18n("Undefined"); | 239 | return i18n("Undefined"); |
243 | } | 240 | } |
244 | } | 241 | } |
245 | 242 | ||
246 | QString Field::value( const KABC::Addressee &a ) | 243 | QString Field::value( const KABC::Addressee &a ) |
247 | { | 244 | { |
248 | switch ( mImpl->fieldId() ) { | 245 | switch ( mImpl->fieldId() ) { |
249 | case FieldImpl::FormattedName: | 246 | case FieldImpl::FormattedName: |
250 | return a.formattedName(); | 247 | return a.formattedName(); |
251 | case FieldImpl::DefaultFormattedName: | ||
252 | return a.defaultFormattedName(); | ||
253 | case FieldImpl::FamilyName: | 248 | case FieldImpl::FamilyName: |
254 | return a.familyName(); | 249 | return a.familyName(); |
255 | case FieldImpl::GivenName: | 250 | case FieldImpl::GivenName: |
256 | return a.givenName(); | 251 | return a.givenName(); |
257 | case FieldImpl::AdditionalName: | 252 | case FieldImpl::AdditionalName: |
258 | return a.additionalName(); | 253 | return a.additionalName(); |
259 | case FieldImpl::Prefix: | 254 | case FieldImpl::Prefix: |
260 | return a.prefix(); | 255 | return a.prefix(); |
261 | case FieldImpl::Suffix: | 256 | case FieldImpl::Suffix: |
262 | return a.suffix(); | 257 | return a.suffix(); |
263 | case FieldImpl::NickName: | 258 | case FieldImpl::NickName: |
264 | return a.nickName(); | 259 | return a.nickName(); |
265 | case FieldImpl::Mailer: | 260 | case FieldImpl::Mailer: |
266 | return a.mailer(); | 261 | return a.mailer(); |
267 | case FieldImpl::Title: | 262 | case FieldImpl::Title: |
268 | return a.title(); | 263 | return a.title(); |
269 | case FieldImpl::Role: | 264 | case FieldImpl::Role: |
270 | return a.role(); | 265 | return a.role(); |
271 | case FieldImpl::Organization: | 266 | case FieldImpl::Organization: |
272 | return a.organization(); | 267 | return a.organization(); |
273 | case FieldImpl::Note: | 268 | case FieldImpl::Note: |
274 | return a.note(); | 269 | return a.note(); |
275 | case FieldImpl::Email: | 270 | case FieldImpl::Email: |
276 | return a.preferredEmail(); | 271 | return a.preferredEmail(); |
@@ -387,49 +382,48 @@ bool Field::setValue( KABC::Addressee &a, const QString &value ) | |||
387 | // But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? | 382 | // But Qt::IsoDate and QDate::fromString was not specified. Do I have the wrong QT version ? |
388 | { | 383 | { |
389 | QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate | 384 | QDate dt = KGlobal::locale()->readDate( value, "%Y-%m-%d"); // = Qt::ISODate |
390 | a.setBirthday(dt); | 385 | a.setBirthday(dt); |
391 | } | 386 | } |
392 | return true; | 387 | return true; |
393 | case FieldImpl::CustomField: | 388 | case FieldImpl::CustomField: |
394 | a.insertCustom( mImpl->app(), mImpl->key(), value ); | 389 | a.insertCustom( mImpl->app(), mImpl->key(), value ); |
395 | //US never copy the resourcename back to the adressee. | 390 | //US never copy the resourcename back to the adressee. |
396 | case FieldImpl::Resource: | 391 | case FieldImpl::Resource: |
397 | default: | 392 | default: |
398 | return false; | 393 | return false; |
399 | } | 394 | } |
400 | } | 395 | } |
401 | 396 | ||
402 | bool Field::isCustom() | 397 | bool Field::isCustom() |
403 | { | 398 | { |
404 | return mImpl->fieldId() == FieldImpl::CustomField; | 399 | return mImpl->fieldId() == FieldImpl::CustomField; |
405 | } | 400 | } |
406 | 401 | ||
407 | Field::List Field::allFields() | 402 | Field::List Field::allFields() |
408 | { | 403 | { |
409 | if ( mAllFields.isEmpty() ) { | 404 | if ( mAllFields.isEmpty() ) { |
410 | createField( FieldImpl::FormattedName, Frequent ); | 405 | createField( FieldImpl::FormattedName, Frequent ); |
411 | createField( FieldImpl::DefaultFormattedName, Frequent ); | ||
412 | createField( FieldImpl::FamilyName, Frequent ); | 406 | createField( FieldImpl::FamilyName, Frequent ); |
413 | createField( FieldImpl::GivenName, Frequent ); | 407 | createField( FieldImpl::GivenName, Frequent ); |
414 | createField( FieldImpl::AdditionalName ); | 408 | createField( FieldImpl::AdditionalName ); |
415 | createField( FieldImpl::Prefix ); | 409 | createField( FieldImpl::Prefix ); |
416 | createField( FieldImpl::Suffix ); | 410 | createField( FieldImpl::Suffix ); |
417 | createField( FieldImpl::NickName, Personal ); | 411 | createField( FieldImpl::NickName, Personal ); |
418 | createField( FieldImpl::Birthday, Personal ); | 412 | createField( FieldImpl::Birthday, Personal ); |
419 | createField( FieldImpl::Category ); | 413 | createField( FieldImpl::Category ); |
420 | createField( FieldImpl::HomeAddressStreet, Address|Personal ); | 414 | createField( FieldImpl::HomeAddressStreet, Address|Personal ); |
421 | createField( FieldImpl::HomeAddressLocality, Address|Personal ); | 415 | createField( FieldImpl::HomeAddressLocality, Address|Personal ); |
422 | createField( FieldImpl::HomeAddressRegion, Address|Personal ); | 416 | createField( FieldImpl::HomeAddressRegion, Address|Personal ); |
423 | createField( FieldImpl::HomeAddressPostalCode, Address|Personal ); | 417 | createField( FieldImpl::HomeAddressPostalCode, Address|Personal ); |
424 | createField( FieldImpl::HomeAddressCountry, Address|Personal ); | 418 | createField( FieldImpl::HomeAddressCountry, Address|Personal ); |
425 | createField( FieldImpl::HomeAddressLabel, Address|Personal ); | 419 | createField( FieldImpl::HomeAddressLabel, Address|Personal ); |
426 | createField( FieldImpl::BusinessAddressStreet, Address|Organization ); | 420 | createField( FieldImpl::BusinessAddressStreet, Address|Organization ); |
427 | createField( FieldImpl::BusinessAddressLocality, Address|Organization ); | 421 | createField( FieldImpl::BusinessAddressLocality, Address|Organization ); |
428 | createField( FieldImpl::BusinessAddressRegion, Address|Organization ); | 422 | createField( FieldImpl::BusinessAddressRegion, Address|Organization ); |
429 | createField( FieldImpl::BusinessAddressPostalCode, Address|Organization ); | 423 | createField( FieldImpl::BusinessAddressPostalCode, Address|Organization ); |
430 | createField( FieldImpl::BusinessAddressCountry, Address|Organization ); | 424 | createField( FieldImpl::BusinessAddressCountry, Address|Organization ); |
431 | createField( FieldImpl::BusinessAddressLabel, Address|Organization ); | 425 | createField( FieldImpl::BusinessAddressLabel, Address|Organization ); |
432 | createField( FieldImpl::HomePhone, Personal|Frequent ); | 426 | createField( FieldImpl::HomePhone, Personal|Frequent ); |
433 | createField( FieldImpl::BusinessPhone, Organization|Frequent ); | 427 | createField( FieldImpl::BusinessPhone, Organization|Frequent ); |
434 | createField( FieldImpl::MobilePhone, Frequent ); | 428 | createField( FieldImpl::MobilePhone, Frequent ); |
435 | createField( FieldImpl::MobileHomePhone, Frequent ); | 429 | createField( FieldImpl::MobileHomePhone, Frequent ); |
diff --git a/kalarmd/simplealarmdaemonimpl.cpp b/kalarmd/simplealarmdaemonimpl.cpp index b3da428..294ce7d 100644 --- a/kalarmd/simplealarmdaemonimpl.cpp +++ b/kalarmd/simplealarmdaemonimpl.cpp | |||
@@ -35,49 +35,49 @@ | |||
35 | #include <qpushbutton.h> | 35 | #include <qpushbutton.h> |
36 | #include <qlayout.h> | 36 | #include <qlayout.h> |
37 | #include <qlineedit.h> | 37 | #include <qlineedit.h> |
38 | #include <qdialog.h> | 38 | #include <qdialog.h> |
39 | #define protected public | 39 | #define protected public |
40 | #include <qspinbox.h> | 40 | #include <qspinbox.h> |
41 | #undef protected | 41 | #undef protected |
42 | #include <qtextstream.h> | 42 | #include <qtextstream.h> |
43 | #include <qtopia/qcopenvelope_qws.h> | 43 | #include <qtopia/qcopenvelope_qws.h> |
44 | #include <qtopia/alarmserver.h> | 44 | #include <qtopia/alarmserver.h> |
45 | 45 | ||
46 | #include <stdlib.h> | 46 | #include <stdlib.h> |
47 | #include <stdio.h> | 47 | #include <stdio.h> |
48 | #include <unistd.h> | 48 | #include <unistd.h> |
49 | 49 | ||
50 | 50 | ||
51 | SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) | 51 | SimpleAlarmDaemonImpl::SimpleAlarmDaemonImpl( QWidget *parent ) |
52 | : QLabel( parent ) | 52 | : QLabel( parent ) |
53 | { | 53 | { |
54 | mAlarmDialog = new AlarmDialog( 0 ); | 54 | mAlarmDialog = new AlarmDialog( 0 ); |
55 | mPopUp = new QPopupMenu( this ); | 55 | mPopUp = new QPopupMenu( this ); |
56 | mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) ); | 56 | mPopUp->insertItem( "What's Next?", this, SLOT ( showWN() ) ); |
57 | mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) ); | 57 | mPopUp->insertItem( "Next Days!", this, SLOT ( showKO() ) ); |
58 | mPopUp->insertSeparator(); | 58 | mPopUp->insertSeparator(); |
59 | mPopUp->insertItem( "What's Todo?", this, SLOT ( showTodo() ) ); | 59 | mPopUp->insertItem( "Todo List", this, SLOT ( showTodo() ) ); |
60 | mPopUp->insertSeparator(); | 60 | mPopUp->insertSeparator(); |
61 | mPopUp->insertItem( "Addresses", this, SLOT ( showAdd() ) ); | 61 | mPopUp->insertItem( "Addresses", this, SLOT ( showAdd() ) ); |
62 | mPopUp->insertSeparator(); | 62 | mPopUp->insertSeparator(); |
63 | mPopUp->insertItem( "Edit Journal", this, SLOT ( writeJournal() ) ); | 63 | mPopUp->insertItem( "Edit Journal", this, SLOT ( writeJournal() ) ); |
64 | mPopUp->insertItem( "New Event", this, SLOT ( newEvent() ) ); | 64 | mPopUp->insertItem( "New Event", this, SLOT ( newEvent() ) ); |
65 | mPopUp->insertItem( "New Todo", this, SLOT ( newTodo() ) ); | 65 | mPopUp->insertItem( "New Todo", this, SLOT ( newTodo() ) ); |
66 | mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) ); | 66 | mPopUp->insertItem( "New Mail", this, SLOT ( newMail() ) ); |
67 | mPopUp->insertSeparator(); | 67 | mPopUp->insertSeparator(); |
68 | mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) ); | 68 | mPopUp->insertItem( "Multi Sync", this, SLOT ( ringSync() ) ); |
69 | mTimerPopUp = new QPopupMenu( this ); | 69 | mTimerPopUp = new QPopupMenu( this ); |
70 | QFont fon = mTimerPopUp->font(); | 70 | QFont fon = mTimerPopUp->font(); |
71 | fon.setPointSize( fon.pointSize() *3/2 ); | 71 | fon.setPointSize( fon.pointSize() *3/2 ); |
72 | mTimerPopUp->setFont( fon ); | 72 | mTimerPopUp->setFont( fon ); |
73 | mBeepPopUp = new QPopupMenu( this ); | 73 | mBeepPopUp = new QPopupMenu( this ); |
74 | mSoundPopUp = new QPopupMenu( this ); | 74 | mSoundPopUp = new QPopupMenu( this ); |
75 | mPausePopUp = new QPopupMenu( this ); | 75 | mPausePopUp = new QPopupMenu( this ); |
76 | QPopupMenu* savePopUp = new QPopupMenu( this ); | 76 | QPopupMenu* savePopUp = new QPopupMenu( this ); |
77 | savePopUp->insertItem( "Save", 0 ); | 77 | savePopUp->insertItem( "Save", 0 ); |
78 | savePopUp->insertItem( "Load", 1 ); | 78 | savePopUp->insertItem( "Load", 1 ); |
79 | mSoundPopUp->insertItem( "Buzzer", 0 ); | 79 | mSoundPopUp->insertItem( "Buzzer", 0 ); |
80 | mSoundPopUp->insertItem( "Wav file", 1 ); | 80 | mSoundPopUp->insertItem( "Wav file", 1 ); |
81 | mPausePopUp->insertItem( " 1 sec", 1 ); | 81 | mPausePopUp->insertItem( " 1 sec", 1 ); |
82 | mPausePopUp->insertItem( " 2 sec", 2 ); | 82 | mPausePopUp->insertItem( " 2 sec", 2 ); |
83 | mPausePopUp->insertItem( " 3 sec", 3 ); | 83 | mPausePopUp->insertItem( " 3 sec", 3 ); |
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 23afe7a..e545ca8 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -422,64 +422,73 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) | |||
422 | //qDebug("%d %d %d %d ", x, yy, w, h ); | 422 | //qDebug("%d %d %d %d ", x, yy, w, h ); |
423 | if ( mIncidence->cancelled() ){ | 423 | if ( mIncidence->cancelled() ){ |
424 | 424 | ||
425 | 425 | ||
426 | small = ( height() < 20 ); | 426 | small = ( height() < 20 ); |
427 | 427 | ||
428 | if ( ! small ) { | 428 | if ( ! small ) { |
429 | QFontMetrics fm ( paint->font() ); | 429 | QFontMetrics fm ( paint->font() ); |
430 | paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); | 430 | paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); |
431 | } | 431 | } |
432 | 432 | ||
433 | } | 433 | } |
434 | pa.end(); | 434 | pa.end(); |
435 | 435 | ||
436 | } | 436 | } |
437 | void KOAgendaItem::resizePixmap( int w , int h ) | 437 | void KOAgendaItem::resizePixmap( int w , int h ) |
438 | { | 438 | { |
439 | paintPix()->resize( w, h ); | 439 | paintPix()->resize( w, h ); |
440 | paintPixSel()->resize( w, h ); | 440 | paintPixSel()->resize( w, h ); |
441 | 441 | ||
442 | } | 442 | } |
443 | QPixmap * KOAgendaItem::paintPix() | 443 | QPixmap * KOAgendaItem::paintPix() |
444 | { | 444 | { |
445 | static QPixmap* mPaintPix = 0; | 445 | static QPixmap* mPaintPix = 0; |
446 | if ( ! mPaintPix ) | 446 | if ( ! mPaintPix ) { |
447 | mPaintPix = new QPixmap(1,1); | 447 | int w = QApplication::desktop()->width(); |
448 | int h = QApplication::desktop()->height(); | ||
449 | mPaintPix = new QPixmap(w,h); | ||
450 | } | ||
448 | return mPaintPix ; | 451 | return mPaintPix ; |
449 | } | 452 | } |
450 | QPixmap * KOAgendaItem::paintPixAllday() | 453 | QPixmap * KOAgendaItem::paintPixAllday() |
451 | { | 454 | { |
452 | static QPixmap* mPaintPixA = 0; | 455 | static QPixmap* mPaintPixA = 0; |
453 | if ( ! mPaintPixA ) | 456 | if ( ! mPaintPixA ) { |
454 | mPaintPixA = new QPixmap(1,1); | 457 | int w = QApplication::desktop()->width(); |
458 | int h = QApplication::desktop()->height()/3; | ||
459 | mPaintPixA = new QPixmap(w,h); | ||
460 | } | ||
455 | return mPaintPixA ; | 461 | return mPaintPixA ; |
456 | } | 462 | } |
457 | QPixmap * KOAgendaItem::paintPixSel() | 463 | QPixmap * KOAgendaItem::paintPixSel() |
458 | { | 464 | { |
459 | static QPixmap* mPaintPixSel = 0; | 465 | static QPixmap* mPaintPixSel = 0; |
460 | if ( ! mPaintPixSel ) | 466 | if ( ! mPaintPixSel ) { |
461 | mPaintPixSel = new QPixmap(1,1); | 467 | int w = QApplication::desktop()->width(); |
468 | int h = QApplication::desktop()->height(); | ||
469 | mPaintPixSel = new QPixmap(w,h); | ||
470 | } | ||
462 | return mPaintPixSel ; | 471 | return mPaintPixSel ; |
463 | } | 472 | } |
464 | void KOAgendaItem::paintEvent ( QPaintEvent *e ) | 473 | void KOAgendaItem::paintEvent ( QPaintEvent *e ) |
465 | { | 474 | { |
466 | 475 | ||
467 | if ( globalFlagBlockAgendaItemPaint ) | 476 | if ( globalFlagBlockAgendaItemPaint ) |
468 | return; | 477 | return; |
469 | if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) | 478 | if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) |
470 | return; | 479 | return; |
471 | int yy; | 480 | int yy; |
472 | if ( mAllDay ) | 481 | if ( mAllDay ) |
473 | yy = y(); | 482 | yy = y(); |
474 | else | 483 | else |
475 | yy = mCellYTop * ( height() / cellHeight() ); | 484 | yy = mCellYTop * ( height() / cellHeight() ); |
476 | int xx = x(); | 485 | int xx = x(); |
477 | 486 | ||
478 | if ( xPaintCoord != xx || yPaintCoord != yy || | 487 | if ( xPaintCoord != xx || yPaintCoord != yy || |
479 | wPaintCoord != width() || hPaintCoord != height()) { | 488 | wPaintCoord != width() || hPaintCoord != height()) { |
480 | xPaintCoord= xx; | 489 | xPaintCoord= xx; |
481 | yPaintCoord = yy; | 490 | yPaintCoord = yy; |
482 | wPaintCoord = width(); | 491 | wPaintCoord = width(); |
483 | hPaintCoord = height(); | 492 | hPaintCoord = height(); |
484 | globalFlagBlockAgendaItemUpdate = 0; | 493 | globalFlagBlockAgendaItemUpdate = 0; |
485 | paintMe( mSelected ); | 494 | paintMe( mSelected ); |
@@ -504,107 +513,106 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) | |||
504 | } | 513 | } |
505 | xx += rx; | 514 | xx += rx; |
506 | 515 | ||
507 | if ( xx < 0 ) { | 516 | if ( xx < 0 ) { |
508 | rw = rw + xx; | 517 | rw = rw + xx; |
509 | rx -= xx; | 518 | rx -= xx; |
510 | xx = 0; | 519 | xx = 0; |
511 | if ( rw <= 1 ) { | 520 | if ( rw <= 1 ) { |
512 | //qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1()); | 521 | //qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1()); |
513 | return; | 522 | return; |
514 | } | 523 | } |
515 | } | 524 | } |
516 | if ( paintFrom->width() < xx+rw ) { | 525 | if ( paintFrom->width() < xx+rw ) { |
517 | rw = paintFrom->width() - xx; | 526 | rw = paintFrom->width() - xx; |
518 | if ( rw <= 1 ) { | 527 | if ( rw <= 1 ) { |
519 | //qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); | 528 | //qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); |
520 | return; | 529 | return; |
521 | } | 530 | } |
522 | } | 531 | } |
523 | //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); | 532 | //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); |
524 | bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); | 533 | bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); |
525 | } | 534 | } |
526 | void KOAgendaItem::computeText() | 535 | void KOAgendaItem::computeText() |
527 | { | 536 | { |
528 | |||
529 | mDisplayedText = mIncidence->summary(); | 537 | mDisplayedText = mIncidence->summary(); |
530 | if ( (mIncidence->type() == "Todo") ) { | 538 | if ( (mIncidence->type() == "Todo") ) { |
531 | if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { | 539 | if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { |
532 | if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) | 540 | if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) |
533 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; | 541 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; |
534 | else if ( !(mIncidence->doesFloat())) | 542 | else if ( !(mIncidence->doesFloat())) |
535 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; | 543 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; |
536 | } | 544 | } |
537 | } else { | 545 | } else { |
538 | if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) | 546 | if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) |
539 | mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; | 547 | mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + " - " + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; |
540 | 548 | ||
541 | if ( mAllDay ) { | 549 | if ( mAllDay ) { |
542 | if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { | 550 | if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { |
543 | mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; | 551 | mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; |
544 | } | 552 | } |
545 | } | 553 | } |
546 | 554 | ||
547 | } | 555 | } |
548 | 556 | ||
549 | if ( !mIncidence->location().isEmpty() ) { | 557 | if ( !mIncidence->location().isEmpty() ) { |
550 | if ( mAllDay ) | 558 | if ( mAllDay ) |
551 | mDisplayedText += " ("; | 559 | mDisplayedText += " ("; |
552 | else | 560 | else |
553 | mDisplayedText += "\n("; | 561 | mDisplayedText += "\n("; |
554 | mDisplayedText += mIncidence->location() +")"; | 562 | mDisplayedText += mIncidence->location() +")"; |
555 | } | 563 | } |
556 | 564 | #ifdef DESKTOP_VERSION | |
557 | QString tipText = mIncidence->summary(); | 565 | QString tipText = mIncidence->summary(); |
558 | if ( !mIncidence->doesFloat() ) { | 566 | if ( !mIncidence->doesFloat() ) { |
559 | if ( mIncidence->type() == "Event" ) { | 567 | if ( mIncidence->type() == "Event" ) { |
560 | if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) { | 568 | if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) { |
561 | tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr(); | 569 | tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr(); |
562 | tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr(); | 570 | tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr(); |
563 | } | 571 | } |
564 | else { | 572 | else { |
565 | tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr(); | 573 | tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr(); |
566 | tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr(); | 574 | tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr(); |
567 | } | 575 | } |
568 | } | 576 | } |
569 | else if ( mIncidence->type() == "Todo" ) { | 577 | else if ( mIncidence->type() == "Todo" ) { |
570 | if (mIncidence->hasStartDate()) | 578 | if (mIncidence->hasStartDate()) |
571 | tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartStr(); | 579 | tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartStr(); |
572 | if (((Todo*)mIncidence)->hasDueDate()) | 580 | if (((Todo*)mIncidence)->hasDueDate()) |
573 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueStr(); | 581 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueStr(); |
574 | } | 582 | } |
575 | } else if ( mIncidence->type() == "Todo" ) { | 583 | } else if ( mIncidence->type() == "Todo" ) { |
576 | if (mIncidence->hasStartDate()) | 584 | if (mIncidence->hasStartDate()) |
577 | tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartDateStr(); | 585 | tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartDateStr(); |
578 | if (((Todo*)mIncidence)->hasDueDate()) | 586 | if (((Todo*)mIncidence)->hasDueDate()) |
579 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr(); | 587 | tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr(); |
580 | } | 588 | } |
581 | 589 | ||
582 | if (!mIncidence->location().isEmpty()) { | 590 | if (!mIncidence->location().isEmpty()) { |
583 | tipText += "\n"+i18n("Location: ")+mIncidence->location(); | 591 | tipText += "\n"+i18n("Location: ")+mIncidence->location(); |
584 | } | 592 | } |
585 | QToolTip::add(this,tipText,toolTipGroup(),""); | 593 | QToolTip::add(this,tipText,toolTipGroup(),""); |
586 | 594 | #endif | |
587 | } | 595 | } |
588 | void KOAgendaItem::updateItem() | 596 | void KOAgendaItem::updateItem() |
589 | { | 597 | { |
590 | computeText(); | 598 | computeText(); |
591 | 599 | ||
592 | //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y()); | 600 | //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y()); |
593 | paintMe( mSelected ); | 601 | paintMe( mSelected ); |
594 | repaint( false); | 602 | repaint( false); |
595 | } | 603 | } |
596 | 604 | ||
597 | void KOAgendaItem::resizeEvent ( QResizeEvent *ev ) | 605 | void KOAgendaItem::resizeEvent ( QResizeEvent *ev ) |
598 | { | 606 | { |
599 | //qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1()); | 607 | //qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1()); |
600 | paintMe( mSelected ); | 608 | paintMe( mSelected ); |
601 | repaint( false ); | 609 | repaint( false ); |
602 | } | 610 | } |
603 | 611 | ||
604 | /* | 612 | /* |
605 | Return height of item in units of agenda cells | 613 | Return height of item in units of agenda cells |
606 | */ | 614 | */ |
607 | int KOAgendaItem::cellHeight() | 615 | int KOAgendaItem::cellHeight() |
608 | { | 616 | { |
609 | int ret = mCellYBottom - mCellYTop + 1; | 617 | int ret = mCellYBottom - mCellYTop + 1; |
610 | if ( ret <= 0 ) { | 618 | if ( ret <= 0 ) { |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 4dfb9df..65d6acf 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -620,106 +620,116 @@ void MonthViewCell::startUpdateCell() | |||
620 | while ( CurrentAvailItem ) { | 620 | while ( CurrentAvailItem ) { |
621 | MonthViewItem *item = CurrentAvailItem; | 621 | MonthViewItem *item = CurrentAvailItem; |
622 | CurrentAvailItem = (MonthViewItem *)item->next(); | 622 | CurrentAvailItem = (MonthViewItem *)item->next(); |
623 | mAvailItemList.append( item ); | 623 | mAvailItemList.append( item ); |
624 | takeItem ( item ); | 624 | takeItem ( item ); |
625 | } | 625 | } |
626 | 626 | ||
627 | #ifdef DESKTOP_VERSION | 627 | #ifdef DESKTOP_VERSION |
628 | QToolTip::remove(this); | 628 | QToolTip::remove(this); |
629 | #endif | 629 | #endif |
630 | mToolTip.clear(); | 630 | mToolTip.clear(); |
631 | //qApp->processEvents(); | 631 | //qApp->processEvents(); |
632 | #if 0 | 632 | #if 0 |
633 | if ( !mHolidayString.isEmpty() ) { | 633 | if ( !mHolidayString.isEmpty() ) { |
634 | MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); | 634 | MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); |
635 | item->setPalette( mHolidayPalette ); | 635 | item->setPalette( mHolidayPalette ); |
636 | insertItem( item ); | 636 | insertItem( item ); |
637 | mToolTip.append ( mHolidayString ); | 637 | mToolTip.append ( mHolidayString ); |
638 | } | 638 | } |
639 | #endif | 639 | #endif |
640 | } | 640 | } |
641 | 641 | ||
642 | int MonthViewCell::insertEvent(Event *event) | 642 | int MonthViewCell::insertEvent(Event *event) |
643 | { | 643 | { |
644 | bool useToolTips = true; | ||
645 | #ifndef DEKSTOP_VERSION | ||
646 | useToolTips = false; | ||
647 | #endif | ||
644 | QString mToolTipText; | 648 | QString mToolTipText; |
645 | setFocusPolicy(WheelFocus); | 649 | setFocusPolicy(WheelFocus); |
646 | if ( !(event->doesRecur() == Recurrence::rNone) ) { | 650 | if ( !(event->doesRecur() == Recurrence::rNone) ) { |
647 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) | 651 | if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) |
648 | return mdayCount; | 652 | return mdayCount; |
649 | else | 653 | else |
650 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) | 654 | if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) |
651 | return mdayCount; | 655 | return mdayCount; |
652 | } | 656 | } |
653 | 657 | ||
654 | if ( event->isHoliday()) { | 658 | if ( event->isHoliday()) { |
655 | setHoliday( true ); | 659 | setHoliday( true ); |
656 | if ( mDate.dayOfWeek() == 7 ) | 660 | if ( mDate.dayOfWeek() == 7 ) |
657 | setLineWidth( 3 ); | 661 | setLineWidth( 3 ); |
658 | } | 662 | } |
659 | QString text; | 663 | QString text; |
660 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day | 664 | int multiday = 0;// 1 = start, 2 = midddle, 3 = end day |
661 | if (event->isMultiDay()) { | 665 | if (event->isMultiDay()) { |
662 | QString prefix = "<->";multiday = 2; | 666 | QString prefix = "<->";multiday = 2; |
663 | QString time; | 667 | QString time; |
664 | if ( event->doesRecur() ) { | 668 | if ( event->doesRecur() ) { |
665 | if ( event->recursOn( mDate) ) { | 669 | if ( event->recursOn( mDate) ) { |
666 | prefix ="->" ;multiday = 1; | 670 | prefix ="->" ;multiday = 1; |
667 | } | 671 | } |
668 | else { | 672 | else { |
669 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); | 673 | int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); |
670 | if ( event->recursOn( mDate.addDays( -days)) ) { | 674 | if ( event->recursOn( mDate.addDays( -days)) ) { |
671 | prefix ="<-" ;multiday = 3; | 675 | prefix ="<-" ;multiday = 3; |
672 | } | 676 | } |
673 | } | 677 | } |
674 | 678 | ||
675 | } else { | 679 | } else { |
676 | if (mDate == event->dtStart().date()) { | 680 | if (mDate == event->dtStart().date()) { |
677 | prefix ="->" ;multiday = 1; | 681 | prefix ="->" ;multiday = 1; |
678 | } else if (mDate == event->dtEnd().date()) { | 682 | } else if (mDate == event->dtEnd().date()) { |
679 | prefix ="<-" ;multiday = 3; | 683 | prefix ="<-" ;multiday = 3; |
680 | } | 684 | } |
681 | } | 685 | } |
682 | if ( !event->doesFloat() ) { | 686 | if ( !event->doesFloat() ) { |
683 | if ( mDate == event->dtStart().date () ) | 687 | if ( mDate == event->dtStart().date () ) |
684 | time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; | 688 | time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; |
685 | else if ( mDate == event->dtEnd().date () ) | 689 | else if ( mDate == event->dtEnd().date () ) |
686 | time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; | 690 | time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; |
687 | 691 | ||
688 | } | 692 | } |
689 | text = time + event->summary(); | 693 | text = time + event->summary(); |
690 | mToolTipText += prefix + text; | 694 | if ( useToolTips ) |
695 | mToolTipText += prefix + text; | ||
691 | } else { | 696 | } else { |
692 | if (event->doesFloat()) { | 697 | if (event->doesFloat()) { |
693 | text = event->summary(); | 698 | text = event->summary(); |
694 | mToolTipText += text; | 699 | if ( useToolTips ) |
700 | mToolTipText += text; | ||
695 | } | 701 | } |
696 | else { | 702 | else { |
697 | text = KGlobal::locale()->formatTime(event->dtStart().time()); | 703 | text = KGlobal::locale()->formatTime(event->dtStart().time()); |
698 | text += " " + event->summary(); | 704 | text += " " + event->summary(); |
699 | mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); | 705 | if ( useToolTips ) |
706 | mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); | ||
700 | } | 707 | } |
701 | } | 708 | } |
709 | if ( useToolTips && ! event->location().isEmpty() ) { | ||
710 | mToolTipText += " (" + event->location() +")"; | ||
711 | } | ||
702 | MonthViewItem *item ; | 712 | MonthViewItem *item ; |
703 | 713 | ||
704 | if ( mAvailItemList.count() ) { | 714 | if ( mAvailItemList.count() ) { |
705 | item = mAvailItemList.first(); | 715 | item = mAvailItemList.first(); |
706 | mAvailItemList.remove( item ); | 716 | mAvailItemList.remove( item ); |
707 | item->recycle( event, mDate, text ); | 717 | item->recycle( event, mDate, text ); |
708 | } else { | 718 | } else { |
709 | item = new MonthViewItem( event, mDate, text ); | 719 | item = new MonthViewItem( event, mDate, text ); |
710 | } | 720 | } |
711 | 721 | ||
712 | QPalette pal; | 722 | QPalette pal; |
713 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { | 723 | if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { |
714 | QStringList categories = event->categories(); | 724 | QStringList categories = event->categories(); |
715 | QString cat = categories.first(); | 725 | QString cat = categories.first(); |
716 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 726 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
717 | pal = getPalette(); | 727 | pal = getPalette(); |
718 | if (cat.isEmpty()) { | 728 | if (cat.isEmpty()) { |
719 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 729 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
720 | } else { | 730 | } else { |
721 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 731 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
722 | } | 732 | } |
723 | 733 | ||
724 | } else { | 734 | } else { |
725 | if (cat.isEmpty()) { | 735 | if (cat.isEmpty()) { |
@@ -743,49 +753,50 @@ int MonthViewCell::insertEvent(Event *event) | |||
743 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) | 753 | if ( me->status() == Attendee::NeedsAction && me->RSVP()) |
744 | item->setReply(true && multiday < 2); | 754 | item->setReply(true && multiday < 2); |
745 | else | 755 | else |
746 | item->setReply(false); | 756 | item->setReply(false); |
747 | } else | 757 | } else |
748 | item->setReply(false); | 758 | item->setReply(false); |
749 | #endif | 759 | #endif |
750 | item->setMultiDay( multiday ); | 760 | item->setMultiDay( multiday ); |
751 | if ( multiday ) { | 761 | if ( multiday ) { |
752 | insertItem( item ,mdayCount); | 762 | insertItem( item ,mdayCount); |
753 | ++mdayCount; | 763 | ++mdayCount; |
754 | } else { | 764 | } else { |
755 | uint i; | 765 | uint i; |
756 | int pos = mdayCount; | 766 | int pos = mdayCount; |
757 | for ( i = mdayCount; i < count();++i ) { | 767 | for ( i = mdayCount; i < count();++i ) { |
758 | QListBoxItem* it = this->item ( i ); | 768 | QListBoxItem* it = this->item ( i ); |
759 | if ( text < it->text() ) { | 769 | if ( text < it->text() ) { |
760 | pos = i; | 770 | pos = i; |
761 | break; | 771 | break; |
762 | } | 772 | } |
763 | ++pos; | 773 | ++pos; |
764 | } | 774 | } |
765 | insertItem( item ,pos); | 775 | insertItem( item ,pos); |
766 | } | 776 | } |
767 | mToolTip.append( mToolTipText ); | 777 | if ( useToolTips ) |
778 | mToolTip.append( mToolTipText ); | ||
768 | return mdayCount; | 779 | return mdayCount; |
769 | } | 780 | } |
770 | void MonthViewCell::insertTodo(Todo *todo) | 781 | void MonthViewCell::insertTodo(Todo *todo) |
771 | { | 782 | { |
772 | setFocusPolicy(WheelFocus); | 783 | setFocusPolicy(WheelFocus); |
773 | QString text; | 784 | QString text; |
774 | if (todo->hasDueDate()) { | 785 | if (todo->hasDueDate()) { |
775 | if (!todo->doesFloat()) { | 786 | if (!todo->doesFloat()) { |
776 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); | 787 | text += KGlobal::locale()->formatTime(todo->dtDue().time()); |
777 | text += " "; | 788 | text += " "; |
778 | } | 789 | } |
779 | } | 790 | } |
780 | text += todo->summary(); | 791 | text += todo->summary(); |
781 | MonthViewItem *item ; | 792 | MonthViewItem *item ; |
782 | if ( mAvailItemList.count() ) { | 793 | if ( mAvailItemList.count() ) { |
783 | item = mAvailItemList.first(); | 794 | item = mAvailItemList.first(); |
784 | mAvailItemList.remove( item ); | 795 | mAvailItemList.remove( item ); |
785 | item->recycle( todo, mDate, text ); | 796 | item->recycle( todo, mDate, text ); |
786 | } else { | 797 | } else { |
787 | item = new MonthViewItem( todo, mDate, text ); | 798 | item = new MonthViewItem( todo, mDate, text ); |
788 | } | 799 | } |
789 | //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); | 800 | //MonthViewItem *item = new MonthViewItem( todo, mDate, text ); |
790 | //item->setPalette( mStandardPalette ); | 801 | //item->setPalette( mStandardPalette ); |
791 | QPalette pal; | 802 | QPalette pal; |
@@ -795,49 +806,51 @@ void MonthViewCell::insertTodo(Todo *todo) | |||
795 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { | 806 | if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { |
796 | pal = getPalette(); | 807 | pal = getPalette(); |
797 | if (cat.isEmpty()) { | 808 | if (cat.isEmpty()) { |
798 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); | 809 | pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); |
799 | } else { | 810 | } else { |
800 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); | 811 | pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); |
801 | } | 812 | } |
802 | 813 | ||
803 | } else { | 814 | } else { |
804 | if (cat.isEmpty()) { | 815 | if (cat.isEmpty()) { |
805 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); | 816 | pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); |
806 | } else { | 817 | } else { |
807 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); | 818 | pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); |
808 | } | 819 | } |
809 | } | 820 | } |
810 | 821 | ||
811 | } else { | 822 | } else { |
812 | pal = mStandardPalette ; | 823 | pal = mStandardPalette ; |
813 | } | 824 | } |
814 | item->setPalette( pal ); | 825 | item->setPalette( pal ); |
815 | item->setRecur( todo->recurrence()->doesRecur() ); | 826 | item->setRecur( todo->recurrence()->doesRecur() ); |
816 | item->setAlarm( todo->isAlarmEnabled() ); | 827 | item->setAlarm( todo->isAlarmEnabled() ); |
817 | item->setMoreInfo( todo->description().length() > 0 ); | 828 | item->setMoreInfo( todo->description().length() > 0 ); |
818 | insertItem( item , count()); | 829 | insertItem( item , count()); |
830 | #ifdef DESKTOP_VERSION | ||
819 | mToolTip.append( text ); | 831 | mToolTip.append( text ); |
832 | #endif | ||
820 | } | 833 | } |
821 | void MonthViewCell::repaintfinishUpdateCell() | 834 | void MonthViewCell::repaintfinishUpdateCell() |
822 | { | 835 | { |
823 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); | 836 | MonthViewItem *mitem = (MonthViewItem*) firstItem (); |
824 | while ( mitem ) { | 837 | while ( mitem ) { |
825 | mitem->setBlockRepaint( false ); | 838 | mitem->setBlockRepaint( false ); |
826 | updateItem ( mitem ); | 839 | updateItem ( mitem ); |
827 | mitem = (MonthViewItem *)mitem->next(); | 840 | mitem = (MonthViewItem *)mitem->next(); |
828 | } | 841 | } |
829 | } | 842 | } |
830 | void MonthViewCell::finishUpdateCell() | 843 | void MonthViewCell::finishUpdateCell() |
831 | { | 844 | { |
832 | 845 | ||
833 | 846 | ||
834 | 847 | ||
835 | #ifdef DESKTOP_VERSION | 848 | #ifdef DESKTOP_VERSION |
836 | if (mToolTip.count() > 0 ) { | 849 | if (mToolTip.count() > 0 ) { |
837 | mToolTip.sort(); | 850 | mToolTip.sort(); |
838 | QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); | 851 | QToolTip::add(this,mToolTip.join("\n"),toolTipGroup(),""); |
839 | } | 852 | } |
840 | #endif | 853 | #endif |
841 | //sort(); | 854 | //sort(); |
842 | //setMyPalette(); | 855 | //setMyPalette(); |
843 | setMyPalette(); | 856 | setMyPalette(); |