From 517ad73e64c0d620c5574c837ec265c37fab4340 Mon Sep 17 00:00:00 2001 From: Maximilian Mader Date: Mon, 30 Sep 2019 22:30:33 +0200 Subject: [PATCH] [GTK3] Make dummy preference callbacks functional --- gtk3/main.c | 9 +++++---- gtk3/settings.c | 2 +- gtk3/settings.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gtk3/main.c b/gtk3/main.c index 474c41f..576a363 100644 --- a/gtk3/main.c +++ b/gtk3/main.c @@ -278,6 +278,7 @@ static void setup_menu(GApplication *app) { g_print("Showing hamburger\n"); // Attach a custom title bar GtkWidget *titlebar = gtkget(GTK_WIDGET, "main_header_bar"); + gtk_header_bar_set_title(GTK_HEADER_BAR(titlebar), gtk_window_get_title(GTK_WINDOW(main_window))); gtk_window_set_titlebar(GTK_WINDOW(main_window), titlebar); // Disable menubar @@ -769,7 +770,7 @@ G_MODULE_EXPORT void on_boot_rom_location_changed(GtkWidget *w, gpointer user_da G_MODULE_EXPORT void on_cgb_model_changed(GtkWidget *w, gpointer user_data_gptr) { GtkComboBox *box = GTK_COMBO_BOX(w); - g_print("New value: %s\n", gtk_combo_box_get_active_id(box)); + config.cgb_revision_name = (gchar *)gtk_combo_box_get_active_id(box); } G_MODULE_EXPORT void on_color_correction_changed(GtkWidget *w, gpointer user_data_gptr) { @@ -787,7 +788,7 @@ G_MODULE_EXPORT void on_color_menubar_override_changed(GtkWidget *w, gpointer us G_MODULE_EXPORT void on_dmg_model_changed(GtkWidget *w, gpointer user_data_gptr) { GtkComboBox *box = GTK_COMBO_BOX(w); - g_print("New value: %s\n", gtk_combo_box_get_active_id(box)); + config.dmg_revision_name = (gchar *)gtk_combo_box_get_active_id(box); } G_MODULE_EXPORT void on_graphic_filter_changed(GtkWidget *w, gpointer user_data_gptr) { @@ -814,12 +815,12 @@ G_MODULE_EXPORT void on_keep_aspect_ratio_changed(GtkWidget *w, gpointer user_da G_MODULE_EXPORT void on_rewind_duration_changed(GtkWidget *w, gpointer user_data_gptr) { GtkComboBox *box = GTK_COMBO_BOX(w); - g_print("New value: %s\n", gtk_combo_box_get_active_id(box)); + config.rewind_duration = g_ascii_strtoll(gtk_combo_box_get_active_id(box), NULL, 10); } G_MODULE_EXPORT void on_sgb_model_changed(GtkWidget *w, gpointer user_data_gptr) { GtkComboBox *box = GTK_COMBO_BOX(w); - g_print("New value: %s\n", gtk_combo_box_get_active_id(box)); + config.sgb_revision_name = (gchar *)gtk_combo_box_get_active_id(box); } G_MODULE_EXPORT void on_use_integer_scaling_changed(GtkWidget *w, gpointer user_data_gptr) { diff --git a/gtk3/settings.c b/gtk3/settings.c index 95a7b93..abcb0fc 100644 --- a/gtk3/settings.c +++ b/gtk3/settings.c @@ -91,7 +91,7 @@ void save_config_to_key_file(config_t *config, GKeyFile *key_file) { #undef EXPAND_GROUP_MEMBER_IF_1 } -G_MODULE_EXPORT void on_preferences_realize(GtkWidget *w, gpointer builder_ptr) { +void on_preferences_realize(GtkWidget *w, gpointer builder_ptr) { GtkWindow *preferences = GTK_WINDOW(w); GtkBuilder *builder = (GtkBuilder *) builder_ptr; diff --git a/gtk3/settings.h b/gtk3/settings.h index 2dd2e58..af84153 100644 --- a/gtk3/settings.h +++ b/gtk3/settings.h @@ -69,7 +69,7 @@ gchar* settings_file_path; GKeyFile *key_file; config_t config; -G_MODULE_EXPORT void on_preferences_realize(GtkWidget *w, gpointer builder_ptr); +void on_preferences_realize(GtkWidget *w, gpointer builder_ptr); void print_config(config_t *config); void load_config_from_key_file(config_t *config, GKeyFile *key_file);