diff --git a/gtk3/main.c b/gtk3/main.c index 766052f..4be2ff3 100644 --- a/gtk3/main.c +++ b/gtk3/main.c @@ -360,6 +360,7 @@ static void rumble_callback(GB_gameboy_t *gb, double amp) { // because the UI definition can’t define string arguments for signal handlers. static void create_model_menu_items() { bool on_change_model(GtkWidget *, gpointer); + bool on_change_linked_device(GtkWidget *, gpointer); static const char *const model_names[] = { "Game Boy", @@ -402,7 +403,7 @@ static void create_model_menu_items() { CheckMenuItemGroup *link_group = check_menu_item_group_new((char **) peripheral_names, (char **) peripheral_codes); check_menu_item_group_insert_into_menu_shell(link_group, GTK_MENU_SHELL(builder_get(GTK_MENU_SHELL, "link_menu")), 0); - // check_menu_item_group_connect_toggle_signal(link_group, on_change_linked_device); + check_menu_item_group_connect_toggle_signal(link_group, on_change_linked_device); check_menu_item_group_activate(link_group, "NONE"); } @@ -1083,6 +1084,21 @@ G_MODULE_EXPORT void on_quit_activate(GtkWidget *w, gpointer user_data_ptr) { quit(); } +bool on_change_linked_device(GtkWidget *widget, gpointer user_data) { + GtkCheckMenuItem *check_menu_item = GTK_CHECK_MENU_ITEM(widget); + + if (!gtk_check_menu_item_get_active(check_menu_item)) { + return true; + } + else if (!GB_is_inited(&gb)) { + return false; + } + + g_message("Not yet implemented"); + + return false; +} + bool on_change_model(GtkWidget *widget, gpointer user_data) { GtkCheckMenuItem *check_menu_item = GTK_CHECK_MENU_ITEM(widget); gchar *model_str = (gchar *) user_data; diff --git a/gtk3/resources/ui/window.ui b/gtk3/resources/ui/window.ui index 63fe238..199256d 100644 --- a/gtk3/resources/ui/window.ui +++ b/gtk3/resources/ui/window.ui @@ -308,7 +308,7 @@ Maximilian Mader https://github.com/max-m - + True False app.pause @@ -390,7 +390,7 @@ Maximilian Mader https://github.com/max-m True False - + True False app.toggle_developer_mode