Merge lp:~brandontschaefer/unity/quicklist-close-super-open-dash into lp:unity

Proposed by Brandon Schaefer
Status: Merged
Approved by: Brandon Schaefer
Approved revision: no longer in the source branch.
Merged at revision: 2496
Proposed branch: lp:~brandontschaefer/unity/quicklist-close-super-open-dash
Merge into: lp:unity
Diff against target: 54 lines (+24/-3)
2 files modified
plugins/unityshell/src/unityshell.cpp (+12/-2)
tests/autopilot/unity/tests/test_quicklist.py (+12/-1)
To merge this branch: bzr merge lp:~brandontschaefer/unity/quicklist-close-super-open-dash
Reviewer Review Type Date Requested Status
Thomi Richards (community) quality Approve
Review via email: mp+113097@code.launchpad.net

Commit message

Quicklist closes when opening the Dash.

Description of the change

=== Problem ===
When a quicklist was open you could not open th dash.

=== Fix ===
If a quicklist is open and you press super it will now close the quicklist.

=== Test ===
AP Tests

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

Hi,

34 + """When the quicklist is open and you open the dash:
35 + The quicklist should close then the dash must open.
36 +
37 + """

Please fix this docstring. "should" is a weasel word that implies ambiguity. I suggest a better docstring is something like:

"When a quicklist is open you must still be able to open the dash by pushing the Super key."""

39 + [calc_win1] = calc.get_windows()
40 + self.assertTrue(calc_win1.is_focused)

You don't need these two lines - you never use calc_win1, and we don't need to assert that the window is focused (that's not what we're testing).

45 + self.dash.ensure_visible()

If this succeeds you'll be leaving the dash open, which will cause the test to fail! Please add the following:

self.addCleanup(self.dash.ensure_hidden)

Other than that, looks good.

review: Needs Fixing (quality)
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) :
review: Approve (quality)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/unityshell.cpp'
2--- plugins/unityshell/src/unityshell.cpp 2012-07-11 03:15:53 +0000
3+++ plugins/unityshell/src/unityshell.cpp 2012-07-11 20:52:29 +0000
4@@ -1697,8 +1697,18 @@
5 scale_just_activated_ = false;
6 }
7
8- if (hud_controller_->IsVisible() && launcher_controller_->AboutToShowDash(was_tap, when))
9- hud_controller_->HideHud();
10+ if (launcher_controller_->AboutToShowDash(was_tap, when))
11+ {
12+ if (hud_controller_->IsVisible())
13+ {
14+ hud_controller_->HideHud();
15+ }
16+
17+ if (QuicklistManager::Default()->Current())
18+ {
19+ QuicklistManager::Default()->Current()->Hide();
20+ }
21+ }
22
23 super_keypressed_ = false;
24 launcher_controller_->KeyNavTerminate(true);
25
26=== modified file 'tests/autopilot/unity/tests/test_quicklist.py'
27--- tests/autopilot/unity/tests/test_quicklist.py 2012-07-11 04:28:16 +0000
28+++ tests/autopilot/unity/tests/test_quicklist.py 2012-07-11 20:52:29 +0000
29@@ -137,13 +137,24 @@
30 """When a quicklist is open you must still be able to open the Hud."""
31 calc = self.start_app("Calculator")
32
33- calc_icon = self.launcher.model.get_icon_by_desktop_id(calc.desktop_file)
34+ calc_icon = self.launcher.model.get_icon(desktop_id=calc.desktop_file)
35 calc_ql = self.open_quicklist_for_icon(calc_icon)
36
37 self.hud.ensure_visible()
38 self.addCleanup(self.hud.ensure_hidden)
39 self.assertThat(self.hud.visible, Eventually(Equals(True)))
40
41+ def test_quicklist_closes_when_dash_opens(self):
42+ """When the quicklist is open you must still be able to open the dash."""
43+ calc = self.start_app("Calculator")
44+
45+ calc_icon = self.launcher.model.get_icon(desktop_id=calc.desktop_file)
46+ calc_ql = self.open_quicklist_for_icon(calc_icon)
47+
48+ self.dash.ensure_visible()
49+ self.addCleanup(self.dash.ensure_hidden)
50+ self.assertThat(self.dash.visible, Eventually(Equals(True)))
51+
52
53 class QuicklistKeyNavigationTests(UnityTestCase):
54 """Tests for the quicklist key navigation."""