aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2014-12-03 09:52:32 -0600
committerTed Gould <ted@gould.cx>2014-12-03 09:52:32 -0600
commit57982f343b03175c20a4b51ccb5c853588613935 (patch)
tree9180d1df5c69b847cfbf827c834214115efaa2d4
parentf6505dfead05c0e341d7ece63510e621a45e0325 (diff)
downloadayatana-indicator-sound-57982f343b03175c20a4b51ccb5c853588613935.tar.gz
ayatana-indicator-sound-57982f343b03175c20a4b51ccb5c853588613935.tar.bz2
ayatana-indicator-sound-57982f343b03175c20a4b51ccb5c853588613935.zip
Add an action to track whether the indicator is shown so that we can not show notifications if it is open
-rw-r--r--src/service.vala5
-rw-r--r--src/sound-menu.vala1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/service.vala b/src/service.vala
index c74b2eb..48b0cbe 100644
--- a/src/service.vala
+++ b/src/service.vala
@@ -146,6 +146,7 @@ public class IndicatorSound.Service: Object {
{ "scroll", activate_scroll_action, "i", null, null },
{ "desktop-settings", activate_desktop_settings, null, null, null },
{ "phone-settings", activate_phone_settings, null, null, null },
+ { "indicator-shown", null, null, "@b false", null },
};
MainLoop loop;
@@ -255,6 +256,10 @@ 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())
+ return;
+
/* Determine Label */
string volume_label = "";
if (volume_control.high_volume)
diff --git a/src/sound-menu.vala b/src/sound-menu.vala
index 3881faf..96dd143 100644
--- a/src/sound-menu.vala
+++ b/src/sound-menu.vala
@@ -60,6 +60,7 @@ public class SoundMenu: Object
root_item.set_attribute ("x-canonical-type", "s", "com.canonical.indicator.root");
root_item.set_attribute ("x-canonical-scroll-action", "s", "indicator.scroll");
root_item.set_attribute ("x-canonical-secondary-action", "s", "indicator.mute");
+ root_item.set_attribute ("submenu-action", "s", "indicator.indicator-shown");
root_item.set_submenu (this.menu);
this.root = new Menu ();