From 7a64ed801d8322523907acf192e5a06b9702ac9c Mon Sep 17 00:00:00 2001 From: Brandon Wright Date: Wed, 14 Nov 2018 14:51:39 -0600 Subject: [PATCH] GTK+: Don't translate config file entries. --- gtk/src/gtk_binding.cpp | 5 ++++- gtk/src/gtk_binding.h | 2 +- gtk/src/gtk_config.cpp | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gtk/src/gtk_binding.cpp b/gtk/src/gtk_binding.cpp index da9afb83..78e3e1df 100644 --- a/gtk/src/gtk_binding.cpp +++ b/gtk/src/gtk_binding.cpp @@ -211,11 +211,14 @@ Binding::Binding (const char *raw_string) } void -Binding::to_string (char *str) +Binding::to_string (char *str, bool translate) { char buf[256]; char *c; +#undef _ +#define _(String) translate ? gettext(String) : (String) + str[0] = '\0'; if (is_key ()) diff --git a/gtk/src/gtk_binding.h b/gtk/src/gtk_binding.h index 7acad208..4ba357b7 100644 --- a/gtk/src/gtk_binding.h +++ b/gtk/src/gtk_binding.h @@ -35,7 +35,7 @@ class Binding Binding (unsigned int); Binding (); Binding (const char *str); - void to_string (char *str); + void to_string (char *str, bool translate = true); unsigned int hex (); unsigned int base_hex (); bool matches (Binding &binding); diff --git a/gtk/src/gtk_config.cpp b/gtk/src/gtk_config.cpp index 05f13859..d3c3547c 100644 --- a/gtk/src/gtk_config.cpp +++ b/gtk/src/gtk_config.cpp @@ -425,7 +425,7 @@ int Snes9xConfig::save_config_file () for (int j = 0; j < NUM_JOYPAD_LINKS; j++) { snprintf (key, PATH_MAX, "Joypad %d::%s", i, b_links[j].snes9x_name); - joypad[j].to_string (buffer); + joypad[j].to_string (buffer, false); cf.SetString (key, std::string (buffer)); } } @@ -433,7 +433,7 @@ int Snes9xConfig::save_config_file () for (int i = NUM_JOYPAD_LINKS; b_links[i].snes9x_name; i++) { snprintf (key, PATH_MAX, "Shortcuts::%s", b_links[i].snes9x_name); - shortcut[i - NUM_JOYPAD_LINKS].to_string (buffer); + shortcut[i - NUM_JOYPAD_LINKS].to_string (buffer, false); cf.SetString (key, std::string (buffer)); }