41 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
41 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
42 number, |
42 number, |
43 QContactPhoneNumber::FieldNumber, |
43 QContactPhoneNumber::FieldNumber, |
44 phoneNumberEditorView ); |
44 phoneNumberEditorView ); |
45 detailItem->addText( hbTrId("txt_phob_list_add_phone_number") ); |
45 detailItem->addText( hbTrId("txt_phob_list_add_phone_number") ); |
46 detailItem->addIcon( HbIcon(mMap->getMappedIcon(QContactPhoneNumber::DefinitionName)) ); |
46 detailItem->addIcon( HbIcon(mMap->getContactEditorIconString(QContactPhoneNumber::DefinitionName, "")) ); |
47 list.append( detailItem ); |
47 list.append( detailItem ); |
48 } |
48 } |
49 // existing phonenumber(s) |
49 // existing phonenumber(s) |
50 else |
50 else |
51 { |
51 { |
59 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
59 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
60 number, |
60 number, |
61 QContactPhoneNumber::FieldNumber, |
61 QContactPhoneNumber::FieldNumber, |
62 phoneNumberEditorView); |
62 phoneNumberEditorView); |
63 |
63 |
64 detailItem->addIcon( mMap->getMappedIcon(subtype) ); |
64 detailItem->addIcon( mMap->getContactEditorIconString(subtype, context) ); |
65 detailItem->addText( mMap->getLocString(subtype, context) ); |
65 detailItem->addText( mMap->getContactEditorLocString(subtype, context) ); |
66 detailItem->addText( number.number() ); |
66 detailItem->addText( number.number() ); |
67 list.append( detailItem ); |
67 list.append( detailItem ); |
68 } |
68 } |
69 } |
69 } |
70 } |
70 } |
82 |
82 |
83 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
83 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
84 number, |
84 number, |
85 QContactOnlineAccount::FieldAccountUri, |
85 QContactOnlineAccount::FieldAccountUri, |
86 phoneNumberEditorView); |
86 phoneNumberEditorView); |
87 detailItem->addIcon( mMap->getMappedIcon(subtype) ); |
87 detailItem->addIcon( mMap->getContactEditorIconString(subtype, context) ); |
88 |
88 |
89 if ( subtype == QContactOnlineAccount::SubTypeSip ) |
89 if ( subtype == QContactOnlineAccount::SubTypeSip ) |
90 { |
90 { |
91 detailItem->addText( hbTrId("txt_phob_formlabel_val_sip") ); |
91 detailItem->addText( hbTrId("txt_phob_formlabel_val_sip") ); |
|
92 detailItem->addText( number.accountUri() ); |
|
93 list.append( detailItem ); |
92 } |
94 } |
93 else |
95 else if ( subtype == QContactOnlineAccount::SubTypeSipVoip ) |
94 { |
96 { |
95 if ( context == QContactOnlineAccount::ContextHome ) |
97 if ( context == QContactOnlineAccount::ContextHome ) |
96 detailItem->addText( hbTrId("txt_phob_dblist_internet_telephone_home") ); |
98 detailItem->addText( hbTrId("txt_phob_dblist_internet_telephone_home") ); |
97 else if ( context == QContactOnlineAccount::ContextWork ) |
99 else if ( context == QContactOnlineAccount::ContextWork ) |
98 detailItem->addText( hbTrId("txt_phob_dblist_internet_telephone_work") ); |
100 detailItem->addText( hbTrId("txt_phob_dblist_internet_telephone_work") ); |
99 else |
101 else |
100 detailItem->addText( hbTrId("txt_phob_dblist_internet_telephone") ); |
102 detailItem->addText( hbTrId("txt_phob_dblist_internet_telephone") ); |
|
103 |
|
104 detailItem->addText( number.accountUri() ); |
|
105 list.append( detailItem ); |
101 } |
106 } |
102 detailItem->addText( number.accountUri() ); |
107 else |
103 list.append( detailItem ); |
108 { |
|
109 /* Other subtypes of QContactOnlineAccount are not supported by UI */ |
|
110 } |
104 } |
111 } |
105 } |
112 } |
106 } |
113 } |
107 |
114 |
108 return list; |
115 return list; |
119 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
126 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
120 email, |
127 email, |
121 QContactEmailAddress::FieldEmailAddress, |
128 QContactEmailAddress::FieldEmailAddress, |
122 emailEditorView); |
129 emailEditorView); |
123 detailItem->addText( hbTrId("txt_phob_list_add_email_address") ); |
130 detailItem->addText( hbTrId("txt_phob_list_add_email_address") ); |
124 detailItem->addIcon( HbIcon(mMap->getMappedIcon(QContactEmailAddress::DefinitionName)) ); |
131 detailItem->addIcon( HbIcon(mMap->getContactEditorIconString(QContactEmailAddress::DefinitionName, "")) ); |
125 list.append( detailItem ); |
132 list.append( detailItem ); |
126 } |
133 } |
127 // existing email(s) |
134 // existing email(s) |
128 else |
135 else |
129 { |
136 { |
133 |
140 |
134 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
141 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
135 address, |
142 address, |
136 QContactEmailAddress::FieldEmailAddress, |
143 QContactEmailAddress::FieldEmailAddress, |
137 emailEditorView); |
144 emailEditorView); |
138 detailItem->addIcon( mMap->getMappedIcon(QContactEmailAddress::DefinitionName) ); |
145 detailItem->addIcon( mMap->getContactEditorIconString(QContactEmailAddress::DefinitionName, context) ); |
139 |
146 |
140 if ( context == QContactEmailAddress::ContextHome ) |
147 if ( context == QContactEmailAddress::ContextHome ) |
141 detailItem->addText(hbTrId("txt_phob_formlabel_email_home")); |
148 detailItem->addText(hbTrId("txt_phob_formlabel_email_home")); |
142 else if ( context == QContactEmailAddress::ContextWork ) |
149 else if ( context == QContactEmailAddress::ContextWork ) |
143 detailItem->addText(hbTrId("txt_phob_formlabel_email_work")); |
150 detailItem->addText(hbTrId("txt_phob_formlabel_email_work")); |
185 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
192 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
186 url, |
193 url, |
187 QContactUrl::FieldUrl, |
194 QContactUrl::FieldUrl, |
188 urlEditorView ); |
195 urlEditorView ); |
189 detailItem->addText( hbTrId("txt_phob_list_add_url_address") ); |
196 detailItem->addText( hbTrId("txt_phob_list_add_url_address") ); |
190 detailItem->addIcon( HbIcon(mMap->getMappedIcon(QContactUrl::DefinitionName)) ); |
197 detailItem->addIcon( HbIcon(mMap->getContactEditorIconString(QContactUrl::DefinitionName, "")) ); |
191 list.append( detailItem ); |
198 list.append( detailItem ); |
192 } |
199 } |
193 // existing url(s) |
200 // existing url(s) |
194 else |
201 else |
195 { |
202 { |
199 |
206 |
200 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
207 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
201 url, |
208 url, |
202 QContactUrl::FieldUrl, |
209 QContactUrl::FieldUrl, |
203 urlEditorView ); |
210 urlEditorView ); |
204 detailItem->addIcon( mMap->getMappedIcon(QContactUrl::DefinitionName) ); |
211 detailItem->addIcon( mMap->getContactEditorIconString(QContactUrl::DefinitionName, context) ); |
205 |
212 |
206 if ( context == QContactUrl::ContextHome ) |
213 if ( context == QContactUrl::ContextHome ) |
207 detailItem->addText( hbTrId("txt_phob_dblist_url_home") ); |
214 detailItem->addText( hbTrId("txt_phob_formlabel_address_home") ); |
208 else if ( context == QContactUrl::ContextWork ) |
215 else if ( context == QContactUrl::ContextWork ) |
209 detailItem->addText( hbTrId("txt_phob_dblist_url_work") ); |
216 detailItem->addText( hbTrId("txt_phob_formlabel_address_work") ); |
210 else |
217 else |
211 detailItem->addText( hbTrId("txt_phob_list_url") ); |
218 detailItem->addText( hbTrId("txt_phob_list_url") ); |
212 |
219 |
213 detailItem->addText( url.url() ); |
220 detailItem->addText( url.url() ); |
214 list.append( detailItem ); |
221 list.append( detailItem ); |
234 } |
241 } |
235 |
242 |
236 QString address = valueList.join(" ").trimmed(); |
243 QString address = valueList.join(" ").trimmed(); |
237 if ( !address.isEmpty() ) |
244 if ( !address.isEmpty() ) |
238 { |
245 { |
239 QString context = addr.contexts().isEmpty() ? "" : mMap->getMappedDetail(addr.contexts().first() ); |
246 QString context = addr.contexts().isEmpty() ? "" : addr.contexts().first(); |
240 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
247 CntEditViewDetailItem* detailItem = new CntEditViewDetailItem( |
241 addr, |
248 addr, |
242 fieldList, |
249 fieldList, |
243 addressEditorView); |
250 addressEditorView); |
244 |
251 |
245 if ( context == QContactAddress::ContextHome ) |
252 if ( context == QContactAddress::ContextHome ) |
246 detailItem->addText(hbTrId("txt_phob_dblist_url_home")); |
253 detailItem->addText(hbTrId("txt_phob_formlabel_address_home")); |
247 else if ( context == QContactAddress::ContextWork ) |
254 else if ( context == QContactAddress::ContextWork ) |
248 detailItem->addText(hbTrId("txt_phob_dblist_url_work")); |
255 detailItem->addText(hbTrId("txt_phob_formlabel_address_work")); |
249 else |
256 else |
250 detailItem->addText(hbTrId("txt_phob_list_address")); |
257 detailItem->addText(hbTrId("txt_phob_list_address")); |
251 |
258 |
252 detailItem->addText( address ); |
259 detailItem->addText( address ); |
253 list.append( detailItem ); |
260 list.append( detailItem ); |
406 { |
413 { |
407 org.setTitle( QString() ); |
414 org.setTitle( QString() ); |
408 org.setName( QString() ); |
415 org.setName( QString() ); |
409 org.setDepartment( QStringList() ); |
416 org.setDepartment( QStringList() ); |
410 } |
417 } |
|
418 aContact.saveDetail(&org); |
411 |
419 |
412 if ( org.assistantName().isEmpty() && |
420 if ( org.assistantName().isEmpty() && |
413 org.title().isEmpty() && |
421 org.title().isEmpty() && |
414 org.name().isEmpty() && |
422 org.name().isEmpty() && |
415 org.department().isEmpty() ) |
423 org.department().isEmpty() ) |
|
424 { |
416 aContact.removeDetail(&org); |
425 aContact.removeDetail(&org); |
417 else |
426 } |
418 aContact.saveDetail(&org); |
|
419 } |
427 } |
420 |
428 |
421 else if ( aDetail.definitionName() == QContactFamily::DefinitionName ) |
429 else if ( aDetail.definitionName() == QContactFamily::DefinitionName ) |
422 { |
430 { |
423 QContactFamily family = aContact.detail<QContactFamily>(); |
431 QContactFamily family = aContact.detail<QContactFamily>(); |
428 else |
436 else |
429 { |
437 { |
430 family.setChildren( QStringList() ); |
438 family.setChildren( QStringList() ); |
431 } |
439 } |
432 |
440 |
|
441 aContact.saveDetail( &family ); |
|
442 |
433 if ( family.spouse().isEmpty() && family.children().isEmpty() ) |
443 if ( family.spouse().isEmpty() && family.children().isEmpty() ) |
|
444 { |
434 aContact.removeDetail( &family ); |
445 aContact.removeDetail( &family ); |
435 else |
446 } |
436 aContact.saveDetail( &family ); |
|
437 } |
447 } |
438 else |
448 else |
439 { |
449 { |
440 aContact.removeDetail( &aDetail ); |
450 aContact.removeDetail( &aDetail ); |
441 } |
451 } |