mirror of
https://gitlab.cvh-server.de/skrause/flashcards.git
synced 2025-12-11 02:11:37 +01:00
latest changes
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
30
meson.build
30
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,
|
||||
)
|
||||
|
||||
11
po/de.po
11
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 <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\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"
|
||||
|
||||
@@ -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 <EMAIL@ADDRESS>, 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 <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
|
||||
@@ -1 +1 @@
|
||||
i18n.gettext(meson.project_name(), preset: 'glib')
|
||||
i18n.gettext(meson.project_name(), preset : 'glib')
|
||||
@@ -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')
|
||||
|
||||
@@ -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@'],
|
||||
)
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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'
|
||||
)
|
||||
Reference in New Issue
Block a user