Commit 8adba6b0 authored by Martin Straka's avatar Martin Straka

Update message detail after upload to records management

parent 22aa8683
......@@ -116,6 +116,13 @@ Component {
}
}
Connections {
target: messages
onUpdateMessageDetail: {
msgDescrHtml = msgHtmlInfo
}
}
PageHeader {
id: headerBar
title: {
......
......@@ -143,7 +143,7 @@ Component {
text: qsTr("Upload message")
onClicked: {
if (recordsManagement.uploadMessage(userName, msgId, msgType, uploadHierarchyListModel)) {
messages.updateRmStatus(messageModel, msgId, true)
messages.updateRmStatus(messageModel, userName, msgId, true)
pageView.pop(StackView.Immediate)
}
}
......
......@@ -234,8 +234,8 @@ void Messages::markMessagesAsLocallyRead(const QVariant &msgModelVariant,
messageModel->overrideReadAll(isRead);
}
void Messages::updateRmStatus(const QVariant &msgModelVariant, qint64 dmId,
bool isUploadRm)
void Messages::updateRmStatus(const QVariant &msgModelVariant,
const QString &userName, qint64 dmId, bool isUploadRm)
{
qDebug("%s()", __func__);
......@@ -246,6 +246,7 @@ void Messages::updateRmStatus(const QVariant &msgModelVariant, qint64 dmId,
return;
}
messageModel->updateRmStatus(dmId, isUploadRm);
emit updateMessageDetail(getMessageDetail(userName, QString::number(dmId)));
}
void Messages::deleteMessageFromDbs(const QVariant &acntModelVariant,
......
......@@ -134,13 +134,14 @@ public:
* @brief Update records management icon after message upload.
*
* @param[in,out] msgModelVariant QVariant holding message model to be set.
* @param[in] userName User name identifying the account.
* @param[in] dmId Message id.
* @param[in] isUploadRm Set whether to force records management
* upload state.
*/
Q_INVOKABLE static
void updateRmStatus(const QVariant &msgModelVariant, qint64 dmId,
bool isUploadRm);
Q_INVOKABLE
void updateRmStatus(const QVariant &msgModelVariant,
const QString &userName, qint64 dmId, bool isUploadRm);
/*!
* @brief Delete selected message from databases.
......@@ -191,6 +192,15 @@ public:
QString dmEventDescr;
};
signals:
/*!
* @brief Update message detail info.
*
* @param[in] msgHtmlInfo Message detail info string.
*/
void updateMessageDetail(QString msgHtmlInfo);
private:
/*!
* @brief Specifies whether the files should be moved or created from
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment