From 17cc83ab7b3ec0c48e116532f46f86ef81a1bdfd Mon Sep 17 00:00:00 2001 From: DenioD <41270280+DenioD@users.noreply.github.com> Date: Wed, 29 Apr 2020 14:40:13 +0200 Subject: [PATCH] use quuid as cid in headermemo --- src/chatmodel.cpp | 11 ++++++----- src/mainwindow.cpp | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/chatmodel.cpp b/src/chatmodel.cpp index c037fa5..552116c 100644 --- a/src/chatmodel.cpp +++ b/src/chatmodel.cpp @@ -140,9 +140,9 @@ Tx MainWindow::createTxFromChatPage() { // ui->ContactZaddr->setText("Zaddr"); - + - QString addr = ui->ContactZaddr->text().trimmed(); // We need to set the reply Address for our Contact here + QString addr = ui->ContactZaddr->text().trimmed(); // We need to set the reply Address for our Contact here // Remove label if it exists addr = AddressBook::addressFromAddressLabel(addr); @@ -154,12 +154,13 @@ Tx MainWindow::createTxFromChatPage() { amt = CAmount::fromDecimalString("0"); totalAmt = totalAmt + amt; - QString cid = QString::number( time(NULL) % std::rand() ); // low entropy for testing! - // QString cid = QUuid::createUuid().toString(QUuid::WithoutBraces); // Needs to get a fix + + // QString cid = QString::number( time(NULL) % std::rand() ); // low entropy for testing! + QString cid = QUuid::createUuid().toString(QUuid::WithoutBraces); // Needs to get a fix QString hmemo= createHeaderMemo(cid,"Some ZADDR"); QString memo = ui->memoTxtChat->toPlainText().trimmed(); - // ui->memoSizeChat->setLenDisplayLabel(); + // ui->memoSizeChat->setLenDisplayLabel(); tx.toAddrs.push_back(ToFields{addr, amt, hmemo}) ; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 21f922a..b703b53 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -991,11 +991,11 @@ void MainWindow::setupchatTab() { ///////// Set selected Zaddr for Chat with Doubleklick - QObject::connect(ui->listContactWidget, &QTableView::doubleClicked, [=] () { + QObject::connect(ui->listContactWidget, &QTableView::clicked, [=] () { QModelIndex index = ui->listContactWidget->currentIndex(); - QString itemText = index.data(Qt::DisplayRole).toString(); - ui->ContactZaddr->setText(itemText); + QString zaddr = index.data(Qt::DisplayRole).toString(); + ui->ContactZaddr->setText(zaddr); }); }