author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 18 Aug 2010 09:45:25 +0300 | |
changeset 52 | 12db4185673b |
parent 44 | 36f374c67aa8 |
child 70 | a15d9966050f |
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 |
* class to manage differnt messaging views. |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
#include "msgviewmanager.h" |
|
20 |
||
21 |
#include <HbMainWindow> |
|
22 |
#include <HbAction> |
|
23 |
#include <xqserviceutil.h> |
|
24 |
#include <QSqlQuery> |
|
25 |
#include <QSqlError> |
|
26 |
#include <HbApplication> |
|
27 |
#include <xqappmgr.h> |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
28 |
#include <hbmessagebox.h> |
31 | 29 |
#include <HbView> |
30 |
||
31 |
#include "conversationsengine.h" |
|
32 |
#include "msglistview.h" |
|
33 |
#include "msgunieditorview.h" |
|
34 |
#include "msgconversationbaseview.h" |
|
35 |
#include "unifiedviewer.h" |
|
36 |
#include "draftslistview.h" |
|
37 |
#include "msgsettingsview.h" |
|
38 |
#include "convergedmessageid.h" |
|
39 |
#include "ringbc.h" |
|
40 |
#include "unidatamodelloader.h" |
|
41 |
#include "unidatamodelplugininterface.h" |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
42 |
#include "msgcontacthandler.h" |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
43 |
#include "debugtraces.h" |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
44 |
#include "msgaudiofetcherview.h" |
31 | 45 |
|
46 |
// LOCALIZATION |
|
47 |
#define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message") |
|
48 |
#define LOC_DIALOG_SAVE_RINGTONE hbTrId("txt_conversations_dialog_save_ringing_tone") |
|
49 |
||
50 |
const qint64 NULL_CONVERSATIONID = -1; |
|
51 |
||
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
52 |
MsgViewManager::MsgViewManager(bool serviceRequest, HbMainWindow* mainWindow, QObject* parent,int activityMsgId) : |
31 | 53 |
QObject(parent), mMainWindow(mainWindow), mUniEditor(0), mListView(0), mConversationView(0), |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
54 |
mUniViewer(0), mDraftsListView(0), mSettingsView(0), mAudioFetcherView(0), mBackAction(0), |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
55 |
mServiceRequest(serviceRequest), mConversationId(-1), mViewServiceRequest(false),mMessageId(-1) |
31 | 56 |
{ |
57 |
//creating back action. |
|
58 |
mBackAction = new HbAction(Hb::BackNaviAction, this); |
|
59 |
connect(mBackAction, SIGNAL(triggered()), this, SLOT(onBackAction())); |
|
60 |
||
61 |
//create clv as first view if not a service request. |
|
62 |
if (!mServiceRequest) { |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
63 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
64 |
if(activityMsgId == NULL_CONVERSATIONID) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
65 |
{ |
31 | 66 |
QVariantList param; |
67 |
param << MsgBaseView::CLV; |
|
68 |
param << MsgBaseView::CLV; |
|
69 |
switchView(param); |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
70 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
71 |
else |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
72 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
73 |
openUniEditorActivity(activityMsgId); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
74 |
} |
31 | 75 |
} |
76 |
else |
|
77 |
{ |
|
78 |
mDummyview = new HbView(); |
|
79 |
mMainWindow->addView(mDummyview); |
|
80 |
mMainWindow->setCurrentView(mDummyview); |
|
81 |
mViewTobeDeleted << mDummyview; |
|
82 |
} |
|
83 |
} |
|
84 |
||
85 |
MsgViewManager::~MsgViewManager() |
|
86 |
{ |
|
87 |
// TODO Auto-generated destructor stub |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
88 |
mEditorData.clear(); |
31 | 89 |
} |
90 |
||
91 |
void MsgViewManager::onBackAction() |
|
92 |
{ |
|
93 |
switch (mCurrentView) { |
|
94 |
case MsgBaseView::CLV: |
|
95 |
{ |
|
96 |
// if its viewer service then quit the application |
|
97 |
if (mViewServiceRequest) { |
|
98 |
HbApplication::quit(); |
|
99 |
break; |
|
100 |
} |
|
101 |
||
102 |
if (!mServiceRequest) { |
|
103 |
HbApplication::quit(); |
|
104 |
} |
|
105 |
else { |
|
106 |
completeServiceRequest(); |
|
107 |
} |
|
108 |
||
109 |
break; |
|
110 |
} |
|
111 |
||
112 |
case MsgBaseView::CV: |
|
113 |
{ |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
114 |
mConversationId = -1; //reset the conversation view id since its closed |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
115 |
|
31 | 116 |
//Save content to drafts before switching to clv |
117 |
mConversationView->saveContentToDrafts(); |
|
118 |
||
119 |
//marking messages as red in CV. |
|
120 |
mConversationView->markMessagesAsRead(); |
|
121 |
||
122 |
// reset the conversation id published |
|
123 |
mConversationView->setPSCVId(false); |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
124 |
|
31 | 125 |
//clearing content of cv. |
126 |
mConversationView->clearContent(); |
|
127 |
||
128 |
// if service request for veiwer the just switch to univiewer. |
|
129 |
if (mViewServiceRequest) { |
|
130 |
mCurrentView = MsgBaseView::UNIVIEWER; |
|
131 |
mMainWindow->setCurrentView(mUniViewer); |
|
132 |
break; |
|
133 |
} |
|
134 |
||
135 |
if (mServiceRequest) { |
|
136 |
completeServiceRequest(); |
|
137 |
} |
|
138 |
else { |
|
139 |
//switch to clv. |
|
140 |
QVariantList param; |
|
141 |
param << MsgBaseView::CLV; |
|
142 |
param << MsgBaseView::CV; |
|
143 |
switchView(param); |
|
144 |
} |
|
145 |
||
146 |
break; |
|
147 |
} |
|
148 |
||
149 |
case MsgBaseView::DLV: |
|
150 |
{ |
|
151 |
if (mServiceRequest) { |
|
152 |
completeServiceRequest(); |
|
153 |
} |
|
154 |
else { |
|
155 |
//switch to clv. |
|
156 |
QVariantList param; |
|
157 |
param << MsgBaseView::CLV; |
|
158 |
param << MsgBaseView::DLV; |
|
159 |
switchView(param); |
|
160 |
} |
|
161 |
||
162 |
break; |
|
163 |
} |
|
164 |
||
165 |
case MsgBaseView::UNIEDITOR: |
|
166 |
{ |
|
167 |
//Save content to drafts before switching to clv |
|
168 |
mUniEditor->saveContentToDrafts(); |
|
169 |
||
170 |
// if service request for veiwer the just switch to univiewer. |
|
171 |
if (mViewServiceRequest) { |
|
172 |
mCurrentView = MsgBaseView::UNIVIEWER; |
|
173 |
mMainWindow->setCurrentView(mUniViewer); |
|
174 |
break; |
|
175 |
} |
|
176 |
||
177 |
//switch to clv. |
|
178 |
if (mServiceRequest) { |
|
179 |
completeServiceRequest(); |
|
180 |
} |
|
181 |
else { |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
182 |
//switch to previous view. |
31 | 183 |
QVariantList param; |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
184 |
param << mPreviousView; |
31 | 185 |
param << MsgBaseView::UNIEDITOR; |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
186 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
187 |
if(mPreviousView == MsgBaseView::CV) { |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
188 |
param << mConversationId; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
189 |
} |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
190 |
else if(mPreviousView == MsgBaseView::UNIVIEWER){ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
191 |
qint32 contactId = mViewerData.at(0).toLongLong(); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
192 |
qint32 messageId = mViewerData.at(1).toInt(); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
193 |
int msgCount = mViewerData.at(2).toInt(); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
194 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
195 |
param << contactId; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
196 |
param << messageId; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
197 |
param << msgCount; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
198 |
} |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
199 |
else if(mPreviousView == MsgBaseView::UNIEDITOR){ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
200 |
//TODO: Remove error handling once Audio fetcher |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
201 |
//becomes dialog |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
202 |
param[0] = MsgBaseView::CLV; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
203 |
} |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
204 |
|
31 | 205 |
switchView(param); |
206 |
} |
|
207 |
||
208 |
break; |
|
209 |
} |
|
210 |
||
211 |
case MsgBaseView::UNIVIEWER: |
|
212 |
{ |
|
213 |
// if its launched via service request quit the app |
|
214 |
if (mViewServiceRequest) { |
|
215 |
HbApplication::quit(); |
|
216 |
} |
|
217 |
else { |
|
218 |
QVariantList param; |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
219 |
if (mConversationId != -1) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
220 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
221 |
//this means CV is till open then just open the fresh CV |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
222 |
param << MsgBaseView::CV; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
223 |
param << MsgBaseView::UNIVIEWER; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
224 |
param << mConversationView->conversationId(); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
225 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
226 |
else |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
227 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
228 |
param << MsgBaseView::CLV; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
229 |
param << MsgBaseView::UNIVIEWER; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
230 |
} |
31 | 231 |
switchView(param); |
232 |
||
233 |
} |
|
234 |
break; |
|
235 |
} |
|
236 |
case MsgBaseView::MSGSETTINGS: |
|
237 |
{ |
|
238 |
QVariantList param; |
|
239 |
param << MsgBaseView::DEFAULT; |
|
240 |
param << MsgBaseView::MSGSETTINGS; |
|
241 |
switchView(param); |
|
242 |
break; |
|
243 |
} |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
244 |
case MsgBaseView::AUDIOFETCHER: |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
245 |
{ |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
246 |
// switch back to previous view |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
247 |
QVariantList param; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
248 |
param << mPreviousView; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
249 |
param << MsgBaseView::AUDIOFETCHER; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
250 |
if(mPreviousView == MsgBaseView::CV) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
251 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
252 |
param << mConversationId; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
253 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
254 |
switchView(param); |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
255 |
break; |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
256 |
} |
31 | 257 |
default: |
258 |
{ |
|
259 |
break; |
|
260 |
} |
|
261 |
} |
|
262 |
} |
|
263 |
||
264 |
void MsgViewManager::switchView(const QVariantList& data) |
|
265 |
{ |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
266 |
QCRITICAL_WRITE("MsgViewManager::switchView start."); |
31 | 267 |
|
268 |
int viewId = data.at(0).toInt(); |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
269 |
|
31 | 270 |
switch (viewId) { |
271 |
case MsgBaseView::DEFAULT: |
|
272 |
{ |
|
273 |
handleDefault(data); |
|
274 |
break; |
|
275 |
} |
|
276 |
case MsgBaseView::CLV: |
|
277 |
{ |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
278 |
switchToClv(data); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
279 |
break; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
280 |
} |
31 | 281 |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
282 |
case MsgBaseView::CV: |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
283 |
{ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
284 |
switchToCv(data); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
285 |
break; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
286 |
} |
31 | 287 |
|
288 |
case MsgBaseView::DLV: |
|
289 |
{ |
|
290 |
switchToDlv(data); |
|
291 |
break; |
|
292 |
} |
|
293 |
||
294 |
case MsgBaseView::UNIEDITOR: |
|
295 |
{ |
|
296 |
switchToUniEditor(data); |
|
297 |
break; |
|
298 |
} |
|
299 |
||
300 |
case MsgBaseView::UNIVIEWER: |
|
301 |
{ |
|
302 |
switchToUniViewer(data); |
|
303 |
break; |
|
304 |
} |
|
305 |
||
306 |
case MsgBaseView::MSGSETTINGS: |
|
307 |
{ |
|
308 |
switchToMsgSettings(data); |
|
309 |
break; |
|
310 |
} |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
311 |
case MsgBaseView::AUDIOFETCHER: |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
312 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
313 |
switchToAudioFetcher(data); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
314 |
break; |
31 | 315 |
} |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
316 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
317 |
QCRITICAL_WRITE("MsgViewManager::switchView end."); |
31 | 318 |
} |
319 |
||
320 |
void MsgViewManager::deletePreviousView() |
|
321 |
{ |
|
322 |
while(mViewTobeDeleted.count()) |
|
323 |
{ |
|
324 |
HbView* v = mViewTobeDeleted.takeAt(0); |
|
325 |
mMainWindow->removeView(v); |
|
326 |
delete v; |
|
327 |
} |
|
328 |
} |
|
329 |
||
330 |
||
331 |
void MsgViewManager::send(const qint32 contactId, const QString phoneNumber, |
|
332 |
const QString displayName) |
|
333 |
{ |
|
334 |
qint64 conversationId = ConversationsEngine::instance()-> getConversationIdFromContactId( |
|
335 |
contactId); |
|
336 |
||
337 |
//set mode to viewer, if conversations found else send mode. |
|
338 |
QVariantList param; |
|
339 |
if (conversationId > 0) { |
|
340 |
param << MsgBaseView::CV; |
|
341 |
param << MsgBaseView::SERVICE; |
|
342 |
param << conversationId; |
|
343 |
} |
|
344 |
else { |
|
345 |
ConvergedMessage message; |
|
346 |
ConvergedMessageAddress address; |
|
347 |
address.setAddress(phoneNumber); |
|
348 |
address.setAlias(displayName); |
|
349 |
message.addToRecipient(address); |
|
350 |
||
351 |
QByteArray dataArray; |
|
352 |
QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append); |
|
353 |
message.serialize(messageStream); |
|
354 |
||
355 |
param << MsgBaseView::UNIEDITOR; |
|
356 |
param << MsgBaseView::SERVICE; |
|
357 |
param << dataArray; |
|
358 |
} |
|
359 |
switchView(param); |
|
360 |
XQServiceUtil::toBackground(false); |
|
361 |
} |
|
362 |
||
363 |
void MsgViewManager::send(const QString phoneNumber, const QString alias, const QString bodyText) |
|
364 |
{ |
|
365 |
ConvergedMessage message; |
|
366 |
ConvergedMessageAddress address; |
|
367 |
address.setAddress(phoneNumber); |
|
368 |
address.setAlias(alias); |
|
369 |
message.addToRecipient(address); |
|
370 |
message.setBodyText(bodyText); |
|
371 |
||
372 |
QVariantList param; |
|
373 |
QByteArray dataArray; |
|
374 |
QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append); |
|
375 |
message.serialize(messageStream); |
|
376 |
||
377 |
param << MsgBaseView::UNIEDITOR; |
|
378 |
param << MsgBaseView::SERVICE; |
|
379 |
param << dataArray; |
|
380 |
||
381 |
switchView(param); |
|
382 |
XQServiceUtil::toBackground(false); |
|
383 |
} |
|
384 |
||
385 |
void MsgViewManager::setServiceRequest(bool request) |
|
386 |
{ |
|
387 |
mServiceRequest = request; |
|
388 |
mViewAtServiceRequest = mCurrentView; |
|
389 |
} |
|
390 |
||
391 |
void MsgViewManager::switchToLastSavedView() |
|
392 |
{ |
|
393 |
QVariantList param; |
|
394 |
||
395 |
switch (mViewAtServiceRequest) { |
|
396 |
case MsgBaseView::CV: |
|
397 |
{ |
|
398 |
param << MsgBaseView::CV; |
|
399 |
param << MsgBaseView::SERVICE; |
|
400 |
param << mConversationId; |
|
401 |
break; |
|
402 |
} |
|
403 |
case MsgBaseView::UNIVIEWER: |
|
404 |
{ |
|
405 |
param << MsgBaseView::UNIVIEWER; |
|
406 |
param << MsgBaseView::SERVICE; |
|
407 |
break; |
|
408 |
} |
|
409 |
default: |
|
410 |
{ |
|
411 |
param << MsgBaseView::CLV; |
|
412 |
param << MsgBaseView::SERVICE; |
|
413 |
break; |
|
414 |
} |
|
415 |
} |
|
416 |
switchView(param); |
|
417 |
} |
|
418 |
||
419 |
void MsgViewManager::open(qint64 conversationId) |
|
420 |
{ |
|
421 |
QVariantList param; |
|
422 |
||
423 |
if (conversationId < 0) { |
|
424 |
param << MsgBaseView::CLV; |
|
425 |
param << MsgBaseView::SERVICE; |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
426 |
|
31 | 427 |
if( mCurrentView == MsgBaseView::CV && mConversationView) |
428 |
{ |
|
429 |
mConversationView->setPSCVId(false); |
|
430 |
} |
|
431 |
} |
|
432 |
else { |
|
433 |
param << MsgBaseView::CV; |
|
434 |
param << MsgBaseView::SERVICE; |
|
435 |
param << conversationId; |
|
436 |
} |
|
437 |
||
438 |
switchView(param); |
|
439 |
XQServiceUtil::toBackground(false); |
|
440 |
} |
|
441 |
||
442 |
void MsgViewManager::send(QVariant data) |
|
443 |
{ |
|
444 |
ConvergedMessage message; |
|
445 |
ConvergedMessageAttachmentList attachmentList; |
|
446 |
// handle multiple files from sendUI |
|
447 |
// e.g. contacts can send multiple vcards |
|
448 |
QStringList receivedFiles = data.toStringList(); |
|
449 |
int recFileCount = receivedFiles.count(); |
|
450 |
for (int i = 0; i < recFileCount; i++) { |
|
451 |
ConvergedMessageAttachment *attachment = |
|
452 |
new ConvergedMessageAttachment(receivedFiles.at(i)); |
|
453 |
attachmentList.append(attachment); |
|
454 |
} |
|
455 |
message.addAttachments(attachmentList); |
|
456 |
||
457 |
QByteArray dataArray; |
|
458 |
QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append); |
|
459 |
message.serialize(messageStream); |
|
460 |
||
461 |
QVariantList param; |
|
462 |
param << MsgBaseView::UNIEDITOR; |
|
463 |
param << MsgBaseView::SERVICE; |
|
464 |
param << dataArray; |
|
465 |
||
466 |
switchView(param); |
|
467 |
XQServiceUtil::toBackground(false); |
|
468 |
} |
|
469 |
||
470 |
qint64 MsgViewManager::findConversationId(const QString phoneNum) |
|
471 |
{ |
|
472 |
return ConversationsEngine::instance()-> getConversationIdFromAddress(phoneNum); |
|
473 |
} |
|
474 |
||
475 |
//will be depricated in future. |
|
476 |
void MsgViewManager::openEditor(QString phoneNumber, QString name) |
|
477 |
{ |
|
478 |
ConvergedMessage message; |
|
479 |
ConvergedMessageAddress address; |
|
480 |
address.setAddress(phoneNumber); |
|
481 |
address.setAlias(name); |
|
482 |
message.addToRecipient(address); |
|
483 |
||
484 |
QByteArray dataArray; |
|
485 |
QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append); |
|
486 |
message.serialize(messageStream); |
|
487 |
||
488 |
QVariantList param; |
|
489 |
param << MsgBaseView::UNIEDITOR; |
|
490 |
param << MsgBaseView::SERVICE; |
|
491 |
param << dataArray; |
|
492 |
||
493 |
switchView(param); |
|
494 |
XQServiceUtil::toBackground(false); |
|
495 |
} |
|
496 |
||
497 |
void MsgViewManager::completeServiceRequest() |
|
498 |
{ |
|
499 |
mServiceRequest = false; |
|
500 |
XQServiceUtil::toBackground(true); |
|
501 |
switchToLastSavedView(); |
|
502 |
} |
|
503 |
||
504 |
void MsgViewManager::switchToClv(const QVariantList& data) |
|
505 |
{ |
|
506 |
mPreviousView = data.at(1).toInt(); |
|
507 |
||
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
508 |
// delete case from viewer service |
31 | 509 |
if (mViewServiceRequest && (mPreviousView == MsgBaseView::UNIVIEWER)) { |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
510 |
// quit the application |
31 | 511 |
HbApplication::quit(); |
512 |
} |
|
513 |
||
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
514 |
// this is the case when viewer/editor is opened and contacts update takes |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
515 |
// place resulting in CV close, the view should directly come to CLV |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
516 |
// bypassing the CV |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
517 |
if ((mCurrentView == MsgBaseView::UNIVIEWER |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
518 |
&& mPreviousView != MsgBaseView::UNIVIEWER) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
519 |
|| (mCurrentView == MsgBaseView::UNIEDITOR |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
520 |
&& mPreviousView != MsgBaseView::UNIEDITOR)) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
521 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
522 |
//dont do anything |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
523 |
//wait for the back from viewer/editor |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
524 |
//and reset the open CV id |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
525 |
mConversationId = -1; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
526 |
return; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
527 |
} |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
528 |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
529 |
//delete UniEditor |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
530 |
if (mUniEditor) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
531 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
532 |
appendViewToBeDeleted(mUniEditor); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
533 |
mUniEditor = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
534 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
535 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
536 |
//delete UniViewer |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
537 |
if (mUniViewer) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
538 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
539 |
appendViewToBeDeleted(mUniViewer); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
540 |
mUniViewer = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
541 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
542 |
|
31 | 543 |
if (mConversationView) { |
544 |
mConversationView->saveContentToDrafts(); |
|
545 |
//clearing content of cv. |
|
546 |
mConversationView->clearContent(); |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
547 |
//reset the open CV id |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
548 |
mConversationId = -1; |
31 | 549 |
} |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
550 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
551 |
//switch to CLV. |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
552 |
mCurrentView = MsgBaseView::CLV; |
31 | 553 |
if (!mListView) { |
554 |
mListView = new MsgListView(); |
|
555 |
mListView->setNavigationAction(mBackAction); |
|
556 |
connect(mListView, SIGNAL(switchView(const QVariantList&)), this, |
|
557 |
SLOT(switchView(const QVariantList&))); |
|
558 |
mMainWindow->addView(mListView); |
|
559 |
} |
|
560 |
||
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
561 |
mMainWindow->setCurrentView(mListView,true,Hb::ViewSwitchSequential); |
31 | 562 |
} |
563 |
||
564 |
void MsgViewManager::switchToCv(const QVariantList& data) |
|
565 |
{ |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
566 |
QCRITICAL_WRITE("MsgViewManager::switchToCv start."); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
567 |
|
31 | 568 |
//switch to CV. |
569 |
mCurrentView = MsgBaseView::CV; |
|
570 |
mPreviousView = data.at(1).toInt(); |
|
571 |
||
572 |
// delete case from viewer service |
|
573 |
if (mViewServiceRequest && (mPreviousView == MsgBaseView::UNIVIEWER)) { |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
574 |
// quit the application |
31 | 575 |
HbApplication::quit(); |
576 |
} |
|
577 |
||
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
578 |
// delete Audio Fetcher view |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
579 |
if(mAudioFetcherView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
580 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
581 |
appendViewToBeDeleted(mAudioFetcherView); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
582 |
mAudioFetcherView = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
583 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
584 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
585 |
//delete UniEditor |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
586 |
if (mUniEditor) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
587 |
{ |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
588 |
// Save to drafts if CV is launched via service |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
589 |
if (mPreviousView == MsgBaseView::SERVICE) { |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
590 |
mUniEditor->saveContentToDrafts(); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
591 |
} |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
592 |
appendViewToBeDeleted(mUniEditor); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
593 |
mUniEditor = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
594 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
595 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
596 |
//delete UniViewer |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
597 |
if (mUniViewer) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
598 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
599 |
appendViewToBeDeleted(mUniViewer); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
600 |
mUniViewer = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
601 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
602 |
|
31 | 603 |
QVariant var = data.at(2); |
604 |
qint64 conversationId; |
|
605 |
if (var.type() == QVariant::String) { |
|
606 |
QString phoneNumber = var.toString(); |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
607 |
qint32 contactId = findContactId(phoneNumber); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
608 |
if (contactId != -1) { |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
609 |
conversationId = ConversationsEngine::instance()->getConversationIdFromContactId(contactId); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
610 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
611 |
else { |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
612 |
conversationId = findConversationId(phoneNumber); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
613 |
} |
31 | 614 |
|
615 |
if (conversationId == NULL_CONVERSATIONID) { |
|
616 |
QVariantList param; |
|
617 |
param << MsgBaseView::CLV; |
|
618 |
param << MsgBaseView::CV; |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
619 |
|
31 | 620 |
if( mCurrentView == MsgBaseView::CV && mConversationView){ |
621 |
mConversationView->setPSCVId(false); |
|
622 |
} |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
623 |
|
31 | 624 |
switchView(param); |
625 |
return; |
|
626 |
} |
|
627 |
} |
|
628 |
else if (var.type() == QVariant::Invalid) { |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
629 |
// this case comes when a message is deleted from |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
630 |
// Unified viewer set curent view as conversation view |
31 | 631 |
// and return |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
632 |
mMainWindow->setCurrentView(mConversationView,true,Hb::ViewSwitchSequential); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
633 |
|
31 | 634 |
// publish already opened conversation's id |
635 |
mConversationView->setPSCVId(true); |
|
636 |
return; |
|
637 |
} |
|
638 |
else { |
|
639 |
conversationId = var.toLongLong(); |
|
640 |
} |
|
641 |
//switch to CV. |
|
642 |
mConversationId = conversationId; |
|
643 |
||
644 |
if (!mConversationView) { |
|
645 |
mConversationView = new MsgConversationBaseView(); |
|
646 |
mConversationView->setNavigationAction(mBackAction); |
|
647 |
connect(mConversationView, SIGNAL(switchView(const QVariantList&)), this, |
|
648 |
SLOT(switchView(const QVariantList&))); |
|
649 |
||
650 |
mMainWindow->addView(mConversationView); |
|
651 |
} |
|
652 |
else if (mConversationView->conversationId() != mConversationId){ |
|
653 |
//Save content to drafts before switching to different CV |
|
654 |
mConversationView->saveContentToDrafts(); |
|
655 |
//clearing content of current cv. |
|
656 |
mConversationView->clearContent(); |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
657 |
} |
31 | 658 |
|
659 |
mConversationView->openConversation(conversationId); |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
660 |
mMainWindow->setCurrentView(mConversationView,true,Hb::ViewSwitchSequential); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
661 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
662 |
QCRITICAL_WRITE("MsgViewManager::switchToCv end."); |
31 | 663 |
} |
664 |
||
665 |
void MsgViewManager::switchToDlv(const QVariantList& data) |
|
666 |
{ |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
667 |
//delete UniEditor |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
668 |
if (mUniEditor) |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
669 |
{ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
670 |
appendViewToBeDeleted(mUniEditor); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
671 |
mUniEditor = NULL; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
672 |
} |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
673 |
|
31 | 674 |
//switch to DLV. |
675 |
mCurrentView = MsgBaseView::DLV; |
|
676 |
mPreviousView = data.at(1).toInt(); |
|
677 |
||
678 |
if (!mDraftsListView) { |
|
679 |
mDraftsListView = new DraftsListView(); |
|
680 |
mDraftsListView->setNavigationAction(mBackAction); |
|
681 |
connect(mDraftsListView, SIGNAL(switchView(const QVariantList&)), this, |
|
682 |
SLOT(switchView(const QVariantList&))); |
|
683 |
||
684 |
mMainWindow->addView(mDraftsListView); |
|
685 |
} |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
686 |
mMainWindow->setCurrentView(mDraftsListView,true,Hb::ViewSwitchSequential); |
31 | 687 |
} |
688 |
||
689 |
void MsgViewManager::switchToUniEditor(const QVariantList& data) |
|
690 |
{ |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
691 |
QCRITICAL_WRITE("MsgViewManager::switchToUniEditor start."); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
692 |
|
31 | 693 |
/** |
694 |
* Editor is tried to open again before exiting the previously |
|
695 |
* opened editor. Multi taping in DLV or Forward. |
|
696 |
*/ |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
697 |
if (mUniEditor && !mAudioFetcherView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
698 |
{ |
31 | 699 |
return; |
700 |
} |
|
701 |
||
702 |
mCurrentView = MsgBaseView::UNIEDITOR; |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
703 |
if(MsgBaseView::AUDIOFETCHER != data.at(1).toInt()) |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
704 |
{ |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
705 |
mPreviousView = data.at(1).toInt(); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
706 |
} |
31 | 707 |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
708 |
// delete Audio Fetcher view |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
709 |
if(mAudioFetcherView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
710 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
711 |
appendViewToBeDeleted(mAudioFetcherView); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
712 |
mAudioFetcherView = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
713 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
714 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
715 |
// delete UniViewer |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
716 |
if (mUniViewer ) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
717 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
718 |
appendViewToBeDeleted(mUniViewer); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
719 |
mUniViewer = NULL; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
720 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
721 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
722 |
if (mConversationView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
723 |
{ |
31 | 724 |
//clearing content of cv. |
725 |
mConversationView->clearContent(); |
|
726 |
} |
|
727 |
||
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
728 |
// reset conversation id published |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
729 |
if(mPreviousView == MsgBaseView::CV && mConversationView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
730 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
731 |
mConversationView->setPSCVId(false); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
732 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
733 |
|
31 | 734 |
//swich to unieditor. |
735 |
if (!mUniEditor) { |
|
736 |
mUniEditor = new MsgUnifiedEditorView(); |
|
737 |
mMainWindow->addView(mUniEditor); |
|
738 |
mUniEditor->setNavigationAction(mBackAction); |
|
739 |
connect(mUniEditor, SIGNAL(switchView(const QVariantList&)), this, |
|
740 |
SLOT(switchView(const QVariantList&))); |
|
741 |
} |
|
742 |
||
743 |
// check if additional data for unieditor's consumption is available |
|
744 |
if (data.length() > 2) { |
|
745 |
QVariantList editorData; |
|
746 |
// i=2 because view manager consumed first two args |
|
747 |
for (int i = 2; i < data.length(); i++) { |
|
748 |
editorData << data.at(i); |
|
749 |
} |
|
750 |
||
751 |
if (MsgBaseView::DLV == mPreviousView) { |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
752 |
//Populate editor after view ready indication |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
753 |
populateUniEditorAfterViewReady(editorData); |
31 | 754 |
} |
755 |
else { |
|
756 |
mUniEditor->populateContent(editorData); |
|
757 |
} |
|
758 |
} |
|
759 |
||
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
760 |
mMainWindow->setCurrentView(mUniEditor,true,Hb::ViewSwitchSequential); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
761 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
762 |
QCRITICAL_WRITE("MsgViewManager::switchToUniEditor end."); |
31 | 763 |
} |
764 |
||
765 |
void MsgViewManager::switchToUniViewer(const QVariantList& data) |
|
766 |
{ |
|
767 |
/** |
|
768 |
* Viewer is tried to open again before exiting the previously |
|
769 |
* opened viewer. Multi taping bubbles in CV. |
|
770 |
*/ |
|
771 |
if (mUniViewer) { |
|
772 |
return; |
|
773 |
} |
|
774 |
||
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
775 |
if (mUniEditor) |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
776 |
{ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
777 |
appendViewToBeDeleted(mUniEditor); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
778 |
mUniEditor = NULL; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
779 |
} |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
780 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
781 |
//Clear the old viewer data |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
782 |
mViewerData.clear(); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
783 |
|
31 | 784 |
mCurrentView = MsgBaseView::UNIVIEWER; |
785 |
mPreviousView = data.at(1).toInt(); |
|
786 |
||
787 |
//switch to univiewer. |
|
788 |
if (data.length() > 2) { |
|
789 |
qint32 contactId = data.at(2).toLongLong(); |
|
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
790 |
qint32 messageId = data.at(3).toInt(); |
31 | 791 |
int msgCount = data.at(4).toInt(); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
792 |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
793 |
//Save the viewer data to be used when u come back from Editor |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
794 |
mViewerData << contactId; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
795 |
mViewerData << messageId; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
796 |
mViewerData << msgCount; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
797 |
|
31 | 798 |
if (!mUniViewer) { |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
799 |
mUniViewer = new UnifiedViewer(messageId); |
31 | 800 |
mUniViewer->setNavigationAction(mBackAction); |
801 |
mMainWindow->addView(mUniViewer); |
|
802 |
connect(mUniViewer, SIGNAL(switchView(const QVariantList&)), this, |
|
803 |
SLOT(switchView(const QVariantList&))); |
|
804 |
} |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
805 |
mUniViewer->populateContent(messageId, true, msgCount); |
31 | 806 |
} |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
807 |
|
31 | 808 |
if(mPreviousView==MsgBaseView::CV && mConversationView) |
809 |
{ |
|
810 |
mConversationView->setPSCVId(false); |
|
811 |
} |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
812 |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
813 |
mMainWindow->setCurrentView(mUniViewer,true,Hb::ViewSwitchSequential); |
31 | 814 |
} |
815 |
void MsgViewManager::switchToMsgSettings(const QVariantList& data) |
|
816 |
{ |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
817 |
int previousView = data.at(1).toInt(); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
818 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
819 |
MsgSettingsView::SettingsView view = MsgSettingsView::DefaultView; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
820 |
if (previousView == MsgBaseView::UNIEDITOR || previousView |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
821 |
== MsgBaseView::CV) |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
822 |
{ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
823 |
view = (MsgSettingsView::SettingsView)data.at(2).toInt(); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
824 |
} |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
825 |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
826 |
//launch settings service |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
827 |
QList<QVariant> args; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
828 |
QString serviceName("messagesettings"); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
829 |
QString interfaceName("com.nokia.symbian.IMessageSettings"); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
830 |
QString operation("launchSettings(int)"); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
831 |
XQAiwRequest* request; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
832 |
XQApplicationManager appManager; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
833 |
request = appManager.create(serviceName, interfaceName, operation, true); //embedded |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
834 |
if ( request == NULL ) |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
835 |
{ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
836 |
return; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
837 |
} |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
838 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
839 |
args << view; |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
840 |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
841 |
request->setArguments(args); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
842 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
843 |
if(previousView==MsgBaseView::CV && mConversationView){ |
31 | 844 |
mConversationView->setPSCVId(false); |
845 |
} |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
846 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
847 |
if(!request->send()) |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
848 |
{ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
849 |
QDEBUG_WRITE("launchSettings failed") |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
850 |
} |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
851 |
delete request; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
852 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
853 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
854 |
if(previousView==MsgBaseView::CV && mConversationView){ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
855 |
mConversationView->setPSCVId(true); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
856 |
} |
31 | 857 |
} |
858 |
||
859 |
void MsgViewManager::handleDefault(const QVariantList& data) |
|
860 |
{ |
|
861 |
//special handling incase we switch from settings-view |
|
862 |
int previousViewId = data.at(1).toInt(); |
|
863 |
if (MsgBaseView::MSGSETTINGS == previousViewId) { |
|
864 |
//switch to view, where from settings view was launched |
|
865 |
mCurrentView = mPreviousView; |
|
866 |
mPreviousView = previousViewId; |
|
867 |
//remove the settings view from main window |
|
868 |
if (mSettingsView) |
|
869 |
{ |
|
870 |
appendViewToBeDeleted(mSettingsView); |
|
871 |
mSettingsView = NULL; |
|
872 |
} |
|
873 |
switch (mCurrentView) { |
|
874 |
case MsgBaseView::CLV: |
|
875 |
{ |
|
876 |
if (mListView) |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
877 |
mMainWindow->setCurrentView(mListView,true,Hb::ViewSwitchSequential); |
31 | 878 |
break; |
879 |
} |
|
880 |
case MsgBaseView::CV: |
|
881 |
{ |
|
882 |
if (mConversationView) |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
883 |
mMainWindow->setCurrentView(mConversationView,true,Hb::ViewSwitchSequential); |
31 | 884 |
break; |
885 |
} |
|
886 |
case MsgBaseView::DLV: |
|
887 |
{ |
|
888 |
if (mDraftsListView) |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
889 |
mMainWindow->setCurrentView(mDraftsListView,true,Hb::ViewSwitchSequential); |
31 | 890 |
break; |
891 |
} |
|
892 |
case MsgBaseView::UNIEDITOR: |
|
893 |
{ |
|
894 |
if (mServiceRequest) { |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
895 |
mMainWindow->setCurrentView(mUniEditor,true,Hb::ViewSwitchSequential); |
31 | 896 |
} |
897 |
else { |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
898 |
mMainWindow->setCurrentView(mUniEditor,true,Hb::ViewSwitchSequential); |
31 | 899 |
} |
900 |
break; |
|
901 |
} |
|
902 |
} |
|
903 |
} |
|
904 |
} |
|
905 |
||
906 |
void MsgViewManager::view(int msgId) |
|
907 |
{ |
|
908 |
int msgType; |
|
909 |
int msgSubType; |
|
910 |
mMessageId = msgId; |
|
911 |
qint32 messageId(msgId); |
|
912 |
ConversationsEngine::instance()->markAsReadAndGetType(messageId, msgType, msgSubType); |
|
913 |
||
914 |
switch (msgType) { |
|
915 |
case ConvergedMessage::Sms: |
|
916 |
case ConvergedMessage::Mms: |
|
917 |
case ConvergedMessage::MmsNotification: |
|
918 |
{ |
|
919 |
handleSmsMmsMsg(msgId); |
|
920 |
break; |
|
921 |
} |
|
922 |
case ConvergedMessage::BioMsg: |
|
923 |
{ |
|
924 |
if (msgSubType == ConvergedMessage::RingingTone) { |
|
925 |
handleRingtoneMsg(msgId); |
|
926 |
||
927 |
} |
|
928 |
else if (msgSubType == ConvergedMessage::Provisioning) { |
|
929 |
handleProvisoningMsg(msgId); |
|
930 |
} |
|
931 |
break; |
|
932 |
} |
|
933 |
case ConvergedMessage::BT: |
|
934 |
{ |
|
935 |
break; |
|
936 |
} |
|
937 |
default: |
|
938 |
{ |
|
939 |
// for un supported message show delete option |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
940 |
HbMessageBox::question(LOC_DELETE_MESSAGE,this, |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
941 |
SLOT(onDialogDeleteMsg(HbAction*)), |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
942 |
HbMessageBox::Delete | HbMessageBox::Cancel); |
31 | 943 |
break; |
944 |
} |
|
945 |
} |
|
946 |
} |
|
947 |
||
948 |
// ---------------------------------------------------------------------------- |
|
949 |
// MsgViewManager::handleSmsMmsMsg |
|
950 |
// @see header |
|
951 |
// ---------------------------------------------------------------------------- |
|
952 |
void MsgViewManager::handleSmsMmsMsg(int msgId) |
|
953 |
{ |
|
954 |
mViewServiceRequest = true; |
|
955 |
||
956 |
mCurrentView = MsgBaseView::UNIVIEWER; |
|
957 |
||
958 |
if (!mUniViewer) { |
|
959 |
mUniViewer = new UnifiedViewer(msgId); |
|
960 |
mUniViewer->setNavigationAction(mBackAction); |
|
961 |
mMainWindow->addView(mUniViewer); |
|
962 |
connect(mUniViewer, SIGNAL(switchView(const QVariantList&)), this, |
|
963 |
SLOT(switchView(const QVariantList&))); |
|
964 |
} |
|
965 |
mUniViewer->populateContent(msgId, true, -1); |
|
966 |
||
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
967 |
mMainWindow->setCurrentView(mUniViewer,true,Hb::ViewSwitchSequential); |
31 | 968 |
} |
969 |
||
970 |
// ---------------------------------------------------------------------------- |
|
971 |
// MsgViewManager::handleRingtoneMsg |
|
972 |
// @see header |
|
973 |
// ---------------------------------------------------------------------------- |
|
974 |
void MsgViewManager::handleRingtoneMsg(int msgId) |
|
975 |
{ |
|
976 |
mMessageId = msgId; |
|
977 |
HbMessageBox::question(LOC_DIALOG_SAVE_RINGTONE, this, |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
978 |
SLOT(onDialogSaveTone(HbAction*)), |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
979 |
HbMessageBox::Save | HbMessageBox::Cancel); |
31 | 980 |
} |
981 |
||
982 |
// ---------------------------------------------------------------------------- |
|
983 |
// MsgViewManager::handleProvisoningMsg |
|
984 |
// @see header |
|
985 |
// ---------------------------------------------------------------------------- |
|
986 |
void MsgViewManager::handleProvisoningMsg(int msgId) |
|
987 |
{ |
|
988 |
QString messageId; |
|
989 |
messageId.setNum(msgId); |
|
990 |
||
991 |
XQApplicationManager* aiwMgr = new XQApplicationManager(); |
|
992 |
||
993 |
XQAiwRequest* request = aiwMgr->create("com.nokia.services.MDM", "Provisioning", |
|
994 |
"ProcessMessage(QString)", true); // embedded |
|
995 |
||
996 |
if (request) { |
|
997 |
QList<QVariant> args; |
|
998 |
args << QVariant(messageId); |
|
999 |
request->setArguments(args); |
|
1000 |
||
1001 |
// Send the request |
|
1002 |
bool res = request->send(); |
|
1003 |
||
1004 |
// Cleanup |
|
1005 |
delete request; |
|
1006 |
} |
|
1007 |
||
1008 |
delete aiwMgr; |
|
1009 |
||
1010 |
// close the application once its handled |
|
1011 |
HbApplication::quit(); |
|
1012 |
} |
|
1013 |
||
1014 |
void MsgViewManager::setViewInteractive() |
|
1015 |
{ |
|
1016 |
if(!mMainWindow->isInteractive()) |
|
1017 |
{ |
|
1018 |
mMainWindow->setInteractive(true); |
|
1019 |
} |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1020 |
|
31 | 1021 |
disconnect(mMainWindow, SIGNAL(viewReady()),this,SLOT(setViewInteractive())); |
1022 |
} |
|
1023 |
||
1024 |
void MsgViewManager::appendViewToBeDeleted(HbView* view) |
|
1025 |
{ |
|
1026 |
if (view) |
|
1027 |
{ |
|
1028 |
mViewTobeDeleted << view; |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1029 |
connect(mMainWindow, SIGNAL(viewReady()), this, SLOT(deletePreviousView()), Qt::UniqueConnection); |
31 | 1030 |
} |
1031 |
} |
|
1032 |
||
1033 |
// ---------------------------------------------------------------------------- |
|
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1034 |
// MsgViewManager::populateEditorAfterViewReady |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1035 |
// @see header |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1036 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1037 |
void MsgViewManager::populateUniEditorAfterViewReady(const QVariantList& editorData) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1038 |
{ |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1039 |
QCRITICAL_WRITE("MsgViewManager::populateUniEditorAfterViewReady start."); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1040 |
//Save the editor data and use it in ViewReady handler |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1041 |
mEditorData = editorData; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1042 |
connect(mMainWindow, SIGNAL(viewReady()), this, SLOT(populateUniEditorView())); |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1043 |
QCRITICAL_WRITE("MsgViewManager::populateUniEditorAfterViewReady end."); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1044 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1045 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1046 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1047 |
// MsgViewManager::populateUniEditorView |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1048 |
// @see header |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1049 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1050 |
void MsgViewManager::populateUniEditorView() |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1051 |
{ |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1052 |
QCRITICAL_WRITE("MsgViewManager::populateUniEditorView start."); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1053 |
if (mUniEditor) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1054 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1055 |
mUniEditor->openDraftsMessage(mEditorData); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1056 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1057 |
mEditorData.clear(); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1058 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1059 |
disconnect(mMainWindow, SIGNAL(viewReady()), this, |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1060 |
SLOT(populateUniEditorView())); |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1061 |
QCRITICAL_WRITE("MsgViewManager::populateUniEditorView end."); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1062 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1063 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1064 |
// ---------------------------------------------------------------------------- |
31 | 1065 |
// MsgViewManager::onDialogDeleteMsg |
1066 |
// @see header |
|
1067 |
// ---------------------------------------------------------------------------- |
|
1068 |
void MsgViewManager::onDialogDeleteMsg(HbAction* action) |
|
1069 |
{ |
|
1070 |
HbMessageBox *dlg = qobject_cast<HbMessageBox*> (sender()); |
|
1071 |
if (action == dlg->actions().at(0)) { |
|
1072 |
QList<int> msgIdList; |
|
1073 |
msgIdList << mMessageId; |
|
1074 |
ConversationsEngine::instance()->deleteMessages(msgIdList); |
|
1075 |
} |
|
1076 |
HbApplication::quit(); // exit after handling |
|
1077 |
} |
|
1078 |
||
1079 |
// ---------------------------------------------------------------------------- |
|
1080 |
// MsgViewManager::onDialogSaveTone |
|
1081 |
// @see header |
|
1082 |
// ---------------------------------------------------------------------------- |
|
1083 |
void MsgViewManager::onDialogSaveTone(HbAction* action) |
|
1084 |
{ |
|
1085 |
HbMessageBox *dlg = qobject_cast<HbMessageBox*> (sender()); |
|
1086 |
if (action == dlg->actions().at(0)) { |
|
1087 |
UniDataModelLoader* pluginLoader = new UniDataModelLoader(); |
|
1088 |
UniDataModelPluginInterface* pluginInterface = pluginLoader->getDataModelPlugin( |
|
1089 |
ConvergedMessage::BioMsg); |
|
1090 |
pluginInterface->setMessageId(mMessageId); |
|
1091 |
UniMessageInfoList attachments = pluginInterface->attachmentList(); |
|
1092 |
||
1093 |
QString attachmentPath = attachments.at(0)->path(); |
|
1094 |
||
1095 |
RingBc* ringBc = new RingBc(); |
|
1096 |
ringBc->saveTone(attachmentPath); |
|
1097 |
||
1098 |
// clear attachement list : its allocated at data model |
|
1099 |
while (!attachments.isEmpty()) { |
|
1100 |
delete attachments.takeFirst(); |
|
1101 |
} |
|
1102 |
||
1103 |
delete ringBc; |
|
1104 |
delete pluginLoader; |
|
1105 |
} |
|
1106 |
||
1107 |
// close the application once its handled |
|
1108 |
HbApplication::quit(); |
|
1109 |
} |
|
1110 |
||
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1111 |
// ---------------------------------------------------------------------------- |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1112 |
// MsgViewManager::currentView |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1113 |
// @see header |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1114 |
// ---------------------------------------------------------------------------- |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1115 |
int MsgViewManager::currentView() |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1116 |
{ |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1117 |
return mCurrentView; |
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
1118 |
} |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1119 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1120 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1121 |
// MsgViewManager::switchToAudioFetcher |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1122 |
// @see header |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1123 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1124 |
void MsgViewManager::switchToAudioFetcher(const QVariantList& data) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1125 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1126 |
/** |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1127 |
* Audio Fetcher is tried to open again |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1128 |
*/ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1129 |
if(mAudioFetcherView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1130 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1131 |
return; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1132 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1133 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1134 |
//switch to Audio Fetcher view |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1135 |
mCurrentView = MsgBaseView::AUDIOFETCHER; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1136 |
mPreviousView = data.at(1).toInt(); |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1137 |
QVariantList editorData; |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1138 |
// i=2 because view manager consumed first two args |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1139 |
for (int i = 2; i < data.length(); i++) { |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1140 |
editorData << data.at(i); |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1141 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1142 |
mAudioFetcherView = new MsgAudioFetcherView(editorData); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1143 |
mAudioFetcherView->setNavigationAction(mBackAction); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1144 |
connect(mAudioFetcherView, SIGNAL(switchView(const QVariantList&)), this, |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1145 |
SLOT(switchView(const QVariantList&))); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1146 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1147 |
if(mPreviousView==MsgBaseView::CV && mConversationView) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1148 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1149 |
mConversationView->setPSCVId(false); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1150 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1151 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1152 |
mMainWindow->addView(mAudioFetcherView); |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1153 |
mMainWindow->setCurrentView(mAudioFetcherView,true,Hb::ViewSwitchSequential); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1154 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1155 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1156 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1157 |
// MsgViewManager::saveContentToDraft |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1158 |
// @see header |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1159 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1160 |
int MsgViewManager::saveContentToDraft() |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1161 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1162 |
int msgId = NULL_CONVERSATIONID; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1163 |
if( mCurrentView == MsgBaseView::CV ) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1164 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1165 |
msgId = mConversationView->saveContentToDrafts(); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1166 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1167 |
else if( mCurrentView ==MsgBaseView::UNIEDITOR) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1168 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1169 |
msgId = mUniEditor->saveContentToDrafts(); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1170 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1171 |
return msgId; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1172 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1173 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1174 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1175 |
// MsgViewManager::saveContentToDraft |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1176 |
// @see header |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1177 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1178 |
void MsgViewManager::openUniEditorActivity(int activityMsgId) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1179 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1180 |
int msgType; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1181 |
int msgSubType; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1182 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1183 |
qint32 messageId(activityMsgId); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1184 |
// get the message type |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1185 |
ConversationsEngine::instance()->markAsReadAndGetType(messageId, msgType, msgSubType); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1186 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1187 |
if (!mUniEditor) { |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1188 |
mUniEditor = new MsgUnifiedEditorView(); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1189 |
mMainWindow->addView(mUniEditor); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1190 |
mUniEditor->setNavigationAction(mBackAction); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1191 |
connect(mUniEditor, SIGNAL(switchView(const QVariantList&)), this, |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1192 |
SLOT(switchView(const QVariantList&))); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1193 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1194 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1195 |
// buffer data to open the draft message |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1196 |
ConvergedMessageId convergedMsgId(activityMsgId); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1197 |
ConvergedMessage message; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1198 |
message.setMessageType((ConvergedMessage::MessageType) msgType); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1199 |
message.setMessageId(convergedMsgId); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1200 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1201 |
// Launch uni-editor view |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1202 |
QByteArray dataArray; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1203 |
QDataStream messageStream(&dataArray, QIODevice::WriteOnly | QIODevice::Append); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1204 |
message.serialize(messageStream); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1205 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1206 |
QVariantList editorData; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1207 |
editorData << dataArray; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1208 |
mUniEditor->openDraftsMessage(editorData); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1209 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1210 |
// set the current view |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1211 |
mCurrentView = MsgBaseView::UNIEDITOR; |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1212 |
mPreviousView =MsgBaseView::CLV; |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
1213 |
mMainWindow->setCurrentView(mUniEditor,true,Hb::ViewSwitchSequential); |
43
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1214 |
} |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1215 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1216 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1217 |
// MsgViewManager::findContactId |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1218 |
// @see header |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1219 |
// ---------------------------------------------------------------------------- |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1220 |
qint32 MsgViewManager::findContactId(QString address) |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1221 |
{ |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1222 |
QString displayLabel; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1223 |
int count; |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1224 |
int localId = |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1225 |
MsgContactHandler::resolveContactDisplayName(address, |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1226 |
displayLabel, |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1227 |
count); |
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1228 |
|
35b64624a9e7
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
1229 |
return localId; |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1230 |
} |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1231 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
1232 |
//EOF |