Commit 1f074746 authored by Alberto Mardegan's avatar Alberto Mardegan
Browse files

Create application stub for desktop and UBports

Mostly copied from MiTubo.
parent fbb7553a
*.swp
.clickable/
build/
default/
{
"builder": "custom",
"build": "qbs -f ${SRC_DIR} config:release qbs.installPrefix:.",
"dependencies_target": [
"libvncserver-dev"
],
"env_vars": {
"TARGET_SYSTEM": "UbuntuTouch"
},
"install_dir": "${BUILD_DIR}/release/install-root",
"default": "build install launch"
}
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/icons">
</qresource>
</RCC>
[Desktop Entry]
Icon=lomiri_vnc
Categories=Network;Office;Utility;
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="64"
height="64"
id="svg1901"
sodipodi:version="0.32"
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="lomiri_vnc.svg"
version="1.0"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:export-xdpi="19.749216"
inkscape:export-ydpi="19.749216"
viewBox="0 0 64 64">
<defs
id="defs1903">
<linearGradient
id="linearGradient3152">
<stop
style="stop-color:#009a11;stop-opacity:1;"
offset="0"
id="stop3154" />
<stop
style="stop-color:#00cb17;stop-opacity:1;"
offset="1"
id="stop3156" />
</linearGradient>
<inkscape:perspective
sodipodi:type="inkscape:persp3d"
inkscape:vp_x="0 : 526.18107 : 1"
inkscape:vp_y="0 : 1000 : 0"
inkscape:vp_z="744.09421 : 526.18107 : 1"
inkscape:persp3d-origin="372.04729 : 350.7874 : 1"
id="perspective7" />
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1030">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:8;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1032"
width="56"
height="16"
x="-738.14288"
y="108.81933"
ry="2" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1034">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:8;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1036"
width="56"
height="16"
x="-738.14288"
y="108.81933"
ry="2" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1038">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:8;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1040"
width="56"
height="16"
x="-738.14288"
y="108.81933"
ry="2" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1042">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:8;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1044"
width="56"
height="16"
x="-738.14288"
y="108.81933"
ry="2" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1046">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:8;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1048"
width="56"
height="16"
x="-738.14288"
y="108.81933"
ry="2" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1050">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:8;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1052"
width="56"
height="16"
x="-738.14288"
y="108.81933"
ry="2" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1054">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:8;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1056"
width="56"
height="16"
x="-738.14288"
y="108.81933"
ry="2" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1114">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:7.62770033;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1116"
width="40.000004"
height="43.999992"
x="-730.14288"
y="120.81933"
ry="1.9999998" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1118">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:7.62770033;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1120"
width="40.000004"
height="43.999992"
x="-730.14288"
y="120.81933"
ry="1.9999998" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1122">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:7.62770033;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1124"
width="40.000004"
height="43.999992"
x="-730.14288"
y="120.81933"
ry="1.9999998" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1126">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:7.62770033;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1128"
width="40.000004"
height="43.999992"
x="-730.14288"
y="120.81933"
ry="1.9999998" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1130">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:7.62770033;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1132"
width="40.000004"
height="43.999992"
x="-730.14288"
y="120.81933"
ry="1.9999998" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1134">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:7.62770033;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1136"
width="40.000004"
height="43.999992"
x="-730.14288"
y="120.81933"
ry="1.9999998" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1138">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:7.62770033;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1140"
width="40.000004"
height="43.999992"
x="-730.14288"
y="120.81933"
ry="1.9999998" />
</clipPath>
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath1142">
<rect
style="fill:#ff0000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:7.62770033;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:stroke fill markers"
id="rect1144"
width="40.000004"
height="43.999992"
x="-730.14288"
y="120.81933"
ry="1.9999998" />
</clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="5.12"
inkscape:cx="10.996283"
inkscape:cy="26.188002"
inkscape:document-units="px"
inkscape:current-layer="layer1"
gridtolerance="10000"
inkscape:window-width="1871"
inkscape:window-height="1056"
inkscape:window-x="49"
inkscape:window-y="24"
showgrid="true"
showguides="true"
inkscape:guide-bbox="true"
scale-x="1"
inkscape:pagecheckerboard="true"
borderlayer="true"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid830"
empspacing="4" />
</sodipodi:namedview>
<metadata
id="metadata1906">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Taso 1"
inkscape:groupmode="layer"
id="layer1"
style="opacity:1"
transform="translate(742.14288,-104.81933)">
<rect
style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
id="rect4555"
width="64"
height="64"
x="-742.14288"
y="104.81933" />
<path
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:Ubuntu;-inkscape-font-specification:'Ubuntu, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#e95420;fill-opacity:1;stroke:none;stroke-width:1.58730173px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
inkscape:label="V sx"
sodipodi:nodetypes="cccccccscc"
d="m -715.74074,156.81933 h -5.77778 c -1.43915,-3.1746 -2.85714,-6.37037 -4.25396,-9.5873 -1.3545,-3.25925 -2.75133,-6.66667 -4.19048,-10.22222 -1.39683,-3.55556 -2.83597,-7.30159 -4.31746,-11.2381 -1.48148,-3.97884 -3.00529,-8.29629 -4.57143,-12.95238 h 6.79365 c 2.28572,6.68784 4.52911,13.1217 6.73017,19.30158 2.20105,6.1799 4.4656,11.97885 6.79364,17.39684 4.1793,-2.40296 4.1793,2.49639 2.79365,7.30158 z"
id="path893"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:49.66366577px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.24159169px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="-737.1358"
y="148.89561"
id="text880"><tspan
sodipodi:role="line"
id="tspan878"
x="-737.1358"
y="148.89561"
style="stroke-width:1.24159169px">nc</tspan></text>
<path
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:125%;font-family:Ubuntu;-inkscape-font-specification:'Ubuntu, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#e95420;fill-opacity:1;stroke:none;stroke-width:1.58730173px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
inkscape:label="V dx"
sodipodi:nodetypes="ccsccccccc"
inkscape:connector-curvature="0"
id="path882"
d="m -698.47089,112.81933 c -1.60847,4.65609 -3.15344,8.97354 -4.63492,12.95238 -1.43916,3.93651 -2.85715,7.68254 -4.25397,11.2381 -1.39682,3.55555 -2.79365,6.96297 -4.19048,10.22222 -1.3545,3.21693 -2.75132,6.4127 -4.19048,9.5873 h -5.77778 c -2.63527,-4.80519 -2.63527,-9.70454 2.98413,-7.30158 2.32804,-5.37566 4.5926,-11.15345 6.79365,-17.33334 2.20106,-6.22223 4.42329,-12.67724 6.66667,-19.36508 z" />
<rect
style="fill:#5f14c8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:markers fill stroke"
id="rect4606"
width="28"
height="8"
x="-710.85187"
y="152.81934" />
</g>
</svg>
{
"policy_groups": [
"networking"
],
"policy_version": 16.04
}
{
"description": "VNC client",
"hooks": {
"lomiri-vnc": {
"apparmor": "lomiri_vnc.apparmor",
"desktop": "share/applications/lomiri_vnc.desktop",
"urls": "lomiri_vnc.url-dispatcher"
}
},
"maintainer": "Alberto Mardegan <info@mardy.it>"
}
import qbs 1.0
import qbs.Environment
Project {
name: "Lomiri VNC"
property string packageName: "it.mardy.lomiri-vnc"
property string version: "0.1"
qbsSearchPaths: "qbs"
QtGuiApplication {
name: "LomiriVNC"
version: project.version
install: true
cpp.cxxLanguageVersion: "c++14"
cpp.defines: [
'QT_DISABLE_DEPRECATED_BEFORE=0x050900',
'QT_DEPRECATED_WARNINGS=0',
]
Group {
prefix: "src/"
files: [
"main.cpp",
"types.cpp",
"types.h",
]
}
Group {
prefix: "src/desktop/"
files: [
"qml/ui.qrc",
]
}
Group {
prefix: "data/"
files: [
"icons/icons.qrc",
"lomiri_vnc.desktop",
]
}
Group {
files: "data/lomiri_vnc.svg"
fileTags: "freedesktop.appIcon"
}
Depends { name: "cpp" }
Depends { name: "Qt.core" }
Depends { name: "Qt.quick" }
Depends { name: "Qt.quickcontrols2" }
Depends { name: "Qt.svg" }
Depends { name: "freedesktop" }
freedesktop.name: product.name
/*
* Ubuntu Touch specific configuration
*/
Depends {
name: "ubuntutouch"
condition: Environment.getEnv("TARGET_SYSTEM") == "UbuntuTouch"
}
Properties {
condition: ubuntutouch.present
freedesktop.desktopKeys: ubuntutouch.desktopKeys
ubuntutouch.overrideDesktopKeys: ({
"Icon": "./share/icons/hicolor/scalable/apps/lomiri_vnc.svg",
})
ubuntutouch.manifest: ({
"version": project.version + "-0"
})
}
Group {
condition: ubuntutouch.present
prefix: "data/ubuntu-touch/"
files: [
"manifest.json",
"lomiri_vnc.apparmor",
]
}
Group {
condition: ubuntutouch.present
prefix: "src/ubuntu-touch/"
files: [
"qml/ubuntu-touch.qrc",
]
}
}
}
import qbs
import qbs.FileInfo
import qbs.ModUtils
import qbs.TextFile
Module {
id: ubuntutouchModule
readonly property string clickArchitecture: {
switch (qbs.architecture) {
case "armv7a":
return "armhf";
default:
return qbs.architecture;
}
}
readonly property var defaultManifest: {
return {
'name': project.packageName,
'title': product.name,
'framework': "ubuntu-sdk-16.04",
'architecture': clickArchitecture,
'version': project.version,
}
}
readonly property var defaultDesktopKeys: ({
"Exec": FileInfo.joinPaths(qbs.installPrefix,
product.installDir,
product.targetName),
"X-Ubuntu-Touch": "true",
})
property var overrideDesktopKeys: ({})
readonly property var desktopKeys: {
var ret = defaultDesktopKeys;
for (var key in overrideDesktopKeys) {
ret[key] = overrideDesktopKeys[key];
}
return ret;
}
FileTagger {
patterns: [
"*.accounts",
"*.apparmor",
"*.content-hub",
"*.url-dispatcher",
]
fileTags: ["ubuntutouch.clickfile"]
}
additionalProductTypes: [ "ubuntutouch.clickfile" ]
FileTagger {
patterns: [ "manifest.json" ]
fileTags: [ "ubuntutouch.manifest_source" ]
}
Rule {
inputs: [ "ubuntutouch.manifest_source" ]
outputFileTags: [ "ubuntutouch.manifest", "ubuntutouch.clickfile" ]
outputArtifacts: [
{
fileTags: [ "ubuntutouch.manifest", "ubuntutouch.clickfile" ],
filePath: input.fileName
}
]
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = input.fileName + "->" + output.fileName;
cmd.manifest = ModUtils.moduleProperty(product, "manifest") || {}
cmd.highlight = "codegen";
cmd.sourceCode = function() {
var file = new TextFile(input.filePath);
var content = file.readAll();
file.close();
var originalManifest = JSON.parse(content);
for (key in manifest) {
if (manifest.hasOwnProperty(key)) {
originalManifest[key] = manifest[key];
}
}
var defaultManifest = ModUtils.moduleProperty(product, "defaultManifest");
for (key in defaultManifest) {
if (defaultManifest.hasOwnProperty(key) && !(key in originalManifest)) {
originalManifest[key] = defaultManifest[key];
}
}
file = new TextFile(output.filePath, TextFile.WriteOnly);
file.write(JSON.stringify(originalManifest, null, 2));
file.close();
}
return [cmd];
}
}
Group {
fileTagsFilter: ["ubuntutouch.clickfile"]
qbs.install: true
}
}
import QtQuick 2.9
import QtQuick.Controls 2.2
ToolButton {
text: qsTr("")
}
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
Page {
id: root
title: qsTr("VNC Client")
ColumnLayout {
anchors { left: parent.left; right: parent.right; margins: 8 }
Label {
Layout.fillWidth: true
text: qsTr("Enter the URL of the VNC server to connect to:")
wrapMode: Text.WordWrap
}
TextFieldWithContextMenu {
id: urlField
Layout.fillWidth: true
placeholderText: qsTr("VNC server")
selectByMouse: true
onAccepted: activate()
function activate() {
// TODO
}
}
Button {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Connect")
highlighted: true
onClicked: urlField.activate()
}
}
}