diff --git a/Linphone/core/account/AccountCore.cpp b/Linphone/core/account/AccountCore.cpp index 7c2f3a281..0005c404d 100644 --- a/Linphone/core/account/AccountCore.cpp +++ b/Linphone/core/account/AccountCore.cpp @@ -42,8 +42,8 @@ AccountCore::AccountCore(const std::shared_ptr &account) : QO // Init data auto address = account->getContactAddress(); mContactAddress = address ? Utils::coreStringToAppString(account->getContactAddress()->asStringUriOnly()) : ""; - auto params = account->getParams(); - auto identityAddress = params->getIdentityAddress(); + auto params = account->getParams()->clone(); + auto identityAddress = params->getIdentityAddress()->clone(); mIdentityAddress = identityAddress ? Utils::coreStringToAppString(identityAddress->asStringUriOnly()) : ""; mPictureUri = Utils::coreStringToAppString(params->getPictureUri()); mRegistrationState = LinphoneEnums::fromLinphone(account->getState()); @@ -53,6 +53,9 @@ AccountCore::AccountCore(const std::shared_ptr &account) : QO mDisplayName = Utils::coreStringToAppString(identityAddress->getDisplayName()); if (mDisplayName.isEmpty()) { mDisplayName = ToolModel::getDisplayName(mIdentityAddress); + identityAddress->setDisplayName(Utils::appStringToCoreString(mDisplayName)); + params->setIdentityAddress(identityAddress); + account->setParams(params); } mRegisterEnabled = params->registerEnabled(); mMwiServerAddress = diff --git a/Linphone/core/participant/ParticipantCore.cpp b/Linphone/core/participant/ParticipantCore.cpp index 617936114..400b1cac1 100644 --- a/Linphone/core/participant/ParticipantCore.cpp +++ b/Linphone/core/participant/ParticipantCore.cpp @@ -61,7 +61,6 @@ ParticipantCore::ParticipantCore(const std::shared_ptr &p mParticipantDevices.append(map); } } else mIsMe = false; - connect(this, &ParticipantCore::sipAddressChanged, this, &ParticipantCore::updateIsMe); } ParticipantCore::~ParticipantCore() { @@ -74,6 +73,7 @@ void ParticipantCore::setSelf(QSharedPointer me) { mParticipantConnection->makeConnectToCore(&ParticipantCore::lStartInvitation, [this](const int &secs) { QTimer::singleShot(secs * 1000, this, &ParticipantCore::onEndOfInvitation); }); + connect(this, &ParticipantCore::sipAddressChanged, this, &ParticipantCore::updateIsMe); } int ParticipantCore::getSecurityLevel() const { diff --git a/Linphone/model/account/AccountModel.hpp b/Linphone/model/account/AccountModel.hpp index 0682ef55c..c5583963d 100644 --- a/Linphone/model/account/AccountModel.hpp +++ b/Linphone/model/account/AccountModel.hpp @@ -37,13 +37,6 @@ public: AccountModel(const std::shared_ptr &account, QObject *parent = nullptr); ~AccountModel(); - virtual void onRegistrationStateChanged(const std::shared_ptr &account, - linphone::RegistrationState state, - const std::string &message) override; - virtual void - onMessageWaitingIndicationChanged(const std::shared_ptr &account, - const std::shared_ptr &mwi) override; - void onDefaultAccountChanged(); std::string getConfigAccountUiSection(); @@ -103,6 +96,14 @@ signals: void voicemailCountChanged(int count); private: + /**Linphone **/ + virtual void onRegistrationStateChanged(const std::shared_ptr &account, + linphone::RegistrationState state, + const std::string &message) override; + virtual void + onMessageWaitingIndicationChanged(const std::shared_ptr &account, + const std::shared_ptr &mwi) override; + // UserData static void setUserData(const std::shared_ptr &account, std::shared_ptr &data); static std::shared_ptr getUserData(const std::shared_ptr &account); diff --git a/Linphone/view/Control/Button/Button.qml b/Linphone/view/Control/Button/Button.qml index 4ad1a8ec3..f63995c17 100644 --- a/Linphone/view/Control/Button/Button.qml +++ b/Linphone/view/Control/Button/Button.qml @@ -141,8 +141,7 @@ Control.Button { Layout.preferredWidth: mainItem.icon.width Layout.preferredHeight: mainItem.icon.height } - ButtonText{ - Layout.fillHeight: true + ButtonText { horizontalAlignment: Text.AlignLeft } Item{ diff --git a/Linphone/view/Control/Container/Call/CallLayout.qml b/Linphone/view/Control/Container/Call/CallLayout.qml index 8ac39b2fe..4880051c3 100644 --- a/Linphone/view/Control/Container/Call/CallLayout.qml +++ b/Linphone/view/Control/Container/Call/CallLayout.qml @@ -15,7 +15,7 @@ Item { property ConferenceGui conference: call && call.core.conference property bool callTerminatedByUser: false property bool callStarted: call?.core.isStarted - readonly property var callState: call && call.core.state || undefined + readonly property var callState: call? call.core.state : undefined property int conferenceLayout: call && call.core.conferenceVideoLayout || 0 // property int participantDeviceCount: conference ? conference.core.participantDeviceCount : -1 // onParticipantDeviceCountChanged: { @@ -40,14 +40,14 @@ Item { anchors.top: parent.top anchors.topMargin: 25 * DefaultStyle.dp z: 1 - visible: callState === LinphoneEnums.CallState.End || callState === LinphoneEnums.CallState.Error || callState === LinphoneEnums.CallState.Released + visible: mainItem.callState === LinphoneEnums.CallState.End || mainItem.callState === LinphoneEnums.CallState.Error || mainItem.callState === LinphoneEnums.CallState.Released text: mainItem.conference ? qsTr("Vous avez quitté la conférence") - : mainItem.callStarted - ? mainItem.callTerminatedByUser - ? qsTr("Vous avez terminé l'appel") - : qsTr("Votre correspondant a terminé l'appel") - : call && call.core.lastErrorMessage || "" + : mainItem.callTerminatedByUser + ? qsTr("Vous avez terminé l'appel") + : mainItem.callStarted + ? qsTr("Votre correspondant a terminé l'appel") + : call && call.core.lastErrorMessage || "" color: DefaultStyle.grey_0 font { pixelSize: 22 * DefaultStyle.dp diff --git a/Linphone/view/Control/Display/Contact/Contact.qml b/Linphone/view/Control/Display/Contact/Contact.qml index 344007f70..e21842ea2 100644 --- a/Linphone/view/Control/Display/Contact/Contact.qml +++ b/Linphone/view/Control/Display/Contact/Contact.qml @@ -9,21 +9,26 @@ import Linphone import UtilsCpp import SettingsCpp -Rectangle{ +Control.Control{ id: mainItem + padding: 10 * DefaultStyle.dp property AccountGui account + property color backgroundColor: DefaultStyle.grey_0 signal avatarClicked() signal backgroundClicked() signal edit() - - height: 45 * DefaultStyle.dp - MouseArea{ - anchors.fill: parent - onClicked: mainItem.backgroundClicked() + + background: Rectangle { + radius: 10 * DefaultStyle.dp + color: mainItem.backgroundColor + MouseArea{ + id: mouseArea + anchors.fill: parent + onClicked: mainItem.backgroundClicked() + } } - RowLayout{ - anchors.fill: parent + contentItem: RowLayout{ spacing: 0 RowLayout { spacing: 10 * DefaultStyle.dp diff --git a/Linphone/view/Page/Form/Contact/ContactDescription.qml b/Linphone/view/Page/Form/Contact/ContactDescription.qml index 83261a26a..9e89aa87f 100644 --- a/Linphone/view/Page/Form/Contact/ContactDescription.qml +++ b/Linphone/view/Page/Form/Contact/ContactDescription.qml @@ -16,27 +16,27 @@ ColumnLayout{ Text { id: topTextItem Layout.fillHeight: true + Layout.fillWidth: true verticalAlignment: (bottomTextItem.visible?Text.AlignBottom:Text.AlignVCenter) - visible: text != '' + visible: text != "" font.weight: 400 * DefaultStyle.dp font.pixelSize: 14 * DefaultStyle.dp color: DefaultStyle.main2_700 text: mainItem.topText width: mainItem.width - Layout.preferredWidth: mainItem.width wrapMode: Text.WrapAnywhere maximumLineCount: 1 } Text { id: bottomTextItem Layout.fillHeight: true + Layout.fillWidth: true verticalAlignment: (topTextItem.visible?Text.AlignTop:Text.AlignVCenter) visible: text != '' font.weight: 300 * DefaultStyle.dp font.pixelSize: 12 * DefaultStyle.dp color: DefaultStyle.main2_400 text: mainItem.bottomText - Layout.preferredWidth: mainItem.width maximumLineCount: 1 wrapMode: Text.WrapAnywhere } diff --git a/Linphone/view/Page/Form/Meeting/AddParticipantsForm.qml b/Linphone/view/Page/Form/Meeting/AddParticipantsForm.qml index f42821f97..ef69c4bc2 100644 --- a/Linphone/view/Page/Form/Meeting/AddParticipantsForm.qml +++ b/Linphone/view/Page/Form/Meeting/AddParticipantsForm.qml @@ -160,6 +160,7 @@ FocusScope{ searchBarText: searchbar.text sourceFlags: LinphoneEnums.MagicSearchSource.All multiSelectionEnabled: true + displayNameCapitalization: false onContactAddedToSelection: (address) => { contactList.addContactToSelection(address) participantList.positionViewAtEnd() diff --git a/Linphone/view/Page/Layout/Login/LoginLayout.qml b/Linphone/view/Page/Layout/Login/LoginLayout.qml index 5ec33a8f4..8862dd92f 100644 --- a/Linphone/view/Page/Layout/Login/LoginLayout.qml +++ b/Linphone/view/Page/Layout/Login/LoginLayout.qml @@ -21,6 +21,7 @@ Rectangle { property var imageSource property string title property string text + property bool enableMouseArea: false signal contentClicked() EffectImage { Layout.preferredWidth: 32 * DefaultStyle.dp @@ -55,6 +56,7 @@ Rectangle { } MouseArea { id: privateMouseArea + enabled: line.enableMouseArea anchors.fill: parent hoverEnabled: true cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor @@ -80,6 +82,7 @@ Rectangle { imageSource: AppIcons.detective title: qsTr("Politique de confidentialité") text: qsTr("Visiter notre potilique de confidentialité") + enableMouseArea: true onContentClicked: Qt.openUrlExternally(ConstantsCpp.PrivatePolicyUrl) } AboutLine { diff --git a/Linphone/view/Page/Main/AbstractMainPage.qml b/Linphone/view/Page/Main/AbstractMainPage.qml index 0083602f5..6626807cd 100644 --- a/Linphone/view/Page/Main/AbstractMainPage.qml +++ b/Linphone/view/Page/Main/AbstractMainPage.qml @@ -175,14 +175,14 @@ FocusScope { bottomPadding: 11 * DefaultStyle.dp leftPadding: 20 * DefaultStyle.dp rightPadding: 20 * DefaultStyle.dp - icon.source: AppIcons.newItemIconSource + icon.source: mainItem.newItemIconSource icon.width: 24 * DefaultStyle.dp icon.height: 24 * DefaultStyle.dp contentImageColor: DefaultStyle.grey_0 text: mainItem.noItemButtonText textSize: 18 * DefaultStyle.dp textWeight: 600 * DefaultStyle.dp - + spacing: 8 * DefaultStyle.dp onPressed: mainItem.noItemButtonPressed() } Item { diff --git a/Linphone/view/Page/Main/Account/AccountListView.qml b/Linphone/view/Page/Main/Account/AccountListView.qml index dd5013249..86408b0c6 100644 --- a/Linphone/view/Page/Main/Account/AccountListView.qml +++ b/Linphone/view/Page/Main/Account/AccountListView.qml @@ -12,9 +12,9 @@ Item { id: mainItem width: 517 * DefaultStyle.dp readonly property int topPadding: 23 * DefaultStyle.dp - readonly property int bottomPadding: 23 * DefaultStyle.dp - readonly property int leftPadding: 32 * DefaultStyle.dp - readonly property int rightPadding: 32 * DefaultStyle.dp + readonly property int bottomPadding: 18 * DefaultStyle.dp + readonly property int leftPadding: 24 * DefaultStyle.dp + readonly property int rightPadding: 24 * DefaultStyle.dp readonly property int spacing: 16 * DefaultStyle.dp property AccountProxy accountProxy @@ -37,14 +37,25 @@ Item { Layout.preferredHeight: contentHeight Layout.fillWidth: true spacing: mainItem.spacing - model: AppCpp.accounts + model: AccountProxy { + sourceModel: AppCpp.accounts + } delegate: Contact{ id: contactItem width: list.width account: modelData onAvatarClicked: fileDialog.open() - onBackgroundClicked: modelData.core.lSetDefaultAccount() + onBackgroundClicked: { + list.currentIndex = index + modelData.core.lSetDefaultAccount() + } onEdit: editAccount(modelData) + hoverEnabled: true + backgroundColor: list.currentIndex === index + ? DefaultStyle.grey_200 + : hovered + ? DefaultStyle.main2_100 + : DefaultStyle.grey_0 FileDialog { id: fileDialog currentFolder: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0] diff --git a/Linphone/view/Page/Main/Call/CallPage.qml b/Linphone/view/Page/Main/Call/CallPage.qml index 4f86374ac..0cdfd7f7c 100644 --- a/Linphone/view/Page/Main/Call/CallPage.qml +++ b/Linphone/view/Page/Main/Call/CallPage.qml @@ -55,7 +55,7 @@ AbstractMainPage { onNoItemButtonPressed: goToNewCall() - showDefaultItem: listStackView.currentItem && listStackView.currentItem.listView && listStackView.currentItem.listView.count === 0 && listStackView.currentItem.listView.model.sourceModel.count === 0 || false + showDefaultItem: listStackView.currentItem && listStackView.currentItem.listView && listStackView.currentItem.listView.count === 0 function goToNewCall() { if (listStackView.currentItem && listStackView.currentItem.objectName != "newCallItem") listStackView.push(newCallItem) @@ -199,6 +199,7 @@ AbstractMainPage { id: historyListItem FocusScope{ objectName: "historyListItem" + property var listView: historyListView Control.StackView.onActivated: titleLoader.sourceComponent = historyListTitle ColumnLayout { anchors.fill: parent