ongoing call notification

This commit is contained in:
Gaelle Braud 2024-09-02 17:29:39 +02:00
parent 7da33786d1
commit 4f5d6cabfa
13 changed files with 106 additions and 25 deletions

View file

@ -58,7 +58,7 @@ void ConferenceInfoList::setSelf(QSharedPointer<ConferenceInfoList> me) {
auto defaultAccount = CoreModel::getInstance()->getCore()->getDefaultAccount();
if (!defaultAccount) return;
std::list<std::shared_ptr<linphone::ConferenceInfo>> conferenceInfos =
defaultAccount->getConferenceInformationList();
defaultAccount->getConferenceInformationList();
items->push_back(nullptr); // Add Dummy conference for today
for (auto conferenceInfo : conferenceInfos) {
auto confInfoCore = build(conferenceInfo);
@ -102,15 +102,11 @@ void ConferenceInfoList::setSelf(QSharedPointer<ConferenceInfoList> me) {
emit lUpdate();
}
});
mCoreModelConnection->makeConnectToModel(
&CoreModel::callCreated, [this](const std::shared_ptr<linphone::Call> &call) {
lDebug() << "call created" << Utils::coreStringToAppString(call->getRemoteAddress()->asString());
});
mCoreModelConnection->makeConnectToModel(
&CoreModel::conferenceInfoReceived,
[this](const std::shared_ptr<linphone::Core> &core,
const std::shared_ptr<const linphone::ConferenceInfo> &conferenceInfo) {
lDebug() << "info received" << conferenceInfo->getOrganizer()->asStringUriOnly()
lDebug() << log().arg("conference info received") << conferenceInfo->getOrganizer()->asStringUriOnly()
<< conferenceInfo->getSubject();
});
emit lUpdate();

View file

@ -140,7 +140,11 @@ void Utils::setupConference(ConferenceInfoGui *confGui) {
}
void Utils::openCallsWindow(CallGui *call) {
if (call) App::getInstance()->getCallsWindow(QVariant::fromValue(call))->show();
if (call) {
auto window = App::getInstance()->getCallsWindow(QVariant::fromValue(call));
window->show();
window->raise();
}
}
QQuickWindow *Utils::getCallsWindow(CallGui *callGui) {

View file

@ -69,15 +69,37 @@ Item {
id: accountProxy
onDefaultAccountChanged: if (tabbar.currentIndex === 0 && defaultAccount) defaultAccount.core.lResetMissedCalls()
}
Timer {
id: autoClosePopup
interval: 5000
onTriggered: {
transferSucceedPopup.close()
}
CallProxy {
id: callsModel
}
Item{
Popup {
id: currentCallNotif
background: Item{}
closePolicy: Control.Popup.NoAutoClose
visible: currentCall
&& currentCall.core.state != LinphoneEnums.CallState.Idle
&& currentCall.core.state != LinphoneEnums.CallState.IncomingReceived
&& currentCall.core.state != LinphoneEnums.CallState.PushIncomingReceived
x: mainItem.width/2 - width/2
y: contentItem.height/2
property var currentCall: callsModel.currentCall ? callsModel.currentCall : null
property var peerNameObj: currentCall ? UtilsCpp.getDisplayName(currentCall.core.peerAddress) : null
property string peerName:peerNameObj ? peerNameObj.value : ""
contentItem: Button {
text: currentCallNotif.currentCall
? currentCallNotif.currentCall.core.conference
? ("Réunion en cours : ") + currentCallNotif.currentCall.core.conference.core.subject
: (("Appel en cours : ") + currentCallNotif.peerName) : "appel en cours"
color: DefaultStyle.success_500main
onClicked: {
var callsWindow = UtilsCpp.getCallsWindow(currentCallNotif.currentCall)
UtilsCpp.smartShowWindow(callsWindow)
}
}
}
anchors.fill: parent
ColumnLayout{
anchors.fill: parent

View file

@ -39,6 +39,7 @@ list(APPEND _LINPHONEAPP_QML_FILES
view/Item/Notification/Notification.qml
view/Item/Notification/NotificationReceivedCall.qml
view/Item/Notification/TemporaryNotification.qml
view/Item/Participant/ParticipantDeviceListView.qml
view/Item/Participant/ParticipantListView.qml

View file

@ -8,9 +8,9 @@ Control.Button {
id: mainItem
property int capitalization
property color color: DefaultStyle.main1_500_main
property color disabledColor: DefaultStyle.main1_500_main_darker
property color borderColor: "transparent"
property color pressedColor: DefaultStyle.main1_500_main_darker
property color disabledColor: Qt.darker(color, 1.5)
property color borderColor: DefaultStyle.grey_0
readonly property color pressedColor: Qt.darker(color, 1.1)
property bool inversedColors: false
property int textSize: 18 * DefaultStyle.dp
property int textWeight: 600 * DefaultStyle.dp

View file

@ -149,7 +149,6 @@ ListView {
height: 30 * DefaultStyle.dp
radius: 50 * DefaultStyle.dp
color: isSelectedDay ? DefaultStyle.main1_500_main : "transparent"
border.color: DefaultStyle.main1_500_main_darker
border.width: focusDay.activeFocus || hoveringArea.containsMouse ? 1 : 0
}

View file

@ -12,7 +12,7 @@ Item{
property int textSize: 14 * DefaultStyle.dp
property int textWeight: 400 * DefaultStyle.dp
property color backgroundColor: DefaultStyle.grey_0
property color backgroundPressedColor: DefaultStyle.main2_100
readonly property color backgroundPressedColor: Qt.darker(backgroundColor, 1.1)
property int radius: 5 * DefaultStyle.dp
property bool shadowEnabled: mainItem.activeFocus// || containsMouse
property alias containsMouse: mouseArea.containsMouse

View file

@ -80,7 +80,6 @@ Notification {
spacing: 26 * DefaultStyle.dp
Button {
color: DefaultStyle.success_500main
pressedColor: DefaultStyle.success_500main_darker
Layout.preferredWidth: 75 * DefaultStyle.dp
Layout.preferredHeight: 55 * DefaultStyle.dp
contentItem: EffectImage {

View file

@ -0,0 +1,65 @@
import QtQuick 2.7
import QtQuick.Effects
import Linphone
Control.Control {
id: mainItem
// width: 269 * DefaultStyle.dp
y: -height
z: 1
topPadding: 8 * DefaultStyle.dp
bottomPadding: 8 * DefaultStyle.dp
leftPadding: 37 * DefaultStyle.dp
rightPadding: 37 * DefaultStyle.dp
anchors.horizontalCenter: parent.horizontalCenter
clip: true
property string text
property string imageSource
property color contentColor
property int yCoord
signal clicked()
function open() {
y = mainItem.yCoord
autoCloseNotification.restart()
}
MouseArea {
anchors.fill: parent
onClicked: mainItem.clicked()
}
Timer {
id: autoCloseNotification
interval: 4000
onTriggered: {
mainItem.y = -mainItem.height
}
}
Behavior on y {NumberAnimation {duration: 1000}}
background: Rectangle {
anchors.fill: parent
color: DefaultStyle.grey_0
border.color: mainItem.contentColor
border.width: 1 * DefaultStyle.dp
radius: 50 * DefaultStyle.dp
}
contentItem: RowLayout {
Image {
visible: mainItem.imageSource != undefined
source: mainItem.imageSource
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
fillMode: Image.PreserveAspectFit
Layout.fillWidth: true
}
Text {
color: mainItem.contentColor
text: mainItem.text
Layout.fillWidth: true
font {
pixelSize: 14 * DefaultStyle.dp
}
}
}
}

View file

@ -85,7 +85,6 @@ ListView {
Layout.preferredWidth: 20 * DefaultStyle.dp
Layout.preferredHeight: 20 * DefaultStyle.dp
color: DefaultStyle.main2_100
pressedColor: DefaultStyle.main2_200
icon.source: AppIcons.closeX
icon.width: 14 * DefaultStyle.dp
icon.height: 14 * DefaultStyle.dp

View file

@ -83,7 +83,6 @@ Item{
Button {
color: "transparent"
borderColor: DefaultStyle.main2_400
pressedColor: DefaultStyle.main2_500main
icon.source: AppIcons.shareNetwork
contentImageColor: DefaultStyle.main2_400
text: qsTr("Share invitation")

View file

@ -148,7 +148,6 @@ ColumnLayout {
Layout.alignment: Qt.AlignHCenter
text: qsTr("Rejoindre la réunion")
color: DefaultStyle.main2_200
pressedColor: DefaultStyle.main2_400
textColor: DefaultStyle.main2_600
onClicked: {
if (mainItem.conferenceInfo) {

View file

@ -4,7 +4,6 @@ import QtQuick 2.15
QtObject {
property color main1_100: "#FFEACB"
property color main1_500_main: "#FE5E00"
property color main1_500_main_darker: "#C94C02"
property color main2_0: "#FAFEFF"
property color main2_100: "#EEF6F8"
@ -29,7 +28,6 @@ QtObject {
property color warning_600: "#DBB820"
property color danger_500main: "#DD5F5F"
property color success_500main: "#4FAE80"
property color success_500main_darker: "#3F8C67"
property color info_500_main: "#4AA8FF"
property color vue_meter_light_green: "#6FF88D"