Merge branch 'master' into tizen_2.1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 22 Mar 2013 00:05:34 +0000 (09:05 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Fri, 22 Mar 2013 00:05:34 +0000 (09:05 +0900)
Change-Id: I3edb1cea8dcf40ebd52ba32b8f84f26d74e3b306

bluetooth-share-ui.manifest
packaging/org.tizen.bluetooth-share-ui.spec
src/bt-share-ui-ipc.c
src/bt-share-ui-main.c
src/bt-share-ui-main.h
src/bt-share-ui-resource.h
src/bt-share-ui-view.c

index 75b0fa5..dbab204 100644 (file)
@@ -1,5 +1,13 @@
 <manifest>
+    <define>
+        <domain name="org.tizen.bluetooth-share-ui"/>
+    </define>
+    <assign>
+        <filesystem path="/usr/apps/org.tizen.bluetooth-share-ui/bin/*" label="_"/>
+        <filesystem path="/usr/apps/org.tizen.bluetooth-share-ui/res/*" label="_"/>
+        <filesystem path="/opt/share/icons/default/small/org.tizen.bluetooth-share-ui.png" label="_"/>
+    </assign>
     <request>
-        <domain name="_"/>
+        <domain name="org.tizen.bluetooth-share-ui"/>
     </request>
 </manifest>
index 75949cc..440ae27 100644 (file)
@@ -37,6 +37,9 @@ bluetooth share UI application
 %setup -q
 
 %build
+export CFLAGS+=" -fpie -fvisibility=hidden"
+export LDFLAGS+=" -Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs -pie"
+
 cmake . -DCMAKE_INSTALL_PREFIX=%{_appdir}/org.tizen.bluetooth-share-ui
 make %{?jobs:-j%jobs}
 
index 5854d26..ebac272 100644 (file)
@@ -363,7 +363,7 @@ int _bt_share_ui_ipc_retry_send(bt_share_appdata_t *ad, bt_tr_data_t *info)
        if (mode == NULL)
                return -1;
 
-       bd_addr = (char *)calloc(sizeof(char *), BT_ADDRESS_LENGTH_MAX);
+       bd_addr = (char *)calloc(sizeof(char), BT_ADDRESS_LENGTH_MAX);
        if (bd_addr == NULL) {
                free(mode);
                return -1;
@@ -391,9 +391,10 @@ int _bt_share_ui_ipc_retry_send(bt_share_appdata_t *ad, bt_tr_data_t *info)
                                      DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE,
                                      &bd_addr, BT_ADDRESS_LENGTH_MAX,
                                      DBUS_TYPE_INT32, &filecount,
-                                     DBUS_TYPE_STRING, &info->file_path,
+                                     DBUS_TYPE_STRING, &info->content,
                                      DBUS_TYPE_STRING, &mode,
                                      DBUS_TYPE_STRING, &info->dev_name,
+                                     DBUS_TYPE_STRING, &info->type,
                                      DBUS_TYPE_INVALID)) {
                ERR("Connect sending failed\n");
                dbus_message_unref(msg);
index 74640a4..bf6eed8 100644 (file)
@@ -306,7 +306,7 @@ static int __app_resume(void *data)
 }
 
 
-int main(int argc, char *argv[])
+EXPORT int main(int argc, char *argv[])
 {
        bt_share_appdata_t ad;
        app_state = &ad;
index ea71a63..ee8a948 100644 (file)
@@ -26,6 +26,7 @@ extern "C" {
 #include <glib.h>
 #include <dbus/dbus-glib.h>
 
+#define EXPORT __attribute__((visibility("default")))
 
 #if !defined(PACKAGE)
 #define PACKAGE "org.tizen.bluetooth-share-ui"
@@ -49,7 +50,8 @@ typedef enum {
        BT_FT_RECV_FAIL_POPUP,
        BT_FT_RECV_SUCCESS_POPUP,
        BT_FT_SENT_POPUP,
-       BT_FT_RETRY_POPUP
+       BT_FT_RETRY_POPUP,
+       BT_FT_FILE_NOT_EXIST
 } bt_share_ft_popup_type_t;
 
 typedef struct {
index ae1cc79..2cbc3f4 100644 (file)
@@ -58,31 +58,51 @@ extern "C" {
        dgettext(BT_COMMON_PKG, "IDS_BT_POP_SENDINGFAIL")
 #define BT_STR_FT      \
        dgettext(BT_COMMON_PKG, "IDS_BT_BODY_FILE_TRANSFER")
-
-#define BT_STR_SHARING_FN  _("Sharing... %s")
-#define BT_STR_INBOUND_TR  _("Inbound transfers")
-#define BT_STR_OUTBOUND_TR  _("Outbound transfers")
-#define BT_STR_CLR_LIST  _("Clear list")
-#define BT_STR_YESTERDAY  _("Yesterday")
-#define BT_STR_FILE_NOT_RECV  _("File not received")
-#define BT_STR_FILE_S  _("File: %s")
-#define BT_STR_FAIL_S  _("Failure reason: %s")
-#define BT_STR_TR_CANCELLED _("Transfer Cancelled")
-#define BT_STR_TO_S _("To: %s")
-#define BT_STR_FROM_S _("From: %s")
-#define BT_STR_FILE_TYPE_S _("File type: %s")
-#define BT_STR_FILE_SIZE_S _("File size: %s")
-#define BT_STR_SEND_FAIL_TO_S _("Sending failed to %s")
-#define BT_STR_RETRY _("Retry")
-#define BT_STR_TR_HISTORY_EMPTY _("Transfer history is empty")
-#define BT_STR_SHARING  _("Sharing... ")
-#define BT_STR_RECEIVING  _("Receiving...")
-#define BT_STR_UNABLE_TO_RECEIVE "Unable to receive"
+#define BT_STR_SHARING \
+       dgettext(BT_COMMON_PKG, "IDS_BT_POP_SHARING_ING")
+#define BT_STR_RECEIVING       \
+       dgettext(BT_COMMON_PKG, "IDS_BT_POP_RECEIVING_ING")
+#define BT_STR_INBOUND_TR      \
+       dgettext(BT_COMMON_PKG, "IDS_BT_BODY_INBOUND_TRANSFERS")
+#define BT_STR_OUTBOUND_TR     \
+       dgettext(BT_COMMON_PKG, "IDS_BT_BODY_OUTBOUND_TRANSFERS")
+#define BT_STR_CLR_LIST        \
+       dgettext(BT_COMMON_PKG, "IDS_BT_BODY_CLEAR_LIST")
+#define BT_STR_FILE_NOT_EXIST  \
+       dgettext(BT_COMMON_PKG, "IDS_BT_POP_FILE_DOES_NOT_EXIST")
+#define BT_STR_TR_HISTORY_EMPTY        \
+       dgettext(BT_COMMON_PKG, "IDS_BT_BODY_TRANSFER_HISTORY_EMPTY")
+#define BT_STR_SEND_FAIL_TO_S  \
+       dgettext(BT_COMMON_PKG, "IDS_BT_BODY_SENDING_FAILED_TO_PS")
+#define BT_STR_FILE_NOT_RECV   \
+       dgettext(BT_COMMON_PKG, "IDS_BT_POP_FILE_NOT_RECEIVED")
+#define BT_STR_FILE_S  \
+       dgettext(BT_COMMON_PKG, "IDS_BT_POP_FILE_C_PS")
+#define BT_STR_FAIL_S  \
+       dgettext(BT_COMMON_PKG, "IDS_BT_POP_FAILURE_REASON_C_PS")
+#define BT_STR_TO_S    \
+       dgettext(BT_COMMON_PKG, "IDS_BT_POP_TO_C_PS")
+#define BT_STR_FILE_TYPE_S     \
+       dgettext(BT_COMMON_PKG, "IDS_BT_POP_FILE_TYPE_C_PS")
+#define BT_STR_FILE_SIZE_S     \
+       dgettext(BT_COMMON_PKG, "IDS_BT_POP_FILE_SIZE_C_PS")
+#define BT_STR_FROM_S  \
+       dgettext(BT_COMMON_PKG, "IDS_BT_HEADER_FROM_C_PS")
+#define BT_STR_TR_CANCELLED    \
+       dgettext(BT_COMMON_PKG, "IDS_BT_POP_TRANSFER_CANCELLED")
+#define BT_STR_UNABLE_TO_RECEIVE       \
+       dgettext(BT_COMMON_PKG, "IDS_BT_BODY_UNABLE_TO_RECEIVE")
 
 #define BT_STR_INFORMATION dgettext("sys_string", "IDS_COM_OPT_INFORMATION")
 #define BT_STR_OK dgettext("sys_string", "IDS_COM_SK_OK")
 #define BT_STR_CANCEL dgettext("sys_string", "IDS_COM_SK_CANCEL")
 #define BT_STR_CLOSE dgettext("sys_string", "IDS_COM_BODY_CLOSE")
+#define BT_STR_YESTERDAY dgettext("sys_string", "IDS_COM_BODY_YESTERDAY")
+#define BT_STR_RETRY dgettext("sys_string", "IDS_COM_SK_RETRY")
+
+/* Access information */
+#define BT_STR_ACCES_INFO_MAX_LEN 512
+#define BT_STR_ACC_ICON "Icon"
 
 #ifdef __cplusplus
 }
index 1c0141f..341637c 100644 (file)
@@ -326,6 +326,11 @@ Evas_Object *_bt_create_ft_popup(bt_share_ft_popup_type_t type,
                elm_object_part_text_set(layout, "msg2", msg);
                snprintf(msg, sizeof(msg), BT_STR_FAIL_S, BT_STR_TR_CANCELLED);
                elm_object_part_text_set(layout, "msg3", msg);
+       } else if (type == BT_FT_FILE_NOT_EXIST) {
+               layout = _bt_create_popup_layout(ad);
+               elm_object_part_text_set(layout, "msg1", BT_STR_FILE_NOT_EXIST);
+               snprintf(msg, sizeof(msg), BT_STR_FILE_S, info->file_path);
+               elm_object_part_text_set(layout, "msg2", msg);
        } else  if (type == BT_FT_RETRY_POPUP) {
                layout = _bt_create_popup_layout(ad);
                snprintf(msg, sizeof(msg), BT_STR_SEND_FAIL_TO_S, info->dev_name);
@@ -917,20 +922,25 @@ static void __bt_tr_data_recv_item_sel(void *data, Evas_Object *obj,
                snprintf(path, BT_FILE_PATH_LEN_MAX-1, "%s/%s",
                                        DOWNLOAD_PATH, info->file_path);
 
-               ext = strrchr(path, '.') + 1;
+               ext = strrchr(path, '.');
                if (ext) {
-                       if (0 == strcmp(ext, "vcf") || 0 == strcmp(ext, "vcs")) {
-                               free(info->file_path);
-                               info->file_path = strdup(path);
+                       ext++;
+                       if (0 == g_strcmp0(ext, "vcf") || 0 == g_strcmp0(ext, "vcs")) {
+                               g_free(info->file_path);
+                               info->file_path = g_strdup(path);
                                _bt_create_ft_popup(BT_FT_RECV_SUCCESS_POPUP, info);
                                DBG("- \n");
                                return;
                        }
                }
 
-               __bt_open_received_file(path);
-               _bt_share_ui_ipc_info_update(ad, info->id);
-               __bt_sel_item_del(ad);
+               if (access(path, F_OK) == 0) {
+                       __bt_open_received_file(path);
+                       _bt_share_ui_ipc_info_update(ad, info->id);
+                       __bt_sel_item_del(ad);
+               } else {
+                       _bt_create_ft_popup(BT_FT_FILE_NOT_EXIST, info);
+               }
        } else {
                _bt_create_ft_popup(BT_FT_RECV_FAIL_POPUP, info);
        }