redo wizard to use elm

This commit is contained in:
Mike Blumenkrantz 2016-03-11 17:14:17 -05:00
parent 14ad1892aa
commit 9c829d5f25
9 changed files with 382 additions and 279 deletions

View File

@ -16,6 +16,7 @@ static Evas_Object *pop = NULL;
static Eina_List *pops = NULL; static Eina_List *pops = NULL;
static Evas_Object *o_bg = NULL; static Evas_Object *o_bg = NULL;
static Evas_Object *o_content = NULL; static Evas_Object *o_content = NULL;
static Evas_Object *o_box = NULL;
static E_Wizard_Page *pages = NULL; static E_Wizard_Page *pages = NULL;
static E_Wizard_Page *curpage = NULL; static E_Wizard_Page *curpage = NULL;
static int next_ok = 1; static int next_ok = 1;
@ -138,19 +139,14 @@ e_wizard_next(void)
E_API void E_API void
e_wizard_page_show(Evas_Object *obj) e_wizard_page_show(Evas_Object *obj)
{ {
if (o_content) evas_object_del(o_content); evas_object_del(o_content);
o_content = obj; o_content = obj;
if (obj) if (!obj) return;
{ elm_box_pack_end(o_box, obj);
Evas_Coord minw = 0, minh = 0; evas_object_show(obj);
e_widget_size_min_get(obj, &minw, &minh); elm_object_focus_set(obj, 1);
evas_object_size_hint_min_set(obj, minw, minh); edje_object_signal_emit(o_bg, "e,action,page,new", "e");
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");
}
} }
E_API E_Wizard_Page * 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"); // edje_object_signal_emit(o_bg, "e,state,next,disable", "e");
e_wizard_labels_update(); 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); evas_object_show(o_bg);
return 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 (!strcmp(ev->key, "Tab"))
{ {
if (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT) if (ev->modifiers & ECORE_EVENT_MODIFIER_SHIFT)
e_widget_focus_jump(o_content, 0); elm_object_focus_next(o_content, ELM_FOCUS_PREVIOUS);
else 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"))) else if ((!strcmp(ev->key, "Return")) || (!strcmp(ev->key, "KP_Enter")))
{ {
if (next_can) if (next_can)
e_wizard_next(); 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; return ECORE_CALLBACK_RENEW;
} }

View File

@ -149,75 +149,94 @@ wizard_page_shutdown(E_Wizard_Page *pg EINA_UNUSED)
return 1; return 1;
} }
E_API int static Evas_Object *
wizard_page_show(E_Wizard_Page *pg) _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]; char buf[PATH_MAX];
Evas_Object *ic;
o = e_widget_list_add(pg->evas, 1, 0); if (!eina_streq(part, "elm.swallow.icon")) return NULL;
e_wizard_title_set(_("Language")); if (pair && (!pair->locale_icon)) return NULL;
of = e_widget_framelist_add(pg->evas, _("Select one"), 0); if (pair)
ob = e_widget_ilist_add(pg->evas,10 * e_scale, 10 * e_scale, &lang); e_prefix_data_snprintf(buf, sizeof(buf), "data/flags/%s", pair->locale_icon);
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);
else 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(ob);
evas_object_show(of); 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; // pg->data = o;
return 1; /* 1 == show ui, and wait for user, 0 == just continue */ return 1; /* 1 == show ui, and wait for user, 0 == just continue */
} }

View File

@ -135,53 +135,82 @@ wizard_page_shutdown(E_Wizard_Page *pg EINA_UNUSED)
return 1; 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; 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")); e_wizard_title_set(_("Keyboard"));
of = e_widget_framelist_add(pg->evas, _("Select one"), 0); of = elm_frame_add(e_comp->elm);
ob = e_widget_ilist_add(pg->evas, 10 * e_scale, 10 * e_scale, &layout); elm_object_text_set(of, _("Select one"));
e_widget_size_min_set(ob, 140 * e_scale, 140 * e_scale); 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); EINA_LIST_FOREACH(layouts, l, lay)
for (i = 0, l = layouts; l; l = l->next, i++)
{ {
Layout *lay; void *it;
const char *label;
it = elm_genlist_item_append(ob, &itc, lay, NULL, 0, _layout_select, lay);
lay = l->data; if (eina_streq(lay->name, "us"))
ic = e_icon_add(pg->evas); sel_it = it;
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;
}
} }
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(ob);
evas_object_show(of); 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 */ return 1; /* 1 == show ui, and wait for user, 0 == just continue */
} }

View File

@ -4,26 +4,6 @@
static const char *profile = NULL; static const char *profile = NULL;
static Evas_Object *textblock = 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 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) 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; 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 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, *ob;
Eina_List *l, *profiles; Eina_List *profiles;
int i, sel = -1; char *prof;
Evas_Object *ilist; 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")); 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); o = elm_box_add(of);
e_widget_size_min_set(ob, 140 * e_scale, 70 * e_scale); elm_object_content_set(of, o);
ilist = ob;
e_widget_on_change_hook_set(ob, _profile_change, NULL);
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(); profiles = e_config_profile_list();
for (i = 0, l = profiles; l; l = l->next) EINA_LIST_FREE(profiles, prof)
{ {
Efreet_Desktop *desk = NULL; char buf2[PATH_MAX];
char buf[PATH_MAX], buf2[PATH_MAX], *prof; void *it;
const char *label;
Evas_Object *ic;
prof = l->data; if (eina_streq(prof, e_config_profile_get()))
if (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); e_prefix_data_snprintf(buf2, sizeof(buf2), "data/config/%s", prof);
// if it's not a system profile - don't offer it // if it's not a system profile - don't offer it
@ -80,53 +143,33 @@ wizard_page_show(E_Wizard_Page *pg)
free(prof); free(prof);
continue; continue;
} }
if (!strcmp(prof, "standard")) sel = i; it = elm_genlist_item_append(ob, &itc, prof, NULL, 0, _profile_select, prof);
snprintf(buf, sizeof(buf), "%s/profile.desktop", buf2); if (eina_streq(prof, "standard")) sel_it = it;
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++;
} }
if (profiles) eina_list_free(profiles);
e_widget_ilist_go(ob); ob = elm_label_add(o);
e_widget_ilist_thaw(ob); evas_object_show(ob);
elm_box_pack_end(o, ob);
e_widget_framelist_object_append(of, ob); E_WEIGHT(ob, EVAS_HINT_EXPAND, 0);
E_FILL(ob);
ob = e_widget_textblock_add(pg->evas); elm_object_style_set(ob, "marker");
e_widget_size_min_set(ob, 140 * e_scale, 70 * e_scale); elm_object_text_set(ob, _("Select a profile"));
e_widget_textblock_markup_set(ob, _("Select a profile"));
textblock = ob; textblock = ob;
e_widget_framelist_object_append(of, ob); if (sel_it)
{
e_widget_list_object_append(o, of, 1, 1, 0.5); elm_genlist_item_selected_set(sel_it, 1);
elm_genlist_item_show(sel_it, ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
if (sel >= 0) e_widget_ilist_selected_set(ilist, sel); }
evas_object_show(ob); evas_object_show(ob);
evas_object_show(of); evas_object_show(of);
e_wizard_page_show(o); E_EXPAND(of);
E_FILL(of);
e_wizard_page_show(of);
// pg->data = o; // 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 */ return 1; /* 1 == show ui, and wait for user, 0 == just continue */
} }

View File

@ -16,31 +16,37 @@ wizard_page_shutdown(E_Wizard_Page *pg EINA_UNUSED)
} }
*/ */
E_API int 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, *ob, *rg;
E_Radio_Group *rg;
if (e_config->focus_policy == E_FOCUS_CLICK) focus_mode = 0; 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")); 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); rg = ob = elm_radio_add(o);
ob = e_widget_radio_add(pg->evas, _("Whenever a window is clicked"), 0, rg);
e_widget_framelist_object_append(of, ob);
evas_object_show(ob); evas_object_show(ob);
ob = e_widget_radio_add(pg->evas, _("Whenever the mouse enters a window"), 1, rg); E_ALIGN(ob, 0, 0.5);
e_widget_framelist_object_append(of, ob); 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); 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); e_wizard_page_show(of);
evas_object_show(of);
e_wizard_page_show(o);
// pg->data = o; // pg->data = o;
return 1; /* 1 == show ui, and wait for user, 0 == just continue */ return 1; /* 1 == show ui, and wait for user, 0 == just continue */
} }

View File

@ -2,34 +2,28 @@
#include "e_wizard.h" #include "e_wizard.h"
static void 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")); 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) #if defined(USE_MODULE_CONNMAN) || defined(USE_MODULE_WIRELESS)
of = e_widget_framelist_add(pg->evas, elm_object_text_set(of, _("Connman network service not found"));
_("Connman network service not found"), 0);
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 #else
of = e_widget_framelist_add(pg->evas, elm_object_text_set(of, _("Connman and Wireless modules disabled"));
_("Connman support disabled"), 0); elm_object_text_set(ob, _("Install one of these modules for network management support"));
ob = e_widget_label_add
(pg->evas, _("Install/Enable Connman for network management support"));
#endif #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(ob);
evas_object_show(of); evas_object_show(of);
e_wizard_page_show(o); e_wizard_page_show(of);
// pg->data = o; // pg->data = o;
e_wizard_button_next_enable_set(1); e_wizard_button_next_enable_set(1);

View File

@ -2,21 +2,37 @@
#include "e_wizard.h" #include "e_wizard.h"
#include <Evas_GL.h> #include <Evas_GL.h>
static int do_gl = 0; static Eina_Bool do_gl = 0;
static int do_vsync = 0; static Eina_Bool do_vsync = 0;
static int disable_effects = 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 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")); 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) if (e_comp->gl)
{ {
Evas_GL *gl; Evas_GL *gl;
@ -31,18 +47,13 @@ wizard_page_show(E_Wizard_Page *pg)
do_gl = do_vsync = 1; do_gl = do_vsync = 1;
evas_gl_free(gl); evas_gl_free(gl);
} }
ob = e_widget_check_add(pg->evas, _("Hardware Accelerated (OpenGL)"), &(do_gl)); check_add(o, _("Hardware Accelerated (OpenGL)"), &do_gl);
e_widget_framelist_object_append(of, ob); check_add(o, _("Tear-free Rendering (OpenGL only)"), &do_vsync);
ob = e_widget_check_add(pg->evas, _("Tear-free Rendering (OpenGL only)"), &(do_vsync));
e_widget_framelist_object_append(of, ob);
} }
ob = e_widget_check_add(pg->evas, _("Disable composite effects"), &(disable_effects)); check_add(o, _("Disable composite effects"), &disable_effects);
e_widget_framelist_object_append(of, ob);
e_widget_list_object_append(o, of, 0, 0, 0.5);
evas_object_show(of); 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 */ return 1; /* 1 == show ui, and wait for user, 0 == just continue */
} }

View File

@ -1,7 +1,7 @@
/* Ask about updates checking */ /* Ask about updates checking */
#include "e_wizard.h" #include "e_wizard.h"
static int do_up = 1; static Eina_Bool do_up = 1;
/* /*
E_API int 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) 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 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, *ob;
o = e_widget_list_add(pg->evas, 1, 0);
e_wizard_title_set(_("Updates")); 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); o = elm_box_add(of);
e_widget_size_min_set(ob, 260 * e_scale, 280 * e_scale); elm_object_content_set(of, o);
e_widget_textblock_markup_set
(ob, 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<br>" _("Enlightenment can check for new<br>"
"versions, updates, security and<br>" "versions, updates, security and<br>"
"bugfixes, as well as available add-ons.<br>" "bugfixes, as well as available add-ons.<br>"
@ -48,16 +52,16 @@ wizard_page_show(E_Wizard_Page *pg)
"with bugs." "with bugs."
) )
); );
e_widget_framelist_object_append(of, ob); ob = elm_check_add(o);
E_ALIGN(ob, 0, 0.5);
ob = e_widget_check_add(pg->evas, _("Enable update checking"), &(do_up)); evas_object_show(ob);
e_widget_framelist_object_append(of, ob); elm_object_text_set(ob, _("Enable update checking"));
elm_check_state_pointer_set(ob, &do_up);
e_widget_list_object_append(o, of, 0, 0, 0.5); elm_box_pack_end(o, ob);
evas_object_show(of); 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 */ return 1; /* 1 == show ui, and wait for user, 0 == just continue */
} }

View File

@ -1,7 +1,7 @@
/* Setup if user wants Tasks? */ /* Setup if user wants Tasks? */
#include "e_wizard.h" #include "e_wizard.h"
static int do_tasks = 1; static Eina_Bool do_tasks = 1;
/* /*
E_API int 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) 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 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, *ob;
o = e_widget_list_add(pg->evas, 1, 0);
e_wizard_title_set(_("Taskbar")); 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); o = elm_box_add(of);
e_widget_size_min_set(ob, 260 * e_scale, 200 * e_scale); elm_object_content_set(of, o);
e_widget_textblock_markup_set
(ob, 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<br>" _("A taskbar can be added to<br>"
"show open windows and applications." "show open windows and applications."
) )
); );
e_widget_framelist_object_append(of, ob);
ob = e_widget_check_add(pg->evas, _("Enable Taskbar"), &(do_tasks)); ob = elm_check_add(o);
e_widget_framelist_object_append(of, ob); E_ALIGN(ob, 0, 0.5);
evas_object_show(ob);
e_widget_list_object_append(o, of, 0, 0, 0.5); 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); 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 */ return 1; /* 1 == show ui, and wait for user, 0 == just continue */
} }
/* /*