aboutsummaryrefslogtreecommitdiff
path: root/src/service.vala
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2015-02-27 22:36:17 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2015-02-27 22:36:17 +0000
commitcf091c3e612c41dc8e430f6029e7a6ec62a8f703 (patch)
treebde30e01d0ddaee3323780682f6521839dcd7854 /src/service.vala
parentdff67f240ebfc9fe842383d612948597517d3c83 (diff)
parente5a30aa5678ccf55884691e6c8f35cb439d1a3de (diff)
downloadayatana-indicator-sound-cf091c3e612c41dc8e430f6029e7a6ec62a8f703.tar.gz
ayatana-indicator-sound-cf091c3e612c41dc8e430f6029e7a6ec62a8f703.tar.bz2
ayatana-indicator-sound-cf091c3e612c41dc8e430f6029e7a6ec62a8f703.zip
Switch to an internal variable to track blocking notifications
Approved by: Charles Kerr, PS Jenkins bot
Diffstat (limited to 'src/service.vala')
-rw-r--r--src/service.vala10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/service.vala b/src/service.vala
index ff78e0b..488b993 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -97,12 +97,16 @@ public class IndicatorSound.Service: Object {
/* Hide the notification when the menu is shown */
var shown_action = actions.lookup_action ("indicator-shown") as SimpleAction;
shown_action.change_state.connect ((state) => {
- if (state.get_boolean()) {
+ block_notifications = state.get_boolean();
+ if (block_notifications) {
+ debug("Indicator is shown");
try {
sync_notification.close();
} catch (Error e) {
warning("Unable to close synchronous volume notification: %s", e.message);
}
+ } else {
+ debug("Indicator is hidden");
}
});
@@ -282,6 +286,7 @@ public class IndicatorSound.Service: Object {
private bool check_sync_notification = false;
private bool support_sync_notification = false;
+ private bool block_notifications = false;
void update_sync_notification () {
if (!check_sync_notification) {
@@ -296,8 +301,7 @@ public class IndicatorSound.Service: Object {
if (!support_sync_notification)
return;
- var shown_action = actions.lookup_action ("indicator-shown") as SimpleAction;
- if (shown_action != null && shown_action.get_state().get_boolean())
+ if (block_notifications)
return;
/* Determine Label */