Merge branch 'master' of github.com:adityapk00/zec-qt-wallet

This commit is contained in:
adityapk00
2018-11-27 20:29:04 -08:00
33 changed files with 3571 additions and 183 deletions

1
.gitignore vendored
View File

@@ -27,3 +27,4 @@ workspace.code-workspace
*.mak *.mak
*.plist *.plist
zcashd zcashd
res/*.qm

169
README.md
View File

@@ -1,81 +1,88 @@
zec-qt-wallet is a z-Addr first, Sapling compatible wallet and full node for zcashd that runs on Linux, Windows and macOS. zec-qt-wallet is a z-Addr first, Sapling compatible wallet and full node for zcashd that runs on Linux, Windows and macOS.
![Screenshot](docs/screenshot-main.png?raw=true) ![Screenshot](docs/screenshot-main.png?raw=true)
![Screenshots](docs/screenshot-sub.png?raw=true) ![Screenshots](docs/screenshot-sub.png?raw=true)
# Installation # Installation
Head over to the releases page and grab the latest binary. https://github.com/adityapk00/zec-qt-wallet/releases Head over to the releases page and grab the latest installers or binary. https://github.com/adityapk00/zec-qt-wallet/releases
### Linux ### Linux
Extract and run the binary.
``` If you are on Debian/Ubuntu, please download the `.deb` package and install it.
tar -xvf zec-qt-wallet-v0.4.3.tar.gz ```
./zec-qt-wallet-v0.4.3/zec-qt-wallet sudo dpkg -i linux-deb-zec-qt-wallet-v0.5.0.deb
``` sudo apt install -f
```
### Windows
Unzip the release binary and double click on zec-qt-wallet to start. Or you can download and run the binaries directly.
```
### macOS tar -xvf zec-qt-wallet-v0.5.0.tar.gz
Double-click on the .dmg file to open it, and drag zec-qt-wallet on to the Applications link to install. ./zec-qt-wallet-v0.5.0/zec-qt-wallet
```
## zcashd
zec-qt-wallet needs a Zcash node running zcashd. If you already have a zcashd node running, zec-qt-wallet will connect to it. ### Windows
Download and run the .msi installer and follow the prompts. Alternately, you can download the release binary, unzip it and double click on zec-qt-wallet to start.
If you don't have one, zec-qt-wallet will start its embedded zcashd node.
### macOS
Additionally, if this is the first time you're running zec-qt-wallet or a zcashd daemon, zec-qt-wallet will download the zcash params (~1.7 GB) and configure `zcash.conf` for you. Double-click on the .dmg file to open it, and drag zec-qt-wallet on to the Applications link to install.
Pass `--no-embedded` to disable the embedded zcashd and force zec-qt-wallet to connect to an external node. ## zcashd
zec-qt-wallet needs a Zcash node running zcashd. If you already have a zcashd node running, zec-qt-wallet will connect to it.
## Compiling from source
zec-qt-wallet is written in C++ 14, and can be compiled with g++/clang++/visual c++. It also depends on Qt5, which you can get from [here](https://www.qt.io/download) If you don't have one, zec-qt-wallet will start its embedded zcashd node.
See detailed build instructions [on the wiki](https://github.com/ZcashFoundation/zec-qt-wallet/wiki/Compiling-from-source-code) Additionally, if this is the first time you're running zec-qt-wallet or a zcashd daemon, zec-qt-wallet will download the zcash params (~1.7 GB) and configure `zcash.conf` for you.
### Building on Linux Pass `--no-embedded` to disable the embedded zcashd and force zec-qt-wallet to connect to an external node.
``` ## Compiling from source
git clone https://github.com/adityapk00/zec-qt-wallet.git zec-qt-wallet is written in C++ 14, and can be compiled with g++/clang++/visual c++. It also depends on Qt5, which you can get from [here](https://www.qt.io/download). Note that if you are compiling from source, you won't get the embedded zcashd by default. You can either run an external zcashd, or compile zcashd as well.
cd zec-qt-wallet
/path/to/qt5/bin/qmake zec-qt-wallet.pro CONFIG+=debug See detailed build instructions [on the wiki](https://github.com/ZcashFoundation/zec-qt-wallet/wiki/Compiling-from-source-code)
make -j$(nproc)
### Building on Linux
./zec-qt-wallet
``` ```
git clone https://github.com/adityapk00/zec-qt-wallet.git
### Building on Windows cd zec-qt-wallet
You need Visual Studio 2017 (The free C++ Community Edition works just fine). /path/to/qt5/bin/qmake zec-qt-wallet.pro CONFIG+=debug
make -j$(nproc)
From the VS Tools command prompt
``` ./zec-qt-wallet
git clone https://github.com/adityapk00/zec-qt-wallet.git ```
cd zec-qt-wallet
c:\Qt5\bin\qmake.exe zec-qt-wallet.pro -spec win32-msvc CONFIG+=debug ### Building on Windows
nmake You need Visual Studio 2017 (The free C++ Community Edition works just fine).
debug\zec-qt-wallet.exe From the VS Tools command prompt
``` ```
git clone https://github.com/adityapk00/zec-qt-wallet.git
To create the Visual Studio project files so you can compile and run from Visual Studio: cd zec-qt-wallet
``` c:\Qt5\bin\qmake.exe zec-qt-wallet.pro -spec win32-msvc CONFIG+=debug
c:\Qt5\bin\qmake.exe zec-qt-wallet.pro -tp vc CONFIG+=debug nmake
```
debug\zec-qt-wallet.exe
### Building on macOS ```
You need to install the Xcode app or the Xcode command line tools first, and then install Qt.
To create the Visual Studio project files so you can compile and run from Visual Studio:
``` ```
git clone https://github.com/adityapk00/zec-qt-wallet.git c:\Qt5\bin\qmake.exe zec-qt-wallet.pro -tp vc CONFIG+=debug
cd zec-qt-wallet ```
/path/to/qt5/bin/qmake zec-qt-wallet.pro CONFIG+=debug
make ### Building on macOS
You need to install the Xcode app or the Xcode command line tools first, and then install Qt.
./zec-qt-wallet.app/Contents/MacOS/zec-qt-wallet
``` ```
git clone https://github.com/adityapk00/zec-qt-wallet.git
### [Troubleshooting Guide & FAQ](https://github.com/ZcashFoundation/zec-qt-wallet/wiki/Troubleshooting-&-FAQ) cd zec-qt-wallet
Please read the [troubleshooting guide](https://github.com/ZcashFoundation/zec-qt-wallet/wiki/Troubleshooting-&-FAQ) for common problems and solutions. /path/to/qt5/bin/qmake zec-qt-wallet.pro CONFIG+=debug
For support or other questions, tweet at [@zecqtwallet](https://twitter.com/zecqtwallet) or [file an issue](https://github.com/ZcashFoundation/zec-qt-wallet/issues). make
_PS: zec-qt-wallet is NOT an official wallet, and is not affiliated with the Zerocoin Electric Coin Company in any way._ ./zec-qt-wallet.app/Contents/MacOS/zec-qt-wallet
```
### [Troubleshooting Guide & FAQ](https://github.com/ZcashFoundation/zec-qt-wallet/wiki/Troubleshooting-&-FAQ)
Please read the [troubleshooting guide](https://github.com/ZcashFoundation/zec-qt-wallet/wiki/Troubleshooting-&-FAQ) for common problems and solutions.
For support or other questions, tweet at [@zecqtwallet](https://twitter.com/zecqtwallet) or [file an issue](https://github.com/ZcashFoundation/zec-qt-wallet/issues).
_PS: zec-qt-wallet is NOT an official wallet, and is not affiliated with the Zerocoin Electric Coin Company in any way._

View File

@@ -11,4 +11,9 @@
<file>res/zcashdlogo.gif</file> <file>res/zcashdlogo.gif</file>
<file>res/logobig.gif</file> <file>res/logobig.gif</file>
</qresource> </qresource>
<qresource prefix="/translations">
<file>res/zec_qt_wallet_es.qm</file>
<file>res/zec_qt_wallet_fr.qm</file>
<file>res/zec_qt_wallet_de.qm</file>
</qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 138 KiB

1111
res/zec_qt_wallet_de.ts Normal file

File diff suppressed because it is too large Load Diff

1111
res/zec_qt_wallet_es.ts Normal file

File diff suppressed because it is too large Load Diff

1111
res/zec_qt_wallet_fr.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -11,19 +11,19 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string>About</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>zec-qt-wallet</string> <string notr="true">zec-qt-wallet</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<widget class="QLabel" name="versionLabel"> <widget class="QLabel" name="versionLabel">
<property name="text"> <property name="text">
<string>Version</string> <string notr="true">Version</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -40,15 +40,15 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>470</width> <width>463</width>
<height>389</height> <height>517</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QLabel" name="label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string notr="true">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.1pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.1pt; font-weight:400; font-style:normal;&quot;&gt;

View File

@@ -124,7 +124,7 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target) {
if (!addr.isEmpty() && !ab.label->text().isEmpty()) { if (!addr.isEmpty() && !ab.label->text().isEmpty()) {
// Test if address is valid. // Test if address is valid.
if (!Settings::isValidAddress(addr)) { if (!Settings::isValidAddress(addr)) {
QMessageBox::critical(parent, "Address Format Error", addr + " doesn't seem to be a valid Zcash address.", QMessageBox::Ok); QMessageBox::critical(parent, QObject::tr("Address Format Error"), addr + QObject::tr(" doesn't seem to be a valid Zcash address."), QMessageBox::Ok);
} else { } else {
model.addNewLabel(ab.label->text(), ab.addr->text()); model.addNewLabel(ab.label->text(), ab.addr->text());
} }
@@ -168,12 +168,12 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target) {
}); });
} }
menu.addAction("Copy address", [&] () { menu.addAction(QObject::tr("Copy address"), [&] () {
QGuiApplication::clipboard()->setText(addr); QGuiApplication::clipboard()->setText(addr);
parent->ui->statusBar->showMessage("Copied to clipboard", 3 * 1000); parent->ui->statusBar->showMessage(QObject::tr("Copied to clipboard"), 3 * 1000);
}); });
menu.addAction("Delete label", [&] () { menu.addAction(QObject::tr("Delete label"), [&] () {
model.removeItemAt(index.row()); model.removeItemAt(index.row());
}); });

View File

@@ -48,7 +48,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>TextLabel</string> <string notr="true">TextLabel</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -58,7 +58,7 @@
<item row="1" column="0" colspan="3"> <item row="1" column="0" colspan="3">
<widget class="QLabel" name="Memo1"> <widget class="QLabel" name="Memo1">
<property name="text"> <property name="text">
<string>TextLabel</string> <string notr="true">TextLabel</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@@ -68,7 +68,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="Addr1"> <widget class="QLabel" name="Addr1">
<property name="text"> <property name="text">
<string>TextLabel</string> <string notr="true">TextLabel</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
@@ -84,7 +84,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>TextLabel</string> <string notr="true">TextLabel</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -94,7 +94,7 @@
<item row="2" column="0"> <item row="2" column="0">
<widget class="QLabel" name="labelMinerFee"> <widget class="QLabel" name="labelMinerFee">
<property name="text"> <property name="text">
<string>Miner Textlabel</string> <string notr="true">Miner Textlabel</string>
</property> </property>
</widget> </widget>
</item> </item>
@@ -107,7 +107,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>TextLabel</string> <string notr="true">TextLabel</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -123,7 +123,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>Miner Amount</string> <string notr="true">Miner Amount</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>

View File

@@ -38,7 +38,7 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) {
// Priority 2: Try to connect to detect zcash.conf and connect to it. // Priority 2: Try to connect to detect zcash.conf and connect to it.
auto config = autoDetectZcashConf(); auto config = autoDetectZcashConf();
main->logger->write("Attempting autoconnect"); main->logger->write(QObject::tr("Attempting autoconnect"));
if (config.get() != nullptr) { if (config.get() != nullptr) {
auto connection = makeConnection(config); auto connection = makeConnection(config);
@@ -47,7 +47,7 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) {
// Refused connection. So try and start embedded zcashd // Refused connection. So try and start embedded zcashd
if (Settings::getInstance()->useEmbedded()) { if (Settings::getInstance()->useEmbedded()) {
if (tryEzcashdStart) { if (tryEzcashdStart) {
this->showInformation("Starting embedded zcashd"); this->showInformation(QObject::tr("Starting embedded zcashd"));
if (this->startEmbeddedZcashd()) { if (this->startEmbeddedZcashd()) {
// Embedded zcashd started up. Wait a second and then refresh the connection // Embedded zcashd started up. Wait a second and then refresh the connection
main->logger->write("Embedded zcashd started up, trying autoconnect in 1 sec"); main->logger->write("Embedded zcashd started up, trying autoconnect in 1 sec");
@@ -57,7 +57,7 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) {
// zcashd is configured to run as a daemon, so we must wait for a few seconds // zcashd is configured to run as a daemon, so we must wait for a few seconds
// to let it start up. // to let it start up.
main->logger->write("zcashd is daemon=1. Waiting for it to start up"); main->logger->write("zcashd is daemon=1. Waiting for it to start up");
this->showInformation("zcashd is set to run as daemon", "Waiting for zcashd"); this->showInformation(QObject::tr("zcashd is set to run as daemon"), QObject::tr("Waiting for zcashd"));
QTimer::singleShot(5000, [=]() { doAutoConnect(/* don't attempt to start ezcashd */ false); }); QTimer::singleShot(5000, [=]() { doAutoConnect(/* don't attempt to start ezcashd */ false); });
} else { } else {
// Something is wrong. // Something is wrong.
@@ -72,15 +72,15 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) {
main->logger->write("Couldn't start embedded zcashd for unknown reason"); main->logger->write("Couldn't start embedded zcashd for unknown reason");
QString explanation; QString explanation;
if (config->zcashDaemon) { if (config->zcashDaemon) {
explanation = QString() % "You have zcashd set to start as a daemon, which can cause problems " explanation = QString() % QObject::tr("You have zcashd set to start as a daemon, which can cause problems "
"with zec-qt-wallet\n\n." "with zec-qt-wallet\n\n."
"Please remove the following line from your zcash.conf and restart zec-qt-wallet\n" "Please remove the following line from your zcash.conf and restart zec-qt-wallet\n"
"daemon=1"; "daemon=1");
} else { } else {
explanation = QString() % "Couldn't start the embedded zcashd.\n\n" % explanation = QString() % QObject::tr("Couldn't start the embedded zcashd.\n\n"
"Please try restarting.\n\nIf you previously started zcashd with custom arguments, you might need to reset zcash.conf.\n\n" % "Please try restarting.\n\nIf you previously started zcashd with custom arguments, you might need to reset zcash.conf.\n\n"
"If all else fails, please run zcashd manually." % "If all else fails, please run zcashd manually.") %
(ezcashd ? "The process returned:\n\n" % ezcashd->errorString() : QString("")); (ezcashd ? QObject::tr("The process returned") + ":\n\n" % ezcashd->errorString() : QString(""));
} }
this->showError(explanation); this->showError(explanation);
@@ -88,8 +88,8 @@ void ConnectionLoader::doAutoConnect(bool tryEzcashdStart) {
} else { } else {
// zcash.conf exists, there's no connection, and the user asked us not to start zcashd. Error! // zcash.conf exists, there's no connection, and the user asked us not to start zcashd. Error!
main->logger->write("Not using embedded and couldn't connect to zcashd"); main->logger->write("Not using embedded and couldn't connect to zcashd");
QString explanation = QString() % "Couldn't connect to zcashd configured in zcash.conf.\n\n" % QString explanation = QString() % QObject::tr("Couldn't connect to zcashd configured in zcash.conf.\n\n"
"Not starting embedded zcashd because --no-embedded was passed"; "Not starting embedded zcashd because --no-embedded was passed");
this->showError(explanation); this->showError(explanation);
} }
}); });
@@ -180,7 +180,7 @@ void ConnectionLoader::doNextDownload(std::function<void(void)> cb) {
client->deleteLater(); client->deleteLater();
main->logger->write("All Downloads done"); main->logger->write("All Downloads done");
this->showInformation("All Downloads Finished Successfully!"); this->showInformation(QObject::tr("All Downloads Finished Successfully!"));
cb(); cb();
return; return;
} }
@@ -203,7 +203,7 @@ void ConnectionLoader::doNextDownload(std::function<void(void)> cb) {
if (!currentOutput->open(QIODevice::WriteOnly)) { if (!currentOutput->open(QIODevice::WriteOnly)) {
main->logger->write("Couldn't open " + currentOutput->fileName() + " for writing"); main->logger->write("Couldn't open " + currentOutput->fileName() + " for writing");
this->showError("Couldn't download params. Please check the help site for more info."); this->showError(QObject::tr("Couldn't download params. Please check the help site for more info."));
} }
main->logger->write("Downloading to " + filename); main->logger->write("Downloading to " + filename);
qDebug() << "Downloading " << url << " to " << filename; qDebug() << "Downloading " << url << " to " << filename;
@@ -229,8 +229,8 @@ void ConnectionLoader::doNextDownload(std::function<void(void)> cb) {
} }
this->showInformation( this->showInformation(
"Downloading " % filename % (filesRemaining > 1 ? " ( +" % QString::number(filesRemaining) % " more remaining )" : QString("")), QObject::tr("Downloading ") % filename % (filesRemaining > 1 ? " ( +" % QString::number(filesRemaining) % QObject::tr(" more remaining )") : QString("")),
QString::number(done/1024/1024, 'f', 0) % "MB of " % QString::number(total/1024/1024, 'f', 0) + "MB at " % QString::number(speed, 'f', 2) % unit); QString::number(done/1024/1024, 'f', 0) % QObject::tr("MB of ") % QString::number(total/1024/1024, 'f', 0) + QObject::tr("MB at ") % QString::number(speed, 'f', 2) % unit);
}); });
// Download Finished // Download Finished
@@ -245,7 +245,7 @@ void ConnectionLoader::doNextDownload(std::function<void(void)> cb) {
if (currentDownload->error()) { if (currentDownload->error()) {
main->logger->write("Downloading " + filename + " failed"); main->logger->write("Downloading " + filename + " failed");
this->showError("Downloading " + filename + " failed. Please check the help site for more info"); this->showError(QObject::tr("Downloading ") + filename + QObject::tr(" failed. Please check the help site for more info"));
} else { } else {
doNextDownload(cb); doNextDownload(cb);
} }
@@ -269,7 +269,7 @@ bool ConnectionLoader::startEmbeddedZcashd() {
if (ezcashd != nullptr) { if (ezcashd != nullptr) {
if (ezcashd->state() == QProcess::NotRunning) { if (ezcashd->state() == QProcess::NotRunning) {
if (!processStdErrOutput.isEmpty()) { if (!processStdErrOutput.isEmpty()) {
QMessageBox::critical(main, "zcashd error", "zcashd said: " + processStdErrOutput, QMessageBox::critical(main, QObject::tr("zcashd error"), "zcashd said: " + processStdErrOutput,
QMessageBox::Ok); QMessageBox::Ok);
} }
return false; return false;
@@ -336,8 +336,8 @@ void ConnectionLoader::doManualConnect() {
if (!config) { if (!config) {
// Nothing configured, show an error // Nothing configured, show an error
QString explanation = QString() QString explanation = QString()
% "A manual connection was requested, but the settings are not configured.\n\n" % QObject::tr("A manual connection was requested, but the settings are not configured.\n\n"
% "Please set the host/port and user/password in the Edit->Settings menu."; "Please set the host/port and user/password in the Edit->Settings menu.");
showError(explanation); showError(explanation);
doRPCSetConnection(nullptr); doRPCSetConnection(nullptr);
@@ -348,8 +348,8 @@ void ConnectionLoader::doManualConnect() {
auto connection = makeConnection(config); auto connection = makeConnection(config);
refreshZcashdState(connection, [=] () { refreshZcashdState(connection, [=] () {
QString explanation = QString() QString explanation = QString()
% "Could not connect to zcashd configured in settings.\n\n" % QObject::tr("Could not connect to zcashd configured in settings.\n\n"
% "Please set the host/port and user/password in the Edit->Settings menu."; "Please set the host/port and user/password in the Edit->Settings menu.");
showError(explanation); showError(explanation);
doRPCSetConnection(nullptr); doRPCSetConnection(nullptr);
@@ -407,9 +407,9 @@ void ConnectionLoader::refreshZcashdState(Connection* connection, std::function<
refused(); refused();
} else if (err == QNetworkReply::NetworkError::AuthenticationRequiredError) { } else if (err == QNetworkReply::NetworkError::AuthenticationRequiredError) {
main->logger->write("Authentication failed"); main->logger->write("Authentication failed");
QString explanation = QString() QString explanation = QString() %
% "Authentication failed. The username / password you specified was " QObject::tr("Authentication failed. The username / password you specified was "
% "not accepted by zcashd. Try changing it in the Edit->Settings menu"; "not accepted by zcashd. Try changing it in the Edit->Settings menu");
this->showError(explanation); this->showError(explanation);
} else if (err == QNetworkReply::NetworkError::InternalServerError && } else if (err == QNetworkReply::NetworkError::InternalServerError &&
@@ -423,7 +423,7 @@ void ConnectionLoader::refreshZcashdState(Connection* connection, std::function<
if (dots > 3) if (dots > 3)
dots = 0; dots = 0;
} }
this->showInformation("Your zcashd is starting up. Please wait.", status); this->showInformation(QObject::tr("Your zcashd is starting up. Please wait."), status);
main->logger->write("Waiting for zcashd to come online."); main->logger->write("Waiting for zcashd to come online.");
// Refresh after one second // Refresh after one second
QTimer::singleShot(1000, [=]() { this->refreshZcashdState(connection, refused); }); QTimer::singleShot(1000, [=]() { this->refreshZcashdState(connection, refused); });
@@ -444,7 +444,7 @@ void ConnectionLoader::showError(QString explanation) {
rpc->setEZcashd(nullptr); rpc->setEZcashd(nullptr);
rpc->noConnection(); rpc->noConnection();
QMessageBox::critical(main, "Connection Error", explanation, QMessageBox::Ok); QMessageBox::critical(main, QObject::tr("Connection Error"), explanation, QMessageBox::Ok);
d->close(); d->close();
} }
@@ -663,7 +663,7 @@ void Connection::showTxError(const QString& error) {
return; return;
shown = true; shown = true;
QMessageBox::critical(main, "Transaction Error", "There was an error sending the transaction. The error was: \n\n" QMessageBox::critical(main, QObject::tr("Transaction Error"), QObject::tr("There was an error sending the transaction. The error was:") + "\n\n"
+ error, QMessageBox::StandardButton::Ok); + error, QMessageBox::StandardButton::Ok);
shown = false; shown = false;
} }

View File

@@ -40,6 +40,9 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text">
<string notr="true"/>
</property>
</widget> </widget>
</item> </item>
<item> <item>

View File

@@ -4,14 +4,20 @@
#include "version.h" #include "version.h"
#include "precompiled.h"
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication a(argc, argv); QApplication a(argc, argv);
QString locale = QLocale::system().name();
qDebug() << "Loading locale " << locale;
QTranslator translator;
translator.load(QString(":/translations/res/zec_qt_wallet_") + locale);
a.installTranslator(&translator);
QIcon icon(":/icons/res/icon.ico"); QIcon icon(":/icons/res/icon.ico");
QApplication::setWindowIcon(icon); QApplication::setWindowIcon(icon);

View File

@@ -627,7 +627,7 @@ void MainWindow::importPrivKey() {
pui.buttonBox->button(QDialogButtonBox::Save)->setVisible(false); pui.buttonBox->button(QDialogButtonBox::Save)->setVisible(false);
pui.helpLbl->setText(QString() % pui.helpLbl->setText(QString() %
"Please paste your private keys (z-Addr or t-Addr) here, one per line.\n" % tr("Please paste your private keys (z-Addr or t-Addr) here, one per line") % ".\n" %
tr("The keys will be imported into your connected zcashd node")); tr("The keys will be imported into your connected zcashd node"));
if (d.exec() == QDialog::Accepted && !pui.privKeyTxt->toPlainText().trimmed().isEmpty()) { if (d.exec() == QDialog::Accepted && !pui.privKeyTxt->toPlainText().trimmed().isEmpty()) {
@@ -667,17 +667,17 @@ void MainWindow::backupWalletDat() {
QFile wallet(zcashdir.filePath("wallet.dat")); QFile wallet(zcashdir.filePath("wallet.dat"));
if (!wallet.exists()) { if (!wallet.exists()) {
QMessageBox::critical(this, "No wallet.dat", tr("Couldn't find the wallet.dat on this computer.\n") + QMessageBox::critical(this, tr("No wallet.dat"), tr("Couldn't find the wallet.dat on this computer") + "\n" +
tr("You need to back it up from the machine zcashd is running on"), QMessageBox::Ok); tr("You need to back it up from the machine zcashd is running on"), QMessageBox::Ok);
return; return;
} }
QUrl backupName = QFileDialog::getSaveFileUrl(this, "Backup wallet.dat", backupDefaultName, "Data file (*.dat)"); QUrl backupName = QFileDialog::getSaveFileUrl(this, tr("Backup wallet.dat"), backupDefaultName, "Data file (*.dat)");
if (backupName.isEmpty()) if (backupName.isEmpty())
return; return;
if (!wallet.copy(backupName.toLocalFile())) { if (!wallet.copy(backupName.toLocalFile())) {
QMessageBox::critical(this, "Couldn't backup", tr("Couldn't backup the wallet.dat file.") + QMessageBox::critical(this, tr("Couldn't backup"), tr("Couldn't backup the wallet.dat file.") +
tr("You need to back it up manually."), QMessageBox::Ok); tr("You need to back it up manually."), QMessageBox::Ok);
} }
} }

View File

@@ -24,7 +24,7 @@
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="memoSize"> <widget class="QLabel" name="memoSize">
<property name="text"> <property name="text">
<string>0 / 512</string> <string notr="true">0 / 512</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>

View File

@@ -15,6 +15,7 @@
#include <QFontDatabase> #include <QFontDatabase>
#include <QAbstractTableModel> #include <QAbstractTableModel>
#include <QTranslator>
#include <QClipboard> #include <QClipboard>
#include <QStringBuilder> #include <QStringBuilder>
#include <QAbstractItemModel> #include <QAbstractItemModel>

View File

@@ -34,7 +34,7 @@
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="helpLbl"> <widget class="QLabel" name="helpLbl">
<property name="text"> <property name="text">
<string>TextLabel</string> <string notr="true">TextLabel</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@@ -347,7 +347,7 @@ void RPC::noConnection() {
main->statusIcon->setToolTip(""); main->statusIcon->setToolTip("");
main->statusLabel->setText(QObject::tr("No Connection")); main->statusLabel->setText(QObject::tr("No Connection"));
main->statusLabel->setToolTip(""); main->statusLabel->setToolTip("");
main->ui->statusBar->showMessage("No Connection", 1000); main->ui->statusBar->showMessage(QObject::tr("No Connection"), 1000);
// Clear balances table. // Clear balances table.
QMap<QString, double> emptyBalances; QMap<QString, double> emptyBalances;
@@ -572,25 +572,25 @@ void RPC::getInfoThenRefresh(bool force) {
} }
txt = txt % " ( " % QString::number(progress * 100, 'f', 0) % "% )"; txt = txt % " ( " % QString::number(progress * 100, 'f', 0) % "% )";
ui->blockheight->setText(txt); ui->blockheight->setText(txt);
ui->heightLabel->setText("Downloading blocks"); ui->heightLabel->setText(QObject::tr("Downloading blocks"));
} else { } else {
ui->blockheight->setText(QString::number(blockNumber)); ui->blockheight->setText(QString::number(blockNumber));
ui->heightLabel->setText("Block height"); ui->heightLabel->setText(QObject::tr("Block height"));
} }
} }
// Update the status bar // Update the status bar
QString statusText = QString() % QString statusText = QString() %
(isSyncing ? "Syncing" : "Connected") % (isSyncing ? QObject::tr("Syncing") : QObject::tr("Connected")) %
" (" % " (" %
(Settings::getInstance()->isTestnet() ? "testnet:" : "") % (Settings::getInstance()->isTestnet() ? QObject::tr("testnet:") : "") %
QString::number(blockNumber) % QString::number(blockNumber) %
(isSyncing ? ("/" % QString::number(progress*100, 'f', 0) % "%") : QString()) % (isSyncing ? ("/" % QString::number(progress*100, 'f', 0) % "%") : QString()) %
")"; ")";
main->statusLabel->setText(statusText); main->statusLabel->setText(statusText);
auto zecPrice = Settings::getUSDFormat(1); auto zecPrice = Settings::getUSDFormat(1);
QString tooltip = "Connected to zcashd";; QString tooltip = QObject::tr("Connected to zcashd");
if (!zecPrice.isEmpty()) { if (!zecPrice.isEmpty()) {
tooltip = "1 ZEC = " % zecPrice % "\n" % tooltip; tooltip = "1 ZEC = " % zecPrice % "\n" % tooltip;
} }
@@ -606,7 +606,7 @@ void RPC::getInfoThenRefresh(bool force) {
static bool shown = false; static bool shown = false;
if (!shown && prevCallSucceeded) { // show error only first time if (!shown && prevCallSucceeded) { // show error only first time
shown = true; shown = true;
QMessageBox::critical(main, "Connection Error", "There was an error connecting to zcashd. The error was: \n\n" QMessageBox::critical(main, QObject::tr("Connection Error"), QObject::tr("There was an error connecting to zcashd. The error was") + ": \n\n"
+ reply->errorString(), QMessageBox::StandardButton::Ok); + reply->errorString(), QMessageBox::StandardButton::Ok);
shown = false; shown = false;
} }
@@ -844,15 +844,15 @@ void RPC::watchTxStatus() {
auto errorMsg = QString::fromStdString(it["error"]["message"]); auto errorMsg = QString::fromStdString(it["error"]["message"]);
QMessageBox msg( QMessageBox msg(
QMessageBox::Critical, QMessageBox::Critical,
"Transaction Error", QObject::tr("Transaction Error"),
"The transaction with id " % id % " failed. The error was:\n\n" % errorMsg, QObject::tr("The transaction with id ") % id % QObject::tr(" failed. The error was") + ":\n\n" + errorMsg,
QMessageBox::Ok, QMessageBox::Ok,
main main
); );
watchingOps.remove(id); watchingOps.remove(id);
main->ui->statusBar->showMessage(" Tx " % id % " failed", 15 * 1000); main->ui->statusBar->showMessage(QObject::tr(" Tx ") % id % QObject::tr(" failed"), 15 * 1000);
main->loadingLabel->setVisible(false); main->loadingLabel->setVisible(false);
msg.exec(); msg.exec();
@@ -871,7 +871,7 @@ void RPC::watchTxStatus() {
main->loadingLabel->setVisible(false); main->loadingLabel->setVisible(false);
} else { } else {
main->loadingLabel->setVisible(true); main->loadingLabel->setVisible(true);
main->loadingLabel->setToolTip(QString::number(watchingOps.size()) + " tx computing. This can take several minutes."); main->loadingLabel->setToolTip(QString::number(watchingOps.size()) + QObject::tr(" tx computing. This can take several minutes."));
} }
}); });
} }
@@ -950,8 +950,8 @@ void RPC::shutdownZcashd() {
Ui_ConnectionDialog connD; Ui_ConnectionDialog connD;
connD.setupUi(&d); connD.setupUi(&d);
connD.topIcon->setBasePixmap(QIcon(":/icons/res/icon.ico").pixmap(256, 256)); connD.topIcon->setBasePixmap(QIcon(":/icons/res/icon.ico").pixmap(256, 256));
connD.status->setText("Please wait for zec-qt-wallet to exit"); connD.status->setText(QObject::tr("Please wait for zec-qt-wallet to exit"));
connD.statusDetail->setText("Waiting for zcashd to exit"); connD.statusDetail->setText(QObject::tr("Waiting for zcashd to exit"));
QTimer waiter(main); QTimer waiter(main);

15
src/scripts/dotranslations.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/bin/bash
if [ -z $QT_STATIC ]; then
echo "QT_STATIC is not set. Please set it to the base directory of a statically compiled Qt";
exit 1;
fi
rm -f res/*.qm
$QT_STATIC/bin/lrelease zec-qt-wallet.pro
# Then update the qt base translations. First, get all languages
ls res/*.qm | awk -F '[_.]' '{print $4}' | while read -r language ; do
$QT_STATIC/bin/lconvert -o res/zec_$language.qm $QT_STATIC/translations/qtbase_$language.qm res/zec_qt_wallet_$language.qm
mv res/zec_$language.qm res/zec_qt_wallet_$language.qm
done

View File

@@ -34,9 +34,14 @@ rm -f artifacts/macOS-zec-qt-wallet-v$APP_VERSION.dmg
echo "[OK]" echo "[OK]"
echo -n "Building..............." echo -n "Configuring............"
# Build # Build
QT_STATIC=$QT_PATH src/scripts/dotranslations.sh >/dev/null
$QT_PATH/bin/qmake zec-qt-wallet.pro CONFIG+=release >/dev/null $QT_PATH/bin/qmake zec-qt-wallet.pro CONFIG+=release >/dev/null
echo "[OK]"
echo -n "Building..............."
make -j4 >/dev/null make -j4 >/dev/null
echo "[OK]" echo "[OK]"

View File

@@ -59,8 +59,8 @@ echo ""
echo "[Building on" `lsb_release -r`"]" echo "[Building on" `lsb_release -r`"]"
echo -n "Configuring............" echo -n "Configuring............"
QT_STATIC=$QT_STATIC src/scripts/dotranslations.sh >/dev/null
$QT_STATIC/bin/qmake zec-qt-wallet.pro -spec linux-clang CONFIG+=release > /dev/null $QT_STATIC/bin/qmake zec-qt-wallet.pro -spec linux-clang CONFIG+=release > /dev/null
#Mingw seems to have trouble with precompiled headers, so strip that option from the .pro file
echo "[OK]" echo "[OK]"
@@ -89,7 +89,7 @@ cp $ZCASH_DIR/artifacts/zcash-cli bin/zec-qt-wallet-v$APP_VERSION > /dev/null
cp README.md bin/zec-qt-wallet-v$APP_VERSION > /dev/null cp README.md bin/zec-qt-wallet-v$APP_VERSION > /dev/null
cp LICENSE bin/zec-qt-wallet-v$APP_VERSION > /dev/null cp LICENSE bin/zec-qt-wallet-v$APP_VERSION > /dev/null
cd bin && tar cvf linux-zec-qt-wallet-v$APP_VERSION.tar.gz zec-qt-wallet-v$APP_VERSION/ > /dev/null cd bin && tar czf linux-zec-qt-wallet-v$APP_VERSION.tar.gz zec-qt-wallet-v$APP_VERSION/ > /dev/null
cd .. cd ..
mkdir artifacts >/dev/null 2>&1 mkdir artifacts >/dev/null 2>&1

View File

@@ -145,7 +145,7 @@ void MainWindow::addAddressSection() {
int itemNumber = ui->sendToWidgets->children().size() - 1; int itemNumber = ui->sendToWidgets->children().size() - 1;
auto verticalGroupBox = new QGroupBox(ui->sendToWidgets); auto verticalGroupBox = new QGroupBox(ui->sendToWidgets);
verticalGroupBox->setTitle(QString("Recipient ") % QString::number(itemNumber)); verticalGroupBox->setTitle(QString(tr("Recipient ")) % QString::number(itemNumber));
verticalGroupBox->setObjectName(QString("AddressGroupBox") % QString::number(itemNumber)); verticalGroupBox->setObjectName(QString("AddressGroupBox") % QString::number(itemNumber));
auto sendAddressLayout = new QVBoxLayout(verticalGroupBox); auto sendAddressLayout = new QVBoxLayout(verticalGroupBox);
sendAddressLayout->setSpacing(6); sendAddressLayout->setSpacing(6);
@@ -154,12 +154,12 @@ void MainWindow::addAddressSection() {
auto horizontalLayout_12 = new QHBoxLayout(); auto horizontalLayout_12 = new QHBoxLayout();
horizontalLayout_12->setSpacing(6); horizontalLayout_12->setSpacing(6);
auto label_4 = new QLabel(verticalGroupBox); auto label_4 = new QLabel(verticalGroupBox);
label_4->setText("Address"); label_4->setText(tr("Address"));
horizontalLayout_12->addWidget(label_4); horizontalLayout_12->addWidget(label_4);
auto Address1 = new QLineEdit(verticalGroupBox); auto Address1 = new QLineEdit(verticalGroupBox);
Address1->setObjectName(QString("Address") % QString::number(itemNumber)); Address1->setObjectName(QString("Address") % QString::number(itemNumber));
Address1->setPlaceholderText("Address"); Address1->setPlaceholderText(tr("Address"));
QObject::connect(Address1, &QLineEdit::textChanged, [=] (auto text) { QObject::connect(Address1, &QLineEdit::textChanged, [=] (auto text) {
this->addressChanged(itemNumber, text); this->addressChanged(itemNumber, text);
}); });
@@ -169,7 +169,7 @@ void MainWindow::addAddressSection() {
auto addressBook1 = new QPushButton(verticalGroupBox); auto addressBook1 = new QPushButton(verticalGroupBox);
addressBook1->setObjectName(QStringLiteral("AddressBook") % QString::number(itemNumber)); addressBook1->setObjectName(QStringLiteral("AddressBook") % QString::number(itemNumber));
addressBook1->setText("Address Book"); addressBook1->setText(tr("Address Book"));
QObject::connect(addressBook1, &QPushButton::clicked, [=] () { QObject::connect(addressBook1, &QPushButton::clicked, [=] () {
AddressBook::open(this, Address1); AddressBook::open(this, Address1);
}); });
@@ -182,11 +182,11 @@ void MainWindow::addAddressSection() {
horizontalLayout_13->setSpacing(6); horizontalLayout_13->setSpacing(6);
auto label_6 = new QLabel(verticalGroupBox); auto label_6 = new QLabel(verticalGroupBox);
label_6->setText("Amount"); label_6->setText(tr("Amount"));
horizontalLayout_13->addWidget(label_6); horizontalLayout_13->addWidget(label_6);
auto Amount1 = new QLineEdit(verticalGroupBox); auto Amount1 = new QLineEdit(verticalGroupBox);
Amount1->setPlaceholderText("Amount"); Amount1->setPlaceholderText(tr("Amount"));
Amount1->setObjectName(QString("Amount") % QString::number(itemNumber)); Amount1->setObjectName(QString("Amount") % QString::number(itemNumber));
Amount1->setBaseSize(QSize(200, 0)); Amount1->setBaseSize(QSize(200, 0));
// Create the validator for send to/amount fields // Create the validator for send to/amount fields
@@ -207,7 +207,7 @@ void MainWindow::addAddressSection() {
auto MemoBtn1 = new QPushButton(verticalGroupBox); auto MemoBtn1 = new QPushButton(verticalGroupBox);
MemoBtn1->setObjectName(QString("MemoBtn") % QString::number(itemNumber)); MemoBtn1->setObjectName(QString("MemoBtn") % QString::number(itemNumber));
MemoBtn1->setText("Memo"); MemoBtn1->setText(tr("Memo"));
// Connect Memo Clicked button // Connect Memo Clicked button
QObject::connect(MemoBtn1, &QPushButton::clicked, [=] () { QObject::connect(MemoBtn1, &QPushButton::clicked, [=] () {
this->memoButtonClicked(itemNumber); this->memoButtonClicked(itemNumber);
@@ -251,7 +251,7 @@ void MainWindow::setMemoEnabled(int number, bool enabled) {
memoBtn->setToolTip(""); memoBtn->setToolTip("");
} else { } else {
memoBtn->setEnabled(false); memoBtn->setEnabled(false);
memoBtn->setToolTip("Only z-addresses can have memos"); memoBtn->setToolTip(tr("Only z-addresses can have memos"));
} }
} }
@@ -259,8 +259,8 @@ void MainWindow::memoButtonClicked(int number) {
// Memos can only be used with zAddrs. So check that first // Memos can only be used with zAddrs. So check that first
auto addr = ui->sendToWidgets->findChild<QLineEdit*>(QString("Address") + QString::number(number)); auto addr = ui->sendToWidgets->findChild<QLineEdit*>(QString("Address") + QString::number(number));
if (!AddressBook::addressFromAddressLabel(addr->text()).startsWith("z")) { if (!AddressBook::addressFromAddressLabel(addr->text()).startsWith("z")) {
QMessageBox msg(QMessageBox::Critical, "Memos can only be used with z-addresses", QMessageBox msg(QMessageBox::Critical, tr("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", tr("The memo field can only be used with a z-address.\n") + addr->text() + tr("\ndoesn't look like a z-address"),
QMessageBox::Ok, this); QMessageBox::Ok, this);
msg.exec(); msg.exec();
@@ -414,7 +414,7 @@ Tx MainWindow::createTxFromSendPage() {
double change = rpc->getAllBalances()->value(tx.fromAddr) - totalAmt - tx.fee; double change = rpc->getAllBalances()->value(tx.fromAddr) - totalAmt - tx.fee;
if (Settings::getDecimalString(change) != "0") { if (Settings::getDecimalString(change) != "0") {
QString changeMemo = "Change from " + tx.fromAddr; QString changeMemo = tr("Change from ") + tx.fromAddr;
tx.toAddrs.push_back(ToFields{ *saplingAddr, change, changeMemo, changeMemo.toUtf8().toHex() }); tx.toAddrs.push_back(ToFields{ *saplingAddr, change, changeMemo, changeMemo.toUtf8().toHex() });
} }
} }
@@ -517,7 +517,7 @@ bool MainWindow::confirmTx(Tx tx) {
auto labelMinerFee = new QLabel(confirm.sendToAddrs); auto labelMinerFee = new QLabel(confirm.sendToAddrs);
labelMinerFee->setObjectName(QStringLiteral("labelMinerFee")); labelMinerFee->setObjectName(QStringLiteral("labelMinerFee"));
confirm.gridLayout->addWidget(labelMinerFee, row, 0, 1, 1); confirm.gridLayout->addWidget(labelMinerFee, row, 0, 1, 1);
labelMinerFee->setText("Miner Fee"); labelMinerFee->setText(tr("Miner Fee"));
auto minerFee = new QLabel(confirm.sendToAddrs); auto minerFee = new QLabel(confirm.sendToAddrs);
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
@@ -566,7 +566,7 @@ void MainWindow::sendButton() {
QString error = doSendTxValidations(tx); QString error = doSendTxValidations(tx);
if (!error.isEmpty()) { if (!error.isEmpty()) {
// Something went wrong, so show an error and exit // Something went wrong, so show an error and exit
QMessageBox msg(QMessageBox::Critical, "Transaction Error", error, QMessageBox msg(QMessageBox::Critical, tr("Transaction Error"), error,
QMessageBox::Ok, this); QMessageBox::Ok, this);
msg.exec(); msg.exec();
@@ -584,7 +584,7 @@ void MainWindow::sendButton() {
// And send the Tx // And send the Tx
rpc->sendZTransaction(params, [=](const json& reply) { rpc->sendZTransaction(params, [=](const json& reply) {
QString opid = QString::fromStdString(reply.get<json::string_t>()); QString opid = QString::fromStdString(reply.get<json::string_t>());
ui->statusBar->showMessage("Computing Tx: " % opid); ui->statusBar->showMessage(tr("Computing Tx: ") % opid);
// And then start monitoring the transaction // And then start monitoring the transaction
rpc->addNewTxToWatch(tx, opid); rpc->addNewTxToWatch(tx, opid);
@@ -593,12 +593,12 @@ void MainWindow::sendButton() {
} }
QString MainWindow::doSendTxValidations(Tx tx) { QString MainWindow::doSendTxValidations(Tx tx) {
if (!Settings::isValidAddress(tx.fromAddr)) return QString("From Address is Invalid"); if (!Settings::isValidAddress(tx.fromAddr)) return QString(tr("From Address is Invalid"));
for (auto toAddr : tx.toAddrs) { for (auto toAddr : tx.toAddrs) {
if (!Settings::isValidAddress(toAddr.addr)) { if (!Settings::isValidAddress(toAddr.addr)) {
QString addr = (toAddr.addr.length() > 100 ? toAddr.addr.left(100) + "..." : toAddr.addr); QString addr = (toAddr.addr.length() > 100 ? toAddr.addr.left(100) + "..." : toAddr.addr);
return QString("Recipient Address ") % addr % " is Invalid"; return QString(tr("Recipient Address ")) % addr % tr(" is Invalid");
} }
} }

View File

@@ -166,7 +166,7 @@ QString Settings::getZECUSDDisplayFormat(double bal) {
return getZECDisplayFormat(bal); return getZECDisplayFormat(bal);
} }
const QString Settings::txidStatusMessage = QString("Tx submitted (right click to copy) txid:"); const QString Settings::txidStatusMessage = QString(QObject::tr("Tx submitted (right click to copy) txid:"));
QString Settings::getTokenName() { QString Settings::getTokenName() {
if (Settings::getInstance()->isTestnet()) { if (Settings::getInstance()->isTestnet()) {

View File

@@ -6,10 +6,16 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>455</width> <width>460</width>
<height>391</height> <height>464</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>460</width>
<height>464</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Settings</string> <string>Settings</string>
</property> </property>
@@ -20,7 +26,7 @@
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
@@ -30,7 +36,7 @@
<item> <item>
<widget class="QLabel" name="confMsg"> <widget class="QLabel" name="confMsg">
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string notr="true">&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="textInteractionFlags"> <property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set> <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>

View File

@@ -116,8 +116,8 @@ void Turnstile::planMigration(QString zaddr, QString destAddr, int numsplits, in
if (migItems.empty()) { if (migItems.empty()) {
// Show error and abort // Show error and abort
QMessageBox::warning(mainwindow, QMessageBox::warning(mainwindow,
"Locked funds", QObject::tr("Locked funds"),
"Could not initiate migration.\nYou either have unconfirmed funds or the balance is too low for an automatic migration."); QObject::tr("Could not initiate migration.\nYou either have unconfirmed funds or the balance is too low for an automatic migration."));
return; return;
} }
@@ -357,7 +357,7 @@ void Turnstile::doSendTx(Tx tx, std::function<void(void)> cb) {
rpc->sendZTransaction(params, [=] (const json& reply) { rpc->sendZTransaction(params, [=] (const json& reply) {
QString opid = QString::fromStdString(reply.get<json::string_t>()); QString opid = QString::fromStdString(reply.get<json::string_t>());
//qDebug() << opid; //qDebug() << opid;
mainwindow->ui->statusBar->showMessage("Computing Tx: " % opid); mainwindow->ui->statusBar->showMessage(QObject::tr("Computing Tx: ") % opid);
// And then start monitoring the transaction // And then start monitoring the transaction
rpc->addNewTxToWatch(tx, opid); rpc->addNewTxToWatch(tx, opid);

View File

@@ -159,7 +159,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>0.0004 ZEC $0.04</string> <string notr="true">0.0004 ZEC $0.04</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>

View File

@@ -31,14 +31,14 @@
<item row="1" column="0" colspan="3"> <item row="1" column="0" colspan="3">
<widget class="QLabel" name="fromAddr"> <widget class="QLabel" name="fromAddr">
<property name="text"> <property name="text">
<string>From Address</string> <string notr="true">From Address</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="2"> <item row="6" column="2">
<widget class="QLabel" name="progressTxt"> <widget class="QLabel" name="progressTxt">
<property name="text"> <property name="text">
<string>4 / 12</string> <string notr="true">4 / 12</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -111,7 +111,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="text"> <property name="text">
<string>TextLabel</string> <string notr="true">TextLabel</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
@@ -141,7 +141,7 @@
<item row="3" column="0" colspan="3"> <item row="3" column="0" colspan="3">
<widget class="QLabel" name="toAddr"> <widget class="QLabel" name="toAddr">
<property name="text"> <property name="text">
<string>To Address</string> <string notr="true">To Address</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@@ -4,7 +4,7 @@
TxTableModel::TxTableModel(QObject *parent) TxTableModel::TxTableModel(QObject *parent)
: QAbstractTableModel(parent) { : QAbstractTableModel(parent) {
headers << "Type" << "Address" << "Date/Time" << "Amount"; headers << QObject::tr("Type") << QObject::tr("Address") << QObject::tr("Date/Time") << QObject::tr("Amount");
} }
TxTableModel::~TxTableModel() { TxTableModel::~TxTableModel() {

View File

@@ -1 +1 @@
#define APP_VERSION "0.4.3" #define APP_VERSION "0.5.0"

View File

@@ -24,7 +24,7 @@
<item row="14" column="1"> <item row="14" column="1">
<widget class="QLabel" name="feeAmount"> <widget class="QLabel" name="feeAmount">
<property name="text"> <property name="text">
<string>feeamount</string> <string notr="true">feeamount</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -34,7 +34,7 @@
<item row="12" column="1"> <item row="12" column="1">
<widget class="QLabel" name="memoSize"> <widget class="QLabel" name="memoSize">
<property name="text"> <property name="text">
<string>0 / 512</string> <string notr="true">0 / 512</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -104,7 +104,7 @@
<string notr="true">color:red;</string> <string notr="true">color:red;</string>
</property> </property>
<property name="text"> <property name="text">
<string>TextLabel</string> <string>Warning</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@@ -86,9 +86,15 @@ FORMS += \
src/zboard.ui \ src/zboard.ui \
src/addressbook.ui src/addressbook.ui
TRANSLATIONS = res/zec_qt_wallet_es.ts \
res/zec_qt_wallet_fr.ts \
res/zec_qt_wallet_de.ts
win32: RC_ICONS = res/icon.ico win32: RC_ICONS = res/icon.ico
ICON = res/logo.icns ICON = res/logo.icns
# Default rules for deployment. # Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin