#define SUPPORT_COMPRESSED_LICENSE 1
-
-/**< 1 : turn the low batter handlding off */
-#define LOW_BATTERY_DO_NOTHING 1
-
-
#define SUPPORT_SIMLOCK 0
#define SUPPORT_FDN 0
#define SUPPORT_ENCRYPTION 0
#define __SETTING_HELPER_H__
#include <setting.h>
-#include <ui-gadget-module.h>
bool is_searchmode_app(Cfg_Item_Type type);
-extern Eina_Bool setting_main_freeze_event_timer_cb(void *cb);
-
-void setting_main_click_list_item_reset_data(void *data, Evas_Object *obj);;
-void setting_main_destroy_ug_cb(ui_gadget_h ug, void *priv);
-void setting_main_result_ug_cb(ui_gadget_h ug, app_control_h service,
- void *priv);
-void setting_main_layout_ug_cb(ui_gadget_h ug, enum ug_mode mode, void *priv);
#endif
#include <Eina.h>
#include <Elementary.h>
-#include <ITapiModem.h>
-#include <account.h>
-#include <app_manager.h>
#include <efl_extension.h>
-#include <ui-gadget-module.h>
-
-#define NO_UG_FOUND_MSG "IDS_MSGF_POP_UNSUPPORTED"
-
-#define Keystr_Connection "IDS_ST_BODY_CONNECTION"
-
-#define MAX_GROUP_NUM_IN_VIEW 10
-
-
-typedef enum _FLIGHT_MODE_OPEARTION {
- /*< There is no request waiting for processing */
- FM_INVALID = 0,
- /*< Some "flightmode enter" request is waiting for processing */
- FM_ENTER = 1,
- /*< Some "flightmode leave" request is waiting for processing */
- FM_LEAVE,
-} FLIGHT_MODE_OPEARTION;
-
-
-#define MAX_MORE_MENU_NUM 6
-#define WIFI_LAST_ON_OFF_STATE "PREFKEY_WIFI_ON_OFF"
-
-enum {
- OP_WIFI_TURNING_INVALID = 0x00,
- OP_WIFI_TURNING_OFF,
- OP_WIFI_TURNING_ON,
-};
enum {
SC_All_List,
SC_Max
};
-
enum {
GL_Group_Connection,
GL_Group_Device,
typedef struct _setting_main_appdata {
MainData md;
- ui_gadget_h ug; /**< ug */
Evas_Object *sc_gl[SC_Max]; /**< genlist array */
- /* listen / unlisten code */
- Eina_List *listened_list;
-
Elm_Genlist_Item_Class itc_table[GENDIAL_Type_MAX];
- TapiHandle *handle;
- Evas_Object *popup;
-
Setting_GenGroupItem_Data *data_network; /** special layout */
- bool isInUGMode; /**< set TRUE when UG is running */
-
- int current_rotation;
Cfg_Item_Type is_searchmode;
Eina_Hash *main_list_hash;
} setting_main_appdata;
-extern setting_main_appdata *g_main_ad;
/* launch view */
extern setting_view setting_view_main;
-extern void __gl_realized(void *data, Evas_Object *obj, void *event_info);
-extern void setting_main_refresh_topview_list(void *data);
-
-extern Evas_Object *__get_top_list(void *data);
-extern Eina_Bool __save_timer(void *data);
-
typedef Setting_GenGroupItem_Data *(*UI_HANDLER)(void *data, char *title,
char *iconpath, char *ugname, Evas_Object *genlist,
Elm_Object_Item *parent);
typedef enum {
ERROR_STATE = -1,
DEFAULT_UI = 0,
- UI_PROC,
- UG_HANDLE,
+ UI_PROC
} mainlist_entry_action_type;
typedef struct _mainlist_entry {
EXPORT_PUBLIC
void setting_cfg_exit(void)
{
- if (cfg_dir_path) {
- free(cfg_dir_path);
- cfg_dir_path = NULL;
- }
- if (cfg_file_path) {
- free(cfg_file_path);
- cfg_file_path = NULL;
- }
+ free(cfg_dir_path);
+ cfg_dir_path = NULL;
+
+ free(cfg_file_path);
+ cfg_file_path = NULL;
+
if (parser) {
g_object_unref(parser);
parser = NULL;
INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs_main REQUIRED
elementary
- tapi
dlog
- ui-gadget-1
capi-appfw-application
capi-system-system-settings
- feedback
efl-extension
libtzplatform-config
vconf
char str_buf[256] = {0, };
get_gmt_offset(str_buf, 256);
SETTING_TRACE(">>> time zone GMT string : %s", str_buf);
- g_free(tzpath);
+ free(tzpath);
}
void get_current_font()
/* handle error condition */
return NULL;
}
- return g_strdup(buf);
+ return strdup(buf);
}
#include "setting-handler.h"
#include "setting-helper.h"
-extern void setting_main_click_list_ex_ug_cb(void *data, Evas_Object *obj,
+extern void setting_main_click_list_cb(void *data, Evas_Object *obj,
void *event_info);
-static Setting_GenGroupItem_Data *__mobileap_handler(void *data, char *keyStr,
- char *icon_path, char *ug_args, Evas_Object *genlist,
- Elm_Object_Item *parent)
-{
- /*SETTING_TRACE_BEGIN; */
- setting_main_appdata *ad = (setting_main_appdata *)data;
- Setting_GenGroupItem_Data *obj = NULL;
-
- obj = setting_create_Gendial_field_def(genlist,
- &(ad->itc_table[GENDIAL_Type_1text_1icon_2]),
- setting_main_click_list_ex_ug_cb, ug_args,
- SWALLOW_Type_1ICON_1IMAGE, icon_path,
- NULL, 0, keyStr,
- NULL,
- NULL);
- __BACK_POINTER_SET(obj);
- if (obj)
- obj->userdata = ad;
-
- return obj;
-}
-
-static Setting_GenGroupItem_Data *__backlight_time_handler(void *data,
- char *keyStr, char *icon_path, char *ug_args,
- Evas_Object *genlist, Elm_Object_Item *parent)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
- Setting_GenGroupItem_Data *obj = NULL;
-
- char *pa_backlight = get_pa_backlight_time_str();
- obj = setting_create_Gendial_field_def(genlist,
- &(ad->itc_table[GENDIAL_Type_1icon_2text]),
- setting_main_click_list_ex_ug_cb, ug_args,
- SWALLOW_Type_1ICON_1IMAGE, icon_path,
- NULL, 0, keyStr, pa_backlight,
- NULL);
- G_FREE(pa_backlight);
- __BACK_POINTER_SET(obj);
- if (obj) {
- obj->userdata = ad;
- /* ad->data_backlight = obj; */
- }
-
- return obj;
-}
-
-static Setting_GenGroupItem_Data *__developer_option_handler(void *data,
- char *keyStr, char *icon_path, char *ug_args,
- Evas_Object *genlist, Elm_Object_Item *parent)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
- Setting_GenGroupItem_Data *obj = NULL;
-
- /*for user binary: need to check develop_option_state vconf value*/
- int dev_op_state = 0;
- int ret = 0;
- ret = vconf_get_bool(VCONFKEY_SETAPPL_DEVELOPER_OPTION_STATE,
- &dev_op_state);
- if (ret != 0)
- SETTING_TRACE_ERROR("Failed to ger vconf value %d", ret);
-
- if (dev_op_state) {
- obj = setting_create_Gendial_field_def(genlist,
- &(ad->itc_table[GENDIAL_Type_1text_1icon_2]),
- setting_main_click_list_ex_ug_cb, ug_args,
- SWALLOW_Type_1ICON_1IMAGE,
-
- icon_path,
- NULL, 0, keyStr,
- NULL,
- NULL);
- } else {
- SETTING_TRACE("dev_op_state is 0");
- }
-
- return obj;
-}
-
static Setting_GenGroupItem_Data *__default_handler(void *data, char *keyStr,
char *icon_path, char *ug_args, Evas_Object *genlist,
Elm_Object_Item *parent)
{
- /*SETTING_TRACE_BEGIN; */
setting_main_appdata *ad = (setting_main_appdata *)data;
Setting_GenGroupItem_Data *obj = setting_create_Gendial_field_def(
genlist,
&(ad->itc_table[GENDIAL_Type_1text_1icon_2]),
- setting_main_click_list_ex_ug_cb,
+ setting_main_click_list_cb,
ug_args,
SWALLOW_Type_1ICON_1IMAGE,
icon_path,
/* list handler */
static mainlist_entry mainlist_table[] = {
{
- KeyStr_FlightMode,
- __default_handler,
- UG_HANDLE,
- NULL }, /* 0 --> NOT UG */
- {
- KeyStr_WiFi,
- __default_handler,
- UI_PROC,
- NULL }, /* 1 --> UG */
- {
- KeyStr_Bluetooth,
- __default_handler,
- UI_PROC,
- NULL },
- {
- KeyStr_MobileAP,
- __mobileap_handler,
- UG_HANDLE,
- NULL }, /* 1 --> UG */
- {
- KeyStr_Location,
- __default_handler,
- UI_PROC,
- NULL }, /* 1 --> UG */
- {
- KeyStr_Network,
- __default_handler,
- UG_HANDLE,
- NULL }, /* 1 --> UG */
- {
- KeyStr_DeveloperOption,
- __developer_option_handler,
- UI_PROC,
- NULL },
- {
- KeyStr_BacklightTime,
- __backlight_time_handler,
- UI_PROC,
- /* 1 --> UG */
- NULL },
- {
- "Default",
- __default_handler,
- DEFAULT_UI,
- NULL },
+ .title = "Default",
+ .ui_handler = __default_handler,
+ .type = DEFAULT_UI,
+ .item_data = NULL },
/*-------------------------------------------------------------- */
{
- NULL,
- NULL,
- ERROR_STATE,
- NULL },
+ .title = NULL,
+ .ui_handler = NULL,
+ .type = ERROR_STATE,
+ .item_data = NULL },
};
/*--------------------------------------------------------------------------- */
/* hash table utility */
-static void __list_hash_free_cb(void *obj)
+static void _list_hash_free_cb(void *obj)
{
SETTING_TRACE_BEGIN;
mainlist_entry *pnode = obj;
void settinig_drawer_hash_init(void *cb)
{
SETTING_TRACE_BEGIN;
-
+ int i = 0;
setting_main_appdata *ad = (setting_main_appdata *)cb;
- mainlist_entry *pnode = NULL;
- ad->main_list_hash = eina_hash_string_superfast_new(
- __list_hash_free_cb);
+ ad->main_list_hash = eina_hash_string_superfast_new(_list_hash_free_cb);
- for (pnode = &mainlist_table[0]; pnode->title != NULL; pnode++) {
- eina_hash_add(ad->main_list_hash, pnode->title, pnode);
- /*SETTING_TRACE("init and add data to hash : %s ",
- * pnode->title); */
- }
+ for (i = 0; i < (sizeof(mainlist_table) / sizeof(mainlist_table[0])); i++)
+ eina_hash_add(ad->main_list_hash, mainlist_table[i].title,
+ &(mainlist_table[i]));
}
void settinig_drawer_hash_deinit(void *cb)
/* hash table utility */
mainlist_entry *settinig_drawer_hash_find(void *cb, char *search_str)
{
- /*SETTING_TRACE_BEGIN; */
- /*SETTING_TRACE("------------------ HASH SEARCH ----------------------,
- * %s", search_str); */
setting_main_appdata *ad = (setting_main_appdata *)cb;
- mainlist_entry *pnode = NULL;
- pnode = eina_hash_find(ad->main_list_hash, search_str);
- return pnode; /* statically allocated */
+ if (!ad)
+ return NULL;
+
+ return eina_hash_find(ad->main_list_hash, search_str);
}
/*-------------------------------------------------------------------------- */
*
***************************************************/
-/* obj is the layout clicked */
-void setting_main_click_list_item_ug_cb(void *data, Evas_Object *obj,
- char *ug_to_load, app_control_h svc, struct ug_cbs *cbs)
-{
- SETTING_TRACE_BEGIN;
- setting_main_appdata *ad = (setting_main_appdata *)data;
- if (!ug_to_load) {
- setting_create_popup(ad, ad->md.window, NULL, NO_UG_FOUND_MSG,
- NULL, 0, false, false, 0);
- return;
- }
- SETTING_TRACE("to create libug-%s.so", ug_to_load);
- ad->ug = ug_create(NULL, ug_to_load, UG_MODE_FULLVIEW, svc, cbs);
- if (ad->ug) {
- ad->isInUGMode = TRUE;
- } else {
- setting_create_popup(ad, ad->md.window, NULL, NO_UG_FOUND_MSG,
- NULL, 0, false, false, 0);
- }
-}
-
-void setting_main_click_list_ex_ug_cb(void *data, Evas_Object *obj,
- void *event_info)
+void setting_main_click_list_cb(void *data, Evas_Object *obj, void *event_info)
{
SETTING_TRACE_BEGIN;
Elm_Object_Item *item = NULL;
- setting_main_appdata *ad = NULL;
Setting_GenGroupItem_Data *selected_item_data = NULL;
const char *item_name = NULL;
Setting_Cfg_Node_T *pnode = NULL;
- int click_times;
- struct ug_cbs *cbs = NULL;
- char *path = NULL;
- app_control_h svc = NULL;
+ int click_times = 0;
- retm_if(event_info == NULL, "Invalid argument: event info is NULL");
- item = (Elm_Object_Item *)event_info;
+ retm_if(!event_info, "Invalid argument: event info is NULL");
+ item = (Elm_Object_Item *)event_info;
elm_genlist_item_selected_set(item, EINA_FALSE);
-
- SETTING_TRACE("g_main_ad->isInUGMode:%d", g_main_ad->isInUGMode);
- SETTING_TRACE("g_main_ad->ug:%p", g_main_ad->ug);
- if (g_main_ad->isInUGMode && g_main_ad->ug) {
- SETTING_TRACE("[ad->ug non-NULL]skip genlist click event!!");
- return;
- }
-
- ad = g_main_ad;
-
- /* if UG is created by Setting app,
- * setting_main_click_list_ex_ug_cb is diabled. */
- if (ad->isInUGMode) {
- SETTING_TRACE("isInUGMode : TRUE - another UG is running now.");
- ad->isInUGMode = FALSE;
- return;
- } else {
- SETTING_TRACE("isInUGMode : FALSE - another UG is NOT running now.");
- }
-
- selected_item_data =
- (Setting_GenGroupItem_Data *)elm_object_item_data_get(
- item);
- setting_retm_if(NULL == selected_item_data,
- "selected_item_data is NULL");
- setting_main_click_list_item_reset_data(ad, obj);
+ selected_item_data = elm_object_item_data_get(item);
+ setting_retm_if(!selected_item_data,
+ "Setting main list item click, selected_item_data is NULL");
item_name = _(selected_item_data->keyStr);
- SETTING_TRACE("item_name:%s", item_name);
+ SETTING_TRACE("Setting main list item click: %s", item_name);
ret_if(!item_name);
- /* if current selection is for App control lauching style */
- pnode = get_cfg_node_by_keystr(
- selected_item_data->keyStr);
+ pnode = get_cfg_node_by_keystr(selected_item_data->keyStr);
if (pnode == NULL) {
SETTING_TRACE_ERROR(" *** pnode is NULL *** ");
return;
}
if (pnode && pnode->item_type == Cfg_Item_AppLauncher_Node) {
app_launcher(data, NULL, NULL);
- click_times = setting_cfg_get_click_times(
- selected_item_data->keyStr);
- setting_cfg_set_click_times(selected_item_data->keyStr,
- ++click_times);
+ click_times = setting_cfg_get_click_times(selected_item_data->keyStr);
+ setting_cfg_set_click_times(selected_item_data->keyStr, ++click_times);
return;
}
-
- /* handling of UG style */
- cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
- setting_retm_if(!cbs, "calloc failed");
- cbs->layout_cb = setting_main_layout_ug_cb;
- cbs->result_cb = setting_main_result_ug_cb;
- cbs->destroy_cb = setting_main_destroy_ug_cb;
- cbs->priv = (void *)ad;
-
- path = get_path_from_args(data);
- svc = get_svc_from_args(data);
- if (svc) {
- setting_main_click_list_item_ug_cb(ad, obj, path, svc, cbs);
- app_control_destroy(svc);
- }
-
- FREE(path);
- FREE(cbs);
}
return ret;
}
-void setting_main_click_list_item_reset_data(void *data, Evas_Object *obj)
-{
- setting_main_appdata *ad = (setting_main_appdata *)data;
- ad->isInUGMode = FALSE;
-}
-
-void setting_main_destroy_ug_cb(ui_gadget_h ug, void *priv)
-{
- setting_main_appdata *ad = (setting_main_appdata *)priv;
- ret_if(!ad); /* do nothing if ad is NULL */
-
- evas_object_show(ad->md.naviframe);
-
- if (ug)
- ug_destroy(ug);
-
- SETTING_TRACE("ad->ug:%p", ad->ug);
- SETTING_TRACE("g_main_ad->isInUGMode:%d", g_main_ad->isInUGMode);
- SETTING_TRACE("g_main_ad->ug:%p", g_main_ad->ug);
-
- if (is_searchmode_app(ad->is_searchmode)) {
- /*ug_destroy(parent); */
- if (ad->ug) {
- ug_destroy_me(ad->ug);
- ad->ug = NULL;
- }
-
- /*SETTING_TRACE("terminate app !!!!!! "); */
- elm_exit();
- return;
- }
-
- elm_object_tree_focus_allow_set(ad->md.naviframe, TRUE);
- /*ea_screen_reader_support_set(ad->md.win_layout, TRUE); */
-
- setting_main_click_list_item_reset_data(ad, NULL);
- SETTING_TRACE("update main genlist in unloading UG");
- SETTING_TRACE("ad->ug:%p", ad->ug);
- SETTING_TRACE("g_main_ad->isInUGMode:%d", g_main_ad->isInUGMode);
- SETTING_TRACE("g_main_ad->ug:%p", g_main_ad->ug);
- SETTING_TRACE_END;
-}
-
-void setting_main_result_ug_cb(ui_gadget_h ug, app_control_h service,
- void *priv)
-{
- SETTING_TRACE_BEGIN;
- ret_if(!priv);
- /* setting_main_appdata *ad = (setting_main_appdata *) priv; */
-
- SETTING_TRACE_END;
-}
-
-void setting_main_layout_ug_cb(ui_gadget_h ug, enum ug_mode mode, void *priv)
-{
- SETTING_TRACE_BEGIN;
- Evas_Object *base = NULL;
- setting_main_appdata *ad = (setting_main_appdata *)priv;
- ret_if(!ad);
-
- evas_object_hide(ad->md.naviframe);
-
- base = (Evas_Object *)ug_get_layout(ug);
- ret_if(!base);
-
- switch (mode) {
- case UG_MODE_FULLVIEW:
- evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- /*elm_win_resize_object_add(ad->md.window, base); */
- evas_object_show(base);
- break;
- default:
- break;
- }
-
-}
void __all_gl_realized_cb(void *data, Evas_Object *obj, void *event_info)
{
- /*SETTING_TRACE_BEGIN; */
__gl_realized_cb(data, obj, event_info);
setting_retm_if(event_info == NULL,
"invalid parameter: event_info is NULL");
"elm,state,expanded", "elm");
}
-static void __all_gl_group_clicked_cb(void *data, Evas_Object *obj,
- void *event_info)
-{
- SETTING_TRACE_BEGIN;
-
- Elm_Object_Item *item = (Elm_Object_Item *)event_info;
- elm_genlist_item_selected_set(item, 0);
- Setting_GenGroupItem_Data *data_parentItem =
- (Setting_GenGroupItem_Data *)elm_object_item_data_get(
- item);
- setting_retm_if(data_parentItem == NULL, "data_parentItem is NULL");
-
- Elm_Object_Item *start_item = NULL;
-
- data_parentItem->isPlaying = !data_parentItem->isPlaying;
- int hide_flag = !(data_parentItem->isPlaying);
- SETTING_TRACE("----------------------> expand list:%s, hide_flag:%d",
- _(data_parentItem->keyStr), hide_flag);
-
- /*to controll the arrow */
- if (hide_flag)
- elm_object_item_signal_emit(data_parentItem->item,
- "elm,state,contracted", "elm");
- else
- elm_object_item_signal_emit(data_parentItem->item,
- "elm,state,expanded", "elm");
-
- if (!start_item)
- SETTING_TRACE_ERROR(" ------------------> start_item IS NULL");
-}
-
void _view_list_geter(void *data)
{
SETTING_TRACE_BEGIN;
int i, j;
char *keyStr = NULL;
char *icon_path = NULL;
- char *ug_args = NULL;
+ char *app_ctl_args = NULL;
char *group_name = NULL;
int index = 0;
- Evas_Object *genlist = NULL;
+ mainlist_entry *entry = NULL;
Setting_GenGroupItem_Data *item_data = NULL;
setting_main_appdata *ad = (setting_main_appdata *)data;
retm_if(ad == NULL, "Invalid argument: data is NULL");
- genlist = ad->md.genlist;
/*------------------------------------------------------------------ */
/* category name loop */
/*------------------------------------------------------------------ */
group_name = setting_cfg_get_category_name(i);
group_dx++;/*from the first */
item_data = setting_create_Gendial_field_def(
- genlist,
+ ad->md.genlist,
&(ad->itc_table[GENDIAL_Type_expandable_proc]),
- __all_gl_group_clicked_cb,
- (void *)NULL,
+ NULL,
+ NULL,
SWALLOW_Type_INVALID,
NULL, /* l_icon */
NULL, /* r_icon */
NULL, /* r_icon */
NULL);
if (item_data) {
+ elm_genlist_item_select_mode_set(item_data->item,
+ ELM_OBJECT_SELECT_MODE_NONE);
item_data->isPlaying = TRUE;/*expandable ? */
item_data->chk_status = group_dx;/*keep the group idx */
}
for (j = 0; j < setting_cfg_get_menu_length(i); j++) {
keyStr = setting_cfg_get_keyname_idx(i, j);
- ug_args = setting_cfg_get_ug_args_idx(i, j);
+ app_ctl_args = setting_cfg_get_ug_args_idx(i, j);
icon_path = setting_cfg_get_icon_path_idx(i, j);
- mainlist_entry *entry = settinig_drawer_hash_find(ad,
- keyStr);
+ entry = settinig_drawer_hash_find(ad, keyStr);
if (entry) {
- if (entry->type == UG_HANDLE) {
- if (is_ug_installed_by_ug_args(
- ug_args)) {
- item_data = entry->ui_handler(
- ad, keyStr,
- icon_path,
- ug_args,
- genlist, NULL);
- entry->item_data = item_data;
- }
- } else if (entry->type == UI_PROC) {
+ if (entry->type == UI_PROC) {
item_data = entry->ui_handler(ad,
- keyStr, icon_path,
- ug_args, genlist, NULL);
+ keyStr, icon_path,
+ app_ctl_args, ad->md.genlist, NULL);
entry->item_data = item_data;
}
} else {
- entry = settinig_drawer_hash_find(ad,
- "Default");
+ entry = settinig_drawer_hash_find(ad, "Default");
if (entry) {
item_data = entry->ui_handler(ad,
- keyStr, icon_path,
- ug_args, genlist, NULL);
+ keyStr, icon_path,
+ app_ctl_args, ad->md.genlist, NULL);
entry->item_data = item_data;
}
}
retv_if(!data, EINA_FALSE);
setting_main_appdata *ad = (setting_main_appdata *) data;
- if (ad && ad->md.window)
+ if (ad)
elm_win_lower(ad->md.window);
SETTING_TRACE_END;
static int setting_main_destroy(void *cb)
{
SETTING_TRACE_BEGIN;
- /* error check */
+ setting_main_appdata *ad = (setting_main_appdata *)cb;
+
retv_if(cb == NULL, SETTING_GENERAL_ERR_NULL_DATA_PARAMETER);
- setting_main_appdata *ad = (setting_main_appdata *)cb;
- if (0 == setting_view_main.is_create) {
- /*already not exsit */
+ if (0 == setting_view_main.is_create)
return SETTING_RETURN_SUCCESS;
- }
+
evas_object_data_set(ad->md.window, "conformant", NULL);
settinig_drawer_hash_deinit(ad);
#include <system_settings.h>
-setting_main_appdata *g_main_ad;
-
-#if LOW_BATTERY_DO_NOTHING
-
-/* in case of low battery, don't terminate itself.*/
-
-/**
- * The event process when battery becomes low.
- */
-static void setting_main_low_battery_cb(app_event_info_h event_info, void *data)
-{
- SETTING_TRACE_BEGIN;
- retm_if(!data, "Invalid argument: data is NULL");
- setting_main_appdata *ad = data;
-
- if (ad->ug)
- ug_send_event(UG_EVENT_LOW_BATTERY);
-}
-#endif
+static setting_main_appdata *g_main_ad = NULL;
/**
* The event process when region is changes.
&localeLanguage);
elm_language_set(localeLanguage);
free(localeLanguage);
-
- if (ad->isInUGMode && ad->ug) {
- /* app launching */
- Evas_Object *layout = (Evas_Object *)ug_get_layout(ad->ug);
- if (layout) {
- Evas_Object *naviframe = NULL;
- naviframe = elm_object_part_content_get(layout,
- "elm.swallow.content");
- setting_navi_items_update(naviframe);
- }
-
- ug_send_event(UG_EVENT_LANG_CHANGE);
- }
}
setting_main_appdata *ad = data;
- app_event_handler_h handlers[5] = {NULL, };
-#if LOW_BATTERY_DO_NOTHING
- ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY],
- APP_EVENT_LOW_BATTERY, setting_main_low_battery_cb, ad);
-#endif
- ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED],
- APP_EVENT_LANGUAGE_CHANGED,
- setting_main_lang_changed_cb, ad);
- ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED],
- APP_EVENT_REGION_FORMAT_CHANGED,
- setting_main_region_changed_cb, ad);
- ui_app_add_event_handler(
- &handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED],
- /* no callback */
- APP_EVENT_DEVICE_ORIENTATION_CHANGED, NULL, NULL);
-
/*------------------------------------------------------------------ */
if (app_init(&ad->md, SETTING_PACKAGE) != SETTING_RETURN_SUCCESS)
* The function is called by app-fwk after app_create. It always do the process
* which cost much time.
*/
-static void setting_main_app_reset(app_control_h service, void *data)
+static void setting_main_app_ctl(app_control_h service, void *data)
{
SETTING_TRACE_BEGIN;
+ int flight_mode = 0;
setting_main_appdata *ad = data;
if (is_searchmode_app(ad->is_searchmode))
else
evas_object_show(ad->md.layout);
- /*------------------------------------------------------------------ */
-
- if (ad->md.window) {
- evas_object_show(ad->md.window);
- elm_win_activate(ad->md.window);
- }
+ evas_object_show(ad->md.window);
+ elm_win_activate(ad->md.window);
/* Disable data_network if flight mode is ON */
- int flight_mode = 0;
vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &flight_mode);
- if (flight_mode) {
- if (ad->data_network)
- setting_disable_genlist_item(ad->data_network->item);
- }
+ if (flight_mode && ad->data_network)
+ setting_disable_genlist_item(ad->data_network->item);
}
-EXPORT_PUBLIC
int main(int argc, char *argv[])
{
setting_main_appdata ad = {};
+ app_event_handler_h handlers[5] = {NULL, };
ui_app_lifecycle_callback_s ops = {
.create = setting_main_app_create,
.terminate = setting_main_app_terminate,
.pause = NULL,
.resume = setting_main_app_resume,
- .app_control = setting_main_app_reset
+ .app_control = setting_main_app_ctl
};
memset(&ad, 0, sizeof(setting_main_appdata));
+ ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED],
+ APP_EVENT_LANGUAGE_CHANGED,
+ setting_main_lang_changed_cb, &ad);
+ ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED],
+ APP_EVENT_REGION_FORMAT_CHANGED,
+ setting_main_region_changed_cb, &ad);
+ ui_app_add_event_handler(
+ &handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED],
+ /* no callback */
+ APP_EVENT_DEVICE_ORIENTATION_CHANGED, NULL, NULL);
+
dlog_print(DLOG_INFO, LOG_TAG, "[%s:%d] BUILD: %s %s", basename(__FILE__), __LINE__, __DATE__, __TIME__);
return ui_app_main(argc, argv, &ops, &ad);