Merge lp:~verzegnassi-stefano/logviewer/logviewer into lp:logviewer

Proposed by Michael Zanetti
Status: Merged
Approved by: Victor Tuson Palau
Approved revision: 14
Merged at revision: 8
Proposed branch: lp:~verzegnassi-stefano/logviewer/logviewer
Merge into: lp:logviewer
Diff against target: 1539 lines (+722/-474)
14 files modified
CMakeLists.txt (+44/-24)
app/CMakeLists.txt (+4/-5)
app/Main.qml (+74/-193)
app/logviewer.desktop.in (+1/-1)
app/ui/AboutPage.qml (+37/-30)
app/ui/LogPage.qml (+145/-135)
app/ui/MainPage.qml (+107/-0)
app/ui/PrefPage.qml (+86/-73)
backend/CMakeLists.txt (+3/-0)
backend/tests/unit/tst_mytype.qml (+2/-2)
logviewer.apparmor (+2/-2)
manifest.json.in (+11/-9)
po/CMakeLists.txt (+63/-0)
po/com.ubuntu.developer.vtuson.logviewer.pot (+143/-0)
To merge this branch: bzr merge lp:~verzegnassi-stefano/logviewer/logviewer
Reviewer Review Type Date Requested Status
Victor Tuson Palau Approve
Review via email: mp+297934@code.launchpad.net

Commit message

Maintenance update (by Stefano Verzegnassi)

* Update to latest UITK components
* Rework build system to allow building with the Ubuntu SDK

Description of the change

By Stefano Verzegnassi
    * Fixed icon path
    * Removed TextArea frame spacing
    * Use latest version of QML components
    * Removed usage of deprecated components (e.g. Ubuntu.Components.ListItems.*)
    * Added .pot template
    * General code refactor. Only 'autoscroll' is currently missing.
    * Text size now uses FontUtils (i.e. does not depend on screen density anymore)
    * Refactored CMake project. Now it can be built with the latest Ubuntu IDE.

To post a comment you must log in.
12. By Stefano Verzegnassi

Restore proper values in the .desktop file

13. By Stefano Verzegnassi

No chance to get the informations about the internal flickable of a UITK TextArea.
Revert to the 'old' QML TextEdit, apply some style and re-introduce the autoscroll.

14. By Stefano Verzegnassi

Updated .pot

Revision history for this message
Victor Tuson Palau (vtuson) :
review: Approve

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-25 11:10:28 +0000
3+++ CMakeLists.txt 2016-06-20 17:01:33 +0000
4@@ -1,56 +1,76 @@
5 project(logviewer C CXX)
6 cmake_minimum_required(VERSION 2.8.9)
7
8-set (UBUNTU_PROJECT_TYPE "ClickApp" CACHE INTERNAL "Tells QtCreator this is a Click application project")
9+# Do not remove this line, its required for the correct functionality of the Ubuntu-SDK
10+set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Tells QtCreator location and name of the manifest file")
11 set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
12
13 find_package(Qt5Core)
14 find_package(Qt5Qml)
15 find_package(Qt5Quick)
16-#find_package(ubuntu-sdk-libs)
17+# find_package(ubuntu-sdk-libs)
18
19-#automatically create moc files
20+# Automatically create moc files
21 set(CMAKE_AUTOMOC ON)
22
23-# components PATH
24+# Components PATH
25 execute_process(
26 COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
27 OUTPUT_VARIABLE ARCH_TRIPLET
28 OUTPUT_STRIP_TRAILING_WHITESPACE
29 )
30+
31 set(QT_IMPORTS_DIR "lib/${ARCH_TRIPLET}")
32
33 option(INSTALL_TESTS "Install the tests on make install" on)
34
35 set(APP_NAME logviewer)
36-set(LOGVIEWER_DIR "app")
37-set(MAIN_QML "logviewer.qml")
38-set(ICON "icon.png")
39+set(APP_ID "com.ubuntu.developer.vtuson.logviewer")
40+set(LOGVIEWER_DIR "share/qml/logviewer")
41+set(MAIN_QML "Main.qml")
42+set(ICON "${LOGVIEWER_DIR}/graphics/logviewer.png")
43
44-#set install paths
45+# Set install paths
46 set(CMAKE_INSTALL_PREFIX /)
47 set(DATA_DIR /)
48 set(DESKTOP_DIR ${DATA_DIR})
49-
50-set(EXEC "qmlscene $@ ${LOGVIEWER_DIR}/${MAIN_QML}")
51-
52-install(FILES manifest.json DESTINATION ${CMAKE_INSTALL_PREFIX})
53-install(DIRECTORY "app/graphics" DESTINATION ${DATA_DIR})
54-install(FILES "Logviewer.json" ${ICON} DESTINATION ${DATA_DIR})
55+set(DESKTOP_FILE_NAME "logviewer.desktop")
56+
57+set(EXEC "qmlscene %U ${LOGVIEWER_DIR}/${MAIN_QML}")
58+
59+# This command figures out the target architecture for use in the manifest file
60+execute_process(
61+ COMMAND dpkg-architecture -qDEB_HOST_ARCH
62+ OUTPUT_VARIABLE CLICK_ARCH
63+ OUTPUT_STRIP_TRAILING_WHITESPACE
64+)
65+
66+configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json)
67+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json
68+ DESTINATION ${CMAKE_INSTALL_PREFIX})
69+
70+install(DIRECTORY "app/graphics" DESTINATION ${LOGVIEWER_DIR})
71+install(FILES "logviewer.apparmor" DESTINATION ${DATA_DIR})
72
73 add_subdirectory(app)
74 add_subdirectory(backend)
75+add_subdirectory(po)
76
77 add_custom_target("autopilot" chmod +x ${CMAKE_SOURCE_DIR}/app/tests/autopilot/run
78 COMMAND ${CMAKE_SOURCE_DIR}/app/tests/autopilot/run
79- DEPENDS logviewerbackend logviewerbackend-qmldir
80- WORKING_DIRECTORY ./app)
81-
82-add_custom_target("check" /usr/bin/qmltestrunner -input ${CMAKE_SOURCE_DIR}/app/tests/unit -import ${CMAKE_BINARY_DIR}/backend
83- DEPENDS logviewerbackend logviewerbackend-qmldir
84- WORKING_DIRECTORY ./app)
85-
86-add_custom_target("run" /usr/bin/qmlscene -I ${CMAKE_BINARY_DIR}/backend ${CMAKE_SOURCE_DIR}/app/logviewer.qml
87- DEPENDS logviewerbackend logviewerbackend-qmldir
88- WORKING_DIRECTORY ./app)
89+ DEPENDS Logviewerbackend Logviewerbackend-qmldir
90+ WORKING_DIRECTORY ./app)
91+
92+add_custom_target("check"
93+ COMMAND /usr/bin/qmltestrunner -input ${CMAKE_SOURCE_DIR}/backend/tests/unit -import ${CMAKE_BINARY_DIR}/backend
94+ COMMAND /usr/bin/qmltestrunner -input ${CMAKE_SOURCE_DIR}/app/tests/unit -import ${CMAKE_BINARY_DIR}/backend
95+ DEPENDS Logviewerbackend Logviewerbackend-qmldir
96+ WORKING_DIRECTORY ./app)
97+
98+add_custom_target("run" /usr/bin/qmlscene -I ${CMAKE_BINARY_DIR}/backend ${CMAKE_SOURCE_DIR}/app/Main.qml
99+ DEPENDS Logviewerbackend Logviewerbackend-qmldir
100+ WORKING_DIRECTORY ./app)
101+
102+# No op custom target for all not compiled files, so they show up in the QtCreator project tree
103+add_custom_target("logviewer_ClickFiles" ALL SOURCES "logviewer.apparmor" "manifest.json.in")
104
105
106=== modified file 'app/CMakeLists.txt'
107--- app/CMakeLists.txt 2014-08-25 11:10:28 +0000
108+++ app/CMakeLists.txt 2016-06-20 17:01:33 +0000
109@@ -1,13 +1,12 @@
110 file(GLOB QML_JS_FILES *.qml *.js)
111
112-# make the files visible on qtcreator
113+# Make the files visible on qtcreator
114 add_custom_target(logviewer_QMlFiles ALL SOURCES ${QML_JS_FILES})
115
116-#substitute variables in the desktop file
117-set(DESKTOP_FILE "Logviewer.desktop")
118-configure_file(${DESKTOP_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE})
119+# Substitute variables in the desktop file
120+configure_file(${DESKTOP_FILE_NAME}.in ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME}.in)
121
122-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} DESTINATION ${DESKTOP_DIR})
123+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME} DESTINATION ${DESKTOP_DIR})
124 install(FILES ${QML_JS_FILES} DESTINATION ${LOGVIEWER_DIR})
125
126 add_subdirectory(ui)
127
128=== renamed file 'app/logviewer.qml' => 'app/Main.qml'
129--- app/logviewer.qml 2014-08-25 11:10:28 +0000
130+++ app/Main.qml 2016-06-20 17:01:33 +0000
131@@ -1,17 +1,14 @@
132-import QtQuick 2.0
133-import Ubuntu.Components 1.1
134-import "ui"
135-import "./libs/logviewer.js" as LogViewLib
136+import QtQuick 2.4
137+import Ubuntu.Components 1.3
138+import Qt.labs.settings 1.0
139 import Logviewer 1.0
140-import Ubuntu.Components.ListItems 1.0 as ListItem
141-import Qt.labs.settings 1.0
142-
143-
144
145 MainView {
146+ id: mainView
147+
148 // objectName for functional testing purposes (autopilot-qt5)
149 objectName: "mainView"
150- id:mainView
151+
152 // Note! applicationName needs to match the "name" field of the click manifest
153 applicationName: "com.ubuntu.developer.vtuson.logviewer"
154
155@@ -20,206 +17,90 @@
156 when the device is rotated. The default is false.
157 */
158 //automaticOrientation: true
159+ anchorToKeyboard: true
160
161 width: units.gu(100)
162 height: units.gu(75)
163
164- useDeprecatedToolbar: false
165- anchorToKeyboard: true
166+ Component.onCompleted: {
167+ pStack.push(Qt.resolvedUrl("ui/MainPage.qml"))
168+ }
169
170 Settings { //This will also save the settings as soon as this patch gets merged into the UI Toolkit trunk repo: https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1354321
171 id: preferences
172 property string dir: "/home/phablet/.cache/upstart/"
173 property string filter: "*.log"
174 property int buffer: 8000
175- property int fontSize: 24
176+ property int dpFontSize: 10
177 property string username: "Guest"
178 }
179
180+ ListModel {
181+ id:logsList
182+ property bool loading: false
183+ }
184+
185+ LogViewer {
186+ id:logs
187+ logDir: preferences.dir
188+ logFilter: preferences.filter
189+
190+ onLogListChanged: {
191+ logsList.loading = true
192+
193+ //this signal indicates that the directory files where loaded
194+ console.log("logs are: " + logs.logList)
195+
196+ //clear any old list
197+ logsList.clear()
198+
199+ var tmplogs= logs.logList;
200+ var alogs = {}
201+ alogs = tmplogs.split("\n")
202+ var itemtmp= {}
203+ for (var logitem in alogs){
204+ if(alogs[logitem].trim()!== "") {
205+ itemtmp["iLogPath"] =alogs[logitem]
206+ logsList.append(itemtmp)
207+ }
208+ }
209+
210+ logsList.loading = false
211+ }
212+
213+ Component.onCompleted: {
214+ logs.loadLogs()
215+ }
216+ }
217+
218 PageStack {
219 id: pStack
220-
221- Component.onCompleted: push(page0)
222-
223- PrefPage {
224- id:msettings
225- onCancelChanges: {
226- loadStandardSettings()
227- pStack.pop()
228- }
229- onApplyChanges: {
230- preferences.fontSize=msettings.fontSize
231- preferences.buffer=msettings.bufferSize
232- preferences.dir=msettings.directory
233- logs.logDir=msettings.directory
234- logs.logFilter=msettings.filter
235- preferences.username =msettings.username
236- preferences.filter=msettings.filter
237- pStack.pop()
238- logs.loadLogs()
239- }
240-
241-
242- Component.onCompleted:loadStandardSettings()
243-
244- function loadStandardSettings(){
245- msettings.fontSize=preferences.fontSize
246- msettings.bufferSize=preferences.buffer
247- msettings.directory=preferences.dir
248- msettings.filter=preferences.filter
249- msettings.username=preferences.username
250- }
251- }
252-
253- AboutPage {
254- id: aboutPage
255- }
256-
257- Page {
258- id: page0
259- title: i18n.tr("Ubuntu Logs")
260- visible: false
261- ListModel { id:logsList }
262-
263- head.actions: [
264- Action {
265- text: i18n.tr("Reload")
266- onTriggered: {
267- emptyLabel.text = ""
268- logsList.clear()
269- logs.loadLogs()
270- }
271- iconName: "reload"
272- },
273- Action {
274- text: i18n.tr("Settings")
275- onTriggered: pStack.push(msettings)
276- iconName: "settings"
277- },
278- Action {
279- text: i18n.tr("About")
280- onTriggered: pStack.push(aboutPage)
281- iconName: "info"
282- }
283- ]
284-
285- Component{
286- id:logDelegate
287-
288- ListItem.Empty {
289- id:logItemDelegate
290- property var pageDelegate
291- Label{
292- id:labelDelegate
293- text:iLogPath.slice(iLogPath.lastIndexOf("/")+1,iLogPath.length)
294- anchors.left: parent.left
295- anchors.leftMargin: units.gu(2)
296- anchors.verticalCenter: parent.verticalCenter
297- fontSize: "large"
298- elide: Text.ElideLeft
299- width:logsListView.width -chevron.width -units.gu(4)
300-
301- }
302- Icon {
303- id:chevron
304- width: units.gu(2)
305- anchors.right: parent.right
306- anchors.rightMargin: units.gu(2)
307- height: width
308- name: "chevron"
309- anchors.verticalCenter: parent.verticalCenter
310- }
311-
312- MouseArea {
313- anchors.fill: parent
314- onClicked:{
315-
316- console.log("creating page")
317-
318- //remove the file extension if any
319- var lastpos = iLogPath.lastIndexOf(".")
320- if (lastpos ===-1) lastpos=iLogPath.length
321-
322- //remove path
323- var startpos = iLogPath.lastIndexOf("/")
324-
325- //iname is now the title page
326- var iname= iLogPath.slice(startpos+1,lastpos)
327- console.log("in page creation, title is " +iname + "\nfile is " +preferences.dir+iLogPath)
328- //create page
329- pageDelegate=createLog(preferences.dir+iLogPath,iname,preferences.buffer)
330- pageDelegate.fontsize=preferences.fontSize
331- pageDelegate.filter=preferences.filter
332- pageDelegate.username=preferences.username
333- console.log("page loaded")
334-
335-// Should be: => Error in createLog()
336-// qml: creating page
337-// qml: in page creation, title is application-click-com.ubuntu.developer.nikwen.logviewer.logviewer_Logviewer_0.1file is /home/phablet/.cache/upstart/application-click-com.ubuntu.developer.nikwen.logviewer.logviewer_Logviewer_0.1.log
338-// readlog called
339-// filed opened succesfully "/home/phablet/.cache/upstart/application-click-com.ubuntu.developer.nikwen.logviewer.logviewer_Logviewer_0.1.log"
340-// seek of file was true
341-// qml: page loaded
342- }
343- }
344-
345- }
346- }
347- ListView {
348- id: logsListView
349- clip: true
350- anchors.fill: parent
351- model: logsList
352- delegate: logDelegate
353- focus: true
354- }
355-
356- Label {
357- property string textToShow: i18n.tr("No logs found for the set filter") //Don't show text while (re)loading
358- id: emptyLabel
359- anchors.centerIn: parent
360- visible: logsListView.model.count === 0
361- }
362-
363- LogViewer {
364- id:logs
365- logDir: preferences.dir
366- logFilter:preferences.filter
367-
368- onLogListChanged: {
369- //this signal indicates that the directory files where loaded
370- console.log("logs are: " + logs.logList)
371-
372- //clear any old list
373- logsList.clear()
374-
375- var tmplogs= logs.logList;
376- var alogs = {}
377- alogs = tmplogs.split("\n")
378- var itemtmp= {}
379- for (var logitem in alogs){
380- if(alogs[logitem].trim()!== "") {
381- itemtmp["iLogPath"] =alogs[logitem]
382- logsList.append(itemtmp)
383- }
384- }
385-
386- emptyLabel.text = emptyLabel.textToShow
387-
388- }
389-
390- Component.onCompleted: {
391- logs.loadLogs()
392- }
393- }
394-
395-
396- }
397 }
398- function createLog(path,name,buffer){
399- var ilog =LogViewLib.addLog(pStack,path,name,buffer)
400- pStack.push(ilog)
401- return ilog
402+
403+ function showSettings() {
404+ var prop = {
405+ dpFontSize: preferences.dpFontSize,
406+ bufferSize: preferences.buffer,
407+ directory: preferences.dir,
408+ filter: preferences.filter,
409+ username: preferences.username
410+ }
411+
412+ var slot_applyChanges = function(msettings) {
413+ console.log("Save changes...")
414+ preferences.dpFontSize = msettings.dpFontSize
415+ preferences.buffer = msettings.bufferSize
416+ preferences.dir = msettings.directory
417+ logs.logDir = msettings.directory
418+ logs.logFilter = msettings.filter
419+ preferences.username = msettings.username
420+ preferences.filter = msettings.filter
421+ logs.loadLogs()
422+ }
423+
424+ var settingPage = pStack.push(Qt.resolvedUrl("ui/PrefPage.qml"), prop)
425+
426+ settingPage.applyChanges.connect(function() { slot_applyChanges(settingPage) })
427 }
428 }
429
430
431=== removed file 'app/graphics/chevron@18.png'
432Binary files app/graphics/chevron@18.png 2014-01-07 19:49:28 +0000 and app/graphics/chevron@18.png 1970-01-01 00:00:00 +0000 differ
433=== renamed file 'icon.png' => 'app/graphics/logviewer.png'
434=== removed file 'app/logls.txt'
435=== renamed file 'app/Logviewer.desktop.in' => 'app/logviewer.desktop.in'
436--- app/Logviewer.desktop.in 2014-08-25 11:10:28 +0000
437+++ app/logviewer.desktop.in 2016-06-20 17:01:33 +0000
438@@ -1,6 +1,6 @@
439 [Desktop Entry]
440 Name=Logviewer
441-Comment=Logviewer for Ubuntu Touch
442+_Comment=Logviewer for Ubuntu Touch
443 Exec=@EXEC@
444 Icon=@ICON@
445 Terminal=false
446
447=== modified file 'app/ui/AboutPage.qml'
448--- app/ui/AboutPage.qml 2014-08-25 11:10:28 +0000
449+++ app/ui/AboutPage.qml 2016-06-20 17:01:33 +0000
450@@ -1,30 +1,41 @@
451-import QtQuick 2.0
452-import Ubuntu.Components 1.1
453-import Ubuntu.Layouts 1.0
454+import QtQuick 2.4
455+import Ubuntu.Components 1.3
456
457 Page {
458 id: aboutPage
459- title: i18n.tr("About")
460- visible:false
461-
462- Flickable {
463- id: flickable
464- anchors.fill: parent
465+
466+ header: PageHeader {
467+ title: i18n.tr("About")
468+ }
469+
470+ ScrollView {
471+ id: scrollView
472+ anchors {
473+ top: aboutPage.header.bottom
474+ bottom: parent.bottom
475+ left: parent.left
476+ right: parent.right
477+ }
478+
479 clip: true
480
481- contentHeight: aboutColumn.height + 2 * aboutColumn.marginTop //doubled marginTop to get the same margin at the bottom
482-
483 Column {
484 id: aboutColumn
485 spacing: units.gu(2)
486- width: parent.width
487- property real marginTop: units.gu(3)
488- y: marginTop
489-
490- Label {
491- anchors.horizontalCenter: parent.horizontalCenter
492- text: i18n.tr("<b>Logviewer</b>")
493- fontSize: "x-large"
494+ width: scrollView.width
495+
496+ // TODO: Qt 5.6 added 'topPadding' property.
497+ Item { width: 1; height: units.gu(3) /* top margin */ }
498+
499+ Label {
500+ anchors.horizontalCenter: parent.horizontalCenter
501+ text: i18n.tr("Logviewer")
502+ textSize: Label.XLarge
503+ }
504+
505+ Label {
506+ anchors.horizontalCenter: parent.horizontalCenter
507+ text: i18n.tr("Version %1").arg("0.9")
508 }
509
510 UbuntuShape {
511@@ -33,16 +44,16 @@
512 width: Math.min(parent.width, maxWidth)/2
513 height: Math.min(parent.width, maxWidth)/2
514 image: Image {
515- source: "../../icon.png"
516+ source: "../graphics/logviewer.png"
517 smooth: true
518 fillMode: Image.PreserveAspectFit
519-
520 }
521 }
522
523 Label {
524 anchors.horizontalCenter: parent.horizontalCenter
525- text: i18n.tr("<b>Authors:</b>")
526+ text: i18n.tr("Authors:")
527+ font.weight: Font.DemiBold
528 }
529
530 Label {
531@@ -54,7 +65,8 @@
532
533 Label {
534 anchors.horizontalCenter: parent.horizontalCenter
535- text: i18n.tr("<b>Source code:</b>")
536+ text: i18n.tr("Source code:")
537+ font.weight: Font.DemiBold
538 }
539
540 Label {
541@@ -65,13 +77,8 @@
542
543 Label {
544 anchors.horizontalCenter: parent.horizontalCenter
545- text: i18n.tr("Version: <b>0.8</b>")
546- }
547-
548- Label {
549- anchors.horizontalCenter: parent.horizontalCenter
550- font.bold: true;
551- text: "2014"
552+ font.weight: Font.DemiBold
553+ text: "2014-2016"
554 }
555 }
556 }
557
558=== modified file 'app/ui/LogPage.qml'
559--- app/ui/LogPage.qml 2014-08-25 11:10:28 +0000
560+++ app/ui/LogPage.qml 2016-06-20 17:01:33 +0000
561@@ -1,22 +1,21 @@
562-import QtQuick 2.0
563-import Ubuntu.Components 1.1
564+import QtQuick 2.4
565+import Ubuntu.Components 1.3
566+import Ubuntu.Components.Popups 1.3
567 import Logviewer 1.0
568-import Ubuntu.Components.ListItems 1.0 as ListItem
569-import Ubuntu.Components.Popups 1.0
570+
571 import "../libs/pastebin.js" as PasteBin
572
573-
574 Page {
575 id: logPage
576 property string logname
577 property alias path: mLogViewer.filePath
578 property string username
579 property alias filter: mLogViewer.logFilter
580- property bool readingLog : true
581+ property bool readingLog: true
582 property bool autoscroll: true
583 property alias buffer: mLogViewer.logBuffer
584 property bool doselection: false
585- property alias fontsize: logText.font.pointSize
586+ property alias fontSize: logText.font.pixelSize
587 property int maxTitle: 14
588 property int iconSize: units.gu(4)
589 property bool logDie: false
590@@ -24,94 +23,102 @@
591 property bool dialogError: false
592 property string dialogText
593
594- title: logname.length > maxTitle? ".."+logname.slice(logname.length-maxTitle-1,logname.length) :
595- logname
596+ header: PageHeader {
597+ title: logname.length > maxTitle
598+ ? ".."+logname.slice(logname.length-maxTitle-1,logname.length)
599+ : logname
600+
601+ leadingActionBar.actions: Action {
602+ text: i18n.tr("Back")
603+ iconName: "back"
604+ onTriggered: {
605+ if (readingLog) {
606+ // Page gets closed by mLogViewer.onLogStopped slot,
607+ // after we have cleaned all the threads.
608+ logDie = true;
609+ mLogViewer.stopLog()
610+ } else {
611+ pageStack.pop()
612+ }
613+ }
614+ }
615+
616+ trailingActionBar.actions: [
617+ Action {
618+ id: pauseaction
619+ text: readingLog ? i18n.tr("Pause") : i18n.tr("Start")
620+ onTriggered: {
621+ readingLog ? mLogViewer.stopLog() : mLogViewer.openLog()
622+ readingLog = !readingLog
623+ console.log("Action is " + pauseaction.text)
624+ }
625+ iconName: readingLog ? "media-playback-pause" : "media-playback-start"
626+ },
627+ Action {
628+ text: i18n.tr("Clear")
629+ onTriggered: mLogViewer.clearLog()
630+ iconName: "edit-clear"
631+ },
632+ Action {
633+ text: doselection? i18n.tr("Copy") : i18n.tr("Select")
634+ onTriggered: {
635+ if (doselection) {
636+ Clipboard.push(logText.selectedText)
637+ logText.select(0,0)
638+
639+ }
640+ doselection =!doselection
641+ }
642+ iconName: doselection ? "browser-tabs" : "edit"
643+ },
644+ Action {
645+ text: i18n.tr("PasteBin")
646+ iconName: "external-link"
647+ onTriggered: {
648+ __popover=PopupUtils.open(progress)
649+ var uploadText = logText.selectedText
650+
651+ if (uploadText === "") {
652+ console.log("Text to upload is empty. Pasting the whole text...")
653+ uploadText = logText.text
654+ }
655+
656+ PasteBin.post(i18n.tr("From file ")+ path + ":\n" + uploadText, username,
657+ function on_success(url) {
658+ console.log("url is "+url)
659+ Clipboard.push(url)
660+ logText.select(0,0)
661+ PopupUtils.close(__popover)
662+ __popover=null
663+ logPage.dialogError = false;
664+ logPage.dialogText = "<a href=\""+url+"\">"+url+"</a>"
665+ PopupUtils.open(resultsD)
666+ },
667+ function on_failure(why ){
668+ console.log("error is " + why)
669+ logText.select(0,0)
670+ PopupUtils.close(__popover)
671+ __popover=null
672+ logPage.dialogError = true;
673+ PopupUtils.open(resultsD)
674+ })
675+ }
676+ }
677+ ]
678+ }
679+
680 visible: false
681
682 LogViewer {
683 id: mLogViewer
684+ onLogStopped: if (logDie) pageStack.pop()
685 onLogTextChanged: {
686- if(autoscroll) flickArea.contentY= logText.height-logPage.height
687- }
688- onLogStopped: {
689- if(logDie) logPage.destroy()
690+ if(autoscroll) flickArea.contentY= logText.height-scrollView.height
691 }
692 }
693+
694 ListModel { id:logsList }
695
696- Connections {
697- target: head.backAction
698- onTriggered: {
699- toolbar.pageStack.pop()
700- logDie=true
701- mLogViewer.stopLog()
702- }
703- }
704-
705- head.actions: [
706- Action {
707- id: pauseaction
708- text: readingLog ? i18n.tr("Pause") : i18n.tr("Start")
709- onTriggered: {
710- if (readingLog){
711- mLogViewer.stopLog()
712- } else {
713- mLogViewer.openLog()
714- }
715- readingLog = !readingLog
716- console.log("Action is " + pauseaction.text)
717- }
718- iconName: readingLog ? "media-playback-pause" : "media-playback-start"
719- },
720- Action {
721- text: i18n.tr("Clear")
722- onTriggered: mLogViewer.clearLog()
723- iconName: "clear"
724- },
725- Action {
726- text: doselection? i18n.tr("Copy") : i18n.tr("Select")
727- onTriggered: {
728- if (doselection) {
729- Clipboard.push(logText.selectedText)
730- logText.select(0,0)
731-
732- }
733- doselection =!doselection
734- }
735- iconName: doselection ? "browser-tabs" : "edit"
736- },
737- Action {
738- text: i18n.tr("PasteBin")
739- onTriggered: {
740- __popover=PopupUtils.open(progress)
741- var uploadText = logText.selectedText
742- if (uploadText === "") uploadText = logText.text
743- PasteBin.post(i18n.tr("From file ")+ path+ ":\n" + uploadText, username,
744- function on_success(url){
745- console.log("url is "+url)
746- Clipboard.push(url)
747- logText.select(0,0)
748- PopupUtils.close(__popover)
749- __popover=null
750- logPage.dialogError = false;
751- logPage.dialogText = "<a href=\""+url+"\">"+url+"</a>"
752- PopupUtils.open(resultsD)
753- },
754- function on_failure(why){
755- console.log("error is " + why)
756- logText.select(0,0)
757- PopupUtils.close(__popover)
758- __popover=null
759- logPage.dialogError = true;
760- PopupUtils.open(resultsD)
761- })
762- doselection =!doselection
763-
764- }
765- iconName: "keyboard-caps-disabled"
766- }
767- ]
768-
769 Component {
770 id: progress
771 Popover {
772@@ -119,19 +126,15 @@
773 autoClose: false
774 anchors.centerIn: parent
775
776- ActivityIndicator {
777- id: spinner_pastebin
778- running: true
779- anchors.verticalCenter: parent.verticalCenter
780- anchors.leftMargin: units.gu(1)
781- anchors.left: parent.left
782-
783- }
784- ListItem.Standard {
785- anchors.verticalCenter: parent.verticalCenter
786- text: i18n.tr("Sending to Pastebin..")
787- anchors.left: spinner_pastebin.right
788- anchors.leftMargin: units.gu(1)
789+ ListItemLayout {
790+ anchors.verticalCenter: parent.verticalCenter
791+
792+ title.text: i18n.tr("Sending to Pastebin..")
793+
794+ ActivityIndicator {
795+ running: true
796+ SlotsLayout.position: SlotsLayout.Leading
797+ }
798 }
799 }
800 }
801@@ -153,43 +156,50 @@
802 }
803
804 Button {
805- text: "OK"
806+ text: i18n.tr("OK")
807 onClicked: PopupUtils.close(dialogue)
808 }
809-
810- }
811- }
812-
813-
814- Flickable {
815- id: flickArea
816- anchors.fill: parent
817- contentWidth: logText.width; contentHeight: logText.height
818- flickableDirection: Flickable.VerticalFlick
819- clip: true
820- onFlickStarted: autoscroll =false;
821- onFlickEnded:{
822- console.log("contenty is " + flickArea.contentY)
823- console.log("log text is "+ logText.height + " and page is " + logPage.height)
824- if (flickArea.contentY > logText.height-logPage.height*2) autoscroll=true
825-
826- }
827- TextEdit {
828- id: logText
829- wrapMode: TextEdit.Wrap
830- width: logPage.width
831- text: mLogViewer.logText
832- readOnly: true
833- font.pointSize: 12
834- selectByMouse: doselection
835- mouseSelectionMode: TextEdit.SelectWords
836-
837- }
838-
839- }
840- Scrollbar {
841- flickableItem: flickArea
842- align: Qt.AlignTrailing
843- }
844+ }
845+ }
846+
847+ ScrollView {
848+ id: scrollView
849+ anchors {
850+ top: logPage.header.bottom
851+ left: parent.left
852+ right: parent.right
853+ bottom: parent.bottom
854+ }
855+
856+ Flickable {
857+ id: flickArea
858+ anchors.fill: parent
859+ contentWidth: logText.width; contentHeight: logText.height
860+ flickableDirection: Flickable.VerticalFlick
861+ clip: true
862+ onFlickStarted: autoscroll =false;
863+ onFlickEnded:{
864+ console.log("contenty is " + flickArea.contentY)
865+ console.log("log text is "+ logText.height + " and scrollview is " + scrollView.height)
866+ if (flickArea.contentY > logText.height-scrollView.height*2) autoscroll=true
867+ }
868+
869+ TextEdit {
870+ id: logText
871+ wrapMode: TextEdit.Wrap
872+ width: scrollView.width
873+ text: mLogViewer.logText
874+ readOnly: true
875+ font.pointSize: 12
876+ selectByMouse: doselection
877+ mouseSelectionMode: TextEdit.SelectWords
878+ persistentSelection: true
879+ color: theme.palette.normal.fieldText
880+ selectedTextColor: theme.palette.selected.selectionText
881+ selectionColor: theme.palette.selected.selection
882+ }
883+ }
884+ }
885+
886 Component.onCompleted: mLogViewer.openLog()
887 }
888
889=== added file 'app/ui/MainPage.qml'
890--- app/ui/MainPage.qml 1970-01-01 00:00:00 +0000
891+++ app/ui/MainPage.qml 2016-06-20 17:01:33 +0000
892@@ -0,0 +1,107 @@
893+import QtQuick 2.4
894+import Ubuntu.Components 1.3
895+
896+Page {
897+ id: mainPage
898+
899+ header: PageHeader {
900+ title: i18n.tr("Ubuntu Logs")
901+ flickable: scrollView.flickableItem
902+
903+ trailingActionBar.actions: [
904+ Action {
905+ text: i18n.tr("Reload")
906+ onTriggered: logs.loadLogs()
907+ iconName: "reload"
908+ },
909+ Action {
910+ text: i18n.tr("Settings")
911+ onTriggered: mainView.showSettings()
912+ iconName: "settings"
913+ },
914+ Action {
915+ text: i18n.tr("About")
916+ onTriggered: pStack.push(Qt.resolvedUrl("AboutPage.qml"))
917+ iconName: "info"
918+ }
919+ ]
920+ }
921+
922+ ScrollView {
923+ id: scrollView
924+ anchors.fill: parent
925+
926+ ListView {
927+ id: logsListView
928+ anchors.fill: parent
929+ model: logsList
930+ delegate: logDelegate
931+ focus: true
932+
933+ Label {
934+ id: emptyLabel
935+ anchors.centerIn: parent
936+ text: i18n.tr("No logs found for the set filter")
937+ visible: logsListView.count === 0 && !logsList.loading
938+ }
939+ }
940+ }
941+
942+ Component{
943+ id:logDelegate
944+
945+ ListItem {
946+ id:logItemDelegate
947+ property var pageDelegate
948+
949+ onClicked:{
950+ console.log("creating page")
951+
952+ //remove the file extension if any
953+ var lastpos = iLogPath.lastIndexOf(".")
954+ if (lastpos ===-1) lastpos=iLogPath.length
955+
956+ //remove path
957+ var startpos = iLogPath.lastIndexOf("/")
958+
959+ //iname is now the title page
960+ var iname= iLogPath.slice(startpos+1,lastpos)
961+ console.log("in page creation, title is " +iname + "\nfile is " +preferences.dir+iLogPath)
962+
963+ //create page
964+ var pref = {
965+ logname: iname,
966+ path: preferences.dir + iLogPath,
967+ buffer: preferences.buffer,
968+ fontSize: FontUtils.sizeToPixels("medium") * preferences.dpFontSize / 10,
969+ filter: preferences.filter,
970+ username: preferences.username
971+ }
972+
973+ pageStack.push(Qt.resolvedUrl("LogPage.qml"), pref)
974+
975+ console.log("page loaded")
976+
977+// Should be: => Error in createLog()
978+// qml: creating page
979+// qml: in page creation, title is application-click-com.ubuntu.developer.nikwen.logviewer.logviewer_Logviewer_0.1file is /home/phablet/.cache/upstart/application-click-com.ubuntu.developer.nikwen.logviewer.logviewer_Logviewer_0.1.log
980+// readlog called
981+// filed opened succesfully "/home/phablet/.cache/upstart/application-click-com.ubuntu.developer.nikwen.logviewer.logviewer_Logviewer_0.1.log"
982+// seek of file was true
983+// qml: page loaded
984+ }
985+
986+ ListItemLayout {
987+ anchors.centerIn: parent
988+
989+ title.text:iLogPath.slice(iLogPath.lastIndexOf("/")+1,iLogPath.length)
990+
991+ Icon {
992+ width: units.gu(2); height: width
993+ name: "go-next"
994+ SlotsLayout.position: SlotsLayout.Last
995+ }
996+ }
997+ }
998+ }
999+}
1000
1001=== modified file 'app/ui/PrefPage.qml'
1002--- app/ui/PrefPage.qml 2014-08-25 11:10:28 +0000
1003+++ app/ui/PrefPage.qml 2016-06-20 17:01:33 +0000
1004@@ -1,101 +1,106 @@
1005-import QtQuick 2.0
1006-import Ubuntu.Components 1.1
1007-import Ubuntu.Components.Pickers 1.0
1008-import Ubuntu.Components.ListItems 1.0 as ListItem
1009-
1010+import QtQuick 2.4
1011+import Ubuntu.Components 1.3
1012
1013 Page {
1014- id:settingPage
1015- title:"Settings"
1016- visible: false
1017+ id: settingPage
1018+
1019 property alias bufferSize: bufferslider.value
1020- property alias directory:dirPath.text
1021- property alias filter:filterText.text
1022- property alias fontSize:fontslider.value
1023- property alias username:userText.text
1024+ property alias directory: dirPath.text
1025+ property alias filter: filterText.text
1026+ property alias dpFontSize: fontslider.value
1027+ property alias username: userText.text
1028
1029 signal applyChanges
1030 signal cancelChanges
1031
1032- head.backAction: Action {
1033- id: cancelAction
1034- text: i18n.tr("Cancel")
1035- iconName: "close"
1036- onTriggered: cancelChanges()
1037- }
1038-
1039- head.actions: [
1040- Action {
1041- id: applyAction
1042+ header: PageHeader {
1043+ title: i18n.tr("Settings")
1044+ flickable: scrollView.flickableItem
1045+
1046+ leadingActionBar.actions: Action {
1047+ text: i18n.tr("Cancel")
1048+ iconName: "close"
1049+ onTriggered: {
1050+ settingPage.cancelChanges()
1051+ pageStack.pop()
1052+ }
1053+ }
1054+
1055+ trailingActionBar.actions: Action {
1056 text: i18n.tr("Apply")
1057 iconName: "ok"
1058- onTriggered: applyChanges()
1059+ onTriggered: {
1060+ settingPage.applyChanges()
1061+ pageStack.pop()
1062+ }
1063 }
1064- ]
1065+ }
1066
1067- Flickable {
1068+ ScrollView {
1069+ id: scrollView
1070 anchors.fill: parent
1071- contentHeight: column.height
1072
1073 Column {
1074 id: column
1075- anchors {
1076- right: parent.right
1077- left: parent.left
1078- rightMargin: units.gu(2)
1079- leftMargin: anchors.rightMargin
1080- }
1081- height: childrenRect.height
1082-
1083- property real mSpacing: units.gu(2)
1084-
1085- ListItem.Empty {
1086+ width: scrollView.width
1087+
1088+ property int mSpacing: units.gu(1)
1089+
1090+ ListItem {
1091 height: dirlabel.height + dirPath.height + 2 * column.mSpacing
1092 Label {
1093 id: dirlabel
1094 text: i18n.tr("Directory:")
1095- fontSize: "medium"
1096- anchors.top: parent.top
1097- anchors.topMargin: column.mSpacing
1098+ anchors {
1099+ top: parent.top; topMargin: column.mSpacing
1100+ left: parent.left; leftMargin: units.gu(1)
1101+ right: parent.right; rightMargin: units.gu(1)
1102+ }
1103 }
1104 TextField {
1105 id: dirPath
1106 width: parent.width
1107 anchors.top: dirlabel.bottom
1108+ anchors {
1109+ left: parent.left; leftMargin: units.gu(1)
1110+ right: parent.right; rightMargin: units.gu(1)
1111+ }
1112 }
1113-
1114 }
1115
1116- ListItem.Empty {
1117+ ListItem {
1118 height: filterlabel.height + filterText.height + 2 * column.mSpacing
1119 Label {
1120 id: filterlabel
1121 text: i18n.tr("Filter:")
1122- fontSize: "medium"
1123- anchors.top: parent.top
1124- anchors.topMargin: column.mSpacing
1125-
1126+ anchors {
1127+ top: parent.top; topMargin: column.mSpacing
1128+ left: parent.left; leftMargin: units.gu(1)
1129+ right: parent.right; rightMargin: units.gu(1)
1130+ }
1131 }
1132 TextField {
1133 id: filterText
1134 width: parent.width
1135 anchors.top: filterlabel.bottom
1136-
1137+ anchors {
1138+ left: parent.left; leftMargin: units.gu(1)
1139+ right: parent.right; rightMargin: units.gu(1)
1140+ }
1141 }
1142-
1143 }
1144
1145- ListItem.Empty {
1146+ ListItem {
1147 height: bufferlabel.height + bufferslider.height + column.mSpacing
1148 Label {
1149 id:bufferlabel
1150 text: i18n.tr("Buffer:")
1151- fontSize: "medium"
1152- anchors.top: parent.top
1153- anchors.topMargin: column.mSpacing
1154-
1155+ anchors {
1156+ top: parent.top; topMargin: column.mSpacing
1157+ left: parent.left; leftMargin: units.gu(1)
1158+ right: parent.right; rightMargin: units.gu(1)
1159+ }
1160 }
1161-
1162 Slider {
1163 id:bufferslider
1164 function formatValue(v) { return v.toFixed(0) }
1165@@ -105,54 +110,62 @@
1166 live: true
1167 width: parent.width
1168 anchors.top: bufferlabel.bottom
1169+ anchors {
1170+ left: parent.left; leftMargin: units.gu(1)
1171+ right: parent.right; rightMargin: units.gu(1)
1172+ }
1173 }
1174-
1175 }
1176
1177- ListItem.Empty {
1178+ ListItem {
1179 height: fontlabel.height + fontslider.height + column.mSpacing
1180 Label {
1181 id:fontlabel
1182 text: i18n.tr("Font Size:")
1183- fontSize: "medium"
1184- anchors.top: parent.top
1185- anchors.topMargin: column.mSpacing
1186-
1187+ anchors {
1188+ top: parent.top; topMargin: column.mSpacing
1189+ left: parent.left; leftMargin: units.gu(1)
1190+ right: parent.right; rightMargin: units.gu(1)
1191+ }
1192 }
1193-
1194 Slider {
1195 id:fontslider
1196 function formatValue(v) { return v.toFixed(0) }
1197- minimumValue: 8
1198- maximumValue: 38
1199- value: 24
1200+ minimumValue: 4
1201+ maximumValue: 24
1202+ value: 10
1203 live: true
1204 width: parent.width
1205 anchors.top: fontlabel.bottom
1206+ anchors {
1207+ left: parent.left; leftMargin: units.gu(1)
1208+ right: parent.right; rightMargin: units.gu(1)
1209+ }
1210 }
1211-
1212 }
1213
1214- ListItem.Empty {
1215+ ListItem {
1216 height: userlabel.height + userText.height + 2 * column.mSpacing
1217- divider.visible: false //No divider at the end of the list
1218 Label {
1219 id:userlabel
1220 text: i18n.tr("Pastebin user:")
1221- fontSize: "medium"
1222- anchors.top: parent.top
1223- anchors.topMargin: column.mSpacing
1224-
1225+ anchors {
1226+ top: parent.top; topMargin: column.mSpacing
1227+ left: parent.left; leftMargin: units.gu(1)
1228+ right: parent.right; rightMargin: units.gu(1)
1229+ }
1230 }
1231 TextField {
1232 id:userText
1233 maximumLength: 30
1234 width: parent.width
1235 anchors.top: userlabel.bottom
1236-
1237+ anchors {
1238+ left: parent.left; leftMargin: units.gu(1)
1239+ right: parent.right; rightMargin: units.gu(1)
1240+ }
1241 }
1242 }
1243-
1244 }
1245 }
1246 }
1247
1248=== modified file 'backend/CMakeLists.txt'
1249--- backend/CMakeLists.txt 2014-08-25 11:10:28 +0000
1250+++ backend/CMakeLists.txt 2016-06-20 17:01:33 +0000
1251@@ -9,6 +9,9 @@
1252 modules/Logviewer/logviewer.cpp
1253 )
1254
1255+# Make the unit test files visible on qtcreator
1256+add_custom_target(Logviewerbackend_UNITTEST_QML_FILES ALL SOURCES "tests/unit/tst_mytype.qml")
1257+
1258 add_library(Logviewerbackend MODULE
1259 ${Logviewerbackend_SRCS}
1260 )
1261
1262=== modified file 'backend/tests/unit/tst_mytype.qml'
1263--- backend/tests/unit/tst_mytype.qml 2014-08-25 11:10:28 +0000
1264+++ backend/tests/unit/tst_mytype.qml 2016-06-20 17:01:33 +0000
1265@@ -1,6 +1,6 @@
1266-import QtQuick 2.0
1267+import QtQuick 2.4
1268 import QtTest 1.0
1269-import Ubuntu.Components 0.1
1270+import Ubuntu.Components 1.3
1271 import Logviewer 1.0
1272
1273 // See more details @ http://qt-project.org/doc/qt-5.0/qtquick/qml-testcase.html
1274
1275=== renamed file 'Logviewer.json' => 'logviewer.apparmor'
1276--- Logviewer.json 2014-08-25 11:10:28 +0000
1277+++ logviewer.apparmor 2016-06-20 17:01:33 +0000
1278@@ -2,9 +2,9 @@
1279 "policy_groups": [
1280 "networking"
1281 ],
1282- "policy_version": 1.2,
1283+ "policy_version": 1.3,
1284 "read_path": [
1285 "/var/log/",
1286 "/home/phablet/.cache/"
1287 ]
1288-}
1289\ No newline at end of file
1290+}
1291
1292=== renamed file 'manifest.json' => 'manifest.json.in'
1293--- manifest.json 2014-08-25 11:10:28 +0000
1294+++ manifest.json.in 2016-06-20 17:01:33 +0000
1295@@ -1,15 +1,17 @@
1296 {
1297- "architecture": "armhf",
1298+ "name": "@APP_ID@",
1299 "description": "Logviewer app for Ubuntu touch",
1300- "framework": "ubuntu-sdk-14.10-dev2",
1301+ "architecture": "@CLICK_ARCH@",
1302+ "title": "Logviewer",
1303 "hooks": {
1304- "Logviewer": {
1305- "apparmor": "Logviewer.json",
1306- "desktop": "Logviewer.desktop"
1307+ "logviewer": {
1308+ "apparmor": "logviewer.apparmor",
1309+ "desktop": "logviewer.desktop"
1310 }
1311 },
1312+ "version": "0.9",
1313 "maintainer": "Victor Palau <vtuson@gmail.com>",
1314- "name": "com.ubuntu.developer.vtuson.logviewer",
1315- "title": "Logviewer",
1316- "version": "0.8"
1317-}
1318\ No newline at end of file
1319+ "framework" : "ubuntu-sdk-15.04.4"
1320+}
1321+
1322+
1323
1324=== added directory 'po'
1325=== added file 'po/CMakeLists.txt'
1326--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
1327+++ po/CMakeLists.txt 2016-06-20 17:01:33 +0000
1328@@ -0,0 +1,63 @@
1329+include(FindGettext)
1330+
1331+# Find the translation tools
1332+find_program(INTLTOOL_MERGE intltool-merge)
1333+if(NOT INTLTOOL_MERGE)
1334+ message(FATAL_ERROR "Could not find intltool-merge, please install the intltool package")
1335+endif()
1336+
1337+find_program(INTLTOOL_EXTRACT intltool-extract)
1338+if(NOT INTLTOOL_EXTRACT)
1339+ message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package")
1340+endif()
1341+
1342+if(NOT CMAKE_INSTALL_LOCALEDIR)
1343+ set(CMAKE_INSTALL_LOCALEDIR "share/locale")
1344+endif()
1345+
1346+find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext)
1347+
1348+set(DOMAIN ${APP_ID})
1349+set(POT_FILE ${DOMAIN}.pot)
1350+file(GLOB PO_FILES *.po)
1351+
1352+file(GLOB_RECURSE I18N_SRC_FILES
1353+ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
1354+ ${CMAKE_SOURCE_DIR}/*.qml
1355+ ${CMAKE_SOURCE_DIR}/*.js
1356+ ${CMAKE_SOURCE_DIR}/*.cpp
1357+ ${CMAKE_SOURCE_DIR}/*.h
1358+)
1359+list(APPEND I18N_SRC_FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE_NAME}.in.h)
1360+list(SORT I18N_SRC_FILES)
1361+
1362+add_custom_target(${POT_FILE} ALL
1363+ COMMENT "Generating translation template"
1364+ # Extract the translatable messages from the desktop file
1365+ COMMAND ${INTLTOOL_EXTRACT} --update --type=gettext/ini
1366+ --srcdir=${CMAKE_BINARY_DIR}/app ${DESKTOP_FILE_NAME}.in
1367+ # Update the translation file
1368+ COMMAND ${GETTEXT_XGETTEXT_EXECUTABLE} -o ${POT_FILE}
1369+ --from-code=UTF-8
1370+ --c++ --qt --add-comments=TRANSLATORS
1371+ --keyword=tr --keyword=tr:1,2 --keyword=N_
1372+ --package-name='${PROJECT}'
1373+ -D ${CMAKE_CURRENT_SOURCE_DIR} ${I18N_SRC_FILES}
1374+ # Copy the up2date translation file to the source directory
1375+ COMMAND ${CMAKE_COMMAND} -E copy ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR}
1376+)
1377+
1378+foreach(PO_FILE ${PO_FILES})
1379+ get_filename_component(LANG ${PO_FILE} NAME_WE)
1380+ gettext_process_po_files(${LANG} ALL PO_FILES ${PO_FILE})
1381+ set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES)
1382+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo
1383+ DESTINATION ${INSTALL_DIR}
1384+ RENAME ${DOMAIN}.mo)
1385+endforeach(PO_FILE)
1386+
1387+add_custom_target(${DESKTOP_FILE_NAME} ALL
1388+ COMMENT "Merging translations into ${DESKTOP_FILE_NAME}"
1389+ 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
1390+)
1391+
1392
1393=== added file 'po/com.ubuntu.developer.vtuson.logviewer.pot'
1394--- po/com.ubuntu.developer.vtuson.logviewer.pot 1970-01-01 00:00:00 +0000
1395+++ po/com.ubuntu.developer.vtuson.logviewer.pot 2016-06-20 17:01:33 +0000
1396@@ -0,0 +1,143 @@
1397+# SOME DESCRIPTIVE TITLE.
1398+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
1399+# This file is distributed under the same license as the PACKAGE package.
1400+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
1401+#
1402+#, fuzzy
1403+msgid ""
1404+msgstr ""
1405+"Project-Id-Version: \n"
1406+"Report-Msgid-Bugs-To: \n"
1407+"POT-Creation-Date: 2016-06-20 19:00+0200\n"
1408+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1409+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1410+"Language-Team: LANGUAGE <LL@li.org>\n"
1411+"Language: \n"
1412+"MIME-Version: 1.0\n"
1413+"Content-Type: text/plain; charset=CHARSET\n"
1414+"Content-Transfer-Encoding: 8bit\n"
1415+
1416+#: ../app/ui/AboutPage.qml:8 ../app/ui/MainPage.qml:23
1417+msgid "About"
1418+msgstr ""
1419+
1420+#: ../app/ui/AboutPage.qml:32
1421+msgid "Logviewer"
1422+msgstr ""
1423+
1424+#: ../app/ui/AboutPage.qml:38
1425+#, qt-format
1426+msgid "Version %1"
1427+msgstr ""
1428+
1429+#: ../app/ui/AboutPage.qml:55
1430+msgid "Authors:"
1431+msgstr ""
1432+
1433+#: ../app/ui/AboutPage.qml:68
1434+msgid "Source code:"
1435+msgstr ""
1436+
1437+#: ../app/ui/LogPage.qml:32
1438+msgid "Back"
1439+msgstr ""
1440+
1441+#: ../app/ui/LogPage.qml:49
1442+msgid "Pause"
1443+msgstr ""
1444+
1445+#: ../app/ui/LogPage.qml:49
1446+msgid "Start"
1447+msgstr ""
1448+
1449+#: ../app/ui/LogPage.qml:58
1450+msgid "Clear"
1451+msgstr ""
1452+
1453+#: ../app/ui/LogPage.qml:63
1454+msgid "Copy"
1455+msgstr ""
1456+
1457+#: ../app/ui/LogPage.qml:63
1458+msgid "Select"
1459+msgstr ""
1460+
1461+#: ../app/ui/LogPage.qml:75
1462+msgid "PasteBin"
1463+msgstr ""
1464+
1465+#: ../app/ui/LogPage.qml:86
1466+msgid "From file "
1467+msgstr ""
1468+
1469+#: ../app/ui/LogPage.qml:132
1470+msgid "Sending to Pastebin.."
1471+msgstr ""
1472+
1473+#: ../app/ui/LogPage.qml:146
1474+msgid "Pastebin Error"
1475+msgstr ""
1476+
1477+#: ../app/ui/LogPage.qml:146
1478+msgid "Pastebin Successful"
1479+msgstr ""
1480+
1481+#: ../app/ui/LogPage.qml:152
1482+msgid "Error ocurred uploading to Pastebin"
1483+msgstr ""
1484+
1485+#: ../app/ui/LogPage.qml:153
1486+msgid "<br>(Copied to clipboard)"
1487+msgstr ""
1488+
1489+#: ../app/ui/LogPage.qml:159
1490+msgid "OK"
1491+msgstr ""
1492+
1493+#: ../app/ui/MainPage.qml:8
1494+msgid "Ubuntu Logs"
1495+msgstr ""
1496+
1497+#: ../app/ui/MainPage.qml:13
1498+msgid "Reload"
1499+msgstr ""
1500+
1501+#: ../app/ui/MainPage.qml:18 ../app/ui/PrefPage.qml:17
1502+msgid "Settings"
1503+msgstr ""
1504+
1505+#: ../app/ui/MainPage.qml:44
1506+msgid "No logs found for the set filter"
1507+msgstr ""
1508+
1509+#: ../app/ui/PrefPage.qml:21
1510+msgid "Cancel"
1511+msgstr ""
1512+
1513+#: ../app/ui/PrefPage.qml:30
1514+msgid "Apply"
1515+msgstr ""
1516+
1517+#: ../app/ui/PrefPage.qml:53
1518+msgid "Directory:"
1519+msgstr ""
1520+
1521+#: ../app/ui/PrefPage.qml:75
1522+msgid "Filter:"
1523+msgstr ""
1524+
1525+#: ../app/ui/PrefPage.qml:97
1526+msgid "Buffer:"
1527+msgstr ""
1528+
1529+#: ../app/ui/PrefPage.qml:124
1530+msgid "Font Size:"
1531+msgstr ""
1532+
1533+#: ../app/ui/PrefPage.qml:151
1534+msgid "Pastebin user:"
1535+msgstr ""
1536+
1537+#: /tmp/logviewer-build/po/logviewer.desktop.in.h:1
1538+msgid "Logviewer for Ubuntu Touch"
1539+msgstr ""

Subscribers

People subscribed via source and target branches