Commit 77dd5f88 authored by blam's avatar blam

Merge branch 'jb50340-action-display-names' into 'master'

[commhistory-daemon] Update notification action display names. JB#50340

See merge request !40
parents cb66d7d2 f9648319
......@@ -55,10 +55,10 @@ namespace RTComLogger {
#define VOICEMAIL_METHOD QLatin1String("voicemail")
#define REPLACE_TYPE QLatin1String("sms-replace-number")
#define VOICEMAIL_WAITING_SERVICE QLatin1String("com.jolla.voicecall.ui")
#define VOICEMAIL_WAITING_OBJECT_PATH QLatin1String("/")
#define VOICEMAIL_WAITING_INTERFACE QLatin1String("com.jolla.voicecall.ui")
#define VOICEMAIL_WAITING_METHOD QLatin1String("openUrl")
#define VOICECALL_SERVICE QLatin1String("com.jolla.voicecall.ui")
#define VOICECALL_OBJECT_PATH QLatin1String("/")
#define VOICECALL_INTERFACE QLatin1String("com.jolla.voicecall.ui")
#define VOICECALL_DIAL_METHOD QLatin1String("dial")
// Custom hints for identifying notifications
#define ACCOUNT_PATH_HINT QLatin1String("x-org-nemomobile-qmlmessages.account.path")
......
......@@ -61,10 +61,10 @@
#define txt_qtn_msg_contact_card_label qtTrId("qtn_msg_contact_card_label")
//% "%1 | %2"
#define txt_qtn_msg_notification_new_vcard(STR) qtTrId("qtn_msg_received_contact_card").arg(txt_qtn_msg_contact_card_label).arg(STR)
//% "Show Messages"
#define txt_qtn_msg_notification_show_messages qtTrId("txt_qtn_msg_notification_show_messages")
//% "Reply"
#define txt_qtn_msg_notification_reply qtTrId("qtn_msg_notification_reply")
//% "Call"
#define txt_qtn_msg_notification_call qtTrId("qtn_msg_notification_call")
//% "%n attachment(s)"
#define txt_qtn_mms_notification_attachment(NUM) qtTrId("qtn_mms_notification_attachment", NUM)
//% "%1 | %2"
......@@ -79,15 +79,15 @@
#define txt_qtn_call_type_private qtTrId("qtn_call_type_private")
//% "Voicemail"
#define txt_qtn_call_type_voicemail qtTrId("qtn_call_type_voicemail")
//% "Show call history"
#define txt_qtn_call_notification_show_call_history qtTrId("txt_qtn_call_notification_show_call_history")
//% "Call back"
#define txt_qtn_call_notification_call_back qtTrId("txt_qtn_call_notification_call_back")
//% "Send message"
#define txt_qtn_call_notification_send_message qtTrId("txt_qtn_call_notification_send_message")
//% "Tap to listen"
#define txt_qtn_voicemail_prompt qtTrId("qtn_voicemail_prompt")
//% "Call voicemail"
#define txt_qtn_voicemail_notification_call qtTrId("txt_qtn_voicemail_notification_call")
//% "Show voicemail"
#define txt_qtn_voicemail_notification_show_voicemail qtTrId("txt_qtn_voicemail_notification_show_voicemail")
//% "Multimedia message was delivered to %1"
#define txt_qtn_msg_notification_delivered(STR) qtTrId("qtn_mms_info_delivered").arg(STR)
......
......@@ -609,14 +609,31 @@ void NotificationManager::setNotificationProperties(Notification *notification,
case PersonalNotification::Messaging:
if (pn->eventType() != VOICEMAIL_SMS_EVENT_TYPE && grouped) {
// Default action: show the inbox
remoteActions.append(dbusAction("default",
txt_qtn_msg_notification_show_messages,
QString(),
MESSAGING_SERVICE_NAME,
OBJECT_PATH,
MESSAGING_INTERFACE,
SHOW_INBOX_METHOD));
} else {
// Default action: show the message
remoteActions.append(dbusAction("default",
QString(),
MESSAGING_SERVICE_NAME,
OBJECT_PATH,
MESSAGING_INTERFACE,
START_CONVERSATION_METHOD,
QVariantList() << pn->account()
<< pn->targetId()
<< false));
}
if (pn->eventType() == CommHistory::Event::IMEvent
|| pn->eventType() == CommHistory::Event::SMSEvent
|| pn->eventType() == CommHistory::Event::MMSEvent) {
// Named action: "Reply"
remoteActions.append(dbusAction(QString(),
txt_qtn_msg_notification_reply,
MESSAGING_SERVICE_NAME,
OBJECT_PATH,
......@@ -624,21 +641,30 @@ void NotificationManager::setNotificationProperties(Notification *notification,
START_CONVERSATION_METHOD,
QVariantList() << pn->account()
<< pn->targetId()
<< static_cast<uint>(pn->chatType())));
<< true));
}
if (pn->eventType() == CommHistory::Event::SMSEvent
|| pn->eventType() == CommHistory::Event::MMSEvent
|| pn->eventType() == VOICEMAIL_SMS_EVENT_TYPE) {
// Named action: "Call"
remoteActions.append(dbusAction(QString(),
txt_qtn_msg_notification_call,
VOICECALL_SERVICE,
VOICECALL_OBJECT_PATH,
VOICECALL_INTERFACE,
VOICECALL_DIAL_METHOD,
QVariantList() << pn->remoteUid()));
}
remoteActions.append(dbusAction("app",
QString(),
MESSAGING_SERVICE_NAME,
OBJECT_PATH,
MESSAGING_INTERFACE,
SHOW_INBOX_METHOD));
break;
case PersonalNotification::Voice:
// Missed calls.
// Default action: show Call History
remoteActions.append(dbusAction("default",
txt_qtn_call_notification_show_call_history,
QString(),
CALL_HISTORY_SERVICE_NAME,
CALL_HISTORY_OBJECT_PATH,
CALL_HISTORY_INTERFACE,
......@@ -651,12 +677,32 @@ void NotificationManager::setNotificationProperties(Notification *notification,
CALL_HISTORY_INTERFACE,
CALL_HISTORY_METHOD,
QVariantList() << CALL_HISTORY_PARAMETER));
remoteActions.append(dbusAction(QString(),
txt_qtn_call_notification_call_back,
VOICECALL_SERVICE,
VOICECALL_OBJECT_PATH,
VOICECALL_INTERFACE,
VOICECALL_DIAL_METHOD,
QVariantList() << pn->remoteUid()));
remoteActions.append(dbusAction(QString(),
txt_qtn_call_notification_send_message,
MESSAGING_SERVICE_NAME,
OBJECT_PATH,
MESSAGING_INTERFACE,
START_CONVERSATION_METHOD,
QVariantList() << pn->account()
<< pn->targetId()
<< true));
break;
case PersonalNotification::Voicemail:
// Default action: show voicemail
remoteActions.append(dbusAction("default",
txt_qtn_voicemail_notification_show_voicemail,
QString(),
CALL_HISTORY_SERVICE_NAME,
VOICEMAIL_OBJECT_PATH,
VOICEMAIL_INTERFACE,
......@@ -846,21 +892,18 @@ void NotificationManager::slotVoicemailWaitingChanged()
voicemailNotification.setItemCount(voicemailCount);
QString displayName;
QString service;
QString path;
QString iface;
QString method;
QVariantList args;
if (!voicemailNumber.isEmpty()) {
displayName = txt_qtn_voicemail_notification_call;
service = VOICEMAIL_WAITING_SERVICE;
path = VOICEMAIL_WAITING_OBJECT_PATH;
iface = VOICEMAIL_WAITING_INTERFACE;
method = VOICEMAIL_WAITING_METHOD;
service = VOICECALL_SERVICE;
path = VOICECALL_OBJECT_PATH;
iface = VOICECALL_INTERFACE;
method = VOICECALL_DIAL_METHOD;
args.append(QVariant(QVariantList() << QString(QStringLiteral("tel://")) + voicemailNumber));
} else {
displayName = txt_qtn_call_notification_show_call_history;
service = CALL_HISTORY_SERVICE_NAME;
path = CALL_HISTORY_OBJECT_PATH;
iface = CALL_HISTORY_INTERFACE;
......@@ -868,7 +911,7 @@ void NotificationManager::slotVoicemailWaitingChanged()
args.append(CALL_HISTORY_PARAMETER);
}
voicemailNotification.setRemoteActions(QVariantList() << dbusAction("default", displayName, service, path, iface, method, args)
voicemailNotification.setRemoteActions(QVariantList() << dbusAction("default", QString(), service, path, iface, method, args)
<< dbusAction("app", QString(), service, path, iface, method, args));
voicemailNotification.setReplacesId(currentId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment