From: P. F. Chimento Date: Thu, 10 Mar 2011 05:59:01 +0000 (+0100) Subject: Load preferred interpreters from preferences X-Git-Tag: v0.9~123 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=fd477d5430c84dd4bd9b099bb90acfa554a54635;p=projects%2Fchimara%2Fchimara.git Load preferred interpreters from preferences Not editable yet, but that's the next step. --- diff --git a/player/chimara.ui b/player/chimara.ui index 44fca73..b2123ab 100644 --- a/player/chimara.ui +++ b/player/chimara.ui @@ -244,9 +244,9 @@ Philip Chimento - + - + @@ -796,6 +796,28 @@ Philip Chimento False False True + + + Format + + + + 0 + + + + + + + Interpreter + + + + 1 + + + + diff --git a/player/preferences.c b/player/preferences.c index f2cbaf0..ef8b67f 100644 --- a/player/preferences.c +++ b/player/preferences.c @@ -98,6 +98,18 @@ preferences_create(ChimaraGlk *glk) gtk_file_chooser_set_filename(blorb_chooser, filename); g_free(filename); } + + /* Initialize the list of preferred interpreters */ + GtkListStore *interp_list = GTK_LIST_STORE( load_object("interpreters") ); + GVariantIter *iter; + char *format, *plugin; + g_settings_get(prefs_settings, "preferred-interpreters", "a{ss}", &iter); + while(g_variant_iter_loop(iter, "{ss}", &format, &plugin)) { + GtkTreeIter tree_iter; + gtk_list_store_append(interp_list, &tree_iter); + gtk_list_store_set(interp_list, &tree_iter, 0, format, 1, plugin, -1); + } + g_variant_iter_free(iter); } static void