mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-29 14:18:49 +03:00
commit
2a5432d622
1 changed files with 26 additions and 25 deletions
|
@ -51,32 +51,33 @@ Rectangle {
|
||||||
font.pointSize: fontMetrics.font.pointSize * 1.1
|
font.pointSize: fontMetrics.font.pointSize * 1.1
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Item {
|
||||||
target: TimelineManager
|
state: TimelineManager.callState
|
||||||
onCallStateChanged: {
|
states: [
|
||||||
switch (state) {
|
State {
|
||||||
case WebRTCState.INITIATING:
|
name: "OFFERSENT"; when: state == WebRTCState.OFFERSENT
|
||||||
callStateLabel.text = qsTr("Initiating...");
|
PropertyChanges { target: callStateLabel; text: "Calling..." }
|
||||||
break;
|
},
|
||||||
case WebRTCState.OFFERSENT:
|
State {
|
||||||
callStateLabel.text = qsTr("Calling...");
|
name: "CONNECTING"; when: state == WebRTCState.CONNECTING
|
||||||
break;
|
PropertyChanges { target: callStateLabel; text: "Connecting..." }
|
||||||
case WebRTCState.CONNECTING:
|
},
|
||||||
callStateLabel.text = qsTr("Connecting...");
|
State {
|
||||||
break;
|
name: "ANSWERSENT"; when: state == WebRTCState.ANSWERSENT
|
||||||
case WebRTCState.CONNECTED:
|
PropertyChanges { target: callStateLabel; text: "Connecting..." }
|
||||||
callStateLabel.text = "00:00";
|
},
|
||||||
var d = new Date();
|
State {
|
||||||
callTimer.startTime = Math.floor(d.getTime() / 1000);
|
name: "CONNECTED"; when: state == WebRTCState.CONNECTED
|
||||||
if (TimelineManager.onVideoCall)
|
PropertyChanges { target: callStateLabel; text: "00:00" }
|
||||||
stackLayout.currentIndex = 1;
|
PropertyChanges { target: callTimer; startTime: Math.floor((new Date()).getTime() / 1000) }
|
||||||
|
PropertyChanges { target: stackLayout; currentIndex: TimelineManager.onVideoCall ? 1 : 0 }
|
||||||
break;
|
},
|
||||||
case WebRTCState.DISCONNECTED:
|
State {
|
||||||
callStateLabel.text = "";
|
name: "DISCONNECTED"; when: state == WebRTCState.DISCONNECTED
|
||||||
stackLayout.currentIndex = 0;
|
PropertyChanges { target: callStateLabel; text: "" }
|
||||||
|
PropertyChanges { target: stackLayout; currentIndex: 0 }
|
||||||
}
|
}
|
||||||
}
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
|
Loading…
Reference in a new issue