forked from enlightenment/enlightenment
add option for disabling all keyboard layout changes
SVN revision: 83674
This commit is contained in:
parent
7846f013c9
commit
893b867070
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
* added api to automatically disable widgets when checkboxes are checked or unchecked
|
* added api to automatically disable widgets when checkboxes are checked or unchecked
|
||||||
* added e_widget_on_disable_hook_set
|
* added e_widget_on_disable_hook_set
|
||||||
|
* added option for preventing all keyboard layout changes
|
||||||
|
|
||||||
2013-02-05 Mike Blumenkrantz
|
2013-02-05 Mike Blumenkrantz
|
||||||
|
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -35,6 +35,7 @@ Additions:
|
||||||
* split comp window match settings into separate dialog
|
* split comp window match settings into separate dialog
|
||||||
* edge bindings can now be set to "drag only"
|
* edge bindings can now be set to "drag only"
|
||||||
* new option for disabling all pointer warps
|
* new option for disabling all pointer warps
|
||||||
|
* added option for preventing all keyboard layout changes
|
||||||
|
|
||||||
Changes:
|
Changes:
|
||||||
Modules:
|
Modules:
|
||||||
|
|
|
@ -833,6 +833,7 @@ _e_config_edd_init(Eina_Bool old)
|
||||||
E_CONFIG_LIST(D, T, xkb.used_layouts, _e_config_xkb_layout_edd);
|
E_CONFIG_LIST(D, T, xkb.used_layouts, _e_config_xkb_layout_edd);
|
||||||
E_CONFIG_LIST(D, T, xkb.used_options, _e_config_xkb_option_edd);
|
E_CONFIG_LIST(D, T, xkb.used_options, _e_config_xkb_option_edd);
|
||||||
E_CONFIG_VAL(D, T, xkb.only_label, INT);
|
E_CONFIG_VAL(D, T, xkb.only_label, INT);
|
||||||
|
E_CONFIG_VAL(D, T, xkb.dont_touch_my_damn_keyboard, UCHAR);
|
||||||
E_CONFIG_VAL(D, T, xkb.default_model, STR);
|
E_CONFIG_VAL(D, T, xkb.default_model, STR);
|
||||||
|
|
||||||
if (old)
|
if (old)
|
||||||
|
|
|
@ -419,6 +419,7 @@ struct _E_Config
|
||||||
E_Config_XKB_Layout *current_layout;
|
E_Config_XKB_Layout *current_layout;
|
||||||
E_Config_XKB_Layout *sel_layout;
|
E_Config_XKB_Layout *sel_layout;
|
||||||
E_Config_XKB_Layout *lock_layout;
|
E_Config_XKB_Layout *lock_layout;
|
||||||
|
Eina_Bool dont_touch_my_damn_keyboard;
|
||||||
|
|
||||||
/* NO LONGER USED BECAUSE I SUCK
|
/* NO LONGER USED BECAUSE I SUCK
|
||||||
* -zmike, 31 January 2013
|
* -zmike, 31 January 2013
|
||||||
|
|
|
@ -32,6 +32,7 @@ EAPI int
|
||||||
e_xkb_init(void)
|
e_xkb_init(void)
|
||||||
{
|
{
|
||||||
E_EVENT_XKB_CHANGED = ecore_event_type_new();
|
E_EVENT_XKB_CHANGED = ecore_event_type_new();
|
||||||
|
if (e_config->xkb.dont_touch_my_damn_keyboard) return 1;
|
||||||
e_xkb_update(-1);
|
e_xkb_update(-1);
|
||||||
if (e_config->xkb.cur_layout)
|
if (e_config->xkb.cur_layout)
|
||||||
ecore_timer_add(1.5, _e_xkb_init_timer, e_config->xkb.current_layout);
|
ecore_timer_add(1.5, _e_xkb_init_timer, e_config->xkb.current_layout);
|
||||||
|
@ -56,6 +57,7 @@ e_xkb_update(int cur_group)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Eina_Strbuf *buf;
|
Eina_Strbuf *buf;
|
||||||
|
|
||||||
|
if (e_config->xkb.dont_touch_my_damn_keyboard) return;
|
||||||
if ((!e_config->xkb.used_layouts) && (!e_config->xkb.used_options) && (!e_config->xkb.default_model)) return;
|
if ((!e_config->xkb.used_layouts) && (!e_config->xkb.used_options) && (!e_config->xkb.default_model)) return;
|
||||||
if (cur_group != -1)
|
if (cur_group != -1)
|
||||||
{
|
{
|
||||||
|
@ -153,6 +155,7 @@ e_xkb_layout_next(void)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
E_Config_XKB_Layout *cl;
|
E_Config_XKB_Layout *cl;
|
||||||
|
|
||||||
|
if (e_config->xkb.dont_touch_my_damn_keyboard) return;
|
||||||
l = eina_list_nth_list(e_config->xkb.used_layouts, e_config->xkb.cur_group);
|
l = eina_list_nth_list(e_config->xkb.used_layouts, e_config->xkb.cur_group);
|
||||||
l = eina_list_next(l);
|
l = eina_list_next(l);
|
||||||
if (!l) l = e_config->xkb.used_layouts;
|
if (!l) l = e_config->xkb.used_layouts;
|
||||||
|
@ -173,6 +176,7 @@ e_xkb_layout_prev(void)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
E_Config_XKB_Layout *cl;
|
E_Config_XKB_Layout *cl;
|
||||||
|
|
||||||
|
if (e_config->xkb.dont_touch_my_damn_keyboard) return;
|
||||||
l = eina_list_nth_list(e_config->xkb.used_layouts, e_config->xkb.cur_group);
|
l = eina_list_nth_list(e_config->xkb.used_layouts, e_config->xkb.cur_group);
|
||||||
l = eina_list_prev(l);
|
l = eina_list_prev(l);
|
||||||
if (!l) l = eina_list_last(e_config->xkb.used_layouts);
|
if (!l) l = eina_list_last(e_config->xkb.used_layouts);
|
||||||
|
@ -196,6 +200,7 @@ e_xkb_layout_get(void)
|
||||||
{
|
{
|
||||||
unsigned int n = 0;
|
unsigned int n = 0;
|
||||||
|
|
||||||
|
if (e_config->xkb.dont_touch_my_damn_keyboard) return NULL;
|
||||||
if (e_config->xkb.current_layout) return e_config->xkb.current_layout;
|
if (e_config->xkb.current_layout) return e_config->xkb.current_layout;
|
||||||
if (_e_xkb_cur_group >= 0)
|
if (_e_xkb_cur_group >= 0)
|
||||||
n = _e_xkb_cur_group;
|
n = _e_xkb_cur_group;
|
||||||
|
@ -210,6 +215,7 @@ e_xkb_layout_set(const E_Config_XKB_Layout *cl)
|
||||||
int cur_group = -1;
|
int cur_group = -1;
|
||||||
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN(cl);
|
EINA_SAFETY_ON_NULL_RETURN(cl);
|
||||||
|
if (e_config->xkb.dont_touch_my_damn_keyboard) return;
|
||||||
if (e_config_xkb_layout_eq(e_config->xkb.current_layout, cl)) return;
|
if (e_config_xkb_layout_eq(e_config->xkb.current_layout, cl)) return;
|
||||||
e_config_xkb_layout_free(e_config->xkb.current_layout);
|
e_config_xkb_layout_free(e_config->xkb.current_layout);
|
||||||
e_config->xkb.current_layout = e_config_xkb_layout_dup(cl);
|
e_config->xkb.current_layout = e_config_xkb_layout_dup(cl);
|
||||||
|
|
|
@ -16,6 +16,7 @@ struct _E_Config_Dialog_Data
|
||||||
const char *default_model;
|
const char *default_model;
|
||||||
|
|
||||||
int only_label;
|
int only_label;
|
||||||
|
int dont_touch_my_damn_keyboard;
|
||||||
|
|
||||||
E_Dialog *dlg_add_new;
|
E_Dialog *dlg_add_new;
|
||||||
};
|
};
|
||||||
|
@ -109,6 +110,7 @@ _create_data(E_Config_Dialog *cfd __UNUSED__)
|
||||||
/* Initialize options */
|
/* Initialize options */
|
||||||
|
|
||||||
cfdata->only_label = e_config->xkb.only_label;
|
cfdata->only_label = e_config->xkb.only_label;
|
||||||
|
cfdata->dont_touch_my_damn_keyboard = e_config->xkb.dont_touch_my_damn_keyboard;
|
||||||
cfdata->cfg_options = NULL;
|
cfdata->cfg_options = NULL;
|
||||||
|
|
||||||
lll = e_config->xkb.used_options;
|
lll = e_config->xkb.used_options;
|
||||||
|
@ -191,6 +193,7 @@ _basic_apply(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
|
||||||
|
|
||||||
/* Save options */
|
/* Save options */
|
||||||
e_config->xkb.only_label = cfdata->only_label;
|
e_config->xkb.only_label = cfdata->only_label;
|
||||||
|
e_config->xkb.dont_touch_my_damn_keyboard = cfdata->dont_touch_my_damn_keyboard;
|
||||||
|
|
||||||
EINA_LIST_FREE(e_config->xkb.used_options, oc)
|
EINA_LIST_FREE(e_config->xkb.used_options, oc)
|
||||||
{
|
{
|
||||||
|
@ -218,7 +221,7 @@ static Evas_Object *
|
||||||
_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
_basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||||
{
|
{
|
||||||
Evas_Object *mainn, *layoutss, *modelss, *options, *configs, *buttons,
|
Evas_Object *mainn, *layoutss, *modelss, *options, *configs, *buttons,
|
||||||
*general, *scroller, *only_label;
|
*general, *scroller, *only_label, *dont_touch_my_damn_keyboard;
|
||||||
E_XKB_Option *option;
|
E_XKB_Option *option;
|
||||||
E_XKB_Option_Group *group;
|
E_XKB_Option_Group *group;
|
||||||
Eina_List *l, *ll, *lll;
|
Eina_List *l, *ll, *lll;
|
||||||
|
@ -270,8 +273,11 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||||
/* Holds the options */
|
/* Holds the options */
|
||||||
options = e_widget_list_add(evas, 0, 0);
|
options = e_widget_list_add(evas, 0, 0);
|
||||||
|
|
||||||
general = e_widget_framelist_add(evas, _("Gadgets"), 0);
|
general = e_widget_framelist_add(evas, _("General"), 0);
|
||||||
only_label = e_widget_check_add(evas, _("Label only"), &(cfdata->only_label));
|
dont_touch_my_damn_keyboard = e_widget_check_add(evas, _("Do not apply any keyboard settings ever"), &(cfdata->dont_touch_my_damn_keyboard));
|
||||||
|
e_widget_framelist_object_append(general, dont_touch_my_damn_keyboard);
|
||||||
|
only_label = e_widget_check_add(evas, _("Label only in gadgets"), &(cfdata->only_label));
|
||||||
|
e_widget_check_widget_disable_on_checked_add(dont_touch_my_damn_keyboard, only_label);
|
||||||
e_widget_framelist_object_append(general, only_label);
|
e_widget_framelist_object_append(general, only_label);
|
||||||
e_widget_list_object_append(options, general, 1, 1, 0.0);
|
e_widget_list_object_append(options, general, 1, 1, 0.0);
|
||||||
|
|
||||||
|
@ -290,6 +296,7 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||||
chk = e_widget_check_add(evas, option->description,
|
chk = e_widget_check_add(evas, option->description,
|
||||||
&(((E_XKB_Dialog_Option *)
|
&(((E_XKB_Dialog_Option *)
|
||||||
eina_list_data_get(lll))->enabled));
|
eina_list_data_get(lll))->enabled));
|
||||||
|
e_widget_check_widget_disable_on_checked_add(dont_touch_my_damn_keyboard, chk);
|
||||||
e_widget_framelist_object_append(grp, chk);
|
e_widget_framelist_object_append(grp, chk);
|
||||||
lll = eina_list_next(lll);
|
lll = eina_list_next(lll);
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,7 +195,7 @@ _gc_init(E_Gadcon *gc, const char *gcname, const char *id, const char *style)
|
||||||
/* The gadget */
|
/* The gadget */
|
||||||
inst->o_xkbswitch = edje_object_add(gc->evas);
|
inst->o_xkbswitch = edje_object_add(gc->evas);
|
||||||
inst->layout = e_xkb_layout_get();
|
inst->layout = e_xkb_layout_get();
|
||||||
if (e_config->xkb.only_label)
|
if (e_config->xkb.only_label || (!inst->layout))
|
||||||
e_theme_edje_object_set(inst->o_xkbswitch,
|
e_theme_edje_object_set(inst->o_xkbswitch,
|
||||||
"base/theme/modules/xkbswitch",
|
"base/theme/modules/xkbswitch",
|
||||||
"e/modules/xkbswitch/noflag");
|
"e/modules/xkbswitch/noflag");
|
||||||
|
@ -204,12 +204,12 @@ _gc_init(E_Gadcon *gc, const char *gcname, const char *id, const char *style)
|
||||||
"base/theme/modules/xkbswitch",
|
"base/theme/modules/xkbswitch",
|
||||||
"e/modules/xkbswitch/main");
|
"e/modules/xkbswitch/main");
|
||||||
edje_object_part_text_set(inst->o_xkbswitch, "e.text.label",
|
edje_object_part_text_set(inst->o_xkbswitch, "e.text.label",
|
||||||
e_xkb_layout_name_reduce(inst->layout->name));
|
inst->layout ? e_xkb_layout_name_reduce(inst->layout->name) : "?");
|
||||||
/* The gadcon client */
|
/* The gadcon client */
|
||||||
inst->gcc = e_gadcon_client_new(gc, gcname, id, style, inst->o_xkbswitch);
|
inst->gcc = e_gadcon_client_new(gc, gcname, id, style, inst->o_xkbswitch);
|
||||||
inst->gcc->data = inst;
|
inst->gcc->data = inst;
|
||||||
/* The flag icon */
|
/* The flag icon */
|
||||||
if (!e_config->xkb.only_label)
|
if (inst->layout && (!e_config->xkb.only_label))
|
||||||
{
|
{
|
||||||
inst->o_xkbflag = e_icon_add(gc->evas);
|
inst->o_xkbflag = e_icon_add(gc->evas);
|
||||||
e_xkb_e_icon_flag_setup(inst->o_xkbflag, inst->layout->name);
|
e_xkb_e_icon_flag_setup(inst->o_xkbflag, inst->layout->name);
|
||||||
|
@ -513,6 +513,5 @@ _e_xkb_cb_lmenu_set(void *data, E_Menu *mn __UNUSED__, E_Menu_Item *mi __UNUSED_
|
||||||
e_xkb_layout_set(cl);
|
e_xkb_layout_set(cl);
|
||||||
e_config_xkb_layout_free(e_config->xkb.sel_layout);
|
e_config_xkb_layout_free(e_config->xkb.sel_layout);
|
||||||
e_config->xkb.sel_layout = e_config_xkb_layout_dup(cl);
|
e_config->xkb.sel_layout = e_config_xkb_layout_dup(cl);
|
||||||
_xkb_update_icon(cur_group);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue