Merge lp:~michael-sheldon/content-hub/cancel-button into lp:content-hub

Proposed by Michael Sheldon
Status: Merged
Approved by: Bill Filler
Approved revision: 128
Merged at revision: 132
Proposed branch: lp:~michael-sheldon/content-hub/cancel-button
Merge into: lp:content-hub
Diff against target: 238 lines (+121/-52)
5 files modified
CMakeLists.txt (+14/-0)
cmake/Translations.cmake (+0/-41)
import/Ubuntu/Content/ContentTransferHint.qml (+15/-1)
po/CMakeLists.txt (+36/-3)
po/content-hub.pot (+56/-7)
To merge this branch: bzr merge lp:~michael-sheldon/content-hub/cancel-button
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Bill Filler (community) Needs Fixing
Review via email: mp+230505@code.launchpad.net

Commit message

Add a cancel button to the ContentTransferHint.

Description of the change

Adds a cancel button to the ContentTransferHint (allowing users to cancel an import operation from the originating app).

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ken VanDine (ken-vandine) wrote :

This looks good to me, however seems with the recent sdk changes the transfer hint looks a bit confusing. It displays the white box with activity spinner, it used to just be a black overlay with spinner. Perhaps we should put some text in there "Transfer in progress", or some variation of that.

Revision history for this message
Ken VanDine (ken-vandine) wrote :

Or maybe we should look at making it look more like it did before, without the white box.

Revision history for this message
Bill Filler (bfiller) wrote :

+1 on adding "Transfer in progress" to the dialog

review: Needs Fixing
127. By Michael Sheldon

Add 'Transfer in progress' title to ContentTransferHint dialog

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
128. By Michael Sheldon

Fix translation infrastructure to extract strings from both QML and CPP code and update POT file

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list.

 * No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

 * Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

 * Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/content-hub) on device or emulator?

 * Yes

If you changed the UI, was the change specified/approved by design?

 * Adds cancel button to the ContentTransferHint (currently no spec for this component though)

If you changed UI labels, did you update the pot file?

 * Yes

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?

 * No change

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-08-01 20:07:16 +0000
3+++ CMakeLists.txt 2014-08-14 11:49:51 +0000
4@@ -83,6 +83,20 @@
5
6 include_directories(include)
7
8+file(GLOB_RECURSE I18N_QML_SRC_FILES
9+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
10+ import/Ubuntu/Content/**.qml)
11+list(SORT I18N_QML_SRC_FILES)
12+
13+file(GLOB_RECURSE I18N_CPP_SRC_FILES
14+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
15+ src/com/ubuntu/content/detail/**.cpp)
16+list(SORT I18N_CPP_SRC_FILES)
17+
18+# for dh_translations to extract the domain
19+# (regarding syntax consistency, see http://pad.lv/1181187)
20+set (GETTEXT_PACKAGE "content-hub")
21+
22 add_subdirectory(doc)
23 add_subdirectory(po)
24 add_subdirectory(src)
25
26=== removed file 'cmake/Translations.cmake'
27--- cmake/Translations.cmake 2014-05-01 17:03:40 +0000
28+++ cmake/Translations.cmake 1970-01-01 00:00:00 +0000
29@@ -1,41 +0,0 @@
30-# Translations.cmake, CMake macros written for Marlin, feel free to re-use them
31-
32-macro(add_translations_directory NLS_PACKAGE)
33- add_custom_target (i18n ALL)
34- find_program (MSGFMT_EXECUTABLE msgfmt)
35- file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
36- foreach (PO_INPUT ${PO_FILES})
37- get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE)
38- set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo)
39- add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT})
40-
41- install (FILES ${MO_OUTPUT} DESTINATION
42- ${CMAKE_INSTALL_LOCALEDIR}/${PO_INPUT_BASE}/LC_MESSAGES
43- RENAME ${NLS_PACKAGE}.mo)
44- endforeach (PO_INPUT ${PO_FILES})
45-endmacro(add_translations_directory)
46-
47-
48-macro(add_translations_catalog NLS_PACKAGE)
49- add_custom_target (pot COMMENT “Building translation catalog.”)
50- find_program (XGETTEXT_EXECUTABLE xgettext)
51-
52-
53- set(C_SOURCE "")
54-
55- foreach(FILES_INPUT ${ARGN})
56- file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.c)
57- foreach(C_FILE ${SOURCE_FILES})
58- set(C_SOURCE ${C_SOURCE} ${C_FILE})
59- endforeach()
60- file (GLOB_RECURSE SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.cpp)
61- foreach(C_FILE ${SOURCE_FILES})
62- set(C_SOURCE ${C_SOURCE} ${C_FILE})
63- endforeach()
64- endforeach()
65-
66- add_custom_command (TARGET pot COMMAND
67- ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
68- ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --keyword="N_" --from-code=UTF-8
69- )
70-endmacro()
71
72=== modified file 'import/Ubuntu/Content/ContentTransferHint.qml'
73--- import/Ubuntu/Content/ContentTransferHint.qml 2014-04-02 12:18:01 +0000
74+++ import/Ubuntu/Content/ContentTransferHint.qml 2014-08-14 11:49:51 +0000
75@@ -49,10 +49,24 @@
76 id: dialog
77 Dialog {
78 id: dialogue
79+ title: i18n.tr("Transfer in progress")
80+
81 ActivityIndicator {
82- anchors.centerIn: parent
83+ id: indicator
84+ anchors.top: parent.top
85+ anchors.topMargin: units.gu(6)
86 running: internal.isTransferRunning
87 }
88+
89+ Button {
90+ id: cancelTransfer
91+ anchors.top: indicator.bottom
92+ anchors.topMargin: units.gu(4)
93+ text: i18n.tr("Cancel")
94+ onClicked: {
95+ root.activeTransfer.state = ContentTransfer.Aborted
96+ }
97+ }
98 }
99 }
100
101
102=== modified file 'po/CMakeLists.txt'
103--- po/CMakeLists.txt 2014-05-01 17:03:40 +0000
104+++ po/CMakeLists.txt 2014-08-14 11:49:51 +0000
105@@ -1,3 +1,36 @@
106-include (Translations)
107-add_translations_directory ("${GETTEXT_PACKAGE}")
108-add_translations_catalog ("${GETTEXT_PACKAGE}" ../src/com/ubuntu/content/detail)
109+project(contenthub-translations)
110+
111+include(FindGettext)
112+find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
113+
114+set(DOMAIN ${GETTEXT_PACKAGE})
115+set(POT_FILE ${DOMAIN}.pot)
116+file(GLOB PO_FILES *.po)
117+
118+add_custom_target(${POT_FILE}
119+ COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
120+ -D ${CMAKE_SOURCE_DIR}
121+ --from-code=UTF-8
122+ --c++ --qt --add-comments=TRANSLATORS
123+ --keyword=tr --keyword=tr:1,2
124+ --package-name=content-hub
125+ --copyright-holder='Canonical Ltd.'
126+ ${I18N_QML_SRC_FILES}
127+ COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
128+ -D ${CMAKE_SOURCE_DIR}
129+ --from-code=UTF-8
130+ --c++ --qt --add-comments=TRANSLATORS
131+ --keyword=_
132+ -j
133+ --package-name=content-hub
134+ --copyright-holder='Canonical Ltd.'
135+ ${I18N_CPP_SRC_FILES})
136+
137+foreach(PO_FILE ${PO_FILES})
138+ get_filename_component(LANG ${PO_FILE} NAME_WE)
139+ gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE})
140+ set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES)
141+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo
142+ DESTINATION ${INSTALL_DIR}
143+ RENAME ${DOMAIN}.mo)
144+endforeach(PO_FILE)
145
146=== modified file 'po/content-hub.pot'
147--- po/content-hub.pot 2014-05-27 15:00:34 +0000
148+++ po/content-hub.pot 2014-08-14 11:49:51 +0000
149@@ -1,14 +1,14 @@
150 # SOME DESCRIPTIVE TITLE.
151-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
152+# Copyright (C) YEAR Canonical Ltd.
153 # This file is distributed under the same license as the PACKAGE package.
154 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
155 #
156 #, fuzzy
157 msgid ""
158 msgstr ""
159-"Project-Id-Version: PACKAGE VERSION\n"
160+"Project-Id-Version: content-hub\n"
161 "Report-Msgid-Bugs-To: \n"
162-"POT-Creation-Date: 2014-05-27 16:00+0100\n"
163+"POT-Creation-Date: 2014-08-14 12:39+0100\n"
164 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
165 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
166 "Language-Team: LANGUAGE <LL@li.org>\n"
167@@ -17,18 +17,67 @@
168 "Content-Type: text/plain; charset=CHARSET\n"
169 "Content-Transfer-Encoding: 8bit\n"
170
171-#: ../src/com/ubuntu/content/detail/service.cpp:212
172+#: import/Ubuntu/Content/ContentPeerPicker10.qml:48
173+#: import/Ubuntu/Content/ContentPeerPicker11.qml:49
174+msgid "Choose from"
175+msgstr ""
176+
177+#: import/Ubuntu/Content/ContentPeerPicker10.qml:48
178+#: import/Ubuntu/Content/ContentPeerPicker11.qml:49
179+msgid "Open with"
180+msgstr ""
181+
182+#: import/Ubuntu/Content/ContentPeerPicker10.qml:48
183+#: import/Ubuntu/Content/ContentPeerPicker11.qml:49
184+msgid "Share to"
185+msgstr ""
186+
187+#: import/Ubuntu/Content/ContentPeerPicker10.qml:158
188+#: import/Ubuntu/Content/ContentPeerPicker11.qml:175
189+msgid "Apps"
190+msgstr ""
191+
192+#: import/Ubuntu/Content/ContentPeerPicker10.qml:194
193+#: import/Ubuntu/Content/ContentPeerPicker11.qml:211
194+msgid ""
195+"Sorry, there aren't currently any apps installed that can provide this type "
196+"of content."
197+msgstr ""
198+
199+#: import/Ubuntu/Content/ContentPeerPicker10.qml:194
200+#: import/Ubuntu/Content/ContentPeerPicker11.qml:211
201+msgid ""
202+"Sorry, there aren't currently any apps installed that can handle this type "
203+"of content."
204+msgstr ""
205+
206+#: import/Ubuntu/Content/ContentPeerPicker10.qml:210
207+#: import/Ubuntu/Content/ContentPeerPicker11.qml:227
208+msgid "Devices"
209+msgstr ""
210+
211+#: import/Ubuntu/Content/ContentPeerPicker10.qml:247
212+#: import/Ubuntu/Content/ContentPeerPicker11.qml:56
213+#: import/Ubuntu/Content/ContentTransferHint.qml:65
214+msgid "Cancel"
215+msgstr ""
216+
217+#: import/Ubuntu/Content/ContentTransferHint.qml:52
218+msgid "Transfer in progress"
219+msgstr ""
220+
221+#: src/com/ubuntu/content/detail/service.cpp:216
222 msgid "Download Complete"
223 msgstr ""
224
225-#: ../src/com/ubuntu/content/detail/service.cpp:227
226+#: src/com/ubuntu/content/detail/service.cpp:234
227 msgid "Open"
228 msgstr ""
229
230-#: ../src/com/ubuntu/content/detail/service.cpp:234
231+#: src/com/ubuntu/content/detail/service.cpp:241
232 msgid "Dismiss"
233 msgstr ""
234
235-#: ../src/com/ubuntu/content/detail/service.cpp:252
236+#: src/com/ubuntu/content/detail/service.cpp:259
237 msgid "Download Failed"
238 msgstr ""

Subscribers

People subscribed via source and target branches