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
=== modified file 'unity-private/panel/panel-indicator-object-entry-view.vala'
--- unity-private/panel/panel-indicator-object-entry-view.vala 2010-09-21 14:35:55 +0000
+++ unity-private/panel/panel-indicator-object-entry-view.vala 2010-09-22 16:56:07 +0000
@@ -23,6 +23,7 @@
23 {23 {
24 public unowned Indicator.ObjectEntry entry { get; construct; }24 public unowned Indicator.ObjectEntry entry { get; construct; }
25 public signal void menu_moved (Gtk.MenuDirectionType type);25 public signal void menu_moved (Gtk.MenuDirectionType type);
26 public signal void entry_shown ();
2627
27 private Clutter.CairoTexture bg;28 private Clutter.CairoTexture bg;
28 public Ctk.Image image;29 public Ctk.Image image;
@@ -469,6 +470,8 @@
469 entry.menu.move_current.connect (menu_key_moved);470 entry.menu.move_current.connect (menu_key_moved);
470 entry.menu.notify["visible"].connect (menu_vis_changed);471 entry.menu.notify["visible"].connect (menu_vis_changed);
471 bg.opacity = 255;472 bg.opacity = 255;
473
474 entry_shown ();
472 }475 }
473 }476 }
474477
475478
=== modified file 'unity-private/panel/panel-indicator-object-view.vala'
--- unity-private/panel/panel-indicator-object-view.vala 2010-09-16 21:33:12 +0000
+++ unity-private/panel/panel-indicator-object-view.vala 2010-09-22 16:56:07 +0000
@@ -68,6 +68,7 @@
68 IndicatorObjectEntryView object_entry_view = new IndicatorObjectEntryView (indicator_object_entry);68 IndicatorObjectEntryView object_entry_view = new IndicatorObjectEntryView (indicator_object_entry);
6969
70 object_entry_view.menu_moved.connect (this.on_menu_moved);70 object_entry_view.menu_moved.connect (this.on_menu_moved);
71 object_entry_view.entry_shown.connect (on_entry_shown);
7172
72 this.indicator_entry_array.add (object_entry_view);73 this.indicator_entry_array.add (object_entry_view);
73 this.add_actor (object_entry_view);74 this.add_actor (object_entry_view);
@@ -167,12 +168,19 @@
167 IndicatorObjectEntryView object_entry_view = new IndicatorObjectEntryView (indicator_object_entry);168 IndicatorObjectEntryView object_entry_view = new IndicatorObjectEntryView (indicator_object_entry);
168169
169 object_entry_view.menu_moved.connect (this.on_menu_moved);170 object_entry_view.menu_moved.connect (this.on_menu_moved);
171 object_entry_view.entry_shown.connect (on_entry_shown);
170172
171 this.indicator_entry_array.add (object_entry_view);173 this.indicator_entry_array.add (object_entry_view);
172 this.add_actor (object_entry_view);174 this.add_actor (object_entry_view);
173175
174 }176 }
175177
178 private void on_entry_shown (IndicatorObjectEntryView view)
179 {
180 indicator_object.entry_activate (view.entry,
181 global_shell.get_current_time ());
182 }
183
176 private void remove_entry (Indicator.ObjectEntry entry)184 private void remove_entry (Indicator.ObjectEntry entry)
177 {185 {
178 for (int i = 0; i < indicator_entry_array.size; i++)186 for (int i = 0; i < indicator_entry_array.size; i++)
179187
=== modified file 'vapi/indicator.vapi'
--- vapi/indicator.vapi 2010-09-16 21:33:12 +0000
+++ vapi/indicator.vapi 2010-09-22 16:56:07 +0000
@@ -27,6 +27,7 @@
27 [NoWrapper]27 [NoWrapper]
28 public virtual unowned Gtk.Menu get_menu ();28 public virtual unowned Gtk.Menu get_menu ();
29 [NoWrapper]29 [NoWrapper]
30 public virtual void entry_activate (Indicator.ObjectEntry entry, uint timestamp);
30 public virtual void indicator_object_reserved_1 ();31 public virtual void indicator_object_reserved_1 ();
31 public virtual signal void entry_added (Indicator.ObjectEntry entry);32 public virtual signal void entry_added (Indicator.ObjectEntry entry);
32 public virtual signal void entry_moved (Indicator.ObjectEntry entry, uint old_pos, uint new_pos);33 public virtual signal void entry_moved (Indicator.ObjectEntry entry, uint old_pos, uint new_pos);