29 #include <xqsystemtoneservice.h> |
29 #include <xqsystemtoneservice.h> |
30 |
30 |
31 #define LOC_VIEW hbTrId("txt_messaging_button_view") |
31 #define LOC_VIEW hbTrId("txt_messaging_button_view") |
32 #define LOC_CANCEL hbTrId("txt_common_button_cancel") |
32 #define LOC_CANCEL hbTrId("txt_common_button_cancel") |
33 #define LOC_SEND_FAILURE hbTrId("txt_messaging_list_message_sending_failed") |
33 #define LOC_SEND_FAILURE hbTrId("txt_messaging_list_message_sending_failed") |
34 |
34 #define LOC_MMS_RETRIEVAL_FAILED hbTrId("txt_messaging_dialog_mms_retrieval_failed") |
35 //--------------------------------------------------------- |
35 //--------------------------------------------------------- |
36 // Constructor |
36 // Constructor |
37 //--------------------------------------------------------- |
37 //--------------------------------------------------------- |
38 MsgErrorNotifierSvc::MsgErrorNotifierSvc(QObject* parent) : |
38 MsgErrorNotifierSvc::MsgErrorNotifierSvc(QObject* parent) : |
39 XQServiceProvider(QLatin1String("messaging.com.nokia.symbian.MsgErrorNotifier"), parent) |
39 XQServiceProvider(QLatin1String("messaging.com.nokia.symbian.MsgErrorNotifier"), parent) |
71 QString errorNote; |
71 QString errorNote; |
72 |
72 |
73 int msgType = third.toInt(); |
73 int msgType = third.toInt(); |
74 if (msgType == ECsMmsNotification) |
74 if (msgType == ECsMmsNotification) |
75 { |
75 { |
76 errorNote.append("Message Retrieval Failed!");//TODO: use logical str name |
76 errorNote.append(LOC_MMS_RETRIEVAL_FAILED); |
77 } |
77 } |
78 else |
78 else |
79 { |
79 { |
80 errorNote.append(LOC_SEND_FAILURE); |
80 errorNote.append(LOC_SEND_FAILURE); |
81 errorNote.append(QChar(QChar::LineSeparator)); |
81 errorNote.append(QChar(QChar::LineSeparator)); |
88 messageBox.setText(errorNote); |
88 messageBox.setText(errorNote); |
89 QAction* actionView = new QAction(LOC_VIEW,this); |
89 QAction* actionView = new QAction(LOC_VIEW,this); |
90 messageBox.setAction(actionView,HbDeviceMessageBox::AcceptButtonRole); |
90 messageBox.setAction(actionView,HbDeviceMessageBox::AcceptButtonRole); |
91 |
91 |
92 QAction* actionQuit = new QAction(LOC_CANCEL,this); |
92 QAction* actionQuit = new QAction(LOC_CANCEL,this); |
93 actionQuit->setMenuRole(QAction::QuitRole); |
93 messageBox.setAction(actionQuit,HbDeviceMessageBox::RejectButtonRole); |
94 messageBox.setAction(actionView,HbDeviceMessageBox::RejectButtonRole); |
|
95 |
94 |
96 setCurrentRequestAsync(); |
95 setCurrentRequestAsync(); |
97 |
96 |
98 //Play audio alert when error notification is shown |
97 //Play audio alert when error notification is shown |
99 mSts->playTone(XQSystemToneService::MessageSendFailureTone); |
98 mSts->playTone(XQSystemToneService::MessageSendFailureTone); |
100 |
99 |
|
100 // launch Messagebox |
101 const QAction* result = messageBox.exec(); |
101 const QAction* result = messageBox.exec(); |
102 |
102 |
103 // TODO: use XQAiwrequest |
103 // if accepted launch view else quit |
104 if (result->menuRole() != QAction::QuitRole) { |
104 if (messageBox.isAcceptAction(result)) { |
105 QList<QVariant> args; |
105 QList<QVariant> args; |
106 QString serviceName("com.nokia.services.hbserviceprovider"); |
106 QString serviceName("com.nokia.services.hbserviceprovider"); |
107 QString operation("open(qint64)"); |
107 QString operation("open(qint64)"); |
108 XQAiwRequest* request; |
108 XQAiwRequest* request; |
109 XQApplicationManager appManager; |
109 XQApplicationManager appManager; |