Merge lp:~unity-team/unity/entry-activated-support into lp:unity

Proposed by Neil J. Patel on 2010-09-22
Status: Merged
Merged at revision: 543
Proposed branch: lp:~unity-team/unity/entry-activated-support
Merge into: lp:unity
Diff against target: 64 lines (+12/-0)
3 files modified
unity-private/panel/panel-indicator-object-entry-view.vala (+3/-0)
unity-private/panel/panel-indicator-object-view.vala (+8/-0)
vapi/indicator.vapi (+1/-0)
To merge this branch: bzr merge lp:~unity-team/unity/entry-activated-support
Reviewer Review Type Date Requested Status
Jason Smith (community) 2010-09-22 Approve on 2010-09-22
Review via email: mp+36346@code.launchpad.net

Description of the change

Adds support for the new entry_activated API in libindicator. You'll need trunk libindicator and rebuild dbusmenu and the indicators to test this change. Or, you can trust me ;)

To post a comment you must log in.
Jason Smith (jassmith) wrote :

+1 code looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'unity-private/panel/panel-indicator-object-entry-view.vala'
2--- unity-private/panel/panel-indicator-object-entry-view.vala 2010-09-21 14:35:55 +0000
3+++ unity-private/panel/panel-indicator-object-entry-view.vala 2010-09-22 16:56:07 +0000
4@@ -23,6 +23,7 @@
5 {
6 public unowned Indicator.ObjectEntry entry { get; construct; }
7 public signal void menu_moved (Gtk.MenuDirectionType type);
8+ public signal void entry_shown ();
9
10 private Clutter.CairoTexture bg;
11 public Ctk.Image image;
12@@ -469,6 +470,8 @@
13 entry.menu.move_current.connect (menu_key_moved);
14 entry.menu.notify["visible"].connect (menu_vis_changed);
15 bg.opacity = 255;
16+
17+ entry_shown ();
18 }
19 }
20
21
22=== modified file 'unity-private/panel/panel-indicator-object-view.vala'
23--- unity-private/panel/panel-indicator-object-view.vala 2010-09-16 21:33:12 +0000
24+++ unity-private/panel/panel-indicator-object-view.vala 2010-09-22 16:56:07 +0000
25@@ -68,6 +68,7 @@
26 IndicatorObjectEntryView object_entry_view = new IndicatorObjectEntryView (indicator_object_entry);
27
28 object_entry_view.menu_moved.connect (this.on_menu_moved);
29+ object_entry_view.entry_shown.connect (on_entry_shown);
30
31 this.indicator_entry_array.add (object_entry_view);
32 this.add_actor (object_entry_view);
33@@ -167,12 +168,19 @@
34 IndicatorObjectEntryView object_entry_view = new IndicatorObjectEntryView (indicator_object_entry);
35
36 object_entry_view.menu_moved.connect (this.on_menu_moved);
37+ object_entry_view.entry_shown.connect (on_entry_shown);
38
39 this.indicator_entry_array.add (object_entry_view);
40 this.add_actor (object_entry_view);
41
42 }
43
44+ private void on_entry_shown (IndicatorObjectEntryView view)
45+ {
46+ indicator_object.entry_activate (view.entry,
47+ global_shell.get_current_time ());
48+ }
49+
50 private void remove_entry (Indicator.ObjectEntry entry)
51 {
52 for (int i = 0; i < indicator_entry_array.size; i++)
53
54=== modified file 'vapi/indicator.vapi'
55--- vapi/indicator.vapi 2010-09-16 21:33:12 +0000
56+++ vapi/indicator.vapi 2010-09-22 16:56:07 +0000
57@@ -27,6 +27,7 @@
58 [NoWrapper]
59 public virtual unowned Gtk.Menu get_menu ();
60 [NoWrapper]
61+ public virtual void entry_activate (Indicator.ObjectEntry entry, uint timestamp);
62 public virtual void indicator_object_reserved_1 ();
63 public virtual signal void entry_added (Indicator.ObjectEntry entry);
64 public virtual signal void entry_moved (Indicator.ObjectEntry entry, uint old_pos, uint new_pos);