[grilo] test-ui: Load settings from file
- From: Juan A. Suarez Romero <jasuarez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo] test-ui: Load settings from file
- Date: Tue, 13 Dec 2011 16:50:50 +0000 (UTC)
commit 76bb6fc28debdd063bb1f271bec40d2ff6e81cb9
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date: Tue Dec 13 11:11:17 2011 +0000
test-ui: Load settings from file
Besides the hard-coded settings in Grilo Test UI application, we load settings
stored in $HOME/.config/grilo-test-ui/grilo.conf file.
Thus, user can store it his own settings to be used.
Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>
tools/grilo-test-ui/main.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/tools/grilo-test-ui/main.c b/tools/grilo-test-ui/main.c
index 05d5d63..6c8040b 100644
--- a/tools/grilo-test-ui/main.c
+++ b/tools/grilo-test-ui/main.c
@@ -1407,6 +1407,23 @@ activate_ok_button (GtkLabel *label,
gtk_widget_set_sensitive (user_data, TRUE);
}
+static void
+load_file_config (void)
+{
+ GrlPluginRegistry *registry;
+ gchar *config_file;
+
+ registry = grl_plugin_registry_get_default ();
+ config_file = g_strconcat (g_get_user_config_dir(),
+ G_DIR_SEPARATOR_S, "grilo-test-ui",
+ G_DIR_SEPARATOR_S, "grilo.conf",
+ NULL);
+ if (g_file_test (config_file, G_FILE_TEST_EXISTS)) {
+ grl_plugin_registry_add_config_from_file (registry, config_file, NULL);
+ }
+ g_free (config_file);
+}
+
static gchar *
authorize_flickr (void)
{
@@ -2068,6 +2085,7 @@ load_all_plugins ()
static void
configure_plugins ()
{
+ load_file_config();
set_flickr_config ();
set_youtube_config ();
set_vimeo_config ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]