Merge lp:~stolowski/unity-2d/alt-f4-closes-dash into lp:unity-2d

Proposed by Paweł Stołowski
Status: Merged
Approved by: Gerry Boland
Approved revision: 960
Merged at revision: 971
Proposed branch: lp:~stolowski/unity-2d/alt-f4-closes-dash
Merge into: lp:unity-2d
Diff against target: 92 lines (+59/-1)
3 files modified
shell/Shell.qml (+1/-1)
tests/dash/dash-tests.rb (+28/-0)
tests/hud/hud_show_hide_tests.rb (+30/-0)
To merge this branch: bzr merge lp:~stolowski/unity-2d/alt-f4-closes-dash
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
Review via email: mp+96393@code.launchpad.net

Description of the change

[dash][hud] Hide dash and hud on ALT+F4.
Added ALT+F4 handling to Shell.qml.

To post a comment you must log in.
960. By Paweł Stołowski

Dash tests - removed extra newline.

Revision history for this message
Gerry Boland (gerboland) wrote :

Nice, thank you Pawel!

review: Approve
Revision history for this message
Paweł Stołowski (stolowski) wrote :

Cool, thanks :)

Pawel

On 03/08/2012 05:14 PM, Gerry Boland wrote:
> Review: Approve
>
> Nice, thank you Pawel!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'shell/Shell.qml'
--- shell/Shell.qml 2012-03-02 09:30:42 +0000
+++ shell/Shell.qml 2012-03-08 12:40:33 +0000
@@ -180,7 +180,7 @@
180 Component.onCompleted: declarativeView.show()180 Component.onCompleted: declarativeView.show()
181181
182 Keys.onPressed: {182 Keys.onPressed: {
183 if (event.key == Qt.Key_Escape) {183 if (event.key == Qt.Key_Escape || (event.key == Qt.Key_F4 && event.modifiers == Qt.AltModifier )) {
184 declarativeView.forceDeactivateWindow()184 declarativeView.forceDeactivateWindow()
185 }185 }
186 }186 }
187187
=== modified file 'tests/dash/dash-tests.rb'
--- tests/dash/dash-tests.rb 2012-03-06 14:39:51 +0000
+++ tests/dash/dash-tests.rb 2012-03-08 12:40:33 +0000
@@ -66,6 +66,34 @@
66 $SUT.execute_shell_command 'pkill -nf unity-2d-shell'66 $SUT.execute_shell_command 'pkill -nf unity-2d-shell'
67 end67 end
6868
69 # Test case objectives:
70 # * Check that Alt+F4 hides dash
71 # Pre-conditions
72 # * Desktop with no running applications
73 # Test steps
74 # * Verify dash is not showing
75 # * Press Alt+F2
76 # * Verify dash is showing
77 # * Press Alt+F4
78 # * Verify dash is not showing
79 # Post-conditions
80 # * None
81 # References
82 # * None
83 test "Alt+F2, Alt+F4 hides dash" do
84 verify_equal("false", TIMEOUT, 'There should not be a Dash declarative view on startup') {
85 @app.Dash()['active']
86 }
87 XDo::Keyboard.alt_F2
88 verify_equal("true", TIMEOUT, 'There should be a Dash declarative view after pressing Alt+F2') {
89 @app.Dash()['active']
90 }
91 XDo::Keyboard.alt_F4
92 verify_equal("false", TIMEOUT, 'There should not be a Dash declarative view after pressing Escape') {
93 @app.Dash()['active']
94 }
95 end
96
69 #####################################################################################97 #####################################################################################
70 # Test casess98 # Test casess
7199
72100
=== modified file 'tests/hud/hud_show_hide_tests.rb'
--- tests/hud/hud_show_hide_tests.rb 2012-02-20 17:02:12 +0000
+++ tests/hud/hud_show_hide_tests.rb 2012-03-08 12:40:33 +0000
@@ -118,6 +118,36 @@
118 @app.Hud()118 @app.Hud()
119 }119 }
120 end120 end
121
122 # Test case objectives:
123 # * Check Alt+F4 key closes HUD
124 # Pre-conditions
125 # * None
126 # Test steps
127 # * Check HUD closed
128 # * Tap the Alt key
129 # * Check HUD open
130 # * Tap Alt+F4 key
131 # * Check HUD closed
132 # Post-conditions
133 # * None
134 # References
135 # * None
136 test "HUD hides with ALT+F4 key" do
137 verify_not(1, 'HUD should be hidden at startup') {
138 @app.Hud()
139 }
140
141 XDo::Keyboard.alt
142 verify_equal('true', TIMEOUT, 'HUD should be visible, as the Alt key was tapped') {
143 @app.Hud()['active']
144 }
145
146 XDo::Keyboard.alt_F4
147 verify_not(1, 'HUD should be hidden, as the ALT+F4 key should dismiss it') {
148 @app.Hud()
149 }
150 end
121 151
122 # Test case objectives:152 # Test case objectives:
123 # * Check outside mouse-click closes HUD153 # * Check outside mouse-click closes HUD

Subscribers

People subscribed via source and target branches