Merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/i18n_and_reviewtools into lp:qtcreator-plugin-ubuntu
- i18n_and_reviewtools
- Merge into trunk
Status: | Merged | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Zoltan Balogh | ||||||||||||||||||||
Approved revision: | 296 | ||||||||||||||||||||
Merged at revision: | 285 | ||||||||||||||||||||
Proposed branch: | lp:~zeller-benjamin/qtcreator-plugin-ubuntu/i18n_and_reviewtools | ||||||||||||||||||||
Merge into: | lp:qtcreator-plugin-ubuntu | ||||||||||||||||||||
Diff against target: |
1261 lines (+741/-112) 36 files modified
debian/qtcreator-plugin-ubuntu-common.install (+1/-0) share/qtcreator/templates/wizards/ubuntu/backendplustabs/CMakeLists.txt (+9/-7) share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/CMakeLists.txt (+4/-5) share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/components/CMakeLists.txt (+1/-1) share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/displayName.desktop.in (+1/-1) share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/ui/CMakeLists.txt (+1/-1) share/qtcreator/templates/wizards/ubuntu/backendplustabs/po/CMakeLists.txt (+58/-0) share/qtcreator/templates/wizards/ubuntu/backendplustabs/wizard.xml (+3/-2) share/qtcreator/templates/wizards/ubuntu/simplei18n/CMakeLists.txt (+75/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/app/CMakeLists.txt (+20/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/app/components/CMakeLists.txt (+6/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/app/components/HelloComponent.qml (+14/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/app/displayName.desktop.in (+10/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/app/displayName.qml (+41/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName/__init__.py (+132/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName/main/__init__.py (+1/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName/main/test_main.py (+23/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/run (+11/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/unit/tst_hellocomponent.qml (+49/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/app/ui/CMakeLists.txt (+6/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/app/ui/HelloTab.qml (+30/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/app/ui/WorldTab.qml (+29/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/manifest.json.in (+15/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/po/CMakeLists.txt (+58/-0) share/qtcreator/templates/wizards/ubuntu/simplei18n/wizard.xml (+57/-0) share/qtcreator/ubuntu/devicespage/DevicePage.qml (+7/-1) share/qtcreator/ubuntu/devicespage/EmulatorNotInstalled.qml (+46/-0) share/qtcreator/ubuntu/scripts/functions.inc (+3/-1) src/ubuntu/ubuntu.pro (+2/-1) src/ubuntu/ubuntuconstants.h (+3/-3) src/ubuntu/ubuntupackagingwidget.cpp (+9/-2) src/ubuntu/ubuntupackagingwidget.h (+1/-0) src/ubuntu/ubuntuvalidationresultmodel.cpp (+3/-0) tests/validation/fulloutput.json (+4/-72) tests/validation/simplesection.json (+1/-1) tests/validation/tst_validation.cpp (+7/-14) |
||||||||||||||||||||
To merge this branch: | bzr merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/i18n_and_reviewtools | ||||||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
David Planella (community) | Needs Fixing | ||
Zoltan Balogh | Pending | ||
Review via email: mp+238177@code.launchpad.net |
Commit message
- Fix bug lp:1363857 "Use click-review from click-reviewers
- Fix bug lp:1379689 "Add internationaliz
- Fix bug lp:1361936 "error information box is not updated"
- Fix bug lp:1368521 "After choosing "Create emulator", nothing happens
after that"
- Fix bug lp:1371807 "multi user problem writing to /tmp/sdk.log"
Description of the change
- Fix bug lp:1363857 "Use click-review from click-reviewers
- Fix bug lp:1379689 "Add internationaliz
- Fix bug lp:1361936 "error information box is not updated"
- Fix bug lp:1368521 "After choosing "Create emulator", nothing happens
after that"
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:288
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:291
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:292
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:294
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:295
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
David Planella (dpm) wrote : | # |
For the translations part, I've added a few inline comments.
As mentioned on IRC, for a template it might be a neater option and easier for developers to ship the cmake rules as a .cmake module. Here's an example of a WIP implementation of such module:
https:/
Benjamin Zeller (zeller-benjamin) wrote : | # |
> As mentioned on IRC, for a template it might be a neater option and easier for developers
> to ship the cmake rules as a .cmake module. Here's an example of a WIP implementation of
> such module:
Yes I remember that you mentioned that, but I couldn't think of a clean way to make a API that
supports all the use-cases nicely, especially handling the desktop file is a bit problematic.
If we would put out a .cmake module we are stuck with the API it exposes, since we would break
old projects if we just remove it.
But I'm fine switching to a cmake module if there is one created atm anyway. But then it would
make sense to ship it directly to the systemwide cmake module directory.
David Planella (dpm) wrote : | # |
Ok, although I don't quite understand how old projects would be broken if changes were done to a cmake module. If I understand it correctly, Qt Creator only needs to invoke cmake and make to build the translations, right?
In any case, the cmake translations module is still WIP, so let's go with plain cmake rules.
Benjamin Zeller (zeller-benjamin) wrote : | # |
> Ok, although I don't quite understand how old projects would be broken if
> changes were done to a cmake module. If I understand it correctly, Qt Creator
> only needs to invoke cmake and make to build the translations, right?
Well as long as the changes are backwards compatible nothing would break. But if
the API changes or parts of it is removed, then we would break it. Maybe i'm a bit too
precautious ;).
>
> In any case, the cmake translations module is still WIP, so let's go with
> plain cmake rules.
Ok we can switch that out any time!
- 296. By Benjamin Zeller
-
Fix comments in cmake project files
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:296
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'debian/qtcreator-plugin-ubuntu-common.install' |
2 | --- debian/qtcreator-plugin-ubuntu-common.install 2014-09-08 13:11:51 +0000 |
3 | +++ debian/qtcreator-plugin-ubuntu-common.install 2014-10-17 09:54:16 +0000 |
4 | @@ -7,4 +7,5 @@ |
5 | usr/share/qtcreator/templates/wizards/ubuntu/tabs |
6 | usr/share/qtcreator/templates/wizards/ubuntu/goproject |
7 | usr/share/qtcreator/templates/wizards/ubuntu/share |
8 | +usr/share/qtcreator/templates/wizards/ubuntu/simplei18n |
9 | usr/share/qtcreator/ubuntu |
10 | |
11 | === modified file 'share/qtcreator/templates/wizards/ubuntu/backendplustabs/CMakeLists.txt' |
12 | --- share/qtcreator/templates/wizards/ubuntu/backendplustabs/CMakeLists.txt 2014-09-11 10:35:30 +0000 |
13 | +++ share/qtcreator/templates/wizards/ubuntu/backendplustabs/CMakeLists.txt 2014-10-17 09:54:16 +0000 |
14 | @@ -1,19 +1,19 @@ |
15 | project(%ProjectName% C CXX) |
16 | cmake_minimum_required(VERSION 2.8.9) |
17 | |
18 | -#do not remove this line, its required for the correct functionality of the Ubuntu-SDK |
19 | +# Do not remove this line, its required for the correct functionality of the Ubuntu-SDK |
20 | set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Tells QtCreator location and name of the manifest file") |
21 | set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") |
22 | |
23 | find_package(Qt5Core) |
24 | find_package(Qt5Qml) |
25 | find_package(Qt5Quick) |
26 | -#find_package(ubuntu-sdk-libs) |
27 | +# find_package(ubuntu-sdk-libs) |
28 | |
29 | -#automatically create moc files |
30 | +# Automatically create moc files |
31 | set(CMAKE_AUTOMOC ON) |
32 | |
33 | -# components PATH |
34 | +# Components PATH |
35 | execute_process( |
36 | COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH |
37 | OUTPUT_VARIABLE ARCH_TRIPLET |
38 | @@ -29,14 +29,15 @@ |
39 | set(MAIN_QML "%ProjectName%.qml") |
40 | set(ICON "graphics/%ProjectName%.png") |
41 | |
42 | -#set install paths |
43 | +# Set install paths |
44 | set(CMAKE_INSTALL_PREFIX /) |
45 | set(DATA_DIR /) |
46 | set(DESKTOP_DIR ${DATA_DIR}) |
47 | +set(DESKTOP_FILE_NAME "%ClickHookName%.desktop") |
48 | |
49 | set(EXEC "qmlscene $@ ${%ProjectName:u%_DIR}/${MAIN_QML}") |
50 | |
51 | -#This command figures out the target architecture and puts it into the manifest file |
52 | +# This command figures out the target architecture for use in the manifest file |
53 | execute_process( |
54 | COMMAND dpkg-architecture -qDEB_HOST_ARCH |
55 | OUTPUT_VARIABLE CLICK_ARCH |
56 | @@ -52,6 +53,7 @@ |
57 | |
58 | add_subdirectory(app) |
59 | add_subdirectory(backend) |
60 | +add_subdirectory(po) |
61 | |
62 | add_custom_target("autopilot" chmod +x ${CMAKE_SOURCE_DIR}/app/tests/autopilot/run |
63 | COMMAND ${CMAKE_SOURCE_DIR}/app/tests/autopilot/run |
64 | @@ -66,5 +68,5 @@ |
65 | DEPENDS %ProjectName%backend %ProjectName%backend-qmldir |
66 | WORKING_DIRECTORY ./app) |
67 | |
68 | -#no op custom target for all not compiled files, so they show up in the QtCreator project tree |
69 | +# No op custom target for all not compiled files, so they show up in the QtCreator project tree |
70 | add_custom_target("%ProjectName:l%_ClickFiles" ALL SOURCES "%ClickHookName%.apparmor" "manifest.json.in") |
71 | |
72 | === modified file 'share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/CMakeLists.txt' |
73 | --- share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/CMakeLists.txt 2014-07-10 13:20:17 +0000 |
74 | +++ share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/CMakeLists.txt 2014-10-17 09:54:16 +0000 |
75 | @@ -1,13 +1,12 @@ |
76 | file(GLOB QML_JS_FILES *.qml *.js) |
77 | |
78 | -# make the files visible on qtcreator |
79 | +# Make the files visible on qtcreator |
80 | add_custom_target(%ProjectName:l%_QMlFiles ALL SOURCES ${QML_JS_FILES}) |
81 | |
82 | -#substitute variables in the desktop file |
83 | -set(DESKTOP_FILE "%ClickHookName%.desktop") |
84 | -configure_file(${DESKTOP_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}) |
85 | +# Substitute variables in the desktop file |
86 | +configure_file(${DESKTOP_FILE_NAME}.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME}.in) |
87 | |
88 | -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} DESTINATION ${DESKTOP_DIR}) |
89 | +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} DESTINATION ${DESKTOP_DIR}) |
90 | install(FILES ${QML_JS_FILES} DESTINATION ${%ProjectName:u%_DIR}) |
91 | |
92 | add_subdirectory(components) |
93 | |
94 | === modified file 'share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/components/CMakeLists.txt' |
95 | --- share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/components/CMakeLists.txt 2014-06-30 15:20:18 +0000 |
96 | +++ share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/components/CMakeLists.txt 2014-10-17 09:54:16 +0000 |
97 | @@ -1,6 +1,6 @@ |
98 | file(GLOB COMPONENTS_QML_JS_FILES *.qml *.js) |
99 | |
100 | -# make the files visible in the qtcreator tree |
101 | +# Make the files visible in the qtcreator tree |
102 | add_custom_target(%ProjectName:l%_components_QMlFiles ALL SOURCES ${COMPONENTS_QML_JS_FILES}) |
103 | |
104 | install(FILES ${COMPONENTS_QML_JS_FILES} DESTINATION ${%ProjectName:u%_DIR}/components) |
105 | |
106 | === modified file 'share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/displayName.desktop.in' |
107 | --- share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/displayName.desktop.in 2014-06-30 15:20:18 +0000 |
108 | +++ share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/displayName.desktop.in 2014-10-17 09:54:16 +0000 |
109 | @@ -1,5 +1,5 @@ |
110 | [Desktop Entry] |
111 | -Name=%ProjectName% |
112 | +_Name=%ProjectName% |
113 | Comment=My project description |
114 | Exec=@EXEC@ |
115 | Icon=@ICON@ |
116 | |
117 | === modified file 'share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/ui/CMakeLists.txt' |
118 | --- share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/ui/CMakeLists.txt 2014-06-30 15:20:18 +0000 |
119 | +++ share/qtcreator/templates/wizards/ubuntu/backendplustabs/app/ui/CMakeLists.txt 2014-10-17 09:54:16 +0000 |
120 | @@ -1,6 +1,6 @@ |
121 | file(GLOB UI_QML_JS_FILES *.qml *.js) |
122 | |
123 | -# make the files visible in the qtcreator tree |
124 | +# Make the files visible in the qtcreator tree |
125 | add_custom_target(%ProjectName:l%_ui_QMlFiles ALL SOURCES ${UI_QML_JS_FILES}) |
126 | |
127 | install(FILES ${UI_QML_JS_FILES} DESTINATION ${%ProjectName:u%_DIR}/ui) |
128 | |
129 | === added directory 'share/qtcreator/templates/wizards/ubuntu/backendplustabs/po' |
130 | === added file 'share/qtcreator/templates/wizards/ubuntu/backendplustabs/po/CMakeLists.txt' |
131 | --- share/qtcreator/templates/wizards/ubuntu/backendplustabs/po/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
132 | +++ share/qtcreator/templates/wizards/ubuntu/backendplustabs/po/CMakeLists.txt 2014-10-17 09:54:16 +0000 |
133 | @@ -0,0 +1,58 @@ |
134 | +include(FindGettext) |
135 | + |
136 | +# Find the translation tools |
137 | +find_program(INTLTOOL_MERGE intltool-merge) |
138 | +if(NOT INTLTOOL_MERGE) |
139 | + message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package") |
140 | +endif() |
141 | + |
142 | +find_program(INTLTOOL_EXTRACT intltool-extract) |
143 | +if(NOT INTLTOOL_EXTRACT) |
144 | + message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package") |
145 | +endif() |
146 | + |
147 | +find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext) |
148 | + |
149 | +set(DOMAIN ${PROJECT_NAME}) |
150 | +set(POT_FILE ${DOMAIN}.pot) |
151 | +file(GLOB PO_FILES *.po) |
152 | + |
153 | +file(GLOB_RECURSE I18N_SRC_FILES |
154 | + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} |
155 | + ${CMAKE_SOURCE_DIR}/*.qml |
156 | + ${CMAKE_SOURCE_DIR}/*.js |
157 | + ${CMAKE_SOURCE_DIR}/*.cpp |
158 | + ${CMAKE_SOURCE_DIR}/*.h |
159 | +) |
160 | +list(APPEND I18N_SRC_FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME}.in.h) |
161 | +list(SORT I18N_SRC_FILES) |
162 | + |
163 | +add_custom_target(${POT_FILE} ALL |
164 | + COMMENT "Generating translation template" |
165 | + # Extract the translatable messages from the desktop file |
166 | + COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini |
167 | + --srcdir=${CMAKE_BINARY_DIR}/app ${DESKTOP_FILE_NAME}.in |
168 | + # Update the translation file |
169 | + COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE} |
170 | + --from-code=UTF-8 |
171 | + --c++ --qt --add-comments=TRANSLATORS |
172 | + --keyword=tr --keyword=tr:1,2 --keyword=N_ |
173 | + --package-name='${PROJECT}' |
174 | + -D ${CMAKE_CURRENT_SOURCE_DIR} ${I18N_SRC_FILES} |
175 | + # Copy the up2date translation file to the source directory |
176 | + COMMAND ${CMAKE_COMMAND} -E copy ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR} |
177 | +) |
178 | + |
179 | +foreach(PO_FILE ${PO_FILES}) |
180 | + get_filename_component(LANG ${PO_FILE} NAME_WE) |
181 | + gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE}) |
182 | + set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES) |
183 | + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo |
184 | + DESTINATION ${INSTALL_DIR} |
185 | + RENAME ${DOMAIN}.mo) |
186 | +endforeach(PO_FILE) |
187 | + |
188 | +add_custom_target(${DESKTOP_FILE_NAME} ALL |
189 | + COMMENT "Merging translations into ${DESKTOP_FILE_NAME}" |
190 | + COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${CMAKE_BINARY_DIR}/app/${DESKTOP_FILE_NAME}.in ${CMAKE_BINARY_DIR}/app/${DESKTOP_FILE_NAME} > /dev/null |
191 | +) |
192 | |
193 | === modified file 'share/qtcreator/templates/wizards/ubuntu/backendplustabs/wizard.xml' |
194 | --- share/qtcreator/templates/wizards/ubuntu/backendplustabs/wizard.xml 2014-09-12 08:39:29 +0000 |
195 | +++ share/qtcreator/templates/wizards/ubuntu/backendplustabs/wizard.xml 2014-10-17 09:54:16 +0000 |
196 | @@ -39,9 +39,10 @@ |
197 | <file source="app/tests/autopilot/displayName/__init__.py" target="app/tests/autopilot/%ProjectName%/__init__.py" openeditor="false"/> |
198 | <file source="app/tests/autopilot/displayName/main/__init__.py" target="app/tests/autopilot/%ProjectName%/main/__init__.py" openeditor="false"/> |
199 | <file source="cmake/Click.cmake" target="cmake/Click.cmake" openeditor="false"/> |
200 | - <file source="manifest.json.in" target="manifest.json.in" openeditor="true"/> |
201 | - <file source="../share/displayName.apparmor" target="%ClickHookName%.apparmor" openeditor="false"/> |
202 | + <file source="manifest.json.in" target="manifest.json.in" openeditor="true"/> |
203 | + <file source="../share/displayName.apparmor" target="%ClickHookName%.apparmor" openeditor="false"/> |
204 | <file source="app/displayName.qml" target="app/%ProjectName%.qml" openeditor="true"/> |
205 | + <file source="po/CMakeLists.txt" target="po/CMakeLists.txt" openeditor="false"/> |
206 | </files> |
207 | |
208 | <!-- Create a 2nd wizard page with click package parameters --> |
209 | |
210 | === added directory 'share/qtcreator/templates/wizards/ubuntu/simplei18n' |
211 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/CMakeLists.txt' |
212 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
213 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/CMakeLists.txt 2014-10-17 09:54:16 +0000 |
214 | @@ -0,0 +1,75 @@ |
215 | +project(%ProjectName% C CXX) |
216 | +cmake_minimum_required(VERSION 2.8.9) |
217 | + |
218 | +# Do not remove this line, its required for the correct functionality of the Ubuntu-SDK |
219 | +set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Tells QtCreator location and name of the manifest file") |
220 | + |
221 | +find_package(Qt5Core) |
222 | +find_package(Qt5Qml) |
223 | +find_package(Qt5Quick) |
224 | +# Find_package(ubuntu-sdk-libs) |
225 | + |
226 | +#automatically create moc files |
227 | +set(CMAKE_AUTOMOC ON) |
228 | + |
229 | +# Figure out the component install path |
230 | +execute_process( |
231 | + COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH |
232 | + OUTPUT_VARIABLE ARCH_TRIPLET |
233 | + OUTPUT_STRIP_TRAILING_WHITESPACE |
234 | +) |
235 | + |
236 | +set(CLICK_ARCH "all") |
237 | +# If you want to add native code to your project, replace the set CLICK_ARCH command |
238 | +# with the following part. |
239 | +# This command figures out the target architecture for use in the manifest file |
240 | +# execute_process( |
241 | +# COMMAND dpkg-architecture -qDEB_HOST_ARCH |
242 | +# OUTPUT_VARIABLE CLICK_ARCH |
243 | +# OUTPUT_STRIP_TRAILING_WHITESPACE |
244 | +# ) |
245 | + |
246 | +set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}") |
247 | + |
248 | +option(INSTALL_TESTS "Install the tests on make install" on) |
249 | + |
250 | +set(APP_NAME %ProjectName%) |
251 | +set(%ProjectName:u%_DIR "share/qml/%ProjectName%") |
252 | +set(MAIN_QML "%ProjectName%.qml") |
253 | +set(ICON "graphics/%ProjectName%.png") |
254 | + |
255 | +# Set install paths |
256 | +set(CMAKE_INSTALL_PREFIX /) |
257 | +set(DATA_DIR /) |
258 | +set(DESKTOP_DIR ${DATA_DIR}) |
259 | +set(DESKTOP_FILE_NAME "%ClickHookName%.desktop") |
260 | + |
261 | +# This sets the commandline that is executed on the device |
262 | +set(EXEC "qmlscene $@ ${%ProjectName:u%_DIR}/${MAIN_QML}") |
263 | + |
264 | +# Configures the manifest file. The manifest file describes the click package |
265 | +# to the target system. All cmake variables that are defined at this point |
266 | +# can be used in the manifest file and will be automatically replaced by cmake |
267 | +configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json) |
268 | +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json |
269 | + DESTINATION ${CMAKE_INSTALL_PREFIX}) |
270 | + |
271 | +install(DIRECTORY "app/graphics" DESTINATION ${DATA_DIR}) |
272 | +install(FILES "%ClickHookName%.apparmor" DESTINATION ${DATA_DIR}) |
273 | + |
274 | +add_subdirectory(app) |
275 | +add_subdirectory(po) |
276 | + |
277 | +add_custom_target("autopilot" chmod +x ${CMAKE_SOURCE_DIR}/app/tests/autopilot/run |
278 | + COMMAND ${CMAKE_SOURCE_DIR}/app/tests/autopilot/run |
279 | + WORKING_DIRECTORY ./app) |
280 | + |
281 | +add_custom_target("check" /usr/bin/qmltestrunner -input ${CMAKE_SOURCE_DIR}/app/tests/unit -import ${CMAKE_BINARY_DIR}/backend |
282 | + WORKING_DIRECTORY ./app) |
283 | + |
284 | +add_custom_target("run" /usr/bin/qmlscene -I ${CMAKE_BINARY_DIR}/backend ${CMAKE_SOURCE_DIR}/app/%ProjectName%.qml |
285 | + WORKING_DIRECTORY ./app) |
286 | + |
287 | +# Normally QtCreator would only show files that are part of a target, but we need it to show also files |
288 | +# that are not compiled. Therefore we add a custom target that just does nothing but list the files |
289 | +add_custom_target("%ProjectName:l%_ClickFiles" ALL SOURCES "%ClickHookName%.apparmor" "manifest.json.in") |
290 | |
291 | === added directory 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app' |
292 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/CMakeLists.txt' |
293 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/app/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
294 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/app/CMakeLists.txt 2014-10-17 09:54:16 +0000 |
295 | @@ -0,0 +1,20 @@ |
296 | +# Searches for all qml and javascript files in the current directory |
297 | +# to add them to the project, if you add new files in the directory |
298 | +# rerun cmake to make sure they show up in the project tree |
299 | +file(GLOB QML_JS_FILES *.qml *.js) |
300 | + |
301 | +# Make the files visible in qtcreator |
302 | +add_custom_target(%ProjectName:l%_QMlFiles ALL SOURCES ${QML_JS_FILES}) |
303 | + |
304 | +# Substitute variables in the desktop file |
305 | +configure_file(${DESKTOP_FILE_NAME}.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME}.in) |
306 | + |
307 | +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} DESTINATION ${DESKTOP_DIR}) |
308 | +install(FILES ${QML_JS_FILES} DESTINATION ${%ProjectName:u%_DIR}) |
309 | + |
310 | +add_subdirectory(components) |
311 | +add_subdirectory(ui) |
312 | + |
313 | +# Make the autpilot files visible in qtcreator |
314 | +file(GLOB_RECURSE AUTOPILOT_TEST_FILES *.py) |
315 | +add_custom_target(%ProjectName:l%_AutopilotFiles ALL SOURCES ${AUTOPILOT_TEST_FILES}) |
316 | |
317 | === added directory 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/components' |
318 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/components/CMakeLists.txt' |
319 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/app/components/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
320 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/app/components/CMakeLists.txt 2014-10-17 09:54:16 +0000 |
321 | @@ -0,0 +1,6 @@ |
322 | +file(GLOB COMPONENTS_QML_JS_FILES *.qml *.js) |
323 | + |
324 | +# Make the files visible in the qtcreator tree |
325 | +add_custom_target(%ProjectName:l%_components_QMlFiles ALL SOURCES ${COMPONENTS_QML_JS_FILES}) |
326 | + |
327 | +install(FILES ${COMPONENTS_QML_JS_FILES} DESTINATION ${%ProjectName:u%_DIR}/components) |
328 | |
329 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/components/HelloComponent.qml' |
330 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/app/components/HelloComponent.qml 1970-01-01 00:00:00 +0000 |
331 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/app/components/HelloComponent.qml 2014-10-17 09:54:16 +0000 |
332 | @@ -0,0 +1,14 @@ |
333 | +import QtQuick 2.0 |
334 | +import Ubuntu.Components 1.1 |
335 | + |
336 | +UbuntuShape { |
337 | + width: 200 |
338 | + height: width |
339 | + |
340 | + property alias text : myText.text |
341 | + |
342 | + Label { |
343 | + id: myText |
344 | + anchors.centerIn: parent |
345 | + } |
346 | +} |
347 | |
348 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/displayName.desktop.in' |
349 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/app/displayName.desktop.in 1970-01-01 00:00:00 +0000 |
350 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/app/displayName.desktop.in 2014-10-17 09:54:16 +0000 |
351 | @@ -0,0 +1,10 @@ |
352 | +[Desktop Entry] |
353 | +_Name=%ProjectName% |
354 | +Comment=My project description |
355 | +Exec=@EXEC@ |
356 | +Icon=@ICON@ |
357 | +Terminal=false |
358 | +Type=Application |
359 | +X-Ubuntu-Touch=true |
360 | + |
361 | + |
362 | |
363 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/displayName.qml' |
364 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/app/displayName.qml 1970-01-01 00:00:00 +0000 |
365 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/app/displayName.qml 2014-10-17 09:54:16 +0000 |
366 | @@ -0,0 +1,41 @@ |
367 | +import QtQuick 2.0 |
368 | +import Ubuntu.Components 1.1 |
369 | +import "ui" |
370 | + |
371 | +/*! |
372 | + \brief MainView with Tabs element. |
373 | + First Tab has a single Label and |
374 | + second Tab has a single ToolbarAction. |
375 | +*/ |
376 | + |
377 | +MainView { |
378 | + // objectName for functional testing purposes (autopilot-qt5) |
379 | + objectName: "mainView" |
380 | + |
381 | + // Note! applicationName needs to match the "name" field of the click manifest |
382 | + applicationName: "%ClickDomain:l%.%ProjectName:l%" |
383 | + |
384 | + /* |
385 | + This property enables the application to change orientation |
386 | + when the device is rotated. The default is false. |
387 | + */ |
388 | + //automaticOrientation: true |
389 | + |
390 | + // Removes the old toolbar and enables new features of the new header. |
391 | + useDeprecatedToolbar: false |
392 | + |
393 | + width: units.gu(100) |
394 | + height: units.gu(75) |
395 | + |
396 | + Tabs { |
397 | + id: tabs |
398 | + |
399 | + HelloTab { |
400 | + objectName: "helloTab" |
401 | + } |
402 | + |
403 | + WorldTab { |
404 | + objectName: "worldTab" |
405 | + } |
406 | + } |
407 | +} |
408 | |
409 | === added directory 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/graphics' |
410 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/graphics/displayName.png' |
411 | Binary files share/qtcreator/templates/wizards/ubuntu/simplei18n/app/graphics/displayName.png 1970-01-01 00:00:00 +0000 and share/qtcreator/templates/wizards/ubuntu/simplei18n/app/graphics/displayName.png 2014-10-17 09:54:16 +0000 differ |
412 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/graphics/toolbarIcon@8.png' |
413 | Binary files share/qtcreator/templates/wizards/ubuntu/simplei18n/app/graphics/toolbarIcon@8.png 1970-01-01 00:00:00 +0000 and share/qtcreator/templates/wizards/ubuntu/simplei18n/app/graphics/toolbarIcon@8.png 2014-10-17 09:54:16 +0000 differ |
414 | === added directory 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests' |
415 | === added directory 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot' |
416 | === added directory 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName' |
417 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName/__init__.py' |
418 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName/__init__.py 1970-01-01 00:00:00 +0000 |
419 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName/__init__.py 2014-10-17 09:54:16 +0000 |
420 | @@ -0,0 +1,132 @@ |
421 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
422 | + |
423 | +"""Ubuntu Touch App autopilot tests.""" |
424 | + |
425 | +from os import remove |
426 | +import os.path |
427 | +from tempfile import mktemp |
428 | +import subprocess |
429 | + |
430 | +from autopilot.input import Mouse, Touch, Pointer |
431 | +from autopilot.matchers import Eventually |
432 | +from autopilot.platform import model |
433 | +from testtools.matchers import Is, Not, Equals |
434 | +from autopilot.testcase import AutopilotTestCase |
435 | + |
436 | +def get_module_include_path(): |
437 | + return os.path.abspath( |
438 | + os.path.join( |
439 | + os.path.dirname(__file__), |
440 | + '..', |
441 | + '..', |
442 | + '..', |
443 | + '..', |
444 | + 'backend', |
445 | + 'modules') |
446 | + ) |
447 | + |
448 | + |
449 | +class UbuntuTouchAppTestCase(AutopilotTestCase): |
450 | + """A common test case class that provides several useful methods for the tests.""" |
451 | + |
452 | + if model() == 'Desktop': |
453 | + scenarios = [ |
454 | + ('with mouse', dict(input_device_class=Mouse)) |
455 | + ] |
456 | + else: |
457 | + scenarios = [ |
458 | + ('with touch', dict(input_device_class=Touch)) |
459 | + ] |
460 | + |
461 | + @property |
462 | + def main_window(self): |
463 | + return MainWindow(self.app) |
464 | + |
465 | + |
466 | + def setUp(self): |
467 | + self.pointing_device = Pointer(self.input_device_class.create()) |
468 | + super(UbuntuTouchAppTestCase, self).setUp() |
469 | + self.launch_test_qml() |
470 | + |
471 | + |
472 | + def launch_test_qml(self): |
473 | + # If the test class has defined a 'test_qml' class attribute then we |
474 | + # write it to disk and launch it inside the QML Scene. If not, then we |
475 | + # silently do nothing (presumably the test has something else planned). |
476 | + arch = subprocess.check_output(["dpkg-architecture", |
477 | + "-qDEB_HOST_MULTIARCH"]).strip() |
478 | + if hasattr(self, 'test_qml') and isinstance(self.test_qml, basestring): |
479 | + qml_path = mktemp(suffix='.qml') |
480 | + open(qml_path, 'w').write(self.test_qml) |
481 | + self.addCleanup(remove, qml_path) |
482 | + |
483 | + self.app = self.launch_test_application( |
484 | + "/usr/lib/" + arch + "/qt5/bin/qmlscene", |
485 | + "-I", get_module_include_path(), |
486 | + qml_path, |
487 | + app_type='qt') |
488 | + |
489 | + if hasattr(self, 'test_qml_file') and isinstance(self.test_qml_file, basestring): |
490 | + qml_path = self.test_qml_file |
491 | + self.app = self.launch_test_application( |
492 | + "/usr/lib/" + arch + "/qt5/bin/qmlscene", |
493 | + "-I", get_module_include_path(), |
494 | + qml_path, |
495 | + app_type='qt') |
496 | + |
497 | + self.assertThat(self.get_qml_view().visible, Eventually(Equals(True))) |
498 | + |
499 | + |
500 | + def get_qml_view(self): |
501 | + """Get the main QML view""" |
502 | + |
503 | + return self.app.select_single("QQuickView") |
504 | + |
505 | + def get_mainview(self): |
506 | + """Get the QML MainView""" |
507 | + |
508 | + mainView = self.app.select_single("MainView") |
509 | + self.assertThat(mainView, Not(Is(None))) |
510 | + return mainView |
511 | + |
512 | + |
513 | + def get_object(self,objectName): |
514 | + """Get a object based on the objectName""" |
515 | + |
516 | + obj = self.app.select_single(objectName=objectName) |
517 | + self.assertThat(obj, Not(Is(None))) |
518 | + return obj |
519 | + |
520 | + |
521 | + def mouse_click(self,objectName): |
522 | + """Move mouse on top of the object and click on it""" |
523 | + |
524 | + obj = self.get_object(objectName) |
525 | + self.pointing_device.move_to_object(obj) |
526 | + self.pointing_device.click() |
527 | + |
528 | + |
529 | + def mouse_press(self,objectName): |
530 | + """Move mouse on top of the object and press mouse button (without releasing it)""" |
531 | + |
532 | + obj = self.get_object(objectName) |
533 | + self.pointing_device.move_to_object(obj) |
534 | + self.pointing_device.press() |
535 | + |
536 | + |
537 | + def mouse_release(self): |
538 | + """Release mouse button""" |
539 | + |
540 | + self.pointing_device.release() |
541 | + |
542 | + |
543 | + def type_string(self, string): |
544 | + """Type a string with keyboard""" |
545 | + |
546 | + self.keyboard.type(string) |
547 | + |
548 | + |
549 | + def type_key(self, key): |
550 | + """Type a single key with keyboard""" |
551 | + |
552 | + self.keyboard.key(key) |
553 | |
554 | === added directory 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName/main' |
555 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName/main/__init__.py' |
556 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName/main/__init__.py 1970-01-01 00:00:00 +0000 |
557 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName/main/__init__.py 2014-10-17 09:54:16 +0000 |
558 | @@ -0,0 +1,1 @@ |
559 | +""" A main.qml test suite """ |
560 | |
561 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName/main/test_main.py' |
562 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName/main/test_main.py 1970-01-01 00:00:00 +0000 |
563 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/displayName/main/test_main.py 2014-10-17 09:54:16 +0000 |
564 | @@ -0,0 +1,23 @@ |
565 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
566 | + |
567 | +"""Tests for the Hello World""" |
568 | + |
569 | +from autopilot.matchers import Eventually |
570 | +from textwrap import dedent |
571 | +from testtools.matchers import Is, Not, Equals |
572 | +from testtools import skip |
573 | +import os |
574 | +from %ProjectName% import UbuntuTouchAppTestCase |
575 | + |
576 | + |
577 | +class MainTests(UbuntuTouchAppTestCase): |
578 | + """Generic tests for the Hello World""" |
579 | + |
580 | + test_qml_file = "%s/%s.qml" % (os.path.dirname(os.path.realpath(__file__)),"../../../../%ProjectName%") |
581 | + |
582 | + def test_0_can_select_mainView(self): |
583 | + """Must be able to select the mainview.""" |
584 | + |
585 | + mainView = self.get_mainview() |
586 | + self.assertThat(mainView.visible,Eventually(Equals(True))) |
587 | + |
588 | |
589 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/run' |
590 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/run 1970-01-01 00:00:00 +0000 |
591 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/autopilot/run 2014-10-17 09:54:16 +0000 |
592 | @@ -0,0 +1,11 @@ |
593 | +#!/bin/bash |
594 | + |
595 | +if [[ -z `which autopilot` ]]; then |
596 | + echo "Autopilot is not installed. Skip" |
597 | + exit |
598 | +fi |
599 | + |
600 | +SCRIPTPATH=`dirname $0` |
601 | +pushd ${SCRIPTPATH} |
602 | +autopilot run %ProjectName% |
603 | +popd |
604 | |
605 | === added directory 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/unit' |
606 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/unit/tst_hellocomponent.qml' |
607 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/unit/tst_hellocomponent.qml 1970-01-01 00:00:00 +0000 |
608 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/app/tests/unit/tst_hellocomponent.qml 2014-10-17 09:54:16 +0000 |
609 | @@ -0,0 +1,49 @@ |
610 | +import QtQuick 2.0 |
611 | +import QtTest 1.0 |
612 | +import Ubuntu.Components 1.1 |
613 | +import "../../components" |
614 | + |
615 | +// See more details @ http://qt-project.org/doc/qt-5.0/qtquick/qml-testcase.html |
616 | + |
617 | +// Execute tests with: |
618 | +// qmltestrunner |
619 | + |
620 | +Item { |
621 | + // The objects |
622 | + HelloComponent { |
623 | + id: objectUnderTest |
624 | + } |
625 | + |
626 | + TestCase { |
627 | + name: "HelloComponent" |
628 | + |
629 | + function init() { |
630 | + console.debug(">> init"); |
631 | + compare("",objectUnderTest.text,"text was not empty on init"); |
632 | + console.debug("<< init"); |
633 | + } |
634 | + |
635 | + function cleanup() { |
636 | + console.debug(">> cleanup"); |
637 | + console.debug("<< cleanup"); |
638 | + } |
639 | + |
640 | + function initTestCase() { |
641 | + console.debug(">> initTestCase"); |
642 | + console.debug("<< initTestCase"); |
643 | + } |
644 | + |
645 | + function cleanupTestCase() { |
646 | + console.debug(">> cleanupTestCase"); |
647 | + console.debug("<< cleanupTestCase"); |
648 | + } |
649 | + |
650 | + function test_canReadAndWriteText() { |
651 | + var expected = "Hello World"; |
652 | + |
653 | + objectUnderTest.text = expected; |
654 | + |
655 | + compare(expected,objectUnderTest.text,"expected did not equal result"); |
656 | + } |
657 | + } |
658 | +} |
659 | |
660 | === added directory 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/ui' |
661 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/ui/CMakeLists.txt' |
662 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/app/ui/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
663 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/app/ui/CMakeLists.txt 2014-10-17 09:54:16 +0000 |
664 | @@ -0,0 +1,6 @@ |
665 | +file(GLOB UI_QML_JS_FILES *.qml *.js) |
666 | + |
667 | +# Make the files visible in the qtcreator tree |
668 | +add_custom_target(%ProjectName:l%_ui_QMlFiles ALL SOURCES ${UI_QML_JS_FILES}) |
669 | + |
670 | +install(FILES ${UI_QML_JS_FILES} DESTINATION ${%ProjectName:u%_DIR}/ui) |
671 | |
672 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/ui/HelloTab.qml' |
673 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/app/ui/HelloTab.qml 1970-01-01 00:00:00 +0000 |
674 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/app/ui/HelloTab.qml 2014-10-17 09:54:16 +0000 |
675 | @@ -0,0 +1,30 @@ |
676 | +import QtQuick 2.0 |
677 | +import Ubuntu.Components 1.1 |
678 | +import "../components" |
679 | + |
680 | +Tab { |
681 | + title: i18n.tr("Hello..") |
682 | + |
683 | + page: Page { |
684 | + Column { |
685 | + spacing: units.gu(2) |
686 | + anchors.centerIn: parent |
687 | + |
688 | + HelloComponent { |
689 | + objectName: "helloTab_HelloComponent" |
690 | + |
691 | + anchors.horizontalCenter: parent.horizontalCenter |
692 | + |
693 | + text: i18n.tr("Hello World") |
694 | + } |
695 | + |
696 | + Label { |
697 | + objectName: "helloTab_label" |
698 | + |
699 | + anchors.horizontalCenter: parent.horizontalCenter |
700 | + |
701 | + text: i18n.tr("You can change the Tab from Page title above.") |
702 | + } |
703 | + } |
704 | + } |
705 | +} |
706 | |
707 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/app/ui/WorldTab.qml' |
708 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/app/ui/WorldTab.qml 1970-01-01 00:00:00 +0000 |
709 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/app/ui/WorldTab.qml 2014-10-17 09:54:16 +0000 |
710 | @@ -0,0 +1,29 @@ |
711 | +import QtQuick 2.0 |
712 | +import Ubuntu.Components 1.1 |
713 | +import "../components" |
714 | + |
715 | +Tab { |
716 | + title: i18n.tr("..World!") |
717 | + |
718 | + page: Page { |
719 | + Column { |
720 | + spacing: units.gu(2) |
721 | + anchors.centerIn: parent |
722 | + |
723 | + HelloComponent { |
724 | + objectName: "worldTab_HelloComponent" |
725 | + |
726 | + anchors.horizontalCenter: parent.horizontalCenter |
727 | + |
728 | + text: i18n.tr("WorldTab") |
729 | + } |
730 | + |
731 | + Label { |
732 | + id: label |
733 | + objectName: "worldTab_label" |
734 | + |
735 | + anchors.horizontalCenter: parent.horizontalCenter |
736 | + } |
737 | + } |
738 | + } |
739 | +} |
740 | |
741 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/manifest.json.in' |
742 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/manifest.json.in 1970-01-01 00:00:00 +0000 |
743 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/manifest.json.in 2014-10-17 09:54:16 +0000 |
744 | @@ -0,0 +1,15 @@ |
745 | +{ |
746 | + "name": "%ClickDomain:l%.%ProjectName:l%", |
747 | + "description": "description of %ProjectName%", |
748 | + "architecture": "@CLICK_ARCH@", |
749 | + "title": "%ProjectName%", |
750 | + "hooks": { |
751 | + "%ClickHookName%": { |
752 | + "apparmor": "%ClickHookName%.apparmor", |
753 | + "desktop": "%ClickHookName%.desktop" |
754 | + } |
755 | + }, |
756 | + "version": "0.1", |
757 | + "maintainer": "%ClickMaintainer%" |
758 | +} |
759 | + |
760 | |
761 | === added directory 'share/qtcreator/templates/wizards/ubuntu/simplei18n/po' |
762 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/po/CMakeLists.txt' |
763 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/po/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
764 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/po/CMakeLists.txt 2014-10-17 09:54:16 +0000 |
765 | @@ -0,0 +1,58 @@ |
766 | +include(FindGettext) |
767 | + |
768 | +# Find the translation tools |
769 | +find_program(INTLTOOL_MERGE intltool-merge) |
770 | +if(NOT INTLTOOL_MERGE) |
771 | + message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package") |
772 | +endif() |
773 | + |
774 | +find_program(INTLTOOL_EXTRACT intltool-extract) |
775 | +if(NOT INTLTOOL_EXTRACT) |
776 | + message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package") |
777 | +endif() |
778 | + |
779 | +find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext) |
780 | + |
781 | +set(DOMAIN ${PROJECT_NAME}) |
782 | +set(POT_FILE ${DOMAIN}.pot) |
783 | +file(GLOB PO_FILES *.po) |
784 | + |
785 | +file(GLOB_RECURSE I18N_SRC_FILES |
786 | + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} |
787 | + ${CMAKE_SOURCE_DIR}/*.qml |
788 | + ${CMAKE_SOURCE_DIR}/*.js |
789 | + ${CMAKE_SOURCE_DIR}/*.cpp |
790 | + ${CMAKE_SOURCE_DIR}/*.h |
791 | +) |
792 | +list(APPEND I18N_SRC_FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME}.in.h) |
793 | +list(SORT I18N_SRC_FILES) |
794 | + |
795 | +add_custom_target(${POT_FILE} ALL |
796 | + COMMENT "Generating translation template" |
797 | + # Extract the translatable messages from the desktop file |
798 | + COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini |
799 | + --srcdir=${CMAKE_BINARY_DIR}/app ${DESKTOP_FILE_NAME}.in |
800 | + # Update the translation file |
801 | + COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE} |
802 | + --from-code=UTF-8 |
803 | + --c++ --qt --add-comments=TRANSLATORS |
804 | + --keyword=tr --keyword=tr:1,2 --keyword=N_ |
805 | + --package-name='${PROJECT}' |
806 | + -D ${CMAKE_CURRENT_SOURCE_DIR} ${I18N_SRC_FILES} |
807 | + # Copy the up2date translation file to the source directory |
808 | + COMMAND ${CMAKE_COMMAND} -E copy ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR} |
809 | +) |
810 | + |
811 | +foreach(PO_FILE ${PO_FILES}) |
812 | + get_filename_component(LANG ${PO_FILE} NAME_WE) |
813 | + gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE}) |
814 | + set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES) |
815 | + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo |
816 | + DESTINATION ${INSTALL_DIR} |
817 | + RENAME ${DOMAIN}.mo) |
818 | +endforeach(PO_FILE) |
819 | + |
820 | +add_custom_target(${DESKTOP_FILE_NAME} ALL |
821 | + COMMENT "Merging translations into ${DESKTOP_FILE_NAME}" |
822 | + COMMAND LC_ALL=C ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po ${CMAKE_BINARY_DIR}/app/${DESKTOP_FILE_NAME}.in ${CMAKE_BINARY_DIR}/app/${DESKTOP_FILE_NAME} > /dev/null |
823 | +) |
824 | |
825 | === added file 'share/qtcreator/templates/wizards/ubuntu/simplei18n/wizard.xml' |
826 | --- share/qtcreator/templates/wizards/ubuntu/simplei18n/wizard.xml 1970-01-01 00:00:00 +0000 |
827 | +++ share/qtcreator/templates/wizards/ubuntu/simplei18n/wizard.xml 2014-10-17 09:54:16 +0000 |
828 | @@ -0,0 +1,57 @@ |
829 | +<?xml version="1.0" encoding="UTF-8"?> |
830 | +<wizard version="1" kind="project" firstpage="10" id="UbuntuAppWBackendPlusTabsCMake'" category="A.UbuntuProject" |
831 | + platformIndependent="true" |
832 | + class="ubuntu-project-cmake" |
833 | + featuresRequired="" |
834 | + > |
835 | + <icon>../share/ubuntu.png</icon> |
836 | + <description>A simple QML app with localization support. |
837 | + |
838 | +Includes also |
839 | + - unit and functional tests for QML |
840 | +</description> |
841 | + <displayname>App with Simple UI and localization</displayname> |
842 | + <displaycategory>Ubuntu</displaycategory> |
843 | + <files> |
844 | + <file source="CMakeLists.txt" target="CMakeLists.txt" openproject="true"/> |
845 | + <file source="app/graphics/toolbarIcon@8.png" target="app/graphics/toolbarIcon@8.png" openeditor="false" binary="true"/> |
846 | + <file source="app/displayName.desktop.in" target="app/%ClickHookName%.desktop.in" openeditor="false"/> |
847 | + <file source="app/graphics/displayName.png" target="app/graphics/%ProjectName%.png" openeditor="false" binary="true"/> |
848 | + <file source="app/tests/unit/tst_hellocomponent.qml" target="app/tests/unit/tst_hellocomponent.qml" openeditor="false"/> |
849 | + <file source="app/components/CMakeLists.txt" target="app/components/CMakeLists.txt" openeditor="false"/> |
850 | + <file source="app/components/HelloComponent.qml" target="app/components/HelloComponent.qml" openeditor="false"/> |
851 | + <file source="app/ui/CMakeLists.txt" target="app/ui/CMakeLists.txt" openeditor="false"/> |
852 | + <file source="app/ui/WorldTab.qml" target="app/ui/WorldTab.qml" openeditor="false"/> |
853 | + <file source="app/ui/HelloTab.qml" target="app/ui/HelloTab.qml" openeditor="false"/> |
854 | + <file source="app/CMakeLists.txt" target="app/CMakeLists.txt" openeditor="false"/> |
855 | + <file source="app/tests/autopilot/run" target="app/tests/autopilot/run" openeditor="false"/> |
856 | + <file source="app/tests/autopilot/displayName/main/test_main.py" target="app/tests/autopilot/%ProjectName%/main/test_main.py" openeditor="false"/> |
857 | + <file source="app/tests/autopilot/displayName/__init__.py" target="app/tests/autopilot/%ProjectName%/__init__.py" openeditor="false"/> |
858 | + <file source="app/tests/autopilot/displayName/main/__init__.py" target="app/tests/autopilot/%ProjectName%/main/__init__.py" openeditor="false"/> |
859 | + <file source="manifest.json.in" target="manifest.json.in" openeditor="true"/> |
860 | + <file source="../share/displayName.apparmor" target="%ClickHookName%.apparmor" openeditor="false"/> |
861 | + <file source="app/displayName.qml" target="app/%ProjectName%.qml" openeditor="true"/> |
862 | + <file source="po/CMakeLists.txt" target="po/CMakeLists.txt" openeditor="false"/> |
863 | + </files> |
864 | + |
865 | + <!-- Create a 2nd wizard page with click package parameters --> |
866 | + <fieldpagetitle>Click package parameters</fieldpagetitle> |
867 | + <fields> |
868 | + <field mandatory="true" name="ClickDomain"> |
869 | + <fieldcontrol class="QLineEdit" validator='^[A-Za-z0-9.-]+$' |
870 | + defaulttext="" placeholdertext="Domain"/> |
871 | + <fielddescription>Domain:</fielddescription> |
872 | + </field> |
873 | + <field mandatory="true" name="ClickMaintainer"> |
874 | + <fieldcontrol class="QLineEdit" validator='^[^"]+$' |
875 | + defaulttext="" placeholdertext="Maintainer"/> |
876 | + <fielddescription>Maintainer:</fielddescription> |
877 | + </field> |
878 | + <field mandatory="true" name="ClickHookName"> |
879 | + <fieldcontrol class="QLineEdit" validator='^[A-Za-z0-9.-]+$' |
880 | + defaulttext="myapp" placeholdertext="app hook name"/> |
881 | + <fielddescription>App name:</fielddescription> |
882 | + </field> |
883 | + </fields> |
884 | + |
885 | +</wizard> |
886 | |
887 | === modified file 'share/qtcreator/ubuntu/devicespage/DevicePage.qml' |
888 | --- share/qtcreator/ubuntu/devicespage/DevicePage.qml 2014-10-10 07:46:06 +0000 |
889 | +++ share/qtcreator/ubuntu/devicespage/DevicePage.qml 2014-10-17 09:54:16 +0000 |
890 | @@ -143,7 +143,13 @@ |
891 | text: i18n.tr("Add Emulator") |
892 | tooltip: text |
893 | iconSource: "qrc:/ubuntu/images/list-add.svg" |
894 | - onClicked: PopupUtils.open(resourceRoot+"/NewEmulatorDialog.qml",devicePage); |
895 | + onClicked: { |
896 | + if(!devicesModel.emulatorInstalled){ |
897 | + PopupUtils.open(resourceRoot+"/EmulatorNotInstalled.qml",devicePage); |
898 | + return; |
899 | + } |
900 | + PopupUtils.open(resourceRoot+"/NewEmulatorDialog.qml",devicePage); |
901 | + } |
902 | } |
903 | |
904 | Connections{ |
905 | |
906 | === added file 'share/qtcreator/ubuntu/devicespage/EmulatorNotInstalled.qml' |
907 | --- share/qtcreator/ubuntu/devicespage/EmulatorNotInstalled.qml 1970-01-01 00:00:00 +0000 |
908 | +++ share/qtcreator/ubuntu/devicespage/EmulatorNotInstalled.qml 2014-10-17 09:54:16 +0000 |
909 | @@ -0,0 +1,46 @@ |
910 | +import QtQuick 2.0 |
911 | +import Ubuntu.Components 1.0 |
912 | +import Ubuntu.Components.ListItems 1.0 as ListItem |
913 | +import Ubuntu.Components.Popups 1.0 |
914 | + |
915 | +Popover { |
916 | + id: popover |
917 | + height: containerLayout.childrenRect.height |
918 | + Column { |
919 | + id: containerLayout |
920 | + anchors { |
921 | + left: parent.left |
922 | + top: parent.top |
923 | + right: parent.right |
924 | + } |
925 | + ListItem.Header { |
926 | + text: "Ubuntu Emulator is not installed" |
927 | + __foregroundColor: UbuntuColors.orange |
928 | + |
929 | + } |
930 | + ListItem.Empty { |
931 | + showDivider: false |
932 | + Label { |
933 | + anchors.fill: parent |
934 | + anchors.margins: units.gu(2) |
935 | + text: "Install the emulator package \"ubuntu-emulator\" in order to create emulator instances." |
936 | + wrapMode: Text.Wrap |
937 | + } |
938 | + } |
939 | + //add a spacer item |
940 | + Item { |
941 | + height: units.gu(2) |
942 | + width: units.gu(1) |
943 | + } |
944 | + ListItem.SingleControl { |
945 | + highlightWhenPressed: false |
946 | + control: Button { |
947 | + text: "Close" |
948 | + anchors { |
949 | + margins: units.gu(1) |
950 | + } |
951 | + onClicked: PopupUtils.close(popover) |
952 | + } |
953 | + } |
954 | + } |
955 | +} |
956 | |
957 | === modified file 'share/qtcreator/ubuntu/scripts/functions.inc' |
958 | --- share/qtcreator/ubuntu/scripts/functions.inc 2014-09-03 09:33:04 +0000 |
959 | +++ share/qtcreator/ubuntu/scripts/functions.inc 2014-10-17 09:54:16 +0000 |
960 | @@ -15,7 +15,9 @@ |
961 | # |
962 | # Author: Juhapekka Piiroinen <juhapekka.piiroinen@canonical.com> |
963 | |
964 | -echo $0 >> /tmp/sdk.logs |
965 | +# prefix the logs with the username, so this does not clash on a multiuser machine |
966 | +# Bug lp:1371807 |
967 | +echo $0 >> /tmp/${USER}_sdk.logs |
968 | |
969 | set -e |
970 | |
971 | |
972 | === modified file 'src/ubuntu/ubuntu.pro' |
973 | --- src/ubuntu/ubuntu.pro 2014-10-08 10:06:04 +0000 |
974 | +++ src/ubuntu/ubuntu.pro 2014-10-17 09:54:16 +0000 |
975 | @@ -44,7 +44,8 @@ |
976 | $$QML_ROOT/devicespage/NewEmulatorDialog.qml \ |
977 | $$QML_ROOT/devicespage/DeleteEmulatorDialog.qml \ |
978 | $$QML_ROOT/devicespage/ScrollableView.qml \ |
979 | - $$QML_ROOT/devicespage/SectionItem.qml |
980 | + $$QML_ROOT/devicespage/SectionItem.qml \ |
981 | + $$QML_ROOT/devicespage/EmulatorNotInstalled.qml |
982 | |
983 | OTHER_FILES += \ |
984 | UbuntuProject.mimetypes.xml \ |
985 | |
986 | === modified file 'src/ubuntu/ubuntuconstants.h' |
987 | --- src/ubuntu/ubuntuconstants.h 2014-10-06 16:53:25 +0000 |
988 | +++ src/ubuntu/ubuntuconstants.h 2014-10-17 09:54:16 +0000 |
989 | @@ -450,9 +450,9 @@ |
990 | //const char UBUNTUSETTINGSCLICKWIDGET_FILEDIALOG[] = "Location of click-reviewers-tools"; |
991 | |
992 | //review tools |
993 | -const char CLICK_REVIEWERSTOOLS_BINARY[] = "/usr/bin/click-run-checks"; |
994 | -const char CLICK_REVIEWERSTOOLS_ARGS[] = "\"%0\""; |
995 | -const char CLICK_REVIEWERSTOOLS_LOCATION[] = "/usr/bin/click-run-checks \"%0\""; |
996 | +const char CLICK_REVIEWERSTOOLS_BINARY[] = "/usr/bin/click-review"; |
997 | +const char CLICK_REVIEWERSTOOLS_ARGS[] = "--sdk \"%0\""; |
998 | +const char CLICK_REVIEWERSTOOLS_LOCATION[] = "/usr/bin/click-review --sdk \"%0\""; |
999 | |
1000 | //build configuration |
1001 | const char UBUNTU_CLICK_BUILD_CONTEXTMENU_ID[] = "UbuntuProjectManager.RunClickBuildContextMenu"; |
1002 | |
1003 | === modified file 'src/ubuntu/ubuntupackagingwidget.cpp' |
1004 | --- src/ubuntu/ubuntupackagingwidget.cpp 2014-09-30 15:44:15 +0000 |
1005 | +++ src/ubuntu/ubuntupackagingwidget.cpp 2014-10-17 09:54:16 +0000 |
1006 | @@ -191,7 +191,7 @@ |
1007 | else |
1008 | m_inputParser->emitTextItem(QLatin1String("Command failed"),cmd,ClickRunChecksParser::Error); |
1009 | if (cmd == QString::fromLatin1(Constants::UBUNTUWIDGETS_ONFINISHED_SCRIPT_LOCAL_PACKAGE_INSTALLED).arg(Ubuntu::Constants::UBUNTU_SCRIPTPATH)) { |
1010 | - m_validationModel->clear(); |
1011 | + resetValidationResult(); |
1012 | QStringList lines = m_reply.trimmed().split(QLatin1String(Constants::LINEFEED)); |
1013 | foreach(QString line, lines) { |
1014 | line = line.trimmed(); |
1015 | @@ -228,7 +228,7 @@ |
1016 | } |
1017 | |
1018 | void UbuntuPackagingWidget::onStarted(QString cmd) { |
1019 | - m_validationModel->clear(); |
1020 | + resetValidationResult(); |
1021 | m_inputParser->emitTextItem(QLatin1String("Start Command"),cmd,ClickRunChecksParser::NoIcon); |
1022 | } |
1023 | |
1024 | @@ -453,3 +453,10 @@ |
1025 | m_packageBuildSteps->deleteLater(); |
1026 | m_packageBuildSteps.clear(); |
1027 | } |
1028 | + |
1029 | +void UbuntuPackagingWidget::resetValidationResult() |
1030 | +{ |
1031 | + m_validationModel->clear(); |
1032 | + ui->plainTextEditDescription->clear(); |
1033 | + ui->labelErrorType->clear(); |
1034 | +} |
1035 | |
1036 | === modified file 'src/ubuntu/ubuntupackagingwidget.h' |
1037 | --- src/ubuntu/ubuntupackagingwidget.h 2014-08-19 10:11:23 +0000 |
1038 | +++ src/ubuntu/ubuntupackagingwidget.h 2014-10-17 09:54:16 +0000 |
1039 | @@ -85,6 +85,7 @@ |
1040 | void buildClickPackage (); |
1041 | void clearPackageBuildList (); |
1042 | void updateFrameworkList (); |
1043 | + void resetValidationResult (); |
1044 | |
1045 | private: |
1046 | bool m_reviewToolsInstalled; |
1047 | |
1048 | === modified file 'src/ubuntu/ubuntuvalidationresultmodel.cpp' |
1049 | --- src/ubuntu/ubuntuvalidationresultmodel.cpp 2014-08-27 13:30:36 +0000 |
1050 | +++ src/ubuntu/ubuntuvalidationresultmodel.cpp 2014-10-17 09:54:16 +0000 |
1051 | @@ -317,6 +317,8 @@ |
1052 | type.remove(QLatin1String("=")); |
1053 | type = type.trimmed(); |
1054 | |
1055 | + parseJsonSection(type,startOffset,(endOffset-startOffset)+1); |
1056 | + /* |
1057 | static const QRegularExpression regExp(QStringLiteral("^(click-check-.*)")); |
1058 | if(regExp.match(type).hasMatch()) { |
1059 | parseJsonSection(type,startOffset,(endOffset-startOffset)+1); |
1060 | @@ -324,6 +326,7 @@ |
1061 | //ignore unknown sections |
1062 | return true; |
1063 | } |
1064 | + */ |
1065 | |
1066 | return true; |
1067 | } |
1068 | |
1069 | === modified file 'tests/validation/fulloutput.json' |
1070 | --- tests/validation/fulloutput.json 2014-05-16 07:35:13 +0000 |
1071 | +++ tests/validation/fulloutput.json 2014-10-17 09:54:16 +0000 |
1072 | @@ -1,68 +1,4 @@ |
1073 | -= control = |
1074 | -Package: com.ubuntu.developer.johndoe.test1 |
1075 | -Version: 0.1 |
1076 | -Click-Version: 0.4 |
1077 | -Architecture: all |
1078 | -Maintainer: John Doe <john.doe@nowhere.com> |
1079 | -Installed-Size: 597 |
1080 | -Description: test1 |
1081 | - |
1082 | -= manifest = |
1083 | -{ |
1084 | - "architecture": "all", |
1085 | - "description": "description of test1", |
1086 | - "framework": "ubuntu-sdk-14.04-qml-dev1", |
1087 | - "hooks": { |
1088 | - "test1": { |
1089 | - "apparmor": "test1.json", |
1090 | - "desktop": "test1.desktop" |
1091 | - } |
1092 | - }, |
1093 | - "installed-size": "597", |
1094 | - "maintainer": "John Doe <john.doe@nowhere.com>", |
1095 | - "name": "com.ubuntu.developer.johndoe.test1", |
1096 | - "title": "test1", |
1097 | - "version": "0.1" |
1098 | -} |
1099 | - |
1100 | -= md5sums = |
1101 | -6183b7c10f505338a31eef33de5ec257 test1.desktop |
1102 | -960a76e339316360b6dcc5011702b21e test1.json |
1103 | -940ee629a1cce1a2d48335c76d4d25cd graphics/toolbarIcon@8.png |
1104 | -3019fd68af22d99d10c161730f30422b lib/arm-linux-gnueabihf/qt5/qml/test1/libtest1backend.so |
1105 | -8277ab683992b219f4f886740b8a547a lib/arm-linux-gnueabihf/qt5/qml/test1/qmldir |
1106 | -2d093965abbe7cf897cb4595f937c796 share/qml/test1/test1.qml |
1107 | -e98c1a563ab054328797b24111b6152a share/qml/test1/components/HelloComponent.qml |
1108 | -62a85a47736ae719fa9c7385fc3cbaf1 share/qml/test1/ui/HelloTab.qml |
1109 | -38a06f12ecddec945892ff18c9a02026 share/qml/test1/ui/WorldTab.qml |
1110 | -142c5df78d0538ac6c56f31521466808 share/qml/test1/ui/WorldTabTools.qml |
1111 | - |
1112 | -= preinst = |
1113 | -#! /bin/sh |
1114 | -echo "Click packages may not be installed directly using dpkg." |
1115 | -echo "Use 'click install' instead." |
1116 | -exit 1 |
1117 | - |
1118 | -= hooks = |
1119 | -== security: test1.json == |
1120 | -{ |
1121 | - "policy_groups": [ |
1122 | - "networking" |
1123 | - ], |
1124 | - "policy_version": 1.1 |
1125 | -} |
1126 | -== desktop: test1.desktop == |
1127 | -[Desktop Entry] |
1128 | -Name=test1 |
1129 | -Comment=My project description |
1130 | -Exec=qmlscene $@ -I ./lib/arm-linux-gnueabihf/qt5/qml share/qml/test1/test1.qml |
1131 | -Icon=.//grapics/toolbarIcon@8.png |
1132 | -Terminal=false |
1133 | -Type=Application |
1134 | -X-Ubuntu-Touch=true |
1135 | - |
1136 | - |
1137 | -= click-check-lint = |
1138 | += lint = |
1139 | { |
1140 | "error": { |
1141 | "lint_error": { |
1142 | @@ -83,7 +19,7 @@ |
1143 | "warn": {} |
1144 | } |
1145 | |
1146 | -= click-check-desktop = |
1147 | += desktop = |
1148 | { |
1149 | "error": { |
1150 | "desktop_error (test1)": { |
1151 | @@ -104,7 +40,7 @@ |
1152 | } |
1153 | } |
1154 | |
1155 | -= click-check-security = |
1156 | += security = |
1157 | { |
1158 | "error": {}, |
1159 | "info": { |
1160 | @@ -121,7 +57,7 @@ |
1161 | "warn": {} |
1162 | } |
1163 | |
1164 | -= click-check-functional = |
1165 | += functional = |
1166 | { |
1167 | "error": {}, |
1168 | "info": { |
1169 | @@ -137,7 +73,3 @@ |
1170 | }, |
1171 | "warn": {} |
1172 | } |
1173 | - |
1174 | - |
1175 | -** Errors found ** |
1176 | -com.ubuntu.developer.johndoe.test1_0.1_all.click: FAIL |
1177 | |
1178 | === modified file 'tests/validation/simplesection.json' |
1179 | --- tests/validation/simplesection.json 2014-05-16 07:50:59 +0000 |
1180 | +++ tests/validation/simplesection.json 2014-10-17 09:54:16 +0000 |
1181 | @@ -1,4 +1,4 @@ |
1182 | -= click-check-functional = |
1183 | += functional = |
1184 | { |
1185 | "error": { |
1186 | "error1": { |
1187 | |
1188 | === modified file 'tests/validation/tst_validation.cpp' |
1189 | --- tests/validation/tst_validation.cpp 2014-05-16 11:43:27 +0000 |
1190 | +++ tests/validation/tst_validation.cpp 2014-10-17 09:54:16 +0000 |
1191 | @@ -50,7 +50,7 @@ |
1192 | parser.endRecieveData(); |
1193 | |
1194 | QVERIFY(items.length() == 1); |
1195 | - VERIFY_ITEM(items[0],QString("click-check-functional"),QString("No description"),ClickRunChecksParser::Error,5); |
1196 | + VERIFY_ITEM(items[0],QString("functional"),QString("No description"),ClickRunChecksParser::Error,5); |
1197 | VERIFY_ITEM(items[0]->children[0],QString("error1"),QString("Error text"),ClickRunChecksParser::Error,0); |
1198 | QCOMPARE(items[0]->children[0]->link,QUrl("http://somelink.com")); |
1199 | VERIFY_ITEM(items[0]->children[1],QString("warning1"),QString("Warning message"),ClickRunChecksParser::Warning,0); |
1200 | @@ -65,7 +65,7 @@ |
1201 | |
1202 | void tst_Validation::testFullOutputLint(ClickRunChecksParser::DataItem *item, bool *passed) |
1203 | { |
1204 | - VERIFY_ITEM(item,QString("click-check-lint"),QString("No description"),ClickRunChecksParser::Error,4); |
1205 | + VERIFY_ITEM(item,QString("lint"),QString("No description"),ClickRunChecksParser::Error,4); |
1206 | VERIFY_ITEM(item->children[0],QString("lint_error"),QString("errorText"),ClickRunChecksParser::Error,0); |
1207 | VERIFY_ITEM(item->children[1],QString("lint_info1"),QString("OK"),ClickRunChecksParser::Check,0); |
1208 | VERIFY_ITEM(item->children[2],QString("lint_info2"),QString("OK"),ClickRunChecksParser::Check,0); |
1209 | @@ -75,7 +75,7 @@ |
1210 | |
1211 | void tst_Validation::testFullOutputDesktop(ClickRunChecksParser::DataItem *item, bool *passed) |
1212 | { |
1213 | - VERIFY_ITEM(item,QString("click-check-desktop"),QString("No description"),ClickRunChecksParser::Error,3); |
1214 | + VERIFY_ITEM(item,QString("desktop"),QString("No description"),ClickRunChecksParser::Error,3); |
1215 | VERIFY_ITEM(item->children[0],QString("desktop_error (test1)"),QString("Error text for desktop file"),ClickRunChecksParser::Error,0); |
1216 | QCOMPARE(item->children[0]->link,QUrl("http://somelink.com")); |
1217 | VERIFY_ITEM(item->children[1],QString("desktop_warn (test1)"),QString("Warning text for desktop file"),ClickRunChecksParser::Warning,0); |
1218 | @@ -86,7 +86,7 @@ |
1219 | |
1220 | void tst_Validation::testFullOutputSecurity(ClickRunChecksParser::DataItem *item, bool *passed) |
1221 | { |
1222 | - VERIFY_ITEM(item,QString("click-check-security"),QString("No description"),ClickRunChecksParser::Check,3); |
1223 | + VERIFY_ITEM(item,QString("security"),QString("No description"),ClickRunChecksParser::Check,3); |
1224 | VERIFY_ITEM(item->children[0],QString("security_test1 (test.json)"),QString("OK"),ClickRunChecksParser::Check,0); |
1225 | VERIFY_ITEM(item->children[1],QString("security_test2 (test.json)"),QString("OK"),ClickRunChecksParser::Check,0); |
1226 | VERIFY_ITEM(item->children[2],QString("security_test3 (test.json)"),QString("OK"),ClickRunChecksParser::Check,0); |
1227 | @@ -95,7 +95,7 @@ |
1228 | |
1229 | void tst_Validation::testFullOutputFunctional(ClickRunChecksParser::DataItem *item, bool *passed) |
1230 | { |
1231 | - VERIFY_ITEM(item,QString("click-check-functional"),QString("No description"),ClickRunChecksParser::Check,3); |
1232 | + VERIFY_ITEM(item,QString("functional"),QString("No description"),ClickRunChecksParser::Check,3); |
1233 | VERIFY_ITEM(item->children[0],QString("functional_test1"),QString("OK"),ClickRunChecksParser::Check,0); |
1234 | VERIFY_ITEM(item->children[1],QString("functional_test2"),QString("OK"),ClickRunChecksParser::Check,0); |
1235 | VERIFY_ITEM(item->children[2],QString("functional_test3"),QString("OK"),ClickRunChecksParser::Check,0); |
1236 | @@ -170,15 +170,8 @@ |
1237 | QTextStream in(&sourceFile); |
1238 | QString input = in.readAll(); |
1239 | |
1240 | - int offset = input.indexOf("= click-check-lint ="); |
1241 | - parser.beginRecieveData(input.left(offset)); |
1242 | - input = input.mid(offset); |
1243 | - |
1244 | - //until now only unrelevant sections have been parsed |
1245 | - QCOMPARE(items.length(),0); |
1246 | - |
1247 | //parse to somewhere in the middle of a section |
1248 | - offset = input.indexOf("info",input.indexOf("= click-check-desktop =")); |
1249 | + int offset = input.indexOf("info",input.indexOf("= desktop =")); |
1250 | parser.addRecievedData(input.left(offset)); |
1251 | input = input.mid(offset); |
1252 | |
1253 | @@ -193,7 +186,7 @@ |
1254 | * Add the beginning of the next section so the |
1255 | * parser knows where the last one ends |
1256 | */ |
1257 | - QString functionalSectionStart("= click-check-functional ="); |
1258 | + QString functionalSectionStart("= functional ="); |
1259 | offset = input.indexOf(functionalSectionStart)+functionalSectionStart.length(); |
1260 | parser.addRecievedData(input.left(offset)); |
1261 | input = input.mid(offset); |
PASSED: Continuous integration, rev:286 jenkins. qa.ubuntu. com/job/ qtcreator- plugin- ubuntu- ci/448/ jenkins. qa.ubuntu. com/job/ qtcreator- plugin- ubuntu- utopic- amd64-ci/ 216 jenkins. qa.ubuntu. com/job/ qtcreator- plugin- ubuntu- utopic- armhf-ci/ 216
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/qtcreator- plugin- ubuntu- ci/448/ rebuild
http://