Browse Source

Small UI fixes

import_zecw
Aditya Kulkarni 6 years ago
parent
commit
2f85d08d05
  1. 2
      README.md
  2. 16
      src/mainwindow.cpp
  3. 2
      src/mainwindow.ui
  4. 14
      src/rpc.cpp
  5. 14
      src/scripts/mkrelease.sh
  6. 2
      src/sendtab.cpp
  7. 2
      src/ui_mainwindow.h

2
README.md

@ -25,7 +25,7 @@ tar -xvf zcash-qt-wallet-v0.1.6.tar.gz
```
## Compiling from source
zcash-qt-wallet depends on QT5, which you can get from here: https://www.qt.io/download
zcash-qt-wallet depends on Qt5, which you can get from here: https://www.qt.io/download
### Compiling on Linux
You need a C++14 compatible compiler like g++ or clang++

16
src/mainwindow.cpp

@ -35,10 +35,20 @@ MainWindow::MainWindow(QWidget *parent) :
auto msg = ui->statusBar->currentMessage();
QMenu menu(this);
if (!msg.isEmpty() && msg.startsWith(Utils::txidStatusMessage)) {
if (!msg.isEmpty() && msg.startsWith(Utils::txidStatusMessage)) {
auto txid = msg.split(":")[1].trimmed();
menu.addAction("Copy txid", [=]() {
QGuiApplication::clipboard()->setText(msg.split(":")[1].trimmed());
QGuiApplication::clipboard()->setText(txid);
});
menu.addAction("View tx on block explorer", [=]() {
QString url;
if (Settings::getInstance()->isTestnet()) {
url = "https://explorer.testnet.z.cash/tx/" + txid;
} else {
url = "https://explorer.zcha.in/transactions/" + txid;
}
QDesktopServices::openUrl(QUrl(url));
});
}
menu.addAction("Refresh", [=]() {
@ -203,7 +213,7 @@ void MainWindow::setupTransactionsTab() {
auto txModel = dynamic_cast<TxTableModel *>(ui->transactionsTable->model());
QString txid = txModel->getTxId(index.row());
menu.addAction("Copy txid to clipboard", [=] () {
menu.addAction("Copy txid", [=] () {
QGuiApplication::clipboard()->setText(txid);
});
menu.addAction("View on block explorer", [=] () {

2
src/mainwindow.ui

@ -22,7 +22,7 @@
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">

14
src/rpc.cpp

@ -338,7 +338,7 @@ void RPC::refreshBalances() {
allBalances = new QMap<QString, double>();
// Function to process reply of the listunspent and z_listunspent API calls, used below.
auto processUnspent = [=] (const json& reply) {
auto processUnspent = [=] (const json& reply) -> bool {
bool anyUnconfirmed = false;
for (auto& it : reply.get<json::array_t>()) {
QString qsAddr = QString::fromStdString(it["address"]);
@ -358,11 +358,13 @@ void RPC::refreshBalances() {
(*allBalances)[qsAddr] = (*allBalances)[qsAddr] + it["amount"].get<json::number_float_t>();
}
ui->unconfirmedWarning->setVisible(anyUnconfirmed);
return anyUnconfirmed;
};
// Function to create the data model and update the views, used below.
auto updateUI = [=] () {
auto updateUI = [=] (bool anyUnconfirmed) {
ui->unconfirmedWarning->setVisible(anyUnconfirmed);
// Update balances model data, which will update the table too
balancesTableModel->setNewData(allBalances, utxos);
@ -382,12 +384,12 @@ void RPC::refreshBalances() {
// Call the Transparent and Z unspent APIs serially and then, once they're done, update the UI
getTransparentUnspent([=] (json reply) {
processUnspent(reply);
auto anyTUnconfirmed = processUnspent(reply);
getZUnspent([=] (json reply) {
processUnspent(reply);
auto anyZUnconfirmed = processUnspent(reply);
updateUI();
updateUI(anyTUnconfirmed || anyZUnconfirmed);
});
});
}

14
src/scripts/mkrelease.sh

@ -14,6 +14,7 @@ echo "[OK]"
echo -n "Configuring..."
rm -f "bin/linux-zcash-qt-wallet-v$APP_VERSION.tar.gz"
make distclean > /dev/null
$QT_STATIC/bin/qmake zcash-qt-wallet.pro -spec linux-clang CONFIG+=release > /dev/null
echo "[OK]"
@ -41,9 +42,14 @@ cp README.md bin/zcash-qt-wallet-v$APP_VERSION > /dev/null
cp LICENSE bin/zcash-qt-wallet-v$APP_VERSION > /dev/null
cd bin && tar cvf linux-zcash-qt-wallet-v$APP_VERSION.tar.gz zcash-qt-wallet-v$APP_VERSION/ > /dev/null
cd ..
echo "[OK]"
if [ -f bin/linux-zcash-qt-wallet-v$APP_VERSION.tar.gz ] ; then
echo "[OK]"
echo "Done. Build is bin/linux-zcash-qt-wallet-v$APP_VERSION.tar.gz"
echo "Package contents:"
tar tf "bin/linux-zcash-qt-wallet-v$APP_VERSION.tar.gz"
echo "Done. Build is bin/linux-zcash-qt-wallet-v$APP_VERSION.tar.gz"
echo "Package contents:"
tar tf "bin/linux-zcash-qt-wallet-v$APP_VERSION.tar.gz"
else
echo "[ERROR]"
exit 1
fi

2
src/sendtab.cpp

@ -304,7 +304,7 @@ void MainWindow::sendButton() {
json rec = json::object();
rec["address"] = toAddr.addr.toStdString();
rec["amount"] = toAddr.amount;
if (toAddr.addr.startsWith("z"))
if (toAddr.addr.startsWith("z") && !toAddr.encodedMemo.trimmed().isEmpty())
rec["memo"] = toAddr.encodedMemo.toStdString();
allRecepients.push_back(rec);

2
src/ui_mainwindow.h

@ -656,7 +656,7 @@ public:
retranslateUi(MainWindow);
tabWidget->setCurrentIndex(1);
tabWidget->setCurrentIndex(0);
QMetaObject::connectSlotsByName(MainWindow);

Loading…
Cancel
Save