Fix some issues in cloud login page

This commit is contained in:
Michael Zanetti 2019-03-25 00:46:59 +01:00
parent d984a9d39c
commit 0cadc3a542
3 changed files with 77 additions and 67 deletions

View File

@ -503,9 +503,9 @@
</message>
<message numerus="yes">
<source>There are %n boxes connected to your cloud</source>
<translation>
<numerusform>Es ist %1 Box mit Deiner Cloud verbunden</numerusform>
<numerusform>Es sind %1 Boxen mit Deiner Cloud verbunden</numerusform>
<translation type="vanished">
<numerusform>Es ist %n Box mit Deiner Cloud verbunden</numerusform>
<numerusform>Es sind %n Boxen mit Deiner Cloud verbunden</numerusform>
</translation>
</message>
<message>
@ -640,6 +640,13 @@
<source>See our &lt;a href=&quot;%1&quot;&gt;privacy policy&lt;/a&gt; to find out what information is processed. By signing up to %2:cloud you accept those terms and conditions.</source>
<translation>Bitte lese unsere &lt;a href=&quot;%1&quot;&gt;Datenschutzerklärung&lt;/a&gt; um herauszufinden welche Informationen verarbeitet werden. Wenn du dich bei %2:cloud registrierst, erklärst Du Dich damit einverstanden.</translation>
</message>
<message numerus="yes">
<source>There are %n boxes connected to your cloud.</source>
<translation>
<numerusform>Es ist %n Box mit Deiner Cloud verbunden.</numerusform>
<numerusform>Es sind %n Boxen mit Deiner Cloud verbunden.</numerusform>
</translation>
</message>
</context>
<context>
<name>CloudSettingsPage</name>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<TS version="2.1" language="en_US">
<context>
<name>AWSPasswordTextField</name>
<message>
@ -334,8 +334,9 @@
</message>
<message numerus="yes">
<source>There are %n boxes connected to your cloud</source>
<translation type="unfinished">
<numerusform></numerusform>
<translation type="obsolete">
<numerusform>There is %n box connected to your cloud.</numerusform>
<numerusform>There are %n boxes connected to your cloud.</numerusform>
</translation>
</message>
<message>
@ -466,6 +467,13 @@
<source>See our &lt;a href=&quot;%1&quot;&gt;privacy policy&lt;/a&gt; to find out what information is processed. By signing up to %2:cloud you accept those terms and conditions.</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<source>There are %n boxes connected to your cloud.</source>
<translation>
<numerusform>There is %n box connected to your cloud.</numerusform>
<numerusform>There are %n boxes connected to your cloud.</numerusform>
</translation>
</message>
</context>
<context>
<name>CloudSettingsPage</name>

View File

@ -37,77 +37,72 @@ Page {
}
}
Flickable {
ColumnLayout {
anchors.fill: parent
interactive: contentHeight > height
contentHeight: childrenRect.height
visible: AWSClient.isLoggedIn
ColumnLayout {
width: parent.width
Label {
Layout.fillWidth: true
Layout.topMargin: app.margins
Layout.leftMargin: app.margins
Layout.rightMargin: app.margins
wrapMode: Text.WordWrap
text: qsTr("Logged in as %1").arg(AWSClient.username)
}
Label {
Layout.fillWidth: true
Layout.topMargin: app.margins
Layout.leftMargin: app.margins
Layout.rightMargin: app.margins
wrapMode: Text.WordWrap
text: qsTr("Logged in as %1").arg(AWSClient.username)
}
Button {
Layout.fillWidth: true
Layout.margins: app.margins
text: qsTr("Log out")
onClicked: {
logoutDialog.open()
}
}
ThinDivider {}
Label {
Layout.fillWidth: true
Layout.topMargin: app.margins
Layout.leftMargin: app.margins
Layout.rightMargin: app.margins
wrapMode: Text.WordWrap
text: AWSClient.awsDevices.count === 0 ?
qsTr("There are no boxes connected to your cloud yet.") :
qsTr("There are %n boxes connected to your cloud.", "", AWSClient.awsDevices.count)
}
ListView {
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
model: AWSClient.awsDevices
delegate: MeaListItemDelegate {
width: parent.width
text: model.name
subText: model.id
progressive: false
prominentSubText: false
canDelete: true
iconName: "../images/cloud.svg"
secondaryIconName: !model.online ? "../images/cloud-error.svg" : ""
Button {
Layout.fillWidth: true
Layout.margins: app.margins
text: qsTr("Log out")
onClicked: {
logoutDialog.open()
}
}
ThinDivider {}
Label {
Layout.fillWidth: true
Layout.topMargin: app.margins
Layout.leftMargin: app.margins
Layout.rightMargin: app.margins
wrapMode: Text.WordWrap
text: AWSClient.awsDevices.count === 0 ?
qsTr("There are no boxes connected to your cloud yet.") :
qsTr("There are %n boxes connected to your cloud", "", AWSClient.awsDevices.count)
}
ListView {
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
model: AWSClient.awsDevices
delegate: MeaListItemDelegate {
width: parent.width
text: model.name
subText: model.id
progressive: false
prominentSubText: false
canDelete: true
iconName: "../images/cloud.svg"
secondaryIconName: !model.online ? "../images/cloud-error.svg" : ""
onClicked: {
print("clicked, connected:", engine.connection.connected, model.id)
if (!engine.connection.connected) {
var host = discovery.nymeaHosts.find(model.id)
engine.connection.connect(host);
}
}
onDeleteClicked: {
AWSClient.unpairDevice(model.id);
print("clicked, connected:", engine.connection.connected, model.id)
if (!engine.connection.connected) {
var host = discovery.nymeaHosts.find(model.id)
engine.connection.connect(host);
}
}
BusyIndicator {
anchors.centerIn: parent
visible: AWSClient.awsDevices.busy
onDeleteClicked: {
AWSClient.unpairDevice(model.id);
}
}
BusyIndicator {
anchors.centerIn: parent
visible: AWSClient.awsDevices.busy
}
}
}