Merge lp:~osomon/webbrowser-app/video-contextual-actions into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 1341
Merged at revision: 1348
Proposed branch: lp:~osomon/webbrowser-app/video-contextual-actions
Merge into: lp:webbrowser-app
Diff against target: 91 lines (+63/-1)
3 files modified
src/app/actions/OpenVideoInNewTab.qml (+23/-0)
src/app/actions/SaveVideo.qml (+23/-0)
src/app/webbrowser/Browser.qml (+17/-1)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/video-contextual-actions
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+284589@code.launchpad.net

Commit message

Add video-specific contextual actions.

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
=== added file 'src/app/actions/OpenVideoInNewTab.qml'
--- src/app/actions/OpenVideoInNewTab.qml 1970-01-01 00:00:00 +0000
+++ src/app/actions/OpenVideoInNewTab.qml 2016-02-01 11:47:09 +0000
@@ -0,0 +1,23 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This file is part of webbrowser-app.
5 *
6 * webbrowser-app is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 3.
9 *
10 * webbrowser-app is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import Ubuntu.Components 1.3
20
21Action {
22 text: i18n.tr("Open video in new tab")
23}
024
=== added file 'src/app/actions/SaveVideo.qml'
--- src/app/actions/SaveVideo.qml 1970-01-01 00:00:00 +0000
+++ src/app/actions/SaveVideo.qml 2016-02-01 11:47:09 +0000
@@ -0,0 +1,23 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This file is part of webbrowser-app.
5 *
6 * webbrowser-app is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 3.
9 *
10 * webbrowser-app is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import Ubuntu.Components 1.3
20
21Action {
22 text: i18n.tr("Save video")
23}
024
=== modified file 'src/app/webbrowser/Browser.qml'
--- src/app/webbrowser/Browser.qml 2016-01-22 10:23:17 +0000
+++ src/app/webbrowser/Browser.qml 2016-02-01 11:47:09 +0000
@@ -1091,7 +1091,9 @@
1091 }1091 }
1092 Actions.OpenImageInNewTab {1092 Actions.OpenImageInNewTab {
1093 objectName: "OpenImageInNewTabContextualAction"1093 objectName: "OpenImageInNewTabContextualAction"
1094 enabled: contextModel && contextModel.srcUrl.toString()1094 enabled: contextModel &&
1095 (contextModel.mediaType === Oxide.WebView.MediaTypeImage) &&
1096 contextModel.srcUrl.toString()
1095 onTriggered: browser.openUrlInNewTab(contextModel.srcUrl, true)1097 onTriggered: browser.openUrlInNewTab(contextModel.srcUrl, true)
1096 }1098 }
1097 Actions.CopyImage {1099 Actions.CopyImage {
@@ -1109,6 +1111,20 @@
1109 contextModel.hasImageContents1111 contextModel.hasImageContents
1110 onTriggered: contextModel.saveMedia()1112 onTriggered: contextModel.saveMedia()
1111 }1113 }
1114 Actions.OpenVideoInNewTab {
1115 objectName: "OpenVideoInNewTabContextualAction"
1116 enabled: contextModel &&
1117 (contextModel.mediaType === Oxide.WebView.MediaTypeVideo) &&
1118 contextModel.srcUrl.toString()
1119 onTriggered: browser.openUrlInNewTab(contextModel.srcUrl, true)
1120 }
1121 Actions.SaveVideo {
1122 objectName: "SaveVideoContextualAction"
1123 enabled: contextModel &&
1124 (contextModel.mediaType === Oxide.WebView.MediaTypeVideo) &&
1125 contextModel.srcUrl.toString()
1126 onTriggered: contextModel.saveMedia()
1127 }
1112 Actions.Undo {1128 Actions.Undo {
1113 objectName: "UndoContextualAction"1129 objectName: "UndoContextualAction"
1114 enabled: contextModel && contextModel.isEditable &&1130 enabled: contextModel && contextModel.isEditable &&

Subscribers

People subscribed via source and target branches

to status/vote changes: