From: P. F. Chimento Date: Thu, 10 Mar 2011 21:45:19 +0000 (+0100) Subject: List all available formats in dialog X-Git-Tag: v0.9~119 X-Git-Url: https://git.stderr.nl/gitweb?p=projects%2Fchimara%2Fchimara.git;a=commitdiff_plain;h=e3b92c018add5953f6055efe5b3fc4eafab46b0f List all available formats in dialog --- diff --git a/player/preferences.c b/player/preferences.c index 5ee62ed..6287f77 100644 --- a/player/preferences.c +++ b/player/preferences.c @@ -167,17 +167,26 @@ preferences_create(ChimaraGlk *glk) /* Populate the list of available interpreters */ GtkListStore *interp_list = GTK_LIST_STORE( load_object("available_interpreters") ); - unsigned int interp; + unsigned int count; GtkTreeIter tree_iter; - for(interp = 0; interp < CHIMARA_IF_NUM_INTERPRETERS; interp++) { + for(count = 0; count < CHIMARA_IF_NUM_INTERPRETERS; count++) { gtk_list_store_append(interp_list, &tree_iter); gtk_list_store_set(interp_list, &tree_iter, - 0, interpreter_to_display_string(interp), + 0, interpreter_to_display_string(count), -1); } /* Initialize the list of preferred interpreters */ GtkListStore *preferred_list = GTK_LIST_STORE( load_object("interpreters") ); + for(count = 0; count < CHIMARA_IF_NUM_FORMATS; count++) { + gtk_list_store_append(preferred_list, &tree_iter); + gtk_list_store_set(preferred_list, &tree_iter, + 0, format_to_display_string(count), + 1, _("Unknown"), + -1); + } + + /* Get the list of preferred interpreters from the preferences */ GVariantIter *iter; char *format, *plugin; g_settings_get(prefs_settings, "preferred-interpreters", "a{ss}", &iter); @@ -188,9 +197,10 @@ preferences_create(ChimaraGlk *glk) ChimaraIFInterpreter interp_num = parse_interpreter(plugin); if(interp_num == CHIMARA_IF_INTERPRETER_NONE) continue; - gtk_list_store_append(preferred_list, &tree_iter); + GtkTreePath *path = gtk_tree_path_new_from_indices(format_num, -1); + gtk_tree_model_get_iter(GTK_TREE_MODEL(preferred_list), &tree_iter, path); + gtk_tree_path_free(path); gtk_list_store_set(preferred_list, &tree_iter, - 0, format_to_display_string(format_num), 1, interpreter_to_display_string(interp_num), -1); }