Add view on block explorer for txid and address
This commit is contained in:
parent
c7d1eb284f
commit
d28ab79743
|
@ -1,4 +1,5 @@
|
||||||
#include "balancestablemodel.h"
|
#include "balancestablemodel.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
BalancesTableModel::BalancesTableModel(QObject *parent)
|
BalancesTableModel::BalancesTableModel(QObject *parent)
|
||||||
: QAbstractTableModel(parent)
|
: QAbstractTableModel(parent)
|
||||||
|
@ -46,17 +47,8 @@ int BalancesTableModel::columnCount(const QModelIndex&) const
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariant BalancesTableModel::data(const QModelIndex &index, int role) const
|
QVariant BalancesTableModel::data(const QModelIndex &index, int role) const
|
||||||
{
|
{
|
||||||
auto fnSplitAddressForWrap = [=] (const QString& a) -> QString {
|
|
||||||
if (!a.startsWith("z")) return a;
|
|
||||||
|
|
||||||
auto half = a.length() / 2;
|
|
||||||
auto splitted = a.left(half) + "\n" + a.right(a.length() - half);
|
|
||||||
return splitted;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (role == Qt::TextAlignmentRole && index.column() == 1) return QVariant(Qt::AlignRight | Qt::AlignVCenter);
|
if (role == Qt::TextAlignmentRole && index.column() == 1) return QVariant(Qt::AlignRight | Qt::AlignVCenter);
|
||||||
|
|
||||||
if (role == Qt::ForegroundRole) {
|
if (role == Qt::ForegroundRole) {
|
||||||
|
@ -78,8 +70,8 @@ QVariant BalancesTableModel::data(const QModelIndex &index, int role) const
|
||||||
|
|
||||||
if (role == Qt::DisplayRole || role == Qt::ToolTipRole) {
|
if (role == Qt::DisplayRole || role == Qt::ToolTipRole) {
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case 0: return fnSplitAddressForWrap(std::get<0>(modeldata->at(index.row())));
|
case 0: return std::get<0>(modeldata->at(index.row()));
|
||||||
case 1: return QVariant(std::get<1>(modeldata->at(index.row())) % " ZEC");
|
case 1: return QVariant(std::get<1>(modeldata->at(index.row())) % " " % Utils::getTokenName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,3 +103,4 @@ QVariant BalancesTableModel::headerData(int section, Qt::Orientation orientation
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,9 +83,9 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="feesLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Fees: 0.0001 ZEC</string>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -86,6 +86,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
// Set up donate action
|
// Set up donate action
|
||||||
QObject::connect(ui->actionDonate, &QAction::triggered, this, &MainWindow::donate);
|
QObject::connect(ui->actionDonate, &QAction::triggered, this, &MainWindow::donate);
|
||||||
|
|
||||||
|
// Set up check for updates action
|
||||||
|
QObject::connect(ui->actionCheck_for_Updates, &QAction::triggered, [=] () {
|
||||||
|
QDesktopServices::openUrl(QUrl("https://github.com/adityapk00/zcash-qt-wallet/releases"));
|
||||||
|
});
|
||||||
|
|
||||||
QObject::connect(ui->actionImport_Private_Keys, &QAction::triggered, this, &MainWindow::importPrivKeys);
|
QObject::connect(ui->actionImport_Private_Keys, &QAction::triggered, this, &MainWindow::importPrivKeys);
|
||||||
|
|
||||||
// Set up about action
|
// Set up about action
|
||||||
|
@ -118,7 +123,7 @@ void MainWindow::donate() {
|
||||||
ui->Address1->setCursorPosition(0);
|
ui->Address1->setCursorPosition(0);
|
||||||
ui->Amount1->setText("0.01");
|
ui->Amount1->setText("0.01");
|
||||||
|
|
||||||
ui->statusBar->showMessage("Donate 0.01 ZEC to support zcash-qt-wallet");
|
ui->statusBar->showMessage("Donate 0.01 " % Utils::getTokenName() % " to support zcash-qt-wallet");
|
||||||
|
|
||||||
// And switch to the send tab.
|
// And switch to the send tab.
|
||||||
ui->tabWidget->setCurrentIndex(1);
|
ui->tabWidget->setCurrentIndex(1);
|
||||||
|
@ -156,14 +161,27 @@ void MainWindow::setupBalancesTab() {
|
||||||
if (index.row() < 0) return;
|
if (index.row() < 0) return;
|
||||||
|
|
||||||
index = index.sibling(index.row(), 0);
|
index = index.sibling(index.row(), 0);
|
||||||
|
auto addr = ui->balancesTable->model()->data(index).toString();
|
||||||
|
|
||||||
QMenu menu(this);
|
QMenu menu(this);
|
||||||
|
|
||||||
menu.addAction("Copy Address", [=] () {
|
menu.addAction("Copy Address", [=] () {
|
||||||
QClipboard *clipboard = QGuiApplication::clipboard();
|
QClipboard *clipboard = QGuiApplication::clipboard();
|
||||||
clipboard->setText(ui->balancesTable->model()->data(index).toString());
|
clipboard->setText(addr);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (addr.startsWith("t")) {
|
||||||
|
menu.addAction("View on block explorer", [=] () {
|
||||||
|
QString url;
|
||||||
|
if (Settings::getInstance()->isTestnet()) {
|
||||||
|
url = "https://explorer.testnet.z.cash/address/" + addr;
|
||||||
|
} else {
|
||||||
|
url = "https://explorer.zcha.in/accounts/" + addr;
|
||||||
|
}
|
||||||
|
QDesktopServices::openUrl(QUrl(url));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
menu.exec(ui->balancesTable->viewport()->mapToGlobal(pos));
|
menu.exec(ui->balancesTable->viewport()->mapToGlobal(pos));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -177,15 +195,22 @@ void MainWindow::setupTransactionsTab() {
|
||||||
|
|
||||||
QMenu menu(this);
|
QMenu menu(this);
|
||||||
|
|
||||||
menu.addAction("View txid", [=] () {
|
|
||||||
QMessageBox msg(this);
|
|
||||||
msg.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
|
|
||||||
msg.setIcon(QMessageBox::Icon::Information);
|
|
||||||
msg.setWindowTitle("Transaction ID");
|
|
||||||
auto txModel = dynamic_cast<TxTableModel *>(ui->transactionsTable->model());
|
auto txModel = dynamic_cast<TxTableModel *>(ui->transactionsTable->model());
|
||||||
msg.setText("Transaction ID: \n\n" + txModel->getTxId(index.row()));
|
QString txid = txModel->getTxId(index.row());
|
||||||
msg.exec();
|
|
||||||
|
menu.addAction("Copy txid to clipboard", [=] () {
|
||||||
|
QGuiApplication::clipboard()->setText(txid);
|
||||||
});
|
});
|
||||||
|
menu.addAction("View 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.exec(ui->transactionsTable->viewport()->mapToGlobal(pos));
|
menu.exec(ui->transactionsTable->viewport()->mapToGlobal(pos));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,8 +273,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>825</width>
|
<width>823</width>
|
||||||
<height>284</height>
|
<height>226</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="sendToLayout">
|
<layout class="QVBoxLayout" name="sendToLayout">
|
||||||
|
@ -428,9 +428,9 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="lineEdit">
|
<widget class="QLineEdit" name="sendTxFees">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>0.0001 ZEC</string>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
@ -637,7 +637,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>889</width>
|
<width>889</width>
|
||||||
<height>21</height>
|
<height>22</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuBalance">
|
<widget class="QMenu" name="menuBalance">
|
||||||
|
@ -654,6 +654,7 @@
|
||||||
<string>Help</string>
|
<string>Help</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="actionDonate"/>
|
<addaction name="actionDonate"/>
|
||||||
|
<addaction name="actionCheck_for_Updates"/>
|
||||||
<addaction name="actionAbout"/>
|
<addaction name="actionAbout"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menuBalance"/>
|
<addaction name="menuBalance"/>
|
||||||
|
@ -688,6 +689,11 @@
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionCheck_for_Updates">
|
||||||
|
<property name="text">
|
||||||
|
<string>Check github.com for Updates</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
|
@ -699,7 +705,7 @@
|
||||||
<tabstop>Amount1</tabstop>
|
<tabstop>Amount1</tabstop>
|
||||||
<tabstop>Max1</tabstop>
|
<tabstop>Max1</tabstop>
|
||||||
<tabstop>addAddressButton</tabstop>
|
<tabstop>addAddressButton</tabstop>
|
||||||
<tabstop>lineEdit</tabstop>
|
<tabstop>sendTxFees</tabstop>
|
||||||
<tabstop>sendTransactionButton</tabstop>
|
<tabstop>sendTransactionButton</tabstop>
|
||||||
<tabstop>cancelSendButton</tabstop>
|
<tabstop>cancelSendButton</tabstop>
|
||||||
<tabstop>balancesTable</tabstop>
|
<tabstop>balancesTable</tabstop>
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QDesktopServices>
|
||||||
#include <QtNetwork/QNetworkRequest>
|
#include <QtNetwork/QNetworkRequest>
|
||||||
#include <QtNetwork/QNetworkAccessManager>
|
#include <QtNetwork/QNetworkAccessManager>
|
||||||
#include <QtNetwork/QNetworkReply>
|
#include <QtNetwork/QNetworkReply>
|
||||||
|
|
24
src/rpc.cpp
24
src/rpc.cpp
|
@ -287,10 +287,18 @@ void RPC::getInfoThenRefresh() {
|
||||||
{"method", "getinfo"}
|
{"method", "getinfo"}
|
||||||
};
|
};
|
||||||
|
|
||||||
doRPC(payload, [=] (json reply) {
|
doRPC(payload, [=] (const json& reply) {
|
||||||
QString statusText = QString::fromStdString("Connected (")
|
// Testnet?
|
||||||
.append(QString::number(reply["blocks"].get<json::number_unsigned_t>()))
|
if (reply.find("testnet") != reply.end()) {
|
||||||
.append(")");
|
Settings::getInstance()->setTestnet(reply["testnet"].get<json::boolean_t>());
|
||||||
|
};
|
||||||
|
|
||||||
|
// Connected?
|
||||||
|
QString statusText = QString() %
|
||||||
|
"Connected (" %
|
||||||
|
(Settings::getInstance()->isTestnet() ? "testnet:" : "mainnet:") %
|
||||||
|
QString::number(reply["blocks"].get<json::number_unsigned_t>()) %
|
||||||
|
")";
|
||||||
main->statusLabel->setText(statusText);
|
main->statusLabel->setText(statusText);
|
||||||
QIcon i(":/icons/res/connected.png");
|
QIcon i(":/icons/res/connected.png");
|
||||||
main->statusIcon->setPixmap(i.pixmap(16, 16));
|
main->statusIcon->setPixmap(i.pixmap(16, 16));
|
||||||
|
@ -317,9 +325,9 @@ void RPC::refreshAddresses() {
|
||||||
void RPC::refreshBalances() {
|
void RPC::refreshBalances() {
|
||||||
// 1. Get the Balances
|
// 1. Get the Balances
|
||||||
getBalance([=] (json reply) {
|
getBalance([=] (json reply) {
|
||||||
ui->balSheilded ->setText(QString::fromStdString(reply["private"]) % " ZEC");
|
ui->balSheilded ->setText(QString::fromStdString(reply["private"]) % " " % Utils::getTokenName());
|
||||||
ui->balTransparent ->setText(QString::fromStdString(reply["transparent"]) % " ZEC");
|
ui->balTransparent ->setText(QString::fromStdString(reply["transparent"]) % " " % Utils::getTokenName());
|
||||||
ui->balTotal ->setText(QString::fromStdString(reply["total"]) % " ZEC");
|
ui->balTotal ->setText(QString::fromStdString(reply["total"]) % " " % Utils::getTokenName());
|
||||||
});
|
});
|
||||||
|
|
||||||
// 2. Get the UTXOs
|
// 2. Get the UTXOs
|
||||||
|
@ -364,7 +372,7 @@ void RPC::refreshBalances() {
|
||||||
ui->inputsCombo->clear();
|
ui->inputsCombo->clear();
|
||||||
auto i = allBalances->constBegin();
|
auto i = allBalances->constBegin();
|
||||||
while (i != allBalances->constEnd()) {
|
while (i != allBalances->constEnd()) {
|
||||||
QString item = i.key() % "(" % QString::number(i.value(), 'g', 8) % " ZEC)";
|
QString item = i.key() % "(" % QString::number(i.value(), 'g', 8) % " " % Utils::getTokenName() % ")";
|
||||||
ui->inputsCombo->addItem(item);
|
ui->inputsCombo->addItem(item);
|
||||||
if (item.startsWith(lastFromAddr)) ui->inputsCombo->setCurrentText(item);
|
if (item.startsWith(lastFromAddr)) ui->inputsCombo->setCurrentText(item);
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,10 @@ cp zcash-qt-wallet bin/zcash-qt-wallet-v$APP_VERSION > /dev/null
|
||||||
cp README.md bin/zcash-qt-wallet-v$APP_VERSION > /dev/null
|
cp README.md bin/zcash-qt-wallet-v$APP_VERSION > /dev/null
|
||||||
cp LICENSE 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 bin && tar cvf linux-zcash-qt-wallet-v$APP_VERSION.tar.gz zcash-qt-wallet-v$APP_VERSION/ > /dev/null
|
||||||
|
cd ..
|
||||||
echo "[OK]"
|
echo "[OK]"
|
||||||
|
|
||||||
|
|
||||||
echo "Done. Build is 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"
|
|
@ -3,6 +3,7 @@
|
||||||
#include "ui_confirm.h"
|
#include "ui_confirm.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
#include "rpc.h"
|
#include "rpc.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
#include "precompiled.h"
|
#include "precompiled.h"
|
||||||
|
|
||||||
|
@ -32,6 +33,14 @@ void MainWindow::setupSendTab() {
|
||||||
// Max available Checkbox
|
// Max available Checkbox
|
||||||
QObject::connect(ui->Max1, &QCheckBox::stateChanged, this, &MainWindow::maxAmountChecked);
|
QObject::connect(ui->Max1, &QCheckBox::stateChanged, this, &MainWindow::maxAmountChecked);
|
||||||
|
|
||||||
|
// Set up focus enter to set fees
|
||||||
|
QObject::connect(ui->tabWidget, &QTabWidget::currentChanged, [=] (int pos) {
|
||||||
|
if (pos == 1) {
|
||||||
|
// Set the fees
|
||||||
|
ui->sendTxFees->setText("0.0001 " + Utils::getTokenName());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::setDefaultPayFrom() {
|
void MainWindow::setDefaultPayFrom() {
|
||||||
|
@ -66,7 +75,7 @@ void MainWindow::setDefaultPayFrom() {
|
||||||
|
|
||||||
void MainWindow::inputComboTextChanged(const QString& text) {
|
void MainWindow::inputComboTextChanged(const QString& text) {
|
||||||
auto bal = rpc->getAllBalances()->value(text.split("(")[0].trimmed());
|
auto bal = rpc->getAllBalances()->value(text.split("(")[0].trimmed());
|
||||||
auto balFmt = QString::number(bal, 'g', 8) + " ZEC";
|
auto balFmt = QString::number(bal, 'g', 8) + " " % Utils::getTokenName();
|
||||||
ui->sendAddressBalance->setText(balFmt);
|
ui->sendAddressBalance->setText(balFmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,7 +255,7 @@ void MainWindow::sendButton() {
|
||||||
|
|
||||||
auto Amt = new QLabel(confirm.sendToAddrs);
|
auto Amt = new QLabel(confirm.sendToAddrs);
|
||||||
Amt->setObjectName(QString("Amt") % QString::number(i + 1));
|
Amt->setObjectName(QString("Amt") % QString::number(i + 1));
|
||||||
Amt->setText(QString::number(toAddr.second, 'g', 8) % " ZEC");
|
Amt->setText(QString::number(toAddr.second, 'g', 8) % " " % Utils::getTokenName());
|
||||||
Amt->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
Amt->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
||||||
confirm.gridLayout->addWidget(Amt, i, 1, 1, 1);
|
confirm.gridLayout->addWidget(Amt, i, 1, 1, 1);
|
||||||
}
|
}
|
||||||
|
@ -260,6 +269,9 @@ void MainWindow::sendButton() {
|
||||||
// And show it in the confirm dialog
|
// And show it in the confirm dialog
|
||||||
confirm.sendFrom->setText(fnSplitAddressForWrap(fromAddr));
|
confirm.sendFrom->setText(fnSplitAddressForWrap(fromAddr));
|
||||||
|
|
||||||
|
// Fees in the confirm dialog
|
||||||
|
confirm.feesLabel->setText("Fees: 0.0001 " % Utils::getTokenName());
|
||||||
|
|
||||||
// Show the dialog and submit it if the user confirms
|
// Show the dialog and submit it if the user confirms
|
||||||
if (d.exec() == QDialog::Accepted) {
|
if (d.exec() == QDialog::Accepted) {
|
||||||
rpc->sendZTransaction(params, [=](const json& reply) {
|
rpc->sendZTransaction(params, [=](const json& reply) {
|
||||||
|
|
|
@ -65,9 +65,6 @@ void Settings::loadFromFile() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If file was found, then setup some defaults
|
|
||||||
overridePort = "8232";
|
|
||||||
|
|
||||||
QTextStream in(&file);
|
QTextStream in(&file);
|
||||||
|
|
||||||
while (!in.atEnd()) {
|
while (!in.atEnd()) {
|
||||||
|
@ -93,3 +90,11 @@ void Settings::loadFromFile() {
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Settings::isTestnet() {
|
||||||
|
return _isTestnet;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Settings::setTestnet(bool isTestnet) {
|
||||||
|
this->_isTestnet = isTestnet;
|
||||||
|
}
|
|
@ -18,6 +18,10 @@ public:
|
||||||
double fees() { return 0.0001; }
|
double fees() { return 0.0001; }
|
||||||
void loadFromSettings();
|
void loadFromSettings();
|
||||||
void loadFromFile();
|
void loadFromFile();
|
||||||
|
|
||||||
|
bool isTestnet();
|
||||||
|
void setTestnet(bool isTestnet);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// This class can only be accessed through Settings::getInstance()
|
// This class can only be accessed through Settings::getInstance()
|
||||||
Settings() = default;
|
Settings() = default;
|
||||||
|
@ -30,6 +34,8 @@ private:
|
||||||
QString password;
|
QString password;
|
||||||
|
|
||||||
QString overridePort;
|
QString overridePort;
|
||||||
|
|
||||||
|
bool _isTestnet = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SETTINGS_H
|
#endif // SETTINGS_H
|
|
@ -1,10 +1,10 @@
|
||||||
#include "txtablemodel.h"
|
#include "txtablemodel.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
TxTableModel::TxTableModel(QObject *parent)
|
TxTableModel::TxTableModel(QObject *parent)
|
||||||
: QAbstractTableModel(parent)
|
: QAbstractTableModel(parent) {
|
||||||
{
|
|
||||||
headers << "Category" << "Address" << "Date/Time" << "Amount";
|
headers << "Category" << "Address" << "Date/Time" << "Amount";
|
||||||
}
|
}
|
||||||
|
|
||||||
TxTableModel::~TxTableModel() {
|
TxTableModel::~TxTableModel() {
|
||||||
delete modeldata;
|
delete modeldata;
|
||||||
|
@ -53,7 +53,7 @@ void TxTableModel::setNewData(QList<TransactionItem>* data) {
|
||||||
case 0: return modeldata->at(index.row()).type;
|
case 0: return modeldata->at(index.row()).type;
|
||||||
case 1: return modeldata->at(index.row()).address;
|
case 1: return modeldata->at(index.row()).address;
|
||||||
case 2: return modeldata->at(index.row()).datetime;
|
case 2: return modeldata->at(index.row()).datetime;
|
||||||
case 3: return QVariant(QString::number(modeldata->at(index.row()).amount, 'g', 8) % " ZEC");
|
case 3: return QVariant(QString::number(modeldata->at(index.row()).amount, 'g', 8) % " " % Utils::getTokenName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ public:
|
||||||
QLabel *Amt1;
|
QLabel *Amt1;
|
||||||
QSpacerItem *verticalSpacer;
|
QSpacerItem *verticalSpacer;
|
||||||
QFrame *line;
|
QFrame *line;
|
||||||
QLabel *label;
|
QLabel *feesLabel;
|
||||||
QDialogButtonBox *buttonBox;
|
QDialogButtonBox *buttonBox;
|
||||||
|
|
||||||
void setupUi(QDialog *confirm)
|
void setupUi(QDialog *confirm)
|
||||||
|
@ -88,10 +88,10 @@ public:
|
||||||
|
|
||||||
verticalLayout->addWidget(line);
|
verticalLayout->addWidget(line);
|
||||||
|
|
||||||
label = new QLabel(confirm);
|
feesLabel = new QLabel(confirm);
|
||||||
label->setObjectName(QStringLiteral("label"));
|
feesLabel->setObjectName(QStringLiteral("feesLabel"));
|
||||||
|
|
||||||
verticalLayout->addWidget(label);
|
verticalLayout->addWidget(feesLabel);
|
||||||
|
|
||||||
buttonBox = new QDialogButtonBox(confirm);
|
buttonBox = new QDialogButtonBox(confirm);
|
||||||
buttonBox->setObjectName(QStringLiteral("buttonBox"));
|
buttonBox->setObjectName(QStringLiteral("buttonBox"));
|
||||||
|
@ -116,7 +116,7 @@ public:
|
||||||
sendToAddrs->setTitle(QApplication::translate("confirm", "To", nullptr));
|
sendToAddrs->setTitle(QApplication::translate("confirm", "To", nullptr));
|
||||||
Addr1->setText(QApplication::translate("confirm", "TextLabel", nullptr));
|
Addr1->setText(QApplication::translate("confirm", "TextLabel", nullptr));
|
||||||
Amt1->setText(QApplication::translate("confirm", "TextLabel", nullptr));
|
Amt1->setText(QApplication::translate("confirm", "TextLabel", nullptr));
|
||||||
label->setText(QApplication::translate("confirm", "Fees: 0.0001 ZEC", nullptr));
|
feesLabel->setText(QString());
|
||||||
} // retranslateUi
|
} // retranslateUi
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -46,6 +46,7 @@ public:
|
||||||
QAction *actionSettings;
|
QAction *actionSettings;
|
||||||
QAction *actionDonate;
|
QAction *actionDonate;
|
||||||
QAction *actionImport_Private_Keys;
|
QAction *actionImport_Private_Keys;
|
||||||
|
QAction *actionCheck_for_Updates;
|
||||||
QWidget *centralWidget;
|
QWidget *centralWidget;
|
||||||
QGridLayout *gridLayout_3;
|
QGridLayout *gridLayout_3;
|
||||||
QTabWidget *tabWidget;
|
QTabWidget *tabWidget;
|
||||||
|
@ -104,7 +105,7 @@ public:
|
||||||
QVBoxLayout *verticalLayout_10;
|
QVBoxLayout *verticalLayout_10;
|
||||||
QHBoxLayout *horizontalLayout_14;
|
QHBoxLayout *horizontalLayout_14;
|
||||||
QLabel *label_7;
|
QLabel *label_7;
|
||||||
QLineEdit *lineEdit;
|
QLineEdit *sendTxFees;
|
||||||
QSpacerItem *horizontalSpacer_5;
|
QSpacerItem *horizontalSpacer_5;
|
||||||
QHBoxLayout *horizontalLayout_6;
|
QHBoxLayout *horizontalLayout_6;
|
||||||
QSpacerItem *horizontalSpacer;
|
QSpacerItem *horizontalSpacer;
|
||||||
|
@ -153,6 +154,8 @@ public:
|
||||||
actionImport_Private_Keys = new QAction(MainWindow);
|
actionImport_Private_Keys = new QAction(MainWindow);
|
||||||
actionImport_Private_Keys->setObjectName(QStringLiteral("actionImport_Private_Keys"));
|
actionImport_Private_Keys->setObjectName(QStringLiteral("actionImport_Private_Keys"));
|
||||||
actionImport_Private_Keys->setVisible(false);
|
actionImport_Private_Keys->setVisible(false);
|
||||||
|
actionCheck_for_Updates = new QAction(MainWindow);
|
||||||
|
actionCheck_for_Updates->setObjectName(QStringLiteral("actionCheck_for_Updates"));
|
||||||
centralWidget = new QWidget(MainWindow);
|
centralWidget = new QWidget(MainWindow);
|
||||||
centralWidget->setObjectName(QStringLiteral("centralWidget"));
|
centralWidget->setObjectName(QStringLiteral("centralWidget"));
|
||||||
gridLayout_3 = new QGridLayout(centralWidget);
|
gridLayout_3 = new QGridLayout(centralWidget);
|
||||||
|
@ -349,7 +352,7 @@ public:
|
||||||
sendToScrollArea->setWidgetResizable(true);
|
sendToScrollArea->setWidgetResizable(true);
|
||||||
sendToWidgets = new QWidget();
|
sendToWidgets = new QWidget();
|
||||||
sendToWidgets->setObjectName(QStringLiteral("sendToWidgets"));
|
sendToWidgets->setObjectName(QStringLiteral("sendToWidgets"));
|
||||||
sendToWidgets->setGeometry(QRect(0, 0, 825, 284));
|
sendToWidgets->setGeometry(QRect(0, 0, 823, 226));
|
||||||
sendToLayout = new QVBoxLayout(sendToWidgets);
|
sendToLayout = new QVBoxLayout(sendToWidgets);
|
||||||
sendToLayout->setSpacing(6);
|
sendToLayout->setSpacing(6);
|
||||||
sendToLayout->setContentsMargins(11, 11, 11, 11);
|
sendToLayout->setContentsMargins(11, 11, 11, 11);
|
||||||
|
@ -450,11 +453,11 @@ public:
|
||||||
|
|
||||||
horizontalLayout_14->addWidget(label_7);
|
horizontalLayout_14->addWidget(label_7);
|
||||||
|
|
||||||
lineEdit = new QLineEdit(groupBox_7);
|
sendTxFees = new QLineEdit(groupBox_7);
|
||||||
lineEdit->setObjectName(QStringLiteral("lineEdit"));
|
sendTxFees->setObjectName(QStringLiteral("sendTxFees"));
|
||||||
lineEdit->setReadOnly(true);
|
sendTxFees->setReadOnly(true);
|
||||||
|
|
||||||
horizontalLayout_14->addWidget(lineEdit);
|
horizontalLayout_14->addWidget(sendTxFees);
|
||||||
|
|
||||||
horizontalSpacer_5 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
horizontalSpacer_5 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
|
||||||
|
@ -605,7 +608,7 @@ public:
|
||||||
MainWindow->setCentralWidget(centralWidget);
|
MainWindow->setCentralWidget(centralWidget);
|
||||||
menuBar = new QMenuBar(MainWindow);
|
menuBar = new QMenuBar(MainWindow);
|
||||||
menuBar->setObjectName(QStringLiteral("menuBar"));
|
menuBar->setObjectName(QStringLiteral("menuBar"));
|
||||||
menuBar->setGeometry(QRect(0, 0, 889, 21));
|
menuBar->setGeometry(QRect(0, 0, 889, 22));
|
||||||
menuBalance = new QMenu(menuBar);
|
menuBalance = new QMenu(menuBar);
|
||||||
menuBalance->setObjectName(QStringLiteral("menuBalance"));
|
menuBalance->setObjectName(QStringLiteral("menuBalance"));
|
||||||
menuHelp = new QMenu(menuBar);
|
menuHelp = new QMenu(menuBar);
|
||||||
|
@ -621,8 +624,8 @@ public:
|
||||||
QWidget::setTabOrder(Address1, Amount1);
|
QWidget::setTabOrder(Address1, Amount1);
|
||||||
QWidget::setTabOrder(Amount1, Max1);
|
QWidget::setTabOrder(Amount1, Max1);
|
||||||
QWidget::setTabOrder(Max1, addAddressButton);
|
QWidget::setTabOrder(Max1, addAddressButton);
|
||||||
QWidget::setTabOrder(addAddressButton, lineEdit);
|
QWidget::setTabOrder(addAddressButton, sendTxFees);
|
||||||
QWidget::setTabOrder(lineEdit, sendTransactionButton);
|
QWidget::setTabOrder(sendTxFees, sendTransactionButton);
|
||||||
QWidget::setTabOrder(sendTransactionButton, cancelSendButton);
|
QWidget::setTabOrder(sendTransactionButton, cancelSendButton);
|
||||||
QWidget::setTabOrder(cancelSendButton, balancesTable);
|
QWidget::setTabOrder(cancelSendButton, balancesTable);
|
||||||
QWidget::setTabOrder(balancesTable, rdioZAddr);
|
QWidget::setTabOrder(balancesTable, rdioZAddr);
|
||||||
|
@ -639,6 +642,7 @@ public:
|
||||||
menuBalance->addSeparator();
|
menuBalance->addSeparator();
|
||||||
menuBalance->addAction(actionExit);
|
menuBalance->addAction(actionExit);
|
||||||
menuHelp->addAction(actionDonate);
|
menuHelp->addAction(actionDonate);
|
||||||
|
menuHelp->addAction(actionCheck_for_Updates);
|
||||||
menuHelp->addAction(actionAbout);
|
menuHelp->addAction(actionAbout);
|
||||||
|
|
||||||
retranslateUi(MainWindow);
|
retranslateUi(MainWindow);
|
||||||
|
@ -657,6 +661,7 @@ public:
|
||||||
actionSettings->setText(QApplication::translate("MainWindow", "Settings", nullptr));
|
actionSettings->setText(QApplication::translate("MainWindow", "Settings", nullptr));
|
||||||
actionDonate->setText(QApplication::translate("MainWindow", "Donate", nullptr));
|
actionDonate->setText(QApplication::translate("MainWindow", "Donate", nullptr));
|
||||||
actionImport_Private_Keys->setText(QApplication::translate("MainWindow", "Import Private Keys", nullptr));
|
actionImport_Private_Keys->setText(QApplication::translate("MainWindow", "Import Private Keys", nullptr));
|
||||||
|
actionCheck_for_Updates->setText(QApplication::translate("MainWindow", "Check github.com for Updates", nullptr));
|
||||||
groupBox->setTitle(QApplication::translate("MainWindow", "Summary", nullptr));
|
groupBox->setTitle(QApplication::translate("MainWindow", "Summary", nullptr));
|
||||||
label->setText(QApplication::translate("MainWindow", "Shielded", nullptr));
|
label->setText(QApplication::translate("MainWindow", "Shielded", nullptr));
|
||||||
balSheilded->setText(QString());
|
balSheilded->setText(QString());
|
||||||
|
@ -679,7 +684,7 @@ public:
|
||||||
addAddressButton->setText(QApplication::translate("MainWindow", "Add Address", nullptr));
|
addAddressButton->setText(QApplication::translate("MainWindow", "Add Address", nullptr));
|
||||||
groupBox_7->setTitle(QApplication::translate("MainWindow", "Fees", nullptr));
|
groupBox_7->setTitle(QApplication::translate("MainWindow", "Fees", nullptr));
|
||||||
label_7->setText(QApplication::translate("MainWindow", "Fee", nullptr));
|
label_7->setText(QApplication::translate("MainWindow", "Fee", nullptr));
|
||||||
lineEdit->setText(QApplication::translate("MainWindow", "0.0001 ZEC", nullptr));
|
sendTxFees->setText(QString());
|
||||||
sendTransactionButton->setText(QApplication::translate("MainWindow", "Send", nullptr));
|
sendTransactionButton->setText(QApplication::translate("MainWindow", "Send", nullptr));
|
||||||
cancelSendButton->setText(QApplication::translate("MainWindow", "Cancel", nullptr));
|
cancelSendButton->setText(QApplication::translate("MainWindow", "Cancel", nullptr));
|
||||||
tabWidget->setTabText(tabWidget->indexOf(tab_2), QApplication::translate("MainWindow", "Send", nullptr));
|
tabWidget->setTabText(tabWidget->indexOf(tab_2), QApplication::translate("MainWindow", "Send", nullptr));
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
#include "settings.h"
|
||||||
|
|
||||||
const QString Utils::txidStatusMessage = QString("Tx submitted (right click to copy) txid:");
|
const QString Utils::txidStatusMessage = QString("Tx submitted (right click to copy) txid:");
|
||||||
|
|
||||||
|
const QString Utils::getTokenName() {
|
||||||
|
if (Settings::getInstance()->isTestnet()) {
|
||||||
|
return "TAZ";
|
||||||
|
} else {
|
||||||
|
return "ZEC";
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue