forked from enlightenment/enlightenment
don't set dummy layouts in kbd wizard page anymore, also sort by label so we get a usable list
SVN revision: 79361
This commit is contained in:
parent
5d840bab5b
commit
4c2e27030f
|
@ -52,7 +52,7 @@ _layout_sort_cb(const void *data1, const void *data2)
|
||||||
{
|
{
|
||||||
const Layout *l1 = data1;
|
const Layout *l1 = data1;
|
||||||
const Layout *l2 = data2;
|
const Layout *l2 = data2;
|
||||||
return strcmp(l1->name, l2->name);
|
return e_util_strcasecmp(l1->label ?: l1->name, l2->label ?: l2->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -84,20 +84,19 @@ parse_rules(void)
|
||||||
}
|
}
|
||||||
err:
|
err:
|
||||||
fclose(f);
|
fclose(f);
|
||||||
layouts = eina_list_sort(layouts, eina_list_count(layouts),
|
layouts = eina_list_sort(layouts, 0, _layout_sort_cb);
|
||||||
_layout_sort_cb);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
implement_layout(void)
|
implement_layout(void)
|
||||||
{
|
|
||||||
if (layout)
|
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
E_Config_XKB_Layout *nl;
|
E_Config_XKB_Layout *nl;
|
||||||
Eina_Bool found = EINA_FALSE;
|
Eina_Bool found = EINA_FALSE;
|
||||||
|
|
||||||
|
if (!layout) return;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(e_config->xkb.used_layouts, l, nl)
|
EINA_LIST_FOREACH(e_config->xkb.used_layouts, l, nl)
|
||||||
{
|
{
|
||||||
if ((nl->name) && (!strcmp(layout, nl->name)))
|
if ((nl->name) && (!strcmp(layout, nl->name)))
|
||||||
|
@ -106,18 +105,9 @@ implement_layout(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found)
|
if (!found) return;
|
||||||
{
|
|
||||||
nl = E_NEW(E_Config_XKB_Layout, 1);
|
|
||||||
nl->name = eina_stringshare_add(layout);
|
|
||||||
nl->model = eina_stringshare_add("default");
|
|
||||||
nl->variant = eina_stringshare_add("basic");
|
|
||||||
e_config->xkb.used_layouts =
|
|
||||||
eina_list_append(e_config->xkb.used_layouts, nl);
|
|
||||||
}
|
|
||||||
e_xkb_layout_set(layout);
|
e_xkb_layout_set(layout);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
wizard_page_init(E_Wizard_Page *pg __UNUSED__)
|
||||||
|
|
Loading…
Reference in New Issue