mirror of
https://git.wownero.com/wowlet/wowlet.git
synced 2024-08-15 01:03:14 +00:00
Status: constructing transaction
This commit is contained in:
parent
136f877778
commit
0dc196e76d
3 changed files with 47 additions and 12 deletions
|
@ -758,9 +758,11 @@ void AppContext::onTransactionCreated(PendingTransaction *tx, const QString &add
|
||||||
if(address == this->donationAddress)
|
if(address == this->donationAddress)
|
||||||
this->donationSending = true;
|
this->donationSending = true;
|
||||||
|
|
||||||
|
// Let UI know that the transaction was constructed
|
||||||
|
emit endTransaction();
|
||||||
|
|
||||||
// tx created, but not sent yet. ask user to verify first.
|
// tx created, but not sent yet. ask user to verify first.
|
||||||
emit createTransactionSuccess(tx, address, mixin);
|
emit createTransactionSuccess(tx, address, mixin);
|
||||||
emit endTransaction();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppContext::onTransactionCommitted(bool status, PendingTransaction *tx, const QStringList& txid){
|
void AppContext::onTransactionCommitted(bool status, PendingTransaction *tx, const QStringList& txid){
|
||||||
|
|
|
@ -79,7 +79,7 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
|
||||||
connected ? m_statusBtnTor->setIcon(QIcon(":/assets/images/tor_logo.png"))
|
connected ? m_statusBtnTor->setIcon(QIcon(":/assets/images/tor_logo.png"))
|
||||||
: m_statusBtnTor->setIcon(QIcon(":/assets/images/tor_logo_disabled.png"));});
|
: m_statusBtnTor->setIcon(QIcon(":/assets/images/tor_logo_disabled.png"));});
|
||||||
connect(m_ctx->nodes, &Nodes::updateStatus, [=](const QString &msg){
|
connect(m_ctx->nodes, &Nodes::updateStatus, [=](const QString &msg){
|
||||||
m_statusLabelStatus->setText(msg);
|
this->setStatusText(msg);
|
||||||
});
|
});
|
||||||
|
|
||||||
// menu connects
|
// menu connects
|
||||||
|
@ -234,6 +234,22 @@ MainWindow::MainWindow(AppContext *ctx, QWidget *parent) :
|
||||||
connect(m_ctx, &AppContext::initiateTransaction, ui->xmrToWidget, &XMRToWidget::onInitiateTransaction);
|
connect(m_ctx, &AppContext::initiateTransaction, ui->xmrToWidget, &XMRToWidget::onInitiateTransaction);
|
||||||
connect(m_ctx, &AppContext::endTransaction, ui->xmrToWidget, &XMRToWidget::onEndTransaction);
|
connect(m_ctx, &AppContext::endTransaction, ui->xmrToWidget, &XMRToWidget::onEndTransaction);
|
||||||
|
|
||||||
|
connect(m_ctx, &AppContext::initiateTransaction, [this]{
|
||||||
|
m_statusDots = 0;
|
||||||
|
m_constructingTransaction = true;
|
||||||
|
m_txTimer.start(1000);
|
||||||
|
});
|
||||||
|
connect(m_ctx, &AppContext::endTransaction, [this]{
|
||||||
|
// Todo: endTransaction can fail to fire when the node is switched during tx creation
|
||||||
|
m_constructingTransaction = false;
|
||||||
|
m_txTimer.stop();
|
||||||
|
this->setStatusText(m_statusText);
|
||||||
|
});
|
||||||
|
connect(&m_txTimer, &QTimer::timeout, [this]{
|
||||||
|
m_statusLabelStatus->setText("Constructing transaction" + this->statusDots());
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// testnet/stagenet warning
|
// testnet/stagenet warning
|
||||||
auto worthlessWarning = QString("Feather wallet is currently running in %1 mode. This is meant "
|
auto worthlessWarning = QString("Feather wallet is currently running in %1 mode. This is meant "
|
||||||
"for developers only. Your coins are WORTHLESS.");
|
"for developers only. Your coins are WORTHLESS.");
|
||||||
|
@ -592,9 +608,9 @@ void MainWindow::onWalletOpened() {
|
||||||
this->activateWindow();
|
this->activateWindow();
|
||||||
this->setEnabled(true);
|
this->setEnabled(true);
|
||||||
if(!m_ctx->tor->torConnected)
|
if(!m_ctx->tor->torConnected)
|
||||||
m_statusLabelStatus->setText("Wallet opened - Starting Tor (may take a while)");
|
this->setStatusText("Wallet opened - Starting Tor (may take a while)");
|
||||||
else
|
else
|
||||||
m_statusLabelStatus->setText("Wallet opened - Searching for node");
|
this->setStatusText("Wallet opened - Searching for node");
|
||||||
|
|
||||||
connect(m_ctx->currentWallet, &Wallet::connectionStatusChanged, this, &MainWindow::onConnectionStatusChanged);
|
connect(m_ctx->currentWallet, &Wallet::connectionStatusChanged, this, &MainWindow::onConnectionStatusChanged);
|
||||||
|
|
||||||
|
@ -655,22 +671,28 @@ void MainWindow::onBalanceUpdated(double balance, double unlocked, const QString
|
||||||
m_balanceWidget->setHidden(hide);
|
m_balanceWidget->setHidden(hide);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::setStatusText(const QString &text) {
|
||||||
|
m_statusText = text;
|
||||||
|
if (!m_constructingTransaction)
|
||||||
|
m_statusLabelStatus->setText(text);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::onSynchronized() {
|
void MainWindow::onSynchronized() {
|
||||||
this->updateNetStats();
|
this->updateNetStats();
|
||||||
m_statusLabelStatus->setText("Synchronized");
|
this->setStatusText("Synchronized");
|
||||||
this->onConnectionStatusChanged(Wallet::ConnectionStatus_Connected);
|
this->onConnectionStatusChanged(Wallet::ConnectionStatus_Connected);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onBlockchainSync(int height, int target) {
|
void MainWindow::onBlockchainSync(int height, int target) {
|
||||||
QString blocks = (target >= height) ? QString::number(target - height) : "?";
|
QString blocks = (target >= height) ? QString::number(target - height) : "?";
|
||||||
QString heightText = QString("Blockchain sync: %1 blocks remaining").arg(blocks);
|
QString heightText = QString("Blockchain sync: %1 blocks remaining").arg(blocks);
|
||||||
m_statusLabelStatus->setText(heightText);
|
this->setStatusText(heightText);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onRefreshSync(int height, int target) {
|
void MainWindow::onRefreshSync(int height, int target) {
|
||||||
QString blocks = (target >= height) ? QString::number(target - height) : "?";
|
QString blocks = (target >= height) ? QString::number(target - height) : "?";
|
||||||
QString heightText = QString("Wallet refresh: %1 blocks remaining").arg(blocks);
|
QString heightText = QString("Wallet refresh: %1 blocks remaining").arg(blocks);
|
||||||
m_statusLabelStatus->setText(heightText);
|
this->setStatusText(heightText);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onConnectionStatusChanged(int status)
|
void MainWindow::onConnectionStatusChanged(int status)
|
||||||
|
@ -684,7 +706,7 @@ void MainWindow::onConnectionStatusChanged(int status)
|
||||||
switch(status){
|
switch(status){
|
||||||
case Wallet::ConnectionStatus_Disconnected:
|
case Wallet::ConnectionStatus_Disconnected:
|
||||||
statusIcon = ":/assets/images/status_disconnected.svg";
|
statusIcon = ":/assets/images/status_disconnected.svg";
|
||||||
m_statusLabelStatus->setText("Disconnected");
|
this->setStatusText("Disconnected");
|
||||||
break;
|
break;
|
||||||
case Wallet::ConnectionStatus_Connected:
|
case Wallet::ConnectionStatus_Connected:
|
||||||
if (m_ctx->currentWallet->synchronized()) {
|
if (m_ctx->currentWallet->synchronized()) {
|
||||||
|
@ -695,11 +717,11 @@ void MainWindow::onConnectionStatusChanged(int status)
|
||||||
break;
|
break;
|
||||||
case Wallet::ConnectionStatus_Connecting:
|
case Wallet::ConnectionStatus_Connecting:
|
||||||
statusIcon = ":/assets/images/status_lagging.svg";
|
statusIcon = ":/assets/images/status_lagging.svg";
|
||||||
m_statusLabelStatus->setText("Connecting to daemon");
|
this->setStatusText("Connecting to daemon");
|
||||||
break;
|
break;
|
||||||
case Wallet::ConnectionStatus_WrongVersion:
|
case Wallet::ConnectionStatus_WrongVersion:
|
||||||
statusIcon = ":/assets/images/status_disconnected.svg";
|
statusIcon = ":/assets/images/status_disconnected.svg";
|
||||||
m_statusLabelStatus->setText("Incompatible daemon");
|
this->setStatusText("Incompatible daemon");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
statusIcon = ":/assets/images/status_disconnected.svg";
|
statusIcon = ":/assets/images/status_disconnected.svg";
|
||||||
|
@ -1300,6 +1322,12 @@ void MainWindow::rescanSpent() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString MainWindow::statusDots() {
|
||||||
|
m_statusDots++;
|
||||||
|
m_statusDots = m_statusDots % 4;
|
||||||
|
return QString(".").repeated(m_statusDots);
|
||||||
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow() {
|
MainWindow::~MainWindow() {
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,6 +168,8 @@ private:
|
||||||
void updatePasswordIcon();
|
void updatePasswordIcon();
|
||||||
void updateNetStats();
|
void updateNetStats();
|
||||||
void rescanSpent();
|
void rescanSpent();
|
||||||
|
void setStatusText(const QString &text);
|
||||||
|
QString statusDots();
|
||||||
|
|
||||||
WalletWizard *createWizard(WalletWizard::Page startPage);
|
WalletWizard *createWizard(WalletWizard::Page startPage);
|
||||||
|
|
||||||
|
@ -179,8 +181,6 @@ private:
|
||||||
AboutDialog *m_aboutDialog = nullptr;
|
AboutDialog *m_aboutDialog = nullptr;
|
||||||
XMRigWidget *m_xmrig = nullptr;
|
XMRigWidget *m_xmrig = nullptr;
|
||||||
|
|
||||||
bool m_windowSpawned = false;
|
|
||||||
|
|
||||||
QSystemTrayIcon *m_trayIcon;
|
QSystemTrayIcon *m_trayIcon;
|
||||||
QMenu m_trayMenu;
|
QMenu m_trayMenu;
|
||||||
QAction *m_trayActionCalc;
|
QAction *m_trayActionCalc;
|
||||||
|
@ -218,6 +218,11 @@ private:
|
||||||
|
|
||||||
QTimer m_updateBytes;
|
QTimer m_updateBytes;
|
||||||
|
|
||||||
|
QString m_statusText;
|
||||||
|
int m_statusDots;
|
||||||
|
bool m_constructingTransaction = false;
|
||||||
|
QTimer m_txTimer;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void menuToggleTabVisible(const QString &key);
|
void menuToggleTabVisible(const QString &key);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue