From 7987a1fd86dda195e0c7a3198fb73e37dbaeaec5 Mon Sep 17 00:00:00 2001 From: DenioD <41270280+DenioD@users.noreply.github.com> Date: Sun, 10 May 2020 00:13:02 +0200 Subject: [PATCH 1/3] fix mac png problem --- src/mainwindow.cpp | 4 ++-- src/mainwindow.ui | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2957dbb..7a1f6c2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -908,9 +908,9 @@ void MainWindow::setupTransactionsTab() { // Set up context menu on transactions tab auto theme = Settings::getInstance()->get_theme_name(); if (theme == "dark" || theme == "midnight") { - ui->listChat->setStyleSheet("background-image: url(res/sdlogo.png) ;background-attachment: fixed ;background-position: center center ;background-repeat: no-repeat;background-size: cover"); + ui->listChat->setStyleSheet("background-image: url(:/icons/res/sdlogo.png) ;background-attachment: fixed ;background-position: center center ;background-repeat: no-repeat;background-size: cover"); } - if (theme == "default") {ui->listChat->setStyleSheet("background-image: url(res/sdlogo2.png) ;background-attachment: fixed ;background-position: center center ;background-repeat: no-repeat;background-size: cover");} + if (theme == "default") {ui->listChat->setStyleSheet("background-image: url(:/icons/res/sdlogo2.png) ;background-attachment: fixed ;background-position: center center ;background-repeat: no-repeat;background-size: cover");} ui->listChat->setResizeMode(QListView::Adjust); ui->listChat->setWordWrap(true); diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 08e1d4d..3e82d7a 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -10,6 +10,43 @@ 779 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + SilentDragonLite From cd9b850a3522f516bf1e9a1dbbc48f1910c4f097 Mon Sep 17 00:00:00 2001 From: DenioD <41270280+DenioD@users.noreply.github.com> Date: Sun, 10 May 2020 00:59:40 +0200 Subject: [PATCH 2/3] parse hm as json --- src/controller.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/controller.cpp b/src/controller.cpp index ecc487a..c11fe72 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -920,6 +920,7 @@ void Controller::refreshTransactions() { model->markAddressUsed(address); QString memo; + QString test; if (!it["memo"].is_null()) { memo = QString::fromStdString(it["memo"]); } @@ -939,16 +940,16 @@ void Controller::refreshTransactions() { QString type; QString cid; - // int position; - QString requestZaddr1; + // int position; QString requestZaddr; if (memo.startsWith("{")) { - type = memo.mid(75,4); - cid = memo.mid(14,36); - requestZaddr1 = memo.right(82); - requestZaddr = requestZaddr1.left(78); + QJsonDocument doc = QJsonDocument::fromJson(memo.toUtf8()); + + cid = doc["cid"].toString(); + type = doc["t"].toString(); + requestZaddr = doc["z"].toString(); chatModel->addCid(txid, cid); chatModel->addrequestZaddr(txid, requestZaddr); @@ -997,7 +998,7 @@ void Controller::refreshTransactions() { txid, false ); - //DataStore::getChatDataStore()->setData(chatModel->generateChatItemID(item), item); + DataStore::getChatDataStore()->setData(ChatIDGenerator::getInstance()->generateID(item), item); } } From d48a7c64befd210429b4268ddef914a3245f516c Mon Sep 17 00:00:00 2001 From: DenioD <41270280+DenioD@users.noreply.github.com> Date: Sun, 10 May 2020 01:13:56 +0200 Subject: [PATCH 3/3] rename hm json --- src/controller.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/controller.cpp b/src/controller.cpp index c11fe72..e757190 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -889,7 +889,7 @@ void Controller::refreshTransactions() { txid, true ); - //DataStore::getChatDataStore()->setData(chatModel->generateChatItemID(item), item); + DataStore::getChatDataStore()->setData(ChatIDGenerator::getInstance()->generateID(item), item); } @@ -945,11 +945,11 @@ void Controller::refreshTransactions() { if (memo.startsWith("{")) { - QJsonDocument doc = QJsonDocument::fromJson(memo.toUtf8()); + QJsonDocument headermemo = QJsonDocument::fromJson(memo.toUtf8()); - cid = doc["cid"].toString(); - type = doc["t"].toString(); - requestZaddr = doc["z"].toString(); + cid = headermemo["cid"].toString(); + type = headermemo["t"].toString(); + requestZaddr = headermemo["z"].toString(); chatModel->addCid(txid, cid); chatModel->addrequestZaddr(txid, requestZaddr);