/*
* 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>
#include <Ecore_X.h>
#include <sensor.h>
#include <aul.h>
-#include "setting-plugin.h"
+#include "setting-common-plugin.h"
#include "setting-main.h"
#include <elm_object.h>
#include <appsvc.h>
#include <EWebKit2.h>
#include <nfc.h>
+#include <signal.h>
extern void setting_update_gl_item(void* data);
#define KEY_END "XF86Stop"
+#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)
{
//}
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;
#endif
}
+static void _rot_changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ SETTING_TRACE_BEGIN;
+ setting_main_appdata *ad = (setting_main_appdata *)data;
+ if (ad == NULL || ad->win_main == NULL )
+ return;
+ int change_ang = elm_win_rotation_get(ad->win_main);
+ SETTING_TRACE("....change_ang:%d",change_ang);
+ SETTING_TRACE("current_rotation:%d",ad->current_rotation);
+ //Send the rotation event to UGs..
+ enum ug_event event = UG_EVENT_ROTATE_PORTRAIT;
+ switch (change_ang) {
+ case APP_DEVICE_ORIENTATION_0:
+ event = UG_EVENT_ROTATE_PORTRAIT;
+ break;
+ case APP_DEVICE_ORIENTATION_180:
+ event = UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN;
+ break;
+ case APP_DEVICE_ORIENTATION_270:
+ event = UG_EVENT_ROTATE_LANDSCAPE;
+ break;
+ case APP_DEVICE_ORIENTATION_90:
+ event = UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN;
+ break;
+ default:
+ return;
+ }
+ SETTING_TRACE("diff:%d",elm_win_rotation_get(ad->win_main) - ad->current_rotation);
+
+ if (change_ang != ad->current_rotation)
+ {
+ ug_send_event(event);
+ ad->current_rotation = change_ang;
+ }
+}
#endif
/**
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);
}
}
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);
if (item_to_update->chk_status) //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;
- mode = app_get_device_orientation();
- elm_win_rotation_with_resize_set(ad->win_main, mode);
+ //int mode = APP_DEVICE_ORIENTATION_0;
+ //mode = app_get_device_orientation();
+ //elm_win_rotation_with_resize_set(ad->win_main, mode);
}
return;
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;
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;
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;
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;
default:
SETTING_TRACE_ERROR("Invalid wifi status!");
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) {
}
else if (!safeStrCmp(vconf_name, VCONFKEY_CALL_STATE)) {
// do handling in case of VCONFKEY_CALL_STATE
- //In call situation : Wi-fi / Tethering / Network menu dimmed
+ // In call situation : Wi-fi / Tethering / Network menu dimmed
+ // -- Only Wi-fi should be dimmed (2013.04.04) --
if (VCONFKEY_CALL_OFF != status)
{
if (ad->data_network)
setting_disable_genlist_item(ad->data_network->item);
- if (ad->data_wifi)
- setting_disable_genlist_item(ad->data_wifi->item);
}
else
{
if (ad->data_network)
setting_enable_genlist_item(ad->data_network->item);
- if (ad->data_wifi)
- setting_enable_genlist_item(ad->data_wifi->item);
}
} 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);
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;
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:
//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 */
evas_object_show(ad->win_main);
UG_INIT_EFL(ad->win_main, UG_OPT_INDICATOR_ENABLE);
ad->evas = evas_object_evas_get(ad->win_main);
+ ad->current_rotation = elm_win_rotation_get(ad->win_main);
+ SETTING_TRACE("ad->current_rotation:%d",ad->current_rotation);
+ if (elm_win_wm_rotation_supported_get(ad->win_main))
+ {
+ int rots[4] = { 0, 90, 180, 270 }; // rotation value that app may want
+ elm_win_wm_rotation_available_rotations_set(ad->win_main, &rots, 4);
+ }
+ evas_object_smart_callback_add(ad->win_main, "wm,rotation,changed", _rot_changed_cb, ad);
/* 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
//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;
}
SETTING_TRACE_BEGIN;
setting_main_appdata *ad = data;
//vconf_set_bool (VCONFKEY_SETAPPL_ROTATE_HOLD_BOOL, FALSE);
- PLUGIN_FINI;
+
setting_cfg_exit();
clear_system_service_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;
- mode = app_get_device_orientation();
- elm_win_rotation_with_resize_set(ad->win_main, mode);
+ //int mode = APP_DEVICE_ORIENTATION_0;
+ //mode = app_get_device_orientation();
+ //elm_win_rotation_with_resize_set(ad->win_main, mode);
}
vconf_callback_fn cb = NULL;
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)
.low_battery = setting_main_low_battery_cb,
.language_changed = setting_main_lang_changed_cb,
.region_format_changed = setting_main_region_changed_cb,
- .device_orientation = setting_main_rotate,
+ .device_orientation = NULL,
};