aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/default/Makefile.am2
-rw-r--r--config/default/icon.pngbin0 -> 15260 bytes
-rw-r--r--config/default/profile.desktop5
-rw-r--r--data/images/Makefile.am26
-rw-r--r--data/images/lang-bg_BG.pngbin0 -> 346 bytes
-rw-r--r--data/images/lang-ca_ES.pngbin0 -> 3421 bytes
-rw-r--r--data/images/lang-cs_CZ.pngbin0 -> 1758 bytes
-rw-r--r--data/images/lang-da_DK.pngbin0 -> 438 bytes
-rw-r--r--data/images/lang-de_DE.pngbin0 -> 294 bytes
-rw-r--r--data/images/lang-en_US.pngbin0 -> 4787 bytes
-rw-r--r--data/images/lang-es_AR.pngbin0 -> 1563 bytes
-rw-r--r--data/images/lang-es_ES.pngbin0 -> 2738 bytes
-rw-r--r--data/images/lang-fi_FI.pngbin0 -> 478 bytes
-rw-r--r--data/images/lang-fr_FR.pngbin0 -> 349 bytes
-rw-r--r--data/images/lang-hu_HU.pngbin0 -> 339 bytes
-rw-r--r--data/images/lang-it_IT.pngbin0 -> 337 bytes
-rw-r--r--data/images/lang-ja_JP.pngbin0 -> 1404 bytes
-rw-r--r--data/images/lang-ko_KR.pngbin0 -> 4132 bytes
-rw-r--r--data/images/lang-nb_NO.pngbin0 -> 592 bytes
-rw-r--r--data/images/lang-nl_NL.pngbin0 -> 341 bytes
-rw-r--r--data/images/lang-pl_PL.pngbin0 -> 315 bytes
-rw-r--r--data/images/lang-pt_BR.pngbin0 -> 4242 bytes
-rw-r--r--data/images/lang-ru_RU.pngbin0 -> 338 bytes
-rw-r--r--data/images/lang-sk_SK.pngbin0 -> 2214 bytes
-rw-r--r--data/images/lang-sl_SI.pngbin0 -> 1706 bytes
-rw-r--r--data/images/lang-sv_SE.pngbin0 -> 494 bytes
-rw-r--r--data/images/lang-zh_CN.pngbin0 -> 1304 bytes
-rw-r--r--data/images/lang-zh_TW.pngbin0 -> 2471 bytes
-rw-r--r--src/bin/e_config.c44
-rw-r--r--src/bin/e_config.h3
-rw-r--r--src/modules/wizard/page_010.c59
-rw-r--r--src/modules/wizard/page_020.c116
32 files changed, 213 insertions, 42 deletions
diff --git a/config/default/Makefile.am b/config/default/Makefile.am
index a4a0c5261..15e743d90 100644
--- a/config/default/Makefile.am
+++ b/config/default/Makefile.am
@@ -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 \
diff --git a/config/default/icon.png b/config/default/icon.png
new file mode 100644
index 000000000..2c00baf27
--- /dev/null
+++ b/config/default/icon.png
Binary files differ
diff --git a/config/default/profile.desktop b/config/default/profile.desktop
new file mode 100644
index 000000000..c0160e0d0
--- /dev/null
+++ b/config/default/profile.desktop
@@ -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.
diff --git a/data/images/Makefile.am b/data/images/Makefile.am
index ddb9886e0..2110f05a2 100644
--- a/data/images/Makefile.am
+++ b/data/images/Makefile.am
@@ -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)
diff --git a/data/images/lang-bg_BG.png b/data/images/lang-bg_BG.png
new file mode 100644
index 000000000..24a82e8e6
--- /dev/null
+++ b/data/images/lang-bg_BG.png
Binary files differ
diff --git a/data/images/lang-ca_ES.png b/data/images/lang-ca_ES.png
new file mode 100644
index 000000000..7aa94dc1b
--- /dev/null
+++ b/data/images/lang-ca_ES.png
Binary files differ
diff --git a/data/images/lang-cs_CZ.png b/data/images/lang-cs_CZ.png
new file mode 100644
index 000000000..f6d3ac026
--- /dev/null
+++ b/data/images/lang-cs_CZ.png
Binary files differ
diff --git a/data/images/lang-da_DK.png b/data/images/lang-da_DK.png
new file mode 100644
index 000000000..4c3baa315
--- /dev/null
+++ b/data/images/lang-da_DK.png
Binary files differ
diff --git a/data/images/lang-de_DE.png b/data/images/lang-de_DE.png
new file mode 100644
index 000000000..e7af0e4ef
--- /dev/null
+++ b/data/images/lang-de_DE.png
Binary files differ
diff --git a/data/images/lang-en_US.png b/data/images/lang-en_US.png
new file mode 100644
index 000000000..dc642e4e1
--- /dev/null
+++ b/data/images/lang-en_US.png
Binary files differ
diff --git a/data/images/lang-es_AR.png b/data/images/lang-es_AR.png
new file mode 100644
index 000000000..332f7d16b
--- /dev/null
+++ b/data/images/lang-es_AR.png
Binary files differ
diff --git a/data/images/lang-es_ES.png b/data/images/lang-es_ES.png
new file mode 100644
index 000000000..6d99263a2
--- /dev/null
+++ b/data/images/lang-es_ES.png
Binary files differ
diff --git a/data/images/lang-fi_FI.png b/data/images/lang-fi_FI.png
new file mode 100644
index 000000000..daa18846b
--- /dev/null
+++ b/data/images/lang-fi_FI.png
Binary files differ
diff --git a/data/images/lang-fr_FR.png b/data/images/lang-fr_FR.png
new file mode 100644
index 000000000..816409a7e
--- /dev/null
+++ b/data/images/lang-fr_FR.png
Binary files differ
diff --git a/data/images/lang-hu_HU.png b/data/images/lang-hu_HU.png
new file mode 100644
index 000000000..5676584fb
--- /dev/null
+++ b/data/images/lang-hu_HU.png
Binary files differ
diff --git a/data/images/lang-it_IT.png b/data/images/lang-it_IT.png
new file mode 100644
index 000000000..ca1fd40e2
--- /dev/null
+++ b/data/images/lang-it_IT.png
Binary files differ
diff --git a/data/images/lang-ja_JP.png b/data/images/lang-ja_JP.png
new file mode 100644
index 000000000..0481b40f0
--- /dev/null
+++ b/data/images/lang-ja_JP.png
Binary files differ
diff --git a/data/images/lang-ko_KR.png b/data/images/lang-ko_KR.png
new file mode 100644
index 000000000..227b2f378
--- /dev/null
+++ b/data/images/lang-ko_KR.png
Binary files differ
diff --git a/data/images/lang-nb_NO.png b/data/images/lang-nb_NO.png
new file mode 100644
index 000000000..00cfd952d
--- /dev/null
+++ b/data/images/lang-nb_NO.png
Binary files differ
diff --git a/data/images/lang-nl_NL.png b/data/images/lang-nl_NL.png
new file mode 100644
index 000000000..eb3116ee5
--- /dev/null
+++ b/data/images/lang-nl_NL.png
Binary files differ
diff --git a/data/images/lang-pl_PL.png b/data/images/lang-pl_PL.png
new file mode 100644
index 000000000..1f031c2fe
--- /dev/null
+++ b/data/images/lang-pl_PL.png
Binary files differ
diff --git a/data/images/lang-pt_BR.png b/data/images/lang-pt_BR.png
new file mode 100644
index 000000000..75f9b47ce
--- /dev/null
+++ b/data/images/lang-pt_BR.png
Binary files differ
diff --git a/data/images/lang-ru_RU.png b/data/images/lang-ru_RU.png
new file mode 100644
index 000000000..ccc02a54a
--- /dev/null
+++ b/data/images/lang-ru_RU.png
Binary files differ
diff --git a/data/images/lang-sk_SK.png b/data/images/lang-sk_SK.png
new file mode 100644
index 000000000..940ec4235
--- /dev/null
+++ b/data/images/lang-sk_SK.png
Binary files differ
diff --git a/data/images/lang-sl_SI.png b/data/images/lang-sl_SI.png
new file mode 100644
index 000000000..ec34190b5
--- /dev/null
+++ b/data/images/lang-sl_SI.png
Binary files differ
diff --git a/data/images/lang-sv_SE.png b/data/images/lang-sv_SE.png
new file mode 100644
index 000000000..c33ca7e2e
--- /dev/null
+++ b/data/images/lang-sv_SE.png
Binary files differ
diff --git a/data/images/lang-zh_CN.png b/data/images/lang-zh_CN.png
new file mode 100644
index 000000000..c4334dd57
--- /dev/null
+++ b/data/images/lang-zh_CN.png
Binary files differ
diff --git a/data/images/lang-zh_TW.png b/data/images/lang-zh_TW.png
new file mode 100644
index 000000000..0de186737
--- /dev/null
+++ b/data/images/lang-zh_TW.png
Binary files differ
diff --git a/src/bin/e_config.c b/src/bin/e_config.c
index 69de7722b..d7586d8df 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -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;
}
diff --git a/src/bin/e_config.h b/src/bin/e_config.h
index 349406346..e16e2909b 100644
--- a/src/bin/e_config.h
+++ b/src/bin/e_config.h
@@ -456,7 +456,8 @@ EAPI int e_config_save(void);
EAPI void e_config_save_flush(void);
EAPI void e_config_save_queue(void);
-EAPI const char *e_config_profile_get(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);
diff --git a/src/modules/wizard/page_010.c b/src/modules/wizard/page_010.c
index cdf2d9e77..7c03880aa 100644
--- a/src/modules/wizard/page_010.c
+++ b/src/modules/wizard/page_010.c
@@ -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())
{
diff --git a/src/modules/wizard/page_020.c b/src/modules/wizard/page_020.c
index ceb7d9629..e72331047 100644
--- a/src/modules/wizard/page_020.c
+++ b/src/modules/wizard/page_020.c
@@ -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;
-
- 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;
+ Evas_Object *o, *of, *ob;
+ Eina_List *l, *profiles;
+ int i, sel = -1;
+ Evas_Object *ilist;
+
+ 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;
}