Merge lp:~brandontschaefer/unity/lp.1108956-fix-again into lp:unity

Proposed by Brandon Schaefer on 2013-04-11
Status: Work in progress
Proposed branch: lp:~brandontschaefer/unity/lp.1108956-fix-again
Merge into: lp:unity
Diff against target: 75 lines (+27/-5)
3 files modified
dash/DashView.cpp (+11/-4)
tests/autopilot/unity/emulators/dash.py (+6/-1)
tests/autopilot/unity/tests/test_dash.py (+10/-0)
To merge this branch: bzr merge lp:~brandontschaefer/unity/lp.1108956-fix-again
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) 2013-04-11 Approve on 2013-04-16
PS Jenkins bot continuous-integration Needs Fixing on 2013-04-13
Review via email: mp+158450@code.launchpad.net

Commit message

If are in the Command Prompt (Alt+F2) go to the Home.Lens when pressing super or clicking the launcher icon.

Description of the change

=== Problem ===
You must be able to go from the Command Prompt (Alt+F2) to the Home Lens.

=== Fix ===
If we receive a UBUS_PLACE_ENTRY_ACTIVATE_REQUEST, and the command lens is active. Activate that lens instead of closing the dash. As the command lens is not really a lens and should not be treated as if the dash is open. It should be treated as if it were another overlay like the Hud.

=== Test ===
AP test

To post a comment you must log in.
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Marco Trevisan (Treviño) (3v1n0) wrote :

+1

review: Approve
Brandon Schaefer (brandontschaefer) wrote :

Ill have to look into redoing this again.... :(

Marco Trevisan (Treviño) (3v1n0) wrote :

Any new work on this? :)

Unmerged revisions

3298. By Brandon Schaefer on 2013-04-11

* If the command lens is active, and we get a super press or launcher icon click
  that is trying to open the home.lens, then switch to the home lens instead of
  closing the dash.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dash/DashView.cpp'
2--- dash/DashView.cpp 2013-04-10 18:26:42 +0000
3+++ dash/DashView.cpp 2013-04-11 18:16:25 +0000
4@@ -1140,12 +1140,19 @@
5 lens_bar_->Activate(id);
6 ubus_manager_.SendMessage(UBUS_DASH_EXTERNAL_ACTIVATION);
7 }
8- else if (/* visible_ && */ handled_type == NOT_HANDLED)
9+ else if (handled_type == NOT_HANDLED)
10 {
11- ubus_manager_.SendMessage(UBUS_OVERLAY_CLOSE_REQUEST, NULL,
12- glib::Source::Priority::HIGH);
13+ if (lens_bar_->GetActiveLensId() == "commands.lens")
14+ {
15+ lens_bar_->Activate(id);
16+ }
17+ else
18+ {
19+ ubus_manager_.SendMessage(UBUS_OVERLAY_CLOSE_REQUEST, NULL,
20+ glib::Source::Priority::HIGH);
21+ }
22 }
23- else if (/* visible_ && */ handled_type == GOTO_DASH_URI)
24+ else if (handled_type == GOTO_DASH_URI)
25 {
26 lens_bar_->Activate(id);
27 }
28
29=== modified file 'tests/autopilot/unity/emulators/dash.py'
30--- tests/autopilot/unity/emulators/dash.py 2013-04-08 20:27:29 +0000
31+++ tests/autopilot/unity/emulators/dash.py 2013-04-11 18:16:25 +0000
32@@ -63,6 +63,12 @@
33 """
34 Ensures the dash is hidden.
35 """
36+
37+ # the command lens is special, and needs 2 super presses to exit lp.1108956
38+ if self.active_lens == "commands.lens":
39+ self.keybinding("dash/reveal", 0.1)
40+ self.visible.wait_for(True)
41+
42 if self.visible:
43 self.toggle_reveal()
44 self.visible.wait_for(False)
45@@ -85,7 +91,6 @@
46 def preview_animation(self):
47 """Returns the average progress of dash slip and animating a preview.
48 Between 0.0 and 1.0.
49-
50 """
51 return self.view.preview_animation;
52
53
54=== modified file 'tests/autopilot/unity/tests/test_dash.py'
55--- tests/autopilot/unity/tests/test_dash.py 2013-04-10 18:26:42 +0000
56+++ tests/autopilot/unity/tests/test_dash.py 2013-04-11 18:16:25 +0000
57@@ -76,8 +76,18 @@
58 """Switch to command lens without closing the dash."""
59 self.unity.dash.ensure_visible()
60 self.unity.dash.reveal_command_lens()
61+ self.assertThat(self.unity.dash.visible, Eventually(Equals(True)))
62 self.assertThat(self.unity.dash.active_lens, Eventually(Equals('commands.lens')))
63
64+ def test_can_go_from_command_lens_to_dash(self):
65+ """We must be able to go from the command lens to the dash (home lens)."""
66+ self.unity.dash.reveal_command_lens()
67+
68+ # Since the dash is visible we can't use ensure_visible().
69+ self.keybinding("dash/reveal", 0.1)
70+ self.assertThat(self.unity.dash.visible, Eventually(Equals(True)))
71+ self.assertThat(self.unity.dash.active_lens, Eventually(Equals('home.lens')))
72+
73 def test_command_lens_can_close_itself(self):
74 """We must be able to close the Command lens with Alt+F2"""
75 self.unity.dash.reveal_command_lens()