Changeset View
Changeset View
Standalone View
Standalone View
src/qt/walletview.cpp
Show All 13 Lines | |||||
#include "platformstyle.h" | #include "platformstyle.h" | ||||
#include "receivecoinsdialog.h" | #include "receivecoinsdialog.h" | ||||
#include "sendcoinsdialog.h" | #include "sendcoinsdialog.h" | ||||
#include "signverifymessagedialog.h" | #include "signverifymessagedialog.h" | ||||
#include "transactiontablemodel.h" | #include "transactiontablemodel.h" | ||||
#include "transactionview.h" | #include "transactionview.h" | ||||
#include "walletmodel.h" | #include "walletmodel.h" | ||||
#include "interface/node.h" | |||||
#include "ui_interface.h" | #include "ui_interface.h" | ||||
#include <QAction> | #include <QAction> | ||||
#include <QActionGroup> | #include <QActionGroup> | ||||
#include <QFileDialog> | #include <QFileDialog> | ||||
#include <QHBoxLayout> | #include <QHBoxLayout> | ||||
#include <QProgressDialog> | #include <QProgressDialog> | ||||
#include <QPushButton> | #include <QPushButton> | ||||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | if (_walletModel) { | ||||
connect(_walletModel, SIGNAL(showProgress(QString, int)), this, | connect(_walletModel, SIGNAL(showProgress(QString, int)), this, | ||||
SLOT(showProgress(QString, int))); | SLOT(showProgress(QString, int))); | ||||
} | } | ||||
} | } | ||||
void WalletView::processNewTransaction(const QModelIndex &parent, int start, | void WalletView::processNewTransaction(const QModelIndex &parent, int start, | ||||
int end) { | int end) { | ||||
// Prevent balloon-spam when initial block download is in progress | // Prevent balloon-spam when initial block download is in progress | ||||
if (!walletModel || !clientModel || clientModel->inInitialBlockDownload()) { | if (!walletModel || !clientModel || | ||||
clientModel->node().isInitialBlockDownload()) { | |||||
return; | return; | ||||
} | } | ||||
TransactionTableModel *ttm = walletModel->getTransactionTableModel(); | TransactionTableModel *ttm = walletModel->getTransactionTableModel(); | ||||
if (!ttm || ttm->processingQueuedTransactions()) { | if (!ttm || ttm->processingQueuedTransactions()) { | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | void WalletView::backupWallet() { | ||||
QString filename = | QString filename = | ||||
GUIUtil::getSaveFileName(this, tr("Backup Wallet"), QString(), | GUIUtil::getSaveFileName(this, tr("Backup Wallet"), QString(), | ||||
tr("Wallet Data (*.dat)"), nullptr); | tr("Wallet Data (*.dat)"), nullptr); | ||||
if (filename.isEmpty()) { | if (filename.isEmpty()) { | ||||
return; | return; | ||||
} | } | ||||
if (!walletModel->backupWallet(filename)) { | if (!walletModel->wallet().backupWallet(filename.toLocal8Bit().data())) { | ||||
Q_EMIT message( | Q_EMIT message( | ||||
tr("Backup Failed"), | tr("Backup Failed"), | ||||
tr("There was an error trying to save the wallet data to %1.") | tr("There was an error trying to save the wallet data to %1.") | ||||
.arg(filename), | .arg(filename), | ||||
CClientUIInterface::MSG_ERROR); | CClientUIInterface::MSG_ERROR); | ||||
} else { | } else { | ||||
Q_EMIT message( | Q_EMIT message( | ||||
tr("Backup Successful"), | tr("Backup Successful"), | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |