From fca51b78a1f17fb1f7e9447c0514585d4867e43a Mon Sep 17 00:00:00 2001 From: Sophie Krause Date: Tue, 28 Oct 2025 12:37:03 +0100 Subject: [PATCH] latest changes --- .gitlab-ci.yml | 2 +- docs/main.typ | 8 ++++++-- docs/template.typ | 26 +++++++++++++++++++++++--- li.sopht.Flashcards.json | 4 ++-- meson.build | 30 ++++++++++++++++-------------- po/de.po | 11 +++++++---- po/flashcards.pot | 7 ++----- po/meson.build | 2 +- resources/meson.build | 28 +++++++++++++++++----------- resources/ui/meson.build | 17 +++++++++-------- src/database.c | 1 - src/flashcardsappwin.c | 1 - src/meson.build | 13 +++++++------ 13 files changed, 91 insertions(+), 59 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a8c5ec4..3d66a31 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,7 @@ docs: - ./Flashcards.pdf flatpak: - image: quay.io/gnome_infrastructure/gnome-runtime-images:gnome-48 + image: quay.io/gnome_infrastructure/gnome-runtime-images:gnome-49 stage: build variables: APP_ID: "li.sopht.Flashcards" diff --git a/docs/main.typ b/docs/main.typ index ee3684f..bc8a8ab 100644 --- a/docs/main.typ +++ b/docs/main.typ @@ -4,11 +4,15 @@ title: "Karteikarten-Anwendung in C mit GTK4 und Libadwaita", subtitle: "Hardwarenahe Programmierung", authors: ( - "Sophie Krause", + ( + name: "Sophie Krause", + id: "18103387" + ), ), profs: ( - "Prof. Dr. Gerwinski", + "Prof. Dr. rer. nat. Peter Gerwinski", ), + submitted_at: none, logo: "BO.svg" ) diff --git a/docs/template.typ b/docs/template.typ index a4b7602..964a339 100644 --- a/docs/template.typ +++ b/docs/template.typ @@ -1,8 +1,8 @@ #import "@preview/hydra:0.6.1": hydra -#let project(title: "", subtitle: "", authors: (), profs: (), logo: none, body) = { +#let project(title: "", subtitle: "", authors: ((name: "", id: ""),), profs: ("",), submitted_at: none, logo: none, body) = { // Basic properties - set document(author: authors, title: title) + set document(author: "a", title: title) set text(lang: "de") set heading(numbering: "1.1") @@ -27,17 +27,37 @@ set align(left) // Author + let authors_title + if authors.len() == 1 { + authors_title = "Autor*in" + } else { + authors_title = "Autor*innen" + } + text(weight: 700, authors_title + " (Matrikelnummer):") grid( gutter: 1em, - ..authors, + ..authors.map(author => author.name + " (" + author.id + ")").flatten() ) // Profs + let profs_title + if profs.len() == 1 { + profs_title = "Prüfer*in" + } else { + profs_title = "Prüfer*innen" + } + text(weight: 700, profs_title + ":") grid( gutter: 1em, ..profs, ) + // Abgabedatum + if submitted_at != none { + text(weight: 700, "Abgabedatum: ") + text(submitted_at.display("[day].[month].[year]")) + } + // Table of contents set align(left) set page(numbering: "I", number-align: center) diff --git a/li.sopht.Flashcards.json b/li.sopht.Flashcards.json index 490e632..2104964 100644 --- a/li.sopht.Flashcards.json +++ b/li.sopht.Flashcards.json @@ -1,7 +1,7 @@ { "id": "li.sopht.Flashcards", "runtime": "org.gnome.Platform", - "runtime-version": "48", + "runtime-version": "49", "sdk": "org.gnome.Sdk", "command": "flashcards", "separate-locales": false, @@ -33,7 +33,7 @@ { "type": "git", "url": "https://gitlab.gnome.org/jwestman/blueprint-compiler", - "tag": "v0.16.0" + "tag": "v0.18.0" } ] }, diff --git a/meson.build b/meson.build index 981597e..de79488 100644 --- a/meson.build +++ b/meson.build @@ -1,12 +1,13 @@ -project('flashcards', 'c', - version: '1.0.0', - meson_version: '>= 1.0.0', - default_options: ['warning_level=2', 'c_std=gnu23'], +project( + 'flashcards', 'c', + version : '1.0.0', + meson_version : '>= 1.0.0', + default_options : ['warning_level=2', 'c_std=gnu23'], ) flashcards_deps = [ dependency('gtk4'), - dependency('libadwaita-1', version: '>= 1.6'), + dependency('libadwaita-1', version : '>= 1.7'), dependency('sqlite3'), ] @@ -21,20 +22,21 @@ cc = meson.get_compiler('c') config_h = configuration_data() config_h.set_quoted('PACKAGE_VERSION', meson.project_version()) -config_h.set_quoted('GETTEXT_PACKAGE', 'flashcards') +config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name()) config_h.set_quoted('LOCALEDIR', get_option('prefix') / get_option('localedir')) -configure_file(output: 'config.h', configuration: config_h) -add_project_arguments(['-I' + meson.project_build_root()], language: 'c') +configure_file(output : 'config.h', configuration : config_h) +add_project_arguments(['-I' + meson.project_build_root()], language : 'c') -executable('flashcards', +executable( + meson.project_name(), sourcefiles, resources, - dependencies: flashcards_deps, - install: true + dependencies : flashcards_deps, + install : true ) gnome.post_install( - glib_compile_schemas: true, - gtk_update_icon_cache: true, - update_desktop_database: true, + glib_compile_schemas : true, + gtk_update_icon_cache : true, + update_desktop_database : true, ) diff --git a/po/de.po b/po/de.po index 058d066..af4c578 100644 --- a/po/de.po +++ b/po/de.po @@ -1,12 +1,15 @@ +# Copyright (C) 2025 Sophie Krause +# +#, fuzzy msgid "" msgstr "" "Project-Id-Version: flashcards\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-07-03 14:48+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" +"PO-Revision-Date: 2025-10-06 14:36+0200\n" +"Last-Translator: Sophie Krause\n" +"Language-Team: de\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/po/flashcards.pot b/po/flashcards.pot index 6c9fe57..828225f 100644 --- a/po/flashcards.pot +++ b/po/flashcards.pot @@ -1,7 +1,4 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the flashcards package. -# FIRST AUTHOR , YEAR. +# Copyright (C) 2025 Sophie Krause # #, fuzzy msgid "" @@ -9,7 +6,7 @@ msgstr "" "Project-Id-Version: flashcards\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2025-07-03 14:48+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: 2025-10-06 14:36+0200\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" diff --git a/po/meson.build b/po/meson.build index 5eab52e..b117614 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1 +1 @@ -i18n.gettext(meson.project_name(), preset: 'glib') \ No newline at end of file +i18n.gettext(meson.project_name(), preset : 'glib') \ No newline at end of file diff --git a/resources/meson.build b/resources/meson.build index 9b2b38f..ffdfe53 100644 --- a/resources/meson.build +++ b/resources/meson.build @@ -1,10 +1,13 @@ compile_schemas = find_program('glib-compile-schemas', required : false, disabler : true) -test('Validate schema file', - compile_schemas, - args : ['--strict', '--dry-run', meson.current_source_dir()]) +test( + 'Validate schema file', + compile_schemas, + args : ['--strict', '--dry-run', meson.current_source_dir()] +) -install_data('li.sopht.Flashcards.gschema.xml', - install_dir : get_option('datadir') / 'glib-2.0' / 'schemas' +install_data( + 'li.sopht.Flashcards.gschema.xml', + install_dir : get_option('datadir') / 'glib-2.0' / 'schemas' ) desktop_file = i18n.merge_file( @@ -30,8 +33,10 @@ appstream_file = i18n.merge_file( ) appstreamcli = find_program('appstreamcli', required : false, disabler : true) -test('Validate appstream file', appstreamcli, - args : ['validate', '--no-net', '--explain', appstream_file]) +test( + 'Validate appstream file', appstreamcli, + args : ['validate', '--no-net', '--explain', appstream_file] +) service_conf = configuration_data() service_conf.set('bindir', get_option('prefix') / get_option('bindir')) @@ -44,10 +49,11 @@ configure_file( subdir('ui') -resources = gnome.compile_resources('resources', - 'flashcards.gresource.xml', - dependencies : [blueprints, appstream_file], - c_name : 'flashcards' +resources = gnome.compile_resources( + 'resources', + 'flashcards.gresource.xml', + dependencies : [blueprints, appstream_file], + c_name : 'flashcards' ) subdir('icons') diff --git a/resources/ui/meson.build b/resources/ui/meson.build index 993b004..2523f06 100644 --- a/resources/ui/meson.build +++ b/resources/ui/meson.build @@ -1,9 +1,10 @@ -blueprints = custom_target('blueprints', - input : files( - 'window.blp', - 'create-category.blp', - 'create-card.blp' - ), - output : '.', - command : [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], +blueprints = custom_target( + 'blueprints', + input : files( + 'window.blp', + 'create-category.blp', + 'create-card.blp' + ), + output : '.', + command : [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], ) \ No newline at end of file diff --git a/src/database.c b/src/database.c index 533d974..a0c61de 100644 --- a/src/database.c +++ b/src/database.c @@ -69,7 +69,6 @@ database_save_category (sqlite3 *db, const char *c) { sqlite3_stmt *stmt; - fprintf (stdout, "%s\n", c); int rc = sqlite3_prepare_v2 (db, "INSERT INTO categories (name) VALUES(?)", -1, &stmt, nullptr); if (rc == SQLITE_OK) diff --git a/src/flashcardsappwin.c b/src/flashcardsappwin.c index 2ea98e4..8376ae0 100644 --- a/src/flashcardsappwin.c +++ b/src/flashcardsappwin.c @@ -52,7 +52,6 @@ load_categories (FlashcardsAppWindow *win) for (guint i = 0; i < win->categories->len; i++) { category c = g_array_index (win->categories, category, i); - printf ("%d: %s\n", c.id, c.name); GtkWidget *child = gtk_list_box_row_new (); GtkWidget *label = gtk_label_new (c.name); diff --git a/src/meson.build b/src/meson.build index 42c219b..df0f767 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,7 +1,8 @@ -sourcefiles = files('main.c', - 'flashcardsapp.c', - 'flashcardsappwin.c', - 'create-category.c', - 'create-card.c', - 'database.c' +sourcefiles = files( + 'main.c', + 'flashcardsapp.c', + 'flashcardsappwin.c', + 'create-category.c', + 'create-card.c', + 'database.c' ) \ No newline at end of file