Коммит 57175ce1 создал по автору OMP Education's avatar OMP Education
Просмотр файлов

[Structure] Setup application template

владелец 61202ac1
// SPDX-FileCopyrightText: Copyright 2022-2023 Open Mobile Platform LLC <community@omp.ru>
// SPDX-License-Identifier: BSD-3-Clause
import QtQuick 2.0
import Sailfish.Silica 1.0
ApplicationWindow {
objectName: "applicationWindow"
initialPage: Qt.resolvedUrl("pages/MainPage.qml")
cover: Qt.resolvedUrl("cover/DefaultCoverPage.qml")
allowedOrientations: defaultAllowedOrientations
}
// SPDX-FileCopyrightText: Copyright 2022-2023 Open Mobile Platform LLC <community@omp.ru>
// SPDX-License-Identifier: BSD-3-Clause
import QtQuick 2.0
import Sailfish.Silica 1.0
CoverBackground {
objectName: "defaultCover"
CoverPlaceholder {
objectName: "placeholder"
text: qsTr("Application SensorInspector")
icon {
source: Qt.resolvedUrl("../icons/SensorInspector.svg")
sourceSize { width: icon.width; height: icon.height }
}
forceFit: true
}
}
<svg width="1024" height="1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path id="Background" d="m0 357.5c0-180.46 0-245.38 56.06-301.44s120.99-56.06 326.74-56.06h258.39c205.76 0 270.68 0 326.74 56.06s56.06 120.99 56.06 326.74v258.39c0 205.76 0 270.68-56.06 326.74-56.06 56.059-120.99 56.059-326.74 56.059h-258.39c-205.76 0-270.68 0-326.74-56.059-56.06-56.06-56.06-120.99-56.06-326.74z" fill="#003e88"/>
<mask id="Frame_Mask" maskUnits="userSpaceOnUse">
<use xlink:href="#Background"/>
</mask>
<g fill="none" mask="url(#Frame_Mask)" stroke="#4169e1" stroke-width="1024">
<path d="m-2e-5 512h1024" stroke-dasharray="1.024, 49.152, 1.024, 0"/>
<path d="m512-2.41e-5v1024" stroke-dasharray="1.024, 49.152, 1.024, 0"/>
<path d="m-2e-5 512h1024" stroke-dasharray="2.56, 506.88, 2.56, 0"/>
<path d="m512-2.41e-5v1024" stroke-dasharray="2.56, 506.88, 2.56, 0"/>
</g>
<radialGradient id="Aurora_Gradient" cx="253.16" cy="572.03" r="346.86" gradientTransform="matrix(1.7323 .99965 -1 1.7329 540.61 -618.36)" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff" offset="0"/>
<stop stop-color="#fff" stop-opacity="0" offset="1"/>
</radialGradient>
<path d="m820.13 625.96h-23.404a3.7229 3.7229 0 0 1-3.2222-5.5952l8.1207-14.064a12.388 12.388 0 0 0 0-12.41l-35.161-60.959-53.775 93.007h-17.831a3.7229 3.7229 0 0 1-3.2222-5.5952l59.109-102.32a12.388 12.388 0 0 0 0-12.41l-35.161-60.959-204.15 353.24-9.2745-16.045a9.8624 9.8624 0 0 1 0-9.9277l197.7-341.96a12.388 12.388 0 0 0 0-12.41l-35.161-60.959-204.21 353.19-9.2528-16.045a9.8624 9.8624 0 0 1 0-9.9277l197.75-342.05a12.388 12.388 0 0 0 0-12.41l-35.182-61.003-206.7 357.61h-17.722a3.7229 3.7229 0 0 1-3.2221-5.5952l211.92-366.76a12.453 12.453 0 0 0 0-12.41l-35.182-60.959-257.66 445.72h-17.831a3.7229 3.7229 0 0 1-3.2221-5.5952l263.02-455.02a12.388 12.388 0 0 0 0-12.41l-35.204-60.938-346.86 601.06h208.15l138.16 238.94 138.18-238.94h209.22z" fill="url(#Aurora_Gradient)"/>
</svg>
// SPDX-FileCopyrightText: Copyright 2022-2023 Open Mobile Platform LLC <community@omp.ru>
// SPDX-License-Identifier: BSD-3-Clause
import QtQuick 2.0
import Sailfish.Silica 1.0
Page {
objectName: "aboutPage"
allowedOrientations: Orientation.All
SilicaFlickable {
objectName: "flickable"
anchors.fill: parent
contentHeight: layout.height + Theme.paddingLarge
Column {
id: layout
objectName: "layout"
width: parent.width
PageHeader {
objectName: "pageHeader"
title: qsTr("About Application")
}
Label {
objectName: "descriptionText"
anchors { left: parent.left; right: parent.right; margins: Theme.horizontalPageMargin }
color: palette.highlightColor
font.pixelSize: Theme.fontSizeSmall
textFormat: Text.RichText
wrapMode: Text.WordWrap
text: qsTr("#descriptionText")
}
SectionHeader {
objectName: "licenseHeader"
text: qsTr("3-Clause BSD License")
}
Label {
objectName: "licenseText"
anchors { left: parent.left; right: parent.right; margins: Theme.horizontalPageMargin }
color: palette.highlightColor
font.pixelSize: Theme.fontSizeSmall
textFormat: Text.RichText
wrapMode: Text.WordWrap
text: qsTr("#licenseText")
}
}
}
}
// SPDX-FileCopyrightText: Copyright 2022-2023 Open Mobile Platform LLC <community@omp.ru>
// SPDX-License-Identifier: BSD-3-Clause
import QtQuick 2.0
import Sailfish.Silica 1.0
Page {
objectName: "mainPage"
allowedOrientations: Orientation.All
PageHeader {
objectName: "pageHeader"
title: qsTr("Application SensorInspector")
extraContent.children: [
IconButton {
objectName: "aboutButton"
icon.source: "image://theme/icon-m-about"
anchors.verticalCenter: parent.verticalCenter
onClicked: pageStack.push(Qt.resolvedUrl("AboutPage.qml"))
}
]
}
}
Name: ru.auroraos.SensorInspector
Summary: Aurora OS Application
Version: 0.1
Release: 1
Group: Qt/Qt
License: BSD-3-Clause
URL: https://auroraos.ru
Source0: %{name}-%{version}.tar.bz2
Requires: sailfishsilica-qt5 >= 0.10.9
BuildRequires: pkgconfig(auroraapp)
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: desktop-file-utils
%description
The project provides an example of using device sensors
%prep
%autosetup
%build
%qmake5
%make_build
%install
%make_install
%files
%defattr(-,root,root,-)
%{_bindir}/%{name}
%defattr(644,root,root,-)
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
[Desktop Entry]
Type=Application
X-Nemo-Application-Type=silica-qt5
Icon=ru.auroraos.SensorInspector
Exec=/usr/bin/ru.auroraos.SensorInspector
Name=SensorInspector
Name[ru]=Инспектор датчиков
[X-Application]
Permissions=Sensors
OrganizationName=ru.auroraos
ApplicationName=SensorInspector
ExecDBus=/usr/bin/ru.auroraos.SensorInspector
# SPDX-FileCopyrightText: Copyright 2020-2023 Open Mobile Platform LLC <community@omp.ru>
# SPDX-License-Identifier: BSD-3-Clause
TARGET = ru.auroraos.SensorInspector
CONFIG += \
auroraapp
PKGCONFIG += \
SOURCES += \
src/main.cpp \
HEADERS += \
DISTFILES += \
rpm/ru.auroraos.SensorInspector.spec \
AUTHORS.md \
CODE_OF_CONDUCT.md \
CONTRIBUTING.md \
LICENSE.BSD-3-CLAUSE.md \
README.md \
AURORAAPP_ICONS = 86x86 108x108 128x128 172x172
CONFIG += auroraapp_i18n
TRANSLATIONS += \
translations/ru.auroraos.SensorInspector.ts \
translations/ru.auroraos.SensorInspector-ru.ts \
/*******************************************************************************
**
** Copyright (C) 2022 ru.auroraos
**
** This file is part of the Aurora OS Application SensorInspector project.
**
** Redistribution and use in source and binary forms,
** with or without modification, are permitted provided
** that the following conditions are met:
**
** * Redistributions of source code must retain the above copyright notice,
** this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright notice,
** this list of conditions and the following disclaimer
** in the documentation and/or other materials provided with the distribution.
** * Neither the name of the copyright holder nor the names of its contributors
** may be used to endorse or promote products derived from this software
** without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
** THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
** OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
** LOSS OF USE, DATA, OR PROFITS;
** OR BUSINESS INTERRUPTION)
** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
** WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE)
** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
** EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
*******************************************************************************/
#include <auroraapp.h>
#include <QtQuick>
int main(int argc, char *argv[])
{
QScopedPointer<QGuiApplication> application(Aurora::Application::application(argc, argv));
application->setOrganizationName(QStringLiteral("ru.auroraos"));
application->setApplicationName(QStringLiteral("SensorInspector"));
QScopedPointer<QQuickView> view(Aurora::Application::createView());
view->setSource(Aurora::Application::pathTo(QStringLiteral("qml/SensorInspector.qml")));
view->show();
return application->exec();
}
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ru">
<context>
<name>AboutPage</name>
<message>
<location filename="../qml/pages/AboutPage.qml" line="23"/>
<source>About Application</source>
<translation>О приложении</translation>
</message>
<message>
<location filename="../qml/pages/AboutPage.qml" line="33"/>
<source>#descriptionText</source>
<translation>&lt;p&gt;Проект предоставляет пример ипользования датчиков устройства:
отображает доступные датчики устройства, позволят включать и отключать получение данных от датчиков,
отображает полученные данные.&lt;/p&gt;</translation>
</message>
<message>
<location filename="../qml/pages/AboutPage.qml" line="38"/>
<source>3-Clause BSD License</source>
<translation>Лицензия 3-Clause BSD</translation>
</message>
<message>
<location filename="../qml/pages/AboutPage.qml" line="48"/>
<source>#licenseText</source>
<translation>&lt;p&gt;&lt;i&gt;Copyright (C) 2022 ru.auroraos&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.&lt;/li&gt;
&lt;li&gt;Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.&lt;/li&gt;
&lt;li&gt;Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;/p&gt;</translation>
</message>
</context>
<context>
<name>DefaultCoverPage</name>
<message>
<location filename="../qml/cover/DefaultCoverPage.qml" line="12"/>
<source>Application SensorInspector</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainPage</name>
<message>
<location filename="../qml/pages/MainPage.qml" line="13"/>
<source>Application SensorInspector</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en">
<context>
<name>AboutPage</name>
<message>
<location filename="../qml/pages/AboutPage.qml" line="23"/>
<source>About Application</source>
<translation>About Application</translation>
</message>
<message>
<location filename="../qml/pages/AboutPage.qml" line="33"/>
<source>#descriptionText</source>
<translation>&lt;p&gt;The project provides an example of using device sensors.&lt;/p&gt;&lt;p&gt;
The main purpose is to show the work with device sensors: displaying available sensors,
activate/desactivate them, getting data from them.&lt;/p&gt;</translation>
</message>
<message>
<location filename="../qml/pages/AboutPage.qml" line="38"/>
<source>3-Clause BSD License</source>
<translation>3-Clause BSD License</translation>
</message>
<message>
<location filename="../qml/pages/AboutPage.qml" line="48"/>
<source>#licenseText</source>
<translation>&lt;p&gt;&lt;i&gt;Copyright (C) 2022 ru.auroraos&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.&lt;/li&gt;
&lt;li&gt;Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.&lt;/li&gt;
&lt;li&gt;Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;/p&gt;</translation>
</message>
</context>
<context>
<name>DefaultCoverPage</name>
<message>
<location filename="../qml/cover/DefaultCoverPage.qml" line="12"/>
<source>Application SensorInspector</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>MainPage</name>
<message>
<location filename="../qml/pages/MainPage.qml" line="13"/>
<source>Application SensorInspector</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать