pin auth finally working

This commit is contained in:
Marco Martin 2015-06-22 15:53:13 -07:00
parent 9ee815108d
commit b9dfc7d768

View file

@ -21,21 +21,28 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import MeeGo.QOfono 0.2 import MeeGo.QOfono 0.2
import "../components" import "../components"
Rectangle { PlasmaCore.ColorScope {
id: pinScreen id: root
width:1000
height:1900
//anchors.fill: parent
color: "black" anchors.fill: parent
opacity: 0.8 colorGroup: PlasmaCore.Theme.ComplementaryColorGroup
visible: simManager.pinRequired != OfonoSimManager.NoPin visible: simManager.pinRequired != OfonoSimManager.NoPin
//visible: true
property OfonoSimManager simManager: ofonoSimManager property OfonoSimManager simManager: ofonoSimManager
function addNumber(number) {
pinLabel.text = pinLabel.text + number
}
Rectangle {
id: pinScreen
anchors.fill: parent
color: PlasmaCore.ColorScope.backgroundColor
OfonoManager { OfonoManager {
id: ofonoManager id: ofonoManager
onAvailableChanged: { onAvailableChanged: {
@ -81,12 +88,6 @@ Rectangle {
id: netop id: netop
} }
property color textColor: "white"
function addNumber(number) {
pinLabel.text = pinLabel.text + number
}
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
} }
@ -105,12 +106,10 @@ Rectangle {
fill: parent fill: parent
margins: 20 margins: 20
} }
Text { PlasmaComponents.Label {
Layout.fillWidth: true Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter verticalAlignment: Qt.AlignVCenter
font.pixelSize: theme.defaultFont.pixelSize
color: textColor
text: { text: {
switch (simManager.pinRequired) { switch (simManager.pinRequired) {
case OfonoSimManager.NoPin: return i18n("No pin (error)"); case OfonoSimManager.NoPin: return i18n("No pin (error)");
@ -122,22 +121,19 @@ Rectangle {
} }
} }
} }
Text { PlasmaComponents.Label {
Layout.fillWidth: true Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter verticalAlignment: Qt.AlignVCenter
font.pixelSize: theme.defaultFont.pixelSize text: simManager.pinRetries && simManager.pinRetries[simManager.pinRequired] ? i18n("%1 attempts left", simManager.pinRetries[simManager.pinRequired]) : "";
color: textColor
text: /*i18n("%1 attempts left", (simManager.pinRetries ? simManager.pinRetries[simManager.pinRequired] : 0));*/ simManager.pinRetries[simManager.pinRequired] +"--"+ simManager.pinRequired
} }
Text { PlasmaComponents.Label {
id: pinLabel id: pinLabel
Layout.fillWidth: true Layout.fillWidth: true
horizontalAlignment: Qt.AlignRight horizontalAlignment: Qt.AlignRight
verticalAlignment: Qt.AlignVCenter verticalAlignment: Qt.AlignVCenter
font.pixelSize: one.font.pixelSize font.pixelSize: one.font.pixelSize
color: textColor
} }
Grid { Grid {
@ -149,28 +145,40 @@ Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
DialerButton { id: one; text: "1"; color: "white"; } DialerButton { id: one; text: "1"; color: PlasmaCore.ColorScope.textColor }
DialerButton { text: "2"; color: "white"; } DialerButton { text: "2"; color: PlasmaCore.ColorScope.textColor }
DialerButton { text: "3"; color: "white"; } DialerButton { text: "3"; color: PlasmaCore.ColorScope.textColor }
DialerButton { text: "4"; color: "white"; } DialerButton { text: "4"; color: PlasmaCore.ColorScope.textColor }
DialerButton { text: "5"; color: "white"; } DialerButton { text: "5"; color: PlasmaCore.ColorScope.textColor }
DialerButton { text: "6"; color: "white"; } DialerButton { text: "6"; color: PlasmaCore.ColorScope.textColor }
DialerButton { text: "7"; color: "white"; } DialerButton { text: "7"; color: PlasmaCore.ColorScope.textColor }
DialerButton { text: "8"; color: "white"; } DialerButton { text: "8"; color: PlasmaCore.ColorScope.textColor }
DialerButton { text: "9"; color: "white"; } DialerButton { text: "9"; color: PlasmaCore.ColorScope.textColor }
DialerButton { text: "*"; color: "white"; } DialerButton { text: "*"; color: PlasmaCore.ColorScope.textColor }
DialerButton { text: "0"; sub: "+"; color: "white"; } DialerButton { text: "0"; sub: "+"; color: PlasmaCore.ColorScope.textColor }
DialerButton { DialerButton {
text: "#" text: "#"
color: "white" color: PlasmaCore.ColorScope.textColor
callback: function () { callback: function () {
simManager.enterPin(simManager.pinRequired, pinLabel.text) simManager.enterPin(simManager.pinRequired, pinLabel.text)
pinLabel.text = ""; pinLabel.text = "";
} }
} }
} }
PlasmaComponents.Button {
anchors {
top: pad.bottom
horizontalCenter: parent.horizontalCenter
}
text: i18n("Ok")
onClicked: {
simManager.enterPin(simManager.pinRequired, pinLabel.text)
pinLabel.text = "";
}
}
}
} }
} }