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
1=== modified file 'shell/Shell.qml'
2--- shell/Shell.qml 2012-03-02 09:30:42 +0000
3+++ shell/Shell.qml 2012-03-08 12:40:33 +0000
4@@ -180,7 +180,7 @@
5 Component.onCompleted: declarativeView.show()
6
7 Keys.onPressed: {
8- if (event.key == Qt.Key_Escape) {
9+ if (event.key == Qt.Key_Escape || (event.key == Qt.Key_F4 && event.modifiers == Qt.AltModifier )) {
10 declarativeView.forceDeactivateWindow()
11 }
12 }
13
14=== modified file 'tests/dash/dash-tests.rb'
15--- tests/dash/dash-tests.rb 2012-03-06 14:39:51 +0000
16+++ tests/dash/dash-tests.rb 2012-03-08 12:40:33 +0000
17@@ -66,6 +66,34 @@
18 $SUT.execute_shell_command 'pkill -nf unity-2d-shell'
19 end
20
21+ # Test case objectives:
22+ # * Check that Alt+F4 hides dash
23+ # Pre-conditions
24+ # * Desktop with no running applications
25+ # Test steps
26+ # * Verify dash is not showing
27+ # * Press Alt+F2
28+ # * Verify dash is showing
29+ # * Press Alt+F4
30+ # * Verify dash is not showing
31+ # Post-conditions
32+ # * None
33+ # References
34+ # * None
35+ test "Alt+F2, Alt+F4 hides dash" do
36+ verify_equal("false", TIMEOUT, 'There should not be a Dash declarative view on startup') {
37+ @app.Dash()['active']
38+ }
39+ XDo::Keyboard.alt_F2
40+ verify_equal("true", TIMEOUT, 'There should be a Dash declarative view after pressing Alt+F2') {
41+ @app.Dash()['active']
42+ }
43+ XDo::Keyboard.alt_F4
44+ verify_equal("false", TIMEOUT, 'There should not be a Dash declarative view after pressing Escape') {
45+ @app.Dash()['active']
46+ }
47+ end
48+
49 #####################################################################################
50 # Test casess
51
52
53=== modified file 'tests/hud/hud_show_hide_tests.rb'
54--- tests/hud/hud_show_hide_tests.rb 2012-02-20 17:02:12 +0000
55+++ tests/hud/hud_show_hide_tests.rb 2012-03-08 12:40:33 +0000
56@@ -118,6 +118,36 @@
57 @app.Hud()
58 }
59 end
60+
61+ # Test case objectives:
62+ # * Check Alt+F4 key closes HUD
63+ # Pre-conditions
64+ # * None
65+ # Test steps
66+ # * Check HUD closed
67+ # * Tap the Alt key
68+ # * Check HUD open
69+ # * Tap Alt+F4 key
70+ # * Check HUD closed
71+ # Post-conditions
72+ # * None
73+ # References
74+ # * None
75+ test "HUD hides with ALT+F4 key" do
76+ verify_not(1, 'HUD should be hidden at startup') {
77+ @app.Hud()
78+ }
79+
80+ XDo::Keyboard.alt
81+ verify_equal('true', TIMEOUT, 'HUD should be visible, as the Alt key was tapped') {
82+ @app.Hud()['active']
83+ }
84+
85+ XDo::Keyboard.alt_F4
86+ verify_not(1, 'HUD should be hidden, as the ALT+F4 key should dismiss it') {
87+ @app.Hud()
88+ }
89+ end
90
91 # Test case objectives:
92 # * Check outside mouse-click closes HUD

Subscribers

People subscribed via source and target branches