mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-04 06:45:45 +02:00
swarmdetailspanel: add conversation details to the context menu
and add the identifier to check the swarm id (for future public groups, it will be important) Change-Id: I5ebc16cdc280567447abd14a05c4a62263609f25
This commit is contained in:
parent
4449aabfed
commit
5973790c8b
7 changed files with 66 additions and 6 deletions
|
@ -254,7 +254,7 @@ Item {
|
||||||
property string removeContact: qsTr("Remove contact")
|
property string removeContact: qsTr("Remove contact")
|
||||||
property string blockContact: qsTr("Block contact")
|
property string blockContact: qsTr("Block contact")
|
||||||
property string blockSwarm: qsTr("Block swarm")
|
property string blockSwarm: qsTr("Block swarm")
|
||||||
property string contactDetails: qsTr("Contact details")
|
property string convDetails: qsTr("Conversation details")
|
||||||
|
|
||||||
// CallViewContextMenu
|
// CallViewContextMenu
|
||||||
property string hold: qsTr("Hold")
|
property string hold: qsTr("Hold")
|
||||||
|
|
|
@ -144,3 +144,9 @@ CurrentConversation::connectModel()
|
||||||
&CurrentConversation::onProfileUpdated,
|
&CurrentConversation::onProfileUpdated,
|
||||||
Qt::UniqueConnection);
|
Qt::UniqueConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CurrentConversation::showSwarmDetails() const
|
||||||
|
{
|
||||||
|
Q_EMIT showDetails();
|
||||||
|
}
|
||||||
|
|
|
@ -54,6 +54,11 @@ public:
|
||||||
explicit CurrentConversation(LRCInstance* lrcInstance, QObject* parent = nullptr);
|
explicit CurrentConversation(LRCInstance* lrcInstance, QObject* parent = nullptr);
|
||||||
~CurrentConversation() = default;
|
~CurrentConversation() = default;
|
||||||
|
|
||||||
|
Q_INVOKABLE void showSwarmDetails() const;
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void showDetails() const;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void updateData();
|
void updateData();
|
||||||
void onConversationUpdated(const QString& convId);
|
void onConversationUpdated(const QString& convId);
|
||||||
|
|
|
@ -40,6 +40,7 @@ Rectangle {
|
||||||
enabled: true
|
enabled: true
|
||||||
function onTitleChanged() { title.eText = CurrentConversation.title }
|
function onTitleChanged() { title.eText = CurrentConversation.title }
|
||||||
function onDescriptionChanged() { description.eText = CurrentConversation.description }
|
function onDescriptionChanged() { description.eText = CurrentConversation.description }
|
||||||
|
function onShowDetails() { root.showDetailsClicked() }
|
||||||
}
|
}
|
||||||
|
|
||||||
property bool interactionButtonsVisibility: {
|
property bool interactionButtonsVisibility: {
|
||||||
|
|
|
@ -113,6 +113,8 @@ JamiListView {
|
||||||
ConversationSmartListContextMenu {
|
ConversationSmartListContextMenu {
|
||||||
id: contextMenu
|
id: contextMenu
|
||||||
|
|
||||||
|
property var index: -1
|
||||||
|
|
||||||
function openMenuAt(x, y) {
|
function openMenuAt(x, y) {
|
||||||
contextMenu.x = x
|
contextMenu.x = x
|
||||||
contextMenu.y = y
|
contextMenu.y = y
|
||||||
|
@ -122,6 +124,7 @@ JamiListView {
|
||||||
// - userProfile dialog should use a loader/popup
|
// - userProfile dialog should use a loader/popup
|
||||||
|
|
||||||
var row = root.indexAt(x, y + root.contentY)
|
var row = root.indexAt(x, y + root.contentY)
|
||||||
|
index = row
|
||||||
var item = {
|
var item = {
|
||||||
"convId": model.dataForRow(row, ConversationList.UID),
|
"convId": model.dataForRow(row, ConversationList.UID),
|
||||||
"displayId": model.dataForRow(row, ConversationList.BestId),
|
"displayId": model.dataForRow(row, ConversationList.BestId),
|
||||||
|
@ -151,6 +154,11 @@ JamiListView {
|
||||||
|
|
||||||
openMenu()
|
openMenu()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onShowSwarmDetails: {
|
||||||
|
model.select(index)
|
||||||
|
CurrentConversation.showSwarmDetails()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Shortcut {
|
Shortcut {
|
||||||
|
|
|
@ -28,6 +28,8 @@ import "../../commoncomponents/contextmenu"
|
||||||
ContextMenuAutoLoader {
|
ContextMenuAutoLoader {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
signal showSwarmDetails
|
||||||
|
|
||||||
ConfirmDialog {
|
ConfirmDialog {
|
||||||
id: rmDialog
|
id: rmDialog
|
||||||
|
|
||||||
|
@ -164,10 +166,14 @@ ContextMenuAutoLoader {
|
||||||
id: contactDetails
|
id: contactDetails
|
||||||
|
|
||||||
canTrigger: contactType !== Profile.Type.SIP
|
canTrigger: contactType !== Profile.Type.SIP
|
||||||
&& !(mode && mode !== Conversation.Mode.ONE_TO_ONE && mode !== Conversation.Mode.NON_SWARM)
|
itemName: JamiStrings.convDetails
|
||||||
itemName: JamiStrings.contactDetails
|
|
||||||
iconSource: JamiResources.person_24dp_svg
|
iconSource: JamiResources.person_24dp_svg
|
||||||
onClicked: userProfile.open()
|
onClicked: {
|
||||||
|
if (!(mode && mode !== Conversation.Mode.ONE_TO_ONE && mode !== Conversation.Mode.NON_SWARM))
|
||||||
|
userProfile.open()
|
||||||
|
else
|
||||||
|
root.showSwarmDetails()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -325,9 +325,9 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
Layout.preferredHeight: JamiTheme.settingsFontSize + 2 * JamiTheme.preferredMarginSize + 4
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
@ -349,11 +349,45 @@ Rectangle {
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
|
|
||||||
color: JamiTheme.buttonTintedBlack
|
color: JamiTheme.textColor
|
||||||
|
|
||||||
text: CurrentConversation.modeString
|
text: CurrentConversation.modeString
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
Layout.preferredHeight: JamiTheme.settingsFontSize + 2 * JamiTheme.preferredMarginSize + 4
|
||||||
|
Layout.maximumWidth: parent.width
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: idLabel
|
||||||
|
Layout.preferredHeight: 30
|
||||||
|
Layout.rightMargin: JamiTheme.preferredMarginSize
|
||||||
|
Layout.maximumWidth: parent.width / 2
|
||||||
|
|
||||||
|
text: JamiStrings.identifier
|
||||||
|
font.pointSize: JamiTheme.settingsFontSize
|
||||||
|
font.kerning: true
|
||||||
|
elide: Text.ElideRight
|
||||||
|
horizontalAlignment: Text.AlignLeft
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
|
||||||
|
color: JamiTheme.textColor
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
Layout.maximumWidth: parent.width / 2
|
||||||
|
|
||||||
|
color: JamiTheme.textColor
|
||||||
|
|
||||||
|
|
||||||
|
text: CurrentConversation.id
|
||||||
|
elide: Text.ElideRight
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JamiListView {
|
JamiListView {
|
||||||
|
|
Loading…
Add table
Reference in a new issue