Rework overlay/branding mechanism

This commit is contained in:
Michael Zanetti 2021-03-29 18:50:50 +02:00
parent 608c02799c
commit 4a2f4b341e
36 changed files with 117 additions and 105 deletions

View File

@ -21,11 +21,12 @@ linux:!android {
android: { android: {
QMAKE_CXXFLAGS += -Wno-deprecated-declarations QMAKE_CXXFLAGS += -Wno-deprecated-declarations
!equals(OVERLAY_PATH, ""):!equals(BRANDING, "") { equals(OVERLAY_PATH, "") {
ANDROID_PACKAGE_SOURCE_DIR = $${OVERLAY_PATH}/packaging/android_$$BRANDING
} else {
ANDROID_PACKAGE_SOURCE_DIR = $${top_srcdir}/packaging/android ANDROID_PACKAGE_SOURCE_DIR = $${top_srcdir}/packaging/android
} else {
ANDROID_PACKAGE_SOURCE_DIR = $${OVERLAY_PATH}/packaging/android
} }
message("Android package directory: $${ANDROID_PACKAGE_SOURCE_DIR}")
!no-firebase:DEFINES+=WITH_FIREBASE !no-firebase:DEFINES+=WITH_FIREBASE
} }

View File

@ -15,7 +15,7 @@ withtests: {
# $ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" # $ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
# $ make wininstaller # $ make wininstaller
wininstaller.depends = nymea-app wininstaller.depends = nymea-app
!equals(OVERLAY_PATH, ""):!equals(BRANDING, "") { !equals(OVERLAY_PATH, "") {
PACKAGE_BASE_DIR = $${OVERLAY_PATH}\packaging PACKAGE_BASE_DIR = $${OVERLAY_PATH}\packaging
} else { } else {
PACKAGE_BASE_DIR = $$shell_path($$PWD)\packaging PACKAGE_BASE_DIR = $$shell_path($$PWD)\packaging

3
nymea-app/config.txt Normal file
View File

@ -0,0 +1,3 @@
[General]
organisation=nymea
app=nymea-app

View File

@ -70,19 +70,19 @@ int main(int argc, char *argv[])
); );
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication application(argc, argv); QApplication application(argc, argv);
application.setApplicationName("nymea-app");
application.setOrganizationName("nymea"); QSettings config(":/config.txt", QSettings::IniFormat);
application.setApplicationName(config.value("app").toString());
application.setOrganizationName(config.value("organisation").toString());
QCommandLineParser parser; QCommandLineParser parser;
parser.addHelpOption(); parser.addHelpOption();
QCommandLineOption connectOption = QCommandLineOption({"c", "connect"}, "Connect to nymea:core without discovery.", "host"); QCommandLineOption connectOption = QCommandLineOption({"c", "connect"}, "Connect to nymea:core without discovery.", "host");
parser.addOption(connectOption); parser.addOption(connectOption);
#ifndef BRANDING
QCommandLineOption styleOption = QCommandLineOption({"s", "style"}, "Override the style. Style in settings will be disabled.", "style"); QCommandLineOption styleOption = QCommandLineOption({"s", "style"}, "Override the style. Style in settings will be disabled.", "style");
parser.addOption(styleOption); parser.addOption(styleOption);
QCommandLineOption defaultStyleOption = QCommandLineOption({"d", "default-style"}, "The default style to be used if there is no style explicitly selected by the user yet.", "style"); QCommandLineOption defaultStyleOption = QCommandLineOption({"d", "default-style"}, "The default style to be used if there is no style explicitly selected by the user yet.", "style");
parser.addOption(defaultStyleOption); parser.addOption(defaultStyleOption);
#endif
QCommandLineOption defaultViewsOption = QCommandLineOption({"v", "default-views"}, "The main views enabled by default if there is no configuration done by the user and the style doesn't dictate them, comma separated.", "mainviews"); QCommandLineOption defaultViewsOption = QCommandLineOption({"v", "default-views"}, "The main views enabled by default if there is no configuration done by the user and the style doesn't dictate them, comma separated.", "mainviews");
parser.addOption(defaultViewsOption); parser.addOption(defaultViewsOption);
QCommandLineOption kioskOption = QCommandLineOption({"k", "kiosk"}, "Start the application in kiosk mode."); QCommandLineOption kioskOption = QCommandLineOption({"k", "kiosk"}, "Start the application in kiosk mode.");
@ -98,7 +98,7 @@ int main(int argc, char *argv[])
qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)); qtTranslator.load("qt_" + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
application.installTranslator(&qtTranslator); application.installTranslator(&qtTranslator);
qCInfo(dcApplication()) << "nymea:app" << APP_VERSION << "running on" << QSysInfo::machineHostName() << QSysInfo::prettyProductName() << QSysInfo::productType() << QSysInfo::productVersion(); qCInfo(dcApplication()) << application.applicationName() << APP_VERSION << "running on" << QSysInfo::machineHostName() << QSysInfo::prettyProductName() << QSysInfo::productType() << QSysInfo::productVersion();
qCInfo(dcApplication()) << "Locale info:" << QLocale() << QLocale().name() << QLocale().language() << QLocale().system(); qCInfo(dcApplication()) << "Locale info:" << QLocale() << QLocale().name() << QLocale().language() << QLocale().system();
QTranslator appTranslator; QTranslator appTranslator;
@ -114,10 +114,6 @@ int main(int argc, char *argv[])
QQmlApplicationEngine *engine = new QQmlApplicationEngine(); QQmlApplicationEngine *engine = new QQmlApplicationEngine();
#if defined BRANDING
StyleController styleController(BRANDING);
styleController.lockToStyle(BRANDING);
#else
QString defaultStyle; QString defaultStyle;
if (parser.isSet(defaultStyleOption)) { if (parser.isSet(defaultStyleOption)) {
defaultStyle = parser.value(defaultStyleOption); defaultStyle = parser.value(defaultStyleOption);
@ -131,7 +127,6 @@ int main(int argc, char *argv[])
qCInfo(dcApplication()) << "Setting style to" << defaultStyle; qCInfo(dcApplication()) << "Setting style to" << defaultStyle;
styleController.lockToStyle(parser.value(styleOption)); styleController.lockToStyle(parser.value(styleOption));
} }
#endif
QQmlFileSelector *styleSelector = new QQmlFileSelector(engine); QQmlFileSelector *styleSelector = new QQmlFileSelector(engine);
styleSelector->setExtraSelectors({styleController.currentStyle()}); styleSelector->setExtraSelectors({styleController.currentStyle()});
@ -145,6 +140,7 @@ int main(int argc, char *argv[])
} }
qmlRegisterSingletonType(QUrl("qrc:///styles/" + styleController.currentStyle() + "/Style.qml"), "Nymea", 1, 0, "Style" ); qmlRegisterSingletonType(QUrl("qrc:///styles/" + styleController.currentStyle() + "/Style.qml"), "Nymea", 1, 0, "Style" );
qmlRegisterSingletonType(QUrl("qrc:///ui/Configuration.qml"), "Nymea", 1, 0, "Configuration");
engine->rootContext()->setContextProperty("styleController", &styleController); engine->rootContext()->setContextProperty("styleController", &styleController);

View File

@ -44,11 +44,12 @@ RESOURCES += resources.qrc \
ruletemplates.qrc \ ruletemplates.qrc \
images.qrc \ images.qrc \
translations.qrc \ translations.qrc \
styles.qrc
!equals(OVERLAY_PATH, "") { !equals(OVERLAY_PATH, "") {
message("Resource overlay enabled. Will be using overlay from $${OVERLAY_PATH}") message("Resource overlay enabled. Will be using overlay from $${OVERLAY_PATH}")
RESOURCES += $${OVERLAY_PATH}/overlay.qrc RESOURCES += $${OVERLAY_PATH}/overlay.qrc
} else {
RESOURCES += styles.qrc
} }
win32 { win32 {
@ -178,7 +179,7 @@ ubports: {
BR=$$BRANDING BR=$$BRANDING
!equals(BR, "") { !equals(BR, "") {
message("Branding the style to: $${BR}") message("Branding the to: $${BR}")
DEFINES += BRANDING=\\\"$${BR}\\\" DEFINES += BRANDING=\\\"$${BR}\\\"
win32:RCC_ICONS += ../packaging/windows_$${BR}/packages/io.guh.$${BR}/meta/logo.ico win32:RCC_ICONS += ../packaging/windows_$${BR}/packages/io.guh.$${BR}/meta/logo.ico
} else { } else {

View File

@ -77,7 +77,7 @@ public class NymeaAppActivity extends org.qtproject.qt5.android.bindings.QtActiv
} }
} }
public boolean nightModeEnabled() { public boolean darkModeEnabled() {
return (getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES; return (getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES;
} }
} }

View File

@ -233,5 +233,6 @@
<file>ui/devicepages/ThermostatDevicePage.qml</file> <file>ui/devicepages/ThermostatDevicePage.qml</file>
<file>ui/components/BigThingTile.qml</file> <file>ui/components/BigThingTile.qml</file>
<file>ui/appsettings/LoggingCategories.qml</file> <file>ui/appsettings/LoggingCategories.qml</file>
<file>ui/ConfigurationBase.qml</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -31,5 +31,7 @@
<file>styles/energize/logo-wide.svg</file> <file>styles/energize/logo-wide.svg</file>
<file>styles/lime/logo-wide.svg</file> <file>styles/lime/logo-wide.svg</file>
<file>styles/noir/logo-wide.svg</file> <file>styles/noir/logo-wide.svg</file>
<file>ui/Configuration.qml</file>
<file>config.txt</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -0,0 +1,6 @@
pragma Singleton
import QtQuick 2.0
Item {
}

View File

@ -0,0 +1,6 @@
import QtQuick 2.0
Item {
property string systemName: "nymea"
property string appName: "nymea:app"
}

View File

@ -49,7 +49,7 @@ Drawer {
ColumnLayout { ColumnLayout {
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost ? root.currentEngine.jsonRpcClient.currentHost.name : app.systemName text: root.currentEngine && root.currentEngine.jsonRpcClient.currentHost ? root.currentEngine.jsonRpcClient.currentHost.name : Configuration.systemName
} }
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true

View File

@ -99,8 +99,8 @@ Page {
// 2. Style mainViewsFilter as that comes with branding (for now, if a style defines main views, all of them are active by default) // 2. Style mainViewsFilter as that comes with branding (for now, if a style defines main views, all of them are active by default)
// 3. Command line args // 3. Command line args
// 4. Just show "things" alone by default // 4. Just show "things" alone by default
property var filterList: app.hasOwnProperty("mainViewsFilter") ? property var filterList: Configuration.hasOwnProperty("mainViewsFilter") ?
app.mainViewsFilter Configuration.mainViewsFilter
: defaultMainViewFilter.length > 0 ? : defaultMainViewFilter.length > 0 ?
defaultMainViewFilter.split(',') defaultMainViewFilter.split(',')
: ["things"] : ["things"]
@ -109,7 +109,6 @@ Page {
ListModel { ListModel {
id: mainMenuBaseModel id: mainMenuBaseModel
// TODO: Should read this from disk somehow maybe?
ListElement { name: "things"; source: "ThingsView"; displayName: qsTr("Things"); icon: "things" } ListElement { name: "things"; source: "ThingsView"; displayName: qsTr("Things"); icon: "things" }
ListElement { name: "favorites"; source: "FavoritesView"; displayName: qsTr("Favorites"); icon: "starred" } ListElement { name: "favorites"; source: "FavoritesView"; displayName: qsTr("Favorites"); icon: "starred" }
ListElement { name: "groups"; source: "GroupsView"; displayName: qsTr("Groups"); icon: "view-grid-symbolic" } ListElement { name: "groups"; source: "GroupsView"; displayName: qsTr("Groups"); icon: "view-grid-symbolic" }
@ -129,9 +128,9 @@ Page {
var newItems = 0 var newItems = 0
// Add extra views first to make them appear first in the list unless the config says otherwise // Add extra views first to make them appear first in the list unless the config says otherwise
if (app.hasOwnProperty("additionalMainViews")) { if (Configuration.hasOwnProperty("additionalMainViews")) {
for (var i = 0; i < app.additionalMainViews.count; i++) { for (var i = 0; i < Configuration.additionalMainViews.count; i++) {
var item = app.additionalMainViews.get(i); var item = Configuration.additionalMainViews.get(i);
var idx = mainViewSettings.sortOrder.indexOf(item.name); var idx = mainViewSettings.sortOrder.indexOf(item.name);
if (idx === -1) { if (idx === -1) {
newList[newItems++] = item; newList[newItems++] = item;
@ -153,7 +152,7 @@ Page {
} }
clear(); clear();
var brandingFilter = app.hasOwnProperty("mainViewsFilter") ? app.mainViewsFilter : [] var brandingFilter = Configuration.hasOwnProperty("mainViewsFilter") ? Configuration.mainViewsFilter : []
for (idx in configList) { for (idx in configList) {
item = configList[idx]; item = configList[idx];

View File

@ -46,7 +46,7 @@ ApplicationWindow {
minimumHeight: 480 minimumHeight: 480
visibility: kioskMode ? ApplicationWindow.FullScreen : settings.viewMode visibility: kioskMode ? ApplicationWindow.FullScreen : settings.viewMode
color: Material.background color: Material.background
title: app.appName title: Configuration.appName
Material.theme: NymeaUtils.isDark(Style.backgroundColor) ? Material.Dark : Material.Light Material.theme: NymeaUtils.isDark(Style.backgroundColor) ? Material.Dark : Material.Light
Material.background: Style.backgroundColor Material.background: Style.backgroundColor
@ -59,9 +59,6 @@ ApplicationWindow {
font.capitalization: Font.MixedCase font.capitalization: Font.MixedCase
font.family: Style.fontFamily font.family: Style.fontFamily
property string appName: "appBranding" in app ? app.appBranding : "nymea:app"
property string systemName: "coreBranding" in app ? app.coreBranding : "nymea"
property int margins: 16 property int margins: 16
property int bigMargins: 20 property int bigMargins: 20

View File

@ -39,7 +39,7 @@ Page {
signal backPressed(); signal backPressed();
header: NymeaHeader { header: NymeaHeader {
text: qsTr("Welcome to %1!").arg(app.systemName) text: qsTr("Welcome to %1!").arg(Configuration.systemName)
backButtonVisible: true backButtonVisible: true
onBackPressed: { onBackPressed: {
root.backPressed(); root.backPressed();
@ -87,7 +87,7 @@ Page {
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: qsTr("Please press the button on your %1 box to authenticate this device.").arg(app.systemName) text: qsTr("Please press the button on your %1 box to authenticate this device.").arg(Configuration.systemName)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }

View File

@ -182,7 +182,7 @@ Item {
} }
print("Warning: There is a last connected host but UUID is unknown to discovery...") print("Warning: There is a last connected host but UUID is unknown to discovery...")
} else if (autoConnectHost.length > 0) { } else if (autoConnectHost.length > 0) {
var host = nymeaDiscovery.nymeaHosts.createLanHost(app.systemName, autoConnectHost); var host = nymeaDiscovery.nymeaHosts.createLanHost(Configuration.systemName, autoConnectHost);
engine.jsonRpcClient.connectToHost(host) engine.jsonRpcClient.connectToHost(host)
} else { } else {
// Only hide the splash right away if we're not trying to connect to something // Only hide the splash right away if we're not trying to connect to something
@ -445,8 +445,8 @@ Item {
} }
Label { Label {
text: popup.minVersion != "" text: popup.minVersion != ""
? qsTr("The version of the %1:core you are trying to connect to is too old. This app requires at least version %2 but this %1:core only supports %3. Please update your %1:core system.").arg(app.systemName).arg(popup.minVersion).arg(popup.actualVersion) ? qsTr("The version of the %1 system you are trying to connect to is too old. This app requires at least version %2 but this %1 system only supports %3. Please update your %1 system.").arg(Configuration.systemName).arg(popup.minVersion).arg(popup.actualVersion)
: qsTr("The version of the %1:core you are trying to connect to is too new. This app supports only up to version %2 but this %1:core provides %3. Please update %1:app.").arg(app.systemName).arg(popup.maxVersion).arg(popup.actualVersion) : qsTr("The version of the %1 system you are trying to connect to is too new. This app supports only up to version %2 but this %1 system provides %3. Please update %4.").arg(Configuration.systemName).arg(popup.maxVersion).arg(popup.actualVersion).arg(Configuration.appName)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
Layout.fillWidth: true Layout.fillWidth: true
} }

View File

@ -112,7 +112,7 @@ Page {
width: parent.width width: parent.width
iconName: "../images/connections/cloud.svg" iconName: "../images/connections/cloud.svg"
text: qsTr("Cloud") text: qsTr("Cloud")
subText: qsTr("Connect this %1:core to %1:cloud").arg(app.systemName) subText: qsTr("Connect this %1 system to %1:cloud").arg(Configuration.systemName)
prominentSubText: false prominentSubText: false
wrapTexts: false wrapTexts: false
onClicked: pageStack.push(Qt.resolvedUrl("system/CloudSettingsPage.qml")) onClicked: pageStack.push(Qt.resolvedUrl("system/CloudSettingsPage.qml"))
@ -228,7 +228,7 @@ Page {
width: parent.width width: parent.width
iconName: "../images/system-update.svg" iconName: "../images/system-update.svg"
text: qsTr("System update") text: qsTr("System update")
subText: qsTr("Update your %1:core system").arg(app.systemName) subText: qsTr("Update your %1 system").arg(Configuration.systemName)
prominentSubText: false prominentSubText: false
wrapTexts: false wrapTexts: false
onClicked: pageStack.push(Qt.resolvedUrl("system/SystemUpdatePage.qml")) onClicked: pageStack.push(Qt.resolvedUrl("system/SystemUpdatePage.qml"))
@ -259,7 +259,7 @@ Page {
NymeaSwipeDelegate { NymeaSwipeDelegate {
width: parent.width width: parent.width
iconName: "../images/info.svg" iconName: "../images/info.svg"
text: qsTr("About %1:core").arg(app.systemName) text: qsTr("About %1").arg(Configuration.systemName)
subText: qsTr("Find server UUID and versions") subText: qsTr("Find server UUID and versions")
prominentSubText: false prominentSubText: false
wrapTexts: false wrapTexts: false

View File

@ -37,12 +37,12 @@ import "../components"
SettingsPageBase { SettingsPageBase {
id: root id: root
title: qsTr("About %1").arg(app.appName) title: qsTr("About %1").arg(Configuration.appName)
Imprint { Imprint {
id: imprint id: imprint
Layout.fillWidth: true Layout.fillWidth: true
title: app.appName title: Configuration.appName
additionalLicenses: ListModel { additionalLicenses: ListModel {
ListElement { license: "CC-BY-SA-3.0"; component: "Suru icons"; infoText: qsTr("Suru icons by Ubuntu"); platforms: "*" } ListElement { license: "CC-BY-SA-3.0"; component: "Suru icons"; infoText: qsTr("Suru icons by Ubuntu"); platforms: "*" }
ListElement { license: "CC-BY-SA-3.0"; component: "Ubuntu font"; infoText: qsTr("Ubuntu font by Ubuntu"); platforms: "*" } ListElement { license: "CC-BY-SA-3.0"; component: "Ubuntu font"; infoText: qsTr("Ubuntu font by Ubuntu"); platforms: "*" }

View File

@ -77,7 +77,7 @@ Page {
NymeaSwipeDelegate { NymeaSwipeDelegate {
width: parent.width width: parent.width
text: qsTr("Cloud login") text: qsTr("Cloud login")
subText: qsTr("Log into %1:cloud and manage connected %1:core systems").arg(app.systemName) subText: qsTr("Log into %1:cloud and manage connected %1 systems").arg(Configuration.systemName)
iconName: "../images/connections/cloud.svg" iconName: "../images/connections/cloud.svg"
prominentSubText: false prominentSubText: false
wrapTexts: false wrapTexts: false
@ -104,7 +104,7 @@ Page {
padding: 0 padding: 0
NymeaSwipeDelegate { NymeaSwipeDelegate {
width: parent.width width: parent.width
text: qsTr("About %1").arg(app.appName) text: qsTr("About %1").arg(Configuration.appName)
subText: qsTr("Find app versions and licence information") subText: qsTr("Find app versions and licence information")
iconName: "../images/info.svg" iconName: "../images/info.svg"
prominentSubText: false prominentSubText: false

View File

@ -36,7 +36,7 @@ import "../components"
SettingsPageBase { SettingsPageBase {
id: root id: root
title: qsTr("%1 cloud login").arg(app.appName) title: qsTr("%1 cloud login").arg(Configuration.appName)
Component.onCompleted: { Component.onCompleted: {
if (AWSClient.isLoggedIn) { if (AWSClient.isLoggedIn) {
@ -91,7 +91,7 @@ SettingsPageBase {
RowLayout { RowLayout {
SettingsPageSectionHeader { SettingsPageSectionHeader {
text: qsTr("Connected %1:core systems").arg(app.systemName) text: qsTr("Connected %1 systems").arg(Configuration.systemName)
} }
BusyIndicator { BusyIndicator {
running: AWSClient.awsDevices.busy running: AWSClient.awsDevices.busy
@ -107,8 +107,8 @@ SettingsPageBase {
Layout.rightMargin: app.margins Layout.rightMargin: app.margins
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: AWSClient.awsDevices.count === 0 ? text: AWSClient.awsDevices.count === 0 ?
qsTr("There are no %1:core systems connected to your cloud yet.").arg(app.systemName) : qsTr("There are no %1 systems connected to your cloud yet.").arg(Configuration.systemName) :
qsTr("There are %n %1:core systems connected to your cloud.", "", AWSClient.awsDevices.count).arg(app.systemName) qsTr("There are %n %1 systems connected to your cloud.", "", AWSClient.awsDevices.count).arg(Configuration.systemName)
} }
Repeater { Repeater {
@ -151,7 +151,7 @@ SettingsPageBase {
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: app.margins; Layout.rightMargin: app.margins; Layout.topMargin: app.margins Layout.leftMargin: app.margins; Layout.rightMargin: app.margins; Layout.topMargin: app.margins
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: qsTr("Log %1 in to %2:cloud in order to connect to %2:core systems from anywhere and receive push notifications from %2:core systems.").arg(app.appName).arg(app.systemName) text: qsTr("Log %1 in to %2:cloud in order to connect to %2:core systems from anywhere and receive push notifications from %2:core systems.").arg(Configuration.appName).arg(Configuration.systemName)
} }
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
@ -283,7 +283,7 @@ SettingsPageBase {
SettingsPageSectionHeader { SettingsPageSectionHeader {
text: qsTr("Welcome to %1:cloud.").arg(app.systemName) text: qsTr("Welcome to %1:cloud.").arg(Configuration.systemName)
} }
Label { Label {
@ -302,7 +302,7 @@ SettingsPageBase {
Layout.leftMargin: app.margins; Layout.rightMargin: app.margins; Layout.topMargin: app.margins Layout.leftMargin: app.margins; Layout.rightMargin: app.margins; Layout.topMargin: app.margins
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
font.pixelSize: app.smallFont font.pixelSize: app.smallFont
text: qsTr("See our <a href=\"%1\">privacy policy</a> to find out what information is processed. By signing up to %2:cloud you accept those terms and conditions.").arg(app.privacyPolicyUrl).arg(app.systemName) text: qsTr("See our <a href=\"%1\">privacy policy</a> to find out what information is processed. By signing up to %2:cloud you accept those terms and conditions.").arg(app.privacyPolicyUrl).arg(Configuration.systemName)
onLinkActivated: { onLinkActivated: {
Qt.openUrlExternally(link) Qt.openUrlExternally(link)
} }
@ -559,7 +559,7 @@ SettingsPageBase {
MeaDialog { MeaDialog {
id: logoutDialog id: logoutDialog
title: qsTr("Goodbye") title: qsTr("Goodbye")
text: qsTr("Sorry to see you go. If you log out you won't be able to connect to %1:core systems remotely any more. However, you can come back any time, we'll keep your user account. If you whish to completely delete your account and all the data associated with it, check the box below before hitting ok. If you decide to delete your account, all your personal information will be removed from %1:cloud and cannot be restored.").arg(app.systemName) text: qsTr("Sorry to see you go. If you log out you won't be able to connect to %1 systems remotely any more. However, you can come back any time, we'll keep your user account. If you whish to completely delete your account and all the data associated with it, check the box below before hitting ok. If you decide to delete your account, all your personal information will be removed from %1:cloud and cannot be restored.").arg(Configuration.systemName)
headerIcon: "../images/dialog-warning-symbolic.svg" headerIcon: "../images/dialog-warning-symbolic.svg"
standardButtons: Dialog.Cancel | Dialog.Ok standardButtons: Dialog.Cancel | Dialog.Ok

View File

@ -80,7 +80,7 @@ Rectangle {
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
Layout.margins: app.margins * 2 Layout.margins: app.margins * 2
text: qsTr("The system may restart in order to complete the update. %1:app will reconnect automatically after the update.").arg(app.systemName) text: qsTr("The system may restart in order to complete the update. %1:app will reconnect automatically after the update.").arg(Configuration.systemName)
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
font.pixelSize: app.smallFont font.pixelSize: app.smallFont

View File

@ -40,6 +40,6 @@ MeaDialog {
title: qsTr("Insecure connection") title: qsTr("Insecure connection")
headerIcon: "../images/lock-broken.svg" headerIcon: "../images/lock-broken.svg"
text: qsTr("The certificate for this %1 system has changed. This could be because the configuration has been changed, but could also mean the system has been compromised. Do you want to accept the new certificate?").arg(app.systemName) text: qsTr("The certificate for this %1 system has changed. This could be because the configuration has been changed, but could also mean the system has been compromised. Do you want to accept the new certificate?").arg(Configuration.systemName)
standardButtons: Dialog.Ok | Dialog.Cancel standardButtons: Dialog.Ok | Dialog.Cancel
} }

View File

@ -49,7 +49,7 @@ Page {
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Connect %1").arg(app.systemName) text: qsTr("Connect %1").arg(Configuration.systemName)
} }
} }
} }
@ -117,9 +117,9 @@ Page {
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: root.haveHosts ? text: root.haveHosts ?
qsTr("There are %1 %2:cores in your network! Which one would you like to use?").arg(hostsProxy.count).arg(app.systemName) qsTr("There are %n %1 systems in your network! Which one would you like to use?", "", hostsProxy.count).arg(Configuration.systemName)
: startupTimer.running ? qsTr("We haven't found a %1:core in your network yet.").arg(app.systemName) : startupTimer.running ? qsTr("We haven't found a %1 system in your network yet.").arg(Configuration.systemName)
: qsTr("There doesn't seem to be a %1:core installed in your network. Please make sure your %1:core system is correctly set up and connected.").arg(app.systemName) : qsTr("There doesn't seem to be a %1 system installed in your network. Please make sure your %1 system is correctly set up and connected.").arg(Configuration.systemName)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
} }
@ -203,7 +203,7 @@ Page {
visible: !root.haveHosts visible: !root.haveHosts
Label { Label {
text: qsTr("Searching for %1:core systems...").arg(app.systemName) text: qsTr("Searching for %1 systems...").arg(Configuration.systemName)
} }
BusyIndicator { BusyIndicator {
@ -221,7 +221,7 @@ Page {
Layout.rightMargin: app.margins Layout.rightMargin: app.margins
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
visible: nymeaDiscovery.nymeaHosts.count === 0 visible: nymeaDiscovery.nymeaHosts.count === 0
text: qsTr("Do you have a %1:core but it's not connected to your network yet? Use the wireless setup to connect it!").arg(app.systemName) text: qsTr("Do you have a %1 system but it's not connected to your network yet? Use the wireless setup to connect it!").arg(Configuration.systemName)
} }
Button { Button {
Layout.fillWidth: true Layout.fillWidth: true

View File

@ -95,17 +95,17 @@ Page {
errorMessage = qsTr("It seems you're not connected to the network."); errorMessage = qsTr("It seems you're not connected to the network.");
break; break;
case NymeaConnection.ConnectionStatusHostNotFound: case NymeaConnection.ConnectionStatusHostNotFound:
errorMessage = qsTr("%1:core could not be found on this address. Please make sure you entered the address correctly and that the system is powered on.").arg(app.systemName); errorMessage = qsTr("%1 could not be found on this address. Please make sure you entered the address correctly and that the system is powered on.").arg(Configuration.systemName);
break; break;
case NymeaConnection.ConnectionStatusConnectionRefused: case NymeaConnection.ConnectionStatusConnectionRefused:
errorMessage = qsTr("The host has rejected our connection. This probably means that %1 is not running on this host. Perhaps it's restarting?").arg(app.systemName); errorMessage = qsTr("The host has rejected our connection. This probably means that %1 is not running on this host. Perhaps it's restarting?").arg(Configuration.systemName);
break; break;
case NymeaConnection.ConnectionStatusRemoteHostClosed: case NymeaConnection.ConnectionStatusRemoteHostClosed:
errorMessage = qsTr("%1:core has closed the connection. This probably means it has been turned off or restarted.").arg(app.systemName); errorMessage = qsTr("%1 has closed the connection. This probably means it has been turned off or restarted.").arg(Configuration.systemName);
break; break;
case NymeaConnection.ConnectionStatusTimeout: case NymeaConnection.ConnectionStatusTimeout:
errorMessage = qsTr("%1:core did not respond. Please make sure your network connection works properly").arg(app.systemName); errorMessage = qsTr("%1 did not respond. Please make sure your network connection works properly").arg(Configuration.systemName);
break; break;
case NymeaConnection.ConnectionStatusSslError: case NymeaConnection.ConnectionStatusSslError:
errorMessage = qsTr("An unrecovareable SSL Error happened. Please make sure certificates are installed correctly."); errorMessage = qsTr("An unrecovareable SSL Error happened. Please make sure certificates are installed correctly.");

View File

@ -39,7 +39,7 @@ Page {
signal backPressed(); signal backPressed();
header: NymeaHeader { header: NymeaHeader {
text: qsTr("Welcome to %1!").arg(app.systemName) text: qsTr("Welcome to %1!").arg(Configuration.systemName)
backButtonVisible: true backButtonVisible: true
onBackPressed: root.backPressed() onBackPressed: root.backPressed()
} }
@ -70,7 +70,7 @@ Page {
message = qsTr("The password you've chose is too weak.") message = qsTr("The password you've chose is too weak.")
break; break;
case "UserErrorBackendError": case "UserErrorBackendError":
message = qsTr("An error happened with the user storage. Please make sure your %1:core system is installed correctly.").arg(app.systemName) message = qsTr("An error happened with the user storage. Please make sure your %1 system is installed correctly.").arg(Configuration.systemName)
break; break;
} }
var popup = errorDialog.createObject(root, {text: message}); var popup = errorDialog.createObject(root, {text: message});
@ -102,8 +102,8 @@ Page {
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: engine.jsonRpcClient.initialSetupRequired ? text: engine.jsonRpcClient.initialSetupRequired ?
qsTr("In order to use your %1 system, please enter your email address and set a password for it.").arg(app.systemName) qsTr("In order to use your %1 system, please enter your email address and set a password for it.").arg(Configuration.systemName)
: qsTr("In order to use your %1 system, please log in.").arg(app.systemName) : qsTr("In order to use your %1 system, please log in.").arg(Configuration.systemName)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
} }

View File

@ -47,8 +47,8 @@ Page {
EmptyViewPlaceholder { EmptyViewPlaceholder {
anchors.centerIn: parent anchors.centerIn: parent
width: parent.width - app.margins * 2 width: parent.width - app.margins * 2
title: qsTr("Welcome to %1!").arg(app.systemName) title: qsTr("Welcome to %1!").arg(Configuration.systemName)
text: qsTr("This %1 system has not been set up yet. This wizard will guide you through a few simple steps to set it up.").arg(app.systemName) text: qsTr("This %1 system has not been set up yet. This wizard will guide you through a few simple steps to set it up.").arg(Configuration.systemName)
imageSource: "qrc:/styles/%1/logo.svg".arg(styleController.currentStyle) imageSource: "qrc:/styles/%1/logo.svg".arg(styleController.currentStyle)
buttonText: qsTr("Next") buttonText: qsTr("Next")
onButtonClicked: { onButtonClicked: {

View File

@ -116,7 +116,7 @@ Page {
Layout.margins: app.margins Layout.margins: app.margins
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Searching for %1:core systems.").arg(app.systemName) text: qsTr("Searching for %1 systems.").arg(Configuration.systemName)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
BusyIndicator { BusyIndicator {
@ -157,7 +157,7 @@ Page {
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
maximumLineCount: 2 maximumLineCount: 2
elide: Text.ElideRight elide: Text.ElideRight
text: qsTr("Troubles finding your %1:core?").arg(app.systemName) text: qsTr("Troubles finding your %1 system?").arg(Configuration.systemName)
} }
Button { Button {
text: qsTr("Help") text: qsTr("Help")
@ -246,7 +246,7 @@ Page {
Layout.leftMargin: app.margins Layout.leftMargin: app.margins
Layout.rightMargin: app.margins Layout.rightMargin: app.margins
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: qsTr("If you have a %1 box, plug it into a power socket and wait for it to be booted. Once the LED pulses slowly, press the button for 3 seconds until the LED changes.").arg(app.systemName) text: qsTr("If you have a %1 box, plug it into a power socket and wait for it to be booted. Once the LED pulses slowly, press the button for 3 seconds until the LED changes.").arg(Configuration.systemName)
} }
Image { Image {
Layout.preferredWidth: app.iconSize * 5 Layout.preferredWidth: app.iconSize * 5

View File

@ -238,7 +238,7 @@ Page {
Layout.fillWidth: true Layout.fillWidth: true
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: qsTr("Connecting the %1:core to %2").arg(app.systemName).arg(connectingWifiWaitPage.ssid) text: qsTr("Connecting %1 to %2").arg(Configuration.systemName).arg(connectingWifiWaitPage.ssid)
} }
} }
} }

View File

@ -120,7 +120,7 @@ Page {
Layout.leftMargin: app.margins; Layout.rightMargin: app.margins Layout.leftMargin: app.margins; Layout.rightMargin: app.margins
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: root.wifiSetup.currentConnection text: root.wifiSetup.currentConnection
? qsTr("Your %1:core is connected to %2").arg(app.systemName).arg(root.wifiSetup.currentConnection.ssid) ? qsTr("Your %1 system is connected to %2").arg(Configuration.systemName).arg(root.wifiSetup.currentConnection.ssid)
: "" : ""
} }
@ -137,7 +137,7 @@ Page {
spacing: app.margins spacing: app.margins
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Waiting for the %1:core to appear in your network.").arg(app.systemName) text: qsTr("Waiting for the %1 to appear in your network.").arg(Configuration.systemName)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
BusyIndicator { } BusyIndicator { }
@ -148,7 +148,7 @@ Page {
visible: host !== null visible: host !== null
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: app.margins; Layout.rightMargin: app.margins Layout.leftMargin: app.margins; Layout.rightMargin: app.margins
text: qsTr("Connect to %1:core").arg(app.systemName) text: qsTr("Connect to %1").arg(Configuration.systemName)
property NymeaHost host: null property NymeaHost host: null
onClicked: { onClicked: {
print("connecting to", host) print("connecting to", host)

View File

@ -73,9 +73,9 @@ MainViewBase {
anchors { left: parent.left; right: parent.right; margins: app.margins } anchors { left: parent.left; right: parent.right; margins: app.margins }
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
visible: engine.thingManager.things.count === 0 && !engine.thingManager.fetchingData visible: engine.thingManager.things.count === 0 && !engine.thingManager.fetchingData
title: qsTr("Welcome to %1!").arg(app.systemName) title: qsTr("Welcome to %1!").arg(Configuration.systemName)
// Have that split in 2 because we need those strings separated in EditDevicesPage too and don't want translators to do them twice // Have that split in 2 because we need those strings separated in EditDevicesPage too and don't want translators to do them twice
text: qsTr("There are no things set up yet.") + "\n" + qsTr("In order for your %1 system to be useful, go ahead and add some things.").arg(app.systemName) text: qsTr("There are no things set up yet.") + "\n" + qsTr("In order for your %1 system to be useful, go ahead and add some things.").arg(Configuration.systemName)
imageSource: "qrc:/styles/%1/logo.svg".arg(styleController.currentStyle) imageSource: "qrc:/styles/%1/logo.svg".arg(styleController.currentStyle)
buttonText: qsTr("Add things") buttonText: qsTr("Add things")
onButtonClicked: pageStack.push(Qt.resolvedUrl("../thingconfiguration/NewThingPage.qml")) onButtonClicked: pageStack.push(Qt.resolvedUrl("../thingconfiguration/NewThingPage.qml"))

View File

@ -36,13 +36,13 @@ import "../components"
SettingsPageBase { SettingsPageBase {
id: root id: root
title: qsTr("About %1:core").arg(app.systemName) title: qsTr("About %1").arg(Configuration.systemName)
Imprint { Imprint {
id: imprint id: imprint
Layout.fillWidth: true Layout.fillWidth: true
title: qsTr("%1:core").arg(app.systemName) title: qsTr("%1").arg(Configuration.systemName)
githubLink: "https://github.com/nymea/nymea" githubLink: "https://github.com/nymea/nymea"
NymeaSwipeDelegate { NymeaSwipeDelegate {

View File

@ -36,7 +36,7 @@ import "../components"
SettingsPageBase { SettingsPageBase {
id: root id: root
title: qsTr("%1:core cloud settings").arg(app.systemName) title: qsTr("%1 cloud settings").arg(Configuration.systemName)
Item { Item {
id: d id: d
@ -64,7 +64,7 @@ SettingsPageBase {
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: app.margins Layout.leftMargin: app.margins
Layout.rightMargin: app.margins Layout.rightMargin: app.margins
text: qsTr("Connect %1:core to %1:cloud in order to access it from anywhere and send push notifications from %1:core to %2.").arg(app.systemName).arg(app.appName) text: qsTr("Connect %1 to %1:cloud in order to access it from anywhere.").arg(Configuration.systemName).arg(Configuration.appName)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
@ -107,16 +107,16 @@ SettingsPageBase {
text: { text: {
switch (engine.jsonRpcClient.cloudConnectionState) { switch (engine.jsonRpcClient.cloudConnectionState) {
case JsonRpcClient.CloudConnectionStateDisabled: case JsonRpcClient.CloudConnectionStateDisabled:
return qsTr("This box is not connected to %1:cloud").arg(app.systemName) return qsTr("This box is not connected to %1:cloud").arg(Configuration.systemName)
case JsonRpcClient.CloudConnectionStateUnconfigured: case JsonRpcClient.CloudConnectionStateUnconfigured:
if (d.deploymentStarted) { if (d.deploymentStarted) {
return qsTr("Registering box in %1:cloud...").arg(app.systemName) return qsTr("Registering box in %1:cloud...").arg(Configuration.systemName)
} }
return qsTr("This box is not configured to connect to %1:cloud.").arg(app.systemName); return qsTr("This box is not configured to connect to %1:cloud.").arg(Configuration.systemName);
case JsonRpcClient.CloudConnectionStateConnecting: case JsonRpcClient.CloudConnectionStateConnecting:
return qsTr("Connecting the box to %1:cloud...").arg(app.systemName); return qsTr("Connecting the box to %1:cloud...").arg(Configuration.systemName);
case JsonRpcClient.CloudConnectionStateConnected: case JsonRpcClient.CloudConnectionStateConnected:
return qsTr("The box is connected to %1:cloud.").arg(app.systemName); return qsTr("The box is connected to %1:cloud.").arg(Configuration.systemName);
} }
return engine.jsonRpcClient.cloudConnectionState return engine.jsonRpcClient.cloudConnectionState
} }
@ -132,7 +132,7 @@ SettingsPageBase {
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: app.margins; Layout.rightMargin: app.margins Layout.leftMargin: app.margins; Layout.rightMargin: app.margins
visible: engine.jsonRpcClient.cloudConnectionState === JsonRpcClient.CloudConnectionStateUnconfigured && !d.deploymentStarted visible: engine.jsonRpcClient.cloudConnectionState === JsonRpcClient.CloudConnectionStateUnconfigured && !d.deploymentStarted
text: qsTr("This box is not configured to access the %1:cloud. In order for a box to connect to %1:cloud it needs to be registered first.").arg(app.systemName) text: qsTr("This box is not configured to access the %1:cloud. In order for a box to connect to %1:cloud it needs to be registered first.").arg(Configuration.systemName)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
@ -160,13 +160,13 @@ SettingsPageBase {
Layout.leftMargin: app.margins Layout.leftMargin: app.margins
Layout.rightMargin: app.margins Layout.rightMargin: app.margins
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: qsTr("In order to remotely connect to this %1:core, %2 needs to be logged into %1:cloud as well.").arg(app.systemName).arg(app.appName) text: qsTr("In order to remotely connect to this %1 system, %2 needs to be logged into %1:cloud as well.").arg(Configuration.systemName).arg(Configuration.appName)
} }
NymeaSwipeDelegate { NymeaSwipeDelegate {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Go to app settings") text: qsTr("Go to app settings")
subText: qsTr("Set up cloud connection for %1").arg(app.appName) subText: qsTr("Set up cloud connection for %1").arg(Configuration.appName)
prominentSubText: false prominentSubText: false
onClicked: { onClicked: {
pageStack.push(Qt.resolvedUrl("../appsettings/CloudLoginPage.qml")) pageStack.push(Qt.resolvedUrl("../appsettings/CloudLoginPage.qml"))

View File

@ -223,15 +223,15 @@ SettingsPageBase {
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: app.margins Layout.leftMargin: app.margins
Layout.rightMargin: app.margins Layout.rightMargin: app.margins
text: qsTr("Restart %1:core").arg(app.systemName) text: qsTr("Restart %1").arg(Configuration.systemName)
visible: engine.systemController.powerManagementAvailable && engine.jsonRpcClient.ensureServerVersion("5.1") visible: engine.systemController.powerManagementAvailable && engine.jsonRpcClient.ensureServerVersion("5.1")
onClicked: { onClicked: {
var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml")); var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml"));
var text = qsTr("Are you sure you want to restart %1:core now?").arg(app.systemName) var text = qsTr("Are you sure you want to restart %1 now?").arg(Configuration.systemName)
var popup = dialog.createObject(app, var popup = dialog.createObject(app,
{ {
headerIcon: "../images/dialog-warning-symbolic.svg", headerIcon: "../images/dialog-warning-symbolic.svg",
title: qsTr("Restart %1:core").arg(app.systemName), title: qsTr("Restart %1").arg(Configuration.systemName),
text: text, text: text,
standardButtons: Dialog.Ok | Dialog.Cancel standardButtons: Dialog.Ok | Dialog.Cancel
}); });
@ -246,15 +246,15 @@ SettingsPageBase {
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: app.margins Layout.leftMargin: app.margins
Layout.rightMargin: app.margins Layout.rightMargin: app.margins
text: qsTr("Reboot %1:core system").arg(app.systemName) text: qsTr("Reboot %1 system").arg(Configuration.systemName)
visible: engine.systemController.powerManagementAvailable visible: engine.systemController.powerManagementAvailable
onClicked: { onClicked: {
var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml")); var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml"));
var text = qsTr("Are you sure you want to reboot your %1:core sytem now?").arg(app.systemName) var text = qsTr("Are you sure you want to reboot your %1 sytem now?").arg(Configuration.systemName)
var popup = dialog.createObject(app, var popup = dialog.createObject(app,
{ {
headerIcon: "../images/dialog-warning-symbolic.svg", headerIcon: "../images/dialog-warning-symbolic.svg",
title: qsTr("Reboot %1:core system").arg(app.systemName), title: qsTr("Reboot %1 system").arg(Configuration.systemName),
text: text, text: text,
standardButtons: Dialog.Ok | Dialog.Cancel standardButtons: Dialog.Ok | Dialog.Cancel
}); });
@ -268,15 +268,15 @@ SettingsPageBase {
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: app.margins Layout.leftMargin: app.margins
Layout.rightMargin: app.margins Layout.rightMargin: app.margins
text: qsTr("Shut down %1:core system").arg(app.systemName) text: qsTr("Shut down %1 system").arg(Configuration.systemName)
visible: engine.systemController.powerManagementAvailable visible: engine.systemController.powerManagementAvailable
onClicked: { onClicked: {
var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml")); var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml"));
var text = qsTr("Are you sure you want to shut down your %1:core sytem now?").arg(app.systemName) var text = qsTr("Are you sure you want to shut down your %1 sytem now?").arg(Configuration.systemName)
var popup = dialog.createObject(app, var popup = dialog.createObject(app,
{ {
headerIcon: "../images/dialog-warning-symbolic.svg", headerIcon: "../images/dialog-warning-symbolic.svg",
title: qsTr("Shut down %1:core system").arg(app.systemName), title: qsTr("Shut down %1 system").arg(Configuration.systemName),
text: text, text: text,
standardButtons: Dialog.Ok | Dialog.Cancel standardButtons: Dialog.Ok | Dialog.Cancel
}); });

View File

@ -133,7 +133,7 @@ Page {
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: model.source === LogEntry.LoggingSourceSystem ? text: model.source === LogEntry.LoggingSourceSystem ?
qsTr("%1 Server").arg(app.systemName) qsTr("%1 Server").arg(Configuration.systemName)
: model.source === LogEntry.LoggingSourceRules ? : model.source === LogEntry.LoggingSourceRules ?
engine.ruleManager.rules.getRule(model.typeId).name engine.ruleManager.rules.getRule(model.typeId).name
: delegate.thing.name : delegate.thing.name

View File

@ -216,7 +216,7 @@ SettingsPageBase {
onClicked: { onClicked: {
if (!checked) { if (!checked) {
var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml")); var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml"));
var text = qsTr("Disabling networking will disconnect all connected clients. Be aware that you will not be able to interact remotely with this %1 system any more. Do not proceed unless you know what your are doing.").arg(app.systemName) var text = qsTr("Disabling networking will disconnect all connected clients. Be aware that you will not be able to interact remotely with this %1 system any more. Do not proceed unless you know what your are doing.").arg(Configuration.systemName)
+ "\n\n" + "\n\n"
+ qsTr("Do you want to proceed?") + qsTr("Do you want to proceed?")
var popup = dialog.createObject(app, var popup = dialog.createObject(app,
@ -291,7 +291,7 @@ SettingsPageBase {
onClicked: { onClicked: {
if (!checked) { if (!checked) {
var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml")); var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml"));
var text = qsTr("Disabling WiFi will disconnect all clients connected via WiFi. Be aware that you will not be able to interact remotely with this %1 system any more unless a LAN cable is connected.").arg(app.systemName) var text = qsTr("Disabling WiFi will disconnect all clients connected via WiFi. Be aware that you will not be able to interact remotely with this %1 system any more unless a LAN cable is connected.").arg(Configuration.systemName)
+ "\n\n" + "\n\n"
+ qsTr("Do you want to proceed?") + qsTr("Do you want to proceed?")
var popup = dialog.createObject(app, var popup = dialog.createObject(app,

View File

@ -158,7 +158,7 @@ Page {
enabled: !engine.systemController.updateManagementBusy enabled: !engine.systemController.updateManagementBusy
onClicked: { onClicked: {
var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml")); var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml"));
var text = qsTr("This will start a system update. Note that the update might take several minutes and your %1:core might not be functioning properly during this time and restart during the process.\nDo you want to proceed?").arg(app.systemName) var text = qsTr("This will start a system update. Note that the update might take several minutes and your %1 system might not be functioning properly during this time and restart during the process.\nDo you want to proceed?").arg(Configuration.systemName)
var popup = dialog.createObject(app, var popup = dialog.createObject(app,
{ {
headerIcon: "../images/system-update.svg", headerIcon: "../images/system-update.svg",
@ -232,7 +232,7 @@ Page {
onClicked: { onClicked: {
if (checked) { if (checked) {
var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml")); var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml"));
var text = qsTr("Enabling additional software sources allows to install unreleased %1:core packages.\nThis can potentially break your system and lead to problems.\nPlease only use this if you are sure you want this and consider reporting the issues you find when testing unreleased channels.").arg(app.systemName) var text = qsTr("Enabling additional software sources allows to install unreleased %1 packages.\nThis can potentially break your system and lead to problems.\nPlease only use this if you are sure you want this and consider reporting the issues you find when testing unreleased channels.").arg(Configuration.systemName)
var popup = dialog.createObject(app, var popup = dialog.createObject(app,
{ {
headerIcon: "../images/dialog-warning-symbolic.svg", headerIcon: "../images/dialog-warning-symbolic.svg",
@ -358,7 +358,7 @@ Page {
text: packageDetailsPage.pkg.updateAvailable ? qsTr("Update") : qsTr("Install") text: packageDetailsPage.pkg.updateAvailable ? qsTr("Update") : qsTr("Install")
onClicked: { onClicked: {
var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml")); var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml"));
var text = qsTr("This will start a system update. Note that the update might take several minutes and your %1:core might not be functioning properly or restart during this time.").arg(app.systemName) var text = qsTr("This will start a system update. Note that the update might take several minutes and your %1 might not be functioning properly or restart during this time.").arg(Configuration.systemName)
+ "\n\n" + "\n\n"
+ qsTr("\nDo you want to proceed?") + qsTr("\nDo you want to proceed?")
var popup = dialog.createObject(app, var popup = dialog.createObject(app,
@ -382,7 +382,7 @@ Page {
visible: packageDetailsPage.pkg.canRemove visible: packageDetailsPage.pkg.canRemove
onClicked: { onClicked: {
var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml")); var dialog = Qt.createComponent(Qt.resolvedUrl("../components/MeaDialog.qml"));
var text = qsTr("This will start a system update. Note that the update might take several minutes and your %1:core might not be functioning properly during this time and restart during the process.\nDo you want to proceed?").arg(app.systemName) var text = qsTr("This will start a system update. Note that the update might take several minutes and your %1 system might not be functioning properly during this time and restart during the process.\nDo you want to proceed?").arg(Configuration.systemName)
var popup = dialog.createObject(app, var popup = dialog.createObject(app,
{ {
headerIcon: "../images/system-update.svg", headerIcon: "../images/system-update.svg",

View File

@ -125,7 +125,7 @@ Page {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
visible: engine.thingManager.things.count === 0 && !engine.thingManager.fetchingData visible: engine.thingManager.things.count === 0 && !engine.thingManager.fetchingData
title: qsTr("There are no things set up yet.") title: qsTr("There are no things set up yet.")
text: qsTr("In order for your %1 system to be useful, go ahead and add some things.").arg(app.systemName) text: qsTr("In order for your %1 system to be useful, go ahead and add some things.").arg(Configuration.systemName)
imageSource: "qrc:/styles/%1/logo.svg".arg(styleController.currentStyle) imageSource: "qrc:/styles/%1/logo.svg".arg(styleController.currentStyle)
buttonText: qsTr("Add a thing") buttonText: qsTr("Add a thing")
onButtonClicked: pageStack.push(Qt.resolvedUrl("NewThingPage.qml")) onButtonClicked: pageStack.push(Qt.resolvedUrl("NewThingPage.qml"))