Modify the file sent / received string as 3.0 UX guideline 96/99196/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 22 Nov 2016 06:53:12 +0000 (15:53 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 22 Nov 2016 06:57:19 +0000 (15:57 +0900)
Change-Id: Iaddde1f1fb6239bffcc971ded39fbdc37ea628b1
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-share/include/bt-share-resource.h
bt-share/src/bt-share-notification.c
packaging/bluetooth-share.spec

index c9ca4ef..e6d17d8 100644 (file)
@@ -41,6 +41,10 @@ extern "C" {
        dgettext(BT_COMMON_PKG, "IDS_ST_BODY_FILES_SENT_ABB")
 #define BT_STR_FILES_RECEIVED\
        dgettext(BT_COMMON_PKG, "IDS_ST_BODY_FILES_RECEIVED_ABB")
+#define BT_STR_FILES_SENT_TO \
+       dgettext(BT_COMMON_PKG, "IDS_WIFI_BODY_FILES_SENT_TO_PS_M_STATUS")
+#define BT_STR_FILES_RECEIVED_FROM \
+       dgettext(BT_COMMON_PKG, "IDS_WIFI_MBODY_FILES_RECEIVED_FROM_PS")
 
 #define BT_STR_SENDING_FILES_TO \
        dgettext(BT_COMMON_PKG, "IDS_WIFI_BODY_SENDING_FILES_TO_PS_ING")
index 2072184..b82193c 100644 (file)
@@ -128,6 +128,7 @@ notification_h _bt_insert_notification(bt_appdata_t *ad,
        notification_h noti = NULL;
        notification_error_e ret = NOTIFICATION_ERROR_NONE;
        notification_type_e noti_type = NOTIFICATION_TYPE_NONE;
+       char *stms_str = NULL;
        char *title = NULL;
        char *content = NULL;
        char *icon_path = NULL;
@@ -144,17 +145,19 @@ notification_h _bt_insert_notification(bt_appdata_t *ad,
                success = ad->send_data.tr_success;
                fail = ad->send_data.tr_fail;
 
-               if (success == 0)
-                       title = "IDS_BT_MBODY_SENDING_FAILED";
-               else
-                       title = "IDS_BT_MBODY_FILE_SENT";
+               if (success == 0) {
+                       title = g_strdup("IDS_BT_MBODY_SENDING_FAILED");
+               } else {
+                       stms_str = BT_STR_FILES_SENT_TO;
+                       title = g_strdup_printf(stms_str, dev_name);
+               }
 
                if (success == 0 && fail > 0)
-                       content = "IDS_BT_SBODY_PD_FAILED_ABB";
+                       content = g_strdup("IDS_BT_SBODY_PD_FAILED_ABB");
                else if (fail == 0 && success > 0)
-                       content = "IDS_BT_SBODY_PD_SUCCEEDED_ABB";
+                       content = g_strdup("IDS_BT_SBODY_PD_SUCCEEDED_ABB");
                else
-                       content = "IDS_BT_SBODY_P1SD_SUCCEEDED_P2SD_FAILED_ABB2";
+                       content = g_strdup("IDS_BT_SBODY_P1SD_SUCCEEDED_P2SD_FAILED_ABB2");
 
                icon_path = BT_ICON_NOTIFICATION_SENT;
                indicator_icon_path = BT_ICON_NOTIFICATION_SENT_INDICATOR;
@@ -165,13 +168,16 @@ notification_h _bt_insert_notification(bt_appdata_t *ad,
                success = ad->recv_data.tr_success;
                fail = ad->recv_data.tr_fail;
 
-               title = "IDS_BT_MBODY_FILE_RECEIVED";
                if (success == 0 && fail > 0) {
                        content = "IDS_BT_SBODY_PD_FAILED_ABB";
-                       title = "IDS_BT_MBODY_RECEIVING_FAILED";
+                       title = g_strdup("IDS_BT_MBODY_RECEIVING_FAILED");
                } else if (fail == 0 && success > 0) {
+                       stms_str = BT_STR_FILES_RECEIVED_FROM;
+                       title = g_strdup_printf(stms_str, dev_name);
                        content = "IDS_BT_SBODY_PD_SUCCEEDED_ABB";
                } else {
+                       stms_str = BT_STR_FILES_RECEIVED_FROM;
+                       title = g_strdup_printf(stms_str, dev_name);
                        content = "IDS_BT_SBODY_P1SD_SUCCEEDED_P2SD_FAILED_ABB2";
                }
                icon_path = BT_ICON_NOTIFICATION_RECEIVED;
@@ -180,13 +186,13 @@ notification_h _bt_insert_notification(bt_appdata_t *ad,
                app_id = NOTI_OPS_APP_ID;
                noti_type = NOTIFICATION_TYPE_NOTI;
        } else if (type == BT_SENDING_NOTI) {
-               title = "IDS_BT_SBODY_PREPARING_TO_SEND_FILES_ING_ABB";
+               title = g_strdup("IDS_BT_SBODY_PREPARING_TO_SEND_FILES_ING_ABB");
                icon_path = BT_ICON_NOTIFICATION_SENDING;
                indicator_icon_path = BT_ICON_NOTIFICATION_SENDING_INDICATOR;
                flag = NOTIFICATION_PROP_DISABLE_TICKERNOTI;
                noti_type = NOTIFICATION_TYPE_ONGOING;
        } else if (type == BT_RECEIVING_NOTI) {
-               title = "IDS_BT_SBODY_PREPARING_TO_RECEIVE_FILES_ING_ABB";
+               title = g_strdup("IDS_BT_SBODY_PREPARING_TO_RECEIVE_FILES_ING_ABB");
                icon_path = BT_ICON_NOTIFICATION_RECEIVING;
                indicator_icon_path = BT_ICON_NOTIFICATION_RECEIVING_INDICATOR;
                flag = NOTIFICATION_PROP_DISABLE_TICKERNOTI;
@@ -194,7 +200,11 @@ notification_h _bt_insert_notification(bt_appdata_t *ad,
        }
 
        noti = notification_create(noti_type);
-       retvm_if(!noti, NULL, "Fail to notification_create");
+       if (!noti) {
+               ERR("Fail to notification_create");
+               g_free(title);
+               return NULL;
+       }
 
        notification_set_text_domain(noti, BT_COMMON_PKG, BT_COMMON_RES);
 
@@ -202,6 +212,7 @@ notification_h _bt_insert_notification(bt_appdata_t *ad,
                ret = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
                        NULL, title,
                        NOTIFICATION_VARIABLE_TYPE_NONE);
+               free(title);
                warn_if(ret != NOTIFICATION_ERROR_NONE,
                        "Fail to notification_set_text [%d]", ret);
        }
index dd616ab..b3e1fc3 100644 (file)
@@ -4,7 +4,7 @@
 
 Name:       bluetooth-share
 Summary:    Bluetooth file share Agent
-Version:    0.0.47
+Version:    0.0.48
 Release:    0
 Group:      Network & Connectivity/Bluetooth
 License:    Apache-2.0