Browse Source

Merge branch 'master' of github.com:ZcashFoundation/zecwallet

Aditya Kulkarni 5 years ago
parent
commit
97deadb72a
  1. 31
      .github/ISSUE_TEMPLATE/issue_template.md
  2. 4
      src/connection.cpp
  3. 48
      src/createzcashconfdialog.ui
  4. 17
      src/mainwindow.cpp
  5. 12
      src/mainwindow.ui
  6. 13
      src/rpc.cpp
  7. 3
      src/sendtab.cpp
  8. 16
      src/settings.cpp
  9. 6
      src/settings.h
  10. 132
      src/settings.ui

31
.github/ISSUE_TEMPLATE/issue_template.md

@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
Please make sure you have the latest ZecWallet.
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

4
src/connection.cpp

@ -168,6 +168,10 @@ void ConnectionLoader::createZcashConf() {
if (d.exec() == QDialog::Accepted) {
datadir = ui.lblDirName->text();
useTor = ui.chkUseTor->isChecked();
if (!ui.chkAllowInternet->isChecked()) {
Settings::getInstance()->setAllowFetchPrices(false);
Settings::getInstance()->setCheckForUpdates(false);
}
}
main->logger->write("Creating file " + confLocation);

48
src/createzcashconfdialog.ui

@ -99,17 +99,24 @@
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QCheckBox" name="chkCustomDatadir">
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Use custom datadir</string>
<string notr="true"/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<item row="5" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Please choose a directory to store your wallet.dat and blockchain</string>
<string>Allow connections to the internet to check for updates, get ZEC/USD prices etc...</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="chkCustomDatadir">
<property name="text">
<string>Use custom datadir</string>
</property>
</widget>
</item>
@ -144,24 +151,41 @@
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<item row="8" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string notr="true"/>
<string>Please note that you'll need to already have a Tor service configured on port 9050</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="chkAllowInternet">
<property name="text">
<string>Connect to the internet for updates and price feeds</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Please choose a directory to store your wallet.dat and blockchain</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QCheckBox" name="chkUseTor">
<property name="text">
<string>Connect over Tor</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_5">
<item row="6" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Please note that you'll need to already have a Tor service configured on port 9050</string>
<string/>
</property>
</widget>
</item>

17
src/mainwindow.cpp

@ -40,6 +40,11 @@ MainWindow::MainWindow(QWidget *parent) :
// Set up donate action
QObject::connect(ui->actionDonate, &QAction::triggered, this, &MainWindow::donate);
// File a bug
QObject::connect(ui->actionFile_a_bug, &QAction::triggered, [=]() {
QDesktopServices::openUrl(QUrl("https://github.com/zcashfoundation/zecwallet/issues/new"));
});
// Set up check for updates action
QObject::connect(ui->actionCheck_for_Updates, &QAction::triggered, [=] () {
// Silent is false, so show notification even if no update was found
@ -475,6 +480,12 @@ void MainWindow::setupSettingsModal() {
// Auto shielding
settings.chkAutoShield->setChecked(Settings::getInstance()->getAutoShield());
// Check for updates
settings.chkCheckUpdates->setChecked(Settings::getInstance()->getCheckForUpdates());
// Fetch prices
settings.chkFetchPrices->setChecked(Settings::getInstance()->getAllowFetchPrices());
// Use Tor
bool isUsingTor = false;
if (rpc->getConnection() != nullptr) {
@ -540,6 +551,12 @@ void MainWindow::setupSettingsModal() {
// Auto shield
Settings::getInstance()->setAutoShield(settings.chkAutoShield->isChecked());
// Check for updates
Settings::getInstance()->setCheckForUpdates(settings.chkCheckUpdates->isChecked());
// Allow fetching prices
Settings::getInstance()->setAllowFetchPrices(settings.chkFetchPrices->isChecked());
if (!isUsingTor && settings.chkTor->isChecked()) {
// If "use tor" was previously unchecked and now checked
Settings::addToZcashConf(zcashConfLocation, "proxy=127.0.0.1:9050");

12
src/mainwindow.ui

@ -359,8 +359,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>928</width>
<height>353</height>
<width>920</width>
<height>324</height>
</rect>
</property>
<layout class="QVBoxLayout" name="sendToLayout">
@ -1045,7 +1045,7 @@
<x>0</x>
<y>0</y>
<width>968</width>
<height>19</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@ -1069,6 +1069,7 @@
</property>
<addaction name="actionDonate"/>
<addaction name="actionCheck_for_Updates"/>
<addaction name="actionFile_a_bug"/>
<addaction name="actionAbout"/>
</widget>
<widget class="QMenu" name="menuApps">
@ -1189,6 +1190,11 @@
<string>Request zcash...</string>
</property>
</action>
<action name="actionFile_a_bug">
<property name="text">
<string>File a bug...</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>

13
src/rpc.cpp

@ -32,7 +32,8 @@ RPC::RPC(MainWindow* main) {
// Set up timer to refresh Price
priceTimer = new QTimer(main);
QObject::connect(priceTimer, &QTimer::timeout, [=]() {
refreshZECPrice();
if (Settings::getInstance()->getAllowFetchPrices())
refreshZECPrice();
});
priceTimer->start(Settings::priceRefreshSpeed); // Every hour
@ -96,9 +97,13 @@ void RPC::setConnection(Connection* c) {
Settings::removeFromZcashConf(zcashConfLocation, "rescan");
Settings::removeFromZcashConf(zcashConfLocation, "reindex");
// Refresh the UI
refreshZECPrice();
checkForUpdate();
// If we're allowed to get the Zec Price, get the prices
if (Settings::getInstance()->getAllowFetchPrices())
refreshZECPrice();
// If we're allowed to check for updates, check for a new release
if (Settings::getInstance()->getCheckForUpdates())
checkForUpdate();
// Force update, because this might be coming from a settings update
// where we need to immediately refresh

3
src/sendtab.cpp

@ -107,8 +107,11 @@ void MainWindow::setupSendTab() {
void MainWindow::disableRecurring() {
if (!Settings::getInstance()->isTestnet()) {
ui->chkRecurring->setVisible(false);
ui->chkRecurring->setEnabled(false);
ui->btnRecurSchedule->setVisible(false);
ui->btnRecurSchedule->setEnabled(false);
ui->action_Recurring_Payments->setVisible(false);
}
}

16
src/settings.cpp

@ -124,6 +124,22 @@ void Settings::setAutoShield(bool allow) {
QSettings().setValue("options/autoshield", allow);
}
bool Settings::getCheckForUpdates() {
return QSettings().value("options/allowcheckupdates", true).toBool();
}
void Settings::setCheckForUpdates(bool allow) {
QSettings().setValue("options/allowcheckupdates", allow);
}
bool Settings::getAllowFetchPrices() {
return QSettings().value("options/allowfetchprices", true).toBool();
}
void Settings::setAllowFetchPrices(bool allow) {
QSettings().setValue("options/allowfetchprices", allow);
}
bool Settings::getAllowCustomFees() {
// Load from the QT Settings.
return QSettings().value("options/customfees", false).toBool();

6
src/settings.h

@ -60,6 +60,12 @@ public:
bool getAllowCustomFees();
void setAllowCustomFees(bool allow);
bool getAllowFetchPrices();
void setAllowFetchPrices(bool allow);
bool getCheckForUpdates();
void setCheckForUpdates(bool allow);
bool isSaplingActive();

132
src/settings.ui

@ -26,7 +26,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>2</number>
<number>1</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
@ -145,32 +145,18 @@
<string>Options</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="10" column="0" colspan="2">
<widget class="QLabel" name="lblTor">
<property name="text">
<string>Connect to the Tor network via SOCKS proxy running on 127.0.0.1:9050. Please note that you'll have to install and run the Tor service externally.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="btnClearSaved">
<property name="text">
<string>Clear History</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Shielded transactions are saved locally and shown in the transactions tab. If you uncheck this, shielded transactions will not appear in the transactions tab.</string>
<item row="14" column="0" colspan="2">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="wordWrap">
<bool>true</bool>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</widget>
</spacer>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer">
@ -185,21 +171,35 @@
</property>
</spacer>
</item>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="chkSaveTxs">
<item row="7" column="0">
<widget class="QCheckBox" name="chkTor">
<property name="text">
<string>Remember shielded transactions</string>
<string>Connect via Tor</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="chkCustomFees">
<item row="9" column="0" colspan="2">
<widget class="QCheckBox" name="chkCheckUpdates">
<property name="text">
<string>Allow custom fees</string>
<string>Check github for updates at startup</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<item row="13" column="0" colspan="2">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="chkSaveTxs">
<property name="text">
<string>Remember shielded transactions</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Normally, change from t-Addresses goes to another t-Address. Checking this option will send the change to your shielded sapling address instead. Check this option to increase your privacy.</string>
@ -209,61 +209,75 @@
</property>
</widget>
</item>
<item row="11" column="0" colspan="2">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Allow overriding the default fees when sending transactions. Enabling this option may compromise your privacy since fees are transparent. </string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="12" column="0" colspan="2">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
<item row="2" column="1">
<widget class="QPushButton" name="btnClearSaved">
<property name="text">
<string>Clear History</string>
</property>
</spacer>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="label_6">
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Allow overriding the default fees when sending transactions. Enabling this option may compromise your privacy since fees are transparent. </string>
<string>Shielded transactions are saved locally and shown in the transactions tab. If you uncheck this, shielded transactions will not appear in the transactions tab.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<item row="3" column="0">
<widget class="QCheckBox" name="chkCustomFees">
<property name="text">
<string>Allow custom fees</string>
</property>
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="chkAutoShield">
<property name="text">
<string>Shield change from t-Addresses to your sapling address</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_8">
<item row="8" column="0" colspan="2">
<widget class="QLabel" name="lblTor">
<property name="text">
<string/>
<string>Connect to the Tor network via SOCKS proxy running on 127.0.0.1:9050. Please note that you'll have to install and run the Tor service externally.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QCheckBox" name="chkTor">
<item row="10" column="0" colspan="2">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Connect via Tor</string>
<string>Connect to github on startup to check for updates</string>
</property>
</widget>
</item>
<item row="8" column="0">
<item row="12" column="0" colspan="2">
<widget class="QLabel" name="label_10">
<property name="text">
<string notr="true"/>
<string>Connect to the internet to fetch ZEC prices</string>
</property>
</widget>
</item>
<item row="11" column="0" colspan="2">
<widget class="QCheckBox" name="chkFetchPrices">
<property name="text">
<string>Fetch ZEC / USD prices</string>
</property>
</widget>
</item>

Loading…
Cancel
Save