mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-17 20:08:28 +00:00
Access to shared medias and documents from contact page #LINQT-2432
This commit is contained in:
parent
f99399d83c
commit
2817e48a68
10 changed files with 172 additions and 44 deletions
|
|
@ -54,6 +54,14 @@ FriendCore::FriendCore(const std::shared_ptr<linphone::Friend> &contact, bool is
|
||||||
mPictureUri = Utils::coreStringToAppString(contact->getPhoto());
|
mPictureUri = Utils::coreStringToAppString(contact->getPhoto());
|
||||||
mFullName = mFriendModel->getFullName();
|
mFullName = mFriendModel->getFullName();
|
||||||
auto defaultAddress = contact->getAddress();
|
auto defaultAddress = contact->getAddress();
|
||||||
|
if (!defaultAddress) {
|
||||||
|
for (auto &address : contact->getAddresses()) {
|
||||||
|
if (address) {
|
||||||
|
defaultAddress = address;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
auto vcard = contact->getVcard();
|
auto vcard = contact->getVcard();
|
||||||
if (vcard) {
|
if (vcard) {
|
||||||
mOrganization = Utils::coreStringToAppString(vcard->getOrganization());
|
mOrganization = Utils::coreStringToAppString(vcard->getOrganization());
|
||||||
|
|
@ -731,7 +739,7 @@ bool FriendCore::getReadOnly() const {
|
||||||
// [misc]vcards-contacts-list=<URL> & CardDAV
|
// [misc]vcards-contacts-list=<URL> & CardDAV
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<FriendModel> FriendCore::getFriendModel() {
|
std::shared_ptr<FriendModel> FriendCore::getModel() {
|
||||||
return mFriendModel;
|
return mFriendModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ public:
|
||||||
bool isCardDAV() const;
|
bool isCardDAV() const;
|
||||||
bool getReadOnly() const;
|
bool getReadOnly() const;
|
||||||
|
|
||||||
std::shared_ptr<FriendModel> getFriendModel();
|
std::shared_ptr<FriendModel> getModel();
|
||||||
|
|
||||||
Q_INVOKABLE void remove();
|
Q_INVOKABLE void remove();
|
||||||
Q_INVOKABLE void save();
|
Q_INVOKABLE void save();
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,8 @@ void MagicSearchList::setSelf(const QSharedPointer<MagicSearchList> &me) {
|
||||||
auto haveContact =
|
auto haveContact =
|
||||||
std::find_if(mList.begin(), mList.end(), [friendCore](const QSharedPointer<QObject> &item) {
|
std::find_if(mList.begin(), mList.end(), [friendCore](const QSharedPointer<QObject> &item) {
|
||||||
auto itemCore = item.objectCast<FriendCore>();
|
auto itemCore = item.objectCast<FriendCore>();
|
||||||
auto itemModel = itemCore->getFriendModel();
|
auto itemModel = itemCore->getModel();
|
||||||
auto friendModel = friendCore->getFriendModel();
|
auto friendModel = friendCore->getModel();
|
||||||
return itemCore->getDefaultAddress().length() > 0 &&
|
return itemCore->getDefaultAddress().length() > 0 &&
|
||||||
itemCore->getDefaultAddress() == friendCore->getDefaultAddress() ||
|
itemCore->getDefaultAddress() == friendCore->getDefaultAddress() ||
|
||||||
itemModel && friendModel && itemModel->getFriend() == friendModel->getFriend() &&
|
itemModel && friendModel && itemModel->getFriend() == friendModel->getFriend() &&
|
||||||
|
|
|
||||||
|
|
@ -133,6 +133,7 @@ list(APPEND _LINPHONEAPP_QML_FILES
|
||||||
view/Page/Form/Chat/SelectedChatView.qml
|
view/Page/Form/Chat/SelectedChatView.qml
|
||||||
view/Page/Form/Contact/ContactDescription.qml
|
view/Page/Form/Contact/ContactDescription.qml
|
||||||
view/Page/Form/Contact/ContactEdition.qml
|
view/Page/Form/Contact/ContactEdition.qml
|
||||||
|
view/Page/Form/Contact/ContactSharedFiles.qml
|
||||||
view/Page/Form/Login/LoginPage.qml
|
view/Page/Form/Login/LoginPage.qml
|
||||||
view/Page/Form/Login/SIPLoginPage.qml
|
view/Page/Form/Login/SIPLoginPage.qml
|
||||||
view/Page/Form/Meeting/AddParticipantsForm.qml
|
view/Page/Form/Meeting/AddParticipantsForm.qml
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,9 @@ ColumnLayout {
|
||||||
id: mainItem
|
id: mainItem
|
||||||
property color panelColor: DefaultStyle.grey_100
|
property color panelColor: DefaultStyle.grey_100
|
||||||
property alias headerContentItem: rightPanelHeader.contentItem
|
property alias headerContentItem: rightPanelHeader.contentItem
|
||||||
property alias content: rightPanelContent.children
|
property alias content: rightPanelContent.contentItem
|
||||||
property alias header: rightPanelHeader
|
property alias header: rightPanelHeader
|
||||||
|
property int contentTopPadding: 0
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
Control.Control {
|
Control.Control {
|
||||||
|
|
@ -41,16 +42,20 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Control.Control {
|
||||||
id: rightPanelContent
|
id: rightPanelContent
|
||||||
color: mainItem.panelColor
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
MouseArea {
|
topPadding: mainItem.contentTopPadding
|
||||||
anchors.fill: parent
|
background: Rectangle {
|
||||||
onClicked: {
|
anchors.fill: parent
|
||||||
rightPanelContent.forceActiveFocus()
|
color: mainItem.panelColor
|
||||||
}
|
MouseArea {
|
||||||
}
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
rightPanelContent.forceActiveFocus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,6 @@ FocusScope {
|
||||||
}
|
}
|
||||||
|
|
||||||
content: Control.SplitView {
|
content: Control.SplitView {
|
||||||
anchors.fill: parent
|
|
||||||
orientation: Qt.Vertical
|
orientation: Qt.Vertical
|
||||||
handle: Rectangle {
|
handle: Rectangle {
|
||||||
id: splitViewHandle
|
id: splitViewHandle
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,6 @@ MainRightPanel {
|
||||||
|
|
||||||
content: ContactLayout {
|
content: ContactLayout {
|
||||||
id: contactLayoutItem
|
id: contactLayoutItem
|
||||||
anchors.fill: parent
|
|
||||||
contact: mainItem.contact
|
contact: mainItem.contact
|
||||||
button.text: mainItem.saveButtonText
|
button.text: mainItem.saveButtonText
|
||||||
button.Keys.onPressed: (event) => {
|
button.Keys.onPressed: (event) => {
|
||||||
|
|
|
||||||
60
Linphone/view/Page/Form/Contact/ContactSharedFiles.qml
Normal file
60
Linphone/view/Page/Form/Contact/ContactSharedFiles.qml
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
import QtCore
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls.Basic as Control
|
||||||
|
import QtQuick.Dialogs
|
||||||
|
import QtQuick.Effects
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Linphone
|
||||||
|
import UtilsCpp
|
||||||
|
import SettingsCpp
|
||||||
|
import 'qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js' as Utils
|
||||||
|
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
|
||||||
|
|
||||||
|
MainRightPanel {
|
||||||
|
id: mainItem
|
||||||
|
|
||||||
|
property FriendGui contact
|
||||||
|
property int filter
|
||||||
|
contentTopPadding: Utils.getSizeWithScreenRatio(24)
|
||||||
|
|
||||||
|
property string title: filter === ChatMessageFileProxy.FilterContentType.Medias
|
||||||
|
//: "Shared medias"
|
||||||
|
? qsTr("contact_shared_medias_title")
|
||||||
|
//: "Shared documents"
|
||||||
|
: qsTr("contact_shared_documents_title")
|
||||||
|
|
||||||
|
signal close()
|
||||||
|
|
||||||
|
headerContentItem: RowLayout {
|
||||||
|
Text {
|
||||||
|
text: mainItem.title
|
||||||
|
font {
|
||||||
|
pixelSize: Utils.getSizeWithScreenRatio(20)
|
||||||
|
weight: Typography.h4.weight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Item{Layout.fillWidth: true}
|
||||||
|
Button {
|
||||||
|
style: ButtonStyle.noBackground
|
||||||
|
Layout.preferredWidth: Utils.getSizeWithScreenRatio(30)
|
||||||
|
Layout.preferredHeight: Utils.getSizeWithScreenRatio(30)
|
||||||
|
icon.source: AppIcons.closeX
|
||||||
|
icon.width: Utils.getSizeWithScreenRatio(24)
|
||||||
|
icon.height: Utils.getSizeWithScreenRatio(24)
|
||||||
|
//: Close %1
|
||||||
|
Accessible.name: qsTr("close_accessible_name").arg(mainItem.title)
|
||||||
|
onClicked: {
|
||||||
|
mainItem.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
content: MessageSharedFilesInfos {
|
||||||
|
showTitle: false
|
||||||
|
property var chatObj: mainItem.contact
|
||||||
|
? UtilsCpp.getChatForAddress(mainItem.contact.core.defaultAddress)
|
||||||
|
: null
|
||||||
|
chatGui: chatObj && chatObj.value || null
|
||||||
|
filter: mainItem.filter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -22,12 +22,15 @@ ColumnLayout {
|
||||||
property alias listView: listView
|
property alias listView: listView
|
||||||
property var parentView
|
property var parentView
|
||||||
property alias content: contentLayout.children
|
property alias content: contentLayout.children
|
||||||
|
property bool showTitle: true
|
||||||
|
|
||||||
spacing: Utils.getSizeWithScreenRatio(25)
|
spacing: Utils.getSizeWithScreenRatio(25)
|
||||||
|
|
||||||
signal goBackRequested()
|
signal goBackRequested()
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
id: titleLayout
|
||||||
|
visible: mainItem.showTitle
|
||||||
BigButton {
|
BigButton {
|
||||||
icon.source: AppIcons.leftArrow
|
icon.source: AppIcons.leftArrow
|
||||||
style: ButtonStyle.noBackground
|
style: ButtonStyle.noBackground
|
||||||
|
|
|
||||||
|
|
@ -612,40 +612,85 @@ AbstractMainPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ContactDetailLayout {
|
ContactDetailLayout {
|
||||||
visible: false//!SettingsCpp.disableChatFeature
|
visible: !SettingsCpp.disableChatFeature
|
||||||
//: "Medias"
|
//: "Medias & documents"
|
||||||
label: qsTr("contact_details_medias_title")
|
label: qsTr("contact_details_medias_and_documents_title")
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
content: Button {
|
content: ColumnLayout {
|
||||||
style: ButtonStyle.noBackground
|
spacing: Utils.getSizeWithScreenRatio(10)
|
||||||
contentItem: RowLayout {
|
Button {
|
||||||
EffectImage {
|
Layout.fillWidth: true
|
||||||
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
|
style: ButtonStyle.noBackground
|
||||||
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
|
contentItem: RowLayout {
|
||||||
imageSource: AppIcons.shareNetwork
|
EffectImage {
|
||||||
colorizationColor: DefaultStyle.main2_600
|
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
|
||||||
}
|
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
|
||||||
Text {
|
imageSource: AppIcons.shareNetwork
|
||||||
//: "Afficher les medias partagés"
|
colorizationColor: DefaultStyle.main2_600
|
||||||
text: qsTr("contact_details_medias_subtitle")
|
}
|
||||||
font {
|
Text {
|
||||||
pixelSize: Typography.p1.pixelSize
|
//: "Show shared medias"
|
||||||
weight: Typography.p1.weight
|
text: qsTr("contact_details_medias_subtitle")
|
||||||
|
font {
|
||||||
|
pixelSize: Typography.p1.pixelSize
|
||||||
|
weight: Typography.p1.weight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
EffectImage {
|
||||||
|
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
|
||||||
|
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
|
||||||
|
imageSource: AppIcons.rightArrow
|
||||||
|
colorizationColor: DefaultStyle.main2_600
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
onClicked: {
|
||||||
Layout.fillWidth: true
|
rightPanelStackView.push(contactSharedFiles, {
|
||||||
}
|
"filter": ChatMessageFileProxy.FilterContentType.Medias})
|
||||||
EffectImage {
|
|
||||||
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
|
|
||||||
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
|
|
||||||
imageSource: AppIcons.rightArrow
|
|
||||||
colorizationColor: DefaultStyle.main2_600
|
|
||||||
}
|
}
|
||||||
|
Accessible.name: qsTr("contact_details_medias_subtitle")
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: Utils.getSizeWithScreenRatio(1)
|
||||||
|
color: DefaultStyle.main2_200
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
style: ButtonStyle.noBackground
|
||||||
|
contentItem: RowLayout {
|
||||||
|
EffectImage {
|
||||||
|
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
|
||||||
|
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
|
||||||
|
imageSource: AppIcons.pdf
|
||||||
|
colorizationColor: DefaultStyle.main2_600
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
//: "Show shared documents"
|
||||||
|
text: qsTr("contact_details_documents_subtitle")
|
||||||
|
font {
|
||||||
|
pixelSize: Typography.p1.pixelSize
|
||||||
|
weight: Typography.p1.weight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
EffectImage {
|
||||||
|
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
|
||||||
|
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
|
||||||
|
imageSource: AppIcons.rightArrow
|
||||||
|
colorizationColor: DefaultStyle.main2_600
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onClicked: {
|
||||||
|
rightPanelStackView.push(contactSharedFiles, {
|
||||||
|
"filter": ChatMessageFileProxy.FilterContentType.Documents})
|
||||||
|
}
|
||||||
|
Accessible.name: qsTr("contact_details_documents_subtitle")
|
||||||
}
|
}
|
||||||
onClicked: console.debug(
|
|
||||||
"TODO : go to shared media")
|
|
||||||
Accessible.name: qsTr("contact_details_medias_subtitle")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ContactDetailLayout {
|
ContactDetailLayout {
|
||||||
|
|
@ -884,4 +929,12 @@ AbstractMainPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: contactSharedFiles
|
||||||
|
ContactSharedFiles {
|
||||||
|
contact: mainItem.selectedContact
|
||||||
|
onClose: rightPanelStackView.pop()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue