creating ug for plugin model
[apps/core/preloaded/settings.git] / src / setting.c
index 30a73ea..e276a14 100755 (executable)
@@ -1,22 +1,18 @@
 /*
  * setting
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
  *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd.
- *
- * Contact: MyoungJune Park <mj2004.park@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed under the Flora License, Version 1.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://floralicense.org/license/
  *
  * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
+ * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- *
  */
 #include <setting.h>
 #include <app.h>
@@ -48,11 +44,6 @@ void termination_handler(int signum)
        elm_exit();
 }
 
-
-
-
-
-
 static void __main_motion_sensor_cb( unsigned long long timestamp, void *data)
 {
        /* The code 'return ;' will be deleted after the defect of elm_genlist_item_top_show() is fixed */
@@ -497,13 +488,14 @@ static void setting_other_vconf_change_cb(keynode_t *key, void *data)
                int status = 0;
                vconf_get_bool(VCONFKEY_NFC_STATE, &status);
 
+               item_to_update->swallow_type = SWALLOW_Type_1ICON_1RADIO;
                item_to_update->chk_status = status;
                //do not need delay for checks
                elm_check_state_set(item_to_update->eo_check, item_to_update->chk_status);
                SETTING_TRACE("item_to_update->chk_status:%d", item_to_update->chk_status);
 
-               item_to_update->sub_desc = (char *)g_strdup(get_NFC_on_off_str());
-               SETTING_TRACE_DEBUG("%s", item_to_update->sub_desc);
+               //item_to_update->sub_desc = (char *)g_strdup(get_NFC_on_off_str());
+               //SETTING_TRACE_DEBUG("%s", item_to_update->sub_desc);
 
                if (ad->bAppPause || ad->ug) {
                        ad->updateItems[GL_ITEM_NFC] = EINA_TRUE;
@@ -527,10 +519,8 @@ static void setting_int_vconf_change_cb(keynode_t *key, void *data)
        char *vconf_name = vconf_keynode_get_name(key);
        SETTING_TRACE("Enter %s(%s=%d)", __FUNCTION__, vconf_name, status);
 
-       char *pa_wifi_device = NULL;
        Setting_GenGroupItem_Data* item_to_update = NULL;
 
-
        if (!safeStrCmp(vconf_name, VCONFKEY_WIFI_STATE)) {
        // do handling in case of VCONFKEY_WIFI_STATE
                item_to_update = ad->data_wifi;
@@ -538,7 +528,7 @@ static void setting_int_vconf_change_cb(keynode_t *key, void *data)
 
                switch (status) {
                case VCONFKEY_WIFI_OFF:
-                       item_to_update->sub_desc = (char *)g_strdup(_("IDS_COM_BODY_OFF_M_STATUS"));
+                       //item_to_update->sub_desc = (char *)g_strdup(_("IDS_COM_BODY_OFF_M_STATUS"));
 
                        item_to_update->chk_status = EINA_FALSE;
                        break;
@@ -546,13 +536,13 @@ static void setting_int_vconf_change_cb(keynode_t *key, void *data)
                case VCONFKEY_WIFI_UNCONNECTED:
                case VCONFKEY_WIFI_CONNECTED:
                case VCONFKEY_WIFI_TRANSFER:
-                       pa_wifi_device = vconf_get_str(VCONFKEY_WIFI_CONNECTED_AP_NAME);
-                       if (NULL != pa_wifi_device && '\0' != pa_wifi_device[0]) {
-                               item_to_update->sub_desc = (char *)g_strdup(pa_wifi_device);
-                       } else {
-                               item_to_update->sub_desc = (char *)g_strdup(_("IDS_COM_BODY_ON_M_STATUS"));
-                       }
-                       FREE(pa_wifi_device);
+                       //pa_wifi_device = vconf_get_str(VCONFKEY_WIFI_CONNECTED_AP_NAME);
+                       //if (NULL != pa_wifi_device && '\0' != pa_wifi_device[0]) {
+                       //      item_to_update->sub_desc = (char *)g_strdup(pa_wifi_device);
+                       //} else {
+                       //      item_to_update->sub_desc = (char *)g_strdup(_("IDS_COM_BODY_ON_M_STATUS"));
+                       //}
+                       //FREE(pa_wifi_device);
 
                        item_to_update->chk_status = EINA_TRUE;
                        break;
@@ -561,6 +551,7 @@ static void setting_int_vconf_change_cb(keynode_t *key, void *data)
                        return;
                }
 
+               item_to_update->swallow_type = SWALLOW_Type_1ICON_1RADIO;
                elm_check_state_set(item_to_update->eo_check, item_to_update->chk_status);
 
                if (ad->bAppPause || ad->ug) {
@@ -589,19 +580,21 @@ static void setting_int_vconf_change_cb(keynode_t *key, void *data)
                }
 
        } else if (!safeStrCmp(vconf_name, VCONFKEY_BT_STATUS)) {
+       // do handling in case of VCONFKEY_BT_STATUS
                item_to_update = ad->data_bt;
                retm_if(!item_to_update, "ad->data_bt is NULL");
-
+/*
                if (FALSE == status) {
-                       item_to_update->sub_desc = (char *)g_strdup(_("IDS_COM_BODY_OFF_M_STATUS"));
+               //      item_to_update->sub_desc = (char *)g_strdup(_("IDS_COM_BODY_OFF_M_STATUS"));
 
                        item_to_update->chk_status = EINA_FALSE;
                } else {
-                       item_to_update->sub_desc = (char *)g_strdup(_("IDS_COM_BODY_ON_M_STATUS"));
+                       //item_to_update->sub_desc = (char *)g_strdup(_("IDS_COM_BODY_ON_M_STATUS"));
 
                        item_to_update->chk_status = EINA_TRUE;
                }
-
+*/
+               item_to_update->swallow_type = SWALLOW_Type_1ICON_1RADIO;
                item_to_update->chk_status = status;
                elm_check_state_set(item_to_update->eo_check, item_to_update->chk_status);
 
@@ -662,10 +655,11 @@ static void setting_string_vconf_change_cb(keynode_t *key, void *data)
                SETTING_TRACE("status:%d", status);
                switch (status) {
                case VCONFKEY_WIFI_OFF:
-                       item_to_update->sub_desc =
-                               (char *)g_strdup(setting_gettext ("IDS_COM_BODY_OFF_M_STATUS"));
+                       //item_to_update->sub_desc =
+                       //      (char *)g_strdup(setting_gettext ("IDS_COM_BODY_OFF_M_STATUS"));
 
                        item_to_update->chk_status = EINA_FALSE;
+                       item_to_update->swallow_type = SWALLOW_Type_1ICON_1RADIO;
                        elm_check_state_set(item_to_update->eo_check, item_to_update->chk_status);
                        break;
 
@@ -674,13 +668,14 @@ static void setting_string_vconf_change_cb(keynode_t *key, void *data)
                case VCONFKEY_WIFI_TRANSFER:
                        if (NULL != value && '\0' != value[0]) {
                                SETTING_TRACE("wifi_device:%s", value);
-                               item_to_update->sub_desc = (char *)g_strdup(value);
+                               //item_to_update->sub_desc = (char *)g_strdup(value);
                        } else {
-                               item_to_update->sub_desc =
-                                       (char *) g_strdup(setting_gettext ("IDS_COM_BODY_ON_M_STATUS"));
+                               //item_to_update->sub_desc =
+                               //      (char *) g_strdup(setting_gettext ("IDS_COM_BODY_ON_M_STATUS"));
                        }
 
                        item_to_update->chk_status = EINA_TRUE;
+                       item_to_update->swallow_type = SWALLOW_Type_1ICON_1RADIO;
                        elm_check_state_set(item_to_update->eo_check, item_to_update->chk_status);
                        break;
                default:
@@ -753,7 +748,7 @@ static bool setting_main_app_create(void *data)
 
        /* load config file */
        int cfg_operation_ret = setting_cfg_init();
-       PLUGIN_INIT(ad);
+       //PLUGIN_INIT(ad);
 
        elm_theme_extension_add(NULL, SETTING_THEME_EDJ_NAME);
 #if SUPPORT_LCD_TIMEOUT_KEEPING
@@ -843,7 +838,9 @@ static int setting_main_app_terminate(void *data)
        SETTING_TRACE_BEGIN;
        setting_main_appdata *ad = data;
        //vconf_set_bool (VCONFKEY_SETAPPL_ROTATE_HOLD_BOOL, FALSE);
-       PLUGIN_FINI;
+
+       // PLUGIN_FINI;
+
        setting_cfg_exit();
        clear_system_service_data();