Merge lp:~mterry/webbrowser-app/switch-tab-keybinding into lp:webbrowser-app
- switch-tab-keybinding
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Olivier Tilloy |
Approved revision: | 1205 |
Merged at revision: | 1229 |
Proposed branch: | lp:~mterry/webbrowser-app/switch-tab-keybinding |
Merge into: | lp:webbrowser-app |
Diff against target: |
96 lines (+40/-18) 2 files modified
src/app/webbrowser/Browser.qml (+34/-18) tests/autopilot/webbrowser_app/tests/test_keyboard.py (+6/-0) |
To merge this branch: | bzr merge lp:~mterry/webbrowser-app/switch-tab-keybinding |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Olivier Tilloy | Approve | ||
Review via email: mp+272671@code.launchpad.net |
Commit message
Add Ctrl+PageUp and Ctrl+PageDown as alternate keyboard shortcuts for cycling through tabs.
Description of the change
Add Ctrl+PageUp and Ctrl+PageDown as alternate keyboard shortcuts for cycling through tabs.
PS Jenkins bot (ps-jenkins) wrote : | # |
Olivier Tilloy (osomon) wrote : | # |
LGTM, thanks for this useful contribution.
A couple of minor comments:
- the call to focus recentView should probably be factored out to the implementation of internal.
- can you update the autopilot tests in tests/autopilot
- 1204. By Michael Terry
-
Add test and consolidate a little code
Michael Terry (mterry) wrote : | # |
Test added and recentView.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1204
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Michael Terry (mterry) wrote : | # |
I assume those autopilot errors are typical, and not due to this branch?
Olivier Tilloy (osomon) wrote : | # |
The autopilot tests are usually fairly stable, but it’s not uncommon to see one or two random failures. The failures here seem completely unrelated to your branch, but given there are 4 of them, which is higher than usual, I’ll trigger a new CI run.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1204
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1204
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1204
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1204
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Olivier Tilloy (osomon) wrote : | # |
The following autopilot test is broken:
webbrowser_
I can reliably observe the failure on desktop by running the test in narrow mode: modify the width of the window to be 50GU instead of 100GU in src/app/
cd tests/autopilot
autopilot3 run webbrowser_
I’m guessing the change to switchToTab() is what introduced the regression: when selecting a tab from the tabs view (in narrow mode), the recent view is still visible, so we don’t want to focus back the recent view. My bad for suggesting to factor this out, can you please revert that change?
- 1205. By Michael Terry
-
Undo consolidation
Michael Terry (mterry) wrote : | # |
OK, undid that change. :)
Olivier Tilloy (osomon) wrote : | # |
LGTM, let’s see if the CI job passes now.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1205
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'src/app/webbrowser/Browser.qml' | |||
2 | --- src/app/webbrowser/Browser.qml 2015-09-28 08:15:10 +0000 | |||
3 | +++ src/app/webbrowser/Browser.qml 2015-10-06 15:46:27 +0000 | |||
4 | @@ -1273,6 +1273,24 @@ | |||
5 | 1273 | } | 1273 | } |
6 | 1274 | } | 1274 | } |
7 | 1275 | 1275 | ||
8 | 1276 | function switchToPreviousTab() { | ||
9 | 1277 | if (browser.wide) { | ||
10 | 1278 | internal.switchToTab((tabsModel.currentIndex - 1 + tabsModel.count) % tabsModel.count) | ||
11 | 1279 | } else { | ||
12 | 1280 | internal.switchToTab(tabsModel.count - 1) | ||
13 | 1281 | } | ||
14 | 1282 | if (recentView.visible) recentView.focus = true | ||
15 | 1283 | } | ||
16 | 1284 | |||
17 | 1285 | function switchToNextTab() { | ||
18 | 1286 | if (browser.wide) { | ||
19 | 1287 | internal.switchToTab((tabsModel.currentIndex + 1) % tabsModel.count) | ||
20 | 1288 | } else { | ||
21 | 1289 | internal.switchToTab(tabsModel.count - 1) | ||
22 | 1290 | } | ||
23 | 1291 | if (recentView.visible) recentView.focus = true | ||
24 | 1292 | } | ||
25 | 1293 | |||
26 | 1276 | function switchToTab(index) { | 1294 | function switchToTab(index) { |
27 | 1277 | tabsModel.currentIndex = index | 1295 | tabsModel.currentIndex = index |
28 | 1278 | var tab = tabsModel.currentTab | 1296 | var tab = tabsModel.currentTab |
29 | @@ -1581,34 +1599,32 @@ | |||
30 | 1581 | KeyboardShortcuts { | 1599 | KeyboardShortcuts { |
31 | 1582 | id: shortcuts | 1600 | id: shortcuts |
32 | 1583 | 1601 | ||
34 | 1584 | // Ctrl+Tab: cycle through open tabs | 1602 | // Ctrl+Tab or Ctrl+PageDown: cycle through open tabs |
35 | 1585 | KeyboardShortcut { | 1603 | KeyboardShortcut { |
36 | 1586 | modifiers: Qt.ControlModifier | 1604 | modifiers: Qt.ControlModifier |
37 | 1587 | key: Qt.Key_Tab | 1605 | key: Qt.Key_Tab |
38 | 1588 | enabled: chrome.visible || recentView.visible | 1606 | enabled: chrome.visible || recentView.visible |
47 | 1589 | onTriggered: { | 1607 | onTriggered: internal.switchToNextTab() |
48 | 1590 | if (browser.wide) { | 1608 | } |
49 | 1591 | internal.switchToTab((tabsModel.currentIndex + 1) % tabsModel.count) | 1609 | KeyboardShortcut { |
50 | 1592 | } else { | 1610 | modifiers: Qt.ControlModifier |
51 | 1593 | internal.switchToTab(tabsModel.count - 1) | 1611 | key: Qt.Key_PageDown |
52 | 1594 | } | 1612 | enabled: chrome.visible || recentView.visible |
53 | 1595 | if (recentView.visible) recentView.focus = true | 1613 | onTriggered: internal.switchToNextTab() |
46 | 1596 | } | ||
54 | 1597 | } | 1614 | } |
55 | 1598 | 1615 | ||
57 | 1599 | // Ctrl+Shift+Tab: cycle through open tabs in reverse order | 1616 | // Ctrl+Shift+Tab or Ctrl+PageUp: cycle through open tabs in reverse order |
58 | 1600 | KeyboardShortcut { | 1617 | KeyboardShortcut { |
59 | 1601 | modifiers: Qt.ControlModifier | 1618 | modifiers: Qt.ControlModifier |
60 | 1602 | key: Qt.Key_Backtab | 1619 | key: Qt.Key_Backtab |
61 | 1603 | enabled: chrome.visible || recentView.visible | 1620 | enabled: chrome.visible || recentView.visible |
70 | 1604 | onTriggered: { | 1621 | onTriggered: internal.switchToPreviousTab() |
71 | 1605 | if (browser.wide) { | 1622 | } |
72 | 1606 | internal.switchToTab((tabsModel.currentIndex - 1 + tabsModel.count) % tabsModel.count) | 1623 | KeyboardShortcut { |
73 | 1607 | } else { | 1624 | modifiers: Qt.ControlModifier |
74 | 1608 | internal.switchToTab(tabsModel.count - 1) | 1625 | key: Qt.Key_PageUp |
75 | 1609 | } | 1626 | enabled: chrome.visible || recentView.visible |
76 | 1610 | if (recentView.visible) recentView.focus = true | 1627 | onTriggered: internal.switchToPreviousTab() |
69 | 1611 | } | ||
77 | 1612 | } | 1628 | } |
78 | 1613 | 1629 | ||
79 | 1614 | // Ctrl+W or Ctrl+F4: Close the current tab | 1630 | // Ctrl+W or Ctrl+F4: Close the current tab |
80 | 1615 | 1631 | ||
81 | === modified file 'tests/autopilot/webbrowser_app/tests/test_keyboard.py' | |||
82 | --- tests/autopilot/webbrowser_app/tests/test_keyboard.py 2015-08-14 09:25:38 +0000 | |||
83 | +++ tests/autopilot/webbrowser_app/tests/test_keyboard.py 2015-10-06 15:46:27 +0000 | |||
84 | @@ -102,6 +102,12 @@ | |||
85 | 102 | self.check_tab_number(1) | 102 | self.check_tab_number(1) |
86 | 103 | self.main_window.press_key('Ctrl+Tab') | 103 | self.main_window.press_key('Ctrl+Tab') |
87 | 104 | self.check_tab_number(2) | 104 | self.check_tab_number(2) |
88 | 105 | self.main_window.press_key('Ctrl+Page_Down') | ||
89 | 106 | self.check_tab_number(0) | ||
90 | 107 | self.main_window.press_key('Shift+Ctrl+Tab') | ||
91 | 108 | self.check_tab_number(2) | ||
92 | 109 | self.main_window.press_key('Ctrl+Page_Up') | ||
93 | 110 | self.check_tab_number(1) | ||
94 | 105 | 111 | ||
95 | 106 | def test_can_switch_tabs_after_suggestions_escape(self): | 112 | def test_can_switch_tabs_after_suggestions_escape(self): |
96 | 107 | self.open_tabs(1) | 113 | self.open_tabs(1) |
FAILED: Continuous integration, rev:1203 jenkins. qa.ubuntu. com/job/ webbrowser- app-ci/ 2291/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 4388 jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- amd64-ci/ 1045/console jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- armhf-ci/ 1045 jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- armhf-ci/ 1045/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ webbrowser- app-vivid- i386-ci/ 1045/console jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- vivid-mako/ 3571 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 4385 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 4385/artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 23721
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
deb: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/webbrowser- app-ci/ 2291/rebuild
http://