author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 06 Jul 2010 14:12:40 +0300 | |
changeset 44 | 36f374c67aa8 |
parent 34 | 84197e66a4bd |
child 47 | 5b14749788d7 |
child 52 | 12db4185673b |
permissions | -rw-r--r-- |
31 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// INCLUDES |
|
19 |
#include <QTimer> |
|
20 |
#include <HbTextItem> |
|
21 |
#include <HbPushButton> |
|
22 |
#include <HbAction> |
|
23 |
#include <hbmessagebox.h> |
|
24 |
#include <cntservicescontact.h> |
|
25 |
#include <xqaiwrequest.h> |
|
26 |
#include <xqappmgr.h> |
|
27 |
#include <telconfigcrkeys.h> // KCRUidTelephonyConfiguration |
|
28 |
#include <centralrepository.h> |
|
29 |
#include <HbNotificationDialog> |
|
30 |
#include <commonphoneparser.h> // Common phone number validity checker |
|
31 |
#include <xqconversions.h> |
|
32 |
||
33 |
// USER INCLUDES |
|
34 |
#include "debugtraces.h" |
|
35 |
#include "msgunieditoraddress.h" |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
36 |
#include "msgunieditorlineedit.h" |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
37 |
#include "msgunieditormonitor.h" |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
38 |
#include "UniEditorGenUtils.h" |
31 | 39 |
|
40 |
const QString PBK_ICON("qtg_mono_contacts"); |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
41 |
const QString REPLACEMENT_STR("; "); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
42 |
const QString COMMA_SEPERATOR(","); |
31 | 43 |
|
44 |
// Constants |
|
45 |
const int KDefaultGsmNumberMatchLength = 7; //matching unique ph numbers |
|
46 |
#define LOC_SMS_RECIPIENT_LIMIT_REACHED hbTrId("txt_messaging_dialog_number_of_recipients_exceeded") |
|
47 |
#define LOC_MMS_RECIPIENT_LIMIT_REACHED hbTrId("txt_messaging_dpopinfo_unable_to_add_more_recipien") |
|
48 |
#define LOC_DIALOG_OK hbTrId("txt_common_button_ok") |
|
49 |
#define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel") |
|
50 |
#define LOC_INVALID_RECIPIENT hbTrId("txt_messaging_dialog_invalid_recipient_found") |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
51 |
#define LOC_INVALID_RECIPIENT_NOT_ADDED hbTrId("txt_messaging_dialog_invalid_recipient_not_added") |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
52 |
#define LOC_INVALID_RECIPIENTS_NOT_ADDED hbTrId("txt_messaging_dialog_invalid_recipients_not_added") |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
53 |
|
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
54 |
|
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
55 |
|
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
56 |
|
31 | 57 |
|
58 |
MsgUnifiedEditorAddress::MsgUnifiedEditorAddress( const QString& label, |
|
59 |
QGraphicsItem *parent ) : |
|
60 |
MsgUnifiedEditorBaseWidget(parent), |
|
61 |
mSkipMaxRecipientQuery(false), |
|
62 |
mAboutToExceedMaxSmsRecipients(false), |
|
63 |
mAboutToExceedMaxMmsRecipients(false), |
|
64 |
mExceedsMaxMmsRecipientsBy(0) |
|
65 |
{ |
|
66 |
this->setContentsMargins(0,0,0,0); |
|
67 |
||
68 |
mLaunchBtn = new HbPushButton(this); |
|
69 |
HbStyle::setItemName(mLaunchBtn,"launchBtn"); |
|
70 |
connect(mLaunchBtn,SIGNAL(clicked()),this,SLOT(fetchContacts())); |
|
71 |
||
72 |
mLaunchBtn->setIcon(HbIcon(PBK_ICON)); |
|
73 |
||
74 |
mAddressEdit = new MsgUnifiedEditorLineEdit(label,this); |
|
75 |
HbStyle::setItemName(mAddressEdit,"addressField"); |
|
76 |
||
77 |
mAddressEdit->setMaxRows(40); |
|
78 |
connect(mAddressEdit, SIGNAL(contentsChanged(const QString&)), |
|
79 |
this, SLOT(onContentsChanged(const QString&))); |
|
80 |
||
81 |
mAddressEdit->setInputMethodHints(Qt::ImhPreferNumbers); |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
82 |
} |
31 | 83 |
|
84 |
MsgUnifiedEditorAddress::~MsgUnifiedEditorAddress() |
|
85 |
{ |
|
86 |
//TODO: Should remove this code depending on orbit's reply whether it is needed |
|
87 |
//to unregister the same plugin registered on two different widgets twice. |
|
88 |
//style()->unregisterPlugin(mPluginPath); |
|
89 |
} |
|
90 |
||
91 |
void MsgUnifiedEditorAddress::fetchContacts() |
|
92 |
{ |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
93 |
mLaunchBtn->blockSignals(true); |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
94 |
|
31 | 95 |
QList<QVariant> args; |
96 |
QString serviceName("com.nokia.services.phonebookservices"); |
|
97 |
QString operation("fetch(QString,QString,QString)"); |
|
98 |
XQAiwRequest* request; |
|
99 |
XQApplicationManager appManager; |
|
100 |
request = appManager.create(serviceName, "Fetch", operation, true); // embedded |
|
101 |
if ( request == NULL ) |
|
102 |
{ |
|
103 |
return; |
|
104 |
} |
|
105 |
||
106 |
// Result handlers |
|
107 |
connect (request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&))); |
|
108 |
connect (request, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&))); |
|
109 |
||
110 |
args << QString(tr("Phonebook")); |
|
111 |
args << KCntActionAll; |
|
112 |
args << KCntFilterDisplayAll; |
|
113 |
||
114 |
request->setArguments(args); |
|
115 |
request->send(); |
|
116 |
delete request; |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
117 |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
118 |
//unblock click signal after some delay. |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
119 |
QTimer::singleShot(250,this,SLOT(unblockSignals())); |
31 | 120 |
} |
121 |
||
122 |
void MsgUnifiedEditorAddress::handleOk(const QVariant& value) |
|
123 |
{ |
|
124 |
CntServicesContactList contactList = |
|
125 |
qVariantValue<CntServicesContactList>(value); |
|
126 |
int count = contactList.count(); |
|
127 |
||
128 |
ConvergedMessageAddressList addrlist; |
|
129 |
for(int i = 0; i < count; i++ ) |
|
130 |
{ |
|
131 |
ConvergedMessageAddress* address = |
|
132 |
new ConvergedMessageAddress(); |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
133 |
if(!contactList[i].mPhoneNumber.isEmpty()) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
134 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
135 |
address->setAddress(contactList[i].mPhoneNumber); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
136 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
137 |
else |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
138 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
139 |
address->setAddress(contactList[i].mEmailAddress); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
140 |
} |
31 | 141 |
address->setAlias(contactList[i].mDisplayName); |
142 |
addrlist << address; |
|
143 |
} |
|
144 |
setAddresses(addrlist); |
|
145 |
} |
|
146 |
||
147 |
void MsgUnifiedEditorAddress::handleError(int errorCode, const QString& errorMessage) |
|
148 |
{ |
|
149 |
Q_UNUSED(errorMessage) |
|
150 |
Q_UNUSED(errorCode) |
|
151 |
} |
|
152 |
||
153 |
// ---------------------------------------------------------------------------- |
|
154 |
// MsgUnifiedEditorAddress::addresses |
|
155 |
// @see header |
|
156 |
// ---------------------------------------------------------------------------- |
|
157 |
ConvergedMessageAddressList MsgUnifiedEditorAddress::addresses( |
|
158 |
bool removeDuplicates) |
|
159 |
{ |
|
160 |
#ifdef _DEBUG_TRACES_ |
|
161 |
qCritical() << "MsgUnifiedEditorAddress::addresses start"; |
|
162 |
#endif |
|
163 |
// sync-up map to account for user-actions on edit-field |
|
164 |
syncDeletionsToMap(); |
|
165 |
syncAdditionsToMap(); |
|
166 |
||
167 |
ConvergedMessageAddressList addresses; |
|
168 |
if(removeDuplicates) |
|
169 |
{ |
|
170 |
QStringList uniqueAddr; |
|
171 |
uniqueAddr = uniqueAddressList(); |
|
172 |
foreach(QString addr, uniqueAddr) |
|
173 |
{ |
|
174 |
ConvergedMessageAddress* address = new ConvergedMessageAddress; |
|
175 |
address->setAddress(addr); |
|
176 |
address->setAlias(mAddressMap.value(addr)); |
|
177 |
addresses.append(address); |
|
178 |
} |
|
179 |
} |
|
180 |
else |
|
181 |
{ |
|
182 |
QMap<QString, QString>::iterator i = mAddressMap.begin(); |
|
183 |
while (i != mAddressMap.end()) |
|
184 |
{ |
|
185 |
ConvergedMessageAddress* address = new ConvergedMessageAddress; |
|
186 |
address->setAddress(i.key()); |
|
187 |
address->setAlias(i.value()); |
|
188 |
addresses.append(address); |
|
189 |
i++; |
|
190 |
} |
|
191 |
} |
|
192 |
#ifdef _DEBUG_TRACES_ |
|
193 |
qCritical() << "MsgUnifiedEditorAddress::addresses end"; |
|
194 |
#endif |
|
195 |
return addresses; |
|
196 |
} |
|
197 |
||
198 |
int MsgUnifiedEditorAddress::addressCount() |
|
199 |
{ |
|
200 |
return mAddressEdit->addresses().count(); |
|
201 |
} |
|
202 |
||
203 |
void MsgUnifiedEditorAddress::setAddresses(ConvergedMessageAddressList addrlist) |
|
204 |
{ |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
205 |
// avoid processing if no info available |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
206 |
if(addrlist.count() == 0) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
207 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
208 |
return; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
209 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
210 |
|
31 | 211 |
// ensure flags are reset before starting the addr addition |
212 |
mAboutToExceedMaxSmsRecipients = false; |
|
213 |
mAboutToExceedMaxMmsRecipients = false; |
|
214 |
mExceedsMaxMmsRecipientsBy = 0; |
|
215 |
||
216 |
// first, we check if MMS max-recipient count will exceed |
|
217 |
int count = addrlist.count(); |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
218 |
int futureCount = count + MsgUnifiedEditorMonitor::msgAddressCount(); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
219 |
if(futureCount > MsgUnifiedEditorMonitor::maxMmsRecipients()) |
31 | 220 |
{ |
221 |
mAboutToExceedMaxMmsRecipients = true; |
|
222 |
mExceedsMaxMmsRecipientsBy = |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
223 |
futureCount - MsgUnifiedEditorMonitor::maxMmsRecipients(); |
31 | 224 |
} |
225 |
// else, check if SMS max-recipient count will exceed |
|
226 |
else if(!mSkipMaxRecipientQuery) |
|
227 |
{ |
|
228 |
futureCount = count + addressCount(); |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
229 |
if( (addressCount() <= MsgUnifiedEditorMonitor::maxSmsRecipients()) && |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
230 |
(futureCount > MsgUnifiedEditorMonitor::maxSmsRecipients()) ) |
31 | 231 |
{ |
232 |
mAboutToExceedMaxSmsRecipients = true; |
|
233 |
} |
|
234 |
} |
|
235 |
||
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
236 |
int invalidCount= 0; |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
237 |
QString invalidContacts; |
31 | 238 |
for(int i = 0; i < count; i++ ) |
239 |
{ |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
240 |
bool isValid = false; |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
241 |
isValid = checkValidAddress(addrlist.at(i)->address()); |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
242 |
if(!isValid) |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
243 |
{ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
244 |
invalidCount ++; |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
245 |
// append the comma till last but one contact. |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
246 |
// add the invalid ocntacts to the " , " seperated string. |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
247 |
if(invalidCount > 1) |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
248 |
{ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
249 |
invalidContacts.append(COMMA_SEPERATOR); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
250 |
} |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
251 |
invalidContacts.append(addrlist.at(i)->alias()); |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
252 |
} |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
253 |
else |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
254 |
{ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
255 |
mAddressMap.insertMulti(addrlist[i]->address(), addrlist[i]->alias()); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
256 |
if(!addrlist[i]->alias().isEmpty()) |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
257 |
{ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
258 |
mAddressEdit->setText(addrlist[i]->alias()); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
259 |
} |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
260 |
else |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
261 |
{ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
262 |
mAddressEdit->setText(addrlist[i]->address(), false); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
263 |
} |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
264 |
} |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
265 |
} |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
266 |
if(invalidCount) |
31 | 267 |
{ |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
268 |
QString invalidStr; |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
269 |
(invalidCount == 1)?(invalidStr = QString(LOC_INVALID_RECIPIENT_NOT_ADDED)) :(invalidStr = QString(LOC_INVALID_RECIPIENTS_NOT_ADDED)); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
270 |
// append line seperator |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
271 |
invalidStr.append("<br>"); |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
272 |
invalidStr.append(invalidContacts); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
273 |
HbMessageBox::information(invalidStr); |
31 | 274 |
} |
275 |
||
276 |
// addition operation complete, reset flags |
|
277 |
mAboutToExceedMaxSmsRecipients = false; |
|
278 |
mAboutToExceedMaxMmsRecipients = false; |
|
279 |
mExceedsMaxMmsRecipientsBy = 0; |
|
280 |
} |
|
281 |
||
282 |
int MsgUnifiedEditorAddress::contactMatchDigits() |
|
283 |
{ |
|
284 |
// Read the amount of digits to be used in contact matching |
|
285 |
// The key is owned by PhoneApp |
|
286 |
int matchDigitCount = 0; |
|
287 |
TRAP_IGNORE( |
|
288 |
CRepository* repository = CRepository::NewLC(KCRUidTelConfiguration); |
|
289 |
if ( repository->Get(KTelMatchDigits, matchDigitCount) == KErrNone ) |
|
290 |
{ |
|
291 |
// Min is 7 |
|
292 |
matchDigitCount = Max(matchDigitCount, KDefaultGsmNumberMatchLength); |
|
293 |
} |
|
294 |
CleanupStack::PopAndDestroy(); // repository |
|
295 |
); |
|
296 |
return matchDigitCount; |
|
297 |
} |
|
298 |
||
299 |
void MsgUnifiedEditorAddress::onContentsChanged(const QString& text) |
|
300 |
{ |
|
301 |
// Max MMS recipient count check |
|
302 |
if( mAboutToExceedMaxMmsRecipients || |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
303 |
(MsgUnifiedEditorMonitor::msgAddressCount() >= MsgUnifiedEditorMonitor::maxMmsRecipients()) ) |
31 | 304 |
{ |
305 |
if(mAboutToExceedMaxMmsRecipients) |
|
306 |
{// show discreet note only once |
|
307 |
--mExceedsMaxMmsRecipientsBy; |
|
308 |
if(!mExceedsMaxMmsRecipientsBy) |
|
309 |
{ |
|
310 |
HbNotificationDialog::launchDialog( |
|
311 |
LOC_MMS_RECIPIENT_LIMIT_REACHED); |
|
312 |
} |
|
313 |
resetToPrevious(); |
|
314 |
} |
|
315 |
else |
|
316 |
{ |
|
317 |
// update monitor data |
|
318 |
emit contentChanged(); |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
319 |
if(MsgUnifiedEditorMonitor::msgAddressCount() > MsgUnifiedEditorMonitor::maxMmsRecipients()) |
31 | 320 |
{ |
321 |
HbNotificationDialog::launchDialog( |
|
322 |
LOC_MMS_RECIPIENT_LIMIT_REACHED); |
|
323 |
resetToPrevious(); |
|
324 |
// reset monitor data |
|
325 |
emit contentChanged(); |
|
326 |
} |
|
327 |
else |
|
328 |
{ |
|
329 |
mPrevBuffer = text; |
|
330 |
} |
|
331 |
} |
|
332 |
return; |
|
333 |
} |
|
334 |
||
335 |
// Max SMS recipient count check |
|
336 |
if( !mSkipMaxRecipientQuery && |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
337 |
(MsgUnifiedEditorMonitor::messageType() == ConvergedMessage::Sms) && |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
338 |
(mAddressEdit->addresses().count() > MsgUnifiedEditorMonitor::maxSmsRecipients()) ) |
31 | 339 |
{ |
340 |
// when we show this dialog, we don't want the intermediate states |
|
341 |
// to be signalled to us |
|
342 |
disconnect(mAddressEdit, SIGNAL(contentsChanged(const QString&)), |
|
343 |
this, SLOT(onContentsChanged(const QString&))); |
|
344 |
QTimer::singleShot(50, this, SLOT(handleRecipientLimitReached())); |
|
345 |
} |
|
346 |
else |
|
347 |
{ |
|
348 |
if(!mAboutToExceedMaxSmsRecipients) |
|
349 |
{// remember addresses before the block insertion started |
|
350 |
mPrevBuffer = text; |
|
351 |
} |
|
352 |
emit contentChanged(); |
|
353 |
} |
|
354 |
} |
|
355 |
||
356 |
void MsgUnifiedEditorAddress::handleRecipientLimitReached() |
|
357 |
{ |
|
358 |
HbMessageBox* dlg = new HbMessageBox(HbMessageBox::MessageTypeQuestion); |
|
359 |
dlg->setAttribute(Qt::WA_DeleteOnClose); |
|
360 |
dlg->setFocusPolicy(Qt::NoFocus); |
|
361 |
dlg->setTimeout(HbPopup::NoTimeout); |
|
362 |
||
363 |
dlg->setText(LOC_SMS_RECIPIENT_LIMIT_REACHED); |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
364 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
365 |
dlg->clearActions(); |
31 | 366 |
HbAction* okAction = new HbAction(LOC_DIALOG_OK,dlg); |
367 |
dlg->addAction(okAction); |
|
368 |
||
369 |
HbAction* cancelAction = new HbAction(LOC_BUTTON_CANCEL,dlg); |
|
370 |
dlg->addAction(cancelAction); |
|
371 |
||
372 |
dlg->open(this,SLOT(onMaxRecipientsReached(HbAction*))); |
|
373 |
// reconnect to get back updates |
|
374 |
connect(mAddressEdit, SIGNAL(contentsChanged(const QString&)), |
|
375 |
this, SLOT(onContentsChanged(const QString&))); |
|
376 |
} |
|
377 |
||
378 |
void MsgUnifiedEditorAddress::syncDeletionsToMap() |
|
379 |
{ |
|
380 |
// get address list from edit-field |
|
381 |
QStringList addrList = mAddressEdit->addresses(); |
|
382 |
||
383 |
QMap<QString, QString>::iterator i = mAddressMap.begin(); |
|
384 |
while (i != mAddressMap.end()) |
|
385 |
{ |
|
386 |
// check if either key or value is present in the list |
|
387 |
if( !(addrList.contains(i.value(), Qt::CaseSensitive) || |
|
388 |
addrList.contains(i.key(), Qt::CaseSensitive)) ) |
|
389 |
{// if none are present, then delete entry from map |
|
390 |
i = mAddressMap.erase(i); |
|
391 |
} |
|
392 |
else |
|
393 |
{ |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
394 |
// ensure that the matched contact is removed from the |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
395 |
// address's list |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
396 |
int matchedIndex = addrList.indexOf(i.value()); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
397 |
if(matchedIndex == -1) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
398 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
399 |
matchedIndex = addrList.indexOf(i.key()); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
400 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
401 |
if(matchedIndex != -1) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
402 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
403 |
addrList.removeAt(matchedIndex); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
404 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
405 |
// now go to next index in map |
31 | 406 |
++i; |
407 |
} |
|
408 |
} |
|
409 |
} |
|
410 |
||
411 |
void MsgUnifiedEditorAddress::syncAdditionsToMap() |
|
412 |
{ |
|
413 |
// remove already mapped addresses from edit-field |
|
414 |
QStringList userInputAddrList(mAddressEdit->addresses()); |
|
415 |
QStringList mapAddrList = mAddressMap.values(); |
|
416 |
mapAddrList << mAddressMap.keys(); |
|
417 |
foreach(QString addr, mapAddrList) |
|
418 |
{ |
|
419 |
userInputAddrList.removeOne(addr); |
|
420 |
} |
|
421 |
||
422 |
// add the unmapped addresses to address-map |
|
423 |
foreach(QString addr, userInputAddrList) |
|
424 |
{ |
|
425 |
mAddressMap.insertMulti(addr, QString()); |
|
426 |
} |
|
427 |
} |
|
428 |
||
429 |
QStringList MsgUnifiedEditorAddress::uniqueAddressList() |
|
430 |
{ |
|
431 |
int matchDigitCount = MsgUnifiedEditorAddress::contactMatchDigits(); |
|
432 |
QStringList mapAddrList = mAddressMap.keys(); |
|
433 |
for(int j = 0;j<mapAddrList.count()-1;j++) |
|
434 |
{ |
|
435 |
for(int i =j+1;i<mapAddrList.count();i++) |
|
436 |
{ |
|
437 |
if(0 == mapAddrList[j].right(matchDigitCount).compare(mapAddrList[i].right(matchDigitCount))) |
|
438 |
{ |
|
439 |
mapAddrList.removeAt(i); |
|
440 |
i--; |
|
441 |
} |
|
442 |
} |
|
443 |
} |
|
444 |
return mapAddrList; |
|
445 |
} |
|
446 |
||
447 |
// ---------------------------------------------------------------------------- |
|
448 |
// MsgUnifiedEditorAddress::skipMaxRecipientQuery |
|
449 |
// @see header |
|
450 |
// ---------------------------------------------------------------------------- |
|
451 |
void MsgUnifiedEditorAddress::skipMaxRecipientQuery(bool skip) |
|
452 |
{ |
|
453 |
mSkipMaxRecipientQuery = skip; |
|
454 |
} |
|
455 |
||
456 |
void MsgUnifiedEditorAddress::setFocus() |
|
457 |
{ |
|
458 |
mAddressEdit->setFocus(Qt::MouseFocusReason); |
|
459 |
} |
|
460 |
||
461 |
// ---------------------------------------------------------------------------- |
|
462 |
// MsgUnifiedEditorAddress::resetToPrevious |
|
463 |
// @see header |
|
464 |
// ---------------------------------------------------------------------------- |
|
465 |
void MsgUnifiedEditorAddress::resetToPrevious() |
|
466 |
{ |
|
467 |
// when we do this reset operation, we don't want the intermediate states |
|
468 |
// to be signalled to us |
|
469 |
disconnect(mAddressEdit, SIGNAL(contentsChanged(const QString&)), |
|
470 |
this, SLOT(onContentsChanged(const QString&))); |
|
471 |
||
472 |
mAddressEdit->clearContent(); |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
473 |
QStringList list = mPrevBuffer.split(REPLACEMENT_STR, |
31 | 474 |
QString::SkipEmptyParts); |
475 |
int count = list.count(); |
|
476 |
QStringList valList = mAddressMap.values(); |
|
477 |
for(int i=0; i<count; i++) |
|
478 |
{ |
|
479 |
QString addr = list.at(i); |
|
480 |
if(valList.contains(addr)) |
|
481 |
{ |
|
482 |
mAddressEdit->setText(addr); |
|
483 |
} |
|
484 |
else |
|
485 |
{ |
|
486 |
mAddressEdit->setText(addr, false); |
|
487 |
} |
|
488 |
} |
|
489 |
syncDeletionsToMap(); |
|
490 |
connect(mAddressEdit, SIGNAL(contentsChanged(const QString&)), |
|
491 |
this, SLOT(onContentsChanged(const QString&))); |
|
492 |
} |
|
493 |
||
494 |
// ---------------------------------------------------------------------------- |
|
495 |
// MsgUnifiedEditorAddress::onMaxRecipientsReached |
|
496 |
// @see header |
|
497 |
// ---------------------------------------------------------------------------- |
|
498 |
void MsgUnifiedEditorAddress::onMaxRecipientsReached(HbAction* action) |
|
499 |
{ |
|
500 |
HbMessageBox *dlg = qobject_cast<HbMessageBox*> (sender()); |
|
501 |
if (action == dlg->actions().at(0)) { |
|
502 |
// accept new content, update prev-buffer |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
503 |
emit contentChanged(); |
31 | 504 |
mPrevBuffer = mAddressEdit->content(); |
505 |
} |
|
506 |
else { |
|
507 |
// reject the new content, keep the old |
|
508 |
resetToPrevious(); |
|
509 |
} |
|
510 |
} |
|
511 |
||
512 |
// ---------------------------------------------------------------------------- |
|
513 |
// MsgUnifiedEditorAddress::validateContacts |
|
514 |
// @see header |
|
515 |
// ---------------------------------------------------------------------------- |
|
516 |
bool MsgUnifiedEditorAddress::validateContacts() |
|
517 |
{ |
|
518 |
UniEditorGenUtils* genUtils = new UniEditorGenUtils; |
|
519 |
||
520 |
// sync-up map to account for user-actions on address-field |
|
521 |
syncDeletionsToMap(); |
|
522 |
syncAdditionsToMap(); |
|
523 |
||
524 |
// get the list of contacts in address-field |
|
525 |
QStringList fieldAddresses(mAddressEdit->addresses()); |
|
526 |
||
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
527 |
bool isValid = true; |
31 | 528 |
foreach(QString addr, fieldAddresses) |
529 |
{ |
|
530 |
// run address validation only if address is unmapped |
|
531 |
// (i.e. user-inserted) |
|
532 |
if(mAddressMap.contains(addr)) |
|
533 |
{ |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
534 |
isValid = checkValidAddress(addr); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
535 |
if(!isValid) |
31 | 536 |
{ |
537 |
mAddressEdit->highlightInvalidString(addr); |
|
538 |
QString invalidAddrStr = |
|
539 |
QString(LOC_INVALID_RECIPIENT).arg(addr); |
|
540 |
HbMessageBox* dlg = new HbMessageBox(invalidAddrStr, |
|
541 |
HbMessageBox::MessageTypeInformation); |
|
542 |
dlg->setDismissPolicy(HbPopup::TapInside); |
|
543 |
dlg->setTimeout(HbPopup::NoTimeout); |
|
544 |
dlg->setAttribute(Qt::WA_DeleteOnClose, true); |
|
545 |
dlg->open(this, SLOT(handleInvalidContactDialog(HbAction*))); |
|
546 |
break; |
|
547 |
} |
|
548 |
} |
|
549 |
} |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
550 |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
551 |
return isValid; |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
552 |
} |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
553 |
// ---------------------------------------------------------------------------- |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
554 |
// MsgUnifiedEditorAddress::checkValidAddress |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
555 |
// @see header |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
556 |
// ---------------------------------------------------------------------------- |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
557 |
bool MsgUnifiedEditorAddress::checkValidAddress(const QString& addr) |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
558 |
{ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
559 |
bool isValid = false; |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
560 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
561 |
HBufC *tempAddr = XQConversions::qStringToS60Desc(addr); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
562 |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
563 |
// 1. perform number validation |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
564 |
isValid = CommonPhoneParser::IsValidPhoneNumber( |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
565 |
*tempAddr, |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
566 |
CommonPhoneParser::ESMSNumber ); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
567 |
|
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
568 |
// 2. if number validity fails, then perform email addr validation |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
569 |
UniEditorGenUtils* genUtils = new UniEditorGenUtils; |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
570 |
if(!isValid) |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
571 |
{ // additional check for MMS only |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
572 |
isValid = genUtils->IsValidEmailAddress( |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
573 |
*tempAddr ); |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
574 |
} |
31 | 575 |
delete genUtils; |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
576 |
delete tempAddr; |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
577 |
return isValid; |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
578 |
} |
31 | 579 |
|
580 |
void MsgUnifiedEditorAddress::handleInvalidContactDialog( |
|
581 |
HbAction* act) |
|
582 |
{ |
|
583 |
Q_UNUSED(act); |
|
584 |
QTimer::singleShot(250, this, SLOT(setFocus())); |
|
585 |
} |
|
586 |
||
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
587 |
void MsgUnifiedEditorAddress::unblockSignals() |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
588 |
{ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
589 |
mLaunchBtn->blockSignals(false); |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
590 |
} |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
591 |
|
31 | 592 |
Q_IMPLEMENT_USER_METATYPE(CntServicesContact) |
593 |
Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(CntServicesContactList) |
|
594 |
||
595 |
//EOF |