Skip to content

Commit

Permalink
Fix wrong callback arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
btrkeks committed Aug 22, 2024
1 parent c23f3ca commit 7bd7331
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/frontends/gtk3popup/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
10 changes: 5 additions & 5 deletions src/frontends/gtk3popup/ui_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/frontends/gtk3popup/ui_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 7bd7331

Please sign in to comment.