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

small changes, fix lang in flatpak

This commit is contained in:
2025-02-06 18:45:08 +01:00
parent 46efd54ad8
commit 1ea9bb36c6
8 changed files with 41 additions and 50 deletions

View File

@@ -13,6 +13,8 @@ struct _FlashcardsAppWindow
{
AdwApplicationWindow parent;
sqlite3 *db;
GArray *categories;
AdwNavigationSplitView *split_view;
@@ -34,7 +36,7 @@ on_category_selected(GtkListBox *box, GtkListBoxRow *row, gpointer user_data)
return;
}
printf("Test\n");
FlashcardsAppWindow *win = FLASHCARDS_APP_WINDOW(gtk_widget_get_root(GTK_WIDGET(box)));
FlashcardsAppWindow *win = user_data;
adw_navigation_split_view_set_show_content(ADW_NAVIGATION_SPLIT_VIEW(win->split_view), TRUE);
int id = gtk_list_box_row_get_index(gtk_list_box_get_selected_row(win->topics));
@@ -51,7 +53,7 @@ on_add_category(GtkButton *self,
void flashcards_app_window_test(FlashcardsAppWindow *win, const gchar *test)
{
database_save_category(test);
database_save_category(win->db, test);
GtkWidget *child = adw_action_row_new();
adw_preferences_row_set_title(ADW_PREFERENCES_ROW(child), test);
@@ -64,9 +66,9 @@ flashcards_app_window_init(FlashcardsAppWindow *win)
{
gtk_widget_init_template(GTK_WIDGET(win));
database_connect(g_get_user_data_dir());
database_create_tables();
win->categories = database_load_categories();
win->db = database_connect(g_get_user_data_dir());
database_create_tables(win->db);
win->categories = database_load_categories(win->db);
GArray *categories = win->categories;
@@ -102,7 +104,3 @@ flashcards_app_window_new(FlashcardsApp *app)
{
return g_object_new(FLASHCARDS_APP_WINDOW_TYPE, "application", app, NULL);
}
void flashcards_app_window_open(FlashcardsAppWindow *win, GFile *file)
{
}