summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchleun.moon <chleun.moon@samsung.com>2016-11-07 11:19:24 +0900
committerchleun.moon <chleun.moon@samsung.com>2016-11-07 12:06:56 +0900
commit5f2960f37e61d73563fbfb11733f45c458a7af74 (patch)
tree61e26f995efb324248641763a44fc12f78cddfbe
parentab6a07aebdebafbf10c76e9921e247c069231da2 (diff)
downloadnet-popup-5f2960f37e61d73563fbfb11733f45c458a7af74.tar.gz
net-popup-5f2960f37e61d73563fbfb11733f45c458a7af74.tar.bz2
net-popup-5f2960f37e61d73563fbfb11733f45c458a7af74.zip
Change-Id: Id8b1b40d1ca0d6ca11cfb04f47a9a811717a55f8 Signed-off-by: cheoleun <chleun.moon@samsung.com>
-rwxr-xr-xinclude/net-popup-strings.h2
-rwxr-xr-xsrc/net-popup.c55
2 files changed, 26 insertions, 31 deletions
diff --git a/include/net-popup-strings.h b/include/net-popup-strings.h
index 08efab7..ae02cd1 100755
--- a/include/net-popup-strings.h
+++ b/include/net-popup-strings.h
@@ -38,7 +38,7 @@
#define ALERT_STR_OK dgettext(PACKAGE, "IDS_COM_SK_OK")
#define ALERT_STR_NO dgettext(PACKAGE, "IDS_COM_SK_NO")
#define ALERT_STR_CANCEL dgettext(PACKAGE, "IDS_COM_SK_CANCEL")
-#define ALERT_STR_WIFI dgettext(PACKAGE, "IDS_WIFI_BODY_WI_FI")
+#define ALERT_STR_WIFI dgettext(PACKAGE, "IDS_WIFI_BODY_WI_FI")
#define ALERT_STR_SECURITY_RESTRICTION dgettext(PACKAGE, _("IDS_COM_BODY_SECURITY_POLICY_RESTRICTS_USE_OF_PS"))
#define ALERT_STR_WIFI_TETHERING dgettext(PACKAGE, "IDS_MOBILEAP_MBODY_WI_FI_TETHERING")
#define ALERT_STR_BT_TETHERING dgettext(PACKAGE, "IDS_MOBILEAP_BODY_BLUETOOTH_TETHERING")
diff --git a/src/net-popup.c b/src/net-popup.c
index ff1029f..d5241ec 100755
--- a/src/net-popup.c
+++ b/src/net-popup.c
@@ -44,7 +44,7 @@
#define NET_WIFIQS_APPID "net.wifi-qs"
#define LOCALEDIR "/usr/share/locale"
-#define NETPOPUP_EDJ tzplatform_mkpath(TZ_SYS_RO_UG, "/res/edje/net-popup/netpopup-custom.edj")
+#define NETPOPUP_EDJ tzplatform_mkpath(TZ_SYS_RO_UG, "/res/edje/net-popup/netpopup-custom.edj")
#define QP_PRELOAD_NOTI_ICON_PATH tzplatform_mkpath(TZ_SYS_RO_APP, "/org.tizen.quickpanel/shared/res/noti_icons/Wi-Fi")
#define NETCONFIG_NOTIFICATION_WIFI_ICON \
@@ -148,9 +148,8 @@ int __net_popup_send_dbus_msg(const char *resp)
{
log_print(NET_POPUP, "__net_popup_send_dbus_msg()\n");
- if (conn == NULL || resp == NULL) {
+ if (conn == NULL || resp == NULL)
return -1;
- }
GDBusConnection *gconn = NULL;
GVariant *msg = NULL;
@@ -223,13 +222,11 @@ static Eina_Bool __key_release_event_cb(void *data, int type,
Evas_Event_Key_Down *ev = (Evas_Event_Key_Down *) event;
- if (!ev) {
+ if (!ev)
return ECORE_CALLBACK_RENEW;
- }
- if (!ev->keyname) {
+ if (!ev->keyname)
return ECORE_CALLBACK_RENEW;
- }
log_print(NET_POPUP, "key_release : %s", ev->keyname);
if (g_strcmp0(ev->keyname, "XF86Phone") == 0 ||
@@ -247,11 +244,10 @@ static Eina_Bool _ecore_event_client_message_cb(void *data, int type,
Ecore_X_Event_Client_Message *ev = event;
if (ev->message_type == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE) {
- if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF) {
+ if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF)
log_print(NET_POPUP, "ECORE_X_ATOM_E_ILLUME_QUICKPANEL_OFF");
- } else if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON) {
+ else if (ev->data.l[0] == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON)
log_print(NET_POPUP, "ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ON");
- }
}
return ECORE_CALLBACK_RENEW;
}
@@ -312,7 +308,7 @@ static void __net_popup_service_cb(app_control_h request, void *data)
} else if (g_str_equal(type, "popup_user_resp")) {
app_control_clone(&g_req_handle, request);
__net_popup_show_popup_with_user_resp(request, data);
- }else {
+ } else {
__net_popup_show_notification(request, data);
elm_exit();
}
@@ -328,9 +324,8 @@ static void __net_popup_set_orientation(Evas_Object *win)
int rots[4] = { 0, 90, 180, 270 };
- if (!elm_win_wm_rotation_supported_get(win)) {
+ if (!elm_win_wm_rotation_supported_get(win))
return;
- }
elm_win_wm_rotation_available_rotations_set(win, rots, 4);
}
@@ -350,14 +345,14 @@ static Evas_Object* __net_popup_create_win(void)
e = evas_object_evas_get(win);
ee = ecore_evas_ecore_evas_get(e);
- ecore_evas_name_class_set(ee,"APP_POPUP","APP_POPUP");
+ ecore_evas_name_class_set(ee, "APP_POPUP", "APP_POPUP");
elm_win_alpha_set(win, EINA_TRUE);
elm_win_borderless_set(win, EINA_TRUE);
#if 0
ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
evas_object_resize(win, w, h);
- utilx_set_system_notification_level (ecore_x_display_get(),
+ utilx_set_system_notification_level(ecore_x_display_get(),
elm_win_xwindow_get(win),
UTILX_NOTIFICATION_LEVEL_LOW);
#endif
@@ -1009,14 +1004,14 @@ static void __net_popup_add_found_ap_noti(void)
}
noti_err = notification_set_time(noti, time(NULL));
- if(noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
log_print(NET_POPUP, "Failed to notification_set_time : %d", noti_err);
goto error;
}
g_snprintf(icon_path, sizeof(icon_path), "%s%s", QP_PRELOAD_NOTI_ICON_PATH, "/noti_wifi_in_range.png");
noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, icon_path);
- if(noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
log_print(NET_POPUP, "Failed to notification_set_image : %d", noti_err);
goto error;
}
@@ -1029,7 +1024,7 @@ static void __net_popup_add_found_ap_noti(void)
noti_err = notification_set_text_domain(noti, PACKAGE,
LOCALEDIR);
- if(noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
log_print(NET_POPUP, "Failed to notification_set_text_domain : %d", noti_err);
goto error;
}
@@ -1054,24 +1049,24 @@ static void __net_popup_add_found_ap_noti(void)
noti_flags = NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_INDICATOR;
noti_err = notification_set_display_applist(noti, noti_flags);
- if(noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
log_print(NET_POPUP, "Failed to notification_set_display_applist: %d", noti_err);
goto error;
}
ret = app_control_create(&service_handle);
log_print(NET_POPUP, "Service create ret[%d]", ret);
- if(ret != APP_CONTROL_ERROR_NONE)
+ if (ret != APP_CONTROL_ERROR_NONE)
goto error;
ret = app_control_set_app_id(service_handle, NET_WIFIQS_APPID);
log_print(NET_POPUP, "Service set app id ret = %d", ret);
- if(ret != APP_CONTROL_ERROR_NONE)
+ if (ret != APP_CONTROL_ERROR_NONE)
goto error;
ret = app_control_add_extra_data(service_handle, "caller", "notification");
log_print(NET_POPUP, "Service data addition ret = %d", ret);
- if(ret != APP_CONTROL_ERROR_NONE)
+ if (ret != APP_CONTROL_ERROR_NONE)
goto error;
noti_err = notification_set_launch_option(noti,
@@ -1149,21 +1144,21 @@ static void __net_popup_add_portal_noti(app_control_h request)
}
noti_err = notification_set_time(noti, time(NULL));
- if(noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
log_print(NET_POPUP, "fail to notification_set_time : %d", noti_err);
goto error;
}
noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON,
NETCONFIG_NOTIFICATION_WIFI_ICON);
- if(noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
log_print(NET_POPUP, "fail to notification_set_image : %d", noti_err);
goto error;
}
g_snprintf(icon_path, sizeof(icon_path), "%s%s", QP_PRELOAD_NOTI_ICON_PATH, "/noti_wifi_in_range.png");
noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, icon_path);
- if(noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
log_print(NET_POPUP, "fail to notification_set_image : %d", noti_err);
goto error;
}
@@ -1175,7 +1170,7 @@ static void __net_popup_add_portal_noti(app_control_h request)
noti_err = notification_set_text_domain(noti, PACKAGE,
LOCALEDIR);
- if(noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
log_print(NET_POPUP, "fail to notification_set_text_domain : %d", noti_err);
goto error;
}
@@ -1201,25 +1196,25 @@ static void __net_popup_add_portal_noti(app_control_h request)
noti_flags = NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_INDICATOR;
noti_err = notification_set_display_applist(noti, noti_flags);
- if(noti_err != NOTIFICATION_ERROR_NONE) {
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
log_print(NET_POPUP, "fail to notification_set_display_applist : %d", noti_err);
goto error;
}
ret = app_control_create(&service_handle);
log_print(NET_POPUP, "service create ret[%d]", ret);
- if(ret != APP_CONTROL_ERROR_NONE)
+ if (ret != APP_CONTROL_ERROR_NONE)
goto error;
ret = app_control_set_operation(service_handle, APP_CONTROL_OPERATION_VIEW);
- if(ret != APP_CONTROL_ERROR_NONE)
+ if (ret != APP_CONTROL_ERROR_NONE)
goto error;
log_print(NET_POPUP, "service set operation is successful");
ret = app_control_set_uri(service_handle, "http://www.google.com");
- if(ret != APP_CONTROL_ERROR_NONE)
+ if (ret != APP_CONTROL_ERROR_NONE)
goto error;
noti_err = notification_set_launch_option(noti,