Merge lp:~ubuntu-sdk-team/ubuntu-ui-extras/ubuntu-ui-extras-share-popover into lp:~ubuntu-sdk-team/ubuntu-ui-extras/trunk

Proposed by Ugo Riboni on 2013-08-20
Status: Merged
Approved by: Günter Schwann on 2013-08-21
Approved revision: 48
Merged at revision: 50
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-extras/ubuntu-ui-extras-share-popover
Merge into: lp:~ubuntu-sdk-team/ubuntu-ui-extras/trunk
Diff against target: 167 lines (+132/-0)
6 files modified
modules/Ubuntu/Components/Extras/CMakeLists.txt (+1/-0)
modules/Ubuntu/Components/Extras/Share/CMakeLists.txt (+2/-0)
modules/Ubuntu/Components/Extras/Share/ShareMenu.qml (+73/-0)
modules/Ubuntu/Components/Extras/Share/SharePopover.qml (+41/-0)
modules/Ubuntu/Components/Extras/qmldir (+1/-0)
ubuntu-ui-extras.qmlproject (+14/-0)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-extras/ubuntu-ui-extras-share-popover
Reviewer Review Type Date Requested Status
Günter Schwann (community) 2013-08-20 Approve on 2013-08-21
PS Jenkins bot continuous-integration Approve on 2013-08-21
Review via email: mp+181034@code.launchpad.net

Commit message

Add a SharePopover component that apps can use to let the user chose to which service to share.

Description of the change

Add a SharePopover component that apps can use to let the user chose to which service to share.

To post a comment you must log in.
48. By Ugo Riboni on 2013-08-21

Merge changes from trunk

Günter Schwann (schwann) wrote :

looks good, and works

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/Extras/CMakeLists.txt'
2--- modules/Ubuntu/Components/Extras/CMakeLists.txt 2013-08-19 09:15:31 +0000
3+++ modules/Ubuntu/Components/Extras/CMakeLists.txt 2013-08-21 11:26:55 +0000
4@@ -21,3 +21,4 @@
5
6 add_subdirectory(plugin)
7 add_subdirectory(Example)
8+add_subdirectory(Share)
9
10=== added file 'modules/Ubuntu/Components/Extras/Share/CMakeLists.txt'
11--- modules/Ubuntu/Components/Extras/Share/CMakeLists.txt 1970-01-01 00:00:00 +0000
12+++ modules/Ubuntu/Components/Extras/Share/CMakeLists.txt 2013-08-21 11:26:55 +0000
13@@ -0,0 +1,2 @@
14+file(GLOB QML_FILES *.qml)
15+install(FILES ${QML_FILES} DESTINATION ${PLUGIN_DIR}/Share)
16
17=== added file 'modules/Ubuntu/Components/Extras/Share/ShareMenu.qml'
18--- modules/Ubuntu/Components/Extras/Share/ShareMenu.qml 1970-01-01 00:00:00 +0000
19+++ modules/Ubuntu/Components/Extras/Share/ShareMenu.qml 2013-08-21 11:26:55 +0000
20@@ -0,0 +1,73 @@
21+/*
22+ * Copyright (C) 2012-2013 Canonical Ltd
23+ *
24+ * This program is free software: you can redistribute it and/or modify
25+ * it under the terms of the GNU General Public License version 3 as
26+ * published by the Free Software Foundation.
27+ *
28+ * This program is distributed in the hope that it will be useful,
29+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
30+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31+ * GNU General Public License for more details.
32+ *
33+ * You should have received a copy of the GNU General Public License
34+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
35+ *
36+ */
37+
38+import QtQuick 2.0
39+import Ubuntu.Components.ListItems 0.1 as ListItem
40+import Ubuntu.OnlineAccounts 0.1
41+
42+/*!
43+*/
44+Item {
45+ id: sharemenu
46+
47+ height: childrenRect.height
48+
49+ signal selected(string accountId)
50+
51+ ListView {
52+ anchors {
53+ top: parent.top
54+ left: parent.left
55+ right: parent.right
56+ }
57+ height: childrenRect.height
58+ interactive: false
59+
60+ model: AccountServiceModel {
61+ serviceType: "microblogging"
62+ includeDisabled: true
63+ }
64+
65+ delegate: Item {
66+ width: parent.width
67+ height: childrenRect.height
68+ visible: serviceName == "Facebook"
69+
70+ AccountService {
71+ id: service
72+ objectHandle: accountService
73+ }
74+
75+ ListItem.Subtitled {
76+ text: service.provider.displayName
77+ subText: displayName
78+ icon: "image://gicon/" + service.provider.iconName
79+ __iconHeight: units.gu(5)
80+ __iconWidth: units.gu(5)
81+
82+ onClicked: {
83+ if (service.provider.displayName == "Facebook") {
84+ sharemenu.selected(accountId);
85+ } else {
86+ console.log("Sharing to this service is not supported yet.");
87+ sharemenu.selected(null);
88+ }
89+ }
90+ }
91+ }
92+ }
93+}
94
95=== added file 'modules/Ubuntu/Components/Extras/Share/SharePopover.qml'
96--- modules/Ubuntu/Components/Extras/Share/SharePopover.qml 1970-01-01 00:00:00 +0000
97+++ modules/Ubuntu/Components/Extras/Share/SharePopover.qml 2013-08-21 11:26:55 +0000
98@@ -0,0 +1,41 @@
99+/*
100+ * Copyright (C) 2012-2013 Canonical Ltd
101+ *
102+ * This program is free software: you can redistribute it and/or modify
103+ * it under the terms of the GNU General Public License version 3 as
104+ * published by the Free Software Foundation.
105+ *
106+ * This program is distributed in the hope that it will be useful,
107+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
108+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
109+ * GNU General Public License for more details.
110+ *
111+ * You should have received a copy of the GNU General Public License
112+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
113+ */
114+
115+import QtQuick 2.0
116+import Ubuntu.Components.Popups 0.1
117+import Ubuntu.Components.ListItems 0.1 as ListItem
118+
119+/*!
120+*/
121+Popover {
122+ id: sharePopover
123+
124+ signal selected(string accountId)
125+
126+ ShareMenu {
127+ anchors {
128+ left: parent.left
129+ right: parent.right
130+ top: parent.top
131+ }
132+ onSelected: {
133+ if (accountId !== null) {
134+ sharePopover.selected(accountId)
135+ }
136+ sharePopover.hide()
137+ }
138+ }
139+}
140
141=== modified file 'modules/Ubuntu/Components/Extras/qmldir'
142--- modules/Ubuntu/Components/Extras/qmldir 2013-08-12 11:10:11 +0000
143+++ modules/Ubuntu/Components/Extras/qmldir 2013-08-21 11:26:55 +0000
144@@ -2,3 +2,4 @@
145 plugin ubuntu-ui-extras-plugin
146 Example 0.1 Example.qml
147 Share 0.1 Share.qml
148+SharePopover 0.1 Share/SharePopover.qml
149
150=== added file 'ubuntu-ui-extras.qmlproject'
151--- ubuntu-ui-extras.qmlproject 1970-01-01 00:00:00 +0000
152+++ ubuntu-ui-extras.qmlproject 2013-08-21 11:26:55 +0000
153@@ -0,0 +1,14 @@
154+import QmlProject 1.1
155+
156+Project {
157+ QmlFiles {
158+ directory: "modules"
159+ }
160+ JavaScriptFiles {
161+ directory: "modules"
162+ }
163+ Files {
164+ filter: ["modules/Ubuntu/Components/Extras/qmldir"]
165+ }
166+}
167+

Subscribers

People subscribed via source and target branches

to all changes: