summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
Diffstat (limited to 'boot')
-rw-r--r--boot/cedit.c24
-rw-r--r--boot/expo.c2
2 files changed, 22 insertions, 4 deletions
diff --git a/boot/cedit.c b/boot/cedit.c
index 5758cc5a0d6..cd935d4beba 100644
--- a/boot/cedit.c
+++ b/boot/cedit.c
@@ -154,7 +154,7 @@ int cedit_run(struct expo *exp)
struct video_priv *vid_priv;
uint scene_id;
struct scene *scn;
- bool done;
+ bool done, save;
int ret;
cli_ch_init(cch);
@@ -164,6 +164,7 @@ int cedit_run(struct expo *exp)
scene_id = ret;
done = false;
+ save = false;
do {
struct expo_action act;
int ichar, key;
@@ -208,6 +209,15 @@ int cedit_run(struct expo *exp)
case EXPOACT_OPEN:
scene_set_open(scn, act.select.id, true);
cedit_arange(exp, vid_priv, scene_id);
+ switch (scn->highlight_id) {
+ case EXPOID_SAVE:
+ done = true;
+ save = true;
+ break;
+ case EXPOID_DISCARD:
+ done = true;
+ break;
+ }
break;
case EXPOACT_CLOSE:
scene_set_open(scn, act.select.id, false);
@@ -229,6 +239,8 @@ int cedit_run(struct expo *exp)
if (ret)
return log_msg_ret("end", ret);
+ if (!save)
+ return -EACCES;
return 0;
}
@@ -477,6 +489,9 @@ static int h_write_settings_env(struct scene_obj *obj, void *vpriv)
const char *str;
int val, ret;
+ if (obj->id < EXPOID_BASE_ID)
+ return 0;
+
snprintf(var, sizeof(var), "c.%s", obj->name);
switch (obj->type) {
@@ -549,6 +564,9 @@ static int h_read_settings_env(struct scene_obj *obj, void *vpriv)
char var[60];
int val;
+ if (obj->id < EXPOID_BASE_ID)
+ return 0;
+
snprintf(var, sizeof(var), "c.%s", obj->name);
switch (obj->type) {
@@ -644,7 +662,7 @@ static int h_write_settings_cmos(struct scene_obj *obj, void *vpriv)
int val, ret;
uint i, seq;
- if (obj->type != SCENEOBJT_MENU)
+ if (obj->type != SCENEOBJT_MENU || obj->id < EXPOID_BASE_ID)
return 0;
menu = (struct scene_obj_menu *)obj;
@@ -734,7 +752,7 @@ static int h_read_settings_cmos(struct scene_obj *obj, void *vpriv)
int val, ret;
uint i;
- if (obj->type != SCENEOBJT_MENU)
+ if (obj->type != SCENEOBJT_MENU || obj->id < EXPOID_BASE_ID)
return 0;
menu = (struct scene_obj_menu *)obj;
diff --git a/boot/expo.c b/boot/expo.c
index 700786ec0cc..786f665f53c 100644
--- a/boot/expo.c
+++ b/boot/expo.c
@@ -29,7 +29,7 @@ int expo_new(const char *name, void *priv, struct expo **expp)
exp->priv = priv;
INIT_LIST_HEAD(&exp->scene_head);
INIT_LIST_HEAD(&exp->str_head);
- exp->next_id = 1;
+ exp->next_id = EXPOID_BASE_ID;
*expp = exp;