2 * Copyright 2013 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include <vconf-keys.h>
19 #include <syspopup_caller.h>
24 #include "mf-widget.h"
25 #include "mf-fm-svc-wrapper.h"
26 #include "mf-callback.h"
27 #include "mf-language-mgr.h"
30 #define ITEM_MAX_COUNT 4
31 #define SHARE_ITEM_COUNT 4
32 #define MF_POPUP_STYLE_MIN_MENUSTYLE "menustyle"
33 #define MF_POPUP_MENUSTYLE_WIDTH (614*elm_config_scale_get())
34 #define MF_POPUP_MENUSTYLE_HEIGHT(x) ((113*x-1)*elm_config_scale_get())
35 #define MF_POPUP_MENUSTYLE_HEIGHT_MAX (408*elm_config_scale_get())
36 Elm_Genlist_Item_Class listby_itc, share_itc, storage_itc;
40 bool unregister_lang_mgr;
41 Elm_Object_Item *item;
45 static int __mf_popup_get_list_by_selected_item()
47 int iSortTypeValue = 0;
48 mf_util_get_vconf_value(VCONF_TYPE_SORT_TYPE, &iSortTypeValue);
51 switch (iSortTypeValue) {
52 case MYFILE_SORT_BY_DATE_O2R:
55 case MYFILE_SORT_BY_DATE_R2O:
58 case MYFILE_SORT_BY_TYPE_A2Z:
61 case MYFILE_SORT_BY_NAME_A2Z:
64 case MYFILE_SORT_BY_NAME_Z2A:
67 case MYFILE_SORT_BY_SIZE_L2S:
70 case MYFILE_SORT_BY_SIZE_S2L:
71 case MYFILE_SORT_BY_TYPE_Z2A:
79 static int __mf_popup_get_list_by_opt(int index)
81 //int iSortTypeValue = 0;
82 //mf_util_get_vconf_value(VCONF_TYPE_SORT_TYPE, &iSortTypeValue);
84 fsSortOption ret = MYFILE_SORT_BY_NONE;
87 ret = MYFILE_SORT_BY_NAME_A2Z;
90 ret = MYFILE_SORT_BY_NAME_Z2A;
93 ret = MYFILE_SORT_BY_DATE_R2O;
96 ret = MYFILE_SORT_BY_DATE_O2R;
99 ret = MYFILE_SORT_BY_SIZE_L2S;
102 ret = MYFILE_SORT_BY_TYPE_A2Z;
105 ret = MYFILE_SORT_BY_DATE_R2O;
111 static int __mf_popup_get_view_as_type(int index)
113 eMfViewStyle ret = MF_VIEW_STYLE_LIST;
116 ret = MF_VIEW_STYLE_LIST;
119 ret = MF_VIEW_SYTLE_LIST_DETAIL;
122 ret = MF_VIEW_STYLE_THUMBNAIL;
125 ret = MF_VIEW_STYLE_LIST;
131 static void __mf_popup_listby_genlist_del(void *data, Evas_Object * obj)
134 ListByData_s *params = (ListByData_s *) data;
135 mf_retm_if(params == NULL, "params is NULL");
137 if(params->unregister_lang_mgr)
138 mf_language_mgr_unregister_genlist_item(params->item);
139 SAFE_FREE_CHAR(params);
142 static char *__mf_popup_get_genlist_label(void *data, Evas_Object * obj, const char *part)
144 ListByData_s *params = (ListByData_s *) data;
146 struct appdata *ap = params->ap;
151 if (!strcmp(part, "elm.text")) {
152 //listby_opt = __mf_popup_get_list_by_opt(params->index);
153 switch (params->index) {
155 ret = g_strdup(GET_STR(MF_LABEL_NAME_HA_TO_Z));
158 ret = g_strdup(GET_STR(MF_LABEL_NAME_HZ_TO_A));
161 ret = g_strdup(GET_STR(MF_LABEL_DATE_HMOST_RECENT));
164 ret = g_strdup(GET_STR(MF_LABEL_DATE_HOLDEST));
167 ret = g_strdup(GET_SYS_STR(MF_LABEL_SIZE));
170 ret = g_strdup(GET_SYS_STR(MF_LABEL_TYPE)); /**< Sort by file size descending */
173 case MYFILE_SORT_BY_DATE_R2O: /**< Sort by file date descending */
174 ret = g_strdup(GET_SYS_STR(MF_LABEL_DATE));
176 case MYFILE_SORT_BY_TYPE_Z2A: /**< Sort by file type descending */
177 ret = g_strdup(GET_SYS_STR(MF_LABEL_TYPE));
188 static char *__mf_popup_view_as_genlist_label_get(void *data, Evas_Object * obj, const char *part)
190 ListByData_s *params = (ListByData_s *) data;
192 struct appdata *ap = params->ap;
196 eMfViewStyle view_as_type = MF_VIEW_STYLE_LIST;
199 if (!strcmp(part, "elm.text")) {
200 view_as_type = __mf_popup_get_view_as_type(params->index);
201 switch (view_as_type) {
202 case MF_VIEW_STYLE_LIST: /**< Sort by file name ascending */
203 ret = g_strdup(GET_SYS_STR(MF_LABEL_LIST));
205 case MF_VIEW_SYTLE_LIST_DETAIL: /**< Sort by file size ascending */
206 ret = g_strdup(GET_STR(LABEL_LIST_DETAIL_VIEW));
208 case MF_VIEW_STYLE_THUMBNAIL: /**< Sort by file date ascending */
209 ret = g_strdup(GET_STR(MF_LABEL_THUMBNAILS));
219 static Evas_Object* __mf_popup_get_genlist_icon(void *data, Evas_Object * obj, const char *part)
221 ListByData_s *params = (ListByData_s *) data;
223 struct appdata *ap = params->ap;
227 if (!strcmp(part, "elm.icon")) {
228 Evas_Object *radio = NULL;
229 radio = elm_radio_add(obj);
230 elm_object_focus_set(radio, EINA_FALSE);
231 elm_radio_state_value_set(radio, params->index);
232 elm_radio_group_add(radio, ap->mf_Status.pRadioGroup);
233 elm_radio_value_set(radio, ap->mf_Status.iRadioValue);
234 evas_object_show(radio);
240 static void __mf_popup_genlist_select(void *data, Evas_Object * obj, void *event_info)
244 ListByData_s *params = NULL;
245 Elm_Object_Item *item = (Elm_Object_Item *) event_info;
249 elm_genlist_item_selected_set(item, FALSE);
250 params = (ListByData_s *) elm_object_item_data_get(item);
251 if (params != NULL && params->ap != NULL) {
252 fsSortOption iListBySortType = MYFILE_SORT_BY_NONE;
253 params->ap->mf_Status.iSelectedSortType = params->index;
254 elm_radio_value_set(params->ap->mf_Status.pRadioGroup, params->index);
255 iListBySortType = __mf_popup_get_list_by_opt(params->index);
256 mf_util_set_sort_type(iListBySortType);
257 mf_callback_list_by_response_cb(params->ap);
263 static void __mf_popup_view_as_genlist_select(void *data, Evas_Object * obj, void *event_info)
267 ListByData_s *params = NULL;
269 Elm_Object_Item *item = (Elm_Object_Item *) event_info;
271 params = (ListByData_s *) elm_object_item_data_get(item);
272 if (params != NULL && params->ap != NULL) {
273 elm_radio_value_set(params->ap->mf_Status.pRadioGroup, params->index);
274 iViewAsType = __mf_popup_get_view_as_type(params->index);
275 params->ap->mf_Status.flagViewType = iViewAsType;
276 mf_util_set_view_style(iViewAsType);
277 mf_callback_popup_del_idler_cb(params->ap);
278 if (params->ap->mf_Status.flagNoContent != EINA_TRUE) {
279 mf_widget_refresh_view(params->ap);
284 static int __mf_popup_get_view_as_selected_item()
288 mf_util_get_vconf_value(VCONF_TYPE_VIEW_STYLE, &iViewAs);
292 case MF_VIEW_STYLE_LIST:
295 case MF_VIEW_SYTLE_LIST_DETAIL:
298 case MF_VIEW_STYLE_THUMBNAIL:
308 #ifdef MYFILE_SPLIT_VIEW
309 static void __mf_popup_storage_genlist_del(void *data, Evas_Object * obj)
312 StorageData_s *params = (StorageData_s *) data;
313 mf_retm_if(params == NULL, "params is NULL");
315 if(params->unregister_lang_mgr)
316 mf_language_mgr_unregister_genlist_item(params->item);
317 SAFE_FREE_CHAR(params->label);
318 SAFE_FREE_CHAR(params);
321 static char *__mf_popup_get_storage_genlist_label(void *data, Evas_Object * obj, const char *part)
324 StorageData_s *params = (StorageData_s *) data;
325 mf_retvm_if(params == NULL, NULL, "params is NULL");
326 struct appdata *ap = params->ap;
327 mf_retvm_if(ap == NULL, NULL, "ap is NULL");
330 if (!strcmp(part, "elm.text")) {
332 return strdup(params->label);
338 static Evas_Object* __mf_popup_get_storage_genlist_icon(void *data, Evas_Object * obj, const char *part)
341 StorageData_s *params = (StorageData_s *) data;
342 mf_retvm_if(params == NULL, NULL, "params is NULL");
343 struct appdata *ap = params->ap;
344 mf_retvm_if(ap == NULL, NULL, "ap is NULL");
347 if (!strcmp(part, "elm.icon")) {
348 Evas_Object *radio = NULL;
349 radio = elm_radio_add(obj);
350 elm_object_focus_set(radio, EINA_FALSE);
351 elm_radio_state_value_set(radio, params->index);
352 elm_radio_group_add(radio, ap->mf_Status.pRadioGroup);
353 elm_radio_value_set(radio, ap->mf_Status.iRadioValue);
354 evas_object_show(radio);
362 static void __mf_popup_storage_genlist_select(void *data, Evas_Object * obj, void *event_info)
365 mf_retm_if(data == NULL, "data is NULL");
366 mf_retm_if(event_info == NULL, "event_info is NULL");
367 StorageData_s *params = NULL;
368 Elm_Object_Item *item = (Elm_Object_Item *) event_info;
370 params = (StorageData_s *) elm_object_item_data_get(item);
371 if (params != NULL && params->ap != NULL) {
376 /******************************
377 ** Prototype : mf_popup_create_pb_popup
379 ** Input : void *data
390 ** 1.Date : 2010/12/10
392 ** Modification : Created function
394 ******************************/
395 Evas_Object *mf_popup_create_pb_popup(void *data, char *context, int file_count, void *func, void *param)
400 ap = (struct appdata *)data;
403 char count[256] = { 0 };
404 Evas_Object *popup, *progressbar;
407 snprintf(count, sizeof(count), "%s0/%d", count, file_count);
409 popup = elm_popup_add(ap->mf_MainWindow.pMainLayout);
410 elm_object_focus_set(popup, EINA_FALSE);
412 layout = elm_layout_add(popup);
413 elm_object_focus_set(layout, EINA_FALSE);
414 elm_layout_file_set(layout, EDJ_NAME, "popup_center_progressview");
415 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
416 ap->mf_MainWindow.pProgressLayout = layout;
418 progressbar = elm_progressbar_add(popup);
419 elm_object_focus_set(progressbar, EINA_FALSE);
420 ap->mf_FileOperation.progress_bar = progressbar;
421 elm_object_style_set(progressbar, "list_progress");
422 elm_progressbar_horizontal_set(progressbar, EINA_TRUE);
423 evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, EVAS_HINT_FILL);
424 evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
425 elm_progressbar_value_set(progressbar, 0.0);
426 evas_object_show(progressbar);
428 elm_object_part_content_set(layout, "elm.swallow.content", progressbar);
429 edje_object_part_text_set(elm_layout_edje_get(layout), "elm.title", context);
430 edje_object_part_text_set(elm_layout_edje_get(layout), "elm.text.left", "0%");
431 edje_object_part_text_set(elm_layout_edje_get(layout), "elm.text.right", count);
433 elm_object_content_set(popup, layout);
435 Evas_Object *btn1 = mf_widget_button_create(popup, GET_SYS_STR(LABEL_CANCEL));
436 elm_object_style_set(btn1, "popup_button/default");
437 evas_object_smart_callback_add(btn1, "clicked", func, param);
438 elm_object_part_content_set(popup, "button1", btn1);
440 evas_object_show(popup);
445 /******************************
446 ** Prototype : mf_popup_create_popup
448 ** Input : void *data
449 ** ePopMode popupMode
452 ** char *first_btn_text
453 ** char *second_btn_text
454 ** char *third_btn_text
455 ** Evas_Smart_Cb func
463 ** 1.Date : 2010/12/10
465 ** Modification : Created function
467 ******************************/
468 #ifdef MYFILE_SPLIT_VIEW
469 static void mf_popup_storage_item_append(void *data, Evas_Object *popup, Evas_Object *genlist)
472 mf_retm_if(data == NULL, "data is NULL");
473 mf_retm_if(popup == NULL, "popup is NULL");
474 mf_retm_if(genlist == NULL, "genlist is NULL");
476 struct appdata *ap = (struct appdata *)data;
477 Elm_Object_Item *it = NULL;
479 StorageData_s *item_data = malloc(sizeof(StorageData_s));
480 if (item_data == NULL) {
481 mf_util_operation_alloc_failed(ap);
486 item_data->label= strdup(GET_SYS_STR(MF_LABEL_PHONE));
487 item_data->index = MYFILE_PHONE;
489 item_data->unregister_lang_mgr = TRUE;
491 it = elm_genlist_item_append(genlist, &storage_itc, (void *)item_data, NULL,
492 ELM_GENLIST_ITEM_NONE, __mf_popup_storage_genlist_select, popup);
493 item_data->item = it;
494 mf_language_mgr_register_genlist_item(it);
496 if (ap->mf_Status.iStorageState & MYFILE_MMC) {
497 StorageData_s *item_data = malloc(sizeof(StorageData_s));
498 if (item_data == NULL) {
499 mf_util_operation_alloc_failed(ap);
503 item_data->label = strdup(GET_SYS_STR(MF_LABEL_MMC));
504 mf_debug("item_data->label is [%s]", item_data->label);
505 item_data->index = MYFILE_MMC;
507 it = elm_genlist_item_append(genlist, &storage_itc, (void *)item_data, NULL,
508 ELM_GENLIST_ITEM_NONE, __mf_popup_storage_genlist_select, popup);
509 item_data->item = it;
510 mf_language_mgr_register_genlist_item(it);
512 if (ap->mf_Status.iStorageState & MYFILE_OTG) {
513 StorageData_s *item_data = malloc(sizeof(StorageData_s));
514 if (item_data == NULL) {
515 mf_util_operation_alloc_failed(ap);
519 item_data->label = strdup(GET_STR(MF_LABEL_OTG));
520 mf_debug("item_data->label is [%s]", item_data->label);
521 item_data->index = MYFILE_OTG;
523 it = elm_genlist_item_append(genlist, &storage_itc, (void *)item_data, NULL,
524 ELM_GENLIST_ITEM_NONE, __mf_popup_storage_genlist_select, popup);
525 item_data->item = it;
526 mf_language_mgr_register_genlist_item(it);
533 static Evas_Object *__mf_popup_box_set(Evas_Object *parent, Evas_Object *content, int item_cnt)
535 mf_retvm_if(parent == NULL, NULL, "parent is NULL");
536 mf_retvm_if(content == NULL, NULL, "content is NULL");
537 mf_retvm_if(item_cnt < 0, NULL, "content is NULL");
539 Evas_Object *box = elm_box_add(parent);
540 if (item_cnt > ITEM_MAX_COUNT) {
541 evas_object_size_hint_min_set(box, MF_POPUP_MENUSTYLE_WIDTH,
542 MF_POPUP_MENUSTYLE_HEIGHT(ITEM_MAX_COUNT));
544 evas_object_size_hint_min_set(box, MF_POPUP_MENUSTYLE_WIDTH,
545 MF_POPUP_MENUSTYLE_HEIGHT(item_cnt));
548 evas_object_show(content);
549 elm_box_pack_end(box, content);
553 Evas_Object *mf_ug_popup_create_search(void *data, Evas_Smart_Cb func, void *param)
556 struct appdata *ap = (struct appdata *)data;
557 mf_retvm_if(ap == NULL, NULL, "ap is NULL");
562 Evas_Object *label = NULL;
565 popup = elm_popup_add(ap->mf_MainWindow.pMainLayout);
566 elm_object_focus_set(popup, EINA_FALSE);
568 layout = elm_layout_add(popup);
569 elm_object_focus_set(layout, EINA_FALSE);
570 elm_layout_file_set(layout, EDJ_NAME, "popup_center_text");
571 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
572 ap->mf_MainWindow.pSearchLabel = layout;
574 elm_object_part_text_set(layout, "elm.swallow.content", "Phone");
575 elm_object_part_text_set(layout, "elm.title", mf_util_get_text(MF_LABEL_SEARCHING));
577 elm_object_content_set(popup, layout);
579 Evas_Object *btn1 = mf_widget_button_create(popup, GET_SYS_STR(LABEL_CANCEL));
580 elm_object_style_set(btn1, "popup_button/default");
581 evas_object_smart_callback_add(btn1, "clicked", func, param);
582 elm_object_part_content_set(popup, "button1", btn1);
584 evas_object_show(popup);
589 Evas_Object *mf_popup_create_popup(void *data, ePopMode popupMode, char *title, const char *context, const char *first_btn_text, const char *second_btn_text,
590 const char *third_btn_text, Evas_Smart_Cb func, void *param)
595 Evas_Object *genlist;
596 Evas_Object *radio_group = NULL;
597 Evas_Object *box = NULL;
598 Evas_Object *btn1 = NULL;
599 Evas_Object *btn2 = NULL;
600 Evas_Object *btn3 = NULL;
602 int listby_selected= 0;
603 int context_items = 0;
604 #ifdef MYFILE_SPLIT_VIEW
605 int storage = MYFILE_PHONE;
607 ap = (struct appdata *)data;
608 mf_retvm_if(ap == NULL, NULL, "ap is NULL");
610 popup = elm_popup_add(ap->mf_MainWindow.pWindow);
611 elm_object_focus_set(popup, EINA_FALSE);
612 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
614 elm_object_part_text_set(popup, "title,text", title);
615 mf_language_mgr_register_object(popup, OBJ_TYPE_EDJE_OBJECT, "title,text", title);
617 if (context && popupMode != POPMODE_PROGRESSBAR) {
619 elm_object_text_set(popup, context);
624 case POPMODE_TITLE_TEXT:
625 elm_popup_timeout_set(popup, 3);
627 evas_object_smart_callback_add(popup, "response", func, param);
630 case POPMODE_TEXT_NOT_DISABLED:
632 evas_object_smart_callback_add(popup, "response", func, NULL);
636 case POPMODE_TEXT_TWO_BTN:
637 case POPMODE_TITLE_TEXT_TWO_BTN:
638 btn1 = mf_widget_button_create(popup, first_btn_text);
639 elm_object_style_set(btn1, "popup_button/default");
640 btn2 = mf_widget_button_create(popup, second_btn_text);
641 elm_object_style_set(btn2, "popup_button/default");
642 if (g_strcmp0(GET_SYS_STR(LABEL_DELETE), first_btn_text) == 0) {
643 elm_object_style_set(btn1, "sweep/delete");
644 elm_object_style_set(btn2, "sweep/multiline");
646 evas_object_smart_callback_add(btn1, "clicked", func, param);
647 evas_object_smart_callback_add(btn2, "clicked", func, param);
648 elm_object_part_content_set(popup, "button1", btn1);
649 elm_object_part_content_set(popup, "button2", btn2);
652 case POPMODE_TEXT_BTN:
653 case POPMODE_TITLE_TEXT_BTN:
654 btn1 = mf_widget_button_create(popup, GET_SYS_STR(MF_BUTTON_LABEL_OK));
655 elm_object_style_set(btn1, "popup_button/default");
656 evas_object_smart_callback_add(btn1, "clicked", func, param);
657 elm_object_part_content_set(popup, "button1", btn1);
659 case POPMODE_TITLE_TEXT_THREE_BTN:
661 elm_object_style_set(popup, "verticalbuttonstyle");
662 evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
664 btn1 = mf_widget_button_create(popup, GET_SYS_STR(MF_LABEL_REPLACE));
665 elm_object_style_set(btn1, "popup_button/default");
666 btn2 = mf_widget_button_create(popup, GET_STR(MF_BUTTON_LABEL_RENAME_AUTOMATICALLY));
667 elm_object_style_set(btn2, "popup_button/default");
668 btn3 = mf_widget_button_create(popup, GET_SYS_STR(LABEL_CANCEL));
669 elm_object_style_set(btn3, "popup_button/default");
671 evas_object_smart_callback_add(btn1, "clicked", mf_callback_operation_request_replace_cb, param);
672 evas_object_smart_callback_add(btn2, "clicked", mf_callback_operation_request_rename_cb, param);
673 evas_object_smart_callback_add(btn3, "clicked", mf_callback_operation_request_cancel_cb, param);
674 elm_object_part_content_set(popup, "button1", btn1);
675 elm_object_part_content_set(popup, "button2", btn2);
676 elm_object_part_content_set(popup, "button3", btn3);
679 case POPMODE_TITLE_LIST_BTN:
681 elm_object_style_set(popup, MF_POPUP_STYLE_MIN_MENUSTYLE);
683 btn1 = mf_widget_button_create(popup, GET_SYS_STR(LABEL_CANCEL));
684 elm_object_style_set(btn1, "popup_button/default");
685 evas_object_smart_callback_add(btn1, "clicked", func, param);
686 elm_object_part_content_set(popup, "button1", btn1);
688 //btn2 = mf_widget_button_create(popup, GET_STR(MF_LABEL_DESCENDING));
689 //elm_object_style_set(btn2, "popup_button/default");
690 //evas_object_smart_callback_add(btn2, "clicked", func, param);
691 //elm_object_part_content_set(popup, "button2", btn2);
693 if (ap->mf_Status.pRadioGroup) {
694 evas_object_del(ap->mf_Status.pRadioGroup);
695 ap->mf_Status.pRadioGroup = NULL;
698 radio_group = elm_radio_add(ap->mf_MainWindow.pWindow);
699 elm_object_focus_set(radio_group, EINA_FALSE);
700 elm_radio_value_set(radio_group, 0);
701 evas_object_hide(radio_group);
702 ap->mf_Status.pRadioGroup = radio_group;
704 listby_selected = __mf_popup_get_list_by_selected_item();
705 ap->mf_Status.iRadioValue = listby_selected;
707 listby_itc.item_style = "1text.1icon.2";
708 listby_itc.func.text_get = __mf_popup_get_genlist_label;
709 listby_itc.func.content_get = __mf_popup_get_genlist_icon;
710 listby_itc.func.state_get = NULL;
711 listby_itc.func.del = __mf_popup_listby_genlist_del;
712 genlist = elm_genlist_add(popup);
713 //elm_genlist_homogeneous_set(genlist, EINA_TRUE);
714 elm_object_focus_set(genlist, EINA_FALSE);
715 evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
716 evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
717 for (index = 0; index < ITEM_COUNT; index++) {
718 Elm_Object_Item *it = NULL;
719 ListByData_s *item_data = malloc(sizeof(ListByData_s));
720 if (item_data == NULL)
723 item_data->index = index;
724 item_data->unregister_lang_mgr = TRUE;
726 it = elm_genlist_item_append(genlist, &listby_itc, (void *)item_data, NULL,
727 ELM_GENLIST_ITEM_NONE, __mf_popup_genlist_select, popup);
729 item_data->item = it;
730 mf_language_mgr_register_genlist_item(it);
733 box = __mf_popup_box_set(popup, genlist, ITEM_COUNT);
734 elm_object_content_set(popup, box);
735 evas_object_smart_callback_add(popup, "response", func, param);
737 case POPMODE_VIEW_AS_LIST:
738 elm_object_style_set(popup, MF_POPUP_STYLE_MIN_MENUSTYLE);
740 btn1 = mf_widget_button_create(popup, GET_SYS_STR(LABEL_CANCEL));
741 elm_object_style_set(btn1, "popup_button/default");
742 evas_object_smart_callback_add(btn1, "clicked", func, param);
743 elm_object_part_content_set(popup, "button1", btn1);
745 if (ap->mf_Status.pRadioGroup) {
746 evas_object_del(ap->mf_Status.pRadioGroup);
747 ap->mf_Status.pRadioGroup = NULL;
750 radio_group = elm_radio_add(ap->mf_MainWindow.pWindow);
751 elm_object_focus_set(radio_group, EINA_FALSE);
752 elm_radio_value_set(radio_group, 0);
753 evas_object_hide(radio_group);
754 ap->mf_Status.pRadioGroup = radio_group;
756 listby_selected = __mf_popup_get_view_as_selected_item();
757 ap->mf_Status.iRadioValue = listby_selected;
759 listby_itc.item_style = "1text.1icon.2";
760 listby_itc.func.text_get = __mf_popup_view_as_genlist_label_get;
761 listby_itc.func.content_get = __mf_popup_get_genlist_icon;
762 listby_itc.func.state_get = NULL;
763 listby_itc.func.del = __mf_popup_listby_genlist_del;
764 genlist = elm_genlist_add(popup);
765 //elm_genlist_homogeneous_set(genlist, EINA_TRUE);
766 elm_object_focus_set(genlist, EINA_FALSE);
767 evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
768 evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
769 for (index = 0; index < 3; index++) {
770 Elm_Object_Item *it = NULL;
771 ListByData_s *item_data = malloc(sizeof(ListByData_s));
772 if (item_data == NULL)
775 item_data->index = index;
776 item_data->unregister_lang_mgr = TRUE;
778 it = elm_genlist_item_append(genlist, &listby_itc, (void *)item_data, NULL,
779 ELM_GENLIST_ITEM_NONE, __mf_popup_view_as_genlist_select, popup);
780 item_data->item = it;
781 mf_language_mgr_register_genlist_item(it);
784 box = __mf_popup_box_set(popup, genlist, 3);
785 elm_object_content_set(popup, box);
786 evas_object_smart_callback_add(popup, "response", func, param);
790 evas_object_show(popup);
794 void mf_popup_indicator_popup(void *data, const char *text)
796 mf_retm_if(text == NULL, "text is NULL");
797 int ret = status_message_post(text);
798 mf_debug("status_message_post()... [0x%x]!", ret);
800 mf_debug("status_message_post()... [0x%x]!", ret);