aboutsummaryrefslogtreecommitdiff
path: root/src/phone.vala
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-08-05 17:47:31 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-08-05 17:47:31 -0500
commit77e298f113541feacb27c1deca14ec953b6559b0 (patch)
tree8126f0e41a531fec3f60eaa58e04c5ae0a724b08 /src/phone.vala
parentfcf74c76f44201684dedd88e1fce39140c1a6235 (diff)
downloadayatana-indicator-bluetooth-77e298f113541feacb27c1deca14ec953b6559b0.tar.gz
ayatana-indicator-bluetooth-77e298f113541feacb27c1deca14ec953b6559b0.tar.bz2
ayatana-indicator-bluetooth-77e298f113541feacb27c1deca14ec953b6559b0.zip
pass the SimpleActionGroup handle into the profile object so that dynamically-added actions can get added/exported
Diffstat (limited to 'src/phone.vala')
-rw-r--r--src/phone.vala19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/phone.vala b/src/phone.vala
index 34c10ab..4eaff4d 100644
--- a/src/phone.vala
+++ b/src/phone.vala
@@ -19,21 +19,22 @@
class Phone: Profile
{
- private Action[] actions;
+ Bluetooth bluetooth;
+ SimpleActionGroup action_group;
- public override void add_actions_to_group (SimpleActionGroup group)
- {
- for (var i=0; i<actions.length; i++)
- group.insert (actions[i]);
- }
-
- public Phone (Bluetooth bluetooth)
+ public Phone (Bluetooth bluetooth, SimpleActionGroup action_group)
{
base ("phone");
- actions = {};
+ this.bluetooth = bluetooth;
+ this.action_group = action_group;
+
+ // build the static actions
+ Action[] actions = {};
actions += new SimpleAction.stateful ("root-phone", null, action_state_for_root());
actions += create_settings_action ();
+ foreach (var a in actions)
+ action_group.insert (a);
var section = new Menu ();
section.append (_("Sound settingsā€¦"), "indicator.phone-settings");