mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-03 22:35: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 blockContact: qsTr("Block contact")
|
||||
property string blockSwarm: qsTr("Block swarm")
|
||||
property string contactDetails: qsTr("Contact details")
|
||||
property string convDetails: qsTr("Conversation details")
|
||||
|
||||
// CallViewContextMenu
|
||||
property string hold: qsTr("Hold")
|
||||
|
|
|
@ -144,3 +144,9 @@ CurrentConversation::connectModel()
|
|||
&CurrentConversation::onProfileUpdated,
|
||||
Qt::UniqueConnection);
|
||||
}
|
||||
|
||||
void
|
||||
CurrentConversation::showSwarmDetails() const
|
||||
{
|
||||
Q_EMIT showDetails();
|
||||
}
|
||||
|
|
|
@ -54,6 +54,11 @@ public:
|
|||
explicit CurrentConversation(LRCInstance* lrcInstance, QObject* parent = nullptr);
|
||||
~CurrentConversation() = default;
|
||||
|
||||
Q_INVOKABLE void showSwarmDetails() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void showDetails() const;
|
||||
|
||||
private Q_SLOTS:
|
||||
void updateData();
|
||||
void onConversationUpdated(const QString& convId);
|
||||
|
|
|
@ -40,6 +40,7 @@ Rectangle {
|
|||
enabled: true
|
||||
function onTitleChanged() { title.eText = CurrentConversation.title }
|
||||
function onDescriptionChanged() { description.eText = CurrentConversation.description }
|
||||
function onShowDetails() { root.showDetailsClicked() }
|
||||
}
|
||||
|
||||
property bool interactionButtonsVisibility: {
|
||||
|
|
|
@ -113,6 +113,8 @@ JamiListView {
|
|||
ConversationSmartListContextMenu {
|
||||
id: contextMenu
|
||||
|
||||
property var index: -1
|
||||
|
||||
function openMenuAt(x, y) {
|
||||
contextMenu.x = x
|
||||
contextMenu.y = y
|
||||
|
@ -122,6 +124,7 @@ JamiListView {
|
|||
// - userProfile dialog should use a loader/popup
|
||||
|
||||
var row = root.indexAt(x, y + root.contentY)
|
||||
index = row
|
||||
var item = {
|
||||
"convId": model.dataForRow(row, ConversationList.UID),
|
||||
"displayId": model.dataForRow(row, ConversationList.BestId),
|
||||
|
@ -151,6 +154,11 @@ JamiListView {
|
|||
|
||||
openMenu()
|
||||
}
|
||||
|
||||
onShowSwarmDetails: {
|
||||
model.select(index)
|
||||
CurrentConversation.showSwarmDetails()
|
||||
}
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
|
|
|
@ -28,6 +28,8 @@ import "../../commoncomponents/contextmenu"
|
|||
ContextMenuAutoLoader {
|
||||
id: root
|
||||
|
||||
signal showSwarmDetails
|
||||
|
||||
ConfirmDialog {
|
||||
id: rmDialog
|
||||
|
||||
|
@ -164,10 +166,14 @@ ContextMenuAutoLoader {
|
|||
id: contactDetails
|
||||
|
||||
canTrigger: contactType !== Profile.Type.SIP
|
||||
&& !(mode && mode !== Conversation.Mode.ONE_TO_ONE && mode !== Conversation.Mode.NON_SWARM)
|
||||
itemName: JamiStrings.contactDetails
|
||||
itemName: JamiStrings.convDetails
|
||||
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 {
|
||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||
Layout.preferredHeight: JamiTheme.settingsFontSize + 2 * JamiTheme.preferredMarginSize + 4
|
||||
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
|
@ -349,11 +349,45 @@ Rectangle {
|
|||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
|
||||
color: JamiTheme.buttonTintedBlack
|
||||
color: JamiTheme.textColor
|
||||
|
||||
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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue