aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-01-30 10:28:05 -0600
committerTed Gould <ted@gould.cx>2015-01-30 10:28:05 -0600
commit1e149cd05cf4b1bedba53e1104194662ad350de5 (patch)
tree2d704791954c70b397e9a70a2cd1600730d2b50b
parentbc90929adb5637cc0f77dfeba64082b26c435fc7 (diff)
parent59dfdd3906fd238e5ea3606d72b938677096e2c5 (diff)
downloadayatana-indicator-sound-1e149cd05cf4b1bedba53e1104194662ad350de5.tar.gz
ayatana-indicator-sound-1e149cd05cf4b1bedba53e1104194662ad350de5.tar.bz2
ayatana-indicator-sound-1e149cd05cf4b1bedba53e1104194662ad350de5.zip
Update to trunk
-rw-r--r--data/indicator-sound.desktop.in2
-rw-r--r--data/indicator-sound.upstart.desktop.in2
-rw-r--r--debian/changelog40
-rw-r--r--src/accounts-service-user.vala4
-rw-r--r--src/bus-watch-namespace.c9
-rw-r--r--src/service.vala21
-rw-r--r--src/volume-control.vala7
-rw-r--r--tests/pa-mock.cpp2
8 files changed, 77 insertions, 10 deletions
diff --git a/data/indicator-sound.desktop.in b/data/indicator-sound.desktop.in
index 61c049c..6d31a9a 100644
--- a/data/indicator-sound.desktop.in
+++ b/data/indicator-sound.desktop.in
@@ -2,7 +2,7 @@
Type=Application
Name=Indicator Sound
Exec=@CMAKE_INSTALL_FULL_LIBEXECDIR@/indicator-sound/indicator-sound-service
-OnlyShowIn=Unity;XFCE;GNOME;Pantheon;
+OnlyShowIn=Unity;GNOME;Pantheon;
NoDisplay=true
StartupNotify=false
Terminal=false
diff --git a/data/indicator-sound.upstart.desktop.in b/data/indicator-sound.upstart.desktop.in
index 4c3ebc9..0380ab8 100644
--- a/data/indicator-sound.upstart.desktop.in
+++ b/data/indicator-sound.upstart.desktop.in
@@ -2,7 +2,7 @@
Type=Application
Name=Indicator Sound
Exec=@CMAKE_INSTALL_FULL_LIBEXECDIR@/indicator-sound/indicator-sound-service
-OnlyShowIn=Unity;XFCE;Pantheon;
+OnlyShowIn=Unity;Pantheon;
NoDisplay=true
StartupNotify=false
Terminal=false
diff --git a/debian/changelog b/debian/changelog
index 93626ad..aad0867 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,43 @@
+indicator-sound (12.10.2+15.04.20150129.1-0ubuntu1) vivid; urgency=low
+
+ [ Ted Gould ]
+ * Move notification code out of volume control object
+ * Build a rudimentary Pulse Audio mock for testing.
+ * Disconnect the right function from the 'closed' signal (LP:
+ #1307021)
+ * Ensure that the active port is not null before looking at its value
+ (LP: #1399862)
+
+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 29 Jan 2015 17:32:11 +0000
+
+indicator-sound (12.10.2+15.04.20150128-0ubuntu1) vivid; urgency=low
+
+ [ Ted Gould ]
+ * Remove XFCE from the OnlyShowIn list (LP: #1411959)
+
+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Wed, 28 Jan 2015 21:16:55 +0000
+
+indicator-sound (12.10.2+15.04.20150120-0ubuntu1) vivid; urgency=low
+
+ [ Ted Gould ]
+ * Set internal silent mode variable at startup (LP: #1391164)
+
+ [ CI bot ]
+ * Set internal silent mode variable at startup (LP: #1391164)
+
+ [ Nick Dedekind ]
+ * Update the panel icon when entering/exiting silent mode. (LP:
+ #1390067)
+
+ [ Dmitry Shachnev ]
+ * Fix indicator-sound-service crash when active_port is null. (LP:
+ #1395455)
+
+ [ Lars Uebernickel ]
+ * Set internal silent mode variable at startup (LP: #1391164)
+
+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 20 Jan 2015 22:03:19 +0000
+
indicator-sound (12.10.2+15.04.20141105-0ubuntu1) vivid; urgency=medium
[ Ted Gould ]
diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala
index ec52730..e8db7c4 100644
--- a/src/accounts-service-user.vala
+++ b/src/accounts-service-user.vala
@@ -35,6 +35,7 @@ public class AccountsServiceUser : Object {
return _silentMode;
}
set {
+ _silentMode = value;
if (syssoundproxy != null)
syssoundproxy.silent_mode = value;
}
@@ -211,7 +212,8 @@ public class AccountsServiceUser : Object {
}
});
- this.silentMode = this.syssoundproxy.silent_mode;
+ this._silentMode = this.syssoundproxy.silent_mode;
+ this.notify_property("silentMode");
} catch (Error e) {
this.syssoundproxy = null;
warning("Unable to get proxy to system sound settings: %s", e.message);
diff --git a/src/bus-watch-namespace.c b/src/bus-watch-namespace.c
index ad4e7ad..66ad2b2 100644
--- a/src/bus-watch-namespace.c
+++ b/src/bus-watch-namespace.c
@@ -41,9 +41,16 @@ typedef struct
gchar *name;
} GetNameOwnerData;
+/* Global Variables */
static guint namespace_watcher_next_id;
static GHashTable *namespace_watcher_watchers;
+/* Prototypes */
+static void connection_closed (GDBusConnection *connection,
+ gboolean remote_peer_vanished,
+ GError *error,
+ gpointer user_data);
+
static void
namespace_watcher_stop (gpointer data)
{
@@ -70,7 +77,7 @@ namespace_watcher_stop (gpointer data)
if (watcher->connection)
{
- g_signal_handlers_disconnect_by_func (watcher->connection, namespace_watcher_stop, watcher);
+ g_signal_handlers_disconnect_by_func (watcher->connection, connection_closed, watcher);
g_object_unref (watcher->connection);
}
diff --git a/src/service.vala b/src/service.vala
index c7e29e7..fb56215 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -20,6 +20,11 @@
public class IndicatorSound.Service: Object {
public Service (MediaPlayerList playerlist) {
sync_notification = new Notify.Notification(_("Volume"), "", "audio-volume-muted");
+ this.notification_server_watch = GLib.Bus.watch_name(GLib.BusType.SESSION,
+ "org.freedesktop.Notifications",
+ GLib.BusNameWatcherFlags.NONE,
+ () => { check_sync_notification = false; },
+ () => { check_sync_notification = false; });
this.settings = new Settings ("com.canonical.indicator.sound");
this.sharedsettings = new Settings ("com.ubuntu.sound");
@@ -92,6 +97,11 @@ public class IndicatorSound.Service: Object {
Source.remove (this.sound_was_blocked_timeout_id);
this.sound_was_blocked_timeout_id = 0;
}
+
+ if (this.notification_server_watch != 0) {
+ GLib.Bus.unwatch_name(this.notification_server_watch);
+ this.notification_server_watch = 0;
+ }
}
bool greeter_show_track () {
@@ -175,6 +185,7 @@ public class IndicatorSound.Service: Object {
AccountsServiceUser? accounts_service = null;
bool export_to_accounts_service = false;
private Notify.Notification sync_notification;
+ private uint notification_server_watch;
/* Maximum volume as a scaling factor between the volume action's state and the value in
* this.volume_control. See create_volume_action().
@@ -226,6 +237,8 @@ public class IndicatorSound.Service: Object {
string icon;
if (this.volume_control.mute)
icon = this.mute_blocks_sound ? "audio-volume-muted-blocking-panel" : "audio-volume-muted-panel";
+ else if (this.accounts_service != null && this.accounts_service.silentMode)
+ icon = "audio-volume-muted-panel";
else if (volume <= 0.0)
icon = "audio-volume-low-zero-panel";
else if (volume <= 0.3)
@@ -238,6 +251,9 @@ public class IndicatorSound.Service: Object {
string accessible_name;
if (this.volume_control.mute) {
accessible_name = _("Volume (muted)");
+ } else if (this.accounts_service != null && this.accounts_service.silentMode) {
+ int volume_int = (int)(volume * 100);
+ accessible_name = "%s (%s %d%%)".printf (_("Volume"), _("silent"), volume_int);
} else {
int volume_int = (int)(volume * 100);
accessible_name = "%s (%d%%)".printf (_("Volume"), volume_int);
@@ -252,7 +268,6 @@ public class IndicatorSound.Service: Object {
root_action.set_state (builder.end());
}
- /* TODO: Update these if the notification server leaves the bus and restarts */
private bool check_sync_notification = false;
private bool support_sync_notification = false;
@@ -485,13 +500,13 @@ public class IndicatorSound.Service: Object {
action.set_state (this.action_state_for_player (player));
action.set_enabled (player.can_raise);
}
-
+
SimpleAction? greeter_action = this.actions.lookup_action (player.id + ".greeter") as SimpleAction;
if (greeter_action != null) {
greeter_action.set_state (this.action_state_for_player (player, greeter_show_track()));
greeter_action.set_enabled (player.can_raise);
}
-
+
/* If we're playing then put that data in accounts service */
if (player.is_running && export_to_accounts_service && accounts_service != null) {
accounts_service.player = player;
diff --git a/src/volume-control.vala b/src/volume-control.vala
index 193e621..bf97021 100644
--- a/src/volume-control.vala
+++ b/src/volume-control.vala
@@ -179,9 +179,10 @@ public class VolumeControl : Object
* checking for the port name. On touch (with the pulseaudio droid element)
* the headset/headphone port is called 'output-headset' and 'output-headphone'.
* On the desktop this is usually called 'analog-output-headphones' */
- if (i.active_port.name == "output-wired_headset" ||
- i.active_port.name == "output-wired_headphone" ||
- i.active_port.name == "analog-output-headphones") {
+ if (i.active_port != null &&
+ (i.active_port.name == "output-wired_headset" ||
+ i.active_port.name == "output-wired_headphone" ||
+ i.active_port.name == "analog-output-headphones")) {
_active_port_headphone = true;
} else {
_active_port_headphone = false;
diff --git a/tests/pa-mock.cpp b/tests/pa-mock.cpp
index 8ca2374..5dd5c9b 100644
--- a/tests/pa-mock.cpp
+++ b/tests/pa-mock.cpp
@@ -55,10 +55,12 @@ public:
g_debug("Creating Context: %p", this);
}
+private: /* To ensure we're the only ones who can delete it */
~PAMockContext () {
g_debug("Destroying Context: %p", this);
}
+public:
/* Ref counting */
void ref () {
refcnt++;