From 8396e05ce716296377f2e4550e0c929dca30518e Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 14 Dec 2010 16:41:10 +0000 Subject: gsettings all the way --- data/Makefile.am | 41 ++++++++----------------- data/com.canonical.indicators.sound.gschema.xml | 20 ++++++++++++ data/indicator-sound.schemas.in | 16 ---------- src/music-player-bridge.vala | 10 ++++-- 4 files changed, 40 insertions(+), 47 deletions(-) create mode 100644 data/com.canonical.indicators.sound.gschema.xml delete mode 100644 data/indicator-sound.schemas.in diff --git a/data/Makefile.am b/data/Makefile.am index aaa6ca4..730f166 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -5,39 +5,22 @@ service_in_files = indicator-sound.service.in dbus_services_DATA = $(service_in_files:.service.in=.service) %.service: %.service.in - sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ + sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ ############################## -# GConf Schema +# GSettings Schema ############################## -schemadir = \ - $(GCONF_SCHEMA_FILE_DIR) +gsettings_SCHEMAS = \ + com.canonical.indicators.sound.gschema.xml +@GSETTINGS_RULES@ -schema_in_files = \ - indicator-sound.schemas.in - -schema_DATA = \ - $(schema_in_files:.schemas.in=.schemas) - -@INTLTOOL_SCHEMAS_RULE@ - - -#$(dbus_services_DATA): $(service_in_files) Makefile -# sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ - -EXTRA_DIST = \ - $(service_in_files) \ - $(schema_in_files) +############################## -CLEANFILES = \ - $(dbus_services_DATA) \ - $(schema_DATA) +EXTRA_DIST = \ + $(service_in_files) \ + $(gsettings_SCHEMAS) -if GCONF_SCHEMAS_INSTALL -install-data-local: - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) \ - gconftool-2 --makefile-install-rule $(schema_DATA) -else -install-data-local: -endif +CLEANFILES = \ + $(dbus_services_DATA) + \ No newline at end of file diff --git a/data/com.canonical.indicators.sound.gschema.xml b/data/com.canonical.indicators.sound.gschema.xml new file mode 100644 index 0000000..4284527 --- /dev/null +++ b/data/com.canonical.indicators.sound.gschema.xml @@ -0,0 +1,20 @@ + + + + + A list of applications blacklisted from the sound menu + + Each media player which abides by the MPRIS2 spec will automatically appear in the menu. + This array should contain the desktop file names (minus .desktop suffix) of applications which + do not want to be included in the sound menu. + + + + FALSE + Initial setting for global mute (mute all) on the menu + + On start up volume should not be muted. + + + + diff --git a/data/indicator-sound.schemas.in b/data/indicator-sound.schemas.in deleted file mode 100644 index 9ad0f39..0000000 --- a/data/indicator-sound.schemas.in +++ /dev/null @@ -1,16 +0,0 @@ - - - - - /schemas/apps/indicator-sound/volume_mute - /apps/indicator-sound/volume_mute - indicator-sound - bool - FALSE - - Volume is not muted by default - On start up volume should not be muted. - - - - diff --git a/src/music-player-bridge.vala b/src/music-player-bridge.vala index 0d1b0e4..51ecc4c 100644 --- a/src/music-player-bridge.vala +++ b/src/music-player-bridge.vala @@ -27,12 +27,18 @@ public class MusicPlayerBridge : GLib.Object private HashMap registered_clients; private Mpris2Watcher watcher; private const string DESKTOP_PREFIX = "/usr/share/applications/"; - + private Settings settings; + public MusicPlayerBridge() { - registered_clients = new HashMap (); } + construct{ + this.registered_clients = new HashMap (); + this.settings = new Settings("com.canonical.indicators.sound"); + } + + /*private void try_to_add_inactive_familiar_clients(){ foreach(string app in this.playersDB.records()){ if(app == null){ -- cgit v1.2.3