1 /* |
1 /* |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
14 * Description: BTRecvcompletedDialogWidget class declaration. |
14 * Description: BTRecvcompletedDialogWidget class declaration. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include "btrecvcompleteddialogwidget.h" |
18 #include "btrecvcompleteddialogwidget.h" |
19 #include <xqaiwrequest.h> |
|
20 #include <xqappmgr.h> |
|
21 #include <QThreadPool> |
|
22 #include "bluetoothdevicedialogs.h" |
19 #include "bluetoothdevicedialogs.h" |
23 |
20 |
24 const char* DOCML_BT_RECV_CMPLTD_DIALOG = ":/docml/bt-receive-done-dialog.docml"; |
21 const char* DOCML_BT_RECV_CMPLTD_DIALOG = ":/docml/bt-receive-done-dialog.docml"; |
25 const qint64 KBluetoothMsgsConversationId = 0x01; |
|
26 |
|
27 |
|
28 CoversationViewServiceStarter::CoversationViewServiceStarter(qint64 conversationId) |
|
29 :mCnvId(conversationId) |
|
30 { |
|
31 |
|
32 } |
|
33 |
|
34 CoversationViewServiceStarter::~CoversationViewServiceStarter() |
|
35 { |
|
36 |
|
37 } |
|
38 |
|
39 void CoversationViewServiceStarter::run() |
|
40 { |
|
41 QList<QVariant> args; |
|
42 QString serviceName("com.nokia.services.hbserviceprovider"); |
|
43 QString operation("open(qint64)"); |
|
44 XQAiwRequest* request; |
|
45 XQApplicationManager appManager; |
|
46 request = appManager.create(serviceName, "conversationview", operation, false); // not embedded |
|
47 if ( request == NULL ) |
|
48 { |
|
49 return; |
|
50 } |
|
51 args << QVariant(mCnvId); |
|
52 request->setArguments(args); |
|
53 request->send(); |
|
54 delete request; |
|
55 } |
|
56 |
22 |
57 |
23 |
58 BTRecvcompletedDialogWidget::BTRecvcompletedDialogWidget(const QVariantMap ¶meters) |
24 BTRecvcompletedDialogWidget::BTRecvcompletedDialogWidget(const QVariantMap ¶meters) |
|
25 |
59 :mLoader(0), |
26 :mLoader(0), |
60 mOpenConversationView(false) |
27 mOpenConversationView(false) |
61 { |
28 { |
62 constructDialog(parameters); |
29 constructDialog(parameters); |
63 } |
30 } |
188 return true; |
155 return true; |
189 } |
156 } |
190 |
157 |
191 void BTRecvcompletedDialogWidget::showClicked() |
158 void BTRecvcompletedDialogWidget::showClicked() |
192 { |
159 { |
193 if(mOpenConversationView) |
|
194 { |
|
195 CoversationViewServiceStarter* service = new CoversationViewServiceStarter(KBluetoothMsgsConversationId); |
|
196 service->setAutoDelete(true); |
|
197 |
|
198 QThreadPool::globalInstance()->start(service); |
|
199 } |
|
200 |
|
201 QVariantMap data; |
160 QVariantMap data; |
202 data.insert(QString("actionResult"), QVariant(TBluetoothDialogParams::EShow)); |
161 data.insert(QString("actionResult"), QVariant(TBluetoothDialogParams::EShow)); |
203 emit deviceDialogData(data); |
162 emit deviceDialogData(data); |
204 emit deviceDialogClosed(); |
163 emit deviceDialogClosed(); |
205 } |
164 } |