diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 5c7982c..51625e0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -108,11 +108,10 @@ MainWindow::MainWindow(QWidget *parent) : // Set up exit action QObject::connect(ui->actionExit, &QAction::triggered, this, &MainWindow::close); - // Set up Feedback action - //QObject::connect(ui->actionDonate, &QAction::triggered, this, &MainWindow::donate); - + // Telegram QObject::connect(ui->actionTelegram, &QAction::triggered, this, &MainWindow::telegram); + // Website QObject::connect(ui->actionWebsite, &QAction::triggered, this, &MainWindow::website); // File a bug @@ -919,60 +918,48 @@ void MainWindow::website() { QDesktopServices::openUrl(QUrl(url)); } +void MainWindow::doImport(QList* keys) { + if (rpc->getConnection() == nullptr) { + // No connection, just return + return; + } -void MainWindow::donate() { - ui->Address1->setText(Settings::getDonationAddr()); - ui->Address1->setCursorPosition(0); - ui->Amount1->setText("0.00"); - ui->MemoTxt1->setText(tr("Some feedback about SilentDragonlite or Hush...")); - ui->statusBar->showMessage(tr("Send some private and shielded feedback about") % Settings::getTokenName() % tr(" or SilentDragonLite")); - - // And switch to the send tab. - ui->tabWidget->setCurrentIndex(1); -} - - void MainWindow::doImport(QList* keys) { - if (rpc->getConnection() == nullptr) { - // No connection, just return - return; - } - - if (keys->isEmpty()) { - delete keys; - ui->statusBar->showMessage(tr("Private key import rescan in progress. Your funds will be shielded into this wallet and backed up by your seed phrase. This will take some time")); + if (keys->isEmpty()) { + delete keys; + ui->statusBar->showMessage(tr("Private key import rescan in progress. Your funds will be shielded into this wallet and backed up by your seed phrase. This will take some time")); return; - } + } - // Pop the first key - QString key = keys->first(); - QString key1 = key + QString(" ") + QString("0"); - keys->pop_front(); - //bool rescan = keys->isEmpty(); - - if (key.startsWith("SK") || key.startsWith("secret")) { - rpc->importZPrivKey(key, [=] (auto) { this->doImport(keys); }); - } else if (key.startsWith("U") || key.startsWith("5") || key.startsWith("L") || key.startsWith("K")) { - // 5 = uncompressed, len=51 - // LK= compressed, len=52 - // TODO: verify exact length of (un)compressed - if(key.length() > 52) { - QMessageBox::critical(this, tr("Wrong Private key format"), - tr("That private key is too long. It should be 51 or 52 characters.") + "\n"); - return; - } - - if(key.length() < 51) { - QMessageBox::critical(this, tr("Wrong Private key format"), - tr("That private key is too short. It should be 51 or 52 characters.") + "\n"); - return; - } - rpc->importTPrivKey(key, [=] (auto) { this->doImport(keys); }); - }else{ - QMessageBox::critical(this, tr("Wrong Privatkey format"), - tr("Privatkey should start with 5, K, L or U (for taddr) or secret- (for zaddr)") + "\n"); + // Pop the first key + QString key = keys->first(); + QString key1 = key + QString(" ") + QString("0"); + keys->pop_front(); + //bool rescan = keys->isEmpty(); + + if (key.startsWith("SK") || key.startsWith("secret")) { + rpc->importZPrivKey(key, [=] (auto) { this->doImport(keys); }); + } else if (key.startsWith("U") || key.startsWith("5") || key.startsWith("L") || key.startsWith("K")) { + // 5 = uncompressed, len=51 + // LK= compressed, len=52 + // TODO: verify exact length of (un)compressed + if(key.length() > 52) { + QMessageBox::critical(this, tr("Wrong Private key format"), + tr("That private key is too long. It should be 51 or 52 characters.") + "\n"); + return; + } + + if(key.length() < 51) { + QMessageBox::critical(this, tr("Wrong Private key format"), + tr("That private key is too short. It should be 51 or 52 characters.") + "\n"); + return; + } + rpc->importTPrivKey(key, [=] (auto) { this->doImport(keys); }); + }else{ + QMessageBox::critical(this, tr("Wrong Privatkey format"), + tr("Privatkey should start with 5, K, L or U (for taddr) or secret- (for zaddr)") + "\n"); return; } - } +} // Callback invoked when the RPC has finished loading all the balances, and the UI // is now ready to send transactions. diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 7db1cd8..7925a7f 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -59,7 +59,7 @@ - 3 + 0 @@ -1931,7 +1931,6 @@ &Help - diff --git a/src/settings.cpp b/src/settings.cpp index 72c901c..108e82d 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -362,14 +362,6 @@ QString Settings::getTokenName() { } } -QString Settings::getDonationAddr() { - if (Settings::getInstance()->isTestnet()) - return "ztestsaplingXXX"; - else - return "zs1fq9f7vg797qaeac9lyx0njyjmjg4w7m60hwq6lhyhvdcqltl5hdkm8vwx9cxy60ehuuz2x49jxt"; - -} - CAmount Settings::getMinerFee() { return CAmount::fromqint64(10000); }