diff options
Diffstat (limited to 'src/settingsui/network/NetworkSettings.qml')
-rw-r--r-- | src/settingsui/network/NetworkSettings.qml | 123 |
1 files changed, 27 insertions, 96 deletions
diff --git a/src/settingsui/network/NetworkSettings.qml b/src/settingsui/network/NetworkSettings.qml index 947aae5..56c62a8 100644 --- a/src/settingsui/network/NetworkSettings.qml +++ b/src/settingsui/network/NetworkSettings.qml @@ -28,108 +28,39 @@ ****************************************************************************/ import QtQuick 2.6 import QtQuick.Layouts 1.3 -import QtQuick.Controls 2.0 +import QtQuick.Controls 2.2 import QtDeviceUtilities.NetworkSettings 1.0 +import QtDemoLauncher.QtButtonImageProvider 1.0 Item { - property string title: qsTr("Network Settings") - - GroupBox { - id: networkSelect - anchors.rightMargin: parent.width * 0.618 - anchors.left: parent.left - anchors.leftMargin: 20 + Text { + id: networkText anchors.top: parent.top - anchors.topMargin: 20 - - title: qsTr("Select Connection") - - function stateToStr(serviceState) { - switch (serviceState) { - case NetworkService.Idle: - return qsTr("Idle"); - case NetworkService.Failure: - return qsTr("Failure"); - case NetworkService.Association: - return qsTr("Association"); - case NetworkService.Configuration: - return qsTr("Configuration"); - case NetworkService.Ready: - return qsTr("Ready"); - case NetworkService.Disconnect: - return qsTr("Disconnect"); - case NetworkService.Online: - return qsTr("Online"); - default: - return qsTr("Undefined"); - } - } - ColumnLayout { - width: parent.width - - Repeater { - model: NetworkSettingsManager.interfaces - - RadioButton { - id: btn - enabled: (type != NetworkSettingsType.Wired) || NetworkSettingsManager.services.wiredNetworksAvailable - Layout.fillWidth: true - implicitHeight: 54 - - contentItem: Rectangle { - color: checked ? "#80c342" : "white" - border.color: "#bdbebf" - border.width: 1 - anchors.fill: parent - - Row { - anchors.fill: parent - spacing: 10 - - Image { - id: typeId - height: parent.height - width: height - } - Column { - height: parent.height * .7 - spacing: 0 - anchors.verticalCenter: parent.verticalCenter - Label { - text: name - } - Label { - text: ((type == NetworkSettingsType.Wired) && !NetworkSettingsManager.services.wiredNetworksAvailable) ? - qsTr("No networks") : networkSelect.stateToStr(modelData.state) - font.pixelSize: 12 - } - } - } - } + anchors.left: parent.left + fontSizeMode: Text.Fit + minimumPixelSize: 1 + font.pixelSize: parent.height * 0.05 + color: "white" + text: qsTr("Network") + font.family: appFont + font.styleName: "Bold" + } - onCheckedChanged: { - if (checked) { - networkDetails.selectedInterface = modelData - networkDetails.selectedInterface.scanServices() - if (type === NetworkSettingsType.Wired) { - networkDetails.source = "WiredSettings.qml"; - } - else if (type === NetworkSettingsType.Wifi) { - networkDetails.source = "WifiSettings.qml"; - } - } - } - } - } - } + Rectangle { + id: btmLine + anchors.top: networkText.bottom + anchors.topMargin: parent.height * 0.025 + anchors.left: networkText.left + width: parent.width * 0.275 + height: parent.height * 0.005 } - NetworkDetails { - id: networkDetails - anchors.leftMargin: networkSelect.width + 40 - anchors.topMargin: 20 - anchors.rightMargin: 20 - anchors.bottomMargin: 20 - anchors.fill: parent + NetworkListView { + id: networkList + anchors.top: btmLine.bottom + anchors.topMargin: parent.height * 0.025 + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom } } |