#include <setting-main.h>
#include <setting-plugin.h>
+#define PLUGIN_PATH_FORMAT "/opt/apps/%s/setting/setting.xml"
typedef struct DrawAppInfo DrawAppInfo;
typedef struct DrawAppInfo
{
setting_main_appdata *ad = (setting_main_appdata *)data;
- Setting_GenGroupItem_Data * obj = setting_create_Gendial_field_groupitem(genlist,
+ ad->data_network = setting_create_Gendial_field_groupitem(genlist,
&(ad->itc[GENDIAL_Type_1text_1icon_2]),
NULL,
setting_main_click_list_network_ug_cb,
NULL,
NULL);
- return obj;
+ return ad->data_network;
}
static Setting_GenGroupItem_Data * __nfc_handler(void* data, char* keyStr, char* icon_path, char* ug_args, Evas_Object *genlist)
continue; /* hide Network in Emulator*/
} else if (!safeStrCmp(KeyStr_Bluetooth, keyStr)) {
continue; /* hide Bluetooth in Emulator*/
+ } else if (!safeStrCmp(KeyStr_MobileAP, keyStr)) {
+ continue; /* hide Tethering in Emulator*/
} else {
/* do nothing */
}
int value = 0;
vconf_get_bool
(VCONFKEY_SETAPPL_ROTATE_LOCK_BOOL, &value);
+ // true : auto rotation OFF
+ // false : auto rotation ON
value = !value;
ad->data_rotationMode =
__load_applications_menu_list(ad, Cfg_Item_Pos_Level_All);
}
+
bool is_3rdapp_installed_setting_cfg(char* pkgname)
{
SETTING_TRACE_BEGIN;
- // /opt/apps/
char path[512];
- SETTING_TRACE("1");
- if (snprintf(path, 512, "/opt/apps/%s/setting/setting.xml", pkgname) < 0)
+ if (snprintf(path, 512, PLUGIN_PATH_FORMAT, pkgname) < 0)
return false;
struct stat st;
return result_opt;
}
-
/**
* @param data
*/
static void draw_3rdapp(void* data, char* name, char* pkgname)
{
SETTING_TRACE_BEGIN;
+ SETTING_TRACE(" name : %s", name);
+ SETTING_TRACE(" pkgname : %s", pkgname);
+
setting_main_appdata *ad = data;
//3rd cfg
char fullpath[512];
- if (snprintf(fullpath, 512, "/opt/apps/%s/setting/setting.xml", pkgname) < 0)
+ if (snprintf(fullpath, 512, PLUGIN_PATH_FORMAT, pkgname) < 0)
return false;
SETTING_TRACE(" fullpath : %s", fullpath);
if (ad)
{
+ if (ad->plugin_path)
+ {
+ free(ad->plugin_path);
+ ad->plugin_path = NULL;
+ }
+ ad->plugin_path = strdup(fullpath);
+
setting_create_Gendial_field_groupitem(ad->main_genlist,
&(ad->itc[GENDIAL_Type_1text_1icon_2]),
NULL,
setting_main_click_list_plugin_cb,
- strdup(fullpath),
+ ad,
SWALLOW_Type_INVALID,
IMG_DefaultIcon, NULL,
0, name, NULL,
*/
static ail_cb_ret_e __download_apps_cb(ail_appinfo_h ai, void* data)
{
- SETTING_TRACE_BEGIN;
-
DrawAppInfo* pinfo = (DrawAppInfo*)data;
char *id;
//SETTING_TRACE("installed_time = %d ", installed_time);
if (installed_time != 0 && is_3rdapp_installed_setting_cfg(id) == true )
{
- SETTING_TRACE(" 3rd party - app name : ----> %s ", id);
+ SETTING_TRACE(" 3rd party - app name : ----> id : %s --- name : %s ", id, name);
+ SETTING_TRACE(" 3rd party - icon : ----> %s ", icon);
+ SETTING_TRACE(" 3rd party - nodisplay : ----> %d ", nodisplay);
pinfo->ncount++;
// draw code here
if (pinfo->draw_app != NULL)
{
SETTING_TRACE(">>> pkg name --> %s ", id);
- // draw !!!
- pinfo->draw_app(pinfo->data, strdup(id)/* appname*/, strdup(id)/* pkg_name*/);
+ pinfo->draw_app(pinfo->data, strdup(name)/* appname*/, strdup(id)/* pkg_name*/);
}
-
}
}
-
SETTING_TRACE_END;
return AIL_CB_RET_CONTINUE;
}
elm_win_lower(ad->win_main);
}
+static Eina_Bool __refresh_on_idle(void *data)
+{
+ SETTING_TRACE_BEGIN;
+ retv_if(!data, FALSE);
+ setting_main_appdata *ad = data;
+ if (MAIN_PROFILE_ALL == ad->profile_type)
+ {
+ ad->load_fns[Func_Type_Connectivity] = __load_connectivity_level_all_list;
+ ad->load_fns[Func_Type_System] = __load_system_level_all_list;
+ ad->load_fns[Func_Type_Apps] = __load_applications_level_all_list;
+ ad->load_fns[Func_Type_DownApp] = __load_downloaded_apps_level_all_list;
+ setting_main_refresh(ad);
+ }
+ else if (MAIN_PROFILE_PREFERRED == ad->profile_type)
+ {
+ ad->load_fns[Func_Type_Connectivity] = __load_connectivity_level0_list;
+ ad->load_fns[Func_Type_System] = __load_system_level0_list;
+ ad->load_fns[Func_Type_Apps] = __load_applications_level0_list;
+ ad->load_fns[Func_Type_DownApp] = __load_downloaded_apps_level0_list;
+ setting_main_refresh(ad);
+ }
+ ad->refresh_idler = NULL;
+ return FALSE;
+}
+
static void __allFrequent_btn_cb(void *data, Evas_Object *obj, void *event_info)
{
SETTING_TRACE_BEGIN;
ret_if(!data || !obj);
setting_main_appdata *ad = (setting_main_appdata *) data;
+ //if already has the task,cancel the old task with ecore_idler_del,then add new idler task.
+ if (ad->refresh_idler) {
+ ecore_idler_del(ad->refresh_idler);
+ ad->refresh_idler = NULL;
+ }
+
Elm_Object_Item *item = elm_toolbar_first_item_get(obj);
ret_if(!item);
-
if (MAIN_PROFILE_ALL == ad->profile_type)
{
SETTING_TRACE("Change to Preferred view");
elm_object_item_text_set(item, _(ALL_STR));
ad->profile_type = MAIN_PROFILE_PREFERRED;
- ad->load_fns[Func_Type_Connectivity] = __load_connectivity_level0_list;
- ad->load_fns[Func_Type_System] = __load_system_level0_list;
- ad->load_fns[Func_Type_Apps] = __load_applications_level0_list;
- ad->load_fns[Func_Type_DownApp] = __load_downloaded_apps_level0_list;
- setting_main_refresh(ad);
}
else if (MAIN_PROFILE_PREFERRED == ad->profile_type)
{
SETTING_TRACE("Change to ALL view");
elm_object_item_text_set(item, _(PREFERRED_STR));
ad->profile_type = MAIN_PROFILE_ALL;
- ad->load_fns[Func_Type_Connectivity] = __load_connectivity_level_all_list;
- ad->load_fns[Func_Type_System] = __load_system_level_all_list;
- ad->load_fns[Func_Type_Apps] = __load_applications_level_all_list;
- ad->load_fns[Func_Type_DownApp] = __load_downloaded_apps_level_all_list;
- setting_main_refresh(ad);
}
else
{
return;
}
+ ad->refresh_idler = ecore_idler_add((Ecore_Task_Cb) __refresh_on_idle, ad);
}
/**
setting_create_Gendial_itc("dialogue/2text.3", &(ad->itc[GENDIAL_Type_2text_3]));
ad->view_type = SETTING_VIEW_MAIN;
- __setting_create_main_view(ad);
+ bool ret = __setting_create_main_view(ad);
+ SETTING_TRACE(" >>>> ret = %d ", ret);
setting_view_main.is_create = 1;
return SETTING_RETURN_SUCCESS;
//already not exsit
return SETTING_RETURN_SUCCESS;
}
+ if (ad->refresh_idler) {
+ ecore_idler_del(ad->refresh_idler);
+ ad->refresh_idler = NULL;
+ }
if (ad->handle) {
int tapi_ret = tel_deinit(ad->handle);
evas_object_del(ad->flight_popup);
ad->flight_popup = NULL;
}
+
+#if 0
+ if (ad->plugin_node)
+ {
+ setting_plugin_destroy(ad->plugin_node);
+ }
+#endif
+
setting_view_main.is_create = 0;
SETTING_TRACE_END;
return SETTING_RETURN_SUCCESS;
}
if (item_to_update) {
+ SETTING_TRACE("gl update [%s], bGlUpdate:%d", _(item_to_update->keyStr), bGlUpdate);
if(bGlUpdate) {
SETTING_TRACE("gl update:%d", nDx);
elm_object_item_data_set(item_to_update->item, item_to_update);
retm_if(event_info == NULL, "Invalid argument: event info is NULL");
Elm_Object_Item *item = (Elm_Object_Item *) event_info;
elm_genlist_item_selected_set(item, EINA_FALSE);
+
+ setting_main_appdata *ad = data;
#ifdef PLUGIN
- setting_plugin_load((const char *)data);
+ if (ad->plugin_path)
+ {
+ PluginNode* plugin_node = setting_plugin_create();
+
+ plugin_node->plugin_path = strdup(ad->plugin_path);
+
+ setting_plugin_load(plugin_node, (const char *)ad->plugin_path);
+ ad->plugin_node = (void*)plugin_node;
+
+ #if 0
+ if(ad->plugin_path)
+ {
+ free(ad->plugin_path);
+ ad->plugin_path = NULL;
+ }
+ #endif
+ }
#endif
}
+/**
+ * @see [caller] setting_main_list_mouse_up_cb
+ * @see [caller] setting_main_sel_list_mouse_up_cb
+ */
+static void __rotate_lock_handler(int chk_status, setting_main_appdata *ad )
+{
+ SETTING_TRACE_BEGIN;
+ if( chk_status == 1)
+ {
+ // toggle : 0 --> 1
+ int angle = elm_win_rotation_get(ad->win_main);
+ elm_win_rotation_with_resize_set(ad->win_main, angle);
+ } else {
+ elm_win_rotation_with_resize_set(ad->win_main, 0);
+ }
+ vconf_set_bool(VCONFKEY_SETAPPL_ROTATE_LOCK_BOOL, !chk_status);
+}
+
+/**
+ * toggle cb
+ */
void setting_main_list_mouse_up_cb(void *data, Evas_Object *eo,
void *event_info)
{
SETTING_TRACE("change radio[%s], status is:%d", _(list_item->keyStr),
list_item->chk_status);
- /*setting_main_appdata *ad = g_main_ad;*/
+ setting_main_appdata *ad = g_main_ad;
if (!safeStrCmp(KeyStr_UsePacketData, list_item->keyStr)) {
int err;
}
} else if (!safeStrCmp(KeyStr_Landscape, list_item->keyStr)) {
- vconf_set_bool(VCONFKEY_SETAPPL_ROTATE_LOCK_BOOL, ! list_item->chk_status);
+ __rotate_lock_handler(list_item->chk_status, ad);
}
return;
}
+/**
+ * genlist touch cb
+ */
void setting_main_sel_list_mouse_up_cb(void *data, Evas_Object *eo,
void *event_info)
{
(Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
list_item->chk_status = elm_check_state_get(list_item->eo_check);
+
/* new status */
+ list_item->chk_status = !list_item->chk_status;
+ elm_check_state_set(list_item->eo_check, list_item->chk_status);
- /*setting_main_appdata *ad = (setting_main_appdata *) data;*/
+ setting_main_appdata *ad = (setting_main_appdata *) data;
if (!safeStrCmp(KeyStr_UsePacketData, list_item->keyStr)) {
/* setting_reset_slp_key_by_status(eo, BOOL_SLP_SETTING_USE_PACKET_DATA); */
list_item->chk_status, &err);
} else if (!safeStrCmp(KeyStr_Landscape, list_item->keyStr)) {
- vconf_set_bool(VCONFKEY_SETAPPL_ROTATE_LOCK_BOOL, (list_item->chk_status));
+ __rotate_lock_handler(list_item->chk_status, ad);
}
return;