Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
318 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
import QtQuick 2.6 | ||
import QtQuick.Window 2.1 | ||
|
||
import QtQuick.Controls 1.0 | ||
import QtQuick.Controls.Nemo 1.0 | ||
import QtQuick.Controls.Styles.Nemo 1.0 | ||
|
||
import MeeGo.Connman 0.2 | ||
|
||
import "../../components" | ||
|
||
Item { | ||
width: childrenRect.width | ||
height: childrenRect.height | ||
|
||
property bool saved | ||
|
||
ListViewItemWithActions{ | ||
height: { | ||
if (visible) return size.dp(80) | ||
else return 0 | ||
} | ||
visible: { | ||
if (saved) { | ||
return modelData.saved | ||
} | ||
else { | ||
return !modelData.saved | ||
} | ||
} | ||
|
||
label: modelData.name | ||
width: wifiPage.width | ||
|
||
description: { | ||
if ((modelData.state === "online") || (modelData.state === "ready")) { | ||
return qsTr("connected"); | ||
} else if (modelData.state === "association" || modelData.state === "configuration") { | ||
return qsTr("connecting")+"..."; | ||
} else { | ||
if (modelData.security[0] === "none") { | ||
return qsTr("open"); | ||
} else { | ||
return qsTr("secure"); | ||
} | ||
} | ||
} | ||
icon: (getStrengthIndex(modelData.strength) === "0") ? | ||
"image://theme/icon_wifi_0" : "image://theme/icon_wifi_focused" + | ||
getStrengthIndex(modelData.strength) | ||
|
||
onClicked:{ | ||
if (modelData.state === "idle" || modelData.state === "failure"){ | ||
console.log("Show settings page"); | ||
pageStack.push(Qt.resolvedUrl("WifiSettings.qml"),{modelData: modelData}); | ||
} else { | ||
console.log("Show network status page"); | ||
var component = Qt.createComponent(Qt.resolvedUrl("WifiStatus.qml")).errorString(); | ||
console.log(component); | ||
pageStack.push(Qt.resolvedUrl("WifiStatus.qml"),{modelData: modelData}); | ||
} | ||
} | ||
|
||
actions: Rectangle{ | ||
width: childrenRect.width+16 | ||
height: parent.height | ||
Image{ | ||
id: removeNetworkButton | ||
source: "/usr/share/glacier-settings/qml/img/trash.svg" | ||
width: 64 | ||
height: 64 | ||
fillMode: Image.PreserveAspectFit | ||
sourceSize{ | ||
width: width | ||
height: height | ||
} | ||
anchors{ | ||
top:parent.top | ||
topMargin: 8 | ||
left: parent.left | ||
leftMargin: 8 | ||
} | ||
MouseArea{ | ||
anchors.fill: parent | ||
onClicked: { | ||
modelData.remove(); | ||
model.hideAllActions(-1); | ||
} | ||
} | ||
} | ||
|
||
Image{ | ||
source: "/usr/share/glacier-settings/qml/img/disconnect.svg" | ||
visible: (modelData.state === "online" || modelData.state === "ready") | ||
|
||
width: Theme.itemHeightSmall | ||
height: width | ||
fillMode: Image.PreserveAspectFit | ||
sourceSize{ | ||
width: width | ||
height: height | ||
} | ||
anchors{ | ||
top:parent.top | ||
topMargin: 8 | ||
left: removeNetworkButton.right | ||
|
||
leftMargin: 16 | ||
} | ||
MouseArea{ | ||
anchors.fill: parent | ||
onClicked: { | ||
modelData.requestDisconnect(); | ||
model.hideAllActions(-1); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import QtQuick 2.6 | ||
import QtQuick.Window 2.1 | ||
|
||
import QtQuick.Controls 1.0 | ||
import QtQuick.Controls.Nemo 1.0 | ||
import QtQuick.Controls.Styles.Nemo 1.0 | ||
|
||
import MeeGo.Connman 0.2 | ||
|
||
import "../../components" | ||
|
||
Page { | ||
id: savedPage | ||
headerTools: HeaderToolsLayout{ | ||
id: header | ||
showBackButton: true | ||
title: qsTr("Manage saved networks") | ||
} | ||
|
||
SavedServiceModel{ | ||
id: savedModel | ||
} | ||
|
||
Component.onCompleted: { | ||
savedModel.name = "wifi"; | ||
} | ||
|
||
ListView{ | ||
y: header.height | ||
width: parent.width | ||
height: parent.height - header.height | ||
model: savedModel | ||
delegate: ListViewItemWithActions{ | ||
height: size.dp(80) | ||
label: networkService.name | ||
width: savedPage.width | ||
|
||
onClicked: { | ||
pageStack.push(Qt.resolvedUrl("SavedStatus.qml"), {modelData: networkService}); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import QtQuick 2.6 | ||
import QtQuick.Window 2.1 | ||
|
||
import QtQuick.Controls 1.0 | ||
import QtQuick.Controls.Nemo 1.0 | ||
import QtQuick.Controls.Styles.Nemo 1.0 | ||
|
||
import MeeGo.Connman 0.2 | ||
|
||
import "../../components" | ||
|
||
Page { | ||
id: savedWifiStatusPage | ||
property var modelData | ||
|
||
headerTools: HeaderToolsLayout { | ||
id: header | ||
showBackButton: true | ||
title: modelData.name | ||
} | ||
|
||
SettingsColumn{ | ||
id: actionColumn | ||
|
||
Rectangle{ | ||
width: parent.width | ||
height: childrenRect.height | ||
color: "transparent" | ||
|
||
Label{ | ||
id: nameLabel | ||
text: qsTr("Auto connect") | ||
anchors{ | ||
left: parent.left | ||
} | ||
wrapMode: Text.Wrap | ||
font.bold: true | ||
} | ||
|
||
CheckBox { | ||
id: columnCheckBox | ||
checked: modelData.autoConnect | ||
anchors{ | ||
right: parent.right | ||
verticalCenter: nameLabel.verticalCenter | ||
} | ||
|
||
onClicked: { | ||
modelData.autoConnect = !modelData.autoConnect; | ||
} | ||
} | ||
} | ||
|
||
Rectangle{ | ||
width: parent.width | ||
height: childrenRect.height | ||
|
||
color: "transparent" | ||
|
||
Button{ | ||
id: disconnectButton | ||
width: parent.width | ||
anchors{ | ||
horizontalCenter: parent.horizontalCenter | ||
verticalCenter: parent.verticalCenter | ||
} | ||
text: qsTr("Remove") | ||
onClicked: { | ||
modelData.remove(); | ||
console.log("Remove clicked"); | ||
pageStack.pop(); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.