Fix typos and cleanup

This commit is contained in:
Dimitris Apostolou
2018-11-04 22:38:52 +02:00
committed by GitHub
parent 416217e215
commit 0530212b21
8 changed files with 35 additions and 35 deletions

View File

@@ -344,7 +344,7 @@ void MainWindow::setupSettingsModal() {
// Setup clear button
QObject::connect(settings.btnClearSaved, &QCheckBox::clicked, [=]() {
if (QMessageBox::warning(this, "Clear saved history?",
"Shielded z-Address transactions are stored locally in your wallet, outside zcashd. You may delete this saved information safely any time for your privacy.\nDo you want to delete the saved shielded transactions now ?",
"Shielded z-Address transactions are stored locally in your wallet, outside zcashd. You may delete this saved information safely any time for your privacy.\nDo you want to delete the saved shielded transactions now?",
QMessageBox::Yes, QMessageBox::Cancel)) {
SentTxStore::deleteHistory();
// Reload after the clear button so existing txs disappear
@@ -640,10 +640,10 @@ void MainWindow::setupTransactionsTab() {
void MainWindow::addNewZaddr(bool sapling) {
rpc->newZaddr(sapling, [=] (json reply) {
QString addr = QString::fromStdString(reply.get<json::string_t>());
// Make sure the RPC class reloads the Z-addrs for future use
// Make sure the RPC class reloads the z-addrs for future use
rpc->refreshAddresses();
// Just double make sure the Z-address is still checked
// Just double make sure the z-address is still checked
if (( sapling && ui->rdioZSAddr->isChecked()) ||
(!sapling && ui->rdioZAddr->isChecked())) {
ui->listRecieveAddresses->insertItem(0, addr);
@@ -684,7 +684,7 @@ void MainWindow::setupRecieveTab() {
rpc->newTaddr([=] (json reply) {
QString addr = QString::fromStdString(reply.get<json::string_t>());
// Just double make sure the T-address is still checked
// Just double make sure the t-address is still checked
if (ui->rdioTAddr->isChecked()) {
ui->listRecieveAddresses->insertItem(0, addr);
ui->listRecieveAddresses->setCurrentIndex(0);
@@ -696,8 +696,8 @@ void MainWindow::setupRecieveTab() {
// Connect t-addr radio button
QObject::connect(ui->rdioTAddr, &QRadioButton::toggled, [=] (bool checked) {
// Whenever the T-address is selected, we generate a new address, because we don't
// want to reuse T-addrs
// Whenever the t-address is selected, we generate a new address, because we don't
// want to reuse t-addrs
if (checked && this->rpc->getUTXOs() != nullptr) {
auto utxos = this->rpc->getUTXOs();
ui->listRecieveAddresses->clear();
@@ -729,12 +729,12 @@ void MainWindow::setupRecieveTab() {
}
});
// Focus enter for the Recieve Tab
// Focus enter for the Receive Tab
QObject::connect(ui->tabWidget, &QTabWidget::currentChanged, [=] (int tab) {
if (tab == 2) {
// Switched to recieve tab, so update everything.
// Switched to receive tab, so update everything.
// Hide Sapling radio button if sapling is not active
// Hide Sapling radio button if Sapling is not active
if (Settings::getInstance()->isSaplingActive()) {
ui->rdioZSAddr->setVisible(true);
ui->rdioZSAddr->setChecked(true);
@@ -742,7 +742,7 @@ void MainWindow::setupRecieveTab() {
} else {
ui->rdioZSAddr->setVisible(false);
ui->rdioZAddr->setChecked(true);
ui->rdioZAddr->setText("z-Addr"); // Don't use the "Sprout" label if there's no sapling
ui->rdioZAddr->setText("z-Addr"); // Don't use the "Sprout" label if there's no Sapling
}
// And then select the first one

View File

@@ -212,7 +212,7 @@ void RPC::getAllPrivKeys(const std::function<void(QList<QPair<QString, QString>>
// A special function that will call the callback when two lists have been added
auto holder = new QPair<int, QList<QPair<QString, QString>>>();
holder->first = 0; // This is the number of times the callback has been called, initalized to 0
holder->first = 0; // This is the number of times the callback has been called, initialized to 0
auto fnCombineTwoLists = [=] (QList<QPair<QString, QString>> list) {
// Increment the callback counter
holder->first++;
@@ -269,7 +269,7 @@ void RPC::getAllPrivKeys(const std::function<void(QList<QPair<QString, QString>>
};
// First get all the T and Z addresses.
// First get all the t and z addresses.
json payloadT = {
{"jsonrpc", "1.0"},
{"id", "someid"},
@@ -699,7 +699,7 @@ void RPC::watchTxStatus() {
conn->doRPCWithDefaultErrorHandling(payload, [=] (const json& reply) {
// There's an array for each item in the status
for (auto& it : reply.get<json::array_t>()) {
// If we were watching this Tx and it's status became "success", then we'll show a status bar alert
// If we were watching this Tx and its status became "success", then we'll show a status bar alert
QString id = QString::fromStdString(it["id"]);
if (watchingOps.contains(id)) {
// And if it ended up successful
@@ -755,7 +755,7 @@ void RPC::watchTxStatus() {
// Get the ZEC->USD price from coinmarketcap using their API
void RPC::refreshZECPrice() {
qDebug() << QString::fromStdString("Getting zec price");
qDebug() << QString::fromStdString("Getting ZEC price");
if (conn == nullptr)
return noConnection();

View File

@@ -27,7 +27,7 @@ echo "Linux"
echo -n "Configuring..."
$QT_STATIC/bin/qmake zec-qt-wallet.pro -spec linux-clang CONFIG+=release > /dev/null
#Mingw seems to have trouble with precompiled heades, so strip that option from the .pro file
#Mingw seems to have trouble with precompiled headers, so strip that option from the .pro file
echo "[OK]"

View File

@@ -217,7 +217,7 @@ void MainWindow::setMemoEnabled(int number, bool enabled) {
memoBtn->setToolTip("");
} else {
memoBtn->setEnabled(false);
memoBtn->setToolTip("Only Z addresses can have memos");
memoBtn->setToolTip("Only z-addresses can have memos");
}
}
@@ -225,8 +225,8 @@ void MainWindow::memoButtonClicked(int number) {
// Memos can only be used with zAddrs. So check that first
auto addr = ui->sendToWidgets->findChild<QLineEdit*>(QString("Address") + QString::number(number));
if (!addr->text().trimmed().startsWith("z")) {
QMessageBox msg(QMessageBox::Critical, "Memos can only be used with z Addresses",
"The Memo field can only be used with a z Address.\n" + addr->text() + "\ndoesn't look like a z Address",
QMessageBox msg(QMessageBox::Critical, "Memos can only be used with z-addresses",
"The memo field can only be used with a z-address.\n" + addr->text() + "\ndoesn't look like a z-address",
QMessageBox::Ok, this);
msg.exec();
@@ -261,7 +261,7 @@ void MainWindow::removeExtraAddresses() {
// The last one is a spacer, so ignore that
int totalItems = ui->sendToWidgets->children().size() - 2;
// Clear the first recepient fields
// Clear the first recipient fields
auto addr = ui->sendToWidgets->findChild<QLineEdit*>(QString("Address1"));
addr->clear();
auto amt = ui->sendToWidgets->findChild<QLineEdit*>(QString("Amount1"));
@@ -511,7 +511,7 @@ void MainWindow::sendButton() {
}
QString MainWindow::doSendTxValidations(Tx tx) {
// 1. Addresses are valid format.
// 1. Addresses have valid format.
QRegExp zcexp("^z[a-z0-9]{94}$", Qt::CaseInsensitive);
QRegExp zsexp("^z[a-z0-9]{77}$", Qt::CaseInsensitive);
QRegExp ztsexp("^ztestsapling[a-z0-9]{76}", Qt::CaseInsensitive);

View File

@@ -54,7 +54,7 @@ void SentTxStore::addToSentTx(Tx tx, QString txid) {
if (!Settings::getInstance()->getSaveZtxs())
return;
// Also, only store outgoing Txs where the from address is a z-Addr. Else, regular zcashd
// Also, only store outgoing txs where the from address is a z-Addr. Else, regular zcashd
// stores it just fine
if (!tx.fromAddr.startsWith("z"))
return;
@@ -101,4 +101,4 @@ void SentTxStore::addToSentTx(Tx tx, QString txid) {
writer.write(jsonDoc.toJson());
}
writer.close();
}
}

View File

@@ -90,7 +90,7 @@ void Turnstile::planMigration(QString zaddr, QString destAddr, int numsplits, in
auto bal = rpc->getAllBalances()->value(zaddr);
auto splits = splitAmount(bal, numsplits);
// Then, generate an intermediate t-Address for each part using getBatchRPC
// Then, generate an intermediate t-address for each part using getBatchRPC
rpc->getConnection()->doBatchRPC<double>(splits,
[=] (double /*unused*/) {
json payload = {
@@ -186,7 +186,7 @@ void Turnstile::fillAmounts(QList<double>& amounts, double amount, int count) {
}
// Get a random amount off the amount (between half and full) and call recursively.
// Multiply by hundered, because we'll operate on 0.01 ZEC minimum. We'll divide by 100 later
// Multiply by hundred, because we'll operate on 0.01 ZEC minimum. We'll divide by 100 later
double curAmount = std::rand() % (int)std::floor(amount * 100);
// Try to round it off
@@ -319,14 +319,14 @@ void Turnstile::executeMigrationStep() {
} else if (nextStep->status == TurnstileMigrationItemStatus::SentToT) {
// First thing to do is check to see if the funds are confirmed.
// We'll check both the original sprout address and the intermediate T addr for safety.
// We'll check both the original sprout address and the intermediate t-addr for safety.
if (fnHasUnconfirmed(nextStep->intTAddr) || fnHasUnconfirmed(nextStep->fromAddr)) {
//qDebug() << QString("unconfirmed, waiting");
return;
}
if (!rpc->getAllBalances()->keys().contains(nextStep->intTAddr)) {
qDebug() << QString("The intermediate Taddress doesn't have balance, even though it is confirmed");
qDebug() << QString("The intermediate t-address doesn't have balance, even though it is confirmed");
return;
}
@@ -369,4 +369,4 @@ void Turnstile::doSendTx(Tx tx, std::function<void(void)> cb) {
cb();
});
}
}

View File

@@ -47,7 +47,7 @@ const QString Utils::getDevAddr(Tx tx) {
return devAddr;
}
// t-Addr, find if it is going to a sprout or sapling address
// t-Addr, find if it is going to a Sprout or Sapling address
for (const ToFields& to : tx.toAddrs) {
devAddr = testnetAddrLookup(to.addr);
if (!devAddr.isEmpty()) {
@@ -55,7 +55,7 @@ const QString Utils::getDevAddr(Tx tx) {
}
}
// If this is a t-Addr -> t-Addr transaction, use the sapling address by default
// If this is a t-Addr -> t-Addr transaction, use the Sapling address by default
return testnetAddrLookup("ztestsapling");
} else {
// Mainnet doesn't have a fee yet!
@@ -74,4 +74,4 @@ double Utils::getDevFee() {
return 0;
}
}
double Utils::getTotalFee() { return getMinerFee() + getDevFee(); }
double Utils::getTotalFee() { return getMinerFee() + getDevFee(); }