forked from enlightenment/enlightenment
Add a Suspend Now command to actions so that on ACPI lid close, you
can do suspend without a confirmation dialog. Clear the Action Paramaters box when a binding or action changes. SVN revision: 56207
This commit is contained in:
parent
343f3737b1
commit
572970d903
|
@ -1563,7 +1563,7 @@ group "E_Config" struct {
|
||||||
value "context" int: 0;
|
value "context" int: 0;
|
||||||
value "type" int: 5;
|
value "type" int: 5;
|
||||||
value "status" int: 0;
|
value "status" int: 0;
|
||||||
value "action" string: "suspend";
|
value "action" string: "suspend_now";
|
||||||
value "params" string: "now";
|
value "params" string: "now";
|
||||||
}
|
}
|
||||||
group "E_Config_Binding_Acpi" struct {
|
group "E_Config_Binding_Acpi" struct {
|
||||||
|
@ -1577,7 +1577,7 @@ group "E_Config" struct {
|
||||||
value "context" int: 0;
|
value "context" int: 0;
|
||||||
value "type" int: 8;
|
value "type" int: 8;
|
||||||
value "status" int: -1;
|
value "status" int: -1;
|
||||||
value "action" string: "suspend";
|
value "action" string: "suspend_now";
|
||||||
value "params" string: "now";
|
value "params" string: "now";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2096,6 +2096,11 @@ _e_actions_cb_suspend_dialog_delete(E_Win *win)
|
||||||
_e_actions_cb_suspend_dialog_cancel(NULL, dia);
|
_e_actions_cb_suspend_dialog_cancel(NULL, dia);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ACT_FN_GO(suspend_now, __UNUSED__)
|
||||||
|
{
|
||||||
|
e_sys_action_do(E_SYS_SUSPEND, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
ACT_FN_GO(suspend, )
|
ACT_FN_GO(suspend, )
|
||||||
{
|
{
|
||||||
if ((params) && (!strcmp(params, "now")))
|
if ((params) && (!strcmp(params, "now")))
|
||||||
|
@ -2949,6 +2954,10 @@ e_actions_init(void)
|
||||||
e_action_predef_name_set(N_("System"), N_("Reboot"), "reboot",
|
e_action_predef_name_set(N_("System"), N_("Reboot"), "reboot",
|
||||||
NULL, NULL, 0);
|
NULL, NULL, 0);
|
||||||
|
|
||||||
|
ACT_GO(suspend_now);
|
||||||
|
e_action_predef_name_set(N_("System"), N_("Suspend Now"), "suspend_now",
|
||||||
|
NULL, NULL, 0);
|
||||||
|
|
||||||
ACT_GO(suspend);
|
ACT_GO(suspend);
|
||||||
e_action_predef_name_set(N_("System"), N_("Suspend"), "suspend",
|
e_action_predef_name_set(N_("System"), N_("Suspend"), "suspend",
|
||||||
NULL, NULL, 0);
|
NULL, NULL, 0);
|
||||||
|
|
|
@ -9,10 +9,10 @@
|
||||||
/* local config structure */
|
/* local config structure */
|
||||||
struct _E_Config_Dialog_Data
|
struct _E_Config_Dialog_Data
|
||||||
{
|
{
|
||||||
Eina_List *bindings;
|
Eina_List *bindings;
|
||||||
Evas_Object *o_bindings, *o_actions, *o_params;
|
Evas_Object *o_bindings, *o_actions, *o_params;
|
||||||
Evas_Object *o_add, *o_del;
|
Evas_Object *o_add, *o_del;
|
||||||
const char *bindex;
|
const char *bindex;
|
||||||
|
|
||||||
E_Config_Dialog *cfd;
|
E_Config_Dialog *cfd;
|
||||||
};
|
};
|
||||||
|
@ -330,12 +330,12 @@ _selected_action_get(E_Config_Dialog_Data *cfdata)
|
||||||
(strcmp(grp->act_grp, "Launch"))) continue;
|
(strcmp(grp->act_grp, "Launch"))) continue;
|
||||||
EINA_LIST_FOREACH(grp->acts, ll, dsc)
|
EINA_LIST_FOREACH(grp->acts, ll, dsc)
|
||||||
{
|
{
|
||||||
if ((dsc->act_name) && (!strcmp(dsc->act_name, lbl)))
|
if ((dsc->act_name) && (!strcmp(dsc->act_name, lbl)))
|
||||||
return dsc;
|
return dsc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return dsc;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *
|
static const char *
|
||||||
|
@ -386,9 +386,9 @@ _cb_bindings_changed(void *data)
|
||||||
int i = -1;
|
int i = -1;
|
||||||
|
|
||||||
if (!(cfdata = data)) return;
|
if (!(cfdata = data)) return;
|
||||||
|
e_widget_entry_clear(cfdata->o_params);
|
||||||
if (!(bind = _selected_binding_get(cfdata)))
|
if (!(bind = _selected_binding_get(cfdata)))
|
||||||
{
|
{
|
||||||
e_widget_entry_clear(cfdata->o_params);
|
|
||||||
e_widget_disabled_set(cfdata->o_params, EINA_TRUE);
|
e_widget_disabled_set(cfdata->o_params, EINA_TRUE);
|
||||||
e_widget_disabled_set(cfdata->o_del, EINA_TRUE);
|
e_widget_disabled_set(cfdata->o_del, EINA_TRUE);
|
||||||
return;
|
return;
|
||||||
|
@ -417,16 +417,15 @@ _cb_actions_changed(void *data)
|
||||||
E_Action_Description *dsc;
|
E_Action_Description *dsc;
|
||||||
|
|
||||||
if (!(cfdata = data)) return;
|
if (!(cfdata = data)) return;
|
||||||
|
e_widget_entry_clear(cfdata->o_params);
|
||||||
if (!(bind = _selected_binding_get(cfdata)))
|
if (!(bind = _selected_binding_get(cfdata)))
|
||||||
{
|
{
|
||||||
e_widget_entry_clear(cfdata->o_params);
|
|
||||||
e_widget_disabled_set(cfdata->o_params, EINA_TRUE);
|
e_widget_disabled_set(cfdata->o_params, EINA_TRUE);
|
||||||
e_widget_disabled_set(cfdata->o_del, EINA_TRUE);
|
e_widget_disabled_set(cfdata->o_del, EINA_TRUE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(dsc = _selected_action_get(cfdata)))
|
if (!(dsc = _selected_action_get(cfdata)))
|
||||||
{
|
{
|
||||||
e_widget_entry_clear(cfdata->o_params);
|
|
||||||
e_widget_disabled_set(cfdata->o_params, EINA_TRUE);
|
e_widget_disabled_set(cfdata->o_params, EINA_TRUE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue