From 9c829d5f25db0fdfc64d9c6e9989780dcce734c4 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 11 Mar 2016 17:14:17 -0500 Subject: [PATCH] redo wizard to use elm --- src/modules/wizard/e_wizard.c | 34 +++--- src/modules/wizard/page_010.c | 143 +++++++++++++---------- src/modules/wizard/page_011.c | 103 +++++++++++------ src/modules/wizard/page_020.c | 207 ++++++++++++++++++++-------------- src/modules/wizard/page_060.c | 36 +++--- src/modules/wizard/page_110.c | 28 ++--- src/modules/wizard/page_150.c | 43 ++++--- src/modules/wizard/page_170.c | 34 +++--- src/modules/wizard/page_180.c | 33 +++--- 9 files changed, 382 insertions(+), 279 deletions(-) diff --git a/src/modules/wizard/e_wizard.c b/src/modules/wizard/e_wizard.c index ddbc553b1..60a87e309 100644 --- a/src/modules/wizard/e_wizard.c +++ b/src/modules/wizard/e_wizard.c @@ -16,6 +16,7 @@ static Evas_Object *pop = NULL; static Eina_List *pops = NULL; static Evas_Object *o_bg = NULL; static Evas_Object *o_content = NULL; +static Evas_Object *o_box = NULL; static E_Wizard_Page *pages = NULL; static E_Wizard_Page *curpage = NULL; static int next_ok = 1; @@ -138,19 +139,14 @@ e_wizard_next(void) E_API void e_wizard_page_show(Evas_Object *obj) { - if (o_content) evas_object_del(o_content); + evas_object_del(o_content); o_content = obj; - if (obj) - { - Evas_Coord minw = 0, minh = 0; - - e_widget_size_min_get(obj, &minw, &minh); - evas_object_size_hint_min_set(obj, minw, minh); - edje_object_part_swallow(o_bg, "e.swallow.content", obj); - evas_object_show(obj); - e_widget_focus_set(obj, 1); - edje_object_signal_emit(o_bg, "e,action,page,new", "e"); - } + if (!obj) return; + elm_box_pack_end(o_box, obj); + evas_object_show(obj); + + elm_object_focus_set(obj, 1); + edje_object_signal_emit(o_bg, "e,action,page,new", "e"); } E_API E_Wizard_Page * @@ -264,6 +260,9 @@ _e_wizard_main_new(E_Zone *zone) // edje_object_signal_emit(o_bg, "e,state,next,disable", "e"); e_wizard_labels_update(); + o_box = elm_box_add(e_comp->elm); + edje_object_part_swallow(o_bg, "e.swallow.content", o_box); + evas_object_show(o_bg); return o_bg; } @@ -290,22 +289,15 @@ _e_wizard_cb_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) if (!strcmp(ev->key, "Tab")) { if (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT) - e_widget_focus_jump(o_content, 0); + elm_object_focus_next(o_content, ELM_FOCUS_PREVIOUS); else - e_widget_focus_jump(o_content, 1); + elm_object_focus_next(o_content, ELM_FOCUS_NEXT); } else if ((!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter"))) { if (next_can) e_wizard_next(); } - else if (!strcmp(ev->key, "space")) - { - Evas_Object *o; - - o = e_widget_focused_object_get(o_content); - if (o) e_widget_activate(o); - } return ECORE_CALLBACK_RENEW; } diff --git a/src/modules/wizard/page_010.c b/src/modules/wizard/page_010.c index c4f7c3ad3..d12dd198d 100644 --- a/src/modules/wizard/page_010.c +++ b/src/modules/wizard/page_010.c @@ -149,75 +149,94 @@ wizard_page_shutdown(E_Wizard_Page *pg EINA_UNUSED) return 1; } -E_API int -wizard_page_show(E_Wizard_Page *pg) +static Evas_Object * +_lang_content_get(E_Intl_Pair *pair, Evas_Object *obj, const char *part) { - Evas_Object *o, *of, *ob, *ic; - Eina_List *l; - int i, sel = -1; char buf[PATH_MAX]; + Evas_Object *ic; - o = e_widget_list_add(pg->evas, 1, 0); - e_wizard_title_set(_("Language")); - of = e_widget_framelist_add(pg->evas, _("Select one"), 0); - ob = e_widget_ilist_add(pg->evas,10 * e_scale, 10 * e_scale, &lang); - e_widget_size_min_set(ob, 140 * e_scale, 140 * e_scale); - - e_widget_ilist_freeze(ob); - - e_prefix_data_snprintf(buf, sizeof(buf), "data/flags/%s", "lang-system.png"); - ic = e_util_icon_add(buf, pg->evas); - e_widget_ilist_append(ob, ic, _("System Default"), - NULL, NULL, NULL); - for (i = 1, l = blang_list; l; l = l->next, i++) - { - E_Intl_Pair *pair; - - pair = l->data; - if (pair->locale_icon) - { - e_prefix_data_snprintf(buf, sizeof(buf), "data/flags/%s", pair->locale_icon); - ic = e_util_icon_add(buf, pg->evas); - } - else - ic = NULL; - if (ic) - evas_object_size_hint_aspect_set - (ic, EVAS_ASPECT_CONTROL_VERTICAL, 20, 10); - if (e_intl_language_get()) - { - if (!strcmp(pair->locale_key, e_intl_language_get())) - { - snprintf(buf, sizeof(buf), "System Default [%s]", pair->locale_translation); - e_widget_ilist_nth_label_set(ob, 0, _(buf)); - e_widget_ilist_nth_icon_set(ob, 0, ic); - sel = 0; - } - else - e_widget_ilist_append(ob, ic, _(pair->locale_translation), - NULL, NULL, pair->locale_key); - } - else - e_widget_ilist_append(ob, ic, _(pair->locale_translation), - NULL, NULL, pair->locale_key); - } - e_widget_ilist_go(ob); - e_widget_ilist_thaw(ob); - if (sel >= 0) - { - e_widget_ilist_selected_set(ob, sel); - e_widget_ilist_nth_show(ob, sel, 0); - } - else if (e_widget_ilist_count(ob) == 2) // default and one other - e_widget_ilist_selected_set(ob, 1); + if (!eina_streq(part, "elm.swallow.icon")) return NULL; + if (pair && (!pair->locale_icon)) return NULL; + if (pair) + e_prefix_data_snprintf(buf, sizeof(buf), "data/flags/%s", pair->locale_icon); else - e_widget_ilist_selected_set(ob, 0); + e_prefix_data_snprintf(buf, sizeof(buf), "data/flags/%s", "lang-system.png"); + + ic = elm_icon_add(obj); + elm_image_file_set(ic, buf, NULL); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 20, 10); + return ic; +} + +static char * +_lang_text_get(E_Intl_Pair *pair, Evas_Object *obj EINA_UNUSED, const char *part) +{ + char buf[4096]; + + if (!eina_streq(part, "elm.text")) return NULL; + if (!pair) + return strdup(_("System Default")); + + if ((!e_intl_language_get()) || (!eina_streq(pair->locale_key, e_intl_language_get()))) + return strdup(_(pair->locale_translation)); + + snprintf(buf, sizeof(buf), "System Default [%s]", pair->locale_translation); + return strdup(buf); +} + +static void +_lang_select(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + E_Intl_Pair *pair = data; + + lang = pair ? pair->locale_key : NULL; +} + +E_API int +wizard_page_show(E_Wizard_Page *pg EINA_UNUSED) +{ + Evas_Object *of, *ob; + Eina_List *l; + E_Intl_Pair *pair; + Eina_Bool found = EINA_FALSE; + static Elm_Genlist_Item_Class itc = + { + .item_style = "default", + .func = + { + .content_get = (Elm_Genlist_Item_Content_Get_Cb)_lang_content_get, + .text_get = (Elm_Genlist_Item_Text_Get_Cb)_lang_text_get, + }, + .version = ELM_GENLIST_ITEM_CLASS_VERSION + }; + + e_wizard_title_set(_("Language")); + of = elm_frame_add(e_comp->elm); + elm_object_text_set(of, _("Select one")); + ob = elm_genlist_add(of); + elm_genlist_homogeneous_set(ob, 1); + elm_genlist_mode_set(ob, ELM_LIST_COMPRESS); + elm_scroller_bounce_set(ob, 0, 0); + elm_object_content_set(of, ob); + EINA_LIST_FOREACH(blang_list, l, pair) + { + if (e_intl_language_get() && eina_streq(pair->locale_key, e_intl_language_get())) + found = 1; + elm_genlist_item_append(ob, &itc, pair, NULL, 0, _lang_select, pair); + } + if (!found) + elm_genlist_item_prepend(ob, &itc, NULL, NULL, 0, _lang_select, NULL); + if ((!found) && (elm_genlist_items_count(ob) == 2)) // default and one other + elm_genlist_item_selected_set(elm_genlist_last_item_get(ob), 1); + else + elm_genlist_item_selected_set(elm_genlist_first_item_get(ob), 1); - e_widget_framelist_object_append(of, ob); - e_widget_list_object_append(o, of, 1, 1, 0.5); evas_object_show(ob); evas_object_show(of); - e_wizard_page_show(o); + E_EXPAND(of); + E_FILL(of); + elm_genlist_item_show(elm_genlist_selected_item_get(ob), ELM_GENLIST_ITEM_SCROLLTO_MIDDLE); + e_wizard_page_show(of); // pg->data = o; return 1; /* 1 == show ui, and wait for user, 0 == just continue */ } diff --git a/src/modules/wizard/page_011.c b/src/modules/wizard/page_011.c index 0cb91cefa..d25a49850 100644 --- a/src/modules/wizard/page_011.c +++ b/src/modules/wizard/page_011.c @@ -135,53 +135,82 @@ wizard_page_shutdown(E_Wizard_Page *pg EINA_UNUSED) return 1; } */ -E_API int -wizard_page_show(E_Wizard_Page *pg) + + +static Evas_Object * +_layout_content_get(Layout *lay, Evas_Object *obj, const char *part) { - Evas_Object *o, *of, *ob, *ic; + char buf[PATH_MAX]; + Evas_Object *ic; + + if (!eina_streq(part, "elm.swallow.icon")) return NULL; + e_xkb_flag_file_get(buf, sizeof(buf), lay->name); + ic = elm_icon_add(obj); + elm_image_file_set(ic, buf, NULL); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 20, 10); + return ic; +} + +static char * +_layout_text_get(Layout *lay, Evas_Object *obj EINA_UNUSED, const char *part) +{ + if (!eina_streq(part, "elm.text")) return NULL; + return strdup(_(lay->label)); +} + +static void +_layout_select(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + Layout *lay = data; + layout = lay->name; +} + +E_API int +wizard_page_show(E_Wizard_Page *pg EINA_UNUSED) +{ + Evas_Object *of, *ob; Eina_List *l; - int i, sel = -1; + Layout *lay; + void *sel_it = NULL; + static Elm_Genlist_Item_Class itc = + { + .item_style = "default", + .func = + { + .content_get = (Elm_Genlist_Item_Content_Get_Cb)_layout_content_get, + .text_get = (Elm_Genlist_Item_Text_Get_Cb)_layout_text_get, + }, + .version = ELM_GENLIST_ITEM_CLASS_VERSION + }; - o = e_widget_list_add(pg->evas, 1, 0); e_wizard_title_set(_("Keyboard")); - of = e_widget_framelist_add(pg->evas, _("Select one"), 0); - ob = e_widget_ilist_add(pg->evas, 10 * e_scale, 10 * e_scale, &layout); - e_widget_size_min_set(ob, 140 * e_scale, 140 * e_scale); + of = elm_frame_add(e_comp->elm); + elm_object_text_set(of, _("Select one")); + ob = elm_genlist_add(of); + elm_genlist_homogeneous_set(ob, 1); + elm_genlist_mode_set(ob, ELM_LIST_COMPRESS); + elm_scroller_bounce_set(ob, 0, 0); + elm_object_content_set(of, ob); - e_widget_ilist_freeze(ob); - for (i = 0, l = layouts; l; l = l->next, i++) + EINA_LIST_FOREACH(layouts, l, lay) { - Layout *lay; - const char *label; - - lay = l->data; - ic = e_icon_add(pg->evas); - e_xkb_e_icon_flag_setup(ic, lay->name); - label = lay->label; - if (!label) label = "Unknown"; - if (ic) - evas_object_size_hint_aspect_set - (ic, EVAS_ASPECT_CONTROL_VERTICAL, 20, 10); - e_widget_ilist_append(ob, ic, _(label), NULL, NULL, lay->name); - if (lay->name) - { - if (!strcmp(lay->name, "us")) sel = i; - } + void *it; + + it = elm_genlist_item_append(ob, &itc, lay, NULL, 0, _layout_select, lay); + if (eina_streq(lay->name, "us")) + sel_it = it; } - e_widget_ilist_go(ob); - e_widget_ilist_thaw(ob); - if (sel >= 0) - { - e_widget_ilist_selected_set(ob, sel); - e_widget_ilist_nth_show(ob, sel, 0); - } - - e_widget_framelist_object_append(of, ob); - e_widget_list_object_append(o, of, 1, 1, 0.5); evas_object_show(ob); evas_object_show(of); - e_wizard_page_show(o); + E_EXPAND(of); + E_FILL(of); + if (sel_it) + { + elm_genlist_item_selected_set(sel_it, 1); + elm_genlist_item_show(sel_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE); + } + e_wizard_page_show(of); return 1; /* 1 == show ui, and wait for user, 0 == just continue */ } diff --git a/src/modules/wizard/page_020.c b/src/modules/wizard/page_020.c index c69a44670..da216e93e 100644 --- a/src/modules/wizard/page_020.c +++ b/src/modules/wizard/page_020.c @@ -4,26 +4,6 @@ static const char *profile = NULL; static Evas_Object *textblock = NULL; -static void -_profile_change(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED) -{ - char buf[PATH_MAX], buf2[PATH_MAX]; - Efreet_Desktop *desk = NULL; - - e_prefix_data_snprintf(buf2, sizeof(buf2), "data/config/%s", profile); - snprintf(buf, sizeof(buf), "%s/profile.desktop", buf2); - desk = efreet_desktop_new(buf); - if (desk) - { - e_widget_textblock_markup_set(textblock, desk->comment); - efreet_desktop_free(desk); - } - else - e_widget_textblock_markup_set(textblock, _("Unknown")); - - // enable next once you choose a profile - e_wizard_button_next_enable_set(1); -} /* E_API int wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops EINA_UNUSED, Eina_Bool *need_xdg_icons EINA_UNUSED) @@ -37,41 +17,124 @@ wizard_page_shutdown(E_Wizard_Page *pg EINA_UNUSED) return 1; } */ + + +static Evas_Object * +_profile_content_get(char *prof, Evas_Object *obj, const char *part) +{ + char buf[PATH_MAX], buf2[PATH_MAX]; + Evas_Object *ic; + Efreet_Desktop *desktop; + + if (!eina_streq(part, "elm.swallow.icon")) return NULL; + e_prefix_data_snprintf(buf2, sizeof(buf2), "data/config/%s", prof); + snprintf(buf, sizeof(buf), "%s/profile.desktop", buf2); + desktop = efreet_desktop_new(buf); + snprintf(buf, sizeof(buf), "%s/icon.edj", buf2); + if (!ecore_file_exists(buf)) + { + if (desktop && desktop->icon) + { + if (eina_str_has_extension(desktop->icon, "png")) + snprintf(buf, sizeof(buf), "%s/%s", buf2, desktop->icon); + else + snprintf(buf, sizeof(buf), "%s/%s.png", buf2, desktop->icon); + } + else + e_prefix_data_concat_static(buf, "data/images/enlightenment.png"); + } + efreet_desktop_free(desktop); + + ic = elm_icon_add(obj); + elm_image_file_set(ic, buf, NULL); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 20, 10); + return ic; +} + +static char * +_profile_text_get(char *prof, Evas_Object *obj EINA_UNUSED, const char *part) +{ + char *label; + char buf[PATH_MAX], buf2[PATH_MAX]; + Efreet_Desktop *desktop; + + if (!eina_streq(part, "elm.text")) return NULL; + e_prefix_data_snprintf(buf2, sizeof(buf2), "data/config/%s", prof); + snprintf(buf, sizeof(buf), "%s/profile.desktop", buf2); + label = prof; + desktop = efreet_desktop_new(buf); + if (desktop && desktop->name) label = desktop->name; + label = strdup(label); + efreet_desktop_free(desktop); + return label; +} + +static void +_profile_select(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + char buf[PATH_MAX], buf2[PATH_MAX]; + Efreet_Desktop *desk = NULL; + profile = data; + + e_prefix_data_snprintf(buf2, sizeof(buf2), "data/config/%s", profile); + snprintf(buf, sizeof(buf), "%s/profile.desktop", buf2); + desk = efreet_desktop_new(buf); + if (desk) + { + elm_object_text_set(textblock, desk->comment); + efreet_desktop_free(desk); + } + else + elm_object_text_set(textblock, _("Unknown")); + + // enable next once you choose a profile + e_wizard_button_next_enable_set(1); +} + E_API int -wizard_page_show(E_Wizard_Page *pg) +wizard_page_show(E_Wizard_Page *pg EINA_UNUSED) { Evas_Object *o, *of, *ob; - Eina_List *l, *profiles; - int i, sel = -1; - Evas_Object *ilist; + Eina_List *profiles; + char *prof; + void *sel_it = NULL; + static Elm_Genlist_Item_Class itc = + { + .item_style = "default", + .func = + { + .content_get = (Elm_Genlist_Item_Content_Get_Cb)_profile_content_get, + .text_get = (Elm_Genlist_Item_Text_Get_Cb)_profile_text_get, + }, + .version = ELM_GENLIST_ITEM_CLASS_VERSION + }; - o = e_widget_list_add(pg->evas, 1, 0); e_wizard_title_set(_("Profile")); - of = e_widget_framelist_add(pg->evas, _("Select one"), 0); + of = elm_frame_add(e_comp->elm); + elm_object_text_set(of, _("Select one")); - ob = e_widget_ilist_add(pg->evas, 32 * e_scale, 32 * e_scale, &profile); - e_widget_size_min_set(ob, 140 * e_scale, 70 * e_scale); - ilist = ob; - e_widget_on_change_hook_set(ob, _profile_change, NULL); + o = elm_box_add(of); + elm_object_content_set(of, o); - e_widget_ilist_freeze(ob); + ob = elm_genlist_add(o); + evas_object_show(ob); + elm_box_pack_end(o, ob); + E_EXPAND(ob); + E_FILL(ob); + elm_genlist_homogeneous_set(ob, 1); + elm_genlist_mode_set(ob, ELM_LIST_COMPRESS); + elm_scroller_bounce_set(ob, 0, 0); profiles = e_config_profile_list(); - for (i = 0, l = profiles; l; l = l->next) + EINA_LIST_FREE(profiles, prof) { - Efreet_Desktop *desk = NULL; - char buf[PATH_MAX], buf2[PATH_MAX], *prof; - const char *label; - Evas_Object *ic; + char buf2[PATH_MAX]; + void *it; - prof = l->data; - if (e_config_profile_get()) + if (eina_streq(prof, e_config_profile_get())) { - if (!strcmp(prof, e_config_profile_get())) - { - free(prof); - continue; - } + free(prof); + continue; } e_prefix_data_snprintf(buf2, sizeof(buf2), "data/config/%s", prof); // if it's not a system profile - don't offer it @@ -80,53 +143,33 @@ wizard_page_show(E_Wizard_Page *pg) free(prof); continue; } - if (!strcmp(prof, "standard")) sel = i; - snprintf(buf, sizeof(buf), "%s/profile.desktop", buf2); - desk = efreet_desktop_new(buf); - label = prof; - if ((desk) && (desk->name)) label = desk->name; - snprintf(buf, sizeof(buf), "%s/icon.edj", buf2); - if ((desk) && (desk->icon)) - { - if (eina_str_has_extension(desk->icon, "png")) - snprintf(buf, sizeof(buf), "%s/%s", buf2, desk->icon); - else - snprintf(buf, sizeof(buf), "%s/%s.png", buf2, desk->icon); - } - else - e_prefix_data_concat_static(buf, "data/images/enlightenment.png"); - ic = e_util_icon_add(buf, pg->evas); - e_widget_ilist_append(ob, ic, label, NULL, NULL, prof); - free(prof); - if (desk) efreet_desktop_free(desk); - - /* We incremet here, because we don't want to increment it unless we - * actually found an item. */ - i++; + it = elm_genlist_item_append(ob, &itc, prof, NULL, 0, _profile_select, prof); + if (eina_streq(prof, "standard")) sel_it = it; } - if (profiles) eina_list_free(profiles); - e_widget_ilist_go(ob); - e_widget_ilist_thaw(ob); - - e_widget_framelist_object_append(of, ob); - - ob = e_widget_textblock_add(pg->evas); - e_widget_size_min_set(ob, 140 * e_scale, 70 * e_scale); - e_widget_textblock_markup_set(ob, _("Select a profile")); + ob = elm_label_add(o); + evas_object_show(ob); + elm_box_pack_end(o, ob); + E_WEIGHT(ob, EVAS_HINT_EXPAND, 0); + E_FILL(ob); + elm_object_style_set(ob, "marker"); + elm_object_text_set(ob, _("Select a profile")); textblock = ob; - e_widget_framelist_object_append(of, ob); - - e_widget_list_object_append(o, of, 1, 1, 0.5); - - if (sel >= 0) e_widget_ilist_selected_set(ilist, sel); + if (sel_it) + { + elm_genlist_item_selected_set(sel_it, 1); + elm_genlist_item_show(sel_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE); + } evas_object_show(ob); evas_object_show(of); - e_wizard_page_show(o); + E_EXPAND(of); + E_FILL(of); + e_wizard_page_show(of); // pg->data = o; - e_wizard_button_next_enable_set(0); + if (!sel_it) + e_wizard_button_next_enable_set(0); return 1; /* 1 == show ui, and wait for user, 0 == just continue */ } diff --git a/src/modules/wizard/page_060.c b/src/modules/wizard/page_060.c index 7a6685815..84d14028d 100644 --- a/src/modules/wizard/page_060.c +++ b/src/modules/wizard/page_060.c @@ -16,31 +16,37 @@ wizard_page_shutdown(E_Wizard_Page *pg EINA_UNUSED) } */ E_API int -wizard_page_show(E_Wizard_Page *pg) +wizard_page_show(E_Wizard_Page *pg EINA_UNUSED) { - Evas_Object *o, *of, *ob; - E_Radio_Group *rg; + Evas_Object *o, *of, *ob, *rg; if (e_config->focus_policy == E_FOCUS_CLICK) focus_mode = 0; - o = e_widget_list_add(pg->evas, 1, 0); e_wizard_title_set(_("Window Focus")); - of = e_widget_framelist_add(pg->evas, _("Focus:"), 0); + of = elm_frame_add(e_comp->elm); + elm_object_text_set(of, _("Focus:")); + o = elm_box_add(of); + elm_box_homogeneous_set(o, 1); + elm_object_content_set(of, o); - rg = e_widget_radio_group_new(&focus_mode); - - ob = e_widget_radio_add(pg->evas, _("Whenever a window is clicked"), 0, rg); - e_widget_framelist_object_append(of, ob); + rg = ob = elm_radio_add(o); evas_object_show(ob); - ob = e_widget_radio_add(pg->evas, _("Whenever the mouse enters a window"), 1, rg); - e_widget_framelist_object_append(of, ob); + E_ALIGN(ob, 0, 0.5); + elm_box_pack_end(o, ob); + elm_object_text_set(ob, _("Whenever a window is clicked")); + elm_radio_state_value_set(ob, 0); + elm_radio_value_pointer_set(ob, &focus_mode); + + ob = elm_radio_add(o); + E_ALIGN(ob, 0, 0.5); evas_object_show(ob); + elm_box_pack_end(o, ob); + elm_radio_group_add(ob, rg); + elm_object_text_set(ob, _("Whenever the mouse enters a window")); + elm_radio_state_value_set(ob, 1); - e_widget_list_object_append(o, of, 0, 0, 0.5); - evas_object_show(of); - - e_wizard_page_show(o); + e_wizard_page_show(of); // pg->data = o; return 1; /* 1 == show ui, and wait for user, 0 == just continue */ } diff --git a/src/modules/wizard/page_110.c b/src/modules/wizard/page_110.c index 14bdfc447..cbca7ee7d 100644 --- a/src/modules/wizard/page_110.c +++ b/src/modules/wizard/page_110.c @@ -2,34 +2,28 @@ #include "e_wizard.h" static void -_recommend_connman(E_Wizard_Page *pg) +_recommend_connman(E_Wizard_Page *pg EINA_UNUSED) { - Evas_Object *o, *of, *ob; + Evas_Object *of, *ob; - o = e_widget_list_add(pg->evas, 1, 0); e_wizard_title_set(_("Network Management")); + of = elm_frame_add(e_comp->elm); + ob = elm_label_add(of); + elm_object_content_set(of, ob); #if defined(USE_MODULE_CONNMAN) || defined(USE_MODULE_WIRELESS) - of = e_widget_framelist_add(pg->evas, - _("Connman network service not found"), 0); + elm_object_text_set(of, _("Connman network service not found")); - ob = e_widget_label_add - (pg->evas, _("Install Connman for network management support")); + + elm_object_text_set(ob, _("Install/Enable Connman service for network management support")); #else - of = e_widget_framelist_add(pg->evas, - _("Connman support disabled"), 0); - - ob = e_widget_label_add - (pg->evas, _("Install/Enable Connman for network management support")); + elm_object_text_set(of, _("Connman and Wireless modules disabled")); + elm_object_text_set(ob, _("Install one of these modules for network management support")); #endif - e_widget_framelist_object_append(of, ob); - evas_object_show(ob); - - e_widget_list_object_append(o, of, 0, 0, 0.5); evas_object_show(ob); evas_object_show(of); - e_wizard_page_show(o); + e_wizard_page_show(of); // pg->data = o; e_wizard_button_next_enable_set(1); diff --git a/src/modules/wizard/page_150.c b/src/modules/wizard/page_150.c index cf4ba087a..45f783102 100644 --- a/src/modules/wizard/page_150.c +++ b/src/modules/wizard/page_150.c @@ -2,21 +2,37 @@ #include "e_wizard.h" #include -static int do_gl = 0; -static int do_vsync = 0; -static int disable_effects = 0; +static Eina_Bool do_gl = 0; +static Eina_Bool do_vsync = 0; +static Eina_Bool disable_effects = 0; +static void +check_add(Evas_Object *box, const char *txt, Eina_Bool *val) +{ + Evas_Object *ck; + + ck = elm_check_add(box); + evas_object_show(ck); + E_ALIGN(ck, 0, 0.5); + elm_object_text_set(ck, txt); + elm_check_state_pointer_set(ck, val); + elm_box_pack_end(box, ck); +} + E_API int -wizard_page_show(E_Wizard_Page *pg) +wizard_page_show(E_Wizard_Page *pg EINA_UNUSED) { - Evas_Object *o, *of, *ob; + Evas_Object *o, *of; - o = e_widget_list_add(pg->evas, 1, 0); e_wizard_title_set(_("Compositing")); + of = elm_frame_add(e_comp->elm); + elm_object_text_set(of, _("Settings")); - of = e_widget_framelist_add(pg->evas, _("Settings"), 0); + o = elm_box_add(of); + elm_box_homogeneous_set(o, 1); + elm_object_content_set(of, o); if (e_comp->gl) { Evas_GL *gl; @@ -31,18 +47,13 @@ wizard_page_show(E_Wizard_Page *pg) do_gl = do_vsync = 1; evas_gl_free(gl); } - ob = e_widget_check_add(pg->evas, _("Hardware Accelerated (OpenGL)"), &(do_gl)); - e_widget_framelist_object_append(of, ob); - - ob = e_widget_check_add(pg->evas, _("Tear-free Rendering (OpenGL only)"), &(do_vsync)); - e_widget_framelist_object_append(of, ob); + check_add(o, _("Hardware Accelerated (OpenGL)"), &do_gl); + check_add(o, _("Tear-free Rendering (OpenGL only)"), &do_vsync); } - ob = e_widget_check_add(pg->evas, _("Disable composite effects"), &(disable_effects)); - e_widget_framelist_object_append(of, ob); + check_add(o, _("Disable composite effects"), &disable_effects); - e_widget_list_object_append(o, of, 0, 0, 0.5); evas_object_show(of); - e_wizard_page_show(o); + e_wizard_page_show(of); return 1; /* 1 == show ui, and wait for user, 0 == just continue */ } diff --git a/src/modules/wizard/page_170.c b/src/modules/wizard/page_170.c index 1e68bae97..e0663fe97 100644 --- a/src/modules/wizard/page_170.c +++ b/src/modules/wizard/page_170.c @@ -1,7 +1,7 @@ /* Ask about updates checking */ #include "e_wizard.h" -static int do_up = 1; +static Eina_Bool do_up = 1; /* E_API int wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops EINA_UNUSED, Eina_Bool *need_xdg_icons EINA_UNUSED) @@ -16,19 +16,23 @@ wizard_page_shutdown(E_Wizard_Page *pg EINA_UNUSED) } */ E_API int -wizard_page_show(E_Wizard_Page *pg) +wizard_page_show(E_Wizard_Page *pg EINA_UNUSED) { Evas_Object *o, *of, *ob; - o = e_widget_list_add(pg->evas, 1, 0); e_wizard_title_set(_("Updates")); - of = e_widget_framelist_add(pg->evas, _("Check for available updates"), 0); + of = elm_frame_add(e_comp->elm); + elm_object_text_set(of, _("Check for available updates")); - ob = e_widget_textblock_add(pg->evas); - e_widget_size_min_set(ob, 260 * e_scale, 280 * e_scale); - e_widget_textblock_markup_set - (ob, + o = elm_box_add(of); + elm_object_content_set(of, o); + + ob = elm_label_add(of); + E_ALIGN(ob, 0, 0.5); + evas_object_show(ob); + elm_box_pack_end(o, ob); + elm_object_text_set(ob, _("Enlightenment can check for new
" "versions, updates, security and
" "bugfixes, as well as available add-ons.
" @@ -48,16 +52,16 @@ wizard_page_show(E_Wizard_Page *pg) "with bugs." ) ); - e_widget_framelist_object_append(of, ob); - - ob = e_widget_check_add(pg->evas, _("Enable update checking"), &(do_up)); - e_widget_framelist_object_append(of, ob); - - e_widget_list_object_append(o, of, 0, 0, 0.5); + ob = elm_check_add(o); + E_ALIGN(ob, 0, 0.5); + evas_object_show(ob); + elm_object_text_set(ob, _("Enable update checking")); + elm_check_state_pointer_set(ob, &do_up); + elm_box_pack_end(o, ob); evas_object_show(of); - e_wizard_page_show(o); + e_wizard_page_show(of); return 1; /* 1 == show ui, and wait for user, 0 == just continue */ } diff --git a/src/modules/wizard/page_180.c b/src/modules/wizard/page_180.c index 4e27d4440..92158b6bc 100644 --- a/src/modules/wizard/page_180.c +++ b/src/modules/wizard/page_180.c @@ -1,7 +1,7 @@ /* Setup if user wants Tasks? */ #include "e_wizard.h" -static int do_tasks = 1; +static Eina_Bool do_tasks = 1; /* E_API int wizard_page_init(E_Wizard_Page *pg EINA_UNUSED, Eina_Bool *need_xdg_desktops EINA_UNUSED, Eina_Bool *need_xdg_icons EINA_UNUSED) @@ -16,33 +16,38 @@ wizard_page_shutdown(E_Wizard_Page *pg EINA_UNUSED) } */ E_API int -wizard_page_show(E_Wizard_Page *pg) +wizard_page_show(E_Wizard_Page *pg EINA_UNUSED) { Evas_Object *o, *of, *ob; - o = e_widget_list_add(pg->evas, 1, 0); e_wizard_title_set(_("Taskbar")); - of = e_widget_framelist_add(pg->evas, _("Information"), 0); + of = elm_frame_add(e_comp->elm); + elm_object_text_set(of, _("Information")); - ob = e_widget_textblock_add(pg->evas); - e_widget_size_min_set(ob, 260 * e_scale, 200 * e_scale); - e_widget_textblock_markup_set - (ob, + o = elm_box_add(of); + elm_object_content_set(of, o); + + ob = elm_label_add(o); + E_ALIGN(ob, 0, 0.5); + evas_object_show(ob); + elm_box_pack_end(o, ob); + elm_object_text_set(ob, _("A taskbar can be added to
" "show open windows and applications." ) ); - e_widget_framelist_object_append(of, ob); - ob = e_widget_check_add(pg->evas, _("Enable Taskbar"), &(do_tasks)); - e_widget_framelist_object_append(of, ob); - - e_widget_list_object_append(o, of, 0, 0, 0.5); + ob = elm_check_add(o); + E_ALIGN(ob, 0, 0.5); + evas_object_show(ob); + elm_box_pack_end(o, ob); + elm_object_text_set(ob, _("Enable Taskbar")); + elm_check_state_pointer_set(ob, &do_tasks); evas_object_show(of); - e_wizard_page_show(o); + e_wizard_page_show(of); return 1; /* 1 == show ui, and wait for user, 0 == just continue */ } /*