*
*/
-#define STORAGE_APPS_COLOR 192 80 77
-#define STORAGE_IMAGES_COLOR 255 204 0
-#define STORAGE_VIDEOS_COLOR 255 255 0
-#define STORAGE_AUDIO_COLOR 146 208 80
-#define STORAGE_DOCUMENTS_COLOR 0 176 240
-#define STORAGE_MISC_COLOR 127 127 127
-#define STORAGE_CACHED_COLOR 112 48 160
-#define STORAGE_SYSTEM_COLOR 0 32 96
+#define STORAGE_APPS_COLOR 46 181 215
+#define STORAGE_IMAGES_COLOR 18 176 155
+#define STORAGE_VIDEOS_COLOR 163 203 56
+#define STORAGE_AUDIO_COLOR 236 119 3
+#define STORAGE_DOCUMENTS_COLOR 10 14 74
+#define STORAGE_MISC_COLOR 255 195 18
+#define STORAGE_CACHED_COLOR 84 89 89
+#define STORAGE_SYSTEM_COLOR 170 24 24
color_classes {
color_class { "genlist_item/type1/text";
*/
#include "common-data-define.edc"
-#define STORAGE_GRAPH_TOTAL_HIEGHT 300
+#define STORAGE_GRAPH_TOTAL_HIEGHT 72
#define STORAGE_GRAPH_MARGIN_SIZE 25
#define STORAGE_GRAPH_SMALL_TEXT_HEIGHT 42
#define STORAGE_GRAPH_VALUE_TEXT_HEIGHT 78
#define STORAGE_GRAPH_GRAPH_HEIGHT 20
+#define PROGRESSBAR_OFFSET -2
+
+#define DBG(rel_to, r, g, b, a)\
+rect { rel_to"_dbg"; \
+ desc { "default" \
+ rel.to: rel_to; \
+ color: r g b a;\
+ }\
+}
+
styles {
style {
- name: "small text style";
- base: "font="default" font_size=28 align=left color=#737373ff wrap=mixed";
+ name: "used_text_style";
+ base: "font=BreezeSans:style=Regular font_size=18 align=left color=#001447 wrap=mixed";
}
style {
- name: "value style";
- base: "font="default" font_size=48 align=left color=#000000ff wrap=mixed";
+ name: "used_value_style";
+ base: "font=BreezeSans:style=light font_size=22 align=left color=#000C2B wrap=mixed";
+ }
+ style {
+ name: "total_style";
+ base: "font=BreezeSans:Regular=light font_size=16 align=left color=#000C2B wrap=mixed";
}
}
+images
+{
+ image: "core_progress_bar.#.png" COMP;
+// image: "storage/05_progressbar.png" COMP;
+}
+
collections {
group {
name: "STORAGE_GRAPH_GRP";
part {
name: "BG";
type: RECT;
- mouse_events: 1;
+ mouse_events: 1;
description {
state: "default" 0.0;
min: 0 STORAGE_GRAPH_TOTAL_HIEGHT;
rel2.relative: 1.0 1.0;
}
}
-
part {
name: "TXT_USED";
type: TEXTBLOCK;
description {
state: "default" 0.0;
visible: 1;
- rel1 {
- to: "BG";
- relative: 0.0 0.0;
- offset: STORAGE_GRAPH_MARGIN_SIZE STORAGE_GRAPH_MARGIN_SIZE;
- }
- rel2 {
- to: "BG";
- relative: 1.0 0.0;
- offset: -STORAGE_GRAPH_MARGIN_SIZE STORAGE_GRAPH_MARGIN_SIZE+STORAGE_GRAPH_SMALL_TEXT_HEIGHT;
- }
+ rel1.relative: 0.033 0.0;
+ rel2.relative: 0.337 0.5;
text {
- style: "small text style";
+ style: "used_text_style";
text: "IDS_ST_BODY_USED";
}
}
}
-
part {
name: "TXT_USED_VALUE";
type: TEXTBLOCK;
description {
state: "default" 0.0;
visible: 1;
- rel1 {
- to: "TXT_USED";
- relative: 0.0 1.0;
- }
- rel2 {
- to: "TXT_USED";
- relative: 1.0 1.0;
- offset: 0 STORAGE_GRAPH_VALUE_TEXT_HEIGHT;
- }
+ rel1.relative: 0.033 0.5;
+ rel2.relative: 0.337 1.0;
text {
- style: "value style";
+ style: "used_value_style";
text: "IDS_ST_CALCULATING";
align: 0.0 0.0;
}
}
}
-
part {
- name: "BORDER_OUT";
- type: RECT;
+ name: "TXT_TOTAL_SPACE";
+ type: TEXTBLOCK;
description {
state: "default" 0.0;
visible: 1;
- rel1 {
- to: "TXT_USED_VALUE";
- relative: 0.0 1.0;
+ rel1.relative: 0.300 0.0;
+ rel2.relative: 0.467 0.5;
+ text {
+ style: "total_style";
+ text: "IDS_ST_BODY_TOTAL_SPACE_W_VAL";
}
- rel2 {
- to: "TXT_USED_VALUE";
- relative: 1.0 1.0;
- offset: 0 STORAGE_GRAPH_GRAPH_HEIGHT;
+ }
+ }
+ part {
+ name: "TXT_FREE_SPACE";
+ type: TEXTBLOCK;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ rel1.relative: 0.300 0.5;
+ rel2.relative: 0.467 1.0;
+ text {
+ style: "total_style";
+ text: "IDS_ST_BODY_FREE_SPACE_W_VAL";
}
+ }
+ }
+ part {
+ name: "PROGRESS_SPACER";
+ type: SPACER;
+ description {
+ state: "default" 0.0;
+ rel1.relative: 0.467 0.389;
+ rel2.relative: 0.967 0.611;
+ }
+ }
+ part {
+ name: "BORDER_OUT";
+ type: IMAGE;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ rel1.to: "PROGRESS_SPACER";
+ rel1.offset: -3 0;
+ rel2.to: "PROGRESS_SPACER";
color: 34 135 226 255;
+ image.normal: "core_progress_bar.#.png";
+
}
}
-
part {
name: "BORDER_IN";
- type: RECT;
+ type: IMAGE;
description {
state: "default" 0.0;
visible: 1;
rel1 {
- to: "BORDER_OUT";
+ to: "PROGRESS_SPACER";
relative: 0.0 0.0;
- offset: 2 2;
+ offset: 0 2;
}
rel2 {
- to: "BORDER_OUT";
+ to: "PROGRESS_SPACER";
relative: 1.0 1.0;
offset: -3 -3;
}
color: 255 255 255 255;
+ image.normal: "core_progress_bar.#.png";
+
}
}
-
part {
name: "PART_1";
- type: RECT;
+ type: IMAGE;
description {
state: "default" 0.0;
visible: 1;
- rel1 {
- to: "BORDER_IN";
- relative: 0.0 0.0;
- }
- rel2 {
- to: "BORDER_IN";
- relative: 0.0 1.0;
- }
+ rel.to: "PROGRESS_SPACER";
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ image.normal: "core_progress_bar.#.png";
color: STORAGE_APPS_COLOR 255;
+
}
}
-
part {
name: "PART_2";
- type: RECT;
+ type: IMAGE;
description {
state: "default" 0.0;
visible: 1;
- rel1 {
- to: "PART_1";
- relative: 1.0 0.0;
- }
- rel2 {
- to: "BORDER_IN";
- relative: 0.0 1.0;
- }
+ rel.to: "PROGRESS_SPACER";
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ image.normal: "core_progress_bar.#.png";
color: STORAGE_IMAGES_COLOR 255;
+
}
}
-
part {
name: "PART_3";
- type: RECT;
+ type: IMAGE;
description {
state: "default" 0.0;
visible: 1;
- rel1 {
- to: "PART_2";
- relative: 1.0 0.0;
- }
- rel2 {
- to: "BORDER_IN";
- relative: 0.0 1.0;
- }
+ rel.to: "PROGRESS_SPACER";
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 0.0 1.0;
+ image.normal: "core_progress_bar.#.png";
color: STORAGE_VIDEOS_COLOR 255;
+
}
}
-
part {
name: "PART_4";
- type: RECT;
+ type: IMAGE;
description {
state: "default" 0.0;
visible: 1;
- rel1 {
- to: "PART_3";
- relative: 1.0 0.0;
- }
- rel2 {
- to: "BORDER_IN";
- relative: 0.0 1.0;
- }
+ rel.to: "PROGRESS_SPACER";
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ image.normal: "core_progress_bar.#.png";
color: STORAGE_AUDIO_COLOR 255;
+
}
}
-
part {
name: "PART_5";
- type: RECT;
+ type: IMAGE;
description {
state: "default" 0.0;
visible: 1;
- rel1 {
- to: "PART_4";
- relative: 1.0 0.0;
- }
- rel2 {
- to: "BORDER_IN";
- relative: 0.0 1.0;
- }
+ rel.to: "PROGRESS_SPACER";
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ image.normal: "core_progress_bar.#.png";
color: STORAGE_DOCUMENTS_COLOR 255;
+
}
}
-
part {
name: "PART_6";
- type: RECT;
+ type: IMAGE;
description {
state: "default" 0.0;
visible: 1;
- rel1 {
- to: "PART_5";
- relative: 1.0 0.0;
- }
- rel2 {
- to: "BORDER_IN";
- relative: 0.0 1.0;
- }
+ rel.to: "PROGRESS_SPACER";
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ image.normal: "core_progress_bar.#.png";
color: STORAGE_MISC_COLOR 255;
+
}
}
-
part {
name: "PART_7";
- type: RECT;
+ type: IMAGE;
description {
state: "default" 0.0;
visible: 1;
- rel1 {
- to: "PART_6";
- relative: 1.0 0.0;
- }
- rel2 {
- to: "BORDER_IN";
- relative: 0.0 1.0;
- }
+ rel.to: "PROGRESS_SPACER";
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ image.normal: "core_progress_bar.#.png";
color: STORAGE_CACHED_COLOR 255;
+
}
}
-
part {
name: "PART_8";
- type: RECT;
+ type: IMAGE;
description {
state: "default" 0.0;
visible: 1;
- rel1 {
- to: "PART_7";
- relative: 1.0 0.0;
- }
- rel2 {
- to: "BORDER_IN";
- relative: 0.0 1.0;
- }
+ rel.to: "PROGRESS_SPACER";
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ image.normal: "core_progress_bar.#.png";
color: STORAGE_SYSTEM_COLOR 255;
- }
- }
-
- part {
- name: "TXT_TOTAL_SPACE";
- type: TEXTBLOCK;
- description {
- state: "default" 0.0;
- visible: 1;
- rel1 {
- to: "BORDER_OUT";
- relative: 0.0 1.0;
- offset: 0 20;
- }
- rel2 {
- to: "BORDER_OUT";
- relative: 1.0 1.0;
- offset: 0 20+STORAGE_GRAPH_SMALL_TEXT_HEIGHT;
- }
- text {
- style: "small text style";
- text: "IDS_ST_BODY_TOTAL_SPACE_W_VAL";
- }
- }
- }
-
- part {
- name: "TXT_FREE_SPACE";
- type: TEXTBLOCK;
- description {
- state: "default" 0.0;
- visible: 1;
- rel1 {
- to: "TXT_TOTAL_SPACE";
- relative: 0.0 1.0;
- }
- rel2 {
- to: "TXT_TOTAL_SPACE";
- relative: 1.0 1.0;
- offset: 0 STORAGE_GRAPH_SMALL_TEXT_HEIGHT;
- }
- text {
- style: "small text style";
- text: "IDS_ST_BODY_FREE_SPACE_W_VAL";
- }
+
}
}
}
script {
- public message(Msg_Type:type, id, ...)
+
+ public Float:set_part(part_name[], Float:rel_1, Float:rel_w)
{
- static Float:f_val1 = 0.0;
- static Float:f_val2 = 0.0;
- static Float:f_val3 = 0.0;
- static Float:f_val4 = 0.0;
- static Float:f_val5 = 0.0;
- static Float:f_val6 = 0.0;
- static Float:f_val7 = 0.0;
- static Float:f_val8 = 0.0;
-
- if(type == MSG_FLOAT_SET)
- {
- f_val1 = getfarg(2);
- f_val2 = f_val1 + getfarg(3);
- f_val3 = f_val2 + getfarg(4);
- f_val4 = f_val3 + getfarg(5);
- f_val5 = f_val4 + getfarg(6);
- f_val6 = f_val5 + getfarg(7);
- f_val7 = f_val6 + getfarg(8);
- f_val8 = f_val7 + getfarg(9);
+ new part_id = get_part_id(part_name);
+ new Float:rel_2 = rel_1 + rel_w;
+ custom_state(part_id, "default", 0.0);
- custom_state(PART:"PART_1", "default", 0.0);
- set_state_val(PART:"PART_1", STATE_REL2, f_val1, 1.0);
- set_state(PART:"PART_1", "custom", 0.0);
-
- custom_state(PART:"PART_2", "default", 0.0);
- set_state_val(PART:"PART_2", STATE_REL2, f_val2, 1.0);
- set_state(PART:"PART_2", "custom", 0.0);
-
- custom_state(PART:"PART_3", "default", 0.0);
- set_state_val(PART:"PART_3", STATE_REL2, f_val3, 1.0);
- set_state(PART:"PART_3", "custom", 0.0);
-
- custom_state(PART:"PART_4", "default", 0.0);
- set_state_val(PART:"PART_4", STATE_REL2, f_val4, 1.0);
- set_state(PART:"PART_4", "custom", 0.0);
-
- custom_state(PART:"PART_5", "default", 0.0);
- set_state_val(PART:"PART_5", STATE_REL2, f_val5, 1.0);
- set_state(PART:"PART_5", "custom", 0.0);
-
- custom_state(PART:"PART_6", "default", 0.0);
- set_state_val(PART:"PART_6", STATE_REL2, f_val6, 1.0);
- set_state(PART:"PART_6", "custom", 0.0);
-
- custom_state(PART:"PART_7", "default", 0.0);
- set_state_val(PART:"PART_7", STATE_REL2, f_val7, 1.0);
- set_state(PART:"PART_7", "custom", 0.0);
-
- custom_state(PART:"PART_8", "default", 0.0);
- set_state_val(PART:"PART_8", STATE_REL2, f_val8, 1.0);
- set_state(PART:"PART_8", "custom", 0.0);
+ set_state_val(part_id, STATE_REL1, rel_1, 0.0);
+ set_state_val(part_id, STATE_REL2, rel_2, 1.0);
+
+ if (rel_w > 0.0) {
+ set_state_val(part_id, STATE_REL1_OFFSET, -3, 0);
+ }
+
+ set_state(part_id, "custom", 0.0);
+ return rel_2;
+ }
+
+ public message(Msg_Type:type, id, ...)
+ {
+ static Float:rel_1 = 0.0;
+
+ if (type != MSG_FLOAT_SET || id != 7) {
+ return;
}
+
+ static Float:rel_w0 = 0.0;
+ static Float:rel_w1 = 0.0;
+ static Float:rel_w2 = 0.0;
+ static Float:rel_w3 = 0.0;
+ static Float:rel_w4 = 0.0;
+ static Float:rel_w5 = 0.0;
+ static Float:rel_w6 = 0.0;
+ static Float:rel_w7 = 0.0;
+
+ rel_w0 = getfarg(2);
+ rel_w1 = getfarg(3);
+ rel_w2 = getfarg(4);
+ rel_w3 = getfarg(5);
+ rel_w4 = getfarg(6);
+ rel_w5 = getfarg(7);
+ rel_w6 = getfarg(8);
+ rel_w7 = getfarg(9);
+
+ rel_1 = set_part("PART_1", rel_1, rel_w0);
+ rel_1 = set_part("PART_2", rel_1, rel_w1)
+ rel_1 = set_part("PART_3", rel_1, rel_w2);
+ rel_1 = set_part("PART_4", rel_1, rel_w3);
+ rel_1 = set_part("PART_5", rel_1, rel_w4);
+ rel_1 = set_part("PART_6", rel_1, rel_w5);
+ rel_1 = set_part("PART_7", rel_1, rel_w6);
+ rel_1 = set_part("PART_8", rel_1, rel_w7);
}
}
}
/* storage item style */
/* 2: app, 3: pic,video, 4: audio, 5: Misc files, 6: Avail space */
- int color;
+ int data_type;
/* Sound, ringtone ug, fullpath */
char *filepath;
#define SETTING_STORAGE_POPUP_TIMER 2
+typedef enum {
+ DATA_TYPE_APPS = 0,
+ DATA_TYPE_IMAGES = 1,
+ DATA_TYPE_VIDEOS = 2,
+ DATA_TYPE_AUDIO = 3,
+ DATA_TYPE_MISC = 4,
+ DATA_TYPE_CACHE = 5,
+ DATA_TYPE_SYSTEM = 6,
+ DATA_TYPE_MAX,
+} data_type_e;
+
typedef struct _SettingStorage {
MainData md;
double sz_inter_total;
double sz_inter_avail;
- double sz_apps;
- double sz_images;
- double sz_videos;
- double sz_audio;
- double sz_misces;
- double sz_caches;
- double sz_sys;
+
+ double sizes[DATA_TYPE_MAX];
Setting_GenGroupItem_Data *sys_mem;
Setting_GenGroupItem_Data *apps;
Setting_GenGroupItem_Data *images;
Setting_GenGroupItem_Data *videos;
Setting_GenGroupItem_Data *audio;
+ Setting_GenGroupItem_Data *documents;
Setting_GenGroupItem_Data *misces;
Setting_GenGroupItem_Data *caches;
/* Add items to genlist */
storage_apps_gl_append_items(ad);
- elm_object_item_part_content_unset(ad->misces_navi_it,
- "elm.swallow.content");
+ Evas_Object *layout = elm_object_item_part_content_get(ad->misces_navi_it, "elm.swallow.content");
+ elm_object_content_unset(layout);
if (elm_genlist_items_count(ad->misces_genlist) == 0) {
- elm_object_item_part_content_set(ad->misces_navi_it,
- "elm.swallow.content",
- ad->no_content_layout);
+ elm_object_content_set(layout, ad->no_content_layout);
evas_object_hide(ad->misces_genlist);
} else {
- elm_object_item_part_content_set(ad->misces_navi_it,
- "elm.swallow.content",
- ad->misces_genlist);
+ elm_object_content_set(layout, ad->misces_genlist);
evas_object_hide(ad->no_content_layout);
}
ret_if(NULL == d_subItem);
elm_radio_value_set(d_subItem->rgd, d_subItem->chk_status);
-
+ elm_genlist_item_selected_set(event_info, EINA_FALSE);
}
static void storage_default_reset_vconf(Setting_GenGroupItem_Data *data_item)
phone = setting_create_Gendial_field_1radio(scroller,
&itc_multiline_1text_1icon,
storage_default_expand_item_sel,
- NULL, SWALLOW_Type_1RADIO_RIGHT, rgd,
+ NULL, SWALLOW_Type_1RADIO_1TEXT, rgd,
SETTING_DEF_MEMORY_PHONE,
_("Storage"),
NULL);
memory_card = setting_create_Gendial_field_1radio(scroller,
&itc_multiline_1text_1icon,
storage_default_expand_item_sel,
- NULL, SWALLOW_Type_1RADIO_RIGHT, rgd,
+ NULL, SWALLOW_Type_1RADIO_1TEXT, rgd,
SETTING_DEF_MEMORY_MMC,
STORAGE_STR_SD_CARD,
NULL);
SWALLOW_Type_INVALID, NULL, NULL, 0,
"IDS_SM_TMBODY_DEFAULT_STORAGE_LOCATIONS",
NULL, NULL);
+
+ ad->default_storage->data_type = DATA_TYPE_MAX;
}
static void _cancel_btn_clicked_cb(void *data, Evas_Object *obj,
{
Evas_Object *btn_left;
Evas_Object *btn_right;
- Evas_Object *back_button;
Elm_Object_Item *it;
*genlist = elm_genlist_add(ad->md.naviframe);
retvm_if(genlist == NULL, NULL, "Cannot add genlist");
btn_right = setting_create_button(ad->md.naviframe, _("IDS_MSG_ACBUTTON_DONE_ABB"),
"naviframe/title_right", _done_btn_clicked_cb, ad);
- back_button = setting_create_button(ad->md.naviframe, NULL, NAVI_BACK_ARROW_BUTTON_STYLE, storage_default_back_cb, ad);
- it = elm_naviframe_item_push(ad->md.naviframe, "IDS_SM_HEADER_DEFAULT_STORAGE_LOC_ABB", back_button, NULL, *genlist, NULL); /* add new button */
- elm_naviframe_item_pop_cb_set(it, storage_default_back_cb, ad);
+ it = setting_push_to_naviframe_with_back_button(
+ _(IDS_SM_HEADER_DEFAULT_STORAGE_LOC_ABB), _("IDS_ST_BUTTON_BACK"),
+ storage_default_back_cb, ad, *genlist,
+ ad->md.naviframe
+ );
+
elm_object_item_part_content_set(it, "title_left_btn", btn_left);
elm_object_item_part_content_set(it, "title_right_btn", btn_right);
static inline void _update_storage_graph(SettingStorage *ad,
Edje_Object *target)
{
- Edje_Message_Float_Set *msg = alloca(sizeof(Edje_Message_Float_Set)
- + sizeof(double) * 7);
+ Edje_Message_Float_Set *msg = alloca(sizeof(Edje_Message_Float_Set) + sizeof(double) * 8);
ret_if(!msg);
msg->count = 8;
if (ad->sz_inter_total <= 0.0) {
- msg->val[0] = 0;
- msg->val[1] = 0;
- msg->val[2] = 0;
- msg->val[3] = 0;
- msg->val[4] = 0;
- msg->val[5] = 0;
- msg->val[6] = 0;
- msg->val[7] = 0;
+
+ for (int i = DATA_TYPE_APPS; i < DATA_TYPE_MAX; ++i) {
+ msg->val[0] = 0;
+ }
} else {
- /* Apps */
- msg->val[0] = ad->sz_apps / ad->sz_inter_total;
- if (msg->val[0] > 1 || msg->val[0] < 0)
- msg->val[0] = 1;
-
- /* Images */
- msg->val[1] = ad->sz_images / ad->sz_inter_total;
- if (msg->val[1] > 1 || msg->val[1] < 0)
- msg->val[1] = 1;
-
- /* Videos */
- msg->val[2] = ad->sz_videos / ad->sz_inter_total;
- if (msg->val[2] > 1 || msg->val[2] < 0)
- msg->val[2] = 1;
-
- /* Audio files */
- msg->val[3] = ad->sz_audio / ad->sz_inter_total;
- if (msg->val[3] > 1 || msg->val[3] < 0)
- msg->val[3] = 1;
-
- /* Documents */
- msg->val[4] = 0; /* TODO: correct when Documents size API is created
- ad->sz_documents / ad->sz_inter_total;
- if (msg->val[4] > 1 || msg->val[4] < 0)
- msg->val[4] = 1; */
-
- /* Misc. files */
- msg->val[5] = ad->sz_misces / ad->sz_inter_total;
- if (msg->val[5] > 1 || msg->val[5] < 0)
- msg->val[5] = 1;
-
- /* Cached data */
- msg->val[6] = (double)ad->sz_caches / ad->sz_inter_total;
- if (msg->val[6] > 1 || msg->val[6] < 0)
- msg->val[6] = 1;
-
- /* System storage */
- msg->val[7] = ad->sz_sys / ad->sz_inter_total;
- if (msg->val[7] > 1 || msg->val[7] < 0)
- msg->val[7] = 1;
+ for (int i = DATA_TYPE_APPS; i < DATA_TYPE_MAX; ++i) {
+ msg->val[i] = ad->sizes[i] / ad->sz_inter_total;
+ if (msg->val[i] > 1 || msg->val[i] < 0) {
+ msg->val[i] = 1;
+ }
+ }
}
edje_object_message_send(elm_layout_edje_get(target),
edje_object_message_signal_process(elm_layout_edje_get(target));
}
+
+static void _message_handle(void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg)
+{
+
+ if (type == EDJE_MESSAGE_STRING_FLOAT_SET && id == 10) {
+ Edje_Message_String_Float_Set *m = msg;
+ SETTING_TRACE_WARNING("[MS] MSG: size=%d %s rel1: %f relw: %f rel2: %f", m->count, m->str, m->val[0], m->val[1], m->val[2]);
+ } else if (type == EDJE_MESSAGE_STRING_FLOAT && id == 11) {
+ Edje_Message_String_Float *m = msg;
+ SETTING_TRACE_WARNING("[MS] MSG: %s relw: %f", m->str, m->val);
+ }
+}
+
Evas_Object *storage_main_graph_get(void *data, Evas_Object *obj,
const char *part)
{
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ edje_object_message_handler_set(elm_layout_edje_get(layout), _message_handle, NULL);
+
/* Set size texts */
/* - used */
elm_object_part_text_set(layout, "TXT_USED", _("IDS_ST_BODY_USED"));
return layout;
}
+static Evas_Object *_create_icon(Evas_Object *parent, data_type_e ico)
+{
+ char *files[] = {
+ "12_apps_normal.png",
+ "12_images_normal.png",
+ "12_videos_normal.png",
+ "12_audio_normal.png",
+ "12_doc_normal.png",
+ "12_misc_normal.png",
+ "12_cached_data_normal.png",
+ "12_sys_storage_normal.png"
+ };
+
+ char in_path[1024] = {0,};
+ snprintf(in_path, 1024, "icons/storage/%s", files[ico]);
+
+ const char *path = setting_get_resource_path(in_path);
+ if (!path) {
+ SETTING_TRACE_ERROR("Failed to load file: %s", files[ico]);
+ return NULL;
+ }
+
+ Evas_Object *image = elm_image_add(parent);
+ if (!image) {
+ SETTING_TRACE_ERROR("elm_image_add() failed");
+ }
+
+ Eina_Bool ret = elm_image_file_set(image, path, NULL);
+ if (!ret) {
+ SETTING_TRACE_ERROR("elm_image_file_set(%p, %s) failed", image, path);
+ }
+
+ evas_object_size_hint_min_set(image, 32, 32);
+ evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(image, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ return image;
+}
+
Evas_Object *storage_color_item_content_get(void *data, Evas_Object *obj,
const char *part)
{
- Eina_Bool result;
setting_retvm_if(data == NULL, NULL, "data is NULL");
Setting_GenGroupItem_Data *list_item = data;
- int color = list_item->color;
-
- if (!strcmp(part, "elm.icon")) {
- Evas_Object *layout = elm_layout_add(obj);
-
- result = elm_layout_file_set(layout, SETTING_THEME_EDJ_NAME,
- "storage_edge");
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
- EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(layout, EVAS_HINT_FILL,
- EVAS_HINT_FILL);
-
- if (!result) {
- SETTING_TRACE_ERROR(" ERROR -- elm_layout_file_set("
- "layout, SETTING_THEME_EDJ_NAME, "
- "storage_edge)");
- return NULL;
- }
- switch (color) {
- case 1:
- elm_object_signal_emit(layout, "elm,state,show,apps",
- "elm");
- break;
- case 2:
- elm_object_signal_emit(layout, "elm,state,show,images",
- "elm");
- break;
- case 3:
- elm_object_signal_emit(layout, "elm,state,show,videos",
- "elm");
- break;
- case 4:
- elm_object_signal_emit(layout, "elm,state,show,audio",
- "elm");
- break;
- case 5:
- elm_object_signal_emit(layout, "elm,state,show,misc",
- "elm");
- break;
- case 6:
- elm_object_signal_emit(layout, "elm,state,show,cache",
- "elm");
- break;
- case 7:
- elm_object_signal_emit(layout, "elm,state,show,system",
- "elm");
- break;
- default:
- break;
- }
- evas_object_show(layout);
- return layout;
+ if (strcmp(part, "elm.icon")) {
+ return NULL;
}
- return NULL;
+ Evas_Object *icon = _create_icon(obj, list_item->data_type);
+ return icon;
}
static void __storage_cache_file_clean_popup_no_cache_rsp_cb(void *data,
Evas_Object *obj, void *event_info)
}
/* Make toast popup of cache cleared */
- storage_size_to_str(ad->sz_caches, cached_data_str,
+ storage_size_to_str(ad->sizes[DATA_TYPE_CACHE], cached_data_str,
sizeof(cached_data_str));
snprintf(cache_cleared_str, sizeof(cache_cleared_str),
_("IDS_SM_TPOP_P1SS_P2SS_CACHED_DATA_CLEARED_ABB"),
ad->md.window);
/* Refresh cache size display */
- ad->sz_caches = 0;
- storage_genlist_text_update(ad->caches,
- ad->sz_caches);
+ ad->sizes[DATA_TYPE_CACHE] = 0;
+ storage_genlist_text_update(ad->caches, ad->sizes[DATA_TYPE_CACHE]);
break;
}
case POPUP_RESPONSE_CANCEL:
Setting_GenGroupItem_Data *list_item = elm_object_item_data_get(item);
setting_retm_if(NULL == list_item, "list_item is NULL");
- SETTING_TRACE("clicking item[%s]", list_item->keyStr);
-
- if (!safeStrCmp("IDS_SM_TMBODY_APPS_ABB", list_item->keyStr)) {
- setting_view_change(ad->main_view, ad->apps_view, ad);
- } else if (!safeStrCmp("IDS_SM_TMBODY_DEFAULT_STORAGE_LOCATIONS", list_item->keyStr)) {
- setting_view_change(ad->main_view, ad->default_view, ad);
- } else if (!safeStrCmp("IDS_ST_BODY_IMAGES", list_item->keyStr)) {
- app_launcher("org.tizen.myfile.category|view:images", NULL, NULL);
- } else if (!safeStrCmp("IDS_ST_BODY_VIDEOS", list_item->keyStr)) {
- app_launcher("org.tizen.myfile.category|view:videos", NULL, NULL);
- } else if (!safeStrCmp(STORAGE_STR_AUDIO, list_item->keyStr)) {
- app_launcher("org.tizen.myfile.category|view:audio", NULL, NULL);
- } else if (!safeStrCmp(STORAGE_STR_MISCES, list_item->keyStr)) {
- setting_view_change(ad->main_view, ad->misces_view, ad);
- } else if (!safeStrCmp(STORAGE_STR_CACHE, list_item->keyStr)) {
- if (ad->sz_caches <= 0) {
- ad->popup = setting_create_popup(ad, ad->md.window,
- "IDS_ST_HEADER_CLEAR_CACHE_ABB",
- "IDS_ST_POP_THERE_IS_NO_CACHE_DATA_TO_CLEAR",
- __storage_cache_file_clean_popup_no_cache_rsp_cb,
- 0, FALSE, FALSE,
- 1, "IDS_ST_BUTTON_OK_ABB");
- } else {
- ad->popup = setting_create_popup(ad, ad->md.window,
- "IDS_ST_HEADER_CLEAR_CACHE_ABB",
- "IDS_ST_POP_ALL_THE_CACHE_DATA_WILL_BE_CLEARED",
- __storage_cache_file_clean_popup_rsp_cb,
- 0, FALSE, FALSE,
- 2, "IDS_ST_BUTTON_CLEAR_CACHE_ABB",
- "IDS_ST_BUTTON_CANCEL_ABB");
- }
+ SETTING_TRACE("clicking item[%s] %s", list_item->keyStr, STORAGE_STR_CACHE);
+
+ switch (list_item->data_type) {
+ case DATA_TYPE_APPS:
+ setting_view_change(ad->main_view, ad->apps_view, ad);
+ break;
+ case DATA_TYPE_IMAGES:
+ case DATA_TYPE_VIDEOS:
+ case DATA_TYPE_AUDIO:
+ SETTING_TRACE("Unhandled item type");
+ break;
+ case DATA_TYPE_MISC:
+ setting_view_change(ad->main_view, ad->misces_view, ad);
+ break;
+ case DATA_TYPE_CACHE:
+ if (ad->sizes[DATA_TYPE_CACHE] <= 0) {
+ ad->popup = setting_create_popup(ad, ad->md.window,
+ "IDS_ST_HEADER_CLEAR_CACHE_ABB",
+ "IDS_ST_POP_THERE_IS_NO_CACHE_DATA_TO_CLEAR",
+ __storage_cache_file_clean_popup_no_cache_rsp_cb,
+ 0, FALSE, FALSE,
+ 1, "IDS_ST_BUTTON_OK_ABB");
+ } else {
+ ad->popup = setting_create_popup(ad, ad->md.window,
+ "IDS_ST_HEADER_CLEAR_CACHE_ABB",
+ "IDS_ST_POP_ALL_THE_CACHE_DATA_WILL_BE_CLEARED",
+ __storage_cache_file_clean_popup_rsp_cb,
+ 0, FALSE, FALSE,
+ 2, "IDS_ST_BUTTON_CLEAR_CACHE_ABB",
+ "IDS_ST_BUTTON_CANCEL_ABB");
+ }
+ break;
+ case DATA_TYPE_SYSTEM:
+ break;
+ default:
+ setting_view_change(ad->main_view, ad->default_view, ad);
+ break;
}
}
static Setting_GenGroupItem_Data *storage_main_append_group_mid_item(
- SettingStorage *ad, int color, const char *key_str,
+ SettingStorage *ad, int data_type, const char *key_str,
const char *sub_str)
{
Setting_GenGroupItem_Data *item_data = NULL;
item_data->userdata = ad;
item_data->keyStr = (char *)g_strdup(key_str);
item_data->sub_desc = (char *)g_strdup(sub_str);
- item_data->color = color;
+ item_data->data_type = data_type;
item_data->item = elm_genlist_item_append(ad->md.genlist,
&(ad->itc_color_item), item_data, NULL,
ELM_GENLIST_ITEM_NONE, storage_main_sel, ad);
{
/* Apps */
ad->apps = storage_main_append_group_mid_item(ad,
- 1, "IDS_SM_TMBODY_APPS_ABB", "IDS_SM_SBODY_CALCULATING_ING");
+ DATA_TYPE_APPS, "IDS_SM_TMBODY_APPS_ABB", "IDS_SM_SBODY_CALCULATING_ING");
ret_if(NULL == ad->apps);
/* Images */
ad->images = storage_main_append_group_mid_item(ad,
- 2, "IDS_ST_BODY_IMAGES", "IDS_SM_SBODY_CALCULATING_ING");
+ DATA_TYPE_IMAGES, "IDS_ST_BODY_IMAGES", "IDS_SM_SBODY_CALCULATING_ING");
ret_if(NULL == ad->images);
/* Videos */
ad->videos = storage_main_append_group_mid_item(ad,
- 3, "IDS_ST_BODY_VIDEOS", "IDS_SM_SBODY_CALCULATING_ING");
+ DATA_TYPE_VIDEOS, "IDS_ST_BODY_VIDEOS", "IDS_SM_SBODY_CALCULATING_ING");
ret_if(NULL == ad->videos);
/* Audio */
ad->audio = storage_main_append_group_mid_item(ad,
- 4, _("Audio files"), "IDS_SM_SBODY_CALCULATING_ING");
+ DATA_TYPE_AUDIO, _("Audio files"), "IDS_SM_SBODY_CALCULATING_ING");
ret_if(NULL == ad->audio);
/* Miscellaneous files */
ad->misces = storage_main_append_group_mid_item(ad,
- 5, _("Misc. files"), "IDS_SM_SBODY_CALCULATING_ING");
+ DATA_TYPE_MISC, _("IDS_ST_BODY_MISCELLANEOUS_FILES"), "IDS_SM_SBODY_CALCULATING_ING");
ret_if(NULL == ad->misces);
/* Cached data */
ad->caches = storage_main_append_group_mid_item(ad,
- 6, _("Cached data"), "IDS_SM_SBODY_CALCULATING_ING");
+ DATA_TYPE_CACHE, _("IDS_ST_BODY_CACHED_DATA_ABB"), "IDS_SM_SBODY_CALCULATING_ING");
ret_if(NULL == ad->caches);
/* System storage */
ad->sys_mem = storage_main_append_group_mid_item(ad,
- 7, _("System memory"), "IDS_SM_SBODY_CALCULATING_ING");
+ DATA_TYPE_SYSTEM, _("System memory"), "IDS_SM_SBODY_CALCULATING_ING");
ret_if(NULL == ad->sys_mem);
elm_genlist_item_select_mode_set(ad->sys_mem->item,
ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
return;
}
- ad->sz_sys = ad->sz_inter_total - ad->sz_apps - ad->sz_images
- - ad->sz_videos - ad->sz_audio - ad->sz_misces
+ ad->sizes[DATA_TYPE_SYSTEM] = ad->sz_inter_total - ad->sizes[DATA_TYPE_APPS] - ad->sizes[DATA_TYPE_IMAGES]
+ - ad->sizes[DATA_TYPE_VIDEOS] - ad->sizes[DATA_TYPE_AUDIO] - ad->sizes[DATA_TYPE_MISC]
- ad->sz_inter_avail;
- storage_genlist_text_update(ad->sys_mem, ad->sz_sys);
- storage_genlist_text_update(ad->images, ad->sz_images);
- storage_genlist_text_update(ad->videos, ad->sz_videos);
- storage_genlist_text_update(ad->audio, ad->sz_audio);
- storage_genlist_text_update(ad->misces, ad->sz_misces);
+ storage_genlist_text_update(ad->sys_mem, ad->sizes[DATA_TYPE_SYSTEM]);
+ storage_genlist_text_update(ad->images, ad->sizes[DATA_TYPE_IMAGES]);
+ storage_genlist_text_update(ad->videos, ad->sizes[DATA_TYPE_VIDEOS]);
+ storage_genlist_text_update(ad->audio, ad->sizes[DATA_TYPE_AUDIO]);
+ storage_genlist_text_update(ad->misces, ad->sizes[DATA_TYPE_MISC]);
/* update storage graph */
elm_genlist_item_update(ad->graph_genlist_it);
storage_STOP_POINT;
- ad->sz_images = sizes.images_total;
- ad->sz_videos = sizes.video_total;
- ad->sz_audio = sizes.audio_total;
- ad->sz_misces = sizes.misces_total;
+ ad->sizes[DATA_TYPE_IMAGES] = sizes.images_total;
+ ad->sizes[DATA_TYPE_VIDEOS] = sizes.video_total;
+ ad->sizes[DATA_TYPE_AUDIO] = sizes.audio_total;
+ ad->sizes[DATA_TYPE_MISC] = sizes.misces_total;
return SETTING_RETURN_SUCCESS;
}
package_size_info_get_cache_size(size_info, &cache_size);
package_size_info_get_external_cache_size(size_info, &ext_cache_size);
- ad->sz_apps = (double)(app_size + ext_app_size);
- ad->sz_caches = (double)(cache_size + ext_cache_size);
+ ad->sizes[DATA_TYPE_APPS] = (double)(app_size + ext_app_size);
+ ad->sizes[DATA_TYPE_CACHE] = (double)(cache_size + ext_cache_size);
- SETTING_TRACE_DEBUG("size_info->app_size : %lf", ad->sz_apps);
- SETTING_TRACE_DEBUG("ad->sz_caches:%lf", ad->sz_caches);
+ SETTING_TRACE_DEBUG("size_info->app_size : %lf", ad->sizes[DATA_TYPE_APPS]);
+ SETTING_TRACE_DEBUG("ad->sizes[ICON_CACHE];:%lf", ad->sizes[DATA_TYPE_CACHE]);
- storage_genlist_text_update(ad->apps, ad->sz_apps);
- storage_genlist_text_update(ad->caches, ad->sz_caches);
+ storage_genlist_text_update(ad->apps, ad->sizes[DATA_TYPE_APPS]);
+ storage_genlist_text_update(ad->caches, ad->sizes[DATA_TYPE_CACHE]);
ret_if(!ad->graph_genlist_it);
elm_genlist_item_update(ad->graph_genlist_it);