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
1=== added file 'src/app/actions/OpenVideoInNewTab.qml'
2--- src/app/actions/OpenVideoInNewTab.qml 1970-01-01 00:00:00 +0000
3+++ src/app/actions/OpenVideoInNewTab.qml 2016-02-01 11:47:09 +0000
4@@ -0,0 +1,23 @@
5+/*
6+ * Copyright 2016 Canonical Ltd.
7+ *
8+ * This file is part of webbrowser-app.
9+ *
10+ * webbrowser-app is free software; you can redistribute it and/or modify
11+ * it under the terms of the GNU General Public License as published by
12+ * the Free Software Foundation; version 3.
13+ *
14+ * webbrowser-app is distributed in the hope that it will be useful,
15+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17+ * GNU General Public License for more details.
18+ *
19+ * You should have received a copy of the GNU General Public License
20+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
21+ */
22+
23+import Ubuntu.Components 1.3
24+
25+Action {
26+ text: i18n.tr("Open video in new tab")
27+}
28
29=== added file 'src/app/actions/SaveVideo.qml'
30--- src/app/actions/SaveVideo.qml 1970-01-01 00:00:00 +0000
31+++ src/app/actions/SaveVideo.qml 2016-02-01 11:47:09 +0000
32@@ -0,0 +1,23 @@
33+/*
34+ * Copyright 2016 Canonical Ltd.
35+ *
36+ * This file is part of webbrowser-app.
37+ *
38+ * webbrowser-app is free software; you can redistribute it and/or modify
39+ * it under the terms of the GNU General Public License as published by
40+ * the Free Software Foundation; version 3.
41+ *
42+ * webbrowser-app is distributed in the hope that it will be useful,
43+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
44+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45+ * GNU General Public License for more details.
46+ *
47+ * You should have received a copy of the GNU General Public License
48+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
49+ */
50+
51+import Ubuntu.Components 1.3
52+
53+Action {
54+ text: i18n.tr("Save video")
55+}
56
57=== modified file 'src/app/webbrowser/Browser.qml'
58--- src/app/webbrowser/Browser.qml 2016-01-22 10:23:17 +0000
59+++ src/app/webbrowser/Browser.qml 2016-02-01 11:47:09 +0000
60@@ -1091,7 +1091,9 @@
61 }
62 Actions.OpenImageInNewTab {
63 objectName: "OpenImageInNewTabContextualAction"
64- enabled: contextModel && contextModel.srcUrl.toString()
65+ enabled: contextModel &&
66+ (contextModel.mediaType === Oxide.WebView.MediaTypeImage) &&
67+ contextModel.srcUrl.toString()
68 onTriggered: browser.openUrlInNewTab(contextModel.srcUrl, true)
69 }
70 Actions.CopyImage {
71@@ -1109,6 +1111,20 @@
72 contextModel.hasImageContents
73 onTriggered: contextModel.saveMedia()
74 }
75+ Actions.OpenVideoInNewTab {
76+ objectName: "OpenVideoInNewTabContextualAction"
77+ enabled: contextModel &&
78+ (contextModel.mediaType === Oxide.WebView.MediaTypeVideo) &&
79+ contextModel.srcUrl.toString()
80+ onTriggered: browser.openUrlInNewTab(contextModel.srcUrl, true)
81+ }
82+ Actions.SaveVideo {
83+ objectName: "SaveVideoContextualAction"
84+ enabled: contextModel &&
85+ (contextModel.mediaType === Oxide.WebView.MediaTypeVideo) &&
86+ contextModel.srcUrl.toString()
87+ onTriggered: contextModel.saveMedia()
88+ }
89 Actions.Undo {
90 objectName: "UndoContextualAction"
91 enabled: contextModel && contextModel.isEditable &&

Subscribers

People subscribed via source and target branches

to status/vote changes: