aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-01 12:27:07 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-02-01 12:27:07 +0000
commitdce9dcab42b51e6339829215f596dbacabc8ae67 (patch)
tree5b3ea57ad53e73be182ce2243166dc49577929e2
parentffs this free macro needs to get fixed to not fail here (diff)
downloadenlightenment-dce9dcab42b51e6339829215f596dbacabc8ae67.tar.gz
binding dialogs are now able to reset bindings to the system profile file defaults (currently uses "standard" since we have no parenting/typing system for profiles)
ticket #2204 SVN revision: 83557
-rw-r--r--ChangeLog1
-rw-r--r--NEWS2
-rw-r--r--src/modules/conf_edgebindings/e_int_config_edgebindings.c43
-rw-r--r--src/modules/conf_edgebindings/e_int_config_signalbindings.c70
-rw-r--r--src/modules/conf_keybindings/e_int_config_keybindings.c230
-rw-r--r--src/modules/conf_keybindings/e_int_config_mousebindings.c84
6 files changed, 66 insertions, 364 deletions
diff --git a/ChangeLog b/ChangeLog
index e30cfe89b..f0bc091bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
* E_Config_DD structs are now tracked and retrievable through e_config_descriptor_find
* binding dialogs now reload the default config from file when reset defaults is clicked
* fixed leak in profile list dbus method
+ * binding dialogs are now able to reset bindings to the system profile file bindings
2013-01-31 Mike Blumenkrantz
diff --git a/NEWS b/NEWS
index 81968331c..1ca7f8520 100644
--- a/NEWS
+++ b/NEWS
@@ -80,7 +80,7 @@ Improvements:
* add support for AltGr in illume2's E_Kbd_Buf_Key, fix related leak
* split out binding configs into separate config domain
* binding dialogs now reload the default config from file when reset defaults is clicked
-
+ * binding dialogs are now able to reset bindings to the system profile file bindings
Fixes:
* IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar.
* Shelf option 'overlapping' made clearer and disabled when window automatic movement on shelf hide isn't set.
diff --git a/src/modules/conf_edgebindings/e_int_config_edgebindings.c b/src/modules/conf_edgebindings/e_int_config_edgebindings.c
index ec7c25fc5..587fe684a 100644
--- a/src/modules/conf_edgebindings/e_int_config_edgebindings.c
+++ b/src/modules/conf_edgebindings/e_int_config_edgebindings.c
@@ -505,37 +505,24 @@ _delete_edge_binding_cb(void *data, void *data2 __UNUSED__)
static void
_restore_edge_binding_defaults_cb(void *data, void *data2 __UNUSED__)
{
- E_Config_Dialog_Data *cfdata;
- E_Config_Binding_Edge *bi;
-
- cfdata = data;
+ E_Config_Bindings *ecb;
+ Eina_Stringshare *prof;
+ E_Config_Dialog_Data *cfdata = data;
- EINA_LIST_FREE(cfdata->binding.edge, bi)
+ ecb = e_config_domain_system_load("e_bindings", e_config_descriptor_find("E_Config_Bindings"));
+ if (!ecb)
{
- eina_stringshare_del(bi->action);
- eina_stringshare_del(bi->params);
- E_FREE(bi);
+ prof = eina_stringshare_ref(e_config_profile_get());
+ /* FIXME: need some type of parenting/typing system for profiles */
+ e_config_profile_set("standard");
+ ecb = e_config_domain_system_load("e_bindings", e_config_descriptor_find("E_Config_Bindings"));
+ e_config_profile_set(prof);
+ eina_stringshare_del(prof);
}
-
-#define CFG_EDGEBIND_DFLT(_context, _edge, _modifiers, _anymod, _action, _params, _delay) \
- bi = E_NEW(E_Config_Binding_Edge, 1); \
- bi->context = _context; \
- bi->edge = _edge; \
- bi->modifiers = _modifiers; \
- bi->any_mod = _anymod; \
- bi->delay = _delay; \
- bi->action = eina_stringshare_add(_action); \
- bi->params = eina_stringshare_add(_params); \
- cfdata->binding.edge = eina_list_append(cfdata->binding.edge, bi)
-
- CFG_EDGEBIND_DFLT(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_LEFT,
- 0, 0, "desk_flip_in_direction", NULL, 0.3);
- CFG_EDGEBIND_DFLT(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_RIGHT,
- 0, 0, "desk_flip_in_direction", NULL, 0.3);
- CFG_EDGEBIND_DFLT(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_TOP,
- 0, 0, "desk_flip_in_direction", NULL, 0.3);
- CFG_EDGEBIND_DFLT(E_BINDING_CONTEXT_ZONE, E_ZONE_EDGE_BOTTOM,
- 0, 0, "desk_flip_in_direction", NULL, 0.3);
+ if (!ecb) return;
+ E_FREE_LIST(cfdata->binding.edge, e_config_binding_edge_free);
+ cfdata->binding.edge = ecb->edge_bindings, ecb->edge_bindings = NULL;
+ e_config_bindings_free(ecb);
eina_stringshare_del(cfdata->locals.cur);
cfdata->locals.cur = NULL;
diff --git a/src/modules/conf_edgebindings/e_int_config_signalbindings.c b/src/modules/conf_edgebindings/e_int_config_signalbindings.c
index c7fcddd0c..f57faca52 100644
--- a/src/modules/conf_edgebindings/e_int_config_signalbindings.c
+++ b/src/modules/conf_edgebindings/e_int_config_signalbindings.c
@@ -39,19 +39,6 @@ struct _E_Config_Dialog_Data
};
static E_Config_Binding_Signal *
-_signal_binding_new(const char *sig, const char *src)
-{
- E_Config_Binding_Signal *bi;
-
- bi = E_NEW(E_Config_Binding_Signal, 1);
- bi->context = 2;
- bi->any_mod = 1;
- bi->signal = eina_stringshare_add(sig);
- bi->source = eina_stringshare_add(src);
- return bi;
-}
-
-static E_Config_Binding_Signal *
_signal_binding_copy(E_Config_Binding_Signal *bi)
{
E_Config_Binding_Signal *bi2;
@@ -739,47 +726,24 @@ _delete_all_signal_binding_cb(void *data, void *data2 __UNUSED__)
static void
_restore_signal_binding_defaults_cb(void *data, void *data2 __UNUSED__)
{
- E_Config_Dialog_Data *cfdata;
- E_Config_Binding_Signal *bi;
-
- cfdata = data;
-
- E_FREE_LIST(cfdata->binding.signal, _signal_binding_free);
+ E_Config_Bindings *ecb;
+ Eina_Stringshare *prof;
+ E_Config_Dialog_Data *cfdata = data;
-#define CFG_SIGBIND_DFLT(_signal, _source, _action, _params) \
- bi = _signal_binding_new(_signal, _source); \
- bi->action = eina_stringshare_add(_action); \
- bi->params = eina_stringshare_add(_params); \
- cfdata->binding.signal = eina_list_append(cfdata->binding.signal, bi)
-
- CFG_SIGBIND_DFLT("mouse,down,1,double", "e.event.titlebar", "window_shaded_toggle", "up");
- CFG_SIGBIND_DFLT("mouse,down,2", "e.event.titlebar", "window_shaded_toggle", "up");
- CFG_SIGBIND_DFLT("mouse,wheel,?,1", "e.event.titlebar", "window_shaded", "0 up");
- CFG_SIGBIND_DFLT("mouse,wheel,?,-1", "e.event.titlebar", "window_shaded", "1 up");
- CFG_SIGBIND_DFLT("mouse,clicked,3", "e.event.titlebar", "window_menu", NULL);
- CFG_SIGBIND_DFLT("mouse,clicked,?", "e.event.icon", "window_menu", NULL);
- CFG_SIGBIND_DFLT("mouse,clicked,[12]", "e.event.close", "window_close", NULL);
- CFG_SIGBIND_DFLT("mouse,clicked,3", "e.event.close", "window_kill", NULL);
- CFG_SIGBIND_DFLT("mouse,clicked,1", "e.event.maximize", "window_maximized_toggle", NULL);
- CFG_SIGBIND_DFLT("mouse,clicked,2", "e.event.maximize", "window_maximized_toggle", "smart");
- CFG_SIGBIND_DFLT("mouse,clicked,3", "e.event.maximize", "window_maximized_toggle", "expand");
- CFG_SIGBIND_DFLT("mouse,clicked,?", "e.event.minimize", "window_iconic_toggle", NULL);
- CFG_SIGBIND_DFLT("mouse,clicked,?", "e.event.shade", "window_shaded_toggle", "up");
- CFG_SIGBIND_DFLT("mouse,clicked,?", "e.event.lower", "window_lower", NULL);
- CFG_SIGBIND_DFLT("mouse,down,1", "e.event.icon", "window_drag_icon", NULL);
- CFG_SIGBIND_DFLT("mouse,down,1", "e.event.titlebar", "window_move", NULL);
- CFG_SIGBIND_DFLT("mouse,up,1", "e.event.titlebar", "window_move", "end");
- CFG_SIGBIND_DFLT("mouse,down,1", "e.event.resize.tl", "window_resize", "tl");
- CFG_SIGBIND_DFLT("mouse,down,1", "e.event.resize.t", "window_resize", "t");
- CFG_SIGBIND_DFLT("mouse,down,1", "e.event.resize.tr", "window_resize", "tr");
- CFG_SIGBIND_DFLT("mouse,down,1", "e.event.resize.r", "window_resize", "r");
- CFG_SIGBIND_DFLT("mouse,down,1", "e.event.resize.br", "window_resize", "br");
- CFG_SIGBIND_DFLT("mouse,down,1", "e.event.resize.b", "window_resize", "b");
- CFG_SIGBIND_DFLT("mouse,down,1", "e.event.resize.bl", "window_resize", "bl");
- CFG_SIGBIND_DFLT("mouse,down,1", "e.event.resize.l", "window_resize", "l");
- CFG_SIGBIND_DFLT("mouse,up,1", "e.event.resize.*", "window_resize", "end");
- CFG_SIGBIND_DFLT("mouse,down,3", "e.event.resize.*", "window_move", NULL);
- CFG_SIGBIND_DFLT("mouse,up,3", "e.event.resize.*", "window_move", "end");
+ ecb = e_config_domain_system_load("e_bindings", e_config_descriptor_find("E_Config_Bindings"));
+ if (!ecb)
+ {
+ prof = eina_stringshare_ref(e_config_profile_get());
+ /* FIXME: need some type of parenting/typing system for profiles */
+ e_config_profile_set("standard");
+ ecb = e_config_domain_system_load("e_bindings", e_config_descriptor_find("E_Config_Bindings"));
+ e_config_profile_set(prof);
+ eina_stringshare_del(prof);
+ }
+ if (!ecb) return;
+ E_FREE_LIST(cfdata->binding.signal, e_config_binding_signal_free);
+ cfdata->binding.signal = ecb->signal_bindings, ecb->signal_bindings = NULL;
+ e_config_bindings_free(ecb);
eina_stringshare_del(cfdata->locals.cur);
cfdata->locals.cur = NULL;
diff --git a/src/modules/conf_keybindings/e_int_config_keybindings.c b/src/modules/conf_keybindings/e_int_config_keybindings.c
index 378f64b7f..431345f07 100644
--- a/src/modules/conf_keybindings/e_int_config_keybindings.c
+++ b/src/modules/conf_keybindings/e_int_config_keybindings.c
@@ -469,224 +469,24 @@ static void
_restore_key_binding_defaults_cb(void *data,
void *data2 __UNUSED__)
{
- E_Config_Dialog_Data *cfdata;
- E_Config_Binding_Key *bi;
+ E_Config_Bindings *ecb;
+ Eina_Stringshare *prof;
+ E_Config_Dialog_Data *cfdata = data;
- cfdata = data;
-
- EINA_LIST_FREE(cfdata->binding.key, bi)
+ ecb = e_config_domain_system_load("e_bindings", e_config_descriptor_find("E_Config_Bindings"));
+ if (!ecb)
{
- eina_stringshare_del(bi->key);
- eina_stringshare_del(bi->action);
- eina_stringshare_del(bi->params);
- E_FREE(bi);
+ prof = eina_stringshare_ref(e_config_profile_get());
+ /* FIXME: need some type of parenting/typing system for profiles */
+ e_config_profile_set("standard");
+ ecb = e_config_domain_system_load("e_bindings", e_config_descriptor_find("E_Config_Bindings"));
+ e_config_profile_set(prof);
+ eina_stringshare_del(prof);
}
-
-#define CFG_KEYBIND_DFLT(_context, _key, _modifiers, _anymod, _action, _params) \
- bi = E_NEW(E_Config_Binding_Key, 1); \
- bi->context = _context; \
- bi->key = eina_stringshare_add(_key); \
- bi->modifiers = _modifiers; \
- bi->any_mod = _anymod; \
- bi->action = eina_stringshare_add(_action); \
- bi->params = eina_stringshare_add(_params); \
- cfdata->binding.key = eina_list_append(cfdata->binding.key, bi)
-
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Left",
- E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
- "desk_flip_by", "-1 0");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Right",
- E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
- "desk_flip_by", "1 0");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Up",
- E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
- "desk_flip_by", "0 -1");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Down",
- E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
- "desk_flip_by", "0 1");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Up",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "window_raise", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Down",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "window_lower", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "x",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "window_close", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "k",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "window_kill", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "w",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "window_menu", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "s",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "window_sticky_toggle", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "f",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "window_fullscreen_toggle", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "i",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "window_iconic_toggle", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "n",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "window_maximized_toggle", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F10",
- E_BINDING_MODIFIER_SHIFT, 0,
- "window_maximized_toggle", "default vertical");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F10",
- E_BINDING_MODIFIER_CTRL, 0,
- "window_maximized_toggle", "default horizontal");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Left",
- E_BINDING_MODIFIER_WIN, 0,
- "window_maximized_toggle", "default left");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Right",
- E_BINDING_MODIFIER_WIN, 0,
- "window_maximized_toggle", "default right");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "r",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "window_shaded_toggle", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Left",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "-1");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Right",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "1");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F1",
- E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_to", "0");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F2",
- E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_to", "1");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F3",
- E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_to", "2");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F4",
- E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_to", "3");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F5",
- E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_to", "4");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F6",
- E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_to", "5");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F7",
- E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_to", "6");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F8",
- E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_to", "7");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F9",
- E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_to", "8");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F10",
- E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_to", "9");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F11",
- E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_to", "10");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F12",
- E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_to", "11");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "m",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "menu_show", "main");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "a",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "menu_show", "favorites");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Menu",
- 0, 0,
- "menu_show", "main");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Menu",
- E_BINDING_MODIFIER_CTRL, 0,
- "menu_show", "clients");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Menu",
- E_BINDING_MODIFIER_ALT, 0,
- "menu_show", "favorites");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Insert",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "exec", "terminology");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Tab",
- E_BINDING_MODIFIER_ALT, 0,
- "winlist", "next");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Tab",
- E_BINDING_MODIFIER_SHIFT | E_BINDING_MODIFIER_ALT, 0,
- "winlist", "prev");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "End",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "restart", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Delete",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "syscon", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Escape",
- E_BINDING_MODIFIER_ALT, 0,
- "everything", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "l",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "desk_lock", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "d",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_ALT, 0,
- "desk_deskshow_toggle", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F1",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_SHIFT, 0,
- "screen_send_to", "0");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F2",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_SHIFT, 0,
- "screen_send_to", "1");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F3",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_SHIFT, 0,
- "screen_send_to", "2");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "F4",
- E_BINDING_MODIFIER_CTRL | E_BINDING_MODIFIER_SHIFT, 0,
- "screen_send_to", "3");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86AudioLowerVolume",
- 0, 0,
- "volume_decrease", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86AudioRaiseVolume",
- 0, 0,
- "volume_increase", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86AudioMute",
- 0, 0,
- "volume_mute", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Print",
- 0, 0,
- "shot", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86Standby",
- 0, 0,
- "suspend", "now");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86Start",
- 0, 0,
- "menu_show", "all");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86PowerDown",
- 0, 0,
- "hibernate", "now");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86PowerOff",
- 0, 0,
- "halt", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86Sleep",
- 0, 0,
- "suspend", "now");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86Suspend",
- 0, 0,
- "suspend", "now");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86Hibernate",
- 0, 0,
- "hibernate", "now");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "Execute",
- 0, 0,
- "everything", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86MonBrightnessUp",
- 0, 0,
- "backlight_adjust", "0.1");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86MonBrightnessDown",
- 0, 0,
- "backlight_adjust", "-0.1");
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86LightBulb",
- 0, 0,
- "backlight", NULL);
- CFG_KEYBIND_DFLT(E_BINDING_CONTEXT_ANY, "XF86BrightnessAdjust",
- 0, 0,
- "backlight", NULL);
+ if (!ecb) return;
+ E_FREE_LIST(cfdata->binding.key, e_config_binding_key_free);
+ cfdata->binding.key = ecb->key_bindings, ecb->key_bindings = NULL;
+ e_config_bindings_free(ecb);
eina_stringshare_del(cfdata->locals.cur);
cfdata->locals.cur = NULL;
diff --git a/src/modules/conf_keybindings/e_int_config_mousebindings.c b/src/modules/conf_keybindings/e_int_config_mousebindings.c
index a4517f855..c2e818ba3 100644
--- a/src/modules/conf_keybindings/e_int_config_mousebindings.c
+++ b/src/modules/conf_keybindings/e_int_config_mousebindings.c
@@ -569,77 +569,27 @@ _delete_mouse_binding_cb(void *data, void *data2 __UNUSED__)
static void
_restore_mouse_binding_defaults_cb(void *data, void *data2 __UNUSED__)
{
- E_Config_Binding_Mouse *eb;
- E_Config_Binding_Wheel *bw;
- E_Config_Dialog_Data *cfdata;
+ E_Config_Bindings *ecb;
+ Eina_Stringshare *prof;
+ E_Config_Dialog_Data *cfdata = data;
- cfdata = data;
-
- EINA_LIST_FREE(cfdata->binding.mouse, eb)
+ ecb = e_config_domain_system_load("e_bindings", e_config_descriptor_find("E_Config_Bindings"));
+ if (!ecb)
{
- eina_stringshare_del(eb->action);
- eina_stringshare_del(eb->params);
- E_FREE(eb);
+ prof = eina_stringshare_ref(e_config_profile_get());
+ /* FIXME: need some type of parenting/typing system for profiles */
+ e_config_profile_set("standard");
+ ecb = e_config_domain_system_load("e_bindings", e_config_descriptor_find("E_Config_Bindings"));
+ e_config_profile_set(prof);
+ eina_stringshare_del(prof);
}
+ if (!ecb) return;
+ E_FREE_LIST(cfdata->binding.mouse, e_config_binding_mouse_free);
+ E_FREE_LIST(cfdata->binding.wheel, e_config_binding_wheel_free);
- EINA_LIST_FREE(cfdata->binding.wheel, bw)
- {
- if (bw->action) eina_stringshare_del(bw->action);
- if (bw->params) eina_stringshare_del(bw->params);
- E_FREE(bw);
- }
-#define CFG_MOUSEBIND_DFLT(_context, _button, _modifiers, _anymod, _action, _params) \
- eb = E_NEW(E_Config_Binding_Mouse, 1); \
- eb->context = _context; \
- eb->button = _button; \
- eb->modifiers = _modifiers; \
- eb->any_mod = _anymod; \
- eb->action = _action == NULL ? NULL : eina_stringshare_add(_action); \
- eb->params = _params == NULL ? NULL : eina_stringshare_add(_params); \
- cfdata->binding.mouse = eina_list_append(cfdata->binding.mouse, eb)
-
- CFG_MOUSEBIND_DFLT(E_BINDING_CONTEXT_WINDOW, 1, E_BINDING_MODIFIER_ALT, 0, "window_move", NULL);
- CFG_MOUSEBIND_DFLT(E_BINDING_CONTEXT_WINDOW, 2, E_BINDING_MODIFIER_ALT, 0, "window_resize", NULL);
- CFG_MOUSEBIND_DFLT(E_BINDING_CONTEXT_WINDOW, 3, E_BINDING_MODIFIER_ALT, 0, "window_menu", NULL);
- CFG_MOUSEBIND_DFLT(E_BINDING_CONTEXT_ZONE, 1, 0, 0, "menu_show", "main");
- CFG_MOUSEBIND_DFLT(E_BINDING_CONTEXT_ZONE, 2, 0, 0, "menu_show", "clients");
- CFG_MOUSEBIND_DFLT(E_BINDING_CONTEXT_ZONE, 3, 0, 0, "menu_show", "favorites");
-
-#define CFG_WHEELBIND_DFLT(_context, _direction, _z, _modifiers, _anymod, _action, _params) \
- bw = E_NEW(E_Config_Binding_Wheel, 1); \
- bw->context = _context; \
- bw->direction = _direction; \
- bw->z = _z; \
- bw->modifiers = _modifiers; \
- bw->any_mod = _anymod; \
- bw->action = _action == NULL ? NULL : eina_stringshare_add(_action); \
- bw->params = _params == NULL ? NULL : eina_stringshare_add(_params); \
- cfdata->binding.wheel = eina_list_append(cfdata->binding.wheel, bw)
-
- CFG_WHEELBIND_DFLT(E_BINDING_CONTEXT_CONTAINER, 0, -1, E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "-1");
- CFG_WHEELBIND_DFLT(E_BINDING_CONTEXT_CONTAINER, 1, -1, E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "-1");
- CFG_WHEELBIND_DFLT(E_BINDING_CONTEXT_CONTAINER, 0, 1, E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "1");
- CFG_WHEELBIND_DFLT(E_BINDING_CONTEXT_CONTAINER, 1, 1, E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "1");
- CFG_WHEELBIND_DFLT(E_BINDING_CONTEXT_WINDOW, 0, -1, E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "-1");
- CFG_WHEELBIND_DFLT(E_BINDING_CONTEXT_WINDOW, 1, -1, E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "-1");
- CFG_WHEELBIND_DFLT(E_BINDING_CONTEXT_WINDOW, 0, 1, E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "1");
- CFG_WHEELBIND_DFLT(E_BINDING_CONTEXT_WINDOW, 1, 1, E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "1");
- CFG_WHEELBIND_DFLT(E_BINDING_CONTEXT_POPUP, 0, -1, E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "-1");
- CFG_WHEELBIND_DFLT(E_BINDING_CONTEXT_POPUP, 1, -1, E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "-1");
- CFG_WHEELBIND_DFLT(E_BINDING_CONTEXT_POPUP, 0, 1, E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "1");
- CFG_WHEELBIND_DFLT(E_BINDING_CONTEXT_POPUP, 1, 1, E_BINDING_MODIFIER_ALT, 0,
- "desk_linear_flip_by", "1");
+ cfdata->binding.mouse = ecb->mouse_bindings, ecb->mouse_bindings = NULL;
+ cfdata->binding.wheel = ecb->wheel_bindings, ecb->wheel_bindings = NULL;
+ e_config_bindings_free(ecb);
eina_stringshare_del(cfdata->locals.cur);
cfdata->locals.cur = NULL;