Update UI to latest changes
This commit is contained in:
parent
14fe5bb610
commit
94483e92c5
@ -348,7 +348,9 @@ void BtWiFiSetup::processWiFiPacket(const QVariantMap &data)
|
||||
accessPoint->setProtected(data.toMap().value("p").toBool());
|
||||
accessPoint->setHostAddress("");
|
||||
m_accessPoints->addWirelessAccessPoint(accessPoint);
|
||||
|
||||
}
|
||||
loadCurrentConnection();
|
||||
break;
|
||||
case WirelessServiceCommandConnect:
|
||||
qDebug() << "Connect call succeeded";
|
||||
@ -374,6 +376,12 @@ void BtWiFiSetup::processWiFiPacket(const QVariantMap &data)
|
||||
}
|
||||
qDebug() << "current connection is:" << m_currentConnection;
|
||||
emit currentConnectionChanged();
|
||||
|
||||
if (m_bluetoothStatus != BluetoothStatusLoaded) {
|
||||
m_bluetoothStatus = BluetoothStatusLoaded;
|
||||
emit bluetoothStatusChanged(m_bluetoothStatus);
|
||||
}
|
||||
|
||||
break;
|
||||
case WirelessServiceCommandScan:
|
||||
if (responseCode == WirelessServiceResponseSuccess) {
|
||||
@ -439,7 +447,7 @@ void BtWiFiSetup::characteristicChanged(const QLowEnergyCharacteristic &characte
|
||||
} else if (characteristic.uuid() == networkStatusCharacteristicUuid) {
|
||||
m_networkStatus = static_cast<NetworkStatus>(value.toHex().toInt(nullptr, 16));
|
||||
qDebug() << "Network status changed:" << m_networkStatus;
|
||||
if (m_networkStatus == NetworkStatusGlobal) {
|
||||
if (m_networkStatus == NetworkStatusGlobal || m_networkStatus == NetworkStatusLocal || m_networkStatus == NetworkStatusConnectedSite) {
|
||||
loadCurrentConnection();
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,8 @@ public:
|
||||
enum BluetoothStatus {
|
||||
BluetoothStatusDisconnected,
|
||||
BluetoothStatusConnectingToBluetooth,
|
||||
BluetoothStatusConnectedToBluetooth
|
||||
BluetoothStatusConnectedToBluetooth,
|
||||
BluetoothStatusLoaded,
|
||||
};
|
||||
Q_ENUM(BluetoothStatus)
|
||||
|
||||
|
||||
@ -49,15 +49,17 @@ Page {
|
||||
BtWiFiSetup {
|
||||
id: wifiSetup
|
||||
|
||||
onStatusChanged: {
|
||||
onBluetoothStatusChanged: {
|
||||
print("status changed", status)
|
||||
switch (status) {
|
||||
case BtWiFiSetup.StatusDisconnected:
|
||||
case BtWiFiSetup.BluetoothStatusDisconnected:
|
||||
pageStack.pop(root)
|
||||
break;
|
||||
case BtWiFiSetup.StatusConnectingToBluetooth:
|
||||
case BtWiFiSetup.BluetoothStatusConnectingToBluetooth:
|
||||
break;
|
||||
case BtWiFiSetup.StatusConnectedToBluetooth:
|
||||
case BtWiFiSetup.BluetoothStatusConnectedToBluetooth:
|
||||
break;
|
||||
case BtWiFiSetup.BluetoothStatusLoaded:
|
||||
if (!wifiSetup.networkingEnabled) {
|
||||
wifiSetup.networkingEnabled = true;
|
||||
}
|
||||
@ -66,12 +68,12 @@ Page {
|
||||
}
|
||||
setupDevice()
|
||||
break;
|
||||
case BtWiFiSetup.StatusConnectingToWiFi:
|
||||
break;
|
||||
case BtWiFiSetup.StatusConnectedToWiFi:
|
||||
print("Connected to wifi!")
|
||||
}
|
||||
}
|
||||
onWirelessStatusChanged: {
|
||||
|
||||
}
|
||||
|
||||
onBluetoothConnectionError: {
|
||||
print("Error")
|
||||
pageStack.pop(root)
|
||||
|
||||
@ -86,7 +86,7 @@ Page {
|
||||
|
||||
function updateConnectButton() {
|
||||
if (!root.wifiSetup.currentConnection) {
|
||||
connectButton.url = "";
|
||||
connectButton.host = null;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ Page {
|
||||
updateConnectButton();
|
||||
})
|
||||
}
|
||||
connectButton.url = "";
|
||||
connectButton.host = null;
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
@ -54,6 +54,10 @@ SettingsPageBase {
|
||||
text: root.thingClass.displayName
|
||||
subText: root.thingClass.id.toString().replace(/[{}]/g, "")
|
||||
progressive: false
|
||||
onClicked: {
|
||||
PlatformHelper.toClipBoard(subText);
|
||||
ToolTip.show(qsTr("ID copied to clipboard"), 500);
|
||||
}
|
||||
}
|
||||
|
||||
SettingsPageSectionHeader {
|
||||
|
||||
Reference in New Issue
Block a user