Merge lp:~uriboni/webbrowser-app/no-find-in-page-in-new-tab into lp:webbrowser-app

Proposed by Ugo Riboni
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 1131
Merged at revision: 1136
Proposed branch: lp:~uriboni/webbrowser-app/no-find-in-page-in-new-tab
Merge into: lp:webbrowser-app
Diff against target: 82 lines (+25/-3)
3 files modified
src/app/webbrowser/Browser.qml (+4/-3)
tests/autopilot/webbrowser_app/tests/test_findinpage.py (+17/-0)
tests/autopilot/webbrowser_app/tests/test_keyboard.py (+4/-0)
To merge this branch: bzr merge lp:~uriboni/webbrowser-app/no-find-in-page-in-new-tab
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Olivier Tilloy Approve
Review via email: mp+267829@code.launchpad.net

Commit message

Disable find in page when the new tab view is active.

Description of the change

Disable find in page when the new tab view is active

To post a comment you must log in.
Revision history for this message
Olivier Tilloy (osomon) wrote :

This looks good to me. I have one minor comment, see inline.

1131. By Ugo Riboni

Disable the ctr+f shortcut in a better way

Revision history for this message
Olivier Tilloy (osomon) wrote :

Looks good to me now, thanks!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/webbrowser/Browser.qml'
2--- src/app/webbrowser/Browser.qml 2015-08-11 10:37:56 +0000
3+++ src/app/webbrowser/Browser.qml 2015-08-12 16:43:32 +0000
4@@ -104,7 +104,7 @@
5 onTriggered: browser.historyModel.clearAll()
6 },
7 Actions.FindInPage {
8- enabled: !chrome.findInPageMode
9+ enabled: !chrome.findInPageMode && !newTabViewLoader.active
10 onTriggered: {
11 chrome.findInPageMode = true
12 chrome.focus = true
13@@ -353,7 +353,7 @@
14 objectName: "findinpage"
15 text: i18n.tr("Find in page")
16 iconName: "search"
17- enabled: !chrome.findInPageMode
18+ enabled: !chrome.findInPageMode && !newTabViewLoader.active
19 onTriggered: {
20 chrome.findInPageMode = true
21 chrome.focus = true
22@@ -1134,7 +1134,7 @@
23 PopupUtils.open(bookmarkOptionsComponent,
24 chrome.bookmarkTogglePlaceHolder,
25 {"bookmarkUrl": url,
26- "bookmarkTitle": title})
27+ "bookmarkTitle": title})
28 }
29 }
30
31@@ -1501,6 +1501,7 @@
32 KeyboardShortcut {
33 modifiers: Qt.ControlModifier
34 key: Qt.Key_F
35+ enabled: !newTabViewLoader.active
36 onTriggered: {
37 chrome.findInPageMode = true
38 chrome.focus = true
39
40=== modified file 'tests/autopilot/webbrowser_app/tests/test_findinpage.py'
41--- tests/autopilot/webbrowser_app/tests/test_findinpage.py 2015-08-11 11:16:52 +0000
42+++ tests/autopilot/webbrowser_app/tests/test_findinpage.py 2015-08-12 16:43:32 +0000
43@@ -14,6 +14,7 @@
44 # You should have received a copy of the GNU General Public License
45 # along with this program. If not, see <http://www.gnu.org/licenses/>.
46
47+from autopilot.exceptions import StateNotFoundError
48 from autopilot.matchers import Eventually
49 from testtools.matchers import Equals
50
51@@ -154,3 +155,19 @@
52 webview = self.main_window.get_current_webview()
53 self.pointing_device.click_object(webview)
54 self.assertThat(bar.findInPageMode, Eventually(Equals(False)))
55+
56+ def test_find_in_page_not_in_menu_in_new_tab(self):
57+ if not self.main_window.wide:
58+ self.open_tabs_view()
59+ self.open_new_tab()
60+
61+ drawer_button = self.chrome.get_drawer_button()
62+ self.pointing_device.click_object(drawer_button)
63+ self.chrome.get_drawer()
64+ action_missing = False
65+ try:
66+ self.chrome.get_drawer_action("findinpage")
67+ except StateNotFoundError:
68+ action_missing = True
69+
70+ self.assertThat(action_missing, Equals(True))
71
72=== modified file 'tests/autopilot/webbrowser_app/tests/test_keyboard.py'
73--- tests/autopilot/webbrowser_app/tests/test_keyboard.py 2015-08-03 09:50:38 +0000
74+++ tests/autopilot/webbrowser_app/tests/test_keyboard.py 2015-08-12 16:43:32 +0000
75@@ -302,3 +302,7 @@
76 self.assertThat(address_bar.findInPageMode, Eventually(Equals(True)))
77 self.main_window.press_key('Escape')
78 self.assertThat(address_bar.findInPageMode, Eventually(Equals(False)))
79+
80+ self.open_new_tab()
81+ self.main_window.press_key('Ctrl+F')
82+ self.assertThat(address_bar.findInPageMode, Equals(False))

Subscribers

People subscribed via source and target branches

to status/vote changes: