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
=== modified file 'src/app/webbrowser/Browser.qml'
--- src/app/webbrowser/Browser.qml 2015-08-11 10:37:56 +0000
+++ src/app/webbrowser/Browser.qml 2015-08-12 16:43:32 +0000
@@ -104,7 +104,7 @@
104 onTriggered: browser.historyModel.clearAll()104 onTriggered: browser.historyModel.clearAll()
105 },105 },
106 Actions.FindInPage {106 Actions.FindInPage {
107 enabled: !chrome.findInPageMode107 enabled: !chrome.findInPageMode && !newTabViewLoader.active
108 onTriggered: {108 onTriggered: {
109 chrome.findInPageMode = true109 chrome.findInPageMode = true
110 chrome.focus = true110 chrome.focus = true
@@ -353,7 +353,7 @@
353 objectName: "findinpage"353 objectName: "findinpage"
354 text: i18n.tr("Find in page")354 text: i18n.tr("Find in page")
355 iconName: "search"355 iconName: "search"
356 enabled: !chrome.findInPageMode356 enabled: !chrome.findInPageMode && !newTabViewLoader.active
357 onTriggered: {357 onTriggered: {
358 chrome.findInPageMode = true358 chrome.findInPageMode = true
359 chrome.focus = true359 chrome.focus = true
@@ -1134,7 +1134,7 @@
1134 PopupUtils.open(bookmarkOptionsComponent,1134 PopupUtils.open(bookmarkOptionsComponent,
1135 chrome.bookmarkTogglePlaceHolder,1135 chrome.bookmarkTogglePlaceHolder,
1136 {"bookmarkUrl": url,1136 {"bookmarkUrl": url,
1137 "bookmarkTitle": title}) 1137 "bookmarkTitle": title})
1138 }1138 }
1139 }1139 }
11401140
@@ -1501,6 +1501,7 @@
1501 KeyboardShortcut {1501 KeyboardShortcut {
1502 modifiers: Qt.ControlModifier1502 modifiers: Qt.ControlModifier
1503 key: Qt.Key_F1503 key: Qt.Key_F
1504 enabled: !newTabViewLoader.active
1504 onTriggered: {1505 onTriggered: {
1505 chrome.findInPageMode = true1506 chrome.findInPageMode = true
1506 chrome.focus = true1507 chrome.focus = true
15071508
=== modified file 'tests/autopilot/webbrowser_app/tests/test_findinpage.py'
--- tests/autopilot/webbrowser_app/tests/test_findinpage.py 2015-08-11 11:16:52 +0000
+++ tests/autopilot/webbrowser_app/tests/test_findinpage.py 2015-08-12 16:43:32 +0000
@@ -14,6 +14,7 @@
14# You should have received a copy of the GNU General Public License14# You should have received a copy of the GNU General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.15# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
17from autopilot.exceptions import StateNotFoundError
17from autopilot.matchers import Eventually18from autopilot.matchers import Eventually
18from testtools.matchers import Equals19from testtools.matchers import Equals
1920
@@ -154,3 +155,19 @@
154 webview = self.main_window.get_current_webview()155 webview = self.main_window.get_current_webview()
155 self.pointing_device.click_object(webview)156 self.pointing_device.click_object(webview)
156 self.assertThat(bar.findInPageMode, Eventually(Equals(False)))157 self.assertThat(bar.findInPageMode, Eventually(Equals(False)))
158
159 def test_find_in_page_not_in_menu_in_new_tab(self):
160 if not self.main_window.wide:
161 self.open_tabs_view()
162 self.open_new_tab()
163
164 drawer_button = self.chrome.get_drawer_button()
165 self.pointing_device.click_object(drawer_button)
166 self.chrome.get_drawer()
167 action_missing = False
168 try:
169 self.chrome.get_drawer_action("findinpage")
170 except StateNotFoundError:
171 action_missing = True
172
173 self.assertThat(action_missing, Equals(True))
157174
=== modified file 'tests/autopilot/webbrowser_app/tests/test_keyboard.py'
--- tests/autopilot/webbrowser_app/tests/test_keyboard.py 2015-08-03 09:50:38 +0000
+++ tests/autopilot/webbrowser_app/tests/test_keyboard.py 2015-08-12 16:43:32 +0000
@@ -302,3 +302,7 @@
302 self.assertThat(address_bar.findInPageMode, Eventually(Equals(True)))302 self.assertThat(address_bar.findInPageMode, Eventually(Equals(True)))
303 self.main_window.press_key('Escape')303 self.main_window.press_key('Escape')
304 self.assertThat(address_bar.findInPageMode, Eventually(Equals(False)))304 self.assertThat(address_bar.findInPageMode, Eventually(Equals(False)))
305
306 self.open_new_tab()
307 self.main_window.press_key('Ctrl+F')
308 self.assertThat(address_bar.findInPageMode, Equals(False))

Subscribers

People subscribed via source and target branches

to status/vote changes: