diff --git a/lib/Cargo.lock b/lib/Cargo.lock index 2a9ad8f..e32ab35 100644 --- a/lib/Cargo.lock +++ b/lib/Cargo.lock @@ -1051,7 +1051,7 @@ version = "0.1.0" dependencies = [ "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)", - "zecwalletlitelib 0.1.0 (git+https://github.com/adityapk00/zecwallet-light-cli?rev=61dc063fe155d1510e9a074e5a3577a0621f8c3a)", + "zecwalletlitelib 0.1.0 (git+https://github.com/adityapk00/zecwallet-light-cli?rev=96997c5a467b710286bc9c6fea818b9d7d76f254)", ] [[package]] @@ -2266,7 +2266,7 @@ dependencies = [ [[package]] name = "zecwalletlitelib" version = "0.1.0" -source = "git+https://github.com/adityapk00/zecwallet-light-cli?rev=61dc063fe155d1510e9a074e5a3577a0621f8c3a#61dc063fe155d1510e9a074e5a3577a0621f8c3a" +source = "git+https://github.com/adityapk00/zecwallet-light-cli?rev=96997c5a467b710286bc9c6fea818b9d7d76f254#96997c5a467b710286bc9c6fea818b9d7d76f254" dependencies = [ "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)", @@ -2562,4 +2562,4 @@ dependencies = [ "checksum zcash_client_backend 0.0.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)" = "" "checksum zcash_primitives 0.0.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)" = "" "checksum zcash_proofs 0.0.0 (git+https://github.com/adityapk00/librustzcash.git?rev=188537ea025fcb7fbdfc11266f307a084a5451e4)" = "" -"checksum zecwalletlitelib 0.1.0 (git+https://github.com/adityapk00/zecwallet-light-cli?rev=61dc063fe155d1510e9a074e5a3577a0621f8c3a)" = "" +"checksum zecwalletlitelib 0.1.0 (git+https://github.com/adityapk00/zecwallet-light-cli?rev=96997c5a467b710286bc9c6fea818b9d7d76f254)" = "" diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index eafdbac..a85f692 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -408,9 +408,13 @@ void MainWindow::setupSettingsModal() { // Fetch prices settings.chkFetchPrices->setChecked(Settings::getInstance()->getAllowFetchPrices()); + // List of default servers + settings.cmbServer->addItem("https://lightd-main.zecwallet.co:443"); + settings.cmbServer->addItem("https://lightd-main.zcashfr.io:443"); + // Load current values into the dialog auto conf = Settings::getInstance()->getSettings(); - settings.txtServer->setText(conf.server); + settings.cmbServer->setCurrentText(conf.server); // Connection tab by default settings.tabWidget->setCurrentIndex(0); @@ -429,11 +433,15 @@ void MainWindow::setupSettingsModal() { Settings::getInstance()->setAllowFetchPrices(settings.chkFetchPrices->isChecked()); // Save the server - Settings::getInstance()->saveSettings(settings.txtServer->text().trimmed()); + bool reloadConnection = false; + if (conf.server != settings.cmbServer->currentText().trimmed()) { + reloadConnection = true; + } + Settings::getInstance()->saveSettings(settings.cmbServer->currentText().trimmed()); - if (false /* connection needs reloading?*/) { + if (reloadConnection) { // Save settings - Settings::getInstance()->saveSettings(settings.txtServer->text()); + Settings::getInstance()->saveSettings(settings.cmbServer->currentText()); auto cl = new ConnectionLoader(this, rpc); cl->loadConnection(); diff --git a/src/settings.ui b/src/settings.ui index b18879e..4c031c4 100644 --- a/src/settings.ui +++ b/src/settings.ui @@ -10,12 +10,6 @@ 539 - - - 540 - 500 - - Settings @@ -57,14 +51,15 @@ - - - - - - - - + + + + + true + + + +