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
=== modified file 'plugins/unityshell/src/unityshell.cpp'
--- plugins/unityshell/src/unityshell.cpp 2012-07-11 03:15:53 +0000
+++ plugins/unityshell/src/unityshell.cpp 2012-07-11 20:52:29 +0000
@@ -1697,8 +1697,18 @@
1697 scale_just_activated_ = false;1697 scale_just_activated_ = false;
1698 }1698 }
16991699
1700 if (hud_controller_->IsVisible() && launcher_controller_->AboutToShowDash(was_tap, when))1700 if (launcher_controller_->AboutToShowDash(was_tap, when))
1701 hud_controller_->HideHud();1701 {
1702 if (hud_controller_->IsVisible())
1703 {
1704 hud_controller_->HideHud();
1705 }
1706
1707 if (QuicklistManager::Default()->Current())
1708 {
1709 QuicklistManager::Default()->Current()->Hide();
1710 }
1711 }
17021712
1703 super_keypressed_ = false;1713 super_keypressed_ = false;
1704 launcher_controller_->KeyNavTerminate(true);1714 launcher_controller_->KeyNavTerminate(true);
17051715
=== modified file 'tests/autopilot/unity/tests/test_quicklist.py'
--- tests/autopilot/unity/tests/test_quicklist.py 2012-07-11 04:28:16 +0000
+++ tests/autopilot/unity/tests/test_quicklist.py 2012-07-11 20:52:29 +0000
@@ -137,13 +137,24 @@
137 """When a quicklist is open you must still be able to open the Hud."""137 """When a quicklist is open you must still be able to open the Hud."""
138 calc = self.start_app("Calculator")138 calc = self.start_app("Calculator")
139139
140 calc_icon = self.launcher.model.get_icon_by_desktop_id(calc.desktop_file)140 calc_icon = self.launcher.model.get_icon(desktop_id=calc.desktop_file)
141 calc_ql = self.open_quicklist_for_icon(calc_icon)141 calc_ql = self.open_quicklist_for_icon(calc_icon)
142142
143 self.hud.ensure_visible()143 self.hud.ensure_visible()
144 self.addCleanup(self.hud.ensure_hidden)144 self.addCleanup(self.hud.ensure_hidden)
145 self.assertThat(self.hud.visible, Eventually(Equals(True)))145 self.assertThat(self.hud.visible, Eventually(Equals(True)))
146146
147 def test_quicklist_closes_when_dash_opens(self):
148 """When the quicklist is open you must still be able to open the dash."""
149 calc = self.start_app("Calculator")
150
151 calc_icon = self.launcher.model.get_icon(desktop_id=calc.desktop_file)
152 calc_ql = self.open_quicklist_for_icon(calc_icon)
153
154 self.dash.ensure_visible()
155 self.addCleanup(self.dash.ensure_hidden)
156 self.assertThat(self.dash.visible, Eventually(Equals(True)))
157
147158
148class QuicklistKeyNavigationTests(UnityTestCase):159class QuicklistKeyNavigationTests(UnityTestCase):
149 """Tests for the quicklist key navigation."""160 """Tests for the quicklist key navigation."""