From 60f0be3085d6c95cc77e140917e618950441c9ed Mon Sep 17 00:00:00 2001 From: "Zeeshan Ali (Khattak)" Date: Fri, 5 Jun 2009 02:10:26 +0300 Subject: [PATCH] core,ui,media-export: No more specific to folders The FileChooser dialog however still only lets you choose folders. I have no idea how to make it let user be able to choose both folder and files. --- data/rygel-preferences.ui | 12 ++++----- data/rygel.schemas | 8 +++--- .../rygel-media-export-root-container.vala | 2 +- src/ui/rygel-media-export-pref-section.vala | 30 +++++++++++----------- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/data/rygel-preferences.ui b/data/rygel-preferences.ui index 33f0dc9..3876427 100644 --- a/data/rygel-preferences.ui +++ b/data/rygel-preferences.ui @@ -2,7 +2,7 @@ - + @@ -368,12 +368,12 @@ - + True 0 0 12 - F_olders + _URIs True @@ -386,10 +386,10 @@ True 12 - + True True - folders-liststore + uris-liststore False False True @@ -528,7 +528,7 @@ 10 10 - + True True 5 diff --git a/data/rygel.schemas b/data/rygel.schemas index fcf65d2..89f9f42 100644 --- a/data/rygel.schemas +++ b/data/rygel.schemas @@ -111,15 +111,15 @@ - /schemas/apps/rygel/MediaExport/folders - /apps/rygel/MediaExport/folders + /schemas/apps/rygel/MediaExport/uris + /apps/rygel/MediaExport/uris rygel list string [] - List of folders to export - List of folders to export; if list is empty, the XDG media directries are exported + List of URIs to export + List of URIs to export; if list is empty, the XDG media directries are exported diff --git a/src/plugins/media-export/rygel-media-export-root-container.vala b/src/plugins/media-export/rygel-media-export-root-container.vala index f48501b..8d4cf2b 100644 --- a/src/plugins/media-export/rygel-media-export-root-container.vala +++ b/src/plugins/media-export/rygel-media-export-root-container.vala @@ -93,7 +93,7 @@ public class Rygel.MediaExportRootContainer : MediaContainer { this.children = new ArrayList (); var config = Rygel.Configuration.get_default (); - var uris = config.get_string_list ("MediaExport", "folders"); + var uris = config.get_string_list ("MediaExport", "uris"); // either an error occured or the gconf key is not set if (uris.size == 0) { diff --git a/src/ui/rygel-media-export-pref-section.vala b/src/ui/rygel-media-export-pref-section.vala index 8d4df4c..55fa7be 100644 --- a/src/ui/rygel-media-export-pref-section.vala +++ b/src/ui/rygel-media-export-pref-section.vala @@ -25,10 +25,10 @@ using Gee; public class Rygel.MediaExportPrefSection : Rygel.PluginPrefSection { const string NAME = "MediaExport"; - const string FOLDERS_KEY = "folders"; - const string FOLDERS_TEXTVIEW = FOLDERS_KEY + "-treeview"; - const string FOLDERS_LISTSTORE = FOLDERS_KEY + "-liststore"; - const string FOLDERS_DIALOG = FOLDERS_KEY + "-dialog"; + const string URIS_KEY = "uris"; + const string URIS_TEXTVIEW = URIS_KEY + "-treeview"; + const string URIS_LISTSTORE = URIS_KEY + "-liststore"; + const string URIS_DIALOG = URIS_KEY + "-dialog"; const string ADD_BUTTON = "add-button"; const string REMOVE_BUTTON = "remove-button"; const string CLEAR_BUTTON = "clear-button"; @@ -41,11 +41,11 @@ public class Rygel.MediaExportPrefSection : Rygel.PluginPrefSection { Configuration config) { base (builder, config, NAME); - this.treeview = (TreeView) builder.get_object (FOLDERS_TEXTVIEW); + this.treeview = (TreeView) builder.get_object (URIS_TEXTVIEW); assert (this.treeview != null); - this.liststore = (ListStore) builder.get_object (FOLDERS_LISTSTORE); + this.liststore = (ListStore) builder.get_object (URIS_LISTSTORE); assert (this.liststore != null); - this.dialog = (FileChooserDialog) builder.get_object (FOLDERS_DIALOG); + this.dialog = (FileChooserDialog) builder.get_object (URIS_DIALOG); assert (this.dialog != null); treeview.insert_column_with_attributes (-1, @@ -55,12 +55,12 @@ public class Rygel.MediaExportPrefSection : Rygel.PluginPrefSection { 0, null); - var folders = config.get_string_list (this.name, FOLDERS_KEY); - foreach (var folder in folders) { + var uris = config.get_string_list (this.name, URIS_KEY); + foreach (var uri in uris) { TreeIter iter; this.liststore.append (out iter); - this.liststore.set (iter, 0, folder, -1); + this.liststore.set (iter, 0, uri, -1); } var button = (Button) builder.get_object (ADD_BUTTON); @@ -77,18 +77,18 @@ public class Rygel.MediaExportPrefSection : Rygel.PluginPrefSection { base.save (); TreeIter iter; - var folder_list = new ArrayList (); + var uri_list = new ArrayList (); if (this.liststore.get_iter_first (out iter)) { do { - string folder; + string uri; - this.liststore.get (iter, 0, out folder, -1); - folder_list.add (folder); + this.liststore.get (iter, 0, out uri, -1); + uri_list.add (uri); } while (this.liststore.iter_next (ref iter)); } - this.config.set_string_list (this.name, FOLDERS_KEY, folder_list); + this.config.set_string_list (this.name, URIS_KEY, uri_list); } protected override void on_enabled_check_toggled ( -- 2.7.4