mirror of
https://gitlab.cvh-server.de/skrause/flashcards.git
synced 2025-12-12 05:41:37 +01:00
Compare commits
9 Commits
a444bdd2fb
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
fca51b78a1
|
|||
|
b5830c9d13
|
|||
|
cd3ea61503
|
|||
|
5529da02db
|
|||
|
a4ab9486a1
|
|||
|
6cf180e4f0
|
|||
|
34d68d3e51
|
|||
|
d916767369
|
|||
|
803185de87
|
@@ -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"
|
||||
|
||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
6
docs/bibliography.yml
Normal file
6
docs/bibliography.yml
Normal 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 }
|
||||
@@ -4,64 +4,59 @@
|
||||
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",
|
||||
),
|
||||
logo: "BO_Logo.svg"
|
||||
submitted_at: none,
|
||||
logo: "BO.svg"
|
||||
)
|
||||
|
||||
= Einleitung
|
||||
#lorem(100)
|
||||
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()
|
||||
= Konzept & Tools
|
||||
#lorem(100)
|
||||
|
||||
== SQLite
|
||||
#lorem(100)
|
||||
|
||||
== GTK4
|
||||
#lorem(100)
|
||||
|
||||
== Libadwaita
|
||||
#lorem(100)
|
||||
|
||||
== Blueprint
|
||||
#lorem(100)
|
||||
|
||||
#pagebreak()
|
||||
= Implementierung
|
||||
#lorem(100)
|
||||
|
||||
== Datenbank
|
||||
#lorem(100)
|
||||
|
||||
== UI
|
||||
#lorem(100)
|
||||
|
||||
=== Layout
|
||||
|
||||
== Logik
|
||||
#lorem(100)
|
||||
|
||||
#pagebreak()
|
||||
= Buildsystem
|
||||
#lorem(100)
|
||||
|
||||
#pagebreak()
|
||||
= Flatpak
|
||||
#lorem(100)
|
||||
|
||||
#pagebreak()
|
||||
= CI / CD
|
||||
#lorem(100)
|
||||
|
||||
== Flatpak
|
||||
#lorem(100)
|
||||
|
||||
== Dokumentation
|
||||
#lorem(100)
|
||||
|
||||
#pagebreak()
|
||||
= Fazit & Ausblick
|
||||
#lorem(100)
|
||||
@@ -1,8 +1,8 @@
|
||||
#import "@preview/hydra:0.6.0": 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
|
||||
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)
|
||||
@@ -58,4 +78,7 @@
|
||||
counter(page).update(1)
|
||||
set par(justify: true)
|
||||
body
|
||||
|
||||
pagebreak()
|
||||
bibliography("bibliography.yml")
|
||||
}
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
52
po/de.po
52
po/de.po
@@ -1,18 +1,21 @@
|
||||
# Copyright (C) 2025 Sophie Krause
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: flashcards\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-04-04 09:50+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"
|
||||
"POT-Creation-Date: 2025-07-03 14:48+0200\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"
|
||||
|
||||
#: resources/ui/window.blp:5 resources/ui/window.blp:60
|
||||
#: resources/ui/window.blp:81 resources/li.sopht.Flashcards.desktop.in:3
|
||||
#: resources/ui/window.blp:81 resources/li.sopht.Flashcards.desktop.in:2
|
||||
#: resources/li.sopht.Flashcards.metainfo.xml.in:7
|
||||
msgid "Flashcards"
|
||||
msgstr "Karteikarten"
|
||||
@@ -49,19 +52,35 @@ msgstr "Wähle eine Kategorie"
|
||||
msgid "Add a flashcard"
|
||||
msgstr "Füge eine Karteikarte hinzu"
|
||||
|
||||
#: resources/ui/window.blp:136
|
||||
#: resources/ui/window.blp:116
|
||||
msgid "Show answer"
|
||||
msgstr "Antwort zeigen"
|
||||
|
||||
#: resources/ui/window.blp:137
|
||||
msgid "Hard"
|
||||
msgstr "Schwer"
|
||||
|
||||
#: resources/ui/window.blp:142
|
||||
#: resources/ui/window.blp:140
|
||||
msgid "Reappears in 6 hours"
|
||||
msgstr "Erscheint erneut in 6 Stunden"
|
||||
|
||||
#: resources/ui/window.blp:144
|
||||
msgid "Medium"
|
||||
msgstr "Mittel"
|
||||
|
||||
#: resources/ui/window.blp:148
|
||||
#: resources/ui/window.blp:147
|
||||
msgid "Reappears in 12 hours"
|
||||
msgstr "Erscheint erneut in 12 Stunden"
|
||||
|
||||
#: resources/ui/window.blp:151
|
||||
msgid "Easy"
|
||||
msgstr "Einfach"
|
||||
|
||||
#: resources/ui/window.blp:166
|
||||
#: resources/ui/window.blp:154
|
||||
msgid "Reappears in 24 hours"
|
||||
msgstr "Erscheint erneut in 24 Stunden"
|
||||
|
||||
#: resources/ui/window.blp:170
|
||||
msgid "About Flashcards"
|
||||
msgstr "Über Karteikarten"
|
||||
|
||||
@@ -89,18 +108,7 @@ msgstr "Neue Karteikarte erstellen"
|
||||
msgid "Answer"
|
||||
msgstr "Antwort"
|
||||
|
||||
#: resources/li.sopht.Flashcards.desktop.in:9
|
||||
msgid "GTK;"
|
||||
msgstr ""
|
||||
|
||||
#: resources/li.sopht.Flashcards.metainfo.xml.in:8
|
||||
#: resources/li.sopht.Flashcards.metainfo.xml.in:10
|
||||
msgid "Learn categories with flashcards!"
|
||||
msgstr "Lerne Kategorien mit Karteikarten!"
|
||||
|
||||
#: resources/li.sopht.Flashcards.metainfo.xml.in:10
|
||||
msgid "No description"
|
||||
msgstr ""
|
||||
|
||||
#: resources/li.sopht.Flashcards.metainfo.xml.in:44
|
||||
msgid "A caption"
|
||||
msgstr ""
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
# 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 ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: flashcards\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2025-04-04 09:50+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"POT-Creation-Date: 2025-07-03 14:48+0200\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"
|
||||
@@ -18,7 +15,7 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: resources/ui/window.blp:5 resources/ui/window.blp:60
|
||||
#: resources/ui/window.blp:81 resources/li.sopht.Flashcards.desktop.in:3
|
||||
#: resources/ui/window.blp:81 resources/li.sopht.Flashcards.desktop.in:2
|
||||
#: resources/li.sopht.Flashcards.metainfo.xml.in:7
|
||||
msgid "Flashcards"
|
||||
msgstr ""
|
||||
@@ -55,19 +52,35 @@ msgstr ""
|
||||
msgid "Add a flashcard"
|
||||
msgstr ""
|
||||
|
||||
#: resources/ui/window.blp:136
|
||||
#: resources/ui/window.blp:116
|
||||
msgid "Show answer"
|
||||
msgstr ""
|
||||
|
||||
#: resources/ui/window.blp:137
|
||||
msgid "Hard"
|
||||
msgstr ""
|
||||
|
||||
#: resources/ui/window.blp:142
|
||||
#: resources/ui/window.blp:140
|
||||
msgid "Reappears in 6 hours"
|
||||
msgstr ""
|
||||
|
||||
#: resources/ui/window.blp:144
|
||||
msgid "Medium"
|
||||
msgstr ""
|
||||
|
||||
#: resources/ui/window.blp:148
|
||||
#: resources/ui/window.blp:147
|
||||
msgid "Reappears in 12 hours"
|
||||
msgstr ""
|
||||
|
||||
#: resources/ui/window.blp:151
|
||||
msgid "Easy"
|
||||
msgstr ""
|
||||
|
||||
#: resources/ui/window.blp:166
|
||||
#: resources/ui/window.blp:154
|
||||
msgid "Reappears in 24 hours"
|
||||
msgstr ""
|
||||
|
||||
#: resources/ui/window.blp:170
|
||||
msgid "About Flashcards"
|
||||
msgstr ""
|
||||
|
||||
@@ -95,18 +108,7 @@ msgstr ""
|
||||
msgid "Answer"
|
||||
msgstr ""
|
||||
|
||||
#: resources/li.sopht.Flashcards.desktop.in:9
|
||||
msgid "GTK;"
|
||||
msgstr ""
|
||||
|
||||
#: resources/li.sopht.Flashcards.metainfo.xml.in:8
|
||||
#: resources/li.sopht.Flashcards.metainfo.xml.in:10
|
||||
msgid "Learn categories with flashcards!"
|
||||
msgstr ""
|
||||
|
||||
#: resources/li.sopht.Flashcards.metainfo.xml.in:10
|
||||
msgid "No description"
|
||||
msgstr ""
|
||||
|
||||
#: resources/li.sopht.Flashcards.metainfo.xml.in:44
|
||||
msgid "A caption"
|
||||
msgstr ""
|
||||
|
||||
@@ -1 +1 @@
|
||||
i18n.gettext(meson.project_name(), preset: 'glib')
|
||||
i18n.gettext(meson.project_name(), preset : 'glib')
|
||||
@@ -7,6 +7,8 @@
|
||||
<file alias="appdata" compressed="true" preprocess="xml-stripblanks">li.sopht.Flashcards.metainfo.xml</file>
|
||||
</gresource>
|
||||
<gresource prefix="/li/sopht/flashcards/icons/scalable/actions/">
|
||||
<file preprocess="xml-stripblanks">icons/hicolor/scalable/actions/add-card-symbolic.svg</file>
|
||||
<file preprocess="xml-stripblanks">icons/hicolor/scalable/actions/add-symbolic.svg</file>
|
||||
<file preprocess="xml-stripblanks">icons/hicolor/scalable/actions/delete-symbolic.svg</file>
|
||||
<file preprocess="xml-stripblanks">icons/hicolor/scalable/actions/category-symbolic.svg</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><path d="m 7 3 v 4 h -4 v 2 h 4 v 4 h 2 v -4 h 4 v -2 h -4 v -4 z m 0 0" fill="#222222"/></svg>
|
||||
|
Before Width: | Height: | Size: 222 B |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><path d="m 7 1 v 6 h -6 v 2 h 6 v 6 h 2 v -6 h 6 v -2 h -6 v -6 z m 0 0" fill="#222222"/></svg>
|
||||
|
After Width: | Height: | Size: 222 B |
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><g fill="#222222"><path d="m 6 4.5 c 0 0.828125 -0.671875 1.5 -1.5 1.5 s -1.5 -0.671875 -1.5 -1.5 s 0.671875 -1.5 1.5 -1.5 s 1.5 0.671875 1.5 1.5 z m 0 0"/><path d="m 0 7.089844 c 0 0.847656 0.335938 1.660156 0.9375 2.261718 l 5.382812 5.382813 c 0.925782 0.925781 2.433594 0.925781 3.359376 0 l 4.964843 -4.964844 c 0.976563 -0.976562 0.976563 -2.5625 0 -3.539062 l -5.417969 -5.417969 c -0.519531 -0.519531 -1.226562 -0.8125 -1.960937 -0.8125 h -3.265625 c -2.207031 0 -4 1.792969 -4 4 z m 4 -5.089844 h 3.265625 c 0.207031 0 0.402344 0.082031 0.546875 0.226562 l 5.417969 5.417969 c 0.203125 0.207031 0.203125 0.503907 0 0.710938 l -4.964844 4.964843 c -0.15625 0.15625 -0.375 0.15625 -0.53125 0 l -5.382813 -5.382812 c -0.226562 -0.226562 -0.351562 -0.53125 -0.351562 -0.847656 v -3.089844 c 0 -1.117188 0.882812 -2 2 -2 z m 0 0"/></g></svg>
|
||||
|
After Width: | Height: | Size: 972 B |
10
resources/icons/hicolor/scalable/actions/delete-symbolic.svg
Normal file
10
resources/icons/hicolor/scalable/actions/delete-symbolic.svg
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
|
||||
<g fill="#2e3436">
|
||||
<path d="m 1 3 h 14 c 0.550781 0 1 0.449219 1 1 s -0.449219 1 -1 1 h -14 c -0.550781 0 -1 -0.449219 -1 -1 s 0.449219 -1 1 -1 z m 0 0"/>
|
||||
<path d="m 4 4 v -1.5 c 0 -1.386719 1.113281 -2.5 2.5 -2.5 h 2.980469 c 1.382812 0 2.5 1.113281 2.5 2.5 v 1.5 h -2 v -1.5 c 0 -0.269531 -0.230469 -0.5 -0.5 -0.5 h -2.980469 c -0.269531 0 -0.5 0.230469 -0.5 0.5 v 1.5 z m 0 0"/>
|
||||
<path d="m 4 4 v 9 c 0 0.546875 0.453125 1 1 1 h 6 c 0.546875 0 1 -0.453125 1 -1 v -9 h 2 v 9 c 0 1.660156 -1.339844 3 -3 3 h -6 c -1.660156 0 -3 -1.339844 -3 -3 v -9 z m 0 0"/>
|
||||
<path d="m 7 7 v 5 c 0 0.277344 -0.222656 0.5 -0.5 0.5 s -0.5 -0.222656 -0.5 -0.5 v -5 c 0 -0.277344 0.222656 -0.5 0.5 -0.5 s 0.5 0.222656 0.5 0.5 z m 0 0"/>
|
||||
<path d="m 10 7 v 5 c 0 0.277344 -0.222656 0.5 -0.5 0.5 s -0.5 -0.222656 -0.5 -0.5 v -5 c 0 -0.277344 0.222656 -0.5 0.5 -0.5 s 0.5 0.222656 0.5 0.5 z m 0 0"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -14,7 +14,9 @@ install_data(
|
||||
|
||||
action_dir = 'hicolor' / 'scalable' / 'actions'
|
||||
action_icons = [
|
||||
action_dir / 'add-card-symbolic.svg',
|
||||
action_dir / 'add-symbolic.svg',
|
||||
action_dir / 'delete-symbolic.svg',
|
||||
action_dir / 'category-symbolic.svg',
|
||||
]
|
||||
install_data(
|
||||
action_icons,
|
||||
|
||||
@@ -4,6 +4,5 @@ Exec=flashcards
|
||||
Icon=li.sopht.Flashcards
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Utility;
|
||||
Keywords=GTK;
|
||||
Categories=Utility
|
||||
StartupNotify=true
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
<name>Flashcards</name>
|
||||
<summary>Learn categories with flashcards!</summary>
|
||||
<description>
|
||||
<p>No description</p>
|
||||
<p>Learn categories with flashcards!</p>
|
||||
</description>
|
||||
|
||||
|
||||
<developer id="li.sopht">
|
||||
<name translate="no">Sophie Krause</name>
|
||||
</developer>
|
||||
@@ -38,13 +39,6 @@
|
||||
<color type="primary" scheme_preference="dark">#993d3d</color>
|
||||
</branding>
|
||||
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://example.org/example1.png</image>
|
||||
<caption>A caption</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
|
||||
<releases>
|
||||
<release version="1.0.0" date="2025-02-18">
|
||||
</release>
|
||||
|
||||
@@ -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@'],
|
||||
)
|
||||
@@ -24,7 +24,7 @@ template $FlashcardsAppWindow : Adw.ApplicationWindow {
|
||||
Adw.HeaderBar {
|
||||
[start]
|
||||
Gtk.Button {
|
||||
icon-name: "list-add-symbolic";
|
||||
icon-name: "add-symbolic";
|
||||
clicked => $on_add_category();
|
||||
tooltip-text: _("Create category");
|
||||
}
|
||||
@@ -64,14 +64,14 @@ template $FlashcardsAppWindow : Adw.ApplicationWindow {
|
||||
Adw.HeaderBar {
|
||||
[start]
|
||||
Gtk.Button add_card_button {
|
||||
icon-name: "add-card-symbolic";
|
||||
icon-name: "add-symbolic";
|
||||
clicked => $on_add_card();
|
||||
tooltip-text: _("Add flashcard");
|
||||
visible: false;
|
||||
}
|
||||
[start]
|
||||
Gtk.Button delete_card_button {
|
||||
icon-name: "user-trash-symbolic";
|
||||
icon-name: "delete-symbolic";
|
||||
clicked => $on_delete_card();
|
||||
tooltip-text: _("Delete flashcard");
|
||||
visible: false;
|
||||
@@ -86,14 +86,14 @@ template $FlashcardsAppWindow : Adw.ApplicationWindow {
|
||||
Adw.ViewStackPage {
|
||||
child: Adw.StatusPage placeholder_category {
|
||||
title: _("Select a category");
|
||||
icon-name: "edit-find-symbolic";
|
||||
icon-name: "category-symbolic";
|
||||
};
|
||||
}
|
||||
|
||||
Adw.ViewStackPage {
|
||||
child: Adw.StatusPage placeholder_card {
|
||||
title: _("Add a flashcard");
|
||||
icon-name: "list-add-symbolic";
|
||||
icon-name: "add-symbolic";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -113,6 +113,7 @@ template $FlashcardsAppWindow : Adw.ApplicationWindow {
|
||||
styles ["card", "activatable"]
|
||||
halign: center;
|
||||
clicked => $on_flip_card();
|
||||
tooltip-text: _("Show answer");
|
||||
Label card_title {
|
||||
styles ["title-4"]
|
||||
margin-top: 24;
|
||||
@@ -121,7 +122,7 @@ template $FlashcardsAppWindow : Adw.ApplicationWindow {
|
||||
margin-end: 48;
|
||||
hexpand: true;
|
||||
justify: center;
|
||||
label: "Wie viele Bäume sind in einem Wald?";
|
||||
label: "";
|
||||
wrap: true;
|
||||
wrap-mode: word_char;
|
||||
}
|
||||
@@ -136,18 +137,21 @@ template $FlashcardsAppWindow : Adw.ApplicationWindow {
|
||||
label: _("Hard");
|
||||
hexpand: true;
|
||||
clicked => $on_answer_hard();
|
||||
tooltip-text: _("Reappears in 6 hours");
|
||||
}
|
||||
Button {
|
||||
styles ["pill"]
|
||||
label: _("Medium");
|
||||
hexpand: true;
|
||||
clicked => $on_answer_medium();
|
||||
tooltip-text: _("Reappears in 12 hours");
|
||||
}
|
||||
Button {
|
||||
styles ["pill"]
|
||||
label: _("Easy");
|
||||
hexpand: true;
|
||||
clicked => $on_answer_easy();
|
||||
tooltip-text: _("Reappears in 24 hours");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
@@ -71,10 +70,12 @@ next_card (FlashcardsAppWindow *win)
|
||||
if (win->cards->length <= 0)
|
||||
{
|
||||
adw_view_stack_set_visible_child (win->main_view, win->placeholder_card);
|
||||
gtk_widget_set_visible (GTK_WIDGET (win->delete_card_button), FALSE);
|
||||
return;
|
||||
}
|
||||
win->current_card = g_queue_pop_head (win->cards);
|
||||
gtk_label_set_label (win->card_title, win->current_card->title);
|
||||
gtk_widget_set_visible (GTK_WIDGET (win->delete_card_button), TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -82,14 +83,14 @@ load_cards (FlashcardsAppWindow *win, category c)
|
||||
{
|
||||
GArray *card_array = database_load_cards (win->db, c.id);
|
||||
|
||||
adw_view_stack_set_visible_child (win->main_view, win->flashcard);
|
||||
|
||||
win->cards = g_queue_new ();
|
||||
for (guint i = 0; i < card_array->len; i++)
|
||||
{
|
||||
g_queue_push_tail (win->cards, &g_array_index (card_array, card, i));
|
||||
;
|
||||
}
|
||||
|
||||
printf ("Flashcards: %d\n", win->cards->length);
|
||||
next_card (win);
|
||||
}
|
||||
|
||||
@@ -112,7 +113,6 @@ on_select_category (__attribute__ ((unused)) GtkListBox *box,
|
||||
adw_view_stack_set_visible_child (win->main_view, win->flashcard);
|
||||
|
||||
gtk_widget_set_visible (GTK_WIDGET (win->add_card_button), TRUE);
|
||||
gtk_widget_set_visible (GTK_WIDGET (win->delete_card_button), TRUE);
|
||||
gtk_widget_set_visible (GTK_WIDGET (win->delete_category_button), TRUE);
|
||||
|
||||
load_cards (win, c);
|
||||
@@ -202,7 +202,7 @@ flashcards_app_window_add_card (FlashcardsAppWindow *win, const gchar *title,
|
||||
const gchar *answer)
|
||||
{
|
||||
database_save_card (win->db, win->current_category.id, title, answer);
|
||||
printf ("Added card\n");
|
||||
load_cards (win, win->current_category);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -217,7 +217,6 @@ static void
|
||||
on_flashcards_app_window_show (GtkWidget *self, gpointer user_data)
|
||||
{
|
||||
FlashcardsAppWindow *win = user_data;
|
||||
printf ("Show\n");
|
||||
|
||||
load_categories (win);
|
||||
gtk_list_box_unselect_all (win->topics);
|
||||
|
||||
@@ -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