mirror of
https://gitlab.cvh-server.de/skrause/flashcards.git
synced 2025-12-12 09:01:37 +01:00
add missing icons, cleanup translations, fix last little issues, prepare for documentation
This commit is contained in:
@@ -71,10 +71,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 +84,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 +114,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 +203,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 +218,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);
|
||||
|
||||
Reference in New Issue
Block a user