Merge lp:~kalikiana/u1db-qt/gallery2 into lp:u1db-qt

Proposed by Cris Dywan
Status: Merged
Approved by: Cris Dywan
Approved revision: 79
Merged at revision: 73
Proposed branch: lp:~kalikiana/u1db-qt/gallery2
Merge into: lp:u1db-qt
Diff against target: 255 lines (+169/-7)
9 files modified
CMakeLists.txt (+32/-6)
debian/control (+12/-0)
debian/libu1db-qt5-doc.install (+2/-0)
debian/libu1db-qt5-examples.install (+2/-0)
debian/rules (+1/-1)
gallery/CMakeLists.txt (+8/-0)
gallery/SplitView.qml (+59/-0)
gallery/gallery.qml (+44/-0)
gallery/u1db-qt-gallery.desktop (+9/-0)
To merge this branch: bzr merge lp:~kalikiana/u1db-qt/gallery2
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Cris Dywan Approve
Review via email: mp+160052@code.launchpad.net

This proposal supersedes a proposal from 2013-04-18.

Commit message

Implement tabbed example gallery and install to example package

Description of the change

Implement tabbed example gallery and install to example package

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) :
review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

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 2013-04-12 13:36:54 +0000
3+++ CMakeLists.txt 2013-04-22 09:55:31 +0000
4@@ -70,16 +70,24 @@
5
6 # Unit-Test
7 enable_testing()
8-
9 add_custom_target(check COMMAND "env" "CTEST_OUTPUT_ON_FAILURE=1" "${CMAKE_CTEST_COMMAND}")
10-add_custom_target(doc "qdoc" "u1db.qdocconf"
11- COMMAND "sed" "-r" "-i" "'s@(</head>)@<link rel=\"stylesheet\" type=\"text/css\" href=\"style/base.css\" />\\1@'" "./output/html/*.html"
12- COMMAND "qhelpgenerator" "./output/html/u1dbqt.qhp"
13- COMMAND "assistant" "-register" "./output/html/u1dbqt.qch"
14- WORKING_DIRECTORY "documentation")
15+
16+option(BUILD_DOCS "Build documentation" OFF)
17+if (BUILD_DOCS)
18+ set(ALL "ALL")
19+endif ()
20+set(U1DB_DOCS "${PROJECT_BINARY_DIR}/documentation/output")
21+add_custom_target(doc ${ALL} "mkdir" "-p" "${U1DB_DOCS}"
22+ COMMAND "qdoc" "-outputdir" "${U1DB_DOCS}" "${CMAKE_SOURCE_DIR}/documentation/u1db.qdocconf" "1>/dev/null" "2>/dev/null"
23+ COMMAND "sed" "-r" "-i" "'s@(</head>)@<link rel=\"stylesheet\" type=\"text/css\" href=\"style/base.css\" />\\1@'" "${U1DB_DOCS}/*.html"
24+ COMMAND "qhelpgenerator" "${U1DB_DOCS}/u1dbqt.qhp"
25+ COMMAND "assistant" "-register" "${U1DB_DOCS}/u1dbqt.qch"
26+ SOURCES "${CMAKE_SOURCE_DIR}/documentation/u1db.qdocconf"
27+ WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/documentation")
28 add_subdirectory(modules)
29 add_subdirectory(tests)
30 add_subdirectory(examples)
31+add_subdirectory(gallery)
32
33 # Install
34 set(INCLUDE_INSTALL_DIR include/lib${U1DB_QT_LIBNAME})
35@@ -88,6 +96,24 @@
36 LIBRARY DESTINATION lib${LIB_SUFFIX}
37 )
38
39+if (BUILD_DOCS)
40+ install(FILES "${U1DB_DOCS}/u1dbqt.qch"
41+ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/qt5/phrasebooks/"
42+ )
43+ file(GLOB ALL_HTML ${U1DB_DOCS}/*.html)
44+ install(FILES ${ALL_HTML}
45+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/u1db-qt/doc/html
46+ )
47+ install(DIRECTORY "${U1DB_DOCS}/style"
48+ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/u1db-qt/doc/html"
49+ )
50+ file(GLOB ALL_EXAMPLES ${U1DB_DOCS}/*example-*.html)
51+ install(FILES ${ALL_EXAMPLES}
52+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/u1db-qt/examples
53+ )
54+endif ()
55+
56+
57 install(FILES src/global.h src/database.h src/document.h src/index.h src/query.h
58 DESTINATION ${INCLUDE_INSTALL_DIR}
59 )
60
61=== modified file 'debian/control'
62--- debian/control 2013-04-12 13:52:00 +0000
63+++ debian/control 2013-04-22 09:55:31 +0000
64@@ -11,6 +11,7 @@
65 qtdeclarative5-test-plugin,
66 qtdeclarative5-qtquick2-plugin,
67 libqt5sql5-sqlite,
68+ qttools5-dev-tools,
69 qtdeclarative5-dev-tools
70 Standards-Version: 3.9.3
71 Vcs-Bzr: https://launchpad.net/u1db-qt/trunk
72@@ -46,3 +47,14 @@
73 .
74 This package contains the examples demonstrating the use of the Qt binding for U1DB
75
76+Package: libu1db-qt5-doc
77+Section: doc
78+Architecture: all
79+Depends: ${misc:Depends},
80+ libu1db-qt5-1 (= ${binary:Version}),
81+ qttools5-dev-tools
82+Description: Qt5 binding and QtQuick2 plugin for U1DB - offline documentation
83+ Simple Qt5 binding and QtQuick2 plugin for U1DB (https://launchpad.net/u1db).
84+ .
85+ This package contains the offline documentation for the Qt binding for U1DB
86+
87
88=== added file 'debian/libu1db-qt5-doc.install'
89--- debian/libu1db-qt5-doc.install 1970-01-01 00:00:00 +0000
90+++ debian/libu1db-qt5-doc.install 2013-04-22 09:55:31 +0000
91@@ -0,0 +1,2 @@
92+usr/share/qt5/phrasebooks/*
93+usr/share/u1db-qt/doc/html/*
94
95=== modified file 'debian/libu1db-qt5-examples.install'
96--- debian/libu1db-qt5-examples.install 2013-04-12 13:52:00 +0000
97+++ debian/libu1db-qt5-examples.install 2013-04-22 09:55:31 +0000
98@@ -1,1 +1,3 @@
99 usr/share/u1db-qt/examples/*.qml
100+usr/share/u1db-qt/gallery/*.qml
101+usr/share/applications/u1db-qt-gallery.desktop
102
103=== modified file 'debian/rules'
104--- debian/rules 2013-04-09 11:32:11 +0000
105+++ debian/rules 2013-04-22 09:55:31 +0000
106@@ -12,7 +12,7 @@
107 override_dh_auto_configure:
108 PATH=/opt/qt5/bin:$(PATH) \
109 dh_auto_configure -- -DCMAKE_MODULE_PATH=/opt/qt5/lib/cmake \
110- -DLD_LIBRARY_PATH=/opt/qt5/lib:$(LD_LIBRARY_PATH)
111+ -DLD_LIBRARY_PATH=/opt/qt5/lib:$(LD_LIBRARY_PATH) -DBUILD_DOCS=ON
112
113 override_dh_auto_build:
114 dh_auto_build
115
116=== added directory 'gallery'
117=== added file 'gallery/CMakeLists.txt'
118--- gallery/CMakeLists.txt 1970-01-01 00:00:00 +0000
119+++ gallery/CMakeLists.txt 2013-04-22 09:55:31 +0000
120@@ -0,0 +1,8 @@
121+install(FILES gallery.qml SplitView.qml
122+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/u1db-qt/gallery
123+ )
124+
125+install(FILES u1db-qt-gallery.desktop
126+ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
127+ )
128+
129
130=== added file 'gallery/SplitView.qml'
131--- gallery/SplitView.qml 1970-01-01 00:00:00 +0000
132+++ gallery/SplitView.qml 2013-04-22 09:55:31 +0000
133@@ -0,0 +1,59 @@
134+/*
135+ * Copyright (C) 2013 Canonical, Ltd.
136+ *
137+ * Authors:
138+ * Christian Dywan <christian.dywan@canonical.com>
139+ *
140+ * This program is free software; you can redistribute it and/or modify
141+ * it under the terms of the GNU Lesser General Public License as published by
142+ * the Free Software Foundation; version 3.
143+ *
144+ * This program is distributed in the hope that it will be useful,
145+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
146+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
147+ * GNU Lesser General Public License for more details.
148+ *
149+ * You should have received a copy of the GNU Lesser General Public License
150+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
151+ */
152+
153+import QtQuick 2.0
154+import U1db 1.0 as U1db
155+import Ubuntu.Components 0.1
156+import QtWebKit 3.0
157+import QtWebKit.experimental 1.0
158+
159+Tab {
160+ id: exampleView
161+ property string example
162+ title: "Example %1".arg(example)
163+ Row {
164+ id: splitView
165+ property string qml: Qt.resolvedUrl('../examples/u1db-qt-example-%1.qml'.arg(example))
166+ property string html: 'file:////usr/share/u1db-qt/examples/u1db-qt-example-%1.html'.arg(example)
167+ anchors.fill: parent
168+ Loader {
169+ width: parent.width / 3
170+ source: splitView.qml
171+ asynchronous: true
172+ }
173+ // TODO: syntax highlighting
174+ // FIXME: switching tabs with web views may crash lp#1124065
175+ WebView {
176+ width: parent.width / 3
177+ height: parent.height
178+ url: splitView.qml
179+ // FIXME: default font size is extremely small lp#1169989
180+ experimental.preferences.minimumFontSize: units.dp(24)
181+ }
182+ WebView {
183+ width: parent.width / 3
184+ height: parent.height
185+ url: splitView.html
186+ experimental.preferences.minimumFontSize: units.dp(24)
187+ // TODO: open help browser onNavigationRequested: { url }
188+ }
189+ }
190+}
191+
192+
193
194=== added file 'gallery/gallery.qml'
195--- gallery/gallery.qml 1970-01-01 00:00:00 +0000
196+++ gallery/gallery.qml 2013-04-22 09:55:31 +0000
197@@ -0,0 +1,44 @@
198+/*
199+ * Copyright (C) 2013 Canonical, Ltd.
200+ *
201+ * Authors:
202+ * Christian Dywan <christian.dywan@canonical.com>
203+ *
204+ * This program is free software; you can redistribute it and/or modify
205+ * it under the terms of the GNU Lesser General Public License as published by
206+ * the Free Software Foundation; version 3.
207+ *
208+ * This program is distributed in the hope that it will be useful,
209+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
210+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
211+ * GNU Lesser General Public License for more details.
212+ *
213+ * You should have received a copy of the GNU Lesser General Public License
214+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
215+ */
216+
217+import QtQuick 2.0
218+import Ubuntu.Components 0.1
219+
220+MainView {
221+ width: units.gu(60)
222+ height: units.gu(80)
223+
224+ Page {
225+ Tabs {
226+ /* FIXME: lp#1167568 Repeater {
227+ model: ["1", "2", "2b", "3", "4", "5"]
228+ SplitView {
229+ example: modelData
230+ }
231+ } */
232+ SplitView { example: "1" }
233+ SplitView { example: "2" }
234+ SplitView { example: "2b" }
235+ SplitView { example: "3" }
236+ SplitView { example: "4" }
237+ SplitView { example: "5" }
238+ }
239+ }
240+}
241+
242
243=== added file 'gallery/u1db-qt-gallery.desktop'
244--- gallery/u1db-qt-gallery.desktop 1970-01-01 00:00:00 +0000
245+++ gallery/u1db-qt-gallery.desktop 2013-04-22 09:55:31 +0000
246@@ -0,0 +1,9 @@
247+[Desktop Entry]
248+Encoding=UTF-8
249+Type=Application
250+Exec=qmlscene /usr/share/u1db-qt/gallery/gallery.qml
251+Path=/usr/share/u1db-qt/gallery
252+Name=U1Db QML Example Gallery
253+Icon=/usr/share/icons/unity-icon-theme/places/svg/service-u1.svg
254+Terminal=false
255+

Subscribers

People subscribed via source and target branches

to all changes: