diff options
-rw-r--r-- | data/Makefile.am | 41 | ||||
-rw-r--r-- | data/com.canonical.indicators.sound.gschema.xml | 20 | ||||
-rw-r--r-- | data/indicator-sound.schemas.in | 16 | ||||
-rw-r--r-- | src/music-player-bridge.vala | 10 |
4 files changed, 40 insertions, 47 deletions
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 @@ +<schemalist> + <schema id="com.canoncial.indicators.sound" path="/apps/indicators/sound/" gettext-domain="indicator-sound"> + <key name="blacklist_entries" type="(as)"> + <default></default> + <summary>A list of applications blacklisted from the sound menu</summary> + <description> + 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. + </description> + </key> + <key name="global_mute" type="b"> + <default>FALSE</default> + <summary>Initial setting for global mute (mute all) on the menu </summary> + <description> + On start up volume should not be muted. + </description> + </key> + </schema> +</schemalist> 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 @@ -<?xml version="1.0"?> -<gconfschemafile> - <schemalist> - <schema> - <key>/schemas/apps/indicator-sound/volume_mute</key> - <applyto>/apps/indicator-sound/volume_mute</applyto> - <owner>indicator-sound</owner> - <type>bool</type> - <default>FALSE</default> - <locale name="C"> - <short>Volume is not muted by default</short> - <long>On start up volume should not be muted.</long> - </locale> - </schema> - </schemalist> -</gconfschemafile> 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<string, PlayerController> registered_clients; private Mpris2Watcher watcher; private const string DESKTOP_PREFIX = "/usr/share/applications/"; - + private Settings settings; + public MusicPlayerBridge() { - registered_clients = new HashMap<string, PlayerController> (); } + construct{ + this.registered_clients = new HashMap<string, PlayerController> (); + 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){ |