diff --git a/README.md b/README.md index 7d47a94..e69de29 100644 --- a/README.md +++ b/README.md @@ -1,2 +0,0 @@ -# zcash-qt-wallet -Wallet UI for zcashd diff --git a/3rdparty/json/json.hpp b/src/3rdparty/json/json.hpp similarity index 100% rename from 3rdparty/json/json.hpp rename to src/3rdparty/json/json.hpp diff --git a/3rdparty/qrcode/BitBuffer.cpp b/src/3rdparty/qrcode/BitBuffer.cpp similarity index 100% rename from 3rdparty/qrcode/BitBuffer.cpp rename to src/3rdparty/qrcode/BitBuffer.cpp diff --git a/3rdparty/qrcode/BitBuffer.hpp b/src/3rdparty/qrcode/BitBuffer.hpp similarity index 100% rename from 3rdparty/qrcode/BitBuffer.hpp rename to src/3rdparty/qrcode/BitBuffer.hpp diff --git a/3rdparty/qrcode/QrCode.cpp b/src/3rdparty/qrcode/QrCode.cpp similarity index 100% rename from 3rdparty/qrcode/QrCode.cpp rename to src/3rdparty/qrcode/QrCode.cpp diff --git a/3rdparty/qrcode/QrCode.hpp b/src/3rdparty/qrcode/QrCode.hpp similarity index 100% rename from 3rdparty/qrcode/QrCode.hpp rename to src/3rdparty/qrcode/QrCode.hpp diff --git a/3rdparty/qrcode/QrSegment.cpp b/src/3rdparty/qrcode/QrSegment.cpp similarity index 100% rename from 3rdparty/qrcode/QrSegment.cpp rename to src/3rdparty/qrcode/QrSegment.cpp diff --git a/3rdparty/qrcode/QrSegment.hpp b/src/3rdparty/qrcode/QrSegment.hpp similarity index 100% rename from 3rdparty/qrcode/QrSegment.hpp rename to src/3rdparty/qrcode/QrSegment.hpp diff --git a/about.ui b/src/about.ui similarity index 100% rename from about.ui rename to src/about.ui diff --git a/balancestablemodel.cpp b/src/balancestablemodel.cpp similarity index 100% rename from balancestablemodel.cpp rename to src/balancestablemodel.cpp diff --git a/balancestablemodel.h b/src/balancestablemodel.h similarity index 100% rename from balancestablemodel.h rename to src/balancestablemodel.h diff --git a/confirm.ui b/src/confirm.ui similarity index 100% rename from confirm.ui rename to src/confirm.ui diff --git a/main.cpp b/src/main.cpp similarity index 100% rename from main.cpp rename to src/main.cpp diff --git a/mainwindow.cpp b/src/mainwindow.cpp similarity index 100% rename from mainwindow.cpp rename to src/mainwindow.cpp diff --git a/mainwindow.h b/src/mainwindow.h similarity index 100% rename from mainwindow.h rename to src/mainwindow.h diff --git a/mainwindow.ui b/src/mainwindow.ui similarity index 100% rename from mainwindow.ui rename to src/mainwindow.ui diff --git a/precompiled.h b/src/precompiled.h similarity index 100% rename from precompiled.h rename to src/precompiled.h diff --git a/rpc.cpp b/src/rpc.cpp similarity index 96% rename from rpc.cpp rename to src/rpc.cpp index 905ea7c..238e3cf 100644 --- a/rpc.cpp +++ b/src/rpc.cpp @@ -278,16 +278,9 @@ void RPC::getInfoThenRefresh() { main->statusLabel->setText(statusText); main->statusIcon->clear(); // TODO: Add checked icon - // Now, refreshing the balances and transactions causes UI flicked and selections - // to disappear, so we'll only do it if the balance in the wallet has - // updated (i.e., something changed) - if (QString::number(reply["balance"].get()) != currentBalance) { - currentBalance = QString::number(reply["balance"].get()); - refreshBalances(); - refreshTransactions(); - } - - // Addresses can be created without a transaction, so we'll call that outside + // Refresh everything. + refreshBalances(); + refreshTransactions(); refreshAddresses(); }); } @@ -357,10 +350,15 @@ void RPC::refreshBalances() { ui->balancesTable->setColumnWidth(0, 300); // Add all the addresses into the inputs combo box + auto lastFromAddr = ui->inputsCombo->currentText().split("(")[0].trimmed(); + ui->inputsCombo->clear(); auto i = allBalances->constBegin(); while (i != allBalances->constEnd()) { - ui->inputsCombo->addItem(i.key() % "(" % QString::number(i.value(), 'f', 8) % " ZEC)"); + QString item = i.key() % "(" % QString::number(i.value(), 'f', 8) % " ZEC)"; + ui->inputsCombo->addItem(item); + if (item.startsWith(lastFromAddr)) ui->inputsCombo->setCurrentText(item); + ++i; } }; diff --git a/rpc.h b/src/rpc.h similarity index 100% rename from rpc.h rename to src/rpc.h diff --git a/sendtab.cpp b/src/sendtab.cpp similarity index 100% rename from sendtab.cpp rename to src/sendtab.cpp diff --git a/settings.cpp b/src/settings.cpp similarity index 100% rename from settings.cpp rename to src/settings.cpp diff --git a/settings.h b/src/settings.h similarity index 100% rename from settings.h rename to src/settings.h diff --git a/settings.ui b/src/settings.ui similarity index 100% rename from settings.ui rename to src/settings.ui diff --git a/transactionitem.cpp b/src/transactionitem.cpp similarity index 100% rename from transactionitem.cpp rename to src/transactionitem.cpp diff --git a/transactionitem.h b/src/transactionitem.h similarity index 100% rename from transactionitem.h rename to src/transactionitem.h diff --git a/txid.ui b/src/txid.ui similarity index 100% rename from txid.ui rename to src/txid.ui diff --git a/txtablemodel.cpp b/src/txtablemodel.cpp similarity index 100% rename from txtablemodel.cpp rename to src/txtablemodel.cpp diff --git a/txtablemodel.h b/src/txtablemodel.h similarity index 100% rename from txtablemodel.h rename to src/txtablemodel.h diff --git a/ui_about.h b/src/ui_about.h similarity index 100% rename from ui_about.h rename to src/ui_about.h diff --git a/ui_confirm.h b/src/ui_confirm.h similarity index 100% rename from ui_confirm.h rename to src/ui_confirm.h diff --git a/ui_mainwindow.h b/src/ui_mainwindow.h similarity index 100% rename from ui_mainwindow.h rename to src/ui_mainwindow.h diff --git a/ui_settings.h b/src/ui_settings.h similarity index 100% rename from ui_settings.h rename to src/ui_settings.h diff --git a/unspentoutput.cpp b/src/unspentoutput.cpp similarity index 100% rename from unspentoutput.cpp rename to src/unspentoutput.cpp diff --git a/unspentoutput.h b/src/unspentoutput.h similarity index 100% rename from unspentoutput.h rename to src/unspentoutput.h diff --git a/zcash-qt-wallet.pro b/zcash-qt-wallet.pro index b499d87..d02412e 100644 --- a/zcash-qt-wallet.pro +++ b/zcash-qt-wallet.pro @@ -8,7 +8,7 @@ QT += core gui network CONFIG += precompile_header -PRECOMPILED_HEADER = precompiled.h +PRECOMPILED_HEADER = src/precompiled.h greaterThan(QT_MAJOR_VERSION, 4): QT += widgets @@ -21,48 +21,49 @@ TEMPLATE = app # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS -INCLUDEPATH += 3rdparty/ +INCLUDEPATH += src/3rdparty/ RESOURCES = application.qrc MOC_DIR = bin OBJECTS_DIR = bin +UI_DIR = src CONFIG += c++14 SOURCES += \ - main.cpp \ - mainwindow.cpp \ - rpc.cpp \ - balancestablemodel.cpp \ - unspentoutput.cpp \ - 3rdparty/qrcode/BitBuffer.cpp \ - 3rdparty/qrcode/QrCode.cpp \ - 3rdparty/qrcode/QrSegment.cpp \ - settings.cpp \ - sendtab.cpp \ - txtablemodel.cpp \ - transactionitem.cpp + src/main.cpp \ + src/mainwindow.cpp \ + src/rpc.cpp \ + src/balancestablemodel.cpp \ + src/unspentoutput.cpp \ + src/3rdparty/qrcode/BitBuffer.cpp \ + src/3rdparty/qrcode/QrCode.cpp \ + src/3rdparty/qrcode/QrSegment.cpp \ + src/settings.cpp \ + src/sendtab.cpp \ + src/txtablemodel.cpp \ + src/transactionitem.cpp HEADERS += \ - mainwindow.h \ - precompiled.h \ - rpc.h \ - balancestablemodel.h \ - unspentoutput.h \ - 3rdparty/qrcode/BitBuffer.hpp \ - 3rdparty/qrcode/QrCode.hpp \ - 3rdparty/qrcode/QrSegment.hpp \ - 3rdparty/json/json.hpp \ - settings.h \ - txtablemodel.h \ - transactionitem.h + src/mainwindow.h \ + src/precompiled.h \ + src/rpc.h \ + src/balancestablemodel.h \ + src/unspentoutput.h \ + src/3rdparty/qrcode/BitBuffer.hpp \ + src/3rdparty/qrcode/QrCode.hpp \ + src/3rdparty/qrcode/QrSegment.hpp \ + src/3rdparty/json/json.hpp \ + src/settings.h \ + src/txtablemodel.h \ + src/transactionitem.h FORMS += \ - mainwindow.ui \ - settings.ui \ - about.ui \ - confirm.ui + src/mainwindow.ui \ + src/settings.ui \ + src/about.ui \ + src/confirm.ui # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin