mirror of
https://github.com/feather-wallet/feather.git
synced 2024-11-17 17:57:39 +00:00
Don't allow manually storing wallet during synchronization
This commit is contained in:
parent
3eca0bad87
commit
1e6832c184
2 changed files with 12 additions and 1 deletions
|
@ -236,7 +236,7 @@ void MainWindow::initMenu() {
|
|||
connect(ui->actionViewOnly, &QAction::triggered, this, &MainWindow::showViewOnlyDialog);
|
||||
|
||||
// [Wallet] -> [Advanced]
|
||||
connect(ui->actionStore_wallet, &QAction::triggered, [this]{m_ctx->wallet->store();});
|
||||
connect(ui->actionStore_wallet, &QAction::triggered, this, &MainWindow::tryStoreWallet);
|
||||
connect(ui->actionUpdate_balance, &QAction::triggered, [this]{m_ctx->updateBalance();});
|
||||
connect(ui->actionRefresh_tabs, &QAction::triggered, [this]{m_ctx->refreshModels();});
|
||||
connect(ui->actionRescan_spent, &QAction::triggered, this, &MainWindow::rescanSpent);
|
||||
|
@ -530,6 +530,16 @@ void MainWindow::setStatusText(const QString &text, bool override, int timeout)
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::tryStoreWallet() {
|
||||
if (m_ctx->wallet->connectionStatus() == Wallet::ConnectionStatus::ConnectionStatus_Synchronizing) {
|
||||
QMessageBox::warning(this, "Save wallet", "Unable to save wallet during synchronization.\n\n"
|
||||
"Wait until synchronization is finished and try again.");
|
||||
return;
|
||||
}
|
||||
|
||||
m_ctx->wallet->store();
|
||||
}
|
||||
|
||||
void MainWindow::onSynchronized() {
|
||||
this->updateNetStats();
|
||||
this->setStatusText("Synchronized");
|
||||
|
|
|
@ -180,6 +180,7 @@ private slots:
|
|||
void onUpdatesAvailable(const QJsonObject &updates);
|
||||
void toggleSearchbar(bool enabled);
|
||||
void onSetStatusText(const QString &text);
|
||||
void tryStoreWallet();
|
||||
|
||||
private:
|
||||
friend WindowManager;
|
||||
|
|
Loading…
Reference in a new issue