new exercise in unit 1, vocabulary training

This commit is contained in:
Martin Dvořák 2026-09-11 14:15:58 +02:00
commit 2782446b89
7 changed files with 539 additions and 5 deletions

12
main.c
View file

@ -31,6 +31,12 @@ void unit_meta_init(void) {
units[1].progress_file = PROGRESS_U2;
units[2].sub_key = "unit3_sub";
units[2].progress_file = PROGRESS_U3;
/* Off-path branch hanging above exercise 2 of unit 1. */
units[0].has_branch = TRUE;
units[0].branch_name = "Vokabeltraining";
units[0].branch_target = "u1vocab";
units[0].branch_ex = MAX_UNIT_EX;
}
void unit_configure(int idx, const char *const *names, int n) {
@ -183,6 +189,12 @@ void activate(GtkApplication *app, gpointer user_data) {
g_snprintf(name, sizeof(name), "%se%d", u->ex_tag, n);
gtk_stack_add_named(main_stack, page, name);
}
if (u->has_branch && u->branch_target) {
GtkWidget *branch = build_translate(u);
if (branch)
gtk_stack_add_named(main_stack, branch, u->branch_target);
}
}
gtk_stack_set_visible_child_name(main_stack, "welcome");