mirror of
https://gitlab.cvh-server.de/skrause/flashcards.git
synced 2025-12-12 09:01:37 +01:00
small fixes and description
This commit is contained in:
@@ -31,15 +31,18 @@ G_DEFINE_TYPE(FlashcardsAppWindow, flashcards_app_window, ADW_TYPE_APPLICATION_W
|
||||
static void
|
||||
on_category_selected(GtkListBox *box, GtkListBoxRow *row, gpointer user_data)
|
||||
{
|
||||
FlashcardsAppWindow *win;
|
||||
int id;
|
||||
|
||||
if (row == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
printf("Test\n");
|
||||
FlashcardsAppWindow *win = user_data;
|
||||
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));
|
||||
id = gtk_list_box_row_get_index(gtk_list_box_get_selected_row(win->topics));
|
||||
printf("%d\n", id);
|
||||
}
|
||||
|
||||
@@ -47,15 +50,19 @@ static void
|
||||
on_add_category(GtkButton *self,
|
||||
gpointer user_data)
|
||||
{
|
||||
FlashcardsCreateCategoryDialog *dialog = flashcards_create_category_dialog_new(user_data);
|
||||
FlashcardsCreateCategoryDialog *dialog;
|
||||
|
||||
dialog = flashcards_create_category_dialog_new(user_data);
|
||||
adw_dialog_present(ADW_DIALOG(dialog), GTK_WIDGET(user_data));
|
||||
}
|
||||
|
||||
void flashcards_app_window_test(FlashcardsAppWindow *win, const gchar *test)
|
||||
{
|
||||
GtkWidget *child;
|
||||
|
||||
database_save_category(win->db, test);
|
||||
|
||||
GtkWidget *child = adw_action_row_new();
|
||||
child = adw_action_row_new();
|
||||
adw_preferences_row_set_title(ADW_PREFERENCES_ROW(child), test);
|
||||
|
||||
gtk_list_box_append(GTK_LIST_BOX(win->topics), child);
|
||||
@@ -64,20 +71,25 @@ void flashcards_app_window_test(FlashcardsAppWindow *win, const gchar *test)
|
||||
static void
|
||||
flashcards_app_window_init(FlashcardsAppWindow *win)
|
||||
{
|
||||
GArray *categories;
|
||||
|
||||
gtk_widget_init_template(GTK_WIDGET(win));
|
||||
|
||||
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;
|
||||
categories = win->categories;
|
||||
|
||||
for (int i = 0; i < categories->len; i++)
|
||||
{
|
||||
category c = g_array_index(categories, category, i);
|
||||
GtkWidget *child;
|
||||
category c;
|
||||
|
||||
c = g_array_index(categories, category, i);
|
||||
printf("%d: %s\n", c.id, c.name);
|
||||
|
||||
GtkWidget *child = adw_action_row_new();
|
||||
child = adw_action_row_new();
|
||||
adw_preferences_row_set_title(ADW_PREFERENCES_ROW(child), c.name);
|
||||
|
||||
gtk_list_box_append(GTK_LIST_BOX(win->topics), child);
|
||||
|
||||
Reference in New Issue
Block a user