From 3b482a3de378eceb46978ac602d13b9b4c46b5cd Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Fri, 26 Oct 2018 10:49:16 -0700 Subject: [PATCH 01/13] Handle long memos --- src/confirm.ui | 3 +++ src/mainwindow.ui | 5 ++++- src/memodialog.ui | 25 ++++++------------------- src/sendtab.cpp | 23 +++++++++-------------- src/ui_confirm.h | 1 + src/ui_mainwindow.h | 3 ++- src/ui_memodialog.h | 22 ++++++++-------------- 7 files changed, 33 insertions(+), 49 deletions(-) diff --git a/src/confirm.ui b/src/confirm.ui index 96193b0..0485d52 100644 --- a/src/confirm.ui +++ b/src/confirm.ui @@ -132,6 +132,9 @@ TextLabel + + true + diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 4baf922..0a3e11d 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -22,7 +22,7 @@ - 0 + 1 @@ -419,6 +419,9 @@ + + true + diff --git a/src/memodialog.ui b/src/memodialog.ui index 0cbe59a..e659854 100644 --- a/src/memodialog.ui +++ b/src/memodialog.ui @@ -6,17 +6,14 @@ 0 0 - 618 - 115 + 520 + 168 Dialog - - - @@ -27,14 +24,14 @@ - 6 / 512 + 0 / 512 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - + Qt::Horizontal @@ -44,18 +41,8 @@ - - - - Qt::Vertical - - - - 20 - 40 - - - + + diff --git a/src/sendtab.cpp b/src/sendtab.cpp index c7be3b8..10447ce 100644 --- a/src/sendtab.cpp +++ b/src/sendtab.cpp @@ -191,6 +191,7 @@ void MainWindow::addAddressSection() { QFont font1 = Address1->font(); font1.setPointSize(font1.pointSize()-1); MemoTxt1->setFont(font1); + MemoTxt1->setWordWrap(true); sendAddressLayout->addWidget(MemoTxt1); ui->sendToLayout->insertWidget(itemNumber-1, verticalGroupBox); @@ -234,33 +235,26 @@ void MainWindow::memoButtonClicked(int number) { return; } - auto memoTxt = ui->sendToWidgets->findChild(QString("MemoTxt") + QString::number(number)); // Get the current memo if it exists + auto memoTxt = ui->sendToWidgets->findChild(QString("MemoTxt") + QString::number(number)); QString currentMemo = memoTxt->text(); - // Ref to see if the button was clicked - // bool ok; - // QString newMemo = QInputDialog::getText(this, "Memo", - // "Please type a memo to include with the amount. The memo will be visible to the recepient", - // QLineEdit::Normal, currentMemo, &ok); Ui_MemoDialog memoDialog; QDialog dialog(this); memoDialog.setupUi(&dialog); - QObject::connect(memoDialog.memoTxt, &QLineEdit::textChanged, [=] (QString txt) { + QObject::connect(memoDialog.memoTxt, &QPlainTextEdit::textChanged, [=] () { + QString txt = memoDialog.memoTxt->toPlainText(); memoDialog.memoSize->setText(QString::number(txt.toUtf8().size()) + "/512"); memoDialog.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(txt.toUtf8().size() <= 512); - if (txt.toUtf8().size() > 512) { - memoDialog.memoSize->setStyleSheet("color: red;"); - } else { - memoDialog.memoSize->setStyleSheet(""); - } }); - memoDialog.memoTxt->setText(currentMemo); + + memoDialog.memoTxt->setPlainText(currentMemo); + memoDialog.memoTxt->setFocus(); if (dialog.exec() == QDialog::Accepted) { - memoTxt->setText(memoDialog.memoTxt->text()); + memoTxt->setText(memoDialog.memoTxt->toPlainText()); } } @@ -414,6 +408,7 @@ bool MainWindow::confirmTx(Tx tx, ToFields devFee) { QFont font1 = Addr->font(); font1.setPointSize(font1.pointSize() - 1); Memo->setFont(font1); + Memo->setWordWrap(true); confirm.gridLayout->addWidget(Memo, (i*2)+1, 0, 1, 3); } diff --git a/src/ui_confirm.h b/src/ui_confirm.h index 234138e..941848d 100644 --- a/src/ui_confirm.h +++ b/src/ui_confirm.h @@ -125,6 +125,7 @@ public: Memo1 = new QLabel(sendToAddrs); Memo1->setObjectName(QStringLiteral("Memo1")); + Memo1->setWordWrap(true); gridLayout->addWidget(Memo1, 1, 0, 1, 3); diff --git a/src/ui_mainwindow.h b/src/ui_mainwindow.h index c9a29ea..4f01b1d 100644 --- a/src/ui_mainwindow.h +++ b/src/ui_mainwindow.h @@ -434,6 +434,7 @@ public: QFont font1; font1.setPointSize(10); MemoTxt1->setFont(font1); + MemoTxt1->setWordWrap(true); sendAddressLayout->addWidget(MemoTxt1); @@ -675,7 +676,7 @@ public: retranslateUi(MainWindow); - tabWidget->setCurrentIndex(0); + tabWidget->setCurrentIndex(1); QMetaObject::connectSlotsByName(MainWindow); diff --git a/src/ui_memodialog.h b/src/ui_memodialog.h index bd00d49..9f9190e 100644 --- a/src/ui_memodialog.h +++ b/src/ui_memodialog.h @@ -15,8 +15,7 @@ #include #include #include -#include -#include +#include QT_BEGIN_NAMESPACE @@ -24,24 +23,18 @@ class Ui_MemoDialog { public: QGridLayout *gridLayout; - QLineEdit *memoTxt; QLabel *label; QLabel *memoSize; QDialogButtonBox *buttonBox; - QSpacerItem *verticalSpacer; + QPlainTextEdit *memoTxt; void setupUi(QDialog *MemoDialog) { if (MemoDialog->objectName().isEmpty()) MemoDialog->setObjectName(QStringLiteral("MemoDialog")); - MemoDialog->resize(618, 115); + MemoDialog->resize(520, 168); gridLayout = new QGridLayout(MemoDialog); gridLayout->setObjectName(QStringLiteral("gridLayout")); - memoTxt = new QLineEdit(MemoDialog); - memoTxt->setObjectName(QStringLiteral("memoTxt")); - - gridLayout->addWidget(memoTxt, 1, 0, 1, 2); - label = new QLabel(MemoDialog); label->setObjectName(QStringLiteral("label")); @@ -58,11 +51,12 @@ public: buttonBox->setOrientation(Qt::Horizontal); buttonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::Ok); - gridLayout->addWidget(buttonBox, 3, 0, 1, 2); + gridLayout->addWidget(buttonBox, 2, 0, 1, 2); - verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); + memoTxt = new QPlainTextEdit(MemoDialog); + memoTxt->setObjectName(QStringLiteral("memoTxt")); - gridLayout->addItem(verticalSpacer, 2, 0, 1, 2); + gridLayout->addWidget(memoTxt, 1, 0, 1, 2); retranslateUi(MemoDialog); @@ -76,7 +70,7 @@ public: { MemoDialog->setWindowTitle(QApplication::translate("MemoDialog", "Dialog", nullptr)); label->setText(QApplication::translate("MemoDialog", "Memo", nullptr)); - memoSize->setText(QApplication::translate("MemoDialog", "6 / 512", nullptr)); + memoSize->setText(QApplication::translate("MemoDialog", "0 / 512", nullptr)); } // retranslateUi }; From cf7b2e1c4b7ccdc13aa8aff6b0e00d64d121ce66 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Fri, 26 Oct 2018 12:32:12 -0700 Subject: [PATCH 02/13] Show memo icon in Tx table --- src/mainwindow.cpp | 11 +++++------ src/rpc.cpp | 29 ++++++++++++++++++----------- src/rpc.h | 7 ++++--- src/txtablemodel.cpp | 38 +++++++++++++++++++++++++++----------- 4 files changed, 54 insertions(+), 31 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 68a95b7..a5ff83d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -60,7 +60,7 @@ MainWindow::MainWindow(QWidget *parent) : rpc = new RPC(new QNetworkAccessManager(this), this); rpc->refreshZECPrice(); - rpc->refresh(); + rpc->refresh(true); // Force refresh first time } void MainWindow::setupStatusBar() { @@ -99,7 +99,7 @@ void MainWindow::setupStatusBar() { } menu.addAction("Refresh", [=]() { - rpc->refresh(); + rpc->refresh(true); }); QPoint gpos(mapToGlobal(pos).x(), mapToGlobal(pos).y() + this->height() - ui->statusBar->height()); menu.exec(gpos); @@ -112,8 +112,7 @@ void MainWindow::setupStatusBar() { ui->statusBar->addPermanentWidget(statusIcon); } -void MainWindow::setupSettingsModal() { - +void MainWindow::setupSettingsModal() { // Set up File -> Settings action QObject::connect(ui->actionSettings, &QAction::triggered, [=]() { QDialog settingsDialog(this); @@ -132,7 +131,7 @@ void MainWindow::setupSettingsModal() { QMessageBox::Yes, QMessageBox::Cancel)) { SentTxStore::deleteHistory(); // Reload after the clear button so existing txs disappear - rpc->refresh(); + rpc->refresh(true); } }); @@ -182,7 +181,7 @@ void MainWindow::setupSettingsModal() { } // Then refresh everything. - this->rpc->refresh(); + this->rpc->refresh(true); }; }); diff --git a/src/rpc.cpp b/src/rpc.cpp index 5837697..fb190eb 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -366,6 +366,7 @@ void RPC::refreshReceivedZTrans(QList zaddrs) { QSet txids; QMap memos; for (auto it = zaddrTxids->constBegin(); it != zaddrTxids->constEnd(); it++) { + auto zaddr = it.key(); for (auto& i : it.value().get()) { // Filter out change txs if (! i["change"].get()) { @@ -378,7 +379,7 @@ void RPC::refreshReceivedZTrans(QList zaddrs) { QString memo(QByteArray::fromHex( QByteArray::fromStdString(i["memo"].get()))); if (!memo.trimmed().isEmpty()) - memos[txid] = memo; + memos[zaddr + txid] = memo; } } } @@ -423,7 +424,7 @@ void RPC::refreshReceivedZTrans(QList zaddrs) { auto confirmations = txidInfo["confirmations"].get(); TransactionItem tx{ QString("receive"), timestamp, zaddr, txid, amount, - confirmations, "", memos.value(txid, "") }; + confirmations, "", memos.value(zaddr + txid, "") }; txdata.push_front(tx); } } @@ -441,13 +442,12 @@ void RPC::refreshReceivedZTrans(QList zaddrs) { /// This will refresh all the balance data from zcashd -void RPC::refresh() { - // First, test the connection to see if we can actually get info. - getInfoThenRefresh(); +void RPC::refresh(bool force) { + getInfoThenRefresh(force); } -void RPC::getInfoThenRefresh() { +void RPC::getInfoThenRefresh(bool force) { json payload = { {"jsonrpc", "1.0"}, {"id", "someid"}, @@ -464,10 +464,17 @@ void RPC::getInfoThenRefresh() { QIcon i(":/icons/res/connected.png"); main->statusIcon->setPixmap(i.pixmap(16, 16)); - // Refresh everything. - refreshBalances(); - refreshAddresses(); // This calls refreshZSentTransactions() and refreshReceivedZTrans() - refreshTransactions(); + static int lastBlock = 0; + int curBlock = reply["blocks"].get(); + + if ( force || (curBlock != lastBlock) ) { + // Something changed, so refresh everything. + lastBlock = curBlock; + + refreshBalances(); + refreshAddresses(); // This calls refreshZSentTransactions() and refreshReceivedZTrans() + refreshTransactions(); + } // Call to see if the blockchain is syncing. json payload = { @@ -697,7 +704,7 @@ void RPC::watchTxStatus() { watchingOps.remove(id); // Refresh balances to show unconfirmed balances - refresh(); + refresh(true); } else if (status == "failed") { // If it failed, then we'll actually show a warning. auto errorMsg = QString::fromStdString(it["error"]["message"]); diff --git a/src/rpc.h b/src/rpc.h index a174ca3..b0e89ef 100644 --- a/src/rpc.h +++ b/src/rpc.h @@ -29,8 +29,9 @@ public: RPC(QNetworkAccessManager* restclient, MainWindow* main); ~RPC(); - void refresh(); // Refresh all transactions - void refreshAddresses(); // Refresh wallet Z-addrs + void refresh(bool force = false); + + void refreshAddresses(); void refreshZECPrice(); void sendZTransaction (json params, const std::function& cb); @@ -60,7 +61,7 @@ private: bool processUnspent (const json& reply); void updateUI (bool anyUnconfirmed); - void getInfoThenRefresh(); + void getInfoThenRefresh(bool force); void getBalance(const std::function& cb); diff --git a/src/txtablemodel.cpp b/src/txtablemodel.cpp index f86c860..b335d9f 100644 --- a/src/txtablemodel.cpp +++ b/src/txtablemodel.cpp @@ -5,7 +5,7 @@ TxTableModel::TxTableModel(QObject *parent) : QAbstractTableModel(parent) { - headers << "Category" << "Address" << "Date/Time" << "Amount"; + headers << "Type" << "Address" << "Date/Time" << "Amount"; } TxTableModel::~TxTableModel() { @@ -86,10 +86,16 @@ void TxTableModel::updateAllData() { b.setColor(Qt::black); return b; } - - if (role == Qt::DisplayRole || role == Qt::ToolTipRole) { + + auto dat = modeldata->at(index.row()); + if (role == Qt::DisplayRole) { switch (index.column()) { - case 0: return modeldata->at(index.row()).type; + case 0: { + QString labels = (dat.type == "send" ? "S" : "R"); + if (!dat.memo.isEmpty()) + labels = labels + " M"; + return labels; + } case 1: { auto addr = modeldata->at(index.row()).address; if (addr.trimmed().isEmpty()) @@ -98,14 +104,24 @@ void TxTableModel::updateAllData() { return addr; } case 2: return QDateTime::fromSecsSinceEpoch(modeldata->at(index.row()).datetime).toLocalTime().toString(); - case 3: { - if (role == Qt::DisplayRole) - return Settings::getInstance()->getZECDisplayFormat(modeldata->at(index.row()).amount); - else { - return Settings::getInstance()->getUSDFormat(modeldata->at(index.row()).amount); - } - } + case 3: return Settings::getInstance()->getZECDisplayFormat(modeldata->at(index.row()).amount); } + } + + if (role == Qt::ToolTipRole) { + switch (index.column()) { + case 0: return modeldata->at(index.row()).type + + (dat.memo.isEmpty() ? "" : " tx memo: \"" + dat.memo + "\""); + case 1: { + auto addr = modeldata->at(index.row()).address; + if (addr.trimmed().isEmpty()) + return "(Shielded)"; + else + return addr; + } + case 2: return QDateTime::fromSecsSinceEpoch(modeldata->at(index.row()).datetime).toLocalTime().toString(); + case 3: return Settings::getInstance()->getUSDFormat(modeldata->at(index.row()).amount); + } } return QVariant(); From e2a61d6b09fd6c757841f379e30a4ac78cdd3c59 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Fri, 26 Oct 2018 12:59:07 -0700 Subject: [PATCH 03/13] change defaults --- src/mainwindow.cpp | 3 ++- src/utils.cpp | 12 +++++++++--- src/utils.h | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a5ff83d..ad49dba 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -189,7 +189,8 @@ void MainWindow::setupSettingsModal() { void MainWindow::donate() { // Set up a donation to me :) - ui->Address1->setText(Utils::getDonationAddr()); + ui->Address1->setText(Utils::getDonationAddr( + Settings::getInstance()->isSaplingAddress(ui->inputsCombo->currentText()))); ui->Address1->setCursorPosition(0); ui->Amount1->setText("0.01"); diff --git a/src/utils.cpp b/src/utils.cpp index 45ec617..fe76e22 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -12,11 +12,17 @@ const QString Utils::getTokenName() { } } -const QString Utils::getDonationAddr() { +const QString Utils::getDonationAddr(bool sapling) { if (Settings::getInstance()->isTestnet()) - return "tmP1JL19JyJh3jPMUbfovk4W67jB7VJWybu"; + if (sapling) + return "ztestsapling1kdp74adyfsmm9838jaupgfyx3npgw8ut63stjjx757pc248cuc0ymzphqeux60c64qe5qt68ygh"; + else + return "ztbGDqgkmXQjheivgeirwEvJLD4SUNqsWCGwxwVg4YpGz1ARR8P2rXaptkT14z3NDKamcxNmQuvmvktyokMs7HkutRNSx1D"; else - return "t1KfJJrSuVYmnNLrw7EZHRv1kZY3zdGGLyb"; + if (sapling) + return "zs1gv64eu0v2wx7raxqxlmj354y9ycznwaau9kduljzczxztvs4qcl00kn2sjxtejvrxnkucw5xx9u"; + else + return "zcEgrceTwvoiFdEvPWcsJHAMrpLsprMF6aRJiQa3fan5ZphyXLPuHghnEPrEPRoEVzUy65GnMVyCTRdkT6BYBepnXh6NBYs"; } // Get the dev fee address based on the transaction diff --git a/src/utils.h b/src/utils.h index 5964e75..3bb7be5 100644 --- a/src/utils.h +++ b/src/utils.h @@ -13,7 +13,7 @@ public: static const QString getTokenName(); static const QString getDevAddr(Tx tx); - static const QString getDonationAddr(); + static const QString getDonationAddr(bool sapling); static double getMinerFee(); static double getDevFee(); From cde3581b53de3ec2e41a8d020c5776a571e4c968 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Fri, 26 Oct 2018 13:05:47 -0700 Subject: [PATCH 04/13] Add icons for memo --- src/txtablemodel.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/txtablemodel.cpp b/src/txtablemodel.cpp index b335d9f..d3834a1 100644 --- a/src/txtablemodel.cpp +++ b/src/txtablemodel.cpp @@ -90,12 +90,7 @@ void TxTableModel::updateAllData() { auto dat = modeldata->at(index.row()); if (role == Qt::DisplayRole) { switch (index.column()) { - case 0: { - QString labels = (dat.type == "send" ? "S" : "R"); - if (!dat.memo.isEmpty()) - labels = labels + " M"; - return labels; - } + case 0: return dat.type; case 1: { auto addr = modeldata->at(index.row()).address; if (addr.trimmed().isEmpty()) @@ -124,6 +119,19 @@ void TxTableModel::updateAllData() { } } + if (role == Qt::DecorationRole && index.column() == 0) { + if (!dat.memo.isEmpty()) { + // Return the info pixmap to indicate memo + QIcon icon = QApplication::style()->standardIcon(QStyle::SP_MessageBoxInformation); + return QVariant(icon.pixmap(16, 16)); + } else { + // Empty pixmap to make it align + QPixmap p(16, 16); + p.fill(Qt::white); + return QVariant(p); + } + } + return QVariant(); } From b6e826edaff768f1ecb83024d9593e6176a2644c Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Fri, 26 Oct 2018 13:16:29 -0700 Subject: [PATCH 05/13] v0.2.4 --- README.md | 4 ++-- zec-qt-wallet.pro | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4f13a91..f4c4399 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ Head over to the releases page and grab the latest binary. https://github.com/ad ### Linux Extract and run the binary ``` -tar -xvf zec-qt-wallet-v0.2.3.tar.gz -./zec-qt-wallet-v0.2.3/zec-qt-wallet +tar -xvf zec-qt-wallet-v0.2.4.tar.gz +./zec-qt-wallet-v0.2.4/zec-qt-wallet ``` ### Windows diff --git a/zec-qt-wallet.pro b/zec-qt-wallet.pro index 61763b5..197d3bd 100644 --- a/zec-qt-wallet.pro +++ b/zec-qt-wallet.pro @@ -13,7 +13,7 @@ PRECOMPILED_HEADER = src/precompiled.h greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = zec-qt-wallet -APP_VERSION=\\\"0.2.3\\\" +APP_VERSION=\\\"0.2.4\\\" TEMPLATE = app From f5615d44e37879875b89671f17fd0e527203bbdc Mon Sep 17 00:00:00 2001 From: adityapk Date: Fri, 26 Oct 2018 15:21:30 -0700 Subject: [PATCH 06/13] ensure git master branch while releasing --- src/scripts/mkwinrelease.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/scripts/mkwinrelease.ps1 b/src/scripts/mkwinrelease.ps1 index 8614a50..2cc2c39 100644 --- a/src/scripts/mkwinrelease.ps1 +++ b/src/scripts/mkwinrelease.ps1 @@ -3,6 +3,14 @@ if (-not (Test-Path env:APP_VERSION)) { echo "APP_VERSION is not set. Please set $target="zec-qt-wallet-v$Env:APP_VERSION" +echo "Git Status" +$branch= &git branch +if ($branch -ne "* master") { + echo "Not on master branch!" + exit; +} +git pull + echo "Cleaning" nmake clean *>$null Remove-Item -Path debug -Recurse | Out-Null From d3c4b42a160cb309f4d14d962960801e96835c75 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Sun, 28 Oct 2018 08:24:53 -0700 Subject: [PATCH 07/13] Support lower version of Qt and mingw compiler --- src/balancestablemodel.cpp | 4 ++-- src/sendtab.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/balancestablemodel.cpp b/src/balancestablemodel.cpp index ffdf6a3..c21c4d3 100644 --- a/src/balancestablemodel.cpp +++ b/src/balancestablemodel.cpp @@ -20,8 +20,8 @@ void BalancesTableModel::setNewData(const QMap* balances, // Process the address balances into a list delete modeldata; modeldata = new QList>(); - std::for_each(balances->constKeyValueBegin(), balances->constKeyValueEnd(), [=] (auto it) { - modeldata->push_back(std::make_tuple(it.first, QString::number(it.second, 'g', 8))); + std::for_each(balances->keyBegin(), balances->keyEnd(), [=] (auto keyIt) { + modeldata->push_back(std::make_tuple(keyIt, QString::number(balances->value(keyIt), 'g', 8))); }); // And then update the data diff --git a/src/sendtab.cpp b/src/sendtab.cpp index 10447ce..f4cae7d 100644 --- a/src/sendtab.cpp +++ b/src/sendtab.cpp @@ -38,18 +38,18 @@ void MainWindow::setupSendTab() { // The first Memo button QObject::connect(ui->MemoBtn1, &QPushButton::clicked, [=] () { - memoButtonClicked(1); + this->memoButtonClicked(1); }); setMemoEnabled(1, false); // The first Address button QObject::connect(ui->Address1, &QLineEdit::textChanged, [=] (auto text) { - addressChanged(1, text); + this->addressChanged(1, text); }); // The first Amount button QObject::connect(ui->Amount1, &QLineEdit::textChanged, [=] (auto text) { - amountChanged(1, text); + this->amountChanged(1, text); }); // Font for the first Memo label @@ -141,7 +141,7 @@ void MainWindow::addAddressSection() { Address1->setObjectName(QString("Address") % QString::number(itemNumber)); Address1->setPlaceholderText("Address"); QObject::connect(Address1, &QLineEdit::textChanged, [=] (auto text) { - addressChanged(itemNumber, text); + this->addressChanged(itemNumber, text); }); horizontalLayout_12->addWidget(Address1); @@ -162,7 +162,7 @@ void MainWindow::addAddressSection() { auto amtValidator = new QDoubleValidator(0, 21000000, 8, Amount1); Amount1->setValidator(amtValidator); QObject::connect(Amount1, &QLineEdit::textChanged, [=] (auto text) { - amountChanged(itemNumber, text); + this->amountChanged(itemNumber, text); }); horizontalLayout_13->addWidget(Amount1); @@ -179,7 +179,7 @@ void MainWindow::addAddressSection() { MemoBtn1->setText("Memo"); // Connect Memo Clicked button QObject::connect(MemoBtn1, &QPushButton::clicked, [=] () { - memoButtonClicked(itemNumber); + this->memoButtonClicked(itemNumber); }); horizontalLayout_13->addWidget(MemoBtn1); setMemoEnabled(itemNumber, false); From 833eb47f4ac3e158cc8b5d6ae6ccc232c5ba7298 Mon Sep 17 00:00:00 2001 From: NAYRAND JEREMIE Date: Sun, 28 Oct 2018 19:03:12 +0100 Subject: [PATCH 08/13] Support lower version of Qt --- src/senttxstore.cpp | 2 +- src/txtablemodel.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/senttxstore.cpp b/src/senttxstore.cpp index 656fe05..8c9c7f5 100644 --- a/src/senttxstore.cpp +++ b/src/senttxstore.cpp @@ -87,7 +87,7 @@ void SentTxStore::addToSentTx(Tx tx, QString txid) { QJsonObject txItem; txItem["type"] = "sent"; txItem["from"] = tx.fromAddr; - txItem["datetime"] = QDateTime().currentSecsSinceEpoch(); + txItem["datetime"] = QDateTime().currentMSecsSinceEpoch(); txItem["address"] = QString(); // The sent address is blank, to be consistent with t-Addr sent behaviour txItem["txid"] = txid; txItem["amount"] = -totalAmount; diff --git a/src/txtablemodel.cpp b/src/txtablemodel.cpp index d3834a1..96fbe3b 100644 --- a/src/txtablemodel.cpp +++ b/src/txtablemodel.cpp @@ -98,7 +98,7 @@ void TxTableModel::updateAllData() { else return addr; } - case 2: return QDateTime::fromSecsSinceEpoch(modeldata->at(index.row()).datetime).toLocalTime().toString(); + case 2: return QDateTime::fromMSecsSinceEpoch(modeldata->at(index.row()).datetime).toLocalTime().toString(); case 3: return Settings::getInstance()->getZECDisplayFormat(modeldata->at(index.row()).amount); } } @@ -114,7 +114,7 @@ void TxTableModel::updateAllData() { else return addr; } - case 2: return QDateTime::fromSecsSinceEpoch(modeldata->at(index.row()).datetime).toLocalTime().toString(); + case 2: return QDateTime::fromMSecsSinceEpoch(modeldata->at(index.row()).datetime).toLocalTime().toString(); case 3: return Settings::getInstance()->getUSDFormat(modeldata->at(index.row()).amount); } } From 56e45bc64c69681049e75158f7c077ab9aec3a36 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Sun, 28 Oct 2018 11:16:57 -0700 Subject: [PATCH 09/13] msec fixes --- src/senttxstore.cpp | 2 +- src/txtablemodel.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/senttxstore.cpp b/src/senttxstore.cpp index 8c9c7f5..b915d68 100644 --- a/src/senttxstore.cpp +++ b/src/senttxstore.cpp @@ -87,7 +87,7 @@ void SentTxStore::addToSentTx(Tx tx, QString txid) { QJsonObject txItem; txItem["type"] = "sent"; txItem["from"] = tx.fromAddr; - txItem["datetime"] = QDateTime().currentMSecsSinceEpoch(); + txItem["datetime"] = QDateTime().currentMSecsSinceEpoch() / 1000; txItem["address"] = QString(); // The sent address is blank, to be consistent with t-Addr sent behaviour txItem["txid"] = txid; txItem["amount"] = -totalAmount; diff --git a/src/txtablemodel.cpp b/src/txtablemodel.cpp index 96fbe3b..1d3a6cb 100644 --- a/src/txtablemodel.cpp +++ b/src/txtablemodel.cpp @@ -98,7 +98,7 @@ void TxTableModel::updateAllData() { else return addr; } - case 2: return QDateTime::fromMSecsSinceEpoch(modeldata->at(index.row()).datetime).toLocalTime().toString(); + case 2: return QDateTime::fromMSecsSinceEpoch(modeldata->at(index.row()).datetime * 1000).toLocalTime().toString(); case 3: return Settings::getInstance()->getZECDisplayFormat(modeldata->at(index.row()).amount); } } @@ -114,7 +114,7 @@ void TxTableModel::updateAllData() { else return addr; } - case 2: return QDateTime::fromMSecsSinceEpoch(modeldata->at(index.row()).datetime).toLocalTime().toString(); + case 2: return QDateTime::fromMSecsSinceEpoch(modeldata->at(index.row()).datetime * 1000).toLocalTime().toString(); case 3: return Settings::getInstance()->getUSDFormat(modeldata->at(index.row()).amount); } } From 2705a2c22d0689318ee73a520eaaa0761bb407fa Mon Sep 17 00:00:00 2001 From: NAYRAND JEREMIE Date: Sun, 28 Oct 2018 19:22:17 +0100 Subject: [PATCH 10/13] Fix readme twitter link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f4c4399..67c12ee 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,6 @@ The most likely cause for this is that you are trying to spend unconfirmed funds 1-2 blocks for the funds to confirm and retry the transaction. ### Support or other questions -Tweet at [@zcashqtwallet](https://twitter.com/zcashqtwallet) for help. +Tweet at [@zcashqtwallet](https://twitter.com/zecqtwallet) for help. _PS: zec-qt-wallet is NOT an official wallet, and is not affiliated with the Zerocoin Electric Coin Company in any way._ \ No newline at end of file From a4e1de1b8b41872d53fb7bf23f2a2aebf4410253 Mon Sep 17 00:00:00 2001 From: NAYRAND JEREMIE Date: Sun, 28 Oct 2018 19:23:52 +0100 Subject: [PATCH 11/13] Fix readme twitter link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67c12ee..5d4067a 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,6 @@ The most likely cause for this is that you are trying to spend unconfirmed funds 1-2 blocks for the funds to confirm and retry the transaction. ### Support or other questions -Tweet at [@zcashqtwallet](https://twitter.com/zecqtwallet) for help. +Tweet at [@zecqtwallet](https://twitter.com/zecqtwallet) for help. _PS: zec-qt-wallet is NOT an official wallet, and is not affiliated with the Zerocoin Electric Coin Company in any way._ \ No newline at end of file From 2d82c27b638dcb43951b05d068ab398ea3feac64 Mon Sep 17 00:00:00 2001 From: adityapk00 Date: Sun, 28 Oct 2018 16:53:40 -0700 Subject: [PATCH 12/13] Add send from in the balances tab --- src/mainwindow.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ad49dba..6ffe036 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -242,6 +242,19 @@ void MainWindow::setupBalancesTab() { ui->statusBar->showMessage("Copied to clipboard", 3 * 1000); }); + menu.addAction("Send from " % addr.left(40) % (addr.size() > 40 ? "..." : ""), [=]() { + // Find the inputs combo + for (int i = 0; i < ui->inputsCombo->count(); i++) { + if (ui->inputsCombo->itemText(i).startsWith(addr)) { + ui->inputsCombo->setCurrentIndex(i); + break; + } + } + + // And switch to the send tab. + ui->tabWidget->setCurrentIndex(1); + }); + if (addr.startsWith("t")) { menu.addAction("View on block explorer", [=] () { QString url; From 32fec423906e711f29cffb55e63e5525eff1d3e8 Mon Sep 17 00:00:00 2001 From: adityapk00 Date: Sun, 28 Oct 2018 17:01:00 -0700 Subject: [PATCH 13/13] Fix windows build script --- .gitignore | 1 + src/scripts/mkwinrelease.ps1 | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 2747031..92e22e3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ src/precompiled.h.cpp .qmake.stash zec-qt-wallet zec-qt-wallet.vcxproj* +zec-qt-wallet.sln zec-qt-wallet.pro.user Makefile Makefile.* diff --git a/src/scripts/mkwinrelease.ps1 b/src/scripts/mkwinrelease.ps1 index 2cc2c39..af34195 100644 --- a/src/scripts/mkwinrelease.ps1 +++ b/src/scripts/mkwinrelease.ps1 @@ -4,7 +4,7 @@ if (-not (Test-Path env:APP_VERSION)) { echo "APP_VERSION is not set. Please set $target="zec-qt-wallet-v$Env:APP_VERSION" echo "Git Status" -$branch= &git branch +$branch= &git branch | select -first 1 if ($branch -ne "* master") { echo "Not on master branch!" exit; @@ -35,12 +35,12 @@ Copy-Item README.md release/$target | Out-Null echo "Zipping" Compress-Archive -LiteralPath release/$target -DestinationPath "release/Windows-$target.zip" -echo "Package Contents" -[Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') -foreach($sourceFile in (Get-ChildItem "release/Windows-$target.zip")) -{ - [IO.Compression.ZipFile]::OpenRead($sourceFile.FullName).Entries.FullName | - %{ "$sourcefile`:$_" } -} +#echo "Package Contents" +#[Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem') +#foreach($sourceFile in (Get-ChildItem "release/Windows-$target.zip")) +#{ +# [IO.Compression.ZipFile]::OpenRead($sourceFile.FullName).Entries.FullName | +# %{ "$sourcefile`:$_" } +#} echo "Done" \ No newline at end of file