From: P. F. Chimento Date: Thu, 10 Mar 2011 21:26:53 +0000 (+0100) Subject: Dynamically generate list of interpreters X-Git-Tag: v0.9~120 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=82bf403ab4af1f293c0e1eda447613242c48cda9;p=projects%2Fchimara%2Fchimara.git Dynamically generate list of interpreters --- diff --git a/player/chimara.ui b/player/chimara.ui index 1a1bf73..277a23c 100644 --- a/player/chimara.ui +++ b/player/chimara.ui @@ -254,20 +254,6 @@ Philip Chimento - - - Frotz - - - Nitfol - - - Glulxe - - - Git - - False diff --git a/player/preferences.c b/player/preferences.c index 1c1527d..5ee62ed 100644 --- a/player/preferences.c +++ b/player/preferences.c @@ -165,8 +165,19 @@ preferences_create(ChimaraGlk *glk) g_free(filename); } + /* Populate the list of available interpreters */ + GtkListStore *interp_list = GTK_LIST_STORE( load_object("available_interpreters") ); + unsigned int interp; + GtkTreeIter tree_iter; + for(interp = 0; interp < CHIMARA_IF_NUM_INTERPRETERS; interp++) { + gtk_list_store_append(interp_list, &tree_iter); + gtk_list_store_set(interp_list, &tree_iter, + 0, interpreter_to_display_string(interp), + -1); + } + /* Initialize the list of preferred interpreters */ - GtkListStore *interp_list = GTK_LIST_STORE( load_object("interpreters") ); + GtkListStore *preferred_list = GTK_LIST_STORE( load_object("interpreters") ); GVariantIter *iter; char *format, *plugin; g_settings_get(prefs_settings, "preferred-interpreters", "a{ss}", &iter); @@ -177,9 +188,8 @@ preferences_create(ChimaraGlk *glk) ChimaraIFInterpreter interp_num = parse_interpreter(plugin); if(interp_num == CHIMARA_IF_INTERPRETER_NONE) continue; - GtkTreeIter tree_iter; - gtk_list_store_append(interp_list, &tree_iter); - gtk_list_store_set(interp_list, &tree_iter, + gtk_list_store_append(preferred_list, &tree_iter); + gtk_list_store_set(preferred_list, &tree_iter, 0, format_to_display_string(format_num), 1, interpreter_to_display_string(interp_num), -1);