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:
Christopher Michael 2011-01-17 17:25:42 +00:00
parent 343f3737b1
commit 572970d903
3 changed files with 19 additions and 11 deletions

View File

@ -1563,7 +1563,7 @@ group "E_Config" struct {
value "context" int: 0;
value "type" int: 5;
value "status" int: 0;
value "action" string: "suspend";
value "action" string: "suspend_now";
value "params" string: "now";
}
group "E_Config_Binding_Acpi" struct {
@ -1577,7 +1577,7 @@ group "E_Config" struct {
value "context" int: 0;
value "type" int: 8;
value "status" int: -1;
value "action" string: "suspend";
value "action" string: "suspend_now";
value "params" string: "now";
}
}

View File

@ -2096,6 +2096,11 @@ _e_actions_cb_suspend_dialog_delete(E_Win *win)
_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, )
{
if ((params) && (!strcmp(params, "now")))
@ -2949,6 +2954,10 @@ e_actions_init(void)
e_action_predef_name_set(N_("System"), N_("Reboot"), "reboot",
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);
e_action_predef_name_set(N_("System"), N_("Suspend"), "suspend",
NULL, NULL, 0);

View File

@ -9,10 +9,10 @@
/* local config structure */
struct _E_Config_Dialog_Data
{
Eina_List *bindings;
Evas_Object *o_bindings, *o_actions, *o_params;
Evas_Object *o_add, *o_del;
const char *bindex;
Eina_List *bindings;
Evas_Object *o_bindings, *o_actions, *o_params;
Evas_Object *o_add, *o_del;
const char *bindex;
E_Config_Dialog *cfd;
};
@ -330,12 +330,12 @@ _selected_action_get(E_Config_Dialog_Data *cfdata)
(strcmp(grp->act_grp, "Launch"))) continue;
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 NULL;
}
static const char *
@ -386,9 +386,9 @@ _cb_bindings_changed(void *data)
int i = -1;
if (!(cfdata = data)) return;
e_widget_entry_clear(cfdata->o_params);
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_del, EINA_TRUE);
return;
@ -417,16 +417,15 @@ _cb_actions_changed(void *data)
E_Action_Description *dsc;
if (!(cfdata = data)) return;
e_widget_entry_clear(cfdata->o_params);
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_del, EINA_TRUE);
return;
}
if (!(dsc = _selected_action_get(cfdata)))
{
e_widget_entry_clear(cfdata->o_params);
e_widget_disabled_set(cfdata->o_params, EINA_TRUE);
return;
}