+setting (0.1.89-92ubuntu1) precise; urgency=low
+
+ * release
+
+ -- mjpark <mjpark@localhost> Wed, 26 Dec 2012 13:34:15 +0900
+
setting (0.1.89-92) unstable; urgency=low
* Release
#include <setting-display.h>
#include <Ecore_X.h>
-#define SETTING_BRIGHTNESS_LEVEL_FOR_EMUL 60
+#define SETTING_BRIGHTNESS_DEFAULT_LEVEL 60
#ifndef UG_MODULE_API
#define UG_MODULE_API __attribute__ ((visibility("default")))
if(isEmulBin())
{
- ret += vconf_set_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, SETTING_BRIGHTNESS_LEVEL_FOR_EMUL);
+ ret += vconf_set_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, SETTING_BRIGHTNESS_DEFAULT_LEVEL);
#if USE_DEVICE_SET_DISPLAY_BRT
- ret += device_set_brightness(BRIGHTNESS_DISPLAY, SETTING_BRIGHTNESS_LEVEL_FOR_EMUL);
+ ret += device_set_brightness(BRIGHTNESS_DISPLAY, SETTING_BRIGHTNESS_DEFAULT_LEVEL);
#endif
}
else
{
- ret += vconf_set_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, SETTING_BRIGHTNESS_LEVEL7);
+ ret += vconf_set_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, SETTING_BRIGHTNESS_DEFAULT_LEVEL);
#if USE_DEVICE_SET_DISPLAY_BRT
- ret += device_set_brightness(BRIGHTNESS_DISPLAY, SETTING_BRIGHTNESS_LEVEL7);;
+ ret += device_set_brightness(BRIGHTNESS_DISPLAY, SETTING_BRIGHTNESS_DEFAULT_LEVEL);;
#endif
}
SETTING_TRACE_END;
#include <sysman.h>
#include <pthread.h>
#include <media_content.h>
+#include <media_content_type.h>
-#define SUPPORT_SD_CARD_FORMAT 0
+#define SUPPORT_SD_CARD_FORMAT 1
#define SETTING_STORAGE_PROGRESSBAR_TIMEOUT 10
#define SETTING_STORAGE_POPUP_TIMER 2
#define SETTING_STORAGE_AUDIO_STR "IDS_COM_BODY_AUDIO"
#define SETTING_STORAGE_PICS_STR "IDS_ST_BODY_PICTURES_VIDEOS"
-#define SETTING_STORAGE_DOWNS_STR "IDS_ST_BODY_DOWNLOADS"
#define SETTING_STORAGE_MISCES_STR "IDS_ST_BODY_MISCELLANEOUS_FILES"
#define SETTING_STORAGE_AVAIL_STR "IDS_ST_BODY_AVAILABLE"
#define SETTING_STORAGE_FORMAT_STR "IDS_ST_BODY_FORMAT_USB_STORAGE"
#define SETTING_STORAGE_APPS_ICON_PATH SETTING_ICON_PATH"/A01-1_icon_color_applications.png"
#define SETTING_STORAGE_PICS_ICON_PATH SETTING_ICON_PATH"/A01-1_icon_color_pictures.png"
-#define SETTING_STORAGE_DOWNS_ICON_PATH SETTING_ICON_PATH"/A01-1_icon_color_downloads.png"
#define SETTING_STORAGE_AUDIO_ICON_PATH SETTING_ICON_PATH"/A01-1_icon_color_Audio.png"
#define SETTING_STORAGE_MISCES_ICON_PATH SETTING_ICON_PATH"/A01-1_icon_color_miscellaneous_files.png"
#define SETTING_STORAGE_AVAIL_ICON_PATH SETTING_ICON_PATH"/A01-1_icon_color_available.png"
#define SETTING_STORAGE_ICON_HEIGHT ((int)16 * WIDGET_SCALE_FACTOR)
#define SETTING_STORAGE_OPT_USR_PATH "/opt/usr"
-#define SETTING_STORAGE_MEDIA_PATH "/opt/usr/media"
-#define SETTING_STORAGE_PICTURES_PATH "/opt/usr/media/Images"
-#define SETTING_STORAGE_VIDEOS_PATH "/opt/usr/media/Videos"
-#define SETTING_STORAGE_CAMERA_PATH "/opt/usr/media/Camera"
-#define SETTING_STORAGE_DOWNLOADS_PATH "/opt/usr/media/Downloads"
-#define SETTING_STORAGE_AUDIO_PATH "/opt/usr/media/Sounds"
#define SETTING_STORAGE_MMC_PATH "/opt/storage/sdcard"
#define SETTING_STORAGE_MMC_PARENT_PATH "/opt/storage/sdcard/.."
SETTING_STORAGE_SLEEP = -1,
SETTING_STORAGE_REUPDATE = 0,
SETTING_STORAGE_PICTURES_VIDEO = 1,
- SETTING_STORAGE_DOWNLOADS,
SETTING_STORAGE_AUDIO,
SETTING_STORAGE_MISCELLANEOUS,
SETTING_STORAGE_APPLICATIONS,
Setting_Storage_Status internal_status;
Setting_Storage_Status apps_status;
Setting_Storage_Status pics_videos_status;
- Setting_Storage_Status downloads_status;
Setting_Storage_Status audio_status;
Setting_Storage_Status others_status;
Setting_GenGroupItem_Data *internal;
Setting_GenGroupItem_Data *apps;
Setting_GenGroupItem_Data *pics_videos;
- Setting_GenGroupItem_Data *downloads;
Setting_GenGroupItem_Data *audio;
Setting_GenGroupItem_Data *others;
Setting_GenGroupItem_Data *avail;
}
float temp_size = 0.0;
- /* use size (applications + picture/videos + downloads + audio + miscellaneous + available) as 100% */
+ /* use size (applications + picture/videos + audio + miscellaneous + available) as 100% */
double total_size = ad->apps_status.dTotal + ad->pics_videos_status.dTotal +
- ad->downloads_status.dTotal + ad->audio_status.dTotal +
+ + ad->audio_status.dTotal +
ad->others_status.dTotal + ad->internal_status.dAvail;
if (!safeStrCmp(part, "elm.icon")){
elm_box_pack_end(status_box, pics);
}
- /* downloads */
- unsigned int downloads_size = 0;
- temp_size = ((float)ad->downloads_status.dTotal / total_size) * width;
- if (temp_size < 1 && temp_size > 0) {
- downloads_size = 1;
- } else {
- downloads_size = (unsigned int)temp_size;
- }
- if (downloads_size > 0) {
- Evas_Object *downs = __setting_storage_main_image_add(evas, SETTING_STORAGE_DOWNS_ICON_PATH, downloads_size, height);
- elm_box_pack_end(status_box, downs);
- }
-
/* audio */
unsigned int audio_size = 0;
temp_size = ((float)ad->audio_status.dTotal / total_size) * width;
} else {
avail_size = (unsigned int)temp_size;
- int sum = apps_size + pics_videos_size + downloads_size + audio_size + others_size;
+ int sum = apps_size + pics_videos_size + audio_size + others_size;
if ((sum + avail_size) > width) {
avail_size = width - sum;
}
return total_size;
}
-static double __setting_storage_main_downloads_status_get()
-{
- SETTING_TRACE_BEGIN;
-
- double total_size = 0.0;
-
- int ret = MEDIA_CONTENT_ERROR_NONE;
- filter_h filter = NULL;
-
- /*Set Filter*/
- char *condition = "MEDIA_PATH LIKE \'/opt/usr/media/Downloads/%%\'";
-
- ret = media_filter_create(&filter);
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
- SETTING_TRACE("Fail to create filter");
- return total_size;
- }
-
- ret = media_filter_set_condition(filter, condition, MEDIA_CONTENT_COLLATE_DEFAULT);
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
- media_filter_destroy(filter);
- SETTING_TRACE("Fail to set condition");
- return total_size;
- }
-
- ret = media_info_foreach_media_from_db(filter, __setting_storage_main_media_item_cb, &total_size);
- if(ret != MEDIA_CONTENT_ERROR_NONE) {
- media_filter_destroy(filter);
- SETTING_TRACE("Fail to get media");
- return total_size;
- }
-
- ret = media_filter_destroy(filter);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- SETTING_TRACE_ERROR("destroy filter failed\n\n");
- return total_size;
- }
-
- return total_size;
-}
-
static double __setting_storage_main_audio_status_get()
{
SETTING_TRACE_BEGIN;
&setting_view_storage_default_storage, ad);
} else if (!safeStrCmp(SETTING_STORAGE_PICS_STR, list_item->keyStr)) {
__setting_storage_main_app_launch("org.tizen.gallery");
- } else if (!safeStrCmp(SETTING_STORAGE_DOWNS_STR, list_item->keyStr)) {
- __setting_storage_main_app_launch("org.tizen.download-manager");
} else if (!safeStrCmp(SETTING_STORAGE_AUDIO_STR, list_item->keyStr)) {
__setting_storage_main_app_launch("org.tizen.music-player");
} else if (!safeStrCmp(SETTING_STORAGE_MISCES_STR, list_item->keyStr)) {
}
#if SUPPORT_SD_CARD_FORMAT
-static void __setting_storage_main_sd_card_format_cb(int val, void *data)
+static void __setting_storage_main_sd_card_scan_cb(media_content_error_e err, void *data)
{
SETTING_TRACE_BEGIN;
setting_retm_if(data == NULL, "Data parameter is NULL");
SettingStorageUG *ad = (SettingStorageUG *) data;
+ SETTING_TRACE("scan_cb result = %d", err);
+
if (ad->popup) {
evas_object_del(ad->popup);
ad->popup = NULL;
}
- if (val == SETTING_STORAGE_SYSMAN_REQUEST_SUCCESS) {
+ if (err == MEDIA_CONTENT_ERROR_NONE) {
ad->popup = setting_create_popup_without_btn(ad, ad->win_get, NULL, _("IDS_COM_POP_SUCCESS"),
__setting_storage_status_sd_card_popup_format_response_cb,
SETTING_STORAGE_POPUP_TIMER, FALSE, FALSE);
}
}
+static void __setting_storage_main_sd_card_format_cb(int val, void *data)
+{
+ SETTING_TRACE_BEGIN;
+ setting_retm_if(data == NULL, "Data parameter is NULL");
+ SettingStorageUG *ad = (SettingStorageUG *) data;
+
+ if (val == SETTING_STORAGE_SYSMAN_REQUEST_SUCCESS) {
+ int ret = media_content_scan_folder(SETTING_STORAGE_MMC_PATH, __setting_storage_main_sd_card_scan_cb, ad);
+
+ if(ret != MEDIA_CONTENT_ERROR_NONE) {
+ SETTING_TRACE_ERROR("Fail to media_content_scan_file : %d", ret);
+ return;
+ }
+ } else {
+ if (ad->popup) {
+ evas_object_del(ad->popup);
+ ad->popup = NULL;
+ }
+ ad->popup = setting_create_popup_without_btn(ad, ad->win_get, NULL, _("IDS_COM_POP_FAILED"),
+ __setting_storage_status_sd_card_popup_response_cb,
+ SETTING_STORAGE_POPUP_TIMER, FALSE, FALSE);
+ }
+}
+
static void __setting_storage_main_sd_card_format_popup_yes(void *data)
{
SETTING_TRACE_BEGIN;
/* Show Formatting..... popup */
ad->popup = setting_create_popup_with_progressbar(ad, ad->win_get,
- "list_process", _("IDS_ST_POP_MSG_FORMATTING"),
- NULL, __setting_storage_status_sd_card_popup_response_cb,
- SETTING_STORAGE_PROGRESSBAR_TIMEOUT, TRUE, TRUE);
+ "pending_list", NULL,
+ NULL, NULL,
+ 0, TRUE, TRUE);
int ret = __setting_storage_main_mmc_content_init(ad, __setting_storage_main_sd_card_format_cb);
if (ret == SETTING_RETURN_FAIL) {
__setting_storage_main_genlist_update(ad->pics_videos, ad->pics_videos_status);
}
break;
- case SETTING_STORAGE_DOWNLOADS:
- {
- ad->downloads_status.dTotal = update_info->total_size;
- __setting_storage_main_genlist_update(ad->downloads, ad->downloads_status);
- }
- break;
case SETTING_STORAGE_AUDIO:
{
ad->audio_status.dTotal = update_info->total_size;
ecore_pipe_write(ad->pipe, &pics_videos_info, sizeof(pics_videos_info));
}
break;
- case SETTING_STORAGE_DOWNLOADS:
- {
- /* get downloads info */
- double downloads_size = __setting_storage_main_downloads_status_get();
- SETTING_TRACE("downloads_size = %f", downloads_size);
-
- Update_Info downloads_info;
- memset(&downloads_info, 0, sizeof(Update_Info));
- downloads_info.type = SETTING_STORAGE_DOWNLOADS;
- downloads_info.total_size = downloads_size;
- if (ad->pipe)
- ecore_pipe_write(ad->pipe, &downloads_info, sizeof(downloads_info));
- }
- break;
case SETTING_STORAGE_AUDIO:
{
/* get audio info */
ad->pics_videos_status.dAvail = 0.0;
ad->pics_videos_status.dTotal= 0.0;
- ad->downloads_status.dAvail = 0.0;
- ad->downloads_status.dTotal= 0.0;
-
ad->audio_status.dAvail = 0.0;
ad->audio_status.dTotal= 0.0;
return SETTING_RETURN_FAIL;
}
- /* Downloads */
- ad->downloads = setting_create_Gendial_field_def(ad->genlist, &(ad->itc_2text_1icon_3),
- __setting_storage_main_Gendial_mouse_up_cb,
- ad, SWALLOW_Type_INVALID, SETTING_STORAGE_DOWNS_ICON_PATH,
- NULL, 0, SETTING_STORAGE_DOWNS_STR,
- _("IDS_ST_HEADER_PLEASE_WAIT"), NULL);
- if (ad->downloads) {
- ad->downloads->userdata = ad;
- if (is_emulator) {
- elm_genlist_item_select_mode_set(ad->downloads->item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
- }
- } else {
- SETTING_TRACE_ERROR("ad->downloads is NULL");
- return SETTING_RETURN_FAIL;
- }
-
/* Audio */
ad->audio = setting_create_Gendial_field_def(ad->genlist, &(ad->itc_2text_1icon_3),
__setting_storage_main_Gendial_mouse_up_cb,
-Evas_Object *setting_create_layout_navi_bar2(Evas_Object *win_layout, Evas_Object *win_obj, char *title_str, char *lbutton_str, char *rbutton_str, char *mbutton_str, setting_call_back_func lbutton_click_cb, setting_call_back_func rbutton_click_cb, setting_call_back_func mbutton_click_cb, void *cb_data, Evas_Object *eo_view, /*any container obj constructed on any evas obj */
+Evas_Object *setting_create_layout_navi_bar2(Evas_Object *win_layout,
+ Evas_Object *win_obj,
+ char *title_str,
+ char *lbutton_str, char *rbutton_str, char *mbutton_str,
+ setting_call_back_func lbutton_click_cb, setting_call_back_func rbutton_click_cb,
+ setting_call_back_func mbutton_click_cb,
+ void *cb_data, Evas_Object *eo_view, /*any container obj constructed on any evas obj */
Evas_Object **navi_bar,
Evas_Object **titleobj)
{
ELM_GENLIST_ITEM_NONE,
KeyStr_DownloadedAPPs,
NULL);
-
+ get_downloadapp_list(ad);
+ //SETTING_TRACE("Exit %s with return[%d]",__FUNCTION__, downloaded_apps_num);
SETTING_TRACE_END;
}
elm_genlist_item_selected_set(item, EINA_FALSE);
setting_main_appdata *ad = data;
-#ifdef PLUGIN
if (ad->plugin_path)
{
PluginNode* plugin_node = setting_plugin_create();
}
#endif
}
-#endif
}
/**
*/
Eina_List *_g_drawer_list = NULL;
+#if 0
/**
* @return Evas_Object * obj
*/
static void* navigationbar_func(void *data, xmlNode *xmlObj);
-
+#endif
/*
* @return void
pd->navi_bar = NULL;
pd->cfg_file = NULL;
+
+
+
pd->root = NULL;
}
return (void*)list_item;
};
+#if 0
/*
elm_object_item_data_set(item_to_update->item, item_to_update);
elm_genlist_item_update(item_to_update->item);
#endif
return NULL;
};
-
+#endif
static void __check_mouse_up_cb(void *data, Evas_Object *obj,
void *event_info)
const char *title = (char*)xmlGetProp(xmlObj, "title");
const char *key_str= (char*)xmlGetProp(xmlObj, "value");
+ //const char *minlength= (char*)xmlGetProp(xmlObj, "minlength");
+ //const char *maxlength= (char*)xmlGetProp(xmlObj, "maxlength");
+
// TODO: minlength
// TODO: maxlength
Setting_GenGroupItem_Data *list_item =
return NULL;
}
+
+static Evas_Object *setting_create_win_layout2(Evas_Object *win_layout, Evas_Object *win_obj)
+{
+
+ Evas_Object *layout = NULL;
+ Evas_Object *conform = elm_conformant_add(win_obj);
+ //setting_main_appdata *ad = (setting_main_appdata *) data;
+
+ /* Base Layout */
+ layout = elm_layout_add(conform);
+ evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ setting_retvm_if(layout == NULL, FALSE, "layout == NULL");
+
+ elm_layout_theme_set(layout, "layout", "application", "default");
+ evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(conform, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_win_resize_object_add(win_obj, conform);
+ elm_object_content_set(conform, layout);
+
+ Evas_Object *bg = setting_create_bg(layout, win_obj, "group_list");
+ elm_object_part_content_set(layout, "elm.swallow.bg", bg);
+ evas_object_show(layout);
+ evas_object_show(conform);
+
+ //ad->conformant = conform;
+ return layout;
+}
+
+
+Evas_Object *setting_create_layout_navi_bar2(Evas_Object *win_layout, Evas_Object *win_obj, char *title_str, char *lbutton_str, char *rbutton_str, char *mbutton_str, setting_call_back_func lbutton_click_cb, setting_call_back_func rbutton_click_cb, setting_call_back_func mbutton_click_cb, void *cb_data, Evas_Object *eo_view, /*any container obj constructed on any evas obj */
+ Evas_Object **navi_bar,
+ Evas_Object **titleobj)
+{
+
+ Evas_Object *layout = setting_create_win_layout2(win_layout, win_obj);
+ *navi_bar = setting_create_navi_bar(layout);
+
+ setting_create_navi_bar_buttons(title_str,
+ lbutton_str, rbutton_str, mbutton_str,
+ lbutton_click_cb, rbutton_click_cb,
+ mbutton_click_cb, cb_data, eo_view /*content */ ,
+ *navi_bar, NULL);
+ return layout;
+}
+
// <setting>
static void* setting_func(void *data, xmlNode *xmlObj)
{
SETTING_TRACE_BEGIN;
ret_if(!data || !xmlObj);
-#if 1/*{{{*/
- //Draw_Data *pd = node->pd;
+#if 1
PluginNode* node = (PluginNode*)data;
Draw_Data *pd = node->pd;
- //----------------------------------------------------------------
// [DATA] title, btn[0], btn[1]
const char *title = (char*)xmlGetProp(xmlObj, "title");
char *btn[2] = {/* 0 */"OK", /* 1 */"NO"};
- // find child nodes named 'elements'
- #if 0
- if (xmlObj->children) {
- xmlNode* cur = xmlObj->children;
- int i =0;
- while (cur != NULL)
- {
- if (!xmlStrcmp(cur->name, (const xmlChar*)"button")) {
- btn[i] = xmlGetProp(cur, "title");
- SETTING_TRACE("------>>> node type : Element, name=%s id=%s / btn[%d] = %s ",
- cur->name,xmlGetProp(cur, "id"),
- i,
- btn[i]);
- i++;
- }
- cur = cur->next;
- }
- }
- #endif
- //----------------------------------------------------------------
SETTING_TRACE("before setting_create_layout_navi_bar_genlist");
+
// [UI] with DATA
pd->scroller = elm_genlist_add(pd->win_get);
retvm_if(pd->scroller == NULL, NULL,
elm_object_style_set(pd->scroller, "dialogue");
elm_genlist_clear(pd->scroller); /* first to clear list */
- /* Enabling illume notification property for window */
- elm_win_conformant_set(pd->win_get, 1);
- Evas_Object *conformant = elm_conformant_add(pd->win_get);
- elm_object_style_set(conformant, "internal_layout"); /* By Kollus. 2011-01-04 */
- evas_object_show(conformant);
- elm_object_content_set(conformant, pd->scroller);
SETTING_TRACE("_(title):%s", _(title));
- pd->ly_main =
- setting_create_layout_navi_bar(pd->win_get, pd->win_get,
+ pd->ly_main = setting_create_layout_navi_bar2(pd->win_get, pd->win_get,
_(title),
_("IDS_COM_BODY_BACK"), NULL, NULL,
___click_softkey_back_cb,
NULL, NULL,
- data, conformant,
+ data, pd->scroller,
&(pd->navi_bar), NULL);
SETTING_TRACE("after setting_create_layout_navi_bar_genlist");
-#endif/*}}}*/
+#endif
return NULL;
}
xmlNode *cur_node = NULL;
for (cur_node = cur; cur_node;cur_node = cur_node->next) {
if (cur_node->type == XML_ELEMENT_NODE) {
- SETTING_TRACE("node type : %s id= %s", cur_node->name,xmlGetProp(cur_node, "id"));
-
+ // SETTING_TRACE("node type : %s id= %s", cur_node->name,xmlGetProp(cur_node, "id"));
drawer_fp fp = __drawer_find(cur_node->name);
if (fp)
{
}
+/**
+ * set modifiable
+ */
bool setting_plugin_load(PluginNode* context, const char *cfg_file)
{
SETTING_TRACE("cfg_file:%s", cfg_file)