From 2bd7aaa686749c9585a6abac1bd5d62123bf7088 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 24 Sep 2013 09:59:38 -0500 Subject: Recommending gnome-control-center first --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debian/control') diff --git a/debian/control b/debian/control index 2c263a3..c639fcb 100644 --- a/debian/control +++ b/debian/control @@ -27,7 +27,7 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, pulseaudio, -Recommends: ubuntu-system-settings | gnome-control-center, +Recommends: gnome-control-center | ubuntu-system-settings, Description: System sound indicator. System sound indicator which provides easy control of the PulseAudio sound daemon. -- cgit v1.2.3 From 6621a3d848fd50062f25e95f1787c5084aed0671 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 25 Sep 2013 16:07:05 -0500 Subject: Use url-dispatcher instead of invoking system-settings directly. --- CMakeLists.txt | 4 +++- debian/control | 1 + src/CMakeLists.txt | 1 + src/service.vala | 6 +----- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'debian/control') diff --git a/CMakeLists.txt b/CMakeLists.txt index 98dccef..6ab96c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,11 +25,13 @@ set(SOURCE_BINARY_DIR "${CMAKE_BINARY_DIR}/src") set(PULSE_AUDIO_REQUIRED_VERSION 0.9.19) set(GIO_2_0_REQUIRED_VERSION 2.25.13) +set(URL_DISPATCHER_1_REQUIRED_VERSION 1) pkg_check_modules( PULSEAUDIO REQUIRED libpulse-mainloop-glib>=${PULSE_AUDIO_REQUIRED_VERSION} - gio-unix-2.0 + gio-unix-2.0>=${GIO_2_0_REQUIRED_VERSION} + url-dispatcher-1>=${URL_DISPATCHER_1_REQUIRED_VERSION} ) include_directories(${PULSEAUDIO_INCLUDE_DIRS}) diff --git a/debian/control b/debian/control index c639fcb..0d1da18 100644 --- a/debian/control +++ b/debian/control @@ -10,6 +10,7 @@ Build-Depends: debhelper (>= 9.0), autotools-dev, valac (>= 0.18), libglib2.0-dev (>= 2.22.3), + liburl-dispatcher1-dev, libpulse-dev (>= 0.9.18), libpulse-mainloop-glib0 (>= 0.9.18), libgee-dev, diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a28147d..a61fb72 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,6 +20,7 @@ vala_init(indicator-sound-service --vapidir=${CMAKE_SOURCE_DIR}/vapi/ --vapidir=. --target-glib=2.36 + --pkg=url-dispatcher --pkg=bus-watcher ) diff --git a/src/service.vala b/src/service.vala index f43a1a1..c7d4809 100644 --- a/src/service.vala +++ b/src/service.vala @@ -108,11 +108,7 @@ public class IndicatorSound.Service { } void activate_phone_settings (SimpleAction action, Variant? param) { - try { - Process.spawn_command_line_async ("system-settings sound"); - } catch (Error e) { - warning ("unable to launch sound settings: %s", e.message); - } + UrlDispatch.send ("settings://system/sound"); } /* Returns a serialized version of @icon_name suited for the panel */ -- cgit v1.2.3 From d31be181a2c69c167bb61dbb9f1007f346920ac8 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Tue, 1 Oct 2013 14:11:04 +0200 Subject: Show synchronous notification when changing the volume by scrolling over the indicator --- CMakeLists.txt | 1 + debian/control | 1 + src/CMakeLists.txt | 1 + src/main.vala | 2 ++ src/service.vala | 30 ++++++++++++++++++++++++++++++ 5 files changed, 35 insertions(+) (limited to 'debian/control') diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ab96c9..c60dc97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,7 @@ pkg_check_modules( gio-2.0>=${GIO_2_0_REQUIRED_VERSION} gio-unix-2.0 libxml-2.0 + libnotify ) include_directories(${SOUNDSERVICE_INCLUDE_DIRS}) diff --git a/debian/control b/debian/control index 0d1da18..ff4c041 100644 --- a/debian/control +++ b/debian/control @@ -13,6 +13,7 @@ Build-Depends: debhelper (>= 9.0), liburl-dispatcher1-dev, libpulse-dev (>= 0.9.18), libpulse-mainloop-glib0 (>= 0.9.18), + libnotify-dev, libgee-dev, libxml2-dev, Standards-Version: 3.9.4 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a61fb72..572befd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,6 +14,7 @@ vala_init(indicator-sound-service libxml-2.0 libpulse libpulse-mainloop-glib + libnotify OPTIONS --ccode --thread diff --git a/src/main.vala b/src/main.vala index 97f311f..4da9e58 100644 --- a/src/main.vala +++ b/src/main.vala @@ -7,6 +7,8 @@ static int main (string[] args) { Intl.setlocale (LocaleCategory.ALL, ""); Intl.bindtextdomain (Config.GETTEXT_PACKAGE, Config.GNOMELOCALEDIR); + Notify.init ("indicator-sound"); + var service = new IndicatorSound.Service (); return service.run (); } diff --git a/src/service.vala b/src/service.vala index 9041097..0d028ac 100644 --- a/src/service.vala +++ b/src/service.vala @@ -45,6 +45,14 @@ public class IndicatorSound.Service { this.settings.changed["interested-media-players"].connect ( () => { this.players.sync (settings.get_strv ("interested-media-players")); }); + + if (settings.get_boolean ("show-notify-osd-on-scroll")) { + unowned List caps = Notify.get_server_caps (); + if (caps.find_custom ("x-canonical-private-synchronous", strcmp) != null) { + this.notification = new Notify.Notification ("indicator-sound", "", ""); + this.notification.set_hint_string ("x-canonical-private-synchronous", "indicator-sound"); + } + } } public int run () { @@ -76,6 +84,7 @@ public class IndicatorSound.Service { VolumeControl volume_control; MediaPlayerList players; uint player_action_update_id; + Notify.Notification notification; void activate_scroll_action (SimpleAction action, Variant? param) { const double volume_step_percentage = 0.06; @@ -83,6 +92,27 @@ public class IndicatorSound.Service { double v = this.volume_control.get_volume () + volume_step_percentage * delta; this.volume_control.set_volume (v.clamp (0.0, 1.0)); + + if (this.notification != null) { + string icon; + if (v <= 0.0) + icon = "notification-audio-volume-off"; + else if (v <= 0.3) + icon = "notification-audio-volume-low"; + else if (v <= 0.7) + icon = "notification-audio-volume-medium"; + else + icon = "notification-audio-volume-high"; + + this.notification.update ("indicator-sound", "", icon); + this.notification.set_hint_int32 ("value", ((int32) (100 * v)).clamp (-1, 101)); + try { + this.notification.show (); + } + catch (Error e) { + warning ("unable to show notification: %s", e.message); + } + } } void activate_desktop_settings (SimpleAction action, Variant? param) { -- cgit v1.2.3