mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-03 18:24:46 +00:00
some fixes in the phone components
fixes after testing with phonesim
This commit is contained in:
parent
3c06165095
commit
393c36cd80
2 changed files with 50 additions and 7 deletions
|
|
@ -88,6 +88,40 @@ Item {
|
||||||
|
|
||||||
OfonoManager {
|
OfonoManager {
|
||||||
id: ofonoManager
|
id: ofonoManager
|
||||||
|
onAvailableChanged: {
|
||||||
|
console.log("Ofono is " + available)
|
||||||
|
}
|
||||||
|
onModemAdded: {
|
||||||
|
console.log("modem added " + modem)
|
||||||
|
}
|
||||||
|
onModemRemoved: console.log("modem removed")
|
||||||
|
}
|
||||||
|
|
||||||
|
OfonoConnMan {
|
||||||
|
id: ofono1
|
||||||
|
Component.onCompleted: {
|
||||||
|
console.log(ofonoManager.modems)
|
||||||
|
}
|
||||||
|
modemPath: ofonoManager.modems[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
OfonoModem {
|
||||||
|
id: modem1
|
||||||
|
modemPath: ofonoManager.modems[0]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
OfonoContextConnection {
|
||||||
|
id: context1
|
||||||
|
contextPath : ofono1.contexts[0]
|
||||||
|
Component.onCompleted: {
|
||||||
|
print("Context Active: " + context1.active)
|
||||||
|
textLine.text = context1.active ? "online" : "offline"
|
||||||
|
}
|
||||||
|
onActiveChanged: {
|
||||||
|
print("Context Active: " + context1.active)
|
||||||
|
textLine.text = context1.active ? "online" : "offline"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property OfonoSimManager simManager: ofonoSimManager
|
property OfonoSimManager simManager: ofonoSimManager
|
||||||
|
|
@ -97,7 +131,15 @@ Item {
|
||||||
|
|
||||||
OfonoNetworkRegistration {
|
OfonoNetworkRegistration {
|
||||||
id: netreg
|
id: netreg
|
||||||
modemPath: ofonoManager.modems.count? ofonoManager.modems[0] : ""
|
Component.onCompleted: {
|
||||||
|
netreg.scan()
|
||||||
|
updateStrengthIcon()
|
||||||
|
}
|
||||||
|
|
||||||
|
onNetworkOperatorsChanged : {
|
||||||
|
console.log("operators :"+netreg.currentOperator["Name"].toString())
|
||||||
|
}
|
||||||
|
modemPath: ofonoManager.modems.count ? ofonoManager.modems[0] : ""
|
||||||
function updateStrengthIcon() {
|
function updateStrengthIcon() {
|
||||||
if (netreg.strength >= 100) {
|
if (netreg.strength >= 100) {
|
||||||
strengthIcon.source = "network-mobile-100";
|
strengthIcon.source = "network-mobile-100";
|
||||||
|
|
@ -118,7 +160,10 @@ Item {
|
||||||
console.log("Strength changed to " + netreg.strength)
|
console.log("Strength changed to " + netreg.strength)
|
||||||
updateStrengthIcon()
|
updateStrengthIcon()
|
||||||
}
|
}
|
||||||
Component.onCompleted: updateStrengthIcon()
|
}
|
||||||
|
|
||||||
|
OfonoNetworkOperator {
|
||||||
|
id: netop
|
||||||
}
|
}
|
||||||
|
|
||||||
property VoiceCallManager manager: VoiceCallManager {
|
property VoiceCallManager manager: VoiceCallManager {
|
||||||
|
|
@ -132,7 +177,7 @@ Item {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
dialerOverlay.close();
|
dialerOverlay.close();
|
||||||
dialer.numberEntryText = '';
|
dialerOverlay.item.numberEntryText = '';
|
||||||
|
|
||||||
//main.activeVoiceCallPerson = null;
|
//main.activeVoiceCallPerson = null;
|
||||||
}
|
}
|
||||||
|
|
@ -277,7 +322,7 @@ Item {
|
||||||
left: strengthIcon.right
|
left: strengthIcon.right
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
text: netreg.strength + "% " + (netreg.name ? netreg.name : "No Provider")
|
text: netreg.strength + "% " + (ofonoManager.available ? netreg.currentOperator["Name"].toString() :"Ofono not available")
|
||||||
color: "white"
|
color: "white"
|
||||||
font.pixelSize: height / 2
|
font.pixelSize: height / 2
|
||||||
}
|
}
|
||||||
|
|
@ -378,8 +423,6 @@ Item {
|
||||||
elementId: "phone"
|
elementId: "phone"
|
||||||
callback: function() {
|
callback: function() {
|
||||||
dialerOverlay.open()
|
dialerOverlay.open()
|
||||||
//TODO remove
|
|
||||||
dialerOverlay.item.state = "disconnected"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ Rectangle {
|
||||||
property alias numberEntryText: status.text
|
property alias numberEntryText: status.text
|
||||||
property VoiceCallManager manager: homescreen.manager
|
property VoiceCallManager manager: homescreen.manager
|
||||||
|
|
||||||
property string providerId: manager.providers.id(1)
|
property string providerId: manager.providers.id(0)
|
||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
visible = true;
|
visible = true;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue