1
0
mirror of https://gitlab.cvh-server.de/skrause/flashcards.git synced 2025-12-12 10:01:37 +01:00

Compare commits

..

2 Commits

Author SHA1 Message Date
fca51b78a1 latest changes 2025-10-28 12:37:03 +01:00
b5830c9d13 latest changes 2025-08-08 23:01:28 +02:00
15 changed files with 104 additions and 60 deletions

View File

@@ -8,7 +8,7 @@ docs:
- ./Flashcards.pdf - ./Flashcards.pdf
flatpak: flatpak:
image: quay.io/gnome_infrastructure/gnome-runtime-images:gnome-48 image: quay.io/gnome_infrastructure/gnome-runtime-images:gnome-49
stage: build stage: build
variables: variables:
APP_ID: "li.sopht.Flashcards" APP_ID: "li.sopht.Flashcards"

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,6 @@
electronic:
type: Web
title: Ishkur's Guide to Electronic Music
serial-number: v2.5
author: Ishkur
url: { value: http://www.techno.org/electronic-music-guide/, date: 2020-11-30 }

View File

@@ -4,15 +4,24 @@
title: "Karteikarten-Anwendung in C mit GTK4 und Libadwaita", title: "Karteikarten-Anwendung in C mit GTK4 und Libadwaita",
subtitle: "Hardwarenahe Programmierung", subtitle: "Hardwarenahe Programmierung",
authors: ( authors: (
"Sophie Krause", (
name: "Sophie Krause",
id: "18103387"
),
), ),
profs: ( profs: (
"Prof. Dr. Gerwinski", "Prof. Dr. rer. nat. Peter Gerwinski",
), ),
logo: "BO_Logo.svg" submitted_at: none,
logo: "BO.svg"
) )
= Einleitung = Einleitung
Das Projekt behandelt die Entwicklung einer typischen Anwendung für die GNOME-Desktop-Umgebung unter Linux.
Dementsprechend wird die Anwendung mit GTK4 und Libadwaita entwickelt, um ein natives Erlebnis zu erzielen.
Da GTK in C geschrieben ist, wird ebenfalls in dieser Sprache programmiert.
Als Thema der Anwendung wurde eine Karteikarten-App gewählt, da diese gut für die Entwicklung einer Desktop-Anwendung geeignet ist und ebenfalls eine Datenbank benötigt.
#pagebreak() #pagebreak()
= Konzept & Tools = Konzept & Tools
@@ -31,6 +40,7 @@
== Datenbank == Datenbank
== UI == UI
=== Layout === Layout
== Logik == Logik

View File

@@ -1,8 +1,8 @@
#import "@preview/hydra:0.6.1": hydra #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 // Basic properties
set document(author: authors, title: title) set document(author: "a", title: title)
set text(lang: "de") set text(lang: "de")
set heading(numbering: "1.1") set heading(numbering: "1.1")
@@ -27,17 +27,37 @@
set align(left) set align(left)
// Author // Author
let authors_title
if authors.len() == 1 {
authors_title = "Autor*in"
} else {
authors_title = "Autor*innen"
}
text(weight: 700, authors_title + " (Matrikelnummer):")
grid( grid(
gutter: 1em, gutter: 1em,
..authors, ..authors.map(author => author.name + " (" + author.id + ")").flatten()
) )
// Profs // 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( grid(
gutter: 1em, gutter: 1em,
..profs, ..profs,
) )
// Abgabedatum
if submitted_at != none {
text(weight: 700, "Abgabedatum: ")
text(submitted_at.display("[day].[month].[year]"))
}
// Table of contents // Table of contents
set align(left) set align(left)
set page(numbering: "I", number-align: center) set page(numbering: "I", number-align: center)

View File

@@ -1,7 +1,7 @@
{ {
"id": "li.sopht.Flashcards", "id": "li.sopht.Flashcards",
"runtime": "org.gnome.Platform", "runtime": "org.gnome.Platform",
"runtime-version": "48", "runtime-version": "49",
"sdk": "org.gnome.Sdk", "sdk": "org.gnome.Sdk",
"command": "flashcards", "command": "flashcards",
"separate-locales": false, "separate-locales": false,
@@ -33,7 +33,7 @@
{ {
"type": "git", "type": "git",
"url": "https://gitlab.gnome.org/jwestman/blueprint-compiler", "url": "https://gitlab.gnome.org/jwestman/blueprint-compiler",
"tag": "v0.16.0" "tag": "v0.18.0"
} }
] ]
}, },

View File

@@ -1,12 +1,13 @@
project('flashcards', 'c', project(
version: '1.0.0', 'flashcards', 'c',
meson_version: '>= 1.0.0', version : '1.0.0',
default_options: ['warning_level=2', 'c_std=gnu23'], meson_version : '>= 1.0.0',
default_options : ['warning_level=2', 'c_std=gnu23'],
) )
flashcards_deps = [ flashcards_deps = [
dependency('gtk4'), dependency('gtk4'),
dependency('libadwaita-1', version: '>= 1.6'), dependency('libadwaita-1', version : '>= 1.7'),
dependency('sqlite3'), dependency('sqlite3'),
] ]
@@ -21,20 +22,21 @@ cc = meson.get_compiler('c')
config_h = configuration_data() config_h = configuration_data()
config_h.set_quoted('PACKAGE_VERSION', meson.project_version()) 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')) config_h.set_quoted('LOCALEDIR', get_option('prefix') / get_option('localedir'))
configure_file(output: 'config.h', configuration: config_h) configure_file(output : 'config.h', configuration : config_h)
add_project_arguments(['-I' + meson.project_build_root()], language: 'c') add_project_arguments(['-I' + meson.project_build_root()], language : 'c')
executable('flashcards', executable(
meson.project_name(),
sourcefiles, sourcefiles,
resources, resources,
dependencies: flashcards_deps, dependencies : flashcards_deps,
install: true install : true
) )
gnome.post_install( gnome.post_install(
glib_compile_schemas: true, glib_compile_schemas : true,
gtk_update_icon_cache: true, gtk_update_icon_cache : true,
update_desktop_database: true, update_desktop_database : true,
) )

View File

@@ -1,12 +1,15 @@
# Copyright (C) 2025 Sophie Krause
#
#, fuzzy
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: flashcards\n" "Project-Id-Version: flashcards\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-07-03 14:48+0200\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" "Last-Translator: Sophie Krause\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: de\n"
"Language: \n" "Language: de\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"

View File

@@ -1,7 +1,4 @@
# SOME DESCRIPTIVE TITLE. # Copyright (C) 2025 Sophie Krause
# 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.
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
@@ -9,7 +6,7 @@ msgstr ""
"Project-Id-Version: flashcards\n" "Project-Id-Version: flashcards\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-07-03 14:48+0200\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" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n" "Language: \n"

View File

@@ -1 +1 @@
i18n.gettext(meson.project_name(), preset: 'glib') i18n.gettext(meson.project_name(), preset : 'glib')

View File

@@ -1,10 +1,13 @@
compile_schemas = find_program('glib-compile-schemas', required : false, disabler : true) compile_schemas = find_program('glib-compile-schemas', required : false, disabler : true)
test('Validate schema file', test(
compile_schemas, 'Validate schema file',
args : ['--strict', '--dry-run', meson.current_source_dir()]) compile_schemas,
args : ['--strict', '--dry-run', meson.current_source_dir()]
)
install_data('li.sopht.Flashcards.gschema.xml', install_data(
install_dir : get_option('datadir') / 'glib-2.0' / 'schemas' 'li.sopht.Flashcards.gschema.xml',
install_dir : get_option('datadir') / 'glib-2.0' / 'schemas'
) )
desktop_file = i18n.merge_file( desktop_file = i18n.merge_file(
@@ -30,8 +33,10 @@ appstream_file = i18n.merge_file(
) )
appstreamcli = find_program('appstreamcli', required : false, disabler : true) appstreamcli = find_program('appstreamcli', required : false, disabler : true)
test('Validate appstream file', appstreamcli, test(
args : ['validate', '--no-net', '--explain', appstream_file]) 'Validate appstream file', appstreamcli,
args : ['validate', '--no-net', '--explain', appstream_file]
)
service_conf = configuration_data() service_conf = configuration_data()
service_conf.set('bindir', get_option('prefix') / get_option('bindir')) service_conf.set('bindir', get_option('prefix') / get_option('bindir'))
@@ -44,10 +49,11 @@ configure_file(
subdir('ui') subdir('ui')
resources = gnome.compile_resources('resources', resources = gnome.compile_resources(
'flashcards.gresource.xml', 'resources',
dependencies : [blueprints, appstream_file], 'flashcards.gresource.xml',
c_name : 'flashcards' dependencies : [blueprints, appstream_file],
c_name : 'flashcards'
) )
subdir('icons') subdir('icons')

View File

@@ -1,9 +1,10 @@
blueprints = custom_target('blueprints', blueprints = custom_target(
input : files( 'blueprints',
'window.blp', input : files(
'create-category.blp', 'window.blp',
'create-card.blp' 'create-category.blp',
), 'create-card.blp'
output : '.', ),
command : [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'], output : '.',
command : [find_program('blueprint-compiler'), 'batch-compile', '@OUTPUT@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
) )

View File

@@ -69,7 +69,6 @@ database_save_category (sqlite3 *db, const char *c)
{ {
sqlite3_stmt *stmt; sqlite3_stmt *stmt;
fprintf (stdout, "%s\n", c);
int rc = sqlite3_prepare_v2 (db, "INSERT INTO categories (name) VALUES(?)", int rc = sqlite3_prepare_v2 (db, "INSERT INTO categories (name) VALUES(?)",
-1, &stmt, nullptr); -1, &stmt, nullptr);
if (rc == SQLITE_OK) if (rc == SQLITE_OK)

View File

@@ -52,7 +52,6 @@ load_categories (FlashcardsAppWindow *win)
for (guint i = 0; i < win->categories->len; i++) for (guint i = 0; i < win->categories->len; i++)
{ {
category c = g_array_index (win->categories, category, 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 *child = gtk_list_box_row_new ();
GtkWidget *label = gtk_label_new (c.name); GtkWidget *label = gtk_label_new (c.name);

View File

@@ -1,7 +1,8 @@
sourcefiles = files('main.c', sourcefiles = files(
'flashcardsapp.c', 'main.c',
'flashcardsappwin.c', 'flashcardsapp.c',
'create-category.c', 'flashcardsappwin.c',
'create-card.c', 'create-category.c',
'database.c' 'create-card.c',
'database.c'
) )