Merge lp:~osomon/webbrowser-app/workaround-popover-esc into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 1356
Merged at revision: 1362
Proposed branch: lp:~osomon/webbrowser-app/workaround-popover-esc
Merge into: lp:webbrowser-app
Diff against target: 76 lines (+17/-12)
2 files modified
src/app/webbrowser/BookmarkOptions.qml (+2/-2)
src/app/webbrowser/Browser.qml (+15/-10)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/workaround-popover-esc
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+286375@code.launchpad.net

Commit message

Work around bug #1546677 (UITK), by destroying the bookmark options popover instead of hiding it.

To post a comment you must log in.
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/BookmarkOptions.qml'
2--- src/app/webbrowser/BookmarkOptions.qml 2015-08-10 15:22:00 +0000
3+++ src/app/webbrowser/BookmarkOptions.qml 2016-02-17 18:29:28 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright 2015 Canonical Ltd.
7+ * Copyright 2015-2016 Canonical Ltd.
8 *
9 * This file is part of webbrowser-app.
10 *
11@@ -100,7 +100,7 @@
12 anchors.right: parent.right
13 text: i18n.tr("OK")
14 color: UbuntuColors.green
15- onClicked: hide()
16+ onClicked: bookmarkOptions.destroy()
17 }
18 }
19 }
20
21=== modified file 'src/app/webbrowser/Browser.qml'
22--- src/app/webbrowser/Browser.qml 2016-02-15 13:33:11 +0000
23+++ src/app/webbrowser/Browser.qml 2016-02-17 18:29:28 +0000
24@@ -1393,6 +1393,7 @@
25 Component {
26 id: bookmarkOptionsComponent
27 BookmarkOptions {
28+ id: bookmarkOptions
29 folderModel: BookmarksFolderListModel {
30 sourceModel: BookmarksModel
31 }
32@@ -1401,6 +1402,18 @@
33 forceActiveFocus()
34 }
35
36+ // Fragile workaround for https://launchpad.net/bugs/1546677.
37+ // By destroying the popover, its visibility isn’t changed to
38+ // false, and thus the bookmark is not removed.
39+ function closeAndConfirm() {
40+ destroy()
41+ }
42+ onVisibleChanged: {
43+ if (!visible) {
44+ BookmarksModel.remove(bookmarkUrl)
45+ }
46+ }
47+
48 Component.onDestruction: {
49 if (BookmarksModel.contains(bookmarkUrl)) {
50 BookmarksModel.update(bookmarkUrl, bookmarkTitle, bookmarkFolder)
51@@ -1417,15 +1430,7 @@
52 id: bookmarkOptionsShortcuts
53 KeyboardShortcut {
54 key: Qt.Key_Return
55- onTriggered: hide()
56- }
57-
58- KeyboardShortcut {
59- key: Qt.Key_Escape
60- onTriggered: {
61- BookmarksModel.remove(bookmarkUrl)
62- hide()
63- }
64+ onTriggered: closeAndConfirm()
65 }
66
67 KeyboardShortcut {
68@@ -1433,7 +1438,7 @@
69 key: Qt.Key_D
70 onTriggered: {
71 BookmarksModel.remove(bookmarkUrl)
72- hide()
73+ closeAndConfirm()
74 }
75 }
76 }

Subscribers

People subscribed via source and target branches

to status/vote changes: