~charlesk/indicator-bluetooth/gmenuify

« back to all changes in this revision

Viewing changes to src/service.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:
16
16
 
17
17
    public Service (Bluetooth bluetooth)
18
18
    {
 
19
      actions = new SimpleActionGroup ();
 
20
 
19
21
      profiles = new HashTable<string,Profile> (str_hash, str_equal);
20
 
      profiles.insert ("phone", new Phone (bluetooth));
21
 
      profiles.insert ("desktop", new Desktop (bluetooth));
22
 
 
23
 
      actions = new SimpleActionGroup ();
24
 
      foreach (Profile profile in profiles.get_values())
25
 
        profile.add_actions_to_group (actions);
 
22
      profiles.insert ("phone", new Phone (bluetooth, actions));
 
23
      profiles.insert ("desktop", new Desktop (bluetooth, actions));
26
24
    }
27
25
 
28
26
    public int run ()
61
59
 
62
60
      this.profiles.for_each ((name,profile) => {
63
61
        var path = @"/com/canonical/indicator/bluetooth/$name";
64
 
        message (@"exporting menu '$path'");
 
62
        debug (@"exporting menu '$path'");
65
63
        profile.export_menu (connection, path);
66
64
      });
67
65
    }