[banshee/gsettings: 1/7] Switch to a new approach for using GSettings



commit 3ef4ecd5f5e0c9c67ad070425a17ff11d91cd8bc
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Fri Oct 11 14:36:15 2013 +0200

    Switch to a new approach for using GSettings
    
    With GSettings, every setting item must correspond to a predefined
    schema. As we were quite liberal in our use of configuration entries,
    this causes some challenges.
    
    So this commits introduces a new approach, based on a few principles:
     * Schema definition is maintained manually
     * Everything is relocatable
     * Path structure must match schema id
    
    In GSettings, a schema normally has a fixed path that determines where
    the settings are stored in the global tree of settings. However, schemas
    can also be 'relocatable', i.e. not equipped with a fixed path.
    
    We need to use relocatable schemas quite a lot. For example, each source
    has its own set of preferences, located under a node that is the unique
    identifier of the source. And the set of possible sources is unknown:
    one for each DAP device, each DAAP server, etc.
    
    So instead of trying to figure out which schema is relocatable, we just
    assume all of them are.
    
    Preferences are accessed by their namespace, which is converted to a
    path. Then we try to find an existing schema id by assuming they have
    the same structure, and going up the tree until we find a match.
    So for example, the path
      /org/gnome/banshee/sources/Foo/Bar
    will correspond to the schema with the id
       org.gnome.banshee.sources
    This means that preferences must always have a path that matches their
    schema id.
    
    Automatically extracting the schema from the code will not work without
    major impact on everything using preferences: we can't figure out both
    the schema id and the path without those notions leaking out everywhere
    in the code base.
    
    So I just used the GSettingsSchemaExtractor to get a first rough cut of
    the schema, and edited it manually to add all the keys that were not
    extracted automatically. Missing keys are easy to find, as GSettings
    just aborts when trying to read a key not defined in the schema.
    
    That means that the GSettingsSchemaExtractor are the related
    infrastructure can be removed.
    
    The build system is also modified so that the schema file gets
    translated and included in the source tarball.
    
    Also updated Hyena to bring in the latest git master which doesn't
    reference GConf at all anymore.

 .gitignore                                         |    2 +
 Makefile.am                                        |    2 +-
 build/GSettingsSchemaExtractor.cs                  |  345 ----------
 build/GSettingsSchemaExtractorTests.cs             |  292 --------
 build/Makefile.am                                  |   10 -
 build/m4/banshee/gconf.m4                          |   20 -
 configure.ac                                       |    7 +-
 data/Makefile.am                                   |   11 +-
 data/org.gnome.banshee.gschema.xml.in              |  720 ++++++++++++++++++++
 po/POTFILES.in                                     |    3 +-
 po/sort-potfiles                                   |    2 +-
 src/Backends/Banshee.Gnome/Banshee.Gnome.addin.xml |    2 +-
 src/Backends/Banshee.Gnome/Banshee.Gnome.csproj    |    4 +-
 .../GConfConfigurationClient.cs                    |  147 ----
 .../GSettingsConfigurationClient.cs                |  123 ++++
 src/Backends/Banshee.Gnome/Makefile.am             |    4 +-
 src/Core/Banshee.ThickClient/Makefile.am           |    4 -
 src/Hyena                                          |    2 +-
 18 files changed, 866 insertions(+), 834 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 7584ed1..b4a01b4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -77,3 +77,5 @@ build/windows/*.msi
 data/desktop-files/*.desktop
 data/audio-profiles/*.xml
 data/banshee.appdata.xml
+data/org.gnome.banshee.gschema.valid
+data/org.gnome.banshee.gschema.xml
diff --git a/Makefile.am b/Makefile.am
index 7fc9ba1..652601c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -109,7 +109,7 @@ csharp:
        @pushd .; \
     echo ""; \
     echo "Starting csharp with Gtk#, Hyena, Banshee, etc referenced"; \
-    csharp -lib:bin/ -pkg:glib-sharp-2.0 -pkg:gtk-sharp-2.0 -pkg:gconf-sharp-2.0 -pkg:dbus-sharp 
-pkg:taglib-sharp -pkg:ipod-sharp -pkg:mono-addins $(addprefix "-reference:", $(wildcard bin/*.dll)); \
+    csharp -lib:bin/ -pkg:glib-sharp-2.0 -pkg:gtk-sharp-2.0 -pkg:dbus-sharp -pkg:taglib-sharp 
-pkg:ipod-sharp -pkg:mono-addins $(addprefix "-reference:", $(wildcard bin/*.dll)); \
        popd;
 
 test: all
diff --git a/build/Makefile.am b/build/Makefile.am
index 2eea957..d3c2ef0 100644
--- a/build/Makefile.am
+++ b/build/Makefile.am
@@ -1,19 +1,11 @@
 SUBDIRS = pkg-config m4
 
-GCONF_SCHEMA_EXTRACTOR_ASSEMBLY = gconf-schema-extractor.exe
 TRANSLATOR_EXTRACTOR_ASSEMBLY = translator-extractor.exe
 ADDIN_XML_STRING_EXTRACTOR_ASSEMBLY = addin-xml-string-extractor.exe
 GOBJECT_INTPTR_CTOR_VERIFIER_ASSEMBLY = gobject-intptr-ctor-verifier.exe
 
 ALL_TARGETS = $(TRANSLATOR_EXTRACTOR_ASSEMBLY) $(DLL_MAP_VERIFIER_ASSEMBLY) 
$(ADDIN_XML_STRING_EXTRACTOR_ASSEMBLY) $(GOBJECT_INTPTR_CTOR_VERIFIER_ASSEMBLY)
 
-if GCONF_SCHEMAS_INSTALL
-bansheedir = $(pkglibdir)
-banshee_SCRIPTS = $(GCONF_SCHEMA_EXTRACTOR_ASSEMBLY)
-$(GCONF_SCHEMA_EXTRACTOR_ASSEMBLY): GConfSchemaExtractor.cs
-       $(MCS) -out:$@ $<
-endif
-
 $(TRANSLATOR_EXTRACTOR_ASSEMBLY): TranslatorExtractor.cs
        if [ "x$(top_srcdir)" = "x$(top_builddir)" ]; then \
                $(MCS) -out:$@ $< && LC_ALL=en_US.UTF-8 $(MONO) $@ $(top_builddir)/po > \
@@ -29,13 +21,11 @@ $(GOBJECT_INTPTR_CTOR_VERIFIER_ASSEMBLY): GObjectIntPtrCtorVerifier.cs
 EXTRA_DIST = \
        icon-theme-installer \
        private-icon-theme-installer \
-       GConfSchemaExtractor.cs \
        TranslatorExtractor.cs \
        DllMapVerifier.cs \
        AddinXmlStringExtractor.cs \
        GObjectIntPtrCtorVerifier.cs \
        dll-map-makefile-verifier \
-       gconf-schema-rules \
        gnome-doc-utils.make
 
 CLEANFILES = *.exe *.mdb
diff --git a/configure.ac b/configure.ac
index 02cb201..0077700 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,7 +33,7 @@ AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([build/m4])
 AC_SUBST([ACLOCAL_AMFLAGS], ["-I build/m4/shamrock -I build/m4/banshee -I build/m4/shave \${ACLOCAL_FLAGS}"])
 
-IT_PROG_INTLTOOL([0.35.0])
+IT_PROG_INTLTOOL([0.50.1])
 AC_PROG_LIBTOOL
 AC_PROG_INSTALL
 
@@ -136,11 +136,9 @@ dnl GNOME (optional)
 AC_ARG_ENABLE(gnome, AC_HELP_STRING([--disable-gnome], [Disable GNOME support]), , enable_gnome="yes")
 if test "x$enable_gnome" = "xyes"; then
        BANSHEE_CHECK_GNOME_SHARP
-       BANSHEE_CHECK_GCONF
+       GLIB_GSETTINGS
        AM_CONDITIONAL(ENABLE_GNOME, true)
 else
-       AM_CONDITIONAL(GCONF_SCHEMAS_INSTALL, false)
-       AM_CONDITIONAL(HAVE_DBUS_GLIB, false)
        AM_CONDITIONAL(ENABLE_GNOME, false)
 fi
 
@@ -226,6 +224,7 @@ build/pkg-config/Makefile
 data/Makefile
 data/org.bansheeproject.Banshee.service
 data/org.bansheeproject.CollectionIndexer.service
+data/org.gnome.banshee.gschema.xml
 data/audio-profiles/Makefile
 data/desktop-files/Makefile
 data/desktop-files/common.desktop
diff --git a/data/Makefile.am b/data/Makefile.am
index f4af134..3937c2d 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -21,15 +21,22 @@ appdatadir = $(datadir)/appdata
 dist_appdata_DATA = $(appdata_in_files:.xml.in=.xml)
 appdata_in_files = banshee.appdata.xml.in
 
+gsettingsschema_in_files =  org.gnome.banshee.gschema.xml.in
+gsettings_SCHEMAS = $(gsettingsschema_in_files:.xml.in=.xml)
+
+ GSETTINGS_RULES@
+
 all: addin-xml-strings.cs
 
 EXTRA_DIST = \
        $(dbusservice_in_files) \
        addin-xml-strings.cs \
-       $(appdata_in_files)
+       $(appdata_in_files) \
+       $(gsettingsschema_in_files)
 
 CLEANFILES = \
-       $(appdata_DATA)
+       $(appdata_DATA) \
+       $(gsettings_SCHEMAS)
 
 DISTCLEANFILES = \
        $(dbusservice_DATA)
diff --git a/data/org.gnome.banshee.gschema.xml.in b/data/org.gnome.banshee.gschema.xml.in
new file mode 100644
index 0000000..eb8a2fe
--- /dev/null
+++ b/data/org.gnome.banshee.gschema.xml.in
@@ -0,0 +1,720 @@
+<schemalist gettext-domain="@GETTEXT_PACKAGE@">
+  <schema id="org.gnome.banshee.audio_profiles">
+    <key name="active-profile" type="s">
+      <default>''</default>
+      <summary></summary>
+      <description></description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.browser">
+    <key name="show-artist-filter" type="b">
+      <default>true</default>
+      <summary>Artist Filter Visibility</summary>
+      <description>Whether or not to show the Artist filter</description>
+    </key>
+    <key name="artist-filter-type" type="s">
+      <default>'artist'</default>
+      <summary>Artist/AlbumArtist Filter Type</summary>
+      <description>Whether to show all artists or just album artists in the artist filter; either 'artist' 
or 'albumartist'</description>
+    </key>
+    <key name="show-genre-filter" type="b">
+      <default>false</default>
+      <summary>Genre Filter Visibility</summary>
+      <description>Whether or not to show the Genre filter</description>
+    </key>
+    <key name="show-year-filter" type="b">
+      <default>false</default>
+      <summary>Year Filter Visibility</summary>
+      <description>Whether or not to show the Year filter</description>
+    </key>
+    <key name="visible" type="b">
+      <default>true</default>
+      <summary>Artist/Album Browser Visibility</summary>
+      <description>Whether or not to show the Artist/Album browser</description>
+    </key>
+    <key name="position" type="s">
+      <default>'top'</default>
+      <summary>Artist/Album Browser Position</summary>
+      <description>The position of the Artist/Album browser; either 'top' or 'left'</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.core">
+    <key name="io-provider" type="s">
+      <default>'Banshee.IO.Gio.Provider'</default>
+      <summary>Set the IO provider backend in Banshee</summary>
+      <description>Can be either "Banshee.IO.SystemIO.Provider" (.NET System.IO), "Banshee.IO.Gio.Provider" 
(GIO), or "Banshee.IO.Unix.Provider" (Native Unix/POSIX), or takes effect on Banshee start (restart 
necessary)</description>
+    </key>
+    <key name="make-default" type="b">
+      <default>true</default>
+      <summary>Whether to ensure Banshee is the default media player every time it starts</summary>
+      <description></description>
+    </key>
+    <key name="remember-make-default" type="b">
+      <default>false</default>
+      <summary>Whether to remember whether to ensure Banshee is the default media player every time it 
starts</summary>
+      <description></description>
+    </key>
+    <key name="ever-asked-make-default" type="b">
+      <default>false</default>
+      <summary>Whether the user has ever responded to whether they'd like to make Banshee the default 
player</summary>
+      <description></description>
+    </key>
+    <key name="send-anonymous-usage-data" type="b">
+      <default>false</default>
+      <summary>Improve Banshee by sending anonymous usage data</summary>
+      <description></description>
+    </key>
+    <key name="disable-internet-access" type="b">
+      <default>false</default>
+      <summary>Disable internet access</summary>
+      <description>Do not allow components to have internet access within Banshee</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.import">
+    <key name="show-initial-import-dialog" type="b">
+      <default>true</default>
+      <summary>Show the Initial Import Dialog</summary>
+      <description>Show the Initial Import Dialog when the Banshee library is empty</description>
+    </key>
+    <key name="audio-cd-error-correction" type="b">
+      <default>false</default>
+      <summary>Enable error correction</summary>
+      <description>When importing an audio CD, enable error correction (paranoia mode)</description>
+    </key>
+    <key name="auto-rip-cds" type="b">
+      <default>false</default>
+      <summary>Enable audio CD auto ripping</summary>
+      <description>When an audio CD is inserted, automatically begin ripping it.</description>
+    </key>
+    <key name="eject-after-ripped" type="b">
+      <default>false</default>
+      <summary>Eject audio CD after ripped</summary>
+      <description>After an audio CD has been ripped, automatically eject it.</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.interface">
+    <key name="show-context-pane" type="b">
+      <default>false</default>
+      <summary>Show context pane</summary>
+      <description>Show context pane for the currently playing track</description>
+    </key>
+    <key name="last-context-page" type="s">
+      <default>''</default>
+      <summary>The id of the last context page</summary>
+      <description>The string id of the last context page, which will be defaulted to when Banshee 
starts</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.interface.panes.albumartist.browser.top">
+    <key name="position" type="i">
+      <default>375</default>
+      <summary>Artist/Album Browser Container Top Position</summary>
+      <description>The position of the Artist/Album browser pane container, when placed at the 
top</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.interface.panes.albumartist.browser.left">
+    <key name="position" type="i">
+      <default>275</default>
+      <summary>Artist/Album Browser Container Left Position</summary>
+      <description>The position of the Artist/Album browser pane container, when placed on the 
left</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.interface.panes.filtered_list_source_contents.innerpane.position">
+    <key name="top" type="i">
+      <default>180</default>
+      <summary>Position for inner pane inside browser container at the top</summary>
+      <description>Position for inner pane inside browser container (albumartist, podcast, iradio...) to 
determine its height</description>
+    </key>
+    <key name="left" type="i">
+      <default>350</default>
+      <summary>Position for inner pane inside browser container on the left</summary>
+      <description>Position for inner pane inside browser container (albumartist, podcast, iradio...) to 
determine its width</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.interface.panes.iradio.browser.left">
+    <key name="position" type="i">
+      <default>275</default>
+      <summary>Internet Radio Browser Pane Container Position</summary>
+      <description>The position of the internet radio browser pane container</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.interface.panes.podcast.browser.left">
+    <key name="position" type="i">
+      <default>275</default>
+      <summary>Podcast Browser Pane Container Position</summary>
+      <description>The position of the podcast browser pane container</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.library">
+    <key name="folder-pattern" type="s">
+      <default>'%album_artist%%path_sep%%album%'</default>
+      <summary>Library Folder Pattern</summary>
+      <description>Format for creating a track folder inside the library. Do not create an absolute path. 
Location here is relative to the Banshee music directory. See LibraryLocation. Legal tokens: %album_artist%, 
%track_artist%, %album%, %genre%, %title%, %track_number%, %track_count%, %track_number_nz% (No prefixed 
zero), %track_count_nz% (No prefixed zero), %album_artist_initial%,%path_sep% (portable directory separator 
(/)), %artist% (deprecated, use %album_artist%).</description>
+    </key>
+    <key name="file-pattern" type="s">
+      <default>'{%track_number%. }%title%'</default>
+      <summary>Library File Pattern</summary>
+      <description>Format for creating a track filename inside the library. Do not use path 
tokens/characters here. See LibraryFolderPattern. Legal tokens: %album_artist%, %track_artist%, %album%, 
%genre%, %title%, %track_number%, %track_count%, %track_number_nz% (No prefixed zero), %track_count_nz% (No 
prefixed zero), %album_artist_initial%, %artist% (deprecated, use %album_artist%).</description>
+    </key>
+    <key name="write-metadata" type="b">
+      <default>false</default>
+      <summary>Sync metadata between library and supported files</summary>
+      <description>If enabled, metadata will be synced between the library and media files.</description>
+    </key>
+    <key name="write-rating" type="b">
+      <default>false</default>
+      <summary>Sync ratings between library and supported files</summary>
+      <description>If enabled, rating metadata will be synced between the library and audio 
files.</description>
+    </key>
+    <key name="write-count" type="b">
+      <default>false</default>
+      <summary>Sync play counts between library and supported files</summary>
+      <description>If enabled, playcount metadata will be synced between the library and audio 
files.</description>
+    </key>
+    <key name="sort-albums-by-year" type="b">
+      <default>false</default>
+      <summary>Sort tracks by album year</summary>
+      <description>If set the tracks will be sorted by album year instead of by album name</description>
+    </key>
+    <key name="base-location" type="s">
+      <default>''</default>
+      <summary></summary>
+      <description></description>
+    </key>
+    <key name="copy-on-import" type="b">
+      <default>false</default>
+      <summary></summary>
+      <description></description>
+    </key>
+    <key name="move-on-info-save" type="b">
+      <default>false</default>
+      <summary></summary>
+      <description></description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.minimode">
+    <key name="width" type="i">
+      <default>0</default>
+      <summary>Window Width</summary>
+      <description>Width of the main interface window.</description>
+    </key>
+    <key name="height" type="i">
+      <default>0</default>
+      <summary>Window Height</summary>
+      <description>Height of the main interface window.</description>
+    </key>
+    <key name="x-pos" type="i">
+      <default>0</default>
+      <summary>Window Position X</summary>
+      <description>Pixel position of Main Player Window on the X Axis</description>
+    </key>
+    <key name="y-pos" type="i">
+      <default>0</default>
+      <summary>Window Position Y</summary>
+      <description>Pixel position of Main Player Window on the Y Axis</description>
+    </key>
+    <key name="maximized" type="b">
+      <default>false</default>
+      <summary>Window Maximized</summary>
+      <description>True if main window is to be maximized, false if it is not.</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.muinshee">
+    <key name="width" type="i">
+      <default>-1</default>
+      <summary>Window Width</summary>
+      <description>Width of the main interface window.</description>
+    </key>
+    <key name="height" type="i">
+      <default>450</default>
+      <summary>Window Height</summary>
+      <description>Height of the main interface window.</description>
+    </key>
+    <key name="x-pos" type="i">
+      <default>0</default>
+      <summary>Window Position X</summary>
+      <description>Pixel position of Main Player Window on the X Axis</description>
+    </key>
+    <key name="y-pos" type="i">
+      <default>0</default>
+      <summary>Window Position Y</summary>
+      <description>Pixel position of Main Player Window on the Y Axis</description>
+    </key>
+    <key name="maximized" type="b">
+      <default>false</default>
+      <summary>Window Maximized</summary>
+      <description>True if main window is to be maximized, false if it is not.</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.muinshee.album">
+    <key name="width" type="i">
+      <default>500</default>
+      <summary>Window Width</summary>
+      <description>Width of the main interface window.</description>
+    </key>
+    <key name="height" type="i">
+      <default>475</default>
+      <summary>Window Height</summary>
+      <description>Height of the main interface window.</description>
+    </key>
+    <key name="x-pos" type="i">
+      <default>0</default>
+      <summary>Window Position X</summary>
+      <description>Pixel position of Main Player Window on the X Axis</description>
+    </key>
+    <key name="y-pos" type="i">
+      <default>0</default>
+      <summary>Window Position Y</summary>
+      <description>Pixel position of Main Player Window on the Y Axis</description>
+    </key>
+    <key name="maximized" type="b">
+      <default>false</default>
+      <summary>Window Maximized</summary>
+      <description>True if main window is to be maximized, false if it is not.</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.muinshee.song">
+    <key name="width" type="i">
+      <default>500</default>
+      <summary>Window Width</summary>
+      <description>Width of the main interface window.</description>
+    </key>
+    <key name="height" type="i">
+      <default>475</default>
+      <summary>Window Height</summary>
+      <description>Height of the main interface window.</description>
+    </key>
+    <key name="x-pos" type="i">
+      <default>0</default>
+      <summary>Window Position X</summary>
+      <description>Pixel position of Main Player Window on the X Axis</description>
+    </key>
+    <key name="y-pos" type="i">
+      <default>0</default>
+      <summary>Window Position Y</summary>
+      <description>Pixel position of Main Player Window on the Y Axis</description>
+    </key>
+    <key name="maximized" type="b">
+      <default>false</default>
+      <summary>Window Maximized</summary>
+      <description>True if main window is to be maximized, false if it is not.</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.nereid.track_view_columns">
+    <key name="order" type="i">
+      <default>-1</default>
+      <summary></summary>
+      <description></description>
+    </key>
+    <key name="visible" type="b">
+      <default>true</default>
+      <summary></summary>
+      <description></description>
+    </key>
+    <key name="width" type="d">
+      <default>1</default>
+      <summary></summary>
+      <description></description>
+    </key>
+    <!-- The next 2 key should not be here, they are for overall sorting, not for a column -->
+    <key name="column" type="s">
+      <default>""</default>
+      <summary></summary>
+      <description></description>
+    </key>
+    <key name="direction" type="i">
+      <default>0</default>
+      <summary></summary>
+      <description></description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.playback">
+    <key name="repeat-mode" type="s">
+      <default>'none'</default>
+      <summary>Repeat playback</summary>
+      <description>Repeat mode (repeat_none, repeat_all, repeat_single)</description>
+    </key>
+    <key name="shuffle-mode" type="s">
+      <default>'off'</default>
+      <summary>Shuffle playback</summary>
+      <description>Shuffle mode (shuffle_off, shuffle_song, shuffle_artist, shuffle_album, shuffle_rating, 
shuffle_score)</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.player_engine">
+    <key name="replay-gain-enabled" type="b">
+      <default>false</default>
+      <summary>Enable ReplayGain</summary>
+      <description>If ReplayGain data is present on tracks when playing, allow volume scaling</description>
+    </key>
+    <key name="gapless-playback-enabled" type="b">
+      <default>true</default>
+      <summary>Enable gapless playback</summary>
+      <description>Eliminate the small playback gap on track change. Useful for concept albums and classical 
music</description>
+    </key>
+    <key name="equalizer-enabled" type="b">
+      <default>false</default>
+      <summary>Equalizer status</summary>
+      <description>Whether or not the equalizer is set to be enabled.</description>
+    </key>
+    <key name="equalizer-preset" type="s">
+      <default>'Rock'</default>
+      <summary>Equalizer preset</summary>
+      <description>Default preset to load into equalizer.</description>
+    </key>
+    <key name="volume" type="i">
+      <default>80</default>
+      <summary>Volume</summary>
+      <description>Volume of playback relative to mixer output</description>
+    </key>
+    <key name="backend" type="s">
+      <default>'helix-remote'</default>
+      <summary>Backend</summary>
+      <description>Name of media playback engine backend</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.player_window">
+    <key name="default-export-format" type="s">
+      <default>''</default>
+      <summary>Export Format</summary>
+      <description>The default playlist export format</description>
+    </key>
+    <key name="disable-album-grid" type="b">
+      <default>false</default>
+      <summary>Disable album grid</summary>
+      <description>Disable album grid and show the classic layout instead</description>
+    </key>
+    <key name="last-file-chooser-uri" type="s">
+      <default>''</default>
+      <summary>URI</summary>
+      <description>URI of last file folder</description>
+    </key>
+    <key name="open-location-history" type="as">
+      <default>['']</default>
+      <summary>URI List</summary>
+      <description>List of URIs in the history drop-down for the open location dialog</description>
+    </key>
+    <key name="source-view-row-height" type="i">
+      <default>22</default>
+      <summary>The height of each source row in the SourceView.  22 is the default.</summary>
+      <description></description>
+    </key>
+    <key name="source-view-row-padding" type="i">
+      <default>5</default>
+      <summary>The padding between sources in the SourceView.  5 is the default.</summary>
+      <description></description>
+    </key>
+    <key name="width" type="i">
+      <default>1024</default>
+      <summary>Window Width</summary>
+      <description>Width of the main interface window.</description>
+    </key>
+    <key name="height" type="i">
+      <default>700</default>
+      <summary>Window Height</summary>
+      <description>Height of the main interface window.</description>
+    </key>
+    <key name="x-pos" type="i">
+      <default>0</default>
+      <summary>Window Position X</summary>
+      <description>Pixel position of Main Player Window on the X Axis</description>
+    </key>
+    <key name="y-pos" type="i">
+      <default>0</default>
+      <summary>Window Position Y</summary>
+      <description>Pixel position of Main Player Window on the Y Axis</description>
+    </key>
+    <key name="maximized" type="b">
+      <default>false</default>
+      <summary>Window Maximized</summary>
+      <description>True if main window is to be maximized, false if it is not.</description>
+    </key>
+    <key name="source-view-width" type="i">
+      <default>175</default>
+      <summary>Source View Width</summary>
+      <description>Width of Source View Column.</description>
+    </key>
+    <key name="show-cover-art" type="b">
+      <default>false</default>
+      <summary>Show cover art</summary>
+      <description>Show cover art below source view if available</description>
+    </key>
+    <key name="show-seek-slider-resizer" type="b">
+      <default>true</default>
+      <summary>Show seek slider resize grip</summary>
+      <description></description>
+    </key>
+    <key name="seek-slider-width" type="i">
+      <default>175</default>
+      <summary>Width of seek slider in px</summary>
+      <description></description>
+    </key>
+    <key name="search-entry-width" type="i">
+      <default>200</default>
+      <summary>Width of search entry element in px</summary>
+      <description></description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.plugins.amazonmp3store">
+    <key name="country" type="s">
+      <default>'geo'</default>
+      <summary>Which store front to use ("geo" for auto-detect, US, UK, FR, DE, or JP</summary>
+      <description></description>
+    </key>
+    <key name="persist-login" type="b">
+      <default>true</default>
+      <summary>Persist the Amazon MP3 store account login across sessions (via cookies)</summary>
+      <description></description>
+    </key>
+    <key name="redirect-url" type="s">
+      <default>'http://integrated-services.banshee.fm/amz/redirect.do/'</default>
+      <summary>The URL of the redirect server to use for the AmazonMP3 store.</summary>
+      <description></description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.plugins.bpm">
+    <key name="auto-enabled" type="b">
+      <default>false</default>
+      <summary>Automatically detect BPM on imported music</summary>
+      <description>Automatically detect BPM on imported music</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.plugins.cover_art">
+    <key name="enabled" type="b">
+      <default>true</default>
+      <summary>Plugin enabled</summary>
+      <description>Cover art plugin enabled</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.plugins.daap">
+    <key name="expanded" type="b">
+      <default>true</default>
+      <summary>Shared Music expanded</summary>
+      <description>Shared Music expanded</description>
+    </key>
+    <key name="open-remote-server-history" type="as">
+      <default>['']</default>
+      <summary>URI List</summary>
+      <description>List of URIs in the history drop-down for the open remote server dialog</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.plugins.mtp">
+    <key name="never-sync-albumart" type="b">
+      <default>false</default>
+      <summary>Album art disabled</summary>
+      <description>Regardless of device's capabilities, do not sync album art</description>
+    </key>
+    <key name="albumart-max-width" type="i">
+      <default>170</default>
+      <summary>Album art max width</summary>
+      <description>The maximum width to allow for album art.</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.plugins.file_system_queue">
+    <key name="clear-on-quit" type="b">
+      <default>false</default>
+      <summary>Clear on Quit</summary>
+      <description>Clear the file system queue when quitting</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.plugins.internetarchive">
+    <key name="audio-types" type="s">
+      <default>'Audio, VBR Mp3, Ogg Vorbis, 128Kbps MP3,  64Kbps MP3, Flac, VBR ZIP, 64Kbps MP3 
ZIP'</default>
+      <summary>Ordered list of preferred mediatypes for audio items</summary>
+      <description></description>
+    </key>
+    <key name="video-types" type="s">
+      <default>'Ogg Video, 512Kb MPEG4, MPEG2, h.264 MPEG4, DivX, Quicktime, MPEG1'</default>
+      <summary>Ordered list of preferred mediatypes for video items</summary>
+      <description></description>
+    </key>
+    <key name="text-types" type="s">
+      <default>'Text PDF, Standard LuraTech PDF, Grayscale LuraTech PDF, Image Container PDF, ZIP, Text, 
Hypertext'</default>
+      <summary>Ordered list of preferred mediatypes for text items</summary>
+      <description></description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.plugins.audioscrobbler">
+    <key name="api-url" type="s">
+      <default>''</default>
+      <summary>AudioScrobbler API URL</summary>
+      <description>URL for the AudioScrobbler API (supports turtle.libre.fm, for instance)</description>
+    </key>
+    <key name="engine-enabled" type="b">
+      <default>false</default>
+      <summary>Engine enabled</summary>
+      <description>Audioscrobbler reporting engine enabled</description>
+    </key>
+    <key name="device-engine-enabled" type="b">
+      <default>false</default>
+      <summary>Device engine enabled</summary>
+      <description>Audioscrobbler device reporting engine enabled</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.plugins.lastfm">
+    <key name="enabled" type="b">
+      <default>false</default>
+      <summary>Extension enabled</summary>
+      <description>Last.fm extension enabled</description>
+    </key>
+    <key name="username" type="s">
+      <default>''</default>
+      <summary>Last.fm user</summary>
+      <description>Last.fm username</description>
+    </key>
+    <key name="session-key" type="s">
+      <default>''</default>
+      <summary>Last.fm session key</summary>
+      <description>Last.fm session key used in authenticated calls</description>
+    </key>
+    <key name="subscriber" type="b">
+      <default>false</default>
+      <summary>User is Last.fm subscriber</summary>
+      <description>User is Last.fm subscriber</description>
+    </key>
+    <key name="expanded" type="b">
+      <default>false</default>
+      <summary>Last.fm expanded</summary>
+      <description>Last.fm expanded</description>
+    </key>
+    <key name="first-run" type="b">
+      <default>true</default>
+      <summary>First run</summary>
+      <description>First run of the Last.fm extension</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.plugins.miroguide">
+    <key name="last-was-audio" type="b">
+      <default>true</default>
+      <summary></summary>
+      <description></description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.plugins.notification_area">
+    <key name="enabled" type="b">
+      <default>true</default>
+      <summary>Plugin enabled</summary>
+      <description>Notification area plugin enabled</description>
+    </key>
+    <key name="show-notifications" type="b">
+      <default>true</default>
+      <summary>Show notifications</summary>
+      <description>Show information notifications when item starts playing</description>
+    </key>
+    <key name="notify-on-close" type="b">
+      <default>true</default>
+      <summary>Show a notification when closing main window</summary>
+      <description>When the main window is closed, show a notification stating this has 
happened.</description>
+    </key>
+    <key name="quit-on-close" type="b">
+      <default>false</default>
+      <summary>Quit on close</summary>
+      <description>Quit instead of hide to notification area on close</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.plugins.play_queue">
+    <key name="clear-on-quit" type="b">
+      <default>false</default>
+      <summary>Clear on Quit</summary>
+      <description>Clear the play queue when quitting</description>
+    </key>
+    <key name="current-track" type="i">
+      <default>0</default>
+      <summary>Current Track</summary>
+      <description>Current track in the Play Queue</description>
+    </key>
+    <key name="current-offset" type="i">
+      <default>0</default>
+      <summary>Current Offset</summary>
+      <description>Current offset of the Play Queue</description>
+    </key>
+    <key name="populate-shuffle-mode" type="s">
+      <default>'off'</default>
+      <summary>Play Queue population mode</summary>
+      <description>How (and if) the Play Queue should be randomly populated</description>
+    </key>
+    <key name="populate-from" type="s">
+      <default>'Music'</default>
+      <summary>Source to poplulate from</summary>
+      <description>Name of the source to populate the the Play Queue from</description>
+    </key>
+    <key name="played-songs-number" type="i">
+      <default>10</default>
+      <summary>Played Songs Number</summary>
+      <description>Number of played songs to show in the Play Queue</description>
+    </key>
+    <key name="upcoming-songs-number" type="i">
+      <default>10</default>
+      <summary>Upcoming Songs Number</summary>
+      <description>Number of upcoming songs to show in the Play Queue</description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.plugins.podcasting">
+    <key name="vpaned-position" type="i">
+      <default>120</default>
+      <summary>VPaned Position</summary>
+      <description></description>
+    </key>
+  </schema>
+  <schema id="org.gnome.banshee.sources">
+    <key name="child-sort-id" type="s">
+      <default>""</default>
+      <summary></summary>
+      <description></description>
+    </key>
+    <key name="copy-on-import" type="b">
+      <default>false</default>
+      <summary>Copy files on import</summary>
+      <description>Copy and rename files to library directory when importing</description>
+    </key>
+    <key name="current-filters" type="as">
+      <default>[]</default>
+      <summary></summary>
+      <description></description>
+    </key>
+    <key name="expanded" type="b">
+      <default>true</default>
+      <summary>Is source expanded</summary>
+      <description>Is source expanded</description>
+    </key>
+    <key name="library-location" type="s">
+      <default>""</default>
+      <summary>"The base directory under which files for this library are stored"</summary>
+      <description></description>
+    </key>
+    <key name="move-on-info-save" type="b">
+      <default>false</default>
+      <summary>Move files on info save</summary>
+      <description>Move files within the library directory when saving track info</description>
+    </key>
+    <key name="simplified-mode" type="b">
+      <default>false</default>
+      <summary></summary>
+      <description>Only used for Now Playing source</description>
+    </key>
+    <key name="separate-by-type" type="b">
+      <default>false</default>
+      <summary></summary>
+      <description></description>
+    </key>
+    <key name="show-miro-guide-teaser-in-podcasts" type="b">
+      <default>true</default>
+      <summary></summary>
+      <description></description>
+    </key>
+    <key name="status-format" type="i">
+      <default>0</default>
+      <summary></summary>
+      <description></description>
+    </key>
+    <!-- *-pattern duplicated from Library, only used by AudiobookLibrarySource for now -->
+    <key name="folder-pattern" type="s">
+      <default>'%album_artist%%path_sep%%album%'</default>
+      <summary>Library Folder Pattern</summary>
+      <description>Format for creating a track folder inside the library. Do not create an absolute path. 
Location here is relative to the Banshee music directory. See LibraryLocation. Legal tokens: %album_artist%, 
%track_artist%, %album%, %genre%, %title%, %track_number%, %track_count%, %track_number_nz% (No prefixed 
zero), %track_count_nz% (No prefixed zero), %album_artist_initial%,%path_sep% (portable directory separator 
(/)), %artist% (deprecated, use %album_artist%).</description>
+    </key>
+    <key name="file-pattern" type="s">
+      <default>'{%track_number%. }%title%'</default>
+      <summary>Library File Pattern</summary>
+      <description>Format for creating a track filename inside the library. Do not use path 
tokens/characters here. See LibraryFolderPattern. Legal tokens: %album_artist%, %track_artist%, %album%, 
%genre%, %title%, %track_number%, %track_count%, %track_number_nz% (No prefixed zero), %track_count_nz% (No 
prefixed zero), %album_artist_initial%, %artist% (deprecated, use %album_artist%).</description>
+    </key>
+  </schema>
+</schemalist>
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 18fbcde..ecd92d8 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -2,6 +2,7 @@
 # Please keep this file in alphabetical order; run ./sort-potfiles
 # after adding files here.
 [encoding: UTF-8]
+[type: gettext/gsettings]data/org.gnome.banshee.gschema.xml.in
 data/addin-xml-strings.cs
 data/audio-profiles/aac-novell.xml.in
 data/audio-profiles/base.xml.in
@@ -12,8 +13,8 @@ data/audio-profiles/vorbis.xml.in
 data/audio-profiles/wavpack.xml.in
 data/audio-profiles/wav.xml.in
 data/audio-profiles/wma.xml.in
-data/desktop-files/common.desktop.in
 data/banshee.appdata.xml.in
+data/desktop-files/common.desktop.in
 libbanshee/banshee-bpmdetector.c
 libbanshee/banshee-ripper.c
 libbanshee/banshee-transcoder.c
diff --git a/po/sort-potfiles b/po/sort-potfiles
index 119bd74..9d72101 100755
--- a/po/sort-potfiles
+++ b/po/sort-potfiles
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-head -n 4 < POTFILES.in > POTFILES.in.tmp 
+head -n 5 < POTFILES.in > POTFILES.in.tmp 
 grep -v "^[\\[#]" < POTFILES.in | sort >> POTFILES.in.tmp
 mv POTFILES.in.tmp POTFILES.in
 
diff --git a/src/Backends/Banshee.Gnome/Banshee.Gnome.addin.xml 
b/src/Backends/Banshee.Gnome/Banshee.Gnome.addin.xml
index 47ad5c6..7bbed4c 100644
--- a/src/Backends/Banshee.Gnome/Banshee.Gnome.addin.xml
+++ b/src/Backends/Banshee.Gnome/Banshee.Gnome.addin.xml
@@ -19,7 +19,7 @@
   </Extension>
 
   <Extension path="/Banshee/Platform/ConfigurationClient">
-    <ConfigurationClient class="Banshee.GnomeBackend.GConfConfigurationClient"/>
+    <ConfigurationClient class="Banshee.GnomeBackend.GSettingsConfigurationClient"/>
   </Extension>
 
   <Extension path="/Banshee/Platform/DiscDuplicator">
diff --git a/src/Backends/Banshee.Gnome/Banshee.Gnome.csproj b/src/Backends/Banshee.Gnome/Banshee.Gnome.csproj
index bd48357..8152c5a 100644
--- a/src/Backends/Banshee.Gnome/Banshee.Gnome.csproj
+++ b/src/Backends/Banshee.Gnome/Banshee.Gnome.csproj
@@ -71,9 +71,6 @@
   <ItemGroup>
     <Reference Include="System" />
     <Reference Include="gtk-sharp, Version=3.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
-    <Reference Include="gconf-sharp">
-      <SpecificVersion>False</SpecificVersion>
-    </Reference>
     <Reference Include="Mono.Posix">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\bin\bin\Mono.Posix.dll</HintPath>
@@ -94,6 +91,7 @@
     <Compile Include="Banshee.GnomeBackend\DiscDuplicator.cs" />
     <Compile Include="Banshee.GnomeBackend\GnomeScreensaverManager.cs" />
     <Compile Include="Banshee.GnomeBackend\GConfProxy.cs" />
+    <Compile Include="Banshee.GnomeBackend\GSettingsConfigurationClient.cs" />
   </ItemGroup>
   <ItemGroup>
     <EmbeddedResource Include="Banshee.Gnome.addin.xml">
diff --git a/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GSettingsConfigurationClient.cs 
b/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GSettingsConfigurationClient.cs
new file mode 100644
index 0000000..11faefe
--- /dev/null
+++ b/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GSettingsConfigurationClient.cs
@@ -0,0 +1,123 @@
+//
+// GSettingsConfigurationClient.cs
+//
+// Author:
+//   Andres G. Aragoneses <knocte gmail com>
+//
+// Copyright 2012 Andres G. Aragoneses
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using System.Collections.Generic;
+
+using Hyena;
+using Banshee.Configuration;
+
+namespace Banshee.GnomeBackend
+{
+    public class GSettingsConfigurationClient : IConfigurationClient
+    {
+        private static string base_schema = "org.gnome.banshee.";
+
+        private List<string> schema_ids;
+
+        private static string base_path;
+        private static string BasePath {
+            get {
+                if (base_path == null) {
+                    base_path = ApplicationContext.CommandLine["gsettings-base-path"];
+                    if (!base_path.StartsWith ("/") || !base_path.EndsWith ("/")) {
+                        Log.Debug ("Using default gsettings-base-path");
+                        base_path = "/org/gnome/banshee/";
+                    }
+                }
+                return base_path;
+            }
+        }
+
+        public GSettingsConfigurationClient ()
+        {
+            schema_ids = new List<string> (GLib.Settings.ListRelocatableSchemas ());
+            schema_ids.RemoveAll (s => !s.StartsWith (base_schema));
+        }
+
+        private string GetSchemaIdFromPath (string path)
+        {
+            string dotted_path = path.TrimStart ('/').Replace ('/', '.');
+            while (!schema_ids.Contains (dotted_path)) {
+                dotted_path = dotted_path.Remove (dotted_path.LastIndexOf ('.'));
+            }
+            Log.DebugFormat ("### GetSchemaIdFromPath {0} -> {1}", path, dotted_path);
+            return dotted_path;
+        }
+     
+        public bool TryGet<T> (string @namespace, string key, out T result)
+        {
+            result = default (T);
+            Hyena.Log.DebugFormat ("### TryGet namespace={0} key={1}", @namespace, key);
+            string path = String.Concat (BasePath, @namespace);
+            string schema_id = GetSchemaIdFromPath (path);
+            GLib.Settings settings;
+            Hyena.Log.DebugFormat ("### GLib.Settings id={0} path={1} key={2}", schema_id, path, key);
+            try {
+                settings = new GLib.Settings (schema_id, path);
+
+                // gsettings doesn't allow underscores in the keys
+                result = (T)Get (typeof (T), settings, key.Replace ("_", "-"));
+            } catch (Exception e) {
+                Log.DebugException (e);
+            }
+            return true;
+        }
+
+        private object Get (Type type, GLib.Settings settings, string key)
+        {
+            if (type == typeof (bool)) {
+                return settings.GetBoolean (key);
+            }
+            if (type == typeof (string)) {
+                return settings.GetString (key);
+            }
+            if (type == typeof (int)) {
+                return settings.GetInt (key);
+            }
+            if (type == typeof (double)) {
+                return settings.GetDouble (key);
+            }
+            if (type == typeof (String[])) {
+                return settings.GetStrv (key);
+            }
+            throw new NotImplementedException (String.Format ("Type {0} not supported in {1}",
+                                                              type.FullName, 
+                                                              this.GetType ().Name));
+        }
+
+        public void Set<T> (string @namespace, string key, T value)
+        {
+            throw new NotImplementedException ("SET not yet! for " + @namespace + "=>" + key);
+        }
+
+        public void Set<T> (string @namespace, string path, string key, T value)
+        {
+            throw new NotImplementedException ("SET not yet! for " + @namespace + "=>" + key);
+        }
+    }
+}
+
diff --git a/src/Backends/Banshee.Gnome/Makefile.am b/src/Backends/Banshee.Gnome/Makefile.am
index 4a1b0bc..ba2da7f 100644
--- a/src/Backends/Banshee.Gnome/Makefile.am
+++ b/src/Backends/Banshee.Gnome/Makefile.am
@@ -6,10 +6,10 @@ INSTALL_DIR = $(BACKENDS_INSTALL_DIR)
 SOURCES =  \
        Banshee.GnomeBackend/Brasero.cs \
        Banshee.GnomeBackend/DiscDuplicator.cs \
-       Banshee.GnomeBackend/GConfConfigurationClient.cs \
        Banshee.GnomeBackend/GConfProxy.cs \
        Banshee.GnomeBackend/GnomeScreensaverManager.cs \
-       Banshee.GnomeBackend/GnomeService.cs
+       Banshee.GnomeBackend/GnomeService.cs \
+       Banshee.GnomeBackend/GSettingsConfigurationClient.cs
 
 RESOURCES =  \
        Banshee.Gnome.addin.xml \
diff --git a/src/Core/Banshee.ThickClient/Makefile.am b/src/Core/Banshee.ThickClient/Makefile.am
index ed2363b..ea2a8f8 100644
--- a/src/Core/Banshee.ThickClient/Makefile.am
+++ b/src/Core/Banshee.ThickClient/Makefile.am
@@ -3,10 +3,6 @@ TARGET = library
 ASSEMBLY_BUILD_FLAGS = -unsafe
 LINK = $(REF_BANSHEE_THICKCLIENT)
 
-if HAVE_DBUS_GLIB
-BUILD_DEFINES = "-define:HAVE_DBUS_GLIB"
-endif
-
 SOURCES =  \
        Banshee.Addins.Gui/AddinView.cs \
        Banshee.CairoGlyphs/BansheeLineLogo.cs \
diff --git a/src/Hyena b/src/Hyena
index 48aa6db..6ae530d 160000
--- a/src/Hyena
+++ b/src/Hyena
@@ -1 +1 @@
-Subproject commit 48aa6db47acd722bb4e9dcc7fc6216f00407c72a
+Subproject commit 6ae530db3c8740a0098ea2b213dd746c0f933d51



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]