Merge lp:~rpadovani/webbrowser-app/1351165 into lp:webbrowser-app

Proposed by Riccardo Padovani
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 765
Merged at revision: 790
Proposed branch: lp:~rpadovani/webbrowser-app/1351165
Merge into: lp:webbrowser-app
Prerequisite: lp:~rpadovani/webbrowser-app/1351167
Diff against target: 136 lines (+81/-0)
3 files modified
src/app/webbrowser/BookmarksList.qml (+78/-0)
src/app/webbrowser/Browser.qml (+1/-0)
src/app/webbrowser/NewTabView.qml (+2/-0)
To merge this branch: bzr merge lp:~rpadovani/webbrowser-app/1351165
Reviewer Review Type Date Requested Status
Olivier Tilloy Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+238197@code.launchpad.net

Commit message

Enabled swipe gesture to delete a bookmark from the new tab view

Description of the change

Enabled swipe gesture to delete a bookmark from the new tab view

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~rpadovani/webbrowser-app/1351165 updated
763. By Riccardo Padovani

Merged from prerequisite branch

764. By Riccardo Padovani

Reverted QtQuick version bump

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

At a quick glance, that looks good, thanks for working on this!

I don’t think the onBookmarkRemoved handler in NewTabView.qml is needed: the sections should be made dynamic without having to manually add/remove them, but that can be addressed separately (for which I filed bug #1389605).

So I would suggest to remove the handler for now, and with that it should be good (still need to do some functional testing on a device).

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:764
http://jenkins.qa.ubuntu.com/job/webbrowser-app-ci/1237/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/6474
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/4294/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-amd64-ci/436
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/436
        deb: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-armhf-ci/436/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/webbrowser-app-utopic-i386-ci/436
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/6067
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/7726
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/7726/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/15461
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/3646/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/4688
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/4688/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/webbrowser-app-ci/1237/rebuild

review: Needs Fixing (continuous-integration)
lp:~rpadovani/webbrowser-app/1351165 updated
765. By Riccardo Padovani

Removed onBookmarkRemoved handler in NewTabView.qml

Revision history for this message
Riccardo Padovani (rpadovani) wrote :

> At a quick glance, that looks good, thanks for working on this!
>
> I don’t think the onBookmarkRemoved handler in NewTabView.qml is needed: the
> sections should be made dynamic without having to manually add/remove them,
> but that can be addressed separately (for which I filed bug #1389605).
>
> So I would suggest to remove the handler for now, and with that it should be
> good (still need to do some functional testing on a device).

Makes sense, done!

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

Looks good and works fine, thanks Riccardo!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/webbrowser/BookmarksList.qml'
2--- src/app/webbrowser/BookmarksList.qml 2014-10-10 17:39:16 +0000
3+++ src/app/webbrowser/BookmarksList.qml 2014-11-05 19:10:24 +0000
4@@ -27,6 +27,7 @@
5 property alias footerLabelVisible: footerLabel.visible
6
7 signal bookmarkClicked(url url)
8+ signal bookmarkRemoved(url url)
9 signal footerLabelClicked()
10
11 spacing: units.gu(1)
12@@ -35,8 +36,10 @@
13
14 Repeater {
15 id: bookmarksListRepeater
16+ property var _currentSwipedItem: null
17
18 delegate: UrlDelegate{
19+ id: urlDelegate
20 width: bookmarksList.width
21 height: units.gu(5)
22
23@@ -45,6 +48,81 @@
24 url: model.url
25
26 onItemClicked: bookmarkClicked(model.url)
27+
28+ property var removalAnimation
29+ function remove() {
30+ removalAnimation.start()
31+ }
32+
33+ onSwippingChanged: {
34+ bookmarksListRepeater._updateSwipeState(urlDelegate)
35+ }
36+
37+ onSwipeStateChanged: {
38+ bookmarksListRepeater._updateSwipeState(urlDelegate)
39+ }
40+
41+ leftSideAction: Action {
42+ iconName: "delete"
43+ text: i18n.tr("Delete")
44+ onTriggered: {
45+ urlDelegate.remove()
46+ }
47+ }
48+
49+ ListView.onRemove: ScriptAction {
50+ script: {
51+ if (bookmarksListRepeater._currentSwipedItem === urlDelegate) {
52+ bookmarksListRepeater._currentSwipedItem = null
53+ }
54+ }
55+ }
56+
57+ removalAnimation: SequentialAnimation {
58+ alwaysRunToEnd: true
59+
60+ PropertyAction {
61+ target: urlDelegate
62+ property: "ListView.delayRemove"
63+ value: true
64+ }
65+
66+ UbuntuNumberAnimation {
67+ target: urlDelegate
68+ property: "height"
69+ to: 0
70+ }
71+
72+ PropertyAction {
73+ target: urlDelegate
74+ property: "ListView.delayRemove"
75+ value: false
76+ }
77+
78+ ScriptAction {
79+ script: {
80+ bookmarkRemoved(model.url)
81+ }
82+ }
83+ }
84+ }
85+
86+ function _updateSwipeState(item) {
87+ if (item.swipping) {
88+ return
89+ }
90+
91+ if (item.swipeState !== "Normal") {
92+ if (bookmarksListRepeater._currentSwipedItem !== item) {
93+ if (bookmarksListRepeater._currentSwipedItem) {
94+ bookmarksListRepeater._currentSwipedItem.resetSwipe()
95+ }
96+ bookmarksListRepeater._currentSwipedItem = item
97+ }
98+ } else if (item.swipeState !== "Normal"
99+ && bookmarksListRepeater._currentSwipedItem === item) {
100+ bookmarksListRepeater._currentSwipedItem = null
101+ }
102 }
103 }
104
105
106=== modified file 'src/app/webbrowser/Browser.qml'
107--- src/app/webbrowser/Browser.qml 2014-10-07 08:32:45 +0000
108+++ src/app/webbrowser/Browser.qml 2014-11-05 19:10:24 +0000
109@@ -474,6 +474,7 @@
110 currentWebview.url = url
111 currentWebview.forceActiveFocus()
112 }
113+ onBookmarkRemoved: browser.bookmarksModel.remove(url)
114 onHistoryEntryClicked: {
115 currentWebview.url = url
116 currentWebview.forceActiveFocus()
117
118=== modified file 'src/app/webbrowser/NewTabView.qml'
119--- src/app/webbrowser/NewTabView.qml 2014-09-10 13:53:02 +0000
120+++ src/app/webbrowser/NewTabView.qml 2014-11-05 19:10:24 +0000
121@@ -29,6 +29,7 @@
122 property QtObject historyModel
123
124 signal bookmarkClicked(url url)
125+ signal bookmarkRemoved(url url)
126 signal historyEntryClicked(url url)
127
128 QtObject {
129@@ -142,6 +143,7 @@
130 footerLabelVisible: bookmarksListModel.unlimitedCount > internal.bookmarksCountLimit
131
132 onBookmarkClicked: newTabView.bookmarkClicked(url)
133+ onBookmarkRemoved: newTabView.bookmarkRemoved(url)
134 onFooterLabelClicked: internal.seeMoreBookmarksView = !internal.seeMoreBookmarksView
135 }
136 }

Subscribers

People subscribed via source and target branches

to status/vote changes: