Commit 7128dfd0 authored by Martin Straka's avatar Martin Straka
Browse files

Added isds send message dialogue init.

parent 31f048a2
......@@ -121,7 +121,7 @@ Item {
var boxEntry = foundBoxModel.entry(boxId)
if (recipBoxModel != null) {
foundBoxModel.selectEntry(boxEntry.dbID, true)
if (!isds.addRecipent(acntId, boxEntry.dbID, boxEntry.dbName, boxEntry.dbAddress, false, recipBoxModel)) {
if (!isds.addRecipient(acntId, boxEntry.dbID, boxEntry.dbName, boxEntry.dbAddress, false, recipBoxModel)) {
foundBoxModel.selectEntry(boxEntry.dbID, false)
}
}
......
......@@ -280,7 +280,7 @@ Item {
var boxEntry = foundBoxModel.entry(boxId)
if (recipBoxModel != null) {
foundBoxModel.selectEntry(boxEntry.dbID, true)
if (!isds.addRecipent(acntId, boxEntry.dbID, boxEntry.dbName, boxEntry.dbAddress, false, recipBoxModel)) {
if (!isds.addRecipient(acntId, boxEntry.dbID, boxEntry.dbName, boxEntry.dbAddress, false, recipBoxModel)) {
foundBoxModel.selectEntry(boxEntry.dbID, false)
}
}
......
......@@ -124,7 +124,7 @@ Item {
if (isdsEnvelope.dmType === "I" || isdsEnvelope.dmType === "A") {
canUseInitReply = true
}
isds.addRecipent(acntId, isdsEnvelope.dbIDSender, isdsEnvelope.dmSender, isdsEnvelope.dmSenderAddress, canUseInitReply, recipBoxModel);
isds.addRecipient(acntId, isdsEnvelope.dbIDSender, isdsEnvelope.dmSender, isdsEnvelope.dmSenderAddress, canUseInitReply, recipBoxModel);
}
/* Set message envelope data and files to attachment model*/
......@@ -196,9 +196,7 @@ Item {
databoxInfo.text = qsTr("Databox: %1 (%2)").arg(dbID).arg(dbType)
dmAllowSubstDelivery.visible = boxOVM
if (!boxOVM) {
isds.doIsdsAction("pdzInfo", acntId);
}
isds.doIsdsAction("initSendMsgDlg", acntId);
if (action === "new") {
headerBar.title = qsTr("New message")
......@@ -1054,9 +1052,13 @@ Item {
actionButton.enabled = true
}
}
function onRunPdzInfoSig(userName, testing) {
function onInitSendMsgDlgSig(userName, testing) {
actionAcntId.username = userName
actionAcntId.testing = testing
var boxOVM = accounts.isOvm(actionAcntId)
if (boxOVM) {
return
}
var dbID = accounts.dbId(actionAcntId);
databoxInfo.text = databoxInfo.text + isds.pdzInfo(actionAcntId, dbID);
}
......
......@@ -621,7 +621,7 @@ QList<Isds::Type::DmType> setPossiblePdzPaymentMethods(
return dmPaymentTypes;
}
bool IsdsWrapper::addRecipent(const QmlAcntId *qAcntId, const QString &dbID,
bool IsdsWrapper::addRecipient(const QmlAcntId *qAcntId, const QString &dbID,
const QString &dbName, const QString &dbAddress, bool canUseInitReply,
DataboxListModel *databoxModel)
{
......@@ -922,8 +922,8 @@ void IsdsWrapper::doIsdsAction(const QString &isdsAction, const AcntId &acntId)
} else if (isdsAction == "importZfoMessage") {
emit runImportZfoMessageSig(acntId.username(),
acntId.testing());
} else if (isdsAction == "pdzInfo") {
emit runPdzInfoSig(acntId.username(), acntId.testing());
} else if (isdsAction == "initSendMsgDlg") {
emit initSendMsgDlgSig(acntId.username(), acntId.testing());
}
} else {
doLoginAction(isdsAction, acntId);
......
......@@ -317,7 +317,7 @@ public:
* @return True if a message can send to the recipient.
*/
Q_INVOKABLE
bool addRecipent(const QmlAcntId *qAcntId, const QString &dbID,
bool addRecipient(const QmlAcntId *qAcntId, const QString &dbID,
const QString &dbName, const QString &dbAddress,
bool canUseInitReply, DataboxListModel *databoxModel);
......@@ -630,12 +630,12 @@ signals:
void runSyncSingleAccountSentSig(QString userName, bool testing);
/*!
* @brief Run pdz info action from QML.
* @brief Initialise send message dialogue and run pdz info.
*
* @param[in] userName Account username identifier.
* @param[in] testing True if account is ISDS test environment.
*/
void runPdzInfoSig(QString userName, bool testing);
void initSendMsgDlgSig(QString userName, bool testing);
/*!
* @brief Do some post QML action after message sending.
......
......@@ -464,19 +464,14 @@ int DataboxListModel::setQuery(QSqlQuery &query, const QString &dbId,
void DataboxListModel::setPdzDmType(const QString &boxId, int dmType)
{
QMap<QString, InternalEntry>::const_iterator it = m_entries.find(boxId);
if (it == m_entries.end()) {
return;
}
for (int r = (m_boxIds.size() - 1); r >= 0; --r) {
if (m_boxIds.at(r) == boxId) {
m_entries[boxId].entry.setDmType((Isds::Type::DmType)dmType);
emit dataChanged(QAbstractListModel::index(r, 0),
QAbstractListModel::index(r, 0));
for (int row = 0; row < m_boxIds.size(); row++) {
if (m_boxIds.at(row) == boxId) {
m_entries[boxId].entry.setDmType(
(Isds::Type::DmType)dmType);
emit dataChanged(QAbstractListModel::index(row, 0),
QAbstractListModel::index(row, 0));
}
}
}
Qt::ItemFlags DataboxListModel::flags(const QModelIndex &index) const
......
Supports Markdown
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