put a note of the Flora license description
[apps/core/preloaded/settings.git] / src / setting.c
index 4070cd0..de28fff 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>
@@ -31,6 +27,7 @@
 #include <appsvc.h>
 #include <EWebKit2.h>
 #include <nfc.h>
+#include <signal.h>
 
 extern void setting_update_gl_item(void* data);
 
@@ -38,7 +35,14 @@ extern void setting_update_gl_item(void* data);
 #define SUPPORT_UG_MESSAGE
 
 int g_geometry_x, g_geometry_y, g_geometry_w, g_geometry_h;
-extern int aul_listen_app_dead_signal(int (*func)(int signal, void *data), void *data);
+
+void termination_handler(int signum)
+{
+       SETTING_TRACE_BEGIN;
+       SETTING_TRACE(">>>>>>>>>>> SIGTERM >>>>>>>>>>>>>>> SETTING");
+
+       elm_exit();
+}
 
 static void __main_motion_sensor_cb( unsigned long long timestamp, void *data)
 {
@@ -228,8 +232,7 @@ static void setting_main_rotate(app_device_orientation_e m, void *data)
        //}
 
        int value = 0;
-       vconf_get_bool (VCONFKEY_SETAPPL_ROTATE_LOCK_BOOL, &value);
-       value = !value;
+       vconf_get_bool (VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &value);
 
        if (value == 0)
                m = 0;
@@ -299,7 +302,8 @@ static Evas_Object *setting_main_create_win(const char *name)
        Evas_Object *eo;
        int w, h;
 
-       eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
+       //eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
+       eo = elm_win_util_standard_add(name, name);
        if (eo) {
                elm_win_title_set(eo, name);
                evas_object_smart_callback_add(eo, "delete,request", setting_main_del_win, NULL);
@@ -456,14 +460,14 @@ static void setting_other_vconf_change_cb(keynode_t *key, void *data)
                        }
                }
                return;
-       } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_ROTATE_LOCK_BOOL)) {
+       } else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL)) {
                item_to_update = ad->data_rotationMode;
                retm_if(!item_to_update, "ad->data_rotationMode is NULL");
 
                int status = 0;
-               vconf_get_bool(VCONFKEY_SETAPPL_ROTATE_LOCK_BOOL, &status);
+               vconf_get_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &status);
 
-               item_to_update->chk_status = !status;
+               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);
@@ -540,14 +544,14 @@ static void setting_int_vconf_change_cb(keynode_t *key, void *data)
                                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;
                default:
                        SETTING_TRACE_ERROR("Invalid wifi status!");
                        return;
                }
-                       
+
                elm_check_state_set(item_to_update->eo_check, item_to_update->chk_status);
 
                if (ad->bAppPause || ad->ug) {
@@ -581,14 +585,14 @@ static void setting_int_vconf_change_cb(keynode_t *key, void *data)
 
                if (FALSE == 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->chk_status = EINA_TRUE;
                }
-                       
+
                item_to_update->chk_status = status;
                elm_check_state_set(item_to_update->eo_check, item_to_update->chk_status);
 
@@ -723,6 +727,12 @@ static bool setting_main_app_create(void *data)
        //appcore_measure_start();
        setting_main_appdata *ad = data;
 
+       // registering sigterm
+       if (signal(SIGTERM, termination_handler) == SIG_IGN)
+       {
+               signal(SIGTERM, SIG_IGN);
+       }
+
        ad->data_roaming_popup = NULL;
 
        /* create window */
@@ -734,7 +744,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
@@ -811,6 +821,8 @@ static bool setting_main_app_create(void *data)
        //SETTING_TRACE("[TIME] 4. setting_main_app_create taked %d msec ", appcore_measure_time());
        //appcore_measure_start();
 
+       // set default local automatically
+       set_defaultLangICU();
        return true;
 }
 
@@ -918,9 +930,9 @@ static void setting_main_app_reset(service_h service, void *data)
        setting_main_appdata *ad = data;
 
        int value = 0;
-       vconf_get_bool (VCONFKEY_SETAPPL_ROTATE_LOCK_BOOL, &value);
+       vconf_get_bool (VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &value);
        SETTING_TRACE("value:%d", value);
-       if (!value) //rotation function is not blocked
+       if (value) //rotation function is not blocked
        {
                SETTING_TRACE("Rotation function is on, it is necessary to adjust the device orientation");
                int mode = APP_DEVICE_ORIENTATION_0;
@@ -947,7 +959,7 @@ static void setting_main_app_reset(service_h service, void *data)
        REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_WIDGET_THEME_STR, cb, ad);
 
        REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_TELEPHONY_FLIGHT_MODE, cb, ad);
-       REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_ROTATE_LOCK_BOOL, cb, ad);
+       REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, cb, ad);
        REGISTER_VCONF_NODE(ad->listened_list, VCONFKEY_NFC_STATE, cb, ad);
 
        if (ad->win_main)