Add rescan to UI
This commit is contained in:
6
lib/Cargo.lock
generated
6
lib/Cargo.lock
generated
@@ -1051,7 +1051,7 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"zecwalletlitelib 0.1.0 (git+https://github.com/adityapk00/zecwallet-light-cli?rev=96997c5a467b710286bc9c6fea818b9d7d76f254)",
|
"zecwalletlitelib 0.1.0 (git+https://github.com/adityapk00/zecwallet-light-cli?rev=165c22e39e5b43d417f8719edcf91b07c15906bf)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -2266,7 +2266,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "zecwalletlitelib"
|
name = "zecwalletlitelib"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/adityapk00/zecwallet-light-cli?rev=96997c5a467b710286bc9c6fea818b9d7d76f254#96997c5a467b710286bc9c6fea818b9d7d76f254"
|
source = "git+https://github.com/adityapk00/zecwallet-light-cli?rev=165c22e39e5b43d417f8719edcf91b07c15906bf#165c22e39e5b43d417f8719edcf91b07c15906bf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"bellman 0.1.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)",
|
"bellman 0.1.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)",
|
||||||
@@ -2562,4 +2562,4 @@ dependencies = [
|
|||||||
"checksum zcash_client_backend 0.0.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)" = "<none>"
|
"checksum zcash_client_backend 0.0.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)" = "<none>"
|
||||||
"checksum zcash_primitives 0.0.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)" = "<none>"
|
"checksum zcash_primitives 0.0.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)" = "<none>"
|
||||||
"checksum zcash_proofs 0.0.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)" = "<none>"
|
"checksum zcash_proofs 0.0.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)" = "<none>"
|
||||||
"checksum zecwalletlitelib 0.1.0 (git+https://github.com/adityapk00/zecwallet-light-cli?rev=96997c5a467b710286bc9c6fea818b9d7d76f254)" = "<none>"
|
"checksum zecwalletlitelib 0.1.0 (git+https://github.com/adityapk00/zecwallet-light-cli?rev=165c22e39e5b43d417f8719edcf91b07c15906bf)" = "<none>"
|
||||||
|
|||||||
@@ -11,4 +11,4 @@ crate-type = ["staticlib"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2.58"
|
libc = "0.2.58"
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
zecwalletlitelib = { git = "https://github.com/adityapk00/zecwallet-light-cli", rev = "96997c5a467b710286bc9c6fea818b9d7d76f254" }
|
zecwalletlitelib = { git = "https://github.com/adityapk00/zecwallet-light-cli", rev = "165c22e39e5b43d417f8719edcf91b07c15906bf" }
|
||||||
|
|||||||
@@ -139,7 +139,6 @@ Connection* ConnectionLoader::makeConnection(std::shared_ptr<ConnectionConfig> c
|
|||||||
|
|
||||||
// Update the UI with the status
|
// Update the UI with the status
|
||||||
void ConnectionLoader::showInformation(QString info, QString detail) {
|
void ConnectionLoader::showInformation(QString info, QString detail) {
|
||||||
qDebug() << "Showing info " << info << ":" << detail;
|
|
||||||
connD->status->setText(info);
|
connD->status->setText(info);
|
||||||
connD->statusDetail->setText(detail);
|
connD->statusDetail->setText(detail);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ public:
|
|||||||
|
|
||||||
void saveWallet(const std::function<void(json)>& cb) { zrpc->saveWallet(cb); }
|
void saveWallet(const std::function<void(json)>& cb) { zrpc->saveWallet(cb); }
|
||||||
|
|
||||||
|
void clearWallet(const std::function<void(json)>& cb) { zrpc->clearWallet(cb); }
|
||||||
|
|
||||||
void createNewZaddr(bool sapling, const std::function<void(json)>& cb) {
|
void createNewZaddr(bool sapling, const std::function<void(json)>& cb) {
|
||||||
unlockIfEncrypted([=] () {
|
unlockIfEncrypted([=] () {
|
||||||
zrpc->createNewZaddr(sapling, cb);
|
zrpc->createNewZaddr(sapling, cb);
|
||||||
|
|||||||
@@ -84,6 +84,13 @@ void LiteInterface::saveWallet(const std::function<void(json)>& cb) {
|
|||||||
conn->doRPCWithDefaultErrorHandling("save", "", cb);
|
conn->doRPCWithDefaultErrorHandling("save", "", cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LiteInterface::clearWallet(const std::function<void(json)>& cb) {
|
||||||
|
if (conn == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
conn->doRPCWithDefaultErrorHandling("clear", "", cb);
|
||||||
|
}
|
||||||
|
|
||||||
void LiteInterface::unlockWallet(QString password, const std::function<void(json)>& cb) {
|
void LiteInterface::unlockWallet(QString password, const std::function<void(json)>& cb) {
|
||||||
if (conn == nullptr)
|
if (conn == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ public:
|
|||||||
void fetchSeed(const std::function<void(json)>&);
|
void fetchSeed(const std::function<void(json)>&);
|
||||||
|
|
||||||
void saveWallet(const std::function<void(json)>& cb);
|
void saveWallet(const std::function<void(json)>& cb);
|
||||||
|
void clearWallet(const std::function<void(json)>& cb);
|
||||||
|
|
||||||
void fetchWalletEncryptionStatus(const std::function<void(json)>& cb);
|
void fetchWalletEncryptionStatus(const std::function<void(json)>& cb);
|
||||||
void encryptWallet(QString password, const std::function<void(json)>& cb);
|
void encryptWallet(QString password, const std::function<void(json)>& cb);
|
||||||
|
|||||||
@@ -105,6 +105,20 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
AppDataServer::getInstance()->connectAppDialog(this);
|
AppDataServer::getInstance()->connectAppDialog(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Rescan
|
||||||
|
QObject::connect(ui->actionRescan, &QAction::triggered, [=]() {
|
||||||
|
// To rescan, we clear the wallet state, and then reload the connection
|
||||||
|
// This will start a sync, and show the scanning status.
|
||||||
|
getRPC()->clearWallet([=] (auto) {
|
||||||
|
// Save the wallet
|
||||||
|
getRPC()->saveWallet([=] (auto) {
|
||||||
|
// Then reload the connection. The ConnectionLoader deletes itself.
|
||||||
|
auto cl = new ConnectionLoader(this, rpc);
|
||||||
|
cl->loadConnection();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Address Book
|
// Address Book
|
||||||
QObject::connect(ui->action_Address_Book, &QAction::triggered, this, &MainWindow::addressBook);
|
QObject::connect(ui->action_Address_Book, &QAction::triggered, this, &MainWindow::addressBook);
|
||||||
|
|
||||||
@@ -419,12 +433,6 @@ void MainWindow::setupSettingsModal() {
|
|||||||
// Connection tab by default
|
// Connection tab by default
|
||||||
settings.tabWidget->setCurrentIndex(0);
|
settings.tabWidget->setCurrentIndex(0);
|
||||||
|
|
||||||
// Enable the troubleshooting options only if using embedded zcashd
|
|
||||||
if (!rpc->isEmbedded()) {
|
|
||||||
settings.chkRescan->setEnabled(false);
|
|
||||||
settings.chkRescan->setToolTip(tr("You're using an external zcashd. Please restart zcashd with -rescan"));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (settingsDialog.exec() == QDialog::Accepted) {
|
if (settingsDialog.exec() == QDialog::Accepted) {
|
||||||
// Check for updates
|
// Check for updates
|
||||||
Settings::getInstance()->setCheckForUpdates(settings.chkCheckUpdates->isChecked());
|
Settings::getInstance()->setCheckForUpdates(settings.chkCheckUpdates->isChecked());
|
||||||
@@ -445,7 +453,7 @@ void MainWindow::setupSettingsModal() {
|
|||||||
|
|
||||||
// Save the wallet
|
// Save the wallet
|
||||||
getRPC()->saveWallet([=] (auto) {
|
getRPC()->saveWallet([=] (auto) {
|
||||||
// Then reload the connection
|
// Then reload the connection. The ConnectionLoader deletes itself.
|
||||||
auto cl = new ConnectionLoader(this, rpc);
|
auto cl = new ConnectionLoader(this, rpc);
|
||||||
cl->loadConnection();
|
cl->loadConnection();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -392,8 +392,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1226</width>
|
<width>1162</width>
|
||||||
<height>504</height>
|
<height>344</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="sendToLayout">
|
<layout class="QVBoxLayout" name="sendToLayout">
|
||||||
@@ -1088,7 +1088,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1274</width>
|
<width>1274</width>
|
||||||
<height>22</height>
|
<height>39</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="menuFile">
|
<widget class="QMenu" name="menuFile">
|
||||||
@@ -1130,6 +1130,8 @@
|
|||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="actionEncrypt_Wallet"/>
|
<addaction name="actionEncrypt_Wallet"/>
|
||||||
<addaction name="actionRemove_Wallet_Encryption"/>
|
<addaction name="actionRemove_Wallet_Encryption"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionRescan"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menuFile"/>
|
<addaction name="menuFile"/>
|
||||||
<addaction name="menu_Edit"/>
|
<addaction name="menu_Edit"/>
|
||||||
@@ -1226,6 +1228,11 @@
|
|||||||
<string>Remove Wallet Encryption</string>
|
<string>Remove Wallet Encryption</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionRescan">
|
||||||
|
<property name="text">
|
||||||
|
<string>Rescan</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>540</width>
|
<width>733</width>
|
||||||
<height>539</height>
|
<height>539</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@@ -183,50 +183,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_3">
|
|
||||||
<attribute name="title">
|
|
||||||
<string>Troubleshooting</string>
|
|
||||||
</attribute>
|
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
|
||||||
<item row="5" column="0">
|
|
||||||
<spacer name="verticalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="Line" name="line_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_9">
|
|
||||||
<property name="text">
|
|
||||||
<string>Rescan the blockchain for any missing wallet transactions and to correct your wallet balance. This may take several hours. You need to restart ZecWallet for this to take effect</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QCheckBox" name="chkRescan">
|
|
||||||
<property name="text">
|
|
||||||
<string>Rescan</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|||||||
Reference in New Issue
Block a user