Search
lxdream.org :: lxdream :: r724:f2bc1c7cca14
lxdream 0.9.1
released Jun 29
Download Now
changeset724:f2bc1c7cca14
parent723:a13e5529c52a
child725:4d4018e8eeb8
authornkeynes
dateSun Jul 06 03:17:32 2008 +0000 (11 years ago)
Add descriptive (localized) label to config entries for UI use
src/config.c
src/config.h
src/drivers/audio_alsa.c
src/maple/controller.c
1.1 --- a/src/config.c Sun Jul 06 03:16:21 2008 +0000
1.2 +++ b/src/config.c Sun Jul 06 03:17:32 2008 +0000
1.3 @@ -36,17 +36,17 @@
1.4 gboolean lxdream_save_config_stream( FILE *f );
1.5
1.6 static struct lxdream_config_entry global_config[] =
1.7 - {{ "bios", CONFIG_TYPE_FILE, "dcboot.rom" },
1.8 - { "flash", CONFIG_TYPE_FILE, "dcflash.rom" },
1.9 - { "default path", CONFIG_TYPE_PATH, "." },
1.10 - { "save path", CONFIG_TYPE_PATH, "save" },
1.11 - { "bootstrap", CONFIG_TYPE_FILE, "IP.BIN" },
1.12 - { "gdrom", CONFIG_TYPE_FILE, NULL },
1.13 - { "recent", CONFIG_TYPE_FILE, NULL },
1.14 + {{ "bios", N_("Bios ROM"), CONFIG_TYPE_FILE, "dcboot.rom" },
1.15 + { "flash", N_("Flash ROM"), CONFIG_TYPE_FILE, "dcflash.rom" },
1.16 + { "default path", N_("Default disc path"), CONFIG_TYPE_PATH, "." },
1.17 + { "save path", N_("Save-state path"), CONFIG_TYPE_PATH, "save" },
1.18 + { "bootstrap", N_("Bootstrap IP.BIN"), CONFIG_TYPE_FILE, "IP.BIN" },
1.19 + { "gdrom", NULL, CONFIG_TYPE_FILE, NULL },
1.20 + { "recent", NULL, CONFIG_TYPE_FILE, NULL },
1.21 { NULL, CONFIG_TYPE_NONE }};
1.22
1.23 static struct lxdream_config_entry serial_config[] =
1.24 - {{ "device", CONFIG_TYPE_FILE, "/dev/ttyS1" },
1.25 + {{ "device", N_("Serial device"), CONFIG_TYPE_FILE, "/dev/ttyS1" },
1.26 { NULL, CONFIG_TYPE_NONE }};
1.27
1.28 struct lxdream_config_group lxdream_config_root[] =
1.29 @@ -135,6 +135,11 @@
1.30 lxdream_set_config_value(&global_config[key], value);
1.31 }
1.32
1.33 +const lxdream_config_entry_t lxdream_get_config_entry( int key )
1.34 +{
1.35 + return &global_config[key];
1.36 +}
1.37 +
1.38 gboolean lxdream_set_group_value( lxdream_config_group_t group, const gchar *key, const gchar *value )
1.39 {
1.40 int i;
2.1 --- a/src/config.h Sun Jul 06 03:16:21 2008 +0000
2.2 +++ b/src/config.h Sun Jul 06 03:17:32 2008 +0000
2.3 @@ -20,6 +20,7 @@
2.4 #define lxdream_config_H 1
2.5
2.6 #include <glib/gtypes.h>
2.7 +#include <glib/gi18n.h>
2.8
2.9 #define CONFIG_TYPE_NONE 0
2.10 #define CONFIG_TYPE_FILE 1
2.11 @@ -30,6 +31,7 @@
2.12
2.13 typedef struct lxdream_config_entry {
2.14 const gchar *key;
2.15 + const gchar *label; // i18n
2.16 const int type;
2.17 const gchar *default_value;
2.18 gchar *value;
2.19 @@ -47,11 +49,13 @@
2.20 #define CONFIG_BOOTSTRAP 4
2.21 #define CONFIG_GDROM 5
2.22 #define CONFIG_RECENT 6
2.23 +#define CONFIG_KEY_MAX CONFIG_RECENT
2.24
2.25 extern struct lxdream_config_group lxdream_config_root[];
2.26
2.27 /* Global config values */
2.28 const gchar *lxdream_get_config_value( int key );
2.29 +const lxdream_config_entry_t lxdream_get_config_entry( int key );
2.30
2.31 void lxdream_set_global_config_value( int key, const gchar *value );
2.32 void lxdream_set_config_value( lxdream_config_entry_t entry, const gchar *value );
3.1 --- a/src/drivers/audio_alsa.c Sun Jul 06 03:16:21 2008 +0000
3.2 +++ b/src/drivers/audio_alsa.c Sun Jul 06 03:17:32 2008 +0000
3.3 @@ -32,7 +32,7 @@
3.4
3.5
3.6 struct lxdream_config_entry alsa_config[] = {
3.7 - {"device", CONFIG_TYPE_FILE, "default"},
3.8 + {"device", N_("Audio output device"), CONFIG_TYPE_FILE, "default"},
3.9 {NULL, CONFIG_TYPE_NONE}
3.10 };
3.11
4.1 --- a/src/maple/controller.c Sun Jul 06 03:16:21 2008 +0000
4.2 +++ b/src/maple/controller.c Sun Jul 06 03:17:32 2008 +0000
4.3 @@ -47,21 +47,21 @@
4.4 controller_get_config, controller_attach, controller_detach, controller_destroy,
4.5 controller_clone, NULL, NULL, controller_get_cond, NULL, NULL, NULL },
4.6 {0x0000FFFF, 0x80808080},
4.7 - {{ "dpad left", CONFIG_TYPE_KEY },
4.8 - { "dpad right", CONFIG_TYPE_KEY },
4.9 - { "dpad up", CONFIG_TYPE_KEY },
4.10 - { "dpad down", CONFIG_TYPE_KEY },
4.11 - { "analog left", CONFIG_TYPE_KEY },
4.12 - { "analog right", CONFIG_TYPE_KEY },
4.13 - { "analog up", CONFIG_TYPE_KEY },
4.14 - { "analog down", CONFIG_TYPE_KEY },
4.15 - { "button X", CONFIG_TYPE_KEY },
4.16 - { "button Y", CONFIG_TYPE_KEY },
4.17 - { "button A", CONFIG_TYPE_KEY },
4.18 - { "button B", CONFIG_TYPE_KEY },
4.19 - { "trigger left", CONFIG_TYPE_KEY },
4.20 - { "trigger right", CONFIG_TYPE_KEY },
4.21 - { "start", CONFIG_TYPE_KEY },
4.22 + {{ "dpad left", N_("Dpad left"), CONFIG_TYPE_KEY },
4.23 + { "dpad right", N_("Dpad right"), CONFIG_TYPE_KEY },
4.24 + { "dpad up", N_("Dpad up"), CONFIG_TYPE_KEY },
4.25 + { "dpad down", N_("Dpad down"), CONFIG_TYPE_KEY },
4.26 + { "analog left", N_("Analog left"), CONFIG_TYPE_KEY },
4.27 + { "analog right", N_("Analog right"), CONFIG_TYPE_KEY },
4.28 + { "analog up", N_("Analog up"), CONFIG_TYPE_KEY },
4.29 + { "analog down", N_("Analog down"), CONFIG_TYPE_KEY },
4.30 + { "button X", N_("Button X"), CONFIG_TYPE_KEY },
4.31 + { "button Y", N_("Button Y"), CONFIG_TYPE_KEY },
4.32 + { "button A", N_("Button A"), CONFIG_TYPE_KEY },
4.33 + { "button B", N_("Button B"), CONFIG_TYPE_KEY },
4.34 + { "trigger left", N_("Trigger left"), CONFIG_TYPE_KEY },
4.35 + { "trigger right", N_("Trigger right"), CONFIG_TYPE_KEY },
4.36 + { "start", N_("Start button"), CONFIG_TYPE_KEY },
4.37 { NULL, CONFIG_TYPE_NONE }} };
4.38
4.39 #define CONTROLLER(x) ((controller_device_t)(x))
.