summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-09 09:50:33 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-09 09:50:33 +0100
commitfdd472879b61c3230fabe6f8f2e9da1cd52505b0 (patch)
tree5445354e266edee44c06a0dffb1a92666d99e7b1 /src/modules
parent855c7028c4e7ec78bd1a8e6e9f7fe3fa200a1a72 (diff)
xkb - make basic variant null now and handle in wl too the same as x
now russian works for me. :) fixes T7979 @fix
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/xkbswitch/e_mod_config.c48
-rw-r--r--src/modules/xkbswitch/e_mod_parse.c2
2 files changed, 36 insertions, 14 deletions
diff --git a/src/modules/xkbswitch/e_mod_config.c b/src/modules/xkbswitch/e_mod_config.c
index 24fb40e..4e9a48e 100644
--- a/src/modules/xkbswitch/e_mod_config.c
+++ b/src/modules/xkbswitch/e_mod_config.c
@@ -521,8 +521,14 @@ _basic_create_fill(E_Config_Dialog_Data *cfdata)
521 521
522 e_xkb_flag_file_get(buf, sizeof(buf), name); 522 e_xkb_flag_file_get(buf, sizeof(buf), name);
523 elm_image_file_set(ic, buf, NULL); 523 elm_image_file_set(ic, buf, NULL);
524 snprintf(buf, sizeof(buf), "%s (%s, %s)", 524 snprintf(buf, sizeof(buf), "%s%s%s%s%s%s",
525 cl->name, cl->model, cl->variant); 525 cl->name ? cl->name : _("No Name"),
526 cl->model || cl->variant ? " (" : "",
527 cl->model ? cl->model : "",
528 cl->model && cl->variant ? ", " : "",
529 cl->variant ? cl->variant : "",
530 cl->model || cl->variant ? ")" : ""
531 );
526 evas_object_show(ic); 532 evas_object_show(ic);
527 it = elm_list_item_append(cfdata->used_list, buf, ic, 533 it = elm_list_item_append(cfdata->used_list, buf, ic,
528 NULL, NULL, cl); 534 NULL, NULL, cl);
@@ -1451,7 +1457,7 @@ _dlg_add_cb_ok(void *data, E_Dialog *dlg)
1451 E_XKB_Model *m; 1457 E_XKB_Model *m;
1452 E_XKB_Variant *v; 1458 E_XKB_Variant *v;
1453 E_Config_XKB_Layout *cl; 1459 E_Config_XKB_Layout *cl;
1454 char buf[PATH_MAX], icon_buf[PATH_MAX]; 1460 char buf[512], icon_buf[PATH_MAX];
1455 Evas_Object *ic; 1461 Evas_Object *ic;
1456 Elm_Object_Item *it; 1462 Elm_Object_Item *it;
1457 /* Configuration information */ 1463 /* Configuration information */
@@ -1480,8 +1486,14 @@ _dlg_add_cb_ok(void *data, E_Dialog *dlg)
1480 ic = elm_icon_add(cfdata->used_list); 1486 ic = elm_icon_add(cfdata->used_list);
1481 e_xkb_flag_file_get(icon_buf, sizeof(icon_buf), cl->name); 1487 e_xkb_flag_file_get(icon_buf, sizeof(icon_buf), cl->name);
1482 elm_image_file_set(ic, icon_buf, NULL); 1488 elm_image_file_set(ic, icon_buf, NULL);
1483 snprintf(buf, sizeof(buf), "%s (%s, %s)", 1489 snprintf(buf, sizeof(buf), "%s%s%s%s%s%s",
1484 cl->name, cl->model, cl->variant); 1490 cl->name ? cl->name : _("No Name"),
1491 cl->model || cl->variant ? " (" : "",
1492 cl->model ? cl->model : "",
1493 cl->model && cl->variant ? ", " : "",
1494 cl->variant ? cl->variant : "",
1495 cl->model || cl->variant ? ")" : ""
1496 );
1485 elm_list_item_append(cfdata->used_list, buf, ic, NULL, NULL, cl); 1497 elm_list_item_append(cfdata->used_list, buf, ic, NULL, NULL, cl);
1486 elm_list_go(cfdata->used_list); 1498 elm_list_go(cfdata->used_list);
1487 1499
@@ -1499,9 +1511,13 @@ static char *
1499_layout_gl_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) 1511_layout_gl_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
1500{ 1512{
1501 E_XKB_Layout *layout = data; 1513 E_XKB_Layout *layout = data;
1502 char buf[PATH_MAX]; 1514 char buf[512];
1503 1515
1504 snprintf(buf, sizeof(buf), "%s (%s)", layout->description, layout->name); 1516 snprintf(buf, sizeof(buf), "%s%s%s%s",
1517 layout->description ? layout->description : _("No Description"),
1518 layout->name ? " (" : "",
1519 layout->name ? layout->name : "",
1520 layout->name ? ")" : "");
1505 return strdup(buf); 1521 return strdup(buf);
1506} 1522}
1507 1523
@@ -1580,10 +1596,13 @@ static char *
1580_model_gl_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) 1596_model_gl_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
1581{ 1597{
1582 E_XKB_Model *model = data; 1598 E_XKB_Model *model = data;
1583 char buf[PATH_MAX]; 1599 char buf[512];
1584
1585 snprintf(buf, sizeof(buf), "%s (%s)", model->description, model->name);
1586 1600
1601 snprintf(buf, sizeof(buf), "%s%s%s%s",
1602 model->description ? model->description : _("No Description"),
1603 model->name ? " (" : "",
1604 model->name ? model->name : "",
1605 model->name ? ")" : "");
1587 return strdup(buf); 1606 return strdup(buf);
1588} 1607}
1589 1608
@@ -1591,10 +1610,13 @@ static char *
1591_variant_gl_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) 1610_variant_gl_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED)
1592{ 1611{
1593 E_XKB_Variant *variant = data; 1612 E_XKB_Variant *variant = data;
1594 char buf[PATH_MAX]; 1613 char buf[512];
1595
1596 snprintf(buf, sizeof(buf), "%s (%s)", variant->name, variant->description);
1597 1614
1615 snprintf(buf, sizeof(buf), "%s%s%s%s",
1616 variant->name ? variant->name : _("No Name"),
1617 variant->description ? " (" : "",
1618 variant->description ? variant->description : "",
1619 variant->description ? ")" : "");
1598 return strdup(buf); 1620 return strdup(buf);
1599} 1621}
1600 1622
diff --git a/src/modules/xkbswitch/e_mod_parse.c b/src/modules/xkbswitch/e_mod_parse.c
index 9b0894b..0de697e 100644
--- a/src/modules/xkbswitch/e_mod_parse.c
+++ b/src/modules/xkbswitch/e_mod_parse.c
@@ -193,7 +193,7 @@ parse_rules(void)
193 ++p; 193 ++p;
194 194
195 variant = E_NEW(E_XKB_Variant, 1); 195 variant = E_NEW(E_XKB_Variant, 1);
196 variant->name = eina_stringshare_add("basic"); 196 variant->name = NULL; // used to be "basic" but now NULL will do
197 variant->description = eina_stringshare_add("Default layout variant"); 197 variant->description = eina_stringshare_add("Default layout variant");
198 198
199 txt = evas_textblock_text_markup_to_utf8(NULL, p); 199 txt = evas_textblock_text_markup_to_utf8(NULL, p);