|
1 /* |
|
2 * Copyright (c) 2010 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 * MsgErrorWatcher implementation file |
|
16 * |
|
17 */ |
|
18 |
|
19 // SYSTEM INCLUDES |
|
20 #include <hbmessagebox.h> |
|
21 |
|
22 //USER INCLUDES |
|
23 #include "msgerrorwatcher.h" |
|
24 #include "msgerrorwatcher_p.h" |
|
25 #include <hbdevicemessagebox.h> |
|
26 #include <hbnotificationdialog.h> |
|
27 #include <HbDeviceNotificationDialog> |
|
28 #include "debugtraces.h" |
|
29 #include <HbDeviceMessageBox> |
|
30 #include <xqaiwrequest.h> |
|
31 #include <xqappmgr.h> |
|
32 #include "msgsettingsview.h" |
|
33 // LOCAL CONSTANTS AND MACROS |
|
34 #define LOC_MSG_ERRH_DISK_LOW_1 hbTrId("MMS message isn't fetched because disk space is low. Free some memory first.") |
|
35 #define LOC_MSG_ERRH_MEMORY_LOW hbTrId("MMS message is not been fetched because device memory is low. Try to close other applications.") |
|
36 #define LOC_MMS_OFF hbTrId("The MMS message reception is now off. You should change the reception to Always enabled in order to receive MMS messages while roaming.") |
|
37 #define LOC_MSG_ERRH_ACCESS_POINTS_INV hbTrId("MMS Access Points are not valid. Please check the access point data.") |
|
38 #define LOC_OK hbTrId("Ok") |
|
39 #define LOC_CANCEL hbTrId("Cancel") |
|
40 // ---------------------------------------------------------------------------- |
|
41 // MsgErrorWatcher::MsgErrorWatcher |
|
42 // @see MsgErrorWatcher.h |
|
43 // ---------------------------------------------------------------------------- |
|
44 MsgErrorWatcher::MsgErrorWatcher(QObject* parent) : |
|
45 QObject(parent) |
|
46 { |
|
47 QDEBUG_WRITE("MsgErrorWatcher::MsgErrorWatcher : Enter") |
|
48 |
|
49 d_ptr = new CMsgErrorWatcherPrivate(this); |
|
50 // load the messaging ts file. |
|
51 |
|
52 QDEBUG_WRITE("MsgErrorWatcher::MsgErrorWatcher : Exit") |
|
53 } |
|
54 |
|
55 // ---------------------------------------------------------------------------- |
|
56 // MsgErrorWatcher::~MsgErrorWatcher |
|
57 // @see MsgErrorWatcher.h |
|
58 // ---------------------------------------------------------------------------- |
|
59 MsgErrorWatcher::~MsgErrorWatcher() |
|
60 { |
|
61 QDEBUG_WRITE("MsgErrorWatcher::~MsgErrorWatcher : Enter") |
|
62 |
|
63 delete d_ptr; |
|
64 |
|
65 QDEBUG_WRITE("MsgErrorWatcher::~MsgErrorWatcher : Exit") |
|
66 } |
|
67 |
|
68 // ---------------------------------------------------------------------------- |
|
69 // MsgErrorWatcher::~MsgErrorWatcher |
|
70 // @see MsgErrorWatcher.h |
|
71 // ---------------------------------------------------------------------------- |
|
72 void MsgErrorWatcher::ShowNote(TMsgErrorNoteIds errornoteid) |
|
73 { |
|
74 QDEBUG_WRITE("MsgErrorWatcher::ShowNote : Enter") |
|
75 QDEBUG_WRITE_FORMAT("errornoteid : ", errornoteid) |
|
76 HbDeviceMessageBox messageBox(HbMessageBox::MessageTypeWarning); |
|
77 QAction* actionView = NULL; |
|
78 QAction* actionQuit = NULL; |
|
79 const QAction* result = NULL; |
|
80 //create dialog parameters |
|
81 QString text(""); |
|
82 switch (errornoteid) { |
|
83 case EDiskLowNote1: |
|
84 text = LOC_MSG_ERRH_DISK_LOW_1; |
|
85 break; |
|
86 case EMemoryLowNote: |
|
87 text = LOC_MSG_ERRH_MEMORY_LOW; |
|
88 break; |
|
89 case ERoamingNote: |
|
90 text = LOC_MMS_OFF; |
|
91 break; |
|
92 case EInvalidAccessPointNote: |
|
93 text = LOC_MSG_ERRH_ACCESS_POINTS_INV; |
|
94 messageBox.setTimeout(HbPopup::NoTimeout); |
|
95 messageBox.setText(text); |
|
96 actionView = new QAction(LOC_OK, this); |
|
97 messageBox.setAction(actionView, HbDeviceMessageBox::AcceptButtonRole); |
|
98 |
|
99 actionQuit = new QAction(LOC_CANCEL, this); |
|
100 messageBox.setAction(actionQuit, HbDeviceMessageBox::RejectButtonRole); |
|
101 |
|
102 messageBox.setDismissPolicy(HbPopup::NoDismiss); |
|
103 // launch Messagebox |
|
104 result = messageBox.exec(); |
|
105 |
|
106 // if accepted launch view else quit |
|
107 if (messageBox.isAcceptAction(result)) { |
|
108 QList<QVariant> args; |
|
109 QString serviceName("messagesettings"); |
|
110 QString operation("launchSettings(int)"); |
|
111 XQAiwRequest* request; |
|
112 XQApplicationManager appManager; |
|
113 request = appManager.create(serviceName, "com.nokia.symbian.IMessageSettings", |
|
114 operation, false); // non embedded |
|
115 if (request == NULL) { |
|
116 return; |
|
117 } |
|
118 args << QVariant(MsgSettingsView::MMSView); |
|
119 request->setArguments(args); |
|
120 request->send(); |
|
121 delete request; |
|
122 } |
|
123 return; |
|
124 default: |
|
125 break; |
|
126 } |
|
127 HbDeviceNotificationDialog::notification("", text); |
|
128 QDEBUG_WRITE("MsgErrorWatcher::ShowNote : Exit") |
|
129 |
|
130 } |
|
131 |
|
132 //EOF |