GTK+: Don't translate config file entries.

This commit is contained in:
Brandon Wright 2018-11-14 14:51:39 -06:00
parent a9adb88e25
commit 7a64ed801d
3 changed files with 7 additions and 4 deletions

View File

@ -211,11 +211,14 @@ Binding::Binding (const char *raw_string)
} }
void void
Binding::to_string (char *str) Binding::to_string (char *str, bool translate)
{ {
char buf[256]; char buf[256];
char *c; char *c;
#undef _
#define _(String) translate ? gettext(String) : (String)
str[0] = '\0'; str[0] = '\0';
if (is_key ()) if (is_key ())

View File

@ -35,7 +35,7 @@ class Binding
Binding (unsigned int); Binding (unsigned int);
Binding (); Binding ();
Binding (const char *str); Binding (const char *str);
void to_string (char *str); void to_string (char *str, bool translate = true);
unsigned int hex (); unsigned int hex ();
unsigned int base_hex (); unsigned int base_hex ();
bool matches (Binding &binding); bool matches (Binding &binding);

View File

@ -425,7 +425,7 @@ int Snes9xConfig::save_config_file ()
for (int j = 0; j < NUM_JOYPAD_LINKS; j++) for (int j = 0; j < NUM_JOYPAD_LINKS; j++)
{ {
snprintf (key, PATH_MAX, "Joypad %d::%s", i, b_links[j].snes9x_name); 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)); 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++) for (int i = NUM_JOYPAD_LINKS; b_links[i].snes9x_name; i++)
{ {
snprintf (key, PATH_MAX, "Shortcuts::%s", b_links[i].snes9x_name); 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)); cf.SetString (key, std::string (buffer));
} }