Change workding from nymea box to nymea:core or system

This commit is contained in:
Michael Zanetti 2019-07-05 00:06:46 +02:00
parent c932cdad0a
commit 7c9b1bd41a
18 changed files with 43 additions and 43 deletions

View File

@ -515,7 +515,7 @@ void AWSClient::deleteAccount()
}); });
} }
void AWSClient::unpairDevice(const QString &boxId) void AWSClient::unpairDevice(const QString &coreId)
{ {
if (!isLoggedIn()) { if (!isLoggedIn()) {
qWarning() << "Not logged in at AWS. Can't unpair device"; qWarning() << "Not logged in at AWS. Can't unpair device";
@ -524,18 +524,18 @@ void AWSClient::unpairDevice(const QString &boxId)
if (tokensExpired()) { if (tokensExpired()) {
qDebug() << "Cannot unpair device. Need to refresh our tokens"; qDebug() << "Cannot unpair device. Need to refresh our tokens";
refreshAccessToken(); refreshAccessToken();
QueuedCall::enqueue(m_callQueue, QueuedCall("unpairDevice", boxId)); QueuedCall::enqueue(m_callQueue, QueuedCall("unpairDevice", coreId));
return; return;
} }
qDebug() << "unpairing device"; qDebug() << "unpairing device";
QUrl url(QString("https://%1/users/devices/%2").arg(m_configs.value(m_usedConfig).apiEndpoint).arg(boxId)); QUrl url(QString("https://%1/users/devices/%2").arg(m_configs.value(m_usedConfig).apiEndpoint).arg(coreId));
QNetworkRequest request(url); QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
request.setRawHeader("x-api-idToken", m_idToken); request.setRawHeader("x-api-idToken", m_idToken);
m_devices->setBusy(true); m_devices->setBusy(true);
QNetworkReply *reply = m_nam->deleteResource(request); QNetworkReply *reply = m_nam->deleteResource(request);
connect(reply, &QNetworkReply::finished, this, [this, reply, boxId]() { connect(reply, &QNetworkReply::finished, this, [this, reply, coreId]() {
reply->deleteLater(); reply->deleteLater();
m_devices->setBusy(false); m_devices->setBusy(false);
QByteArray data = reply->readAll(); QByteArray data = reply->readAll();
@ -550,7 +550,7 @@ void AWSClient::unpairDevice(const QString &boxId)
return; return;
} }
qDebug() << "Device unpaired" << data; qDebug() << "Device unpaired" << data;
m_devices->remove(boxId); m_devices->remove(coreId);
}); });
} }
@ -838,7 +838,7 @@ bool AWSClient::tokensExpired() const
return (m_accessTokenExpiry.addSecs(-10) < QDateTime::currentDateTime()) || (m_sessionTokenExpiry.addSecs(-10) < QDateTime::currentDateTime()); return (m_accessTokenExpiry.addSecs(-10) < QDateTime::currentDateTime()) || (m_sessionTokenExpiry.addSecs(-10) < QDateTime::currentDateTime());
} }
bool AWSClient::postToMQTT(const QString &boxId, const QString &timestamp, QObject* sender, std::function<void (bool)> callback) bool AWSClient::postToMQTT(const QString &coreId, const QString &timestamp, QObject* sender, std::function<void (bool)> callback)
{ {
if (!isLoggedIn()) { if (!isLoggedIn()) {
qWarning() << "Cannot post to MQTT. Not logged in to AWS"; qWarning() << "Cannot post to MQTT. Not logged in to AWS";
@ -847,10 +847,10 @@ bool AWSClient::postToMQTT(const QString &boxId, const QString &timestamp, QObje
if (tokensExpired()) { if (tokensExpired()) {
qDebug() << "Cannot post to MQTT. Need to refresh the tokens first"; qDebug() << "Cannot post to MQTT. Need to refresh the tokens first";
refreshAccessToken(); refreshAccessToken();
QueuedCall::enqueue(m_callQueue, QueuedCall("postToMQTT", boxId, timestamp, sender, callback)); QueuedCall::enqueue(m_callQueue, QueuedCall("postToMQTT", coreId, timestamp, sender, callback));
return true; // So far it looks we're doing ok... let's return true return true; // So far it looks we're doing ok... let's return true
} }
QString topic = QString("%1/%2/proxy").arg(boxId).arg(QString(m_identityId)); QString topic = QString("%1/%2/proxy").arg(coreId).arg(QString(m_identityId));
QPointer<QObject> senderWatcher = QPointer<QObject>(sender); QPointer<QObject> senderWatcher = QPointer<QObject>(sender);

View File

@ -114,11 +114,11 @@ public:
Q_INVOKABLE void confirmForgotPassword(const QString &username, const QString &code, const QString &newPassword); Q_INVOKABLE void confirmForgotPassword(const QString &username, const QString &code, const QString &newPassword);
Q_INVOKABLE void deleteAccount(); Q_INVOKABLE void deleteAccount();
Q_INVOKABLE void unpairDevice(const QString &boxId); Q_INVOKABLE void unpairDevice(const QString &coreId);
Q_INVOKABLE void fetchDevices(); Q_INVOKABLE void fetchDevices();
Q_INVOKABLE bool postToMQTT(const QString &boxId, const QString &timestamp, QObject* sender, std::function<void(bool)> callback); Q_INVOKABLE bool postToMQTT(const QString &coreId, const QString &timestamp, QObject* sender, std::function<void(bool)> callback);
Q_INVOKABLE void getId(); Q_INVOKABLE void getId();
Q_INVOKABLE void registerPushNotificationEndpoint(const QString &registrationId, const QString &deviceDisplayName, const QString mobileDeviceId, const QString &mobileDeviceManufacturer, const QString &mobileDeviceModel); Q_INVOKABLE void registerPushNotificationEndpoint(const QString &registrationId, const QString &deviceDisplayName, const QString mobileDeviceId, const QString &mobileDeviceManufacturer, const QString &mobileDeviceModel);

View File

@ -421,7 +421,7 @@ void JsonRpcClient::helloReply(const QVariantMap &params)
QVersionNumber minimumRequiredVersion = QVersionNumber(1, 0); QVersionNumber minimumRequiredVersion = QVersionNumber(1, 0);
if (m_jsonRpcVersion < minimumRequiredVersion) { if (m_jsonRpcVersion < minimumRequiredVersion) {
qWarning() << "Nymea box doesn't support minimum required version. Required:" << minimumRequiredVersion << "Found:" << m_jsonRpcVersion; qWarning() << "Nymea core doesn't support minimum required version. Required:" << minimumRequiredVersion << "Found:" << m_jsonRpcVersion;
m_connection->disconnect(); m_connection->disconnect();
emit invalidProtocolVersion(m_jsonRpcVersion.toString(), minimumRequiredVersion.toString()); emit invalidProtocolVersion(m_jsonRpcVersion.toString(), minimumRequiredVersion.toString());
return; return;

View File

@ -10,7 +10,7 @@ ApplicationWindow {
font.capitalization: Font.MixedCase font.capitalization: Font.MixedCase
font.family: "Ubuntu" font.family: "Ubuntu"
// The system (box) name. // The core system name.
property string systemName: "nymea" property string systemName: "nymea"
// The app name // The app name

View File

@ -9,7 +9,7 @@ ApplicationWindow {
font.capitalization: Font.MixedCase font.capitalization: Font.MixedCase
font.family: "Ubuntu" font.family: "Ubuntu"
// The system (box) name. // The core system name.
property string systemName: "nymea" property string systemName: "nymea"
// The app name // The app name

View File

@ -14,7 +14,7 @@ ApplicationWindow {
font.capitalization: Font.MixedCase font.capitalization: Font.MixedCase
font.family: "Oswald" font.family: "Oswald"
// The system (box) name. // The core system name.
property string systemName: "nymea" property string systemName: "nymea"
// The app name // The app name

View File

@ -41,7 +41,7 @@ Page {
ListElement { iconSource: "../images/share.svg"; text: qsTr("Configure things"); page: "thingconfiguration/EditThingsPage.qml" } ListElement { iconSource: "../images/share.svg"; text: qsTr("Configure things"); page: "thingconfiguration/EditThingsPage.qml" }
ListElement { iconSource: "../images/magic.svg"; text: qsTr("Magic"); page: "MagicPage.qml" } ListElement { iconSource: "../images/magic.svg"; text: qsTr("Magic"); page: "MagicPage.qml" }
ListElement { iconSource: "../images/stock_application.svg"; text: qsTr("App settings"); page: "appsettings/AppSettingsPage.qml" } ListElement { iconSource: "../images/stock_application.svg"; text: qsTr("App settings"); page: "appsettings/AppSettingsPage.qml" }
ListElement { iconSource: "../images/settings.svg"; text: qsTr("Box settings"); page: "SettingsPage.qml" } ListElement { iconSource: "../images/settings.svg"; text: qsTr("System settings"); page: "SettingsPage.qml" }
} }
onClicked: { onClicked: {
@ -250,7 +250,7 @@ Page {
visible: engine.deviceManager.devices.count === 0 && !engine.deviceManager.fetchingData visible: engine.deviceManager.devices.count === 0 && !engine.deviceManager.fetchingData
title: qsTr("Welcome to %1!").arg(app.systemName) title: qsTr("Welcome to %1!").arg(app.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 box 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(app.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("thingconfiguration/NewThingPage.qml")) onButtonClicked: pageStack.push(Qt.resolvedUrl("thingconfiguration/NewThingPage.qml"))

View File

@ -316,7 +316,7 @@ Item {
font.pixelSize: app.largeFont font.pixelSize: app.largeFont
} }
Label { Label {
text: qsTr("Sorry, the version of the %1 box you are trying to connect to is too old. This app requires at least version %2 but the %1 box only supports %3").arg(app.systemName).arg(popup.minimumVersion).arg(popup.actualVersion) text: qsTr("Sorry, 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").arg(app.systemName).arg(popup.minimumVersion).arg(popup.actualVersion)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
Layout.fillWidth: true Layout.fillWidth: true
} }

View File

@ -8,7 +8,7 @@ import "components"
Page { Page {
id: root id: root
header: NymeaHeader { header: NymeaHeader {
text: qsTr("Box settings") text: qsTr("System settings")
backButtonVisible: true backButtonVisible: true
onBackPressed: pageStack.pop() onBackPressed: pageStack.pop()
} }
@ -49,7 +49,7 @@ Page {
width: parent.width width: parent.width
iconName: "../images/network-wifi.svg" iconName: "../images/network-wifi.svg"
text: qsTr("Networking") text: qsTr("Networking")
subText: qsTr("Configure the box's network connection") subText: qsTr("Configure the system's network connection")
prominentSubText: false prominentSubText: false
wrapTexts: false wrapTexts: false
onClicked: pageStack.push(Qt.resolvedUrl("system/NetworkSettingsPage.qml")) onClicked: pageStack.push(Qt.resolvedUrl("system/NetworkSettingsPage.qml"))
@ -66,7 +66,7 @@ Page {
width: parent.width width: parent.width
iconName: "../images/cloud.svg" iconName: "../images/cloud.svg"
text: qsTr("Cloud") text: qsTr("Cloud")
subText: qsTr("Connect this box to %1:cloud").arg(app.systemName) subText: qsTr("Connect this %1:core to %1:cloud").arg(app.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"))
@ -84,7 +84,7 @@ Page {
text: qsTr("API interfaces") text: qsTr("API interfaces")
prominentSubText: false prominentSubText: false
wrapTexts: false wrapTexts: false
subText: qsTr("Configure how clients interact with this box") subText: qsTr("Configure how clients interact with this system")
onClicked: pageStack.push(Qt.resolvedUrl("system/ConnectionInterfacesPage.qml")) onClicked: pageStack.push(Qt.resolvedUrl("system/ConnectionInterfacesPage.qml"))
} }
} }

View File

@ -47,7 +47,7 @@ Page {
NymeaListItemDelegate { NymeaListItemDelegate {
width: parent.width width: parent.width
text: qsTr("Cloud login") text: qsTr("Cloud login")
subText: qsTr("Log into %1:cloud and manage connected boxes").arg(app.systemName) subText: qsTr("Log into %1:cloud and manage connected %1:core systems").arg(app.systemName)
iconName: "../images/cloud.svg" iconName: "../images/cloud.svg"
prominentSubText: false prominentSubText: false
wrapTexts: false wrapTexts: false

View File

@ -68,8 +68,8 @@ Page {
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 boxes connected to your cloud yet.") : qsTr("There are no %1:core systems connected to your cloud yet.").arg(app.systemName) :
qsTr("There are %n boxes connected to your cloud.", "", AWSClient.awsDevices.count) qsTr("There are %n %1:core systems connected to your cloud.", "", AWSClient.awsDevices.count).arg(app.systemName)
} }
ListView { ListView {
Layout.fillWidth: true Layout.fillWidth: true
@ -109,7 +109,7 @@ Page {
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 boxes 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: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)
headerIcon: "../images/dialog-warning-symbolic.svg" headerIcon: "../images/dialog-warning-symbolic.svg"
standardButtons: Dialog.Cancel | Dialog.Ok standardButtons: Dialog.Cancel | Dialog.Ok
@ -147,7 +147,7 @@ Page {
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 in to %1:cloud in order to connect to %1 boxes from anywhere.").arg(app.systemName) text: qsTr("Log in to %1:cloud in order to connect to %1:core systems from anywhere.").arg(app.systemName)
} }
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true

View File

@ -47,13 +47,13 @@ Dialog {
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: certDialog.hasOldFingerprint ? qsTr("The certificate of this %1 box has changed!").arg(app.systemName) : qsTr("It seems this is the first time you connect to this %1 box.").arg(app.systemName) text: certDialog.hasOldFingerprint ? qsTr("The certificate of this %1:core has changed!").arg(app.systemName) : qsTr("It seems this is the first time you connect to this %1:core.").arg(app.systemName)
} }
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: certDialog.hasOldFingerprint ? qsTr("Did you change the box's configuration? Verify if this information is correct.") : qsTr("This is the box's certificate. Once you trust it, an encrypted connection will be established.") text: certDialog.hasOldFingerprint ? qsTr("Did you change the system's configuration? Verify if this information is correct.") : qsTr("This is the certificate for this %1:core. Once you trust it, an encrypted connection will be established.").arg(app.systemName)
} }
ThinDivider {} ThinDivider {}

View File

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

View File

@ -65,7 +65,7 @@ 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 box is powered on.").arg(app.systemName); 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);
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(app.systemName);

View File

@ -40,7 +40,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 box is installed correctly.") message = qsTr("An error happened with the user storage. Please make sure your %1:core system is installed correctly.").arg(app.systemName)
break; break;
} }
var popup = errorDialog.createObject(root, {text: message}); var popup = errorDialog.createObject(root, {text: message});
@ -72,7 +72,7 @@ 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 your %1 box.").arg(app.systemName) 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 log in.").arg(app.systemName) : qsTr("In order to use your %1 system, please log in.").arg(app.systemName)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }

View File

@ -71,7 +71,7 @@ Page {
Layout.margins: app.margins Layout.margins: app.margins
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Searching for %1 boxes.").arg(app.systemName) text: qsTr("Searching for %1:core systems.").arg(app.systemName)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
BusyIndicator { BusyIndicator {
@ -112,7 +112,7 @@ Page {
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
maximumLineCount: 2 maximumLineCount: 2
elide: Text.ElideRight elide: Text.ElideRight
text: qsTr("Troubles finding your box?") text: qsTr("Troubles finding your %1:core?").arg(app.systemName)
} }
Button { Button {
text: qsTr("Help") text: qsTr("Help")
@ -194,7 +194,7 @@ Page {
Layout.rightMargin: app.margins Layout.rightMargin: app.margins
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
font.bold: true font.bold: true
text: "%1 box".arg(systemName) text: qsTr("%1 box").arg(systemName)
} }
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true

View File

@ -196,7 +196,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 box to %2").arg(app.systemName).arg(connectingWifiWaitPage.ssid) text: qsTr("Connecting the %1:core to %2").arg(app.systemName).arg(connectingWifiWaitPage.ssid)
} }
} }
} }

View File

@ -92,7 +92,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.networkManagerController.manager.currentConnection text: root.networkManagerController.manager.currentConnection
? qsTr("Your %1 box is connected to %2").arg(app.systemName).arg(root.networkManagerController.manager.currentConnection.ssid) ? qsTr("Your %1:core is connected to %2").arg(app.systemName).arg(root.networkManagerController.manager.currentConnection.ssid)
: "" : ""
} }
@ -109,7 +109,7 @@ Page {
spacing: app.margins spacing: app.margins
Label { Label {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Waiting for the %1 box to appear in your network.").arg(app.systemName) text: qsTr("Waiting for the %1:core to appear in your network.").arg(app.systemName)
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
} }
BusyIndicator { } BusyIndicator { }
@ -120,7 +120,7 @@ Page {
visible: url != "" visible: url != ""
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 box") text: qsTr("Connect to %1:core").arg(app.systemName)
property string url property string url
onClicked: { onClicked: {
engine.connection.connect(url) engine.connection.connect(url)