mirror of
https://github.com/pepaskopec-blip/Graduately.git
synced 2026-10-27 15:14:35 +00:00
Add year-1 civics lessons on life in a community and keep later years locked.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
b17232112d
commit
515abdc6ce
28 changed files with 2665 additions and 12 deletions
|
|
@ -19,6 +19,7 @@
|
|||
#define NET_SUBJ 1 /* index of "Správa počítačových sítí" */
|
||||
#define HW_SUBJ 2 /* index of "Technické vybavení" */
|
||||
#define CZ_SUBJ 3 /* index of "Český jazyk a literatura" */
|
||||
#define ON_SUBJ 4 /* index of "Občanská nauka" */
|
||||
#define CSS_FILE "style.css"
|
||||
#define CHANGELOG_FILE "changelog.txt"
|
||||
#define APP_ID "org.maturita.Maturita"
|
||||
|
|
@ -48,6 +49,7 @@ extern char *app_progress_u3;
|
|||
extern char *app_settings_file;
|
||||
extern char *app_progress_net;
|
||||
extern char *app_progress_hw;
|
||||
extern char *app_progress_on;
|
||||
extern char *app_progress_mluvnice;
|
||||
extern char *app_progress_cetba;
|
||||
#define PROGRESS_DIR app_progress_dir
|
||||
|
|
@ -57,6 +59,7 @@ extern char *app_progress_cetba;
|
|||
#define SETTINGS_FILE app_settings_file
|
||||
#define PROGRESS_NET app_progress_net
|
||||
#define PROGRESS_HW app_progress_hw
|
||||
#define PROGRESS_ON app_progress_on
|
||||
#define NODE_SIZE 88.0
|
||||
#define PATH_SPAC 240.0
|
||||
#define ROAD_MX 150.0 /* horizontal canvas margin */
|
||||
|
|
@ -114,6 +117,8 @@ extern char *app_progress_cetba;
|
|||
#define NET_LESSONS 27
|
||||
#define HW_UNITS 29
|
||||
#define HW_LESSONS 29
|
||||
#define ON_UNITS 17
|
||||
#define ON_LESSONS 17
|
||||
#define HW_SLIDES 3
|
||||
#define HW2_SLIDES 6
|
||||
#define HW3_SLIDES 2
|
||||
|
|
@ -754,6 +759,8 @@ extern NetLesson net_lessons[NET_LESSONS];
|
|||
extern NetLesson *net_notes_target;
|
||||
extern NetLesson hw_lessons[HW_LESSONS];
|
||||
extern GtkWidget *hw_nodes[HW_UNITS];
|
||||
extern NetLesson on_lessons[ON_LESSONS];
|
||||
extern GtkWidget *on_nodes[ON_UNITS];
|
||||
extern GtkWidget *net_note_host;
|
||||
extern int net_note_last_w;
|
||||
extern GtkWidget *net_scroll;
|
||||
|
|
@ -841,6 +848,16 @@ void mark_hw_done(int lesson_id);
|
|||
void refresh_hw_completion_ui(void);
|
||||
void progress_for_hw(ProgressSum *out);
|
||||
void hw_rail_theme_reset(void);
|
||||
void on_load_progress(void);
|
||||
void on_save_progress(void);
|
||||
void mark_on_done(int lesson_id);
|
||||
void refresh_on_completion_ui(void);
|
||||
void progress_for_on(ProgressSum *out);
|
||||
void on_rail_theme_reset(void);
|
||||
void on_lessons_apply_lang(void);
|
||||
GtkWidget *build_onyears_page(void);
|
||||
GtkWidget *build_onmap_page(void);
|
||||
void add_on_pages(GtkStack *stack);
|
||||
void czech_rail_theme_reset(void);
|
||||
void hw_lessons_apply_lang(void);
|
||||
GtkWidget *build_hwyears_page(void);
|
||||
|
|
@ -927,6 +944,8 @@ GtkWidget *build_hw_unit29_page(void);
|
|||
GtkWidget *build_hw_unit29_exercise_page(void);
|
||||
void draw_chip_icon(GtkDrawingArea *area, cairo_t *cr,
|
||||
int width, int height, gpointer data);
|
||||
void draw_civics_icon(GtkDrawingArea *area, cairo_t *cr,
|
||||
int width, int height, gpointer data);
|
||||
void draw_czech_flag(GtkDrawingArea *area, cairo_t *cr,
|
||||
int width, int height, gpointer data);
|
||||
void draw_book_icon(GtkDrawingArea *area, cairo_t *cr,
|
||||
|
|
|
|||
106
src/i18n.c
106
src/i18n.c
|
|
@ -700,6 +700,110 @@ const TrEntry tr_ui[] = {
|
|||
"Quiz: game controls and touch"},
|
||||
{"hw_quiz29_head", "Kvíz k herním ovladačům a dotyku",
|
||||
"Quiz on game controls and touch"},
|
||||
{"on_sub", "Člověk v lidském společenství. Vyberte lekci na cestě.",
|
||||
"The individual and society. Pick a lesson on the path."},
|
||||
{"on_years_sub", "Vyberte ročník a začněte procvičovat.",
|
||||
"Pick a school year and start practicing."},
|
||||
{"on_year1", "1. ročník", "Year 1"},
|
||||
{"on_year2", "2. ročník", "Year 2"},
|
||||
{"on_year3", "3. ročník", "Year 3"},
|
||||
{"on_year4", "4. ročník", "Year 4"},
|
||||
{"on_year_locked_sub", "Zatím bez obsahu", "No content yet"},
|
||||
{"on_unit1", "Výchova k občanství", "Civics"},
|
||||
{"on_unit1_sub", "2 snímky o smyslu předmětu a pak kvíz.",
|
||||
"2 slides on what the subject is for, then a quiz."},
|
||||
{"on_ex1_title", "Kvíz: výchova k občanství", "Quiz: civics"},
|
||||
{"on_quiz1_head", "Kvíz k výchově k občanství", "Quiz on civics"},
|
||||
{"on_unit2", "Učení a volný čas", "Learning and free time"},
|
||||
{"on_unit2_sub", "2 snímky o učení a volném čase a pak kvíz.",
|
||||
"2 slides on learning and free time, then a quiz."},
|
||||
{"on_ex2_title", "Kvíz: učení a volný čas", "Quiz: learning and free time"},
|
||||
{"on_quiz2_head", "Kvíz k učení a volnému času",
|
||||
"Quiz on learning and free time"},
|
||||
{"on_unit3", "Osobnost člověka", "Personality"},
|
||||
{"on_unit3_sub", "2 snímky o osobnosti a socializaci a pak kvíz.",
|
||||
"2 slides on personality and socialisation, then a quiz."},
|
||||
{"on_ex3_title", "Kvíz: osobnost člověka", "Quiz: personality"},
|
||||
{"on_quiz3_head", "Kvíz k osobnosti", "Quiz on personality"},
|
||||
{"on_unit4", "Etapy lidského života", "Stages of life"},
|
||||
{"on_unit4_sub", "2 snímky o etapách života a pak kvíz.",
|
||||
"2 slides on the stages of life, then a quiz."},
|
||||
{"on_ex4_title", "Kvíz: etapy života", "Quiz: stages of life"},
|
||||
{"on_quiz4_head", "Kvíz k etapám života", "Quiz on the stages of life"},
|
||||
{"on_unit5", "Psychohygiena", "Mental hygiene"},
|
||||
{"on_unit5_sub", "2 snímky o náročných situacích a psychohygieně a pak kvíz.",
|
||||
"2 slides on hard situations and mental hygiene, then a quiz."},
|
||||
{"on_ex5_title", "Kvíz: psychohygiena", "Quiz: mental hygiene"},
|
||||
{"on_quiz5_head", "Kvíz k psychohygieně", "Quiz on mental hygiene"},
|
||||
{"on_unit6", "Slušné chování", "Good manners"},
|
||||
{"on_unit6_sub", "2 snímky o etiketě a vztazích a pak kvíz.",
|
||||
"2 slides on manners and relationships, then a quiz."},
|
||||
{"on_ex6_title", "Kvíz: slušné chování", "Quiz: good manners"},
|
||||
{"on_quiz6_head", "Kvíz ke slušnému chování", "Quiz on good manners"},
|
||||
{"on_unit7", "Komunikace a konflikty", "Communication and conflict"},
|
||||
{"on_unit7_sub", "2 snímky o komunikaci a konfliktech a pak kvíz.",
|
||||
"2 slides on communication and conflict, then a quiz."},
|
||||
{"on_ex7_title", "Kvíz: komunikace a konflikty",
|
||||
"Quiz: communication and conflict"},
|
||||
{"on_quiz7_head", "Kvíz ke komunikaci a konfliktům",
|
||||
"Quiz on communication and conflict"},
|
||||
{"on_unit8", "Zdraví a životní styl", "Health and lifestyle"},
|
||||
{"on_unit8_sub", "2 snímky o zdraví a životním stylu a pak kvíz.",
|
||||
"2 slides on health and lifestyle, then a quiz."},
|
||||
{"on_ex8_title", "Kvíz: zdraví a životní styl", "Quiz: health and lifestyle"},
|
||||
{"on_quiz8_head", "Kvíz ke zdraví a životnímu stylu",
|
||||
"Quiz on health and lifestyle"},
|
||||
{"on_unit9", "Závislosti", "Addictions"},
|
||||
{"on_unit9_sub", "2 snímky o závislostech a pomoci a pak kvíz.",
|
||||
"2 slides on addictions and where to get help, then a quiz."},
|
||||
{"on_ex9_title", "Kvíz: závislosti", "Quiz: addictions"},
|
||||
{"on_quiz9_head", "Kvíz k závislostem", "Quiz on addictions"},
|
||||
{"on_unit10", "Rodina a sociální skupiny", "Family and social groups"},
|
||||
{"on_unit10_sub", "2 snímky o skupinách a rodině a pak kvíz.",
|
||||
"2 slides on groups and the family, then a quiz."},
|
||||
{"on_ex10_title", "Kvíz: rodina a skupiny", "Quiz: family and groups"},
|
||||
{"on_quiz10_head", "Kvíz k rodině a sociálním skupinám",
|
||||
"Quiz on the family and social groups"},
|
||||
{"on_unit11", "Komunita, dav a veřejnost", "Community, crowd and the public"},
|
||||
{"on_unit11_sub", "2 snímky o komunitě, davu a veřejnosti a pak kvíz.",
|
||||
"2 slides on community, crowds and the public, then a quiz."},
|
||||
{"on_ex11_title", "Kvíz: komunita a dav", "Quiz: community and crowds"},
|
||||
{"on_quiz11_head", "Kvíz ke komunitě, davu a veřejnosti",
|
||||
"Quiz on community, crowds and the public"},
|
||||
{"on_unit12", "Vrstevníci a migrace", "Peers and migration"},
|
||||
{"on_unit12_sub", "2 snímky o vrstevnících, solidaritě a migraci a pak kvíz.",
|
||||
"2 slides on peers, solidarity and migration, then a quiz."},
|
||||
{"on_ex12_title", "Kvíz: vrstevníci a migrace", "Quiz: peers and migration"},
|
||||
{"on_quiz12_head", "Kvíz k vrstevníkům a migraci",
|
||||
"Quiz on peers and migration"},
|
||||
{"on_unit13", "Společnost a nerovnost", "Society and inequality"},
|
||||
{"on_unit13_sub", "2 snímky o společnosti, vrstvách a chudobě a pak kvíz.",
|
||||
"2 slides on society, strata and poverty, then a quiz."},
|
||||
{"on_ex13_title", "Kvíz: společnost a nerovnost",
|
||||
"Quiz: society and inequality"},
|
||||
{"on_quiz13_head", "Kvíz ke společnosti a nerovnosti",
|
||||
"Quiz on society and inequality"},
|
||||
{"on_unit14", "Postavení mužů a žen", "Men, women and equality"},
|
||||
{"on_unit14_sub", "2 snímky o rovnosti a genderu a pak kvíz.",
|
||||
"2 slides on equality and gender, then a quiz."},
|
||||
{"on_ex14_title", "Kvíz: postavení mužů a žen", "Quiz: men, women and equality"},
|
||||
{"on_quiz14_head", "Kvíz k postavení mužů a žen",
|
||||
"Quiz on men, women and equality"},
|
||||
{"on_unit15", "Kultura", "Culture"},
|
||||
{"on_unit15_sub", "2 snímky o hmotné a duchovní kultuře a pak kvíz.",
|
||||
"2 slides on material and non-material culture, then a quiz."},
|
||||
{"on_ex15_title", "Kvíz: kultura", "Quiz: culture"},
|
||||
{"on_quiz15_head", "Kvíz ke kultuře", "Quiz on culture"},
|
||||
{"on_unit16", "Víra a náboženství", "Faith and religion"},
|
||||
{"on_unit16_sub", "2 snímky o víře, církvích a sektách a pak kvíz.",
|
||||
"2 slides on faith, churches and sects, then a quiz."},
|
||||
{"on_ex16_title", "Kvíz: víra a náboženství", "Quiz: faith and religion"},
|
||||
{"on_quiz16_head", "Kvíz k víře a náboženství", "Quiz on faith and religion"},
|
||||
{"on_unit17", "Rozpočet domácnosti", "Household budget"},
|
||||
{"on_unit17_sub", "2 snímky o rozpočtu a finanční tísni a pak kvíz.",
|
||||
"2 slides on the household budget and money trouble, then a quiz."},
|
||||
{"on_ex17_title", "Kvíz: rozpočet domácnosti", "Quiz: household budget"},
|
||||
{"on_quiz17_head", "Kvíz k rozpočtu domácnosti", "Quiz on the household budget"},
|
||||
{"czech_sub", "Vyberte oblast a začněte procvičovat.",
|
||||
"Pick an area and start practicing."},
|
||||
{"Literatura", "Literatura", "Literature"},
|
||||
|
|
@ -1723,6 +1827,7 @@ void refresh_welcome_heading(void) {
|
|||
void refresh_stats_ui(void);
|
||||
void net_lessons_apply_lang(void);
|
||||
void hw_lessons_apply_lang(void);
|
||||
void on_lessons_apply_lang(void);
|
||||
void net_rail_theme_reset(void);
|
||||
|
||||
void apply_language(void) {
|
||||
|
|
@ -1737,5 +1842,6 @@ void apply_language(void) {
|
|||
changelog_apply_lang();
|
||||
net_lessons_apply_lang();
|
||||
hw_lessons_apply_lang();
|
||||
on_lessons_apply_lang();
|
||||
search_apply_lang();
|
||||
}
|
||||
|
|
|
|||
46
src/icons.c
46
src/icons.c
|
|
@ -142,6 +142,52 @@ void draw_chip_icon(GtkDrawingArea *area, cairo_t *cr,
|
|||
}
|
||||
}
|
||||
|
||||
/* Balance scale for Občanská nauka. */
|
||||
void draw_civics_icon(GtkDrawingArea *area, cairo_t *cr,
|
||||
int width, int height, gpointer data) {
|
||||
const double s = MIN(width, height);
|
||||
const double cx = width / 2.0;
|
||||
const double top = height / 2.0 - s * 0.34;
|
||||
const double beam_y = top + s * 0.22;
|
||||
const double half = s * 0.28;
|
||||
const Rgb c = mix_rgb(color_from_hex(app_theme.on_accent),
|
||||
color_from_hex(app_theme.accent2), 0.22);
|
||||
|
||||
(void)area;
|
||||
(void)data;
|
||||
|
||||
cairo_set_source_rgb(cr, c.r, c.g, c.b);
|
||||
cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
|
||||
cairo_set_line_width(cr, MAX(1.6, s * 0.07));
|
||||
|
||||
cairo_move_to(cr, cx, top);
|
||||
cairo_line_to(cr, cx, top + s * 0.62);
|
||||
cairo_stroke(cr);
|
||||
|
||||
cairo_move_to(cr, cx - half, beam_y);
|
||||
cairo_line_to(cr, cx + half, beam_y);
|
||||
cairo_stroke(cr);
|
||||
|
||||
cairo_set_line_width(cr, MAX(1.4, s * 0.05));
|
||||
cairo_move_to(cr, cx - half, beam_y);
|
||||
cairo_line_to(cr, cx - half, beam_y + s * 0.16);
|
||||
cairo_move_to(cr, cx + half, beam_y);
|
||||
cairo_line_to(cr, cx + half, beam_y + s * 0.16);
|
||||
cairo_stroke(cr);
|
||||
|
||||
cairo_new_path(cr);
|
||||
cairo_arc(cr, cx - half, beam_y + s * 0.24, s * 0.11, 0.15 * G_PI, 0.85 * G_PI);
|
||||
cairo_stroke(cr);
|
||||
cairo_new_path(cr);
|
||||
cairo_arc(cr, cx + half, beam_y + s * 0.24, s * 0.11, 0.15 * G_PI, 0.85 * G_PI);
|
||||
cairo_stroke(cr);
|
||||
|
||||
cairo_set_line_width(cr, MAX(1.8, s * 0.08));
|
||||
cairo_move_to(cr, cx - s * 0.16, top + s * 0.66);
|
||||
cairo_line_to(cr, cx + s * 0.16, top + s * 0.66);
|
||||
cairo_stroke(cr);
|
||||
}
|
||||
|
||||
/* Open book glyph, painted in the given colour. */
|
||||
static void book_paint(cairo_t *cr, int width, int height, Rgb c) {
|
||||
const double w = width;
|
||||
|
|
|
|||
|
|
@ -385,7 +385,8 @@ static gboolean shot_later(gpointer data) {
|
|||
static gboolean run_smoke_test(gpointer data) {
|
||||
static const char *pages[] = {
|
||||
"welcome", "subjects", "roadmap", "stats",
|
||||
"netyears", "netmap", "hwyears", "hwmap", "czechmap",
|
||||
"netyears", "netmap", "hwyears", "hwmap", "onyears", "onmap",
|
||||
"czechmap",
|
||||
"mluvnice", "readinglist",
|
||||
"cetba1984", "cetba1984quiz", "cetba1984dej",
|
||||
"cetbaFuks", "cetbaFuksQuiz", "cetbaFuksDej",
|
||||
|
|
@ -396,6 +397,7 @@ static gboolean run_smoke_test(gpointer data) {
|
|||
"hwunit10", "hwex10", "hwunit15", "hwex15",
|
||||
"hwunit20", "hwex20", "hwunit25", "hwex25",
|
||||
"hwunit29", "hwex29",
|
||||
"onunit1", "onex1", "onunit17", "onex17",
|
||||
"unit1", "unit2", "unit3",
|
||||
"u1e1", "u1e13", "u2e1", "u2e19", "u3e1", "u3e15",
|
||||
"u1vocab", "u2vocab", "u3vocab",
|
||||
|
|
@ -506,6 +508,9 @@ void activate(GtkApplication *app, gpointer user_data) {
|
|||
gtk_stack_add_named(main_stack, build_netmap_page(), "netmap");
|
||||
gtk_stack_add_named(main_stack, build_hwyears_page(), "hwyears");
|
||||
gtk_stack_add_named(main_stack, build_hwmap_page(), "hwmap");
|
||||
gtk_stack_add_named(main_stack, build_onyears_page(), "onyears");
|
||||
gtk_stack_add_named(main_stack, build_onmap_page(), "onmap");
|
||||
add_on_pages(main_stack);
|
||||
gtk_stack_add_named(main_stack, build_czechmap_page(), "czechmap");
|
||||
gtk_stack_add_named(main_stack, build_mluvnice_page(), "mluvnice");
|
||||
for (int n = 1; n <= 20; n++) {
|
||||
|
|
|
|||
2114
src/obcanka.c
Normal file
2114
src/obcanka.c
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -54,6 +54,7 @@ void load_progress(void) {
|
|||
unit_load_progress(&units[i]);
|
||||
net_load_progress();
|
||||
hw_load_progress();
|
||||
on_load_progress();
|
||||
}
|
||||
|
||||
/* Redraw the exercise rails of every unit that already has a page. */
|
||||
|
|
@ -341,3 +342,94 @@ void progress_for_hw(ProgressSum *out) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void on_load_progress(void) {
|
||||
GKeyFile *kf = g_key_file_new();
|
||||
GError *err = NULL;
|
||||
|
||||
if (!g_key_file_load_from_file(kf, PROGRESS_ON, G_KEY_FILE_NONE, &err)) {
|
||||
if (err)
|
||||
g_error_free(err);
|
||||
g_key_file_free(kf);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ON_LESSONS; i++) {
|
||||
gchar key[8];
|
||||
|
||||
g_snprintf(key, sizeof(key), "%d", i + 1);
|
||||
on_lessons[i].done = g_key_file_get_boolean(kf, "done", key, NULL);
|
||||
}
|
||||
|
||||
g_key_file_free(kf);
|
||||
}
|
||||
|
||||
void on_save_progress(void) {
|
||||
GKeyFile *kf = g_key_file_new();
|
||||
|
||||
for (int i = 0; i < ON_LESSONS; i++) {
|
||||
gchar key[8];
|
||||
|
||||
g_snprintf(key, sizeof(key), "%d", i + 1);
|
||||
g_key_file_set_boolean(kf, "done", key, on_lessons[i].done);
|
||||
}
|
||||
|
||||
if (g_mkdir_with_parents(PROGRESS_DIR, 0755) != 0) {
|
||||
g_key_file_free(kf);
|
||||
return;
|
||||
}
|
||||
|
||||
gchar *data = g_key_file_to_data(kf, NULL, NULL);
|
||||
g_key_file_free(kf);
|
||||
|
||||
if (data) {
|
||||
GError *err = NULL;
|
||||
g_file_set_contents(PROGRESS_ON, data, -1, &err);
|
||||
if (err)
|
||||
g_error_free(err);
|
||||
g_free(data);
|
||||
}
|
||||
}
|
||||
|
||||
void refresh_on_completion_ui(void) {
|
||||
for (int i = 0; i < ON_LESSONS; i++) {
|
||||
GtkWidget *node = on_nodes[i];
|
||||
GtkWidget *icon = on_lessons[i].done_icon;
|
||||
|
||||
if (!node)
|
||||
continue;
|
||||
if (on_lessons[i].done) {
|
||||
gtk_widget_remove_css_class(node, "current");
|
||||
gtk_widget_add_css_class(node, "done");
|
||||
if (icon)
|
||||
gtk_widget_set_visible(icon, TRUE);
|
||||
} else {
|
||||
gtk_widget_remove_css_class(node, "done");
|
||||
gtk_widget_add_css_class(node, "current");
|
||||
if (icon)
|
||||
gtk_widget_set_visible(icon, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void mark_on_done(int lesson_id) {
|
||||
if (lesson_id < 0 || lesson_id >= ON_LESSONS)
|
||||
return;
|
||||
if (on_lessons[lesson_id].done)
|
||||
return;
|
||||
on_lessons[lesson_id].done = TRUE;
|
||||
on_save_progress();
|
||||
refresh_on_completion_ui();
|
||||
refresh_stats_ui();
|
||||
}
|
||||
|
||||
void progress_for_on(ProgressSum *out) {
|
||||
out->total_ex += ON_LESSONS;
|
||||
out->open_units += ON_LESSONS;
|
||||
for (int i = 0; i < ON_LESSONS; i++) {
|
||||
if (on_lessons[i].done) {
|
||||
out->done_ex++;
|
||||
out->done_units++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
17
src/search.c
17
src/search.c
|
|
@ -22,7 +22,8 @@ static GtkWidget *search_empty;
|
|||
static GPtrArray *search_items;
|
||||
|
||||
static gboolean subject_open(int i) {
|
||||
return i == 0 || i == NET_SUBJ || i == HW_SUBJ || i == CZ_SUBJ;
|
||||
return i == 0 || i == NET_SUBJ || i == HW_SUBJ || i == CZ_SUBJ
|
||||
|| i == ON_SUBJ;
|
||||
}
|
||||
|
||||
static const char *subject_page(int i) {
|
||||
|
|
@ -34,6 +35,8 @@ static const char *subject_page(int i) {
|
|||
return "hwyears";
|
||||
if (i == CZ_SUBJ)
|
||||
return "czechmap";
|
||||
if (i == ON_SUBJ)
|
||||
return "onyears";
|
||||
return "subjects";
|
||||
}
|
||||
|
||||
|
|
@ -199,6 +202,18 @@ static void catalog_rebuild(void) {
|
|||
catalog_add(tr(key), tr("search_exercise"), page, FALSE, 3, "kviz quiz");
|
||||
}
|
||||
|
||||
catalog_add_key("on_year1", "search_lesson", "onmap", FALSE, 1, "rocnik");
|
||||
catalog_add_key("on_year2", "search_lesson", "onyears", TRUE, 1, "rocnik");
|
||||
catalog_add_key("on_year3", "search_lesson", "onyears", TRUE, 1, "rocnik");
|
||||
catalog_add_key("on_year4", "search_lesson", "onyears", TRUE, 1, "rocnik");
|
||||
for (i = 1; i <= ON_LESSONS; i++) {
|
||||
g_snprintf(key, sizeof(key), "on_unit%d", i);
|
||||
g_snprintf(page, sizeof(page), "onunit%d", i);
|
||||
catalog_add_key(key, "search_lesson", page, FALSE, 2, "obcanka");
|
||||
g_snprintf(page, sizeof(page), "onex%d", i);
|
||||
catalog_add(tr(key), tr("search_exercise"), page, FALSE, 3, "kviz quiz");
|
||||
}
|
||||
|
||||
catalog_add_key("Český jazyk a literatura", "search_subject",
|
||||
"czechmap", FALSE, 0, "cestina czech");
|
||||
catalog_add_key("Literatura", "search_lesson", "czechmap", TRUE, 1, NULL);
|
||||
|
|
|
|||
|
|
@ -69,6 +69,8 @@ void refresh_stats_ui(void) {
|
|||
progress_for_net(&all);
|
||||
else if (s == HW_SUBJ)
|
||||
progress_for_hw(&all);
|
||||
else if (s == ON_SUBJ)
|
||||
progress_for_on(&all);
|
||||
else if (s == CZ_SUBJ)
|
||||
progress_for_mluvnice(&all);
|
||||
else
|
||||
|
|
@ -100,7 +102,8 @@ void refresh_stats_ui(void) {
|
|||
GtkWidget *bar = stats_ui.subj[s].bar;
|
||||
ProgressSum sp = {0};
|
||||
gboolean has_content = (s == NET_SUBJ) || (s == HW_SUBJ)
|
||||
|| (s == CZ_SUBJ) || sub_unit_count[s] > 0;
|
||||
|| (s == ON_SUBJ) || (s == CZ_SUBJ)
|
||||
|| sub_unit_count[s] > 0;
|
||||
|
||||
if (!count || !bar)
|
||||
continue;
|
||||
|
|
@ -108,6 +111,8 @@ void refresh_stats_ui(void) {
|
|||
progress_for_net(&sp);
|
||||
else if (s == HW_SUBJ)
|
||||
progress_for_hw(&sp);
|
||||
else if (s == ON_SUBJ)
|
||||
progress_for_on(&sp);
|
||||
else if (s == CZ_SUBJ)
|
||||
progress_for_mluvnice(&sp);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
/* Subjects page — icon grid, one tile per subject */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
/* Index 0 (Deutsch), NET_SUBJ (networks), HW_SUBJ (hardware) and CZ_SUBJ
|
||||
* (Czech) are unlocked. */
|
||||
/* Index 0 (Deutsch), NET_SUBJ (networks), HW_SUBJ (hardware), CZ_SUBJ
|
||||
* (Czech) and ON_SUBJ (civics) are unlocked. */
|
||||
const char *sub_keys[NUM_SUBJECTS] = {
|
||||
"Deutsch",
|
||||
"Správa počítačových sítí",
|
||||
|
|
@ -153,7 +153,8 @@ void draw_czech_flag(GtkDrawingArea *area, cairo_t *cr,
|
|||
}
|
||||
|
||||
static gboolean subject_is_open(int i) {
|
||||
return i == 0 || i == NET_SUBJ || i == HW_SUBJ || i == CZ_SUBJ;
|
||||
return i == 0 || i == NET_SUBJ || i == HW_SUBJ || i == CZ_SUBJ
|
||||
|| i == ON_SUBJ;
|
||||
}
|
||||
|
||||
static GtkWidget *subject_icon(int i) {
|
||||
|
|
@ -173,6 +174,9 @@ static GtkWidget *subject_icon(int i) {
|
|||
else if (i == CZ_SUBJ)
|
||||
gtk_drawing_area_set_draw_func(GTK_DRAWING_AREA(area),
|
||||
draw_czech_flag, NULL, NULL);
|
||||
else if (i == ON_SUBJ)
|
||||
gtk_drawing_area_set_draw_func(GTK_DRAWING_AREA(area),
|
||||
draw_civics_icon, NULL, NULL);
|
||||
else
|
||||
return icon_area_new(draw_lock_icon, 0.3451, 0.3569, 0.4392, 22);
|
||||
return area;
|
||||
|
|
@ -187,6 +191,8 @@ static const char *subject_target(int i) {
|
|||
return "hwyears";
|
||||
if (i == CZ_SUBJ)
|
||||
return "czechmap";
|
||||
if (i == ON_SUBJ)
|
||||
return "onyears";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -426,6 +426,7 @@ void apply_theme(void) {
|
|||
}
|
||||
net_rail_theme_reset();
|
||||
hw_rail_theme_reset();
|
||||
on_rail_theme_reset();
|
||||
czech_rail_theme_reset();
|
||||
book_rail_theme_reset();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ char *app_progress_u3;
|
|||
char *app_settings_file;
|
||||
char *app_progress_net;
|
||||
char *app_progress_hw;
|
||||
char *app_progress_on;
|
||||
char *app_progress_mluvnice;
|
||||
char *app_progress_cetba;
|
||||
|
||||
|
|
@ -158,6 +159,7 @@ static void set_progress_paths(const char *write_root) {
|
|||
g_free(app_settings_file);
|
||||
g_free(app_progress_net);
|
||||
g_free(app_progress_hw);
|
||||
g_free(app_progress_on);
|
||||
g_free(app_progress_mluvnice);
|
||||
g_free(app_progress_cetba);
|
||||
|
||||
|
|
@ -168,6 +170,7 @@ static void set_progress_paths(const char *write_root) {
|
|||
app_settings_file = g_build_filename(app_progress_dir, "settings.conf", NULL);
|
||||
app_progress_net = g_build_filename(app_progress_dir, "net.conf", NULL);
|
||||
app_progress_hw = g_build_filename(app_progress_dir, "hw.conf", NULL);
|
||||
app_progress_on = g_build_filename(app_progress_dir, "on.conf", NULL);
|
||||
app_progress_mluvnice = g_build_filename(app_progress_dir, "mluvnice.conf", NULL);
|
||||
app_progress_cetba = g_build_filename(app_progress_dir, "cetba.conf", NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue