mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-12-23 13:04:15 +02:00
eeshow/: retrieve title from *.sch; prefer over subsheet name when displaying
This commit is contained in:
parent
1057f2640b
commit
258876ef2c
@ -389,9 +389,13 @@ static void select_subsheet(void *user)
|
||||
|
||||
for (sheet = ctx->sheets; sheet; sheet = sheet->next)
|
||||
if (sheet->sch == obj->u.sheet.sheet) {
|
||||
const char *name;
|
||||
|
||||
sheet->prev = ctx->curr_sheet;
|
||||
set_sheet(ctx, sheet);
|
||||
overlay_add(&ctx->overlays, obj->u.sheet.name,
|
||||
name = sheet->sch->title ? sheet->sch->title :
|
||||
obj->u.sheet.name;
|
||||
overlay_add(&ctx->overlays, name,
|
||||
&ctx->aois, NULL, close_subsheet, ctx);
|
||||
return;
|
||||
}
|
||||
|
@ -283,6 +283,7 @@ static struct sheet *new_sheet(struct sch_ctx *ctx)
|
||||
struct sheet *sheet;
|
||||
|
||||
sheet = alloc_type(struct sheet);
|
||||
sheet->title = NULL;
|
||||
sheet->objs = NULL;
|
||||
sheet->next_obj = &sheet->objs;
|
||||
sheet->next = NULL;
|
||||
@ -441,6 +442,10 @@ static bool parse_line(const struct file *file, void *user, const char *line)
|
||||
return 0;
|
||||
break;
|
||||
case sch_descr:
|
||||
if (sscanf(line, "Title \"%m[^\"]\"", &s) == 1) {
|
||||
ctx->curr_sheet->title = s;
|
||||
return 1;
|
||||
}
|
||||
if (sscanf(line, "$EndDescr%n", &n) || !n)
|
||||
return 1;
|
||||
ctx->state = sch_basic;
|
||||
|
@ -91,6 +91,7 @@ struct sch_obj {
|
||||
};
|
||||
|
||||
struct sheet {
|
||||
const char *title;
|
||||
struct sch_obj *objs;
|
||||
struct sch_obj **next_obj;
|
||||
struct sheet *parent;
|
||||
|
Loading…
Reference in New Issue
Block a user