|
@ -15,6 +15,8 @@ EXTRA_DIST = \
|
|||
|
||||
filesdir = $(datadir)/enlightenment/data/config/default
|
||||
files_DATA = \
|
||||
profile.desktop \
|
||||
icon.png \
|
||||
e.cfg \
|
||||
module.battery.cfg \
|
||||
module.cpufreq.cfg \
|
||||
|
|
After Width: | Height: | Size: 15 KiB |
|
@ -0,0 +1,5 @@
|
|||
[Desktop Entry]
|
||||
Type=Link
|
||||
Name=Default
|
||||
Icon=icon.png
|
||||
Comment=This is the default<br>theme that is<br>universal for most<br>desktop and laptop<br>systems. Choose this<br>if you are not<br>sure what to choose.
|
|
@ -4,6 +4,30 @@ files_DATA = \
|
|||
enlightenment.png \
|
||||
test.png \
|
||||
test.jpg \
|
||||
test.edj
|
||||
test.edj \
|
||||
lang-bg_BG.png \
|
||||
lang-ca_ES.png \
|
||||
lang-cs_CZ.png \
|
||||
lang-da_DK.png \
|
||||
lang-de_DE.png \
|
||||
lang-en_US.png \
|
||||
lang-es_AR.png \
|
||||
lang-es_ES.png \
|
||||
lang-fi_FI.png \
|
||||
lang-fr_FR.png \
|
||||
lang-hu_HU.png \
|
||||
lang-it_IT.png \
|
||||
lang-ja_JP.png \
|
||||
lang-ko_KR.png \
|
||||
lang-nb_NO.png \
|
||||
lang-nl_NL.png \
|
||||
lang-pl_PL.png \
|
||||
lang-pt_BR.png \
|
||||
lang-ru_RU.png \
|
||||
lang-sk_SK.png \
|
||||
lang-sl_SI.png \
|
||||
lang-sv_SE.png \
|
||||
lang-zh_CN.png \
|
||||
lang-zh_TW.png
|
||||
|
||||
EXTRA_DIST = $(files_DATA)
|
||||
|
|
After Width: | Height: | Size: 346 B |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 438 B |
After Width: | Height: | Size: 294 B |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 478 B |
After Width: | Height: | Size: 349 B |
After Width: | Height: | Size: 339 B |
After Width: | Height: | Size: 337 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 592 B |
After Width: | Height: | Size: 341 B |
After Width: | Height: | Size: 315 B |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 338 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 494 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.4 KiB |
|
@ -1804,12 +1804,29 @@ e_config_profile_set(const char *prof)
|
|||
e_util_env_set("E_CONF_PROFILE", _e_config_profile);
|
||||
}
|
||||
|
||||
EAPI char *
|
||||
e_config_profile_dir_get(const char *prof)
|
||||
{
|
||||
char buf[PATH_MAX];
|
||||
const char *homedir;
|
||||
const char *dir;
|
||||
|
||||
homedir = e_user_homedir_get();
|
||||
snprintf(buf, sizeof(buf), "%s/.e/e/config/%s", homedir, prof);
|
||||
if (ecore_file_is_dir(buf)) return strdup(buf);
|
||||
dir = e_prefix_data_get();
|
||||
snprintf(buf, sizeof(buf), "%s/data/config/%s", dir, prof);
|
||||
if (ecore_file_is_dir(buf)) return strdup(buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI Eina_List *
|
||||
e_config_profile_list(void)
|
||||
{
|
||||
Ecore_List *files;
|
||||
char buf[4096];
|
||||
char buf[PATH_MAX];
|
||||
const char *homedir;
|
||||
const char *dir;
|
||||
Eina_List *flist = NULL;
|
||||
|
||||
homedir = e_user_homedir_get();
|
||||
|
@ -1829,6 +1846,31 @@ e_config_profile_list(void)
|
|||
}
|
||||
ecore_list_destroy(files);
|
||||
}
|
||||
dir = e_prefix_data_get();
|
||||
snprintf(buf, sizeof(buf), "%s/data/config", dir);
|
||||
files = ecore_file_ls(buf);
|
||||
if (files)
|
||||
{
|
||||
char *file;
|
||||
|
||||
ecore_list_first_goto(files);
|
||||
while ((file = ecore_list_current(files)))
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/data/config/%s", dir, file);
|
||||
if (ecore_file_is_dir(buf))
|
||||
{
|
||||
Eina_List *l;
|
||||
|
||||
for (l = flist; l; l = l->next)
|
||||
{
|
||||
if (!strcmp(file, l->data)) break;
|
||||
}
|
||||
if (!l) flist = eina_list_append(flist, strdup(file));
|
||||
}
|
||||
ecore_list_next(files);
|
||||
}
|
||||
ecore_list_destroy(files);
|
||||
}
|
||||
return flist;
|
||||
}
|
||||
|
||||
|
|
|
@ -457,6 +457,7 @@ EAPI void e_config_save_flush(void);
|
|||
EAPI void e_config_save_queue(void);
|
||||
|
||||
EAPI const char*e_config_profile_get(void);
|
||||
EAPI char *e_config_profile_dir_get(const char *prof);
|
||||
EAPI void e_config_profile_set(const char *prof);
|
||||
EAPI Eina_List *e_config_profile_list(void);
|
||||
EAPI void e_config_profile_add(const char *prof);
|
||||
|
|
|
@ -11,34 +11,35 @@ static int _basic_lang_list_sort(const void *data1, const void *data2);
|
|||
struct _E_Intl_Pair
|
||||
{
|
||||
const char *locale_key;
|
||||
const char *locale_icon;
|
||||
const char *locale_translation;
|
||||
};
|
||||
|
||||
const E_Intl_Pair basic_language_predefined_pairs[ ] = {
|
||||
{"bg_BG.UTF-8", "Български"},
|
||||
{"ca_ES.UTF-8", "Català"},
|
||||
{"zh_CN.UTF-8", "Chinese (Simplified)"},
|
||||
{"zh_TW.UTF-8", "Chinese (Traditional)"},
|
||||
{"cs_CZ.UTF-8", "Čeština"},
|
||||
{"da_DK.UTF-8", "Dansk"},
|
||||
{"nl_NL.UTF-8", "Nederlands"},
|
||||
{"en_US.UTF-8", "English"},
|
||||
{"fi_FI.UTF-8", "Suomi"},
|
||||
{"fr_FR.UTF-8", "Français"},
|
||||
{"de_DE.UTF-8", "Deutsch"},
|
||||
{"hu_HU.UTF-8", "Magyar"},
|
||||
{"it_IT.UTF-8", "Italiano"},
|
||||
{"ja_JP.UTF-8", "日本語"},
|
||||
{"ko_KR.UTF-8", "한국어"},
|
||||
{"nb_NO.UTF-8", "Norsk Bokmål"},
|
||||
{"pl_PL.UTF-8", "Polski"},
|
||||
{"pt_BR.UTF-8", "Português"},
|
||||
{"ru_RU.UTF-8", "Русский"},
|
||||
{"sk_SK.UTF-8", "Slovenčina"},
|
||||
{"sl_SI.UTF-8", "Slovenščina"},
|
||||
{"es_AR.UTF-8", "Español"},
|
||||
{"sv_SE.UTF-8", "Svenska"},
|
||||
{ NULL, NULL }
|
||||
{"bg_BG.UTF-8", "lang-bg_BG.png", "Български"},
|
||||
{"ca_ES.UTF-8", "lang-ca_ES.png", "Català"},
|
||||
{"zh_CN.UTF-8", "lang-zh_CN.png", "Chinese (Simplified)"},
|
||||
{"zh_TW.UTF-8", "lang-zh_TW.png", "Chinese (Traditional)"},
|
||||
{"cs_CZ.UTF-8", "lang-cs_CZ.png", "Čeština"},
|
||||
{"da_DK.UTF-8", "lang-da_DK.png", "Dansk"},
|
||||
{"nl_NL.UTF-8", "lang-nl_NL.png", "Nederlands"},
|
||||
{"en_US.UTF-8", "lang-en_US.png", "English"},
|
||||
{"fi_FI.UTF-8", "lang-fi_FI.png", "Suomi"},
|
||||
{"fr_FR.UTF-8", "lang-fr_FR.png", "Français"},
|
||||
{"de_DE.UTF-8", "lang-de_DE.png", "Deutsch"},
|
||||
{"hu_HU.UTF-8", "lang-hu_HU.png", "Magyar"},
|
||||
{"it_IT.UTF-8", "lang-it_IT.png", "Italiano"},
|
||||
{"ja_JP.UTF-8", "lang-ja_JP.png", "日本語"},
|
||||
{"ko_KR.UTF-8", "lang-ko_KR.png", "한국어"},
|
||||
{"nb_NO.UTF-8", "lang-nb_NO.png", "Norsk Bokmål"},
|
||||
{"pl_PL.UTF-8", "lang-pl_PL.png", "Polski"},
|
||||
{"pt_BR.UTF-8", "lang-pt_BR.png", "Português"},
|
||||
{"ru_RU.UTF-8", "lang-ru_RU.png", "Русский"},
|
||||
{"sk_SK.UTF-8", "lang-sk_SK.png", "Slovenčina"},
|
||||
{"sl_SI.UTF-8", "lang-sl_SI.png", "Slovenščina"},
|
||||
{"es_AR.UTF-8", "lang-es_AR.png", "Español"},
|
||||
{"sv_SE.UTF-8", "lang-sv_SE.png", "Svenska"},
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
static char *lang = NULL;
|
||||
|
@ -74,7 +75,6 @@ wizard_page_init(E_Wizard_Page *pg)
|
|||
|
||||
e_lang_list = e_intl_language_list();
|
||||
|
||||
printf("init\n");
|
||||
output = popen("locale -a", "r");
|
||||
if (output)
|
||||
{
|
||||
|
@ -146,7 +146,7 @@ wizard_page_show(E_Wizard_Page *pg)
|
|||
|
||||
o = e_widget_list_add(pg->evas, 1, 0);
|
||||
e_wizard_title_set(_("Language"));
|
||||
of = e_widget_framelist_add(pg->evas, _("Available"), 0);
|
||||
of = e_widget_framelist_add(pg->evas, _("Select one"), 0);
|
||||
ob = e_widget_ilist_add(pg->evas, 32 * e_scale, 32 * e_scale, &lang);
|
||||
e_widget_min_size_set(ob, 140 * e_scale, 140 * e_scale);
|
||||
|
||||
|
@ -155,9 +155,14 @@ wizard_page_show(E_Wizard_Page *pg)
|
|||
for (i = 0, l = blang_list; l; l = l->next, i++)
|
||||
{
|
||||
E_Intl_Pair *pair;
|
||||
Evas_Object *ic;
|
||||
char buf[PATH_MAX], *dir;
|
||||
|
||||
pair = l->data;
|
||||
e_widget_ilist_append(ob, NULL, _(pair->locale_translation),
|
||||
dir = e_prefix_data_get();
|
||||
snprintf(buf, sizeof(buf), "%s/data/images/%s", dir, pair->locale_icon);
|
||||
ic = e_util_icon_add(buf, pg->evas);
|
||||
e_widget_ilist_append(ob, ic, _(pair->locale_translation),
|
||||
NULL, NULL, pair->locale_key);
|
||||
if (e_intl_language_get())
|
||||
{
|
||||
|
|
|
@ -4,6 +4,35 @@
|
|||
#include "e.h"
|
||||
#include "e_mod_main.h"
|
||||
|
||||
static char *profile = NULL;
|
||||
static Evas_Object *textblock = NULL;
|
||||
|
||||
static void
|
||||
_profile_change(void *data, Evas_Object *obj)
|
||||
{
|
||||
char buf[PATH_MAX], *dir;
|
||||
Efreet_Desktop *desk = NULL;
|
||||
|
||||
dir = e_prefix_data_get();
|
||||
snprintf(buf, sizeof(buf), "%s/data/config/%s", dir, profile);
|
||||
dir = strdup(buf);
|
||||
if (!dir)
|
||||
{
|
||||
e_widget_textblock_markup_set(textblock, _("Unknown"));
|
||||
return;
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "%s/profile.desktop", dir);
|
||||
desk = efreet_desktop_get(buf);
|
||||
if (desk)
|
||||
{
|
||||
e_widget_textblock_markup_set(textblock, desk->comment);
|
||||
}
|
||||
else
|
||||
e_widget_textblock_markup_set(textblock, _("Unknown"));
|
||||
if (desk) efreet_desktop_free(desk);
|
||||
free(dir);
|
||||
}
|
||||
|
||||
EAPI int
|
||||
wizard_page_init(E_Wizard_Page *pg)
|
||||
{
|
||||
|
@ -17,17 +46,80 @@ wizard_page_shutdown(E_Wizard_Page *pg)
|
|||
EAPI int
|
||||
wizard_page_show(E_Wizard_Page *pg)
|
||||
{
|
||||
Evas_Object *ob, *o;
|
||||
Evas_Object *o, *of, *ob;
|
||||
Eina_List *l, *profiles;
|
||||
int i, sel = -1;
|
||||
Evas_Object *ilist;
|
||||
|
||||
printf("t2\n");
|
||||
ob = e_widget_list_add(pg->evas, 1, 0);
|
||||
o = e_widget_button_add(pg->evas,
|
||||
"Hello Another World", NULL,
|
||||
NULL, NULL, NULL);
|
||||
e_widget_list_object_append(ob, o, 0, 0, 0.5);
|
||||
evas_object_show(o);
|
||||
e_wizard_page_show(ob);
|
||||
pg->data = ob;
|
||||
o = e_widget_list_add(pg->evas, 1, 0);
|
||||
e_wizard_title_set(_("Profile"));
|
||||
of = e_widget_framelist_add(pg->evas, _("Select one"), 0);
|
||||
|
||||
ob = e_widget_ilist_add(pg->evas, 32 * e_scale, 32 * e_scale, &profile);
|
||||
e_widget_min_size_set(ob, 140 * e_scale, 70 * e_scale);
|
||||
ilist = ob;
|
||||
e_widget_on_change_hook_set(ob, _profile_change, NULL);
|
||||
|
||||
e_widget_ilist_freeze(ob);
|
||||
|
||||
profiles = e_config_profile_list();
|
||||
for (i = 0, l = profiles; l; l = l->next, i++)
|
||||
{
|
||||
Efreet_Desktop *desk = NULL;
|
||||
char buf[PATH_MAX], *prof, *dir;
|
||||
const char *label;
|
||||
Evas_Object *ic;
|
||||
|
||||
prof = l->data;
|
||||
dir = e_prefix_data_get();
|
||||
snprintf(buf, sizeof(buf), "%s/data/config/%s", dir, prof);
|
||||
dir = strdup(buf);
|
||||
if (!dir)
|
||||
{
|
||||
free(prof);
|
||||
continue;
|
||||
}
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/profile.desktop", dir);
|
||||
desk = efreet_desktop_get(buf);
|
||||
label = prof;
|
||||
if ((desk) && (desk->name)) label = desk->name;
|
||||
snprintf(buf, sizeof(buf), "%s/icon.edj", dir);
|
||||
if ((desk) && (desk->icon))
|
||||
snprintf(buf, sizeof(buf), "%s/%s", dir, desk->icon);
|
||||
ic = e_util_icon_add(buf, pg->evas);
|
||||
|
||||
e_widget_ilist_append(ob, ic, label, NULL, NULL, prof);
|
||||
if (e_config_profile_get())
|
||||
{
|
||||
if (!strcmp(prof, e_config_profile_get())) sel = i;
|
||||
}
|
||||
free(dir);
|
||||
free(prof);
|
||||
if (desk) efreet_desktop_free(desk);
|
||||
}
|
||||
if (profiles) evas_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_min_size_set(ob, 140 * e_scale, 70 * e_scale);
|
||||
e_widget_textblock_markup_set(ob, _("Select a profile"));
|
||||
textblock = ob;
|
||||
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
e_widget_list_object_append(o, of, 0, 0, 0.5);
|
||||
|
||||
if (sel >= 0) e_widget_ilist_selected_set(ilist, sel);
|
||||
|
||||
evas_object_show(ob);
|
||||
evas_object_show(of);
|
||||
e_wizard_page_show(o);
|
||||
pg->data = of;
|
||||
return 1; /* 1 == show ui, and wait for user, 0 == just continue */
|
||||
}
|
||||
EAPI int
|
||||
|
@ -39,6 +131,6 @@ wizard_page_hide(E_Wizard_Page *pg)
|
|||
EAPI int
|
||||
wizard_page_apply(E_Wizard_Page *pg)
|
||||
{
|
||||
printf("a2\n");
|
||||
// FIXME: actually apply profile
|
||||
return 1;
|
||||
}
|
||||
|
|