Fix the notification for STMS
authorHyunjee Kim <hj0426.kim@samsung.com>
Mon, 17 Jun 2013 07:04:18 +0000 (16:04 +0900)
committerHyunjee Kim <hj0426.kim@samsung.com>
Tue, 18 Jun 2013 00:27:05 +0000 (09:27 +0900)
Change-Id: I224dca1a58878e0bb62d0ad36c9c4709ffaf15f4

CMakeLists.txt
include/mobileap_common.h
include/mobileap_notification.h
packaging/mobileap-agent.spec
src/mobileap_bluetooth.c
src/mobileap_handler.c
src/mobileap_main.c

index 45b36e4..86d7f34 100644 (file)
@@ -28,7 +28,7 @@ MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 INCLUDE_DIRECTORIES(${INCLUDE_DIR})
 
 INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED dlog dbus-glib-1 pmapi vconf notification libssl secure-storage capi-network-connection capi-network-bluetooth ${PRIVATE_REQUIRED_PKGS})
+pkg_check_modules(pkgs REQUIRED dlog dbus-glib-1 pmapi vconf notification libssl secure-storage capi-network-connection capi-network-bluetooth appcore-common ${PRIVATE_REQUIRED_PKGS})
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
index 5760577..ab1e549 100644 (file)
 
 #include "mobileap_agent.h"
 
-/* Need translation */
-#define MH_NOTI_STR    "Connected device (%d)"
-#define MH_NOTI_TITLE  "Tethering"
-
 gint _slist_find_station_by_interface(gconstpointer a, gconstpointer b);
 gint _slist_find_station_by_mac(gconstpointer a, gconstpointer b);
 gint _slist_find_station_by_ip_addr(gconstpointer a, gconstpointer b);
index 77adfae..b457aa8 100644 (file)
 #define MH_NOTI_STR_MAX                50
 #define MH_NOTI_ICON_PATH      "/usr/ug/res/images/ug-setting-mobileap-efl/tethering.png"
 
+#define MOBILEAP_LOCALE_COMMON_PKG             "ug-setting-mobileap-efl"
+#define MOBILEAP_LOCALE_COMMON_RES             "/usr/ug/res/locale"
+
+#define _(str)                 dgettext(MOBILEAP_LOCALE_COMMON_PKG, str)
+
+#define MH_NOTI_STR    _("IDS_MOBILEAP_POP_CONNECTED_DEVICES_C_PD")
+#define MH_NOTI_TITLE  _("IDS_MOBILEAP_BODY_TETHERING")
+#define MH_NOTI_TIMEOUT_STR    _("IDS_MOBILEAP_BODY_TAP_TO_CONFIGURE_TETHERING")
+#define MH_NOTI_TIMEOUT_TITLE  "Disable tethering by timeout"
+#define MH_NOTI_BT_VISIBILITY_STR      _("IDS_ST_BODY_BLUETOOTH_VISIBILITY_HAS_TIMED_OUT_YOUR_DEVICE_MIGHT_NOT_BE_FOUND")
+
+
 int _create_timeout_noti(const char *content, const char *title,
                const char *icon_path);
 int _delete_timeout_noti(void);
index 0d0f3ec..21b6595 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mobileap-agent
 Summary:    Mobile AP daemon for setting tethering environments
-Version:    0.1.91
+Version:    0.1.92
 Release:    1
 Group:      TO_BE/FILLED_IN
 License:    Apache-2.0
@@ -16,6 +16,7 @@ BuildRequires: pkgconfig(libssl)
 BuildRequires: pkgconfig(secure-storage)
 BuildRequires: pkgconfig(capi-network-connection)
 BuildRequires: pkgconfig(capi-network-bluetooth)
+BuildRequires: pkgconfig(appcore-common)
 BuildRequires: cmake
 Requires(post): /usr/bin/vconftool
 Requires: iptables
index 38eceee..077f18a 100644 (file)
@@ -256,7 +256,7 @@ static void __bt_adapter_state_changed(int result, bt_adapter_state_e adapter_st
        } else {
                ret = bt_adapter_get_visibility(&mode, &duration);
                if (ret == BT_ERROR_NONE && mode == BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE)
-                       _create_status_noti("Bluetooth visible time is off. You may not find your device.");
+                       _create_status_noti(MH_NOTI_BT_VISIBILITY_STR);
        }
 
        ret = __activate_bt_nap(obj);
@@ -372,7 +372,7 @@ mobile_ap_error_code_e _enable_bt_tethering(TetheringObject *obj,
        } else {
                bt_ret = bt_adapter_get_visibility(&mode, &duration);
                if (bt_ret == BT_ERROR_NONE && mode == BT_ADAPTER_VISIBILITY_MODE_NON_DISCOVERABLE)
-                       _create_status_noti("Bluetooth visible time is off. You may not find your device.");
+                       _create_status_noti(MH_NOTI_BT_VISIBILITY_STR);
 
        }
 
index 0799cd5..c48e676 100644 (file)
@@ -27,9 +27,6 @@
 #include "mobileap_usb.h"
 #include "mobileap_notification.h"
 
-/* Need translation */
-#define MH_NOTI_TIMEOUT_STR    "Tap for setting"
-#define MH_NOTI_TIMEOUT_TITLE  "Disable tethering by timeout"
 
 typedef struct {
        guint src_id;
index b7b14a2..421e8f7 100644 (file)
@@ -27,6 +27,7 @@
 #include <pmapi.h>
 #include <vconf.h>
 #include <net_connection.h>
+#include <appcore-common.h>
 
 #include "mobileap_agent.h"
 #include "mobileap_handler.h"
@@ -35,6 +36,7 @@
 #include "mobileap_wifi.h"
 #include "mobileap_usb.h"
 #include "mobileap_network.h"
+#include "mobileap_notification.h"
 
 GType tethering_object_get_type(void);
 #define TETHERING_TYPE_OBJECT (tethering_object_get_type())
@@ -555,6 +557,9 @@ int main(int argc, char **argv)
        g_type_init();
 #endif
 
+       if (appcore_set_i18n(MOBILEAP_LOCALE_COMMON_PKG, MOBILEAP_LOCALE_COMMON_RES) < 0)
+                               goto failure;
+
        if (vconf_get_int(VCONFKEY_MOBILE_HOTSPOT_MODE, &mobileap_vconf_key)) {
                ERR("vconf_get_int FAIL\n");
                mobileap_state = MOBILE_AP_STATE_NONE;