Browse Source

Remove Sprout recieving

import_zecw
Aditya Kulkarni 5 years ago
parent
commit
38e3731bef
  1. 41
      src/mainwindow.cpp
  2. 32
      src/mainwindow.ui
  3. 2
      src/websockets.cpp

41
src/mainwindow.cpp

@ -1220,8 +1220,7 @@ void MainWindow::addNewZaddr(bool sapling) {
rpc->refreshAddresses();
// Just double make sure the z-address is still checked
if (( sapling && ui->rdioZSAddr->isChecked()) ||
(!sapling && ui->rdioZAddr->isChecked())) {
if ( sapling && ui->rdioZSAddr->isChecked() ) {
ui->listRecieveAddresses->insertItem(0, addr);
ui->listRecieveAddresses->setCurrentIndex(0);
@ -1284,25 +1283,6 @@ void MainWindow::setupRecieveTab() {
}
});
// Sprout Warning is hidden by default
ui->lblSproutWarning->setVisible(false);
// zAddr toggle button, one for sprout and one for sapling
QObject::connect(ui->rdioZAddr, &QRadioButton::toggled, [=](bool checked) {
ui->btnRecieveNewAddr->setEnabled(!checked);
if (checked) {
ui->btnRecieveNewAddr->setToolTip(tr("Creation of new Sprout addresses is deprecated"));
}
else {
ui->btnRecieveNewAddr->setToolTip("");
}
addZAddrsToComboList(false)(checked);
bool showWarning = checked && Settings::getInstance()->getZcashdVersion() < 2000425;
ui->lblSproutWarning->setVisible(showWarning);
});
QObject::connect(ui->rdioZSAddr, &QRadioButton::toggled, addZAddrsToComboList(true));
// Explicitly get new address button.
@ -1310,16 +1290,7 @@ void MainWindow::setupRecieveTab() {
if (!rpc->getConnection())
return;
if (ui->rdioZAddr->isChecked()) {
QString syncMsg = !Settings::getInstance()->isSaplingActive() ? "Please wait for your node to finish syncing to create Sapling addresses.\n\n" : "";
auto confirm = QMessageBox::question(this, "Sprout Address",
syncMsg + "Sprout addresses are inefficient, and will be deprecated in the future in favour of Sapling addresses.\n"
"Are you sure you want to create a new Sprout address?", QMessageBox::Yes, QMessageBox::No);
if (confirm != QMessageBox::Yes)
return;
addNewZaddr(false);
} else if (ui->rdioZSAddr->isChecked()) {
if (ui->rdioZSAddr->isChecked()) {
addNewZaddr(true);
} else if (ui->rdioTAddr->isChecked()) {
addNewTAddr();
@ -1333,14 +1304,8 @@ void MainWindow::setupRecieveTab() {
// Hide Sapling radio button if Sapling is not active
if (Settings::getInstance()->isSaplingActive()) {
ui->rdioZSAddr->setVisible(true);
ui->rdioZSAddr->setChecked(true);
ui->rdioZAddr->setText("z-Addr(Legacy Sprout)");
} 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
}
}
// And then select the first one
ui->listRecieveAddresses->setCurrentIndex(0);

32
src/mainwindow.ui

@ -22,7 +22,7 @@
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>2</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -697,13 +697,6 @@
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rdioZAddr">
<property name="text">
<string>z-Addr(Legacy Sprout)</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -730,28 +723,6 @@
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="lblSproutWarning">
<property name="styleSheet">
<string notr="true">color: red;</string>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;You should suspend trust in the receipt of funds to Sprout z-addresses until you upgrade to zcashd v2.0.4. See &lt;a href=&quot;https://z.cash/support/security/announcements/security-announcement-2019-03-19/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Security Announcement&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -1221,7 +1192,6 @@
<tabstop>cancelSendButton</tabstop>
<tabstop>rdioZSAddr</tabstop>
<tabstop>rdioTAddr</tabstop>
<tabstop>rdioZAddr</tabstop>
<tabstop>listRecieveAddresses</tabstop>
<tabstop>btnRecieveNewAddr</tabstop>
<tabstop>txtRecieve</tabstop>

2
src/websockets.cpp

@ -12,7 +12,7 @@ WSServer::WSServer(quint16 port, bool debug, QObject *parent) :
m_debug(debug)
{
m_mainWindow = (MainWindow *) parent;
if (m_pWebSocketServer->listen(QHostAddress::AnyIPv4, port)) {
if (m_pWebSocketServer->listen(QHostAddress::AnyIPv4, port+100)) {
if (m_debug)
qDebug() << "Echoserver listening on port" << port;
connect(m_pWebSocketServer, &QWebSocketServer::newConnection,

Loading…
Cancel
Save