~charlesk/indicator-bluetooth/gmenuify

« back to all changes in this revision

Viewing changes to src/phone.vala

  • Committer: Charles Kerr
  • Date: 2013-08-05 22:47:31 UTC
  • Revision ID: charles.kerr@canonical.com-20130805224731-o40p0j3gog9pv3f5
pass the SimpleActionGroup handle into the profile object so that dynamically-added actions can get added/exported

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
class Phone: Profile
21
21
{
22
 
  private Action[] actions;
23
 
 
24
 
  public override void add_actions_to_group (SimpleActionGroup group)
25
 
  {
26
 
    for (var i=0; i<actions.length; i++)
27
 
      group.insert (actions[i]);
28
 
  }
29
 
 
30
 
  public Phone (Bluetooth bluetooth)
 
22
  Bluetooth bluetooth;
 
23
  SimpleActionGroup action_group;
 
24
 
 
25
  public Phone (Bluetooth bluetooth, SimpleActionGroup action_group)
31
26
  {
32
27
    base ("phone");
33
28
 
34
 
    actions = {};
 
29
    this.bluetooth = bluetooth;
 
30
    this.action_group = action_group;
 
31
 
 
32
    // build the static actions
 
33
    Action[] actions = {};
35
34
    actions += new SimpleAction.stateful ("root-phone", null, action_state_for_root());
36
35
    actions += create_settings_action ();
 
36
    foreach (var a in actions)
 
37
      action_group.insert (a);
37
38
 
38
39
    var section = new Menu ();
39
40
    section.append (_("Sound settings…"), "indicator.phone-settings");