From 7bd7331c03ce7f892b2364a561f5d9cde668a553 Mon Sep 17 00:00:00 2001 From: butterkeks Date: Thu, 22 Aug 2024 21:28:23 +0200 Subject: [PATCH] Fix wrong callback arguments --- src/frontends/gtk3popup/callbacks.c | 2 +- src/frontends/gtk3popup/ui_manager.c | 10 +++++----- src/frontends/gtk3popup/ui_manager.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/frontends/gtk3popup/callbacks.c b/src/frontends/gtk3popup/callbacks.c index b2a4670..b981691 100644 --- a/src/frontends/gtk3popup/callbacks.c +++ b/src/frontends/gtk3popup/callbacks.c @@ -73,7 +73,7 @@ void add_to_anki_activated(GSimpleAction *action, GVariant *parameter, gpointer show_copy_sentence_dialog(); } -static void on_add_to_anki_from_clipboard(void *user_data) { +static void on_add_to_anki_from_clipboard(GtkMenuItem *self, gpointer user_data) { DpApplication *app = DP_APPLICATION(user_data); if (!ac_check_connection()) { diff --git a/src/frontends/gtk3popup/ui_manager.c b/src/frontends/gtk3popup/ui_manager.c index 447dfc0..f81d67f 100644 --- a/src/frontends/gtk3popup/ui_manager.c +++ b/src/frontends/gtk3popup/ui_manager.c @@ -164,13 +164,13 @@ typedef struct { PageManager *pm; } DelayedUpdatesArgs; -static gboolean refresh_exists_dot(UiManager *self, PageManager *pm) { +static void refresh_exists_dot(UiManager *self, PageManager *pm) { AnkiCollectionStatus status = pm_get_current_anki_status_nolock(pm); self->current_anki_status_color = map_ac_status_to_color(status); gtk_widget_queue_draw(self->anki_status_dot); } -static gboolean refresh_pron_button(UiManager *self, PageManager *pm) { +static void refresh_pron_button(UiManager *self, PageManager *pm) { Pronfile *pronfiles = pm_get_current_pronfiles_ref(pm); if (pronfiles) { enable_button(self->btn_pronounce); @@ -224,7 +224,7 @@ static gboolean _ui_refresh_impl(gpointer data) { return G_SOURCE_REMOVE; } -void ui_queue_quick_updates(UiManager *self, PageManager *pm) { +static void ui_queue_quick_updates(UiManager *self, PageManager *pm) { struct ui_refresh_args_s *args = new (struct ui_refresh_args_s, 1); args->self = self; args->pm = pm; @@ -320,8 +320,8 @@ void ui_manager_show_edit_lookup_dialog(UiManager *self, const char *current_loo /* -------------- ANKI BUTTON RIGHT CLICK MENU ---------------- */ void ui_manager_show_anki_button_right_click_menu(UiManager *self, - void (*on_clipboard_definition)(void *user_data), - void *user_data) { + void (*on_clipboard_definition)(GtkMenuItem *self, gpointer user_data), + gpointer user_data) { GtkWidget *menu = gtk_menu_new(); GtkWidget *menu_item = gtk_menu_item_new_with_label("Add with clipboard content as definition"); diff --git a/src/frontends/gtk3popup/ui_manager.h b/src/frontends/gtk3popup/ui_manager.h index 6de9991..65b51ff 100644 --- a/src/frontends/gtk3popup/ui_manager.h +++ b/src/frontends/gtk3popup/ui_manager.h @@ -39,8 +39,8 @@ void _nonnull_ ui_manager_set_error(UiManager *self, s8 message); void show_pronunciation_button_right_click_menu(UiManager *self, Pronfile *pronfiles); void ui_manager_show_anki_button_right_click_menu(UiManager *self, - void (*on_clipboard_definition)(void *user_data), - void *user_data); + void (*on_clipboard_definition)(GtkMenuItem *self, gpointer user_data), + gpointer user_data); void ui_manager_show_edit_lookup_dialog(UiManager *self, const char *current_lookup, void (*on_accept)(const char *new_lookup, void *user_data),