[GTK3] Fix some menu entries

This commit is contained in:
Maximilian Mader 2021-01-02 23:38:06 +01:00
parent 46821dd49a
commit f45613f715
Signed by: Max
GPG Key ID: F71D56A3151C4FB3
2 changed files with 19 additions and 3 deletions

View File

@ -360,6 +360,7 @@ static void rumble_callback(GB_gameboy_t *gb, double amp) {
// because the UI definition cant 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;

View File

@ -308,7 +308,7 @@ Maximilian Mader https://github.com/max-m</property>
</object>
</child>
<child>
<object class="GtkMenuItem">
<object class="GtkCheckMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action_name">app.pause</property>
@ -390,7 +390,7 @@ Maximilian Mader https://github.com/max-m</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkMenuItem">
<object class="GtkCheckMenuItem">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="action_name">app.toggle_developer_mode</property>