author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Fri, 17 Sep 2010 08:28:39 +0300 | |
changeset 70 | a15d9966050f |
parent 44 | 36f374c67aa8 |
permissions | -rw-r--r-- |
31 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#include "msgerrornotifiersvc.h" |
|
19 |
#include <QVariant> |
|
20 |
#include <HbMessageBox> |
|
21 |
#include <HbDialog> |
|
22 |
#include <hbdevicemessagebox.h> |
|
23 |
#include <HbAction> |
|
24 |
#include <xqservicerequest.h> |
|
25 |
#include <xqaiwrequest.h> |
|
26 |
#include <xqappmgr.h> |
|
27 |
#include <ccsdefs.h> |
|
28 |
#include <qaction.h> |
|
29 |
||
30 |
#define LOC_VIEW hbTrId("txt_messaging_button_view") |
|
31 |
#define LOC_CANCEL hbTrId("txt_common_button_cancel") |
|
32 |
#define LOC_SEND_FAILURE hbTrId("txt_messaging_list_message_sending_failed") |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
33 |
#define LOC_MMS_RETRIEVAL_FAILED hbTrId("txt_messaging_dialog_mms_retrieval_failed") |
31 | 34 |
//--------------------------------------------------------- |
35 |
// Constructor |
|
36 |
//--------------------------------------------------------- |
|
37 |
MsgErrorNotifierSvc::MsgErrorNotifierSvc(QObject* parent) : |
|
38 |
XQServiceProvider(QLatin1String("messaging.com.nokia.symbian.MsgErrorNotifier"), parent) |
|
39 |
{ |
|
40 |
publishAll(); |
|
41 |
||
42 |
} |
|
43 |
//--------------------------------------------------------- |
|
44 |
// Destructor |
|
45 |
//--------------------------------------------------------- |
|
46 |
MsgErrorNotifierSvc::~MsgErrorNotifierSvc() |
|
47 |
{ |
|
48 |
} |
|
49 |
||
50 |
//--------------------------------------------------------- |
|
51 |
// displayErrorNote |
|
52 |
// @see msgerrornotifiersvc.h |
|
53 |
//--------------------------------------------------------- |
|
54 |
void MsgErrorNotifierSvc::displayErrorNote(QVariantList displayParams) |
|
55 |
{ |
|
56 |
||
57 |
HbDeviceMessageBox messageBox(HbMessageBox::MessageTypeWarning); |
|
58 |
QVariant first = displayParams[0]; |
|
59 |
QVariant second = displayParams[1]; |
|
60 |
QVariant third = displayParams[2]; |
|
61 |
||
62 |
int convId = second.toInt(); |
|
63 |
qint64 id = convId; |
|
64 |
QString errorNote; |
|
65 |
||
66 |
int msgType = third.toInt(); |
|
67 |
if (msgType == ECsMmsNotification) |
|
68 |
{ |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
69 |
errorNote.append(LOC_MMS_RETRIEVAL_FAILED); |
31 | 70 |
} |
71 |
else |
|
72 |
{ |
|
73 |
errorNote.append(LOC_SEND_FAILURE); |
|
74 |
errorNote.append(QChar(QChar::LineSeparator)); |
|
75 |
||
76 |
QString contactName = first.toString(); |
|
77 |
errorNote.append(contactName); |
|
78 |
} |
|
79 |
||
80 |
messageBox.setTimeout(HbPopup::NoTimeout); |
|
81 |
messageBox.setText(errorNote); |
|
82 |
QAction* actionView = new QAction(LOC_VIEW,this); |
|
83 |
messageBox.setAction(actionView,HbDeviceMessageBox::AcceptButtonRole); |
|
84 |
||
85 |
QAction* actionQuit = new QAction(LOC_CANCEL,this); |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
86 |
messageBox.setAction(actionQuit,HbDeviceMessageBox::RejectButtonRole); |
31 | 87 |
|
88 |
setCurrentRequestAsync(); |
|
70
a15d9966050f
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
44
diff
changeset
|
89 |
|
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
90 |
// launch Messagebox |
31 | 91 |
const QAction* result = messageBox.exec(); |
44
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
92 |
|
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
93 |
// if accepted launch view else quit |
36f374c67aa8
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
43
diff
changeset
|
94 |
if (messageBox.isAcceptAction(result)) { |
31 | 95 |
QList<QVariant> args; |
96 |
QString serviceName("com.nokia.services.hbserviceprovider"); |
|
97 |
QString operation("open(qint64)"); |
|
98 |
XQAiwRequest* request; |
|
99 |
XQApplicationManager appManager; |
|
100 |
request = appManager.create(serviceName, "conversationview", operation, false); // embedded |
|
101 |
if (request == NULL) { |
|
102 |
return; |
|
103 |
} |
|
104 |
args << QVariant(id); |
|
105 |
request->setArguments(args); |
|
106 |
request->send(); |
|
107 |
delete request; |
|
108 |
} |
|
109 |
} |