Browse Source

Merge branch 'dev'

pull/126/head v1.5.3
onryo 1 year ago
parent
commit
a89a0cc1c6
  1. 2
      .gitignore
  2. 2
      LICENSE
  3. 23
      README.md
  4. 56
      application.qrc
  5. 28
      build.sh
  6. 58
      doc/release-process.md
  7. 33
      doc/relnotes.md
  8. 11
      doc/win/DEVELOPING-Ubuntu-18-04.md
  9. 1967
      lib/Cargo.lock
  10. 4
      lib/Cargo.toml
  11. 2
      lib/src/lib.rs
  12. 2
      peda-session-SilentDragonLite.txt
  13. BIN
      res/Anonymous.png
  14. BIN
      res/Berg.png
  15. BIN
      res/Elsa.png
  16. BIN
      res/Garfield.png
  17. BIN
      res/Mickey.png
  18. BIN
      res/Pinguin.png
  19. BIN
      res/Popey.png
  20. BIN
      res/Snoopy.png
  21. BIN
      res/Stag.png
  22. BIN
      res/Yoda.png
  23. 4
      res/css/Dark.css
  24. 2
      res/css/Light.css
  25. 21
      res/css/Midnight.css
  26. 114
      res/css/dragonx.css
  27. BIN
      res/darkwing.png
  28. BIN
      res/fekt.png
  29. BIN
      res/hushdlogo.png
  30. BIN
      res/jahway603.png
  31. BIN
      res/libsodium.a
  32. 34
      res/libsodium/buildlibsodium.sh
  33. BIN
      res/lock_closed.png
  34. BIN
      res/lock_open.png
  35. BIN
      res/logobig.gif
  36. BIN
      res/onryo.png
  37. BIN
      res/remove.png
  38. BIN
      res/send.png
  39. BIN
      res/silentdragonlite_ar.qm
  40. 1004
      res/silentdragonlite_ar.ts
  41. BIN
      res/silentdragonlite_be.qm
  42. 1331
      res/silentdragonlite_be.ts
  43. BIN
      res/silentdragonlite_de.qm
  44. 963
      res/silentdragonlite_de.ts
  45. BIN
      res/silentdragonlite_es.qm
  46. 1015
      res/silentdragonlite_es.ts
  47. BIN
      res/silentdragonlite_fa.qm
  48. 967
      res/silentdragonlite_fa.ts
  49. BIN
      res/silentdragonlite_fr.qm
  50. 983
      res/silentdragonlite_fr.ts
  51. BIN
      res/silentdragonlite_hr.qm
  52. 967
      res/silentdragonlite_hr.ts
  53. BIN
      res/silentdragonlite_it.qm
  54. 1002
      res/silentdragonlite_it.ts
  55. BIN
      res/silentdragonlite_nl.qm
  56. 2843
      res/silentdragonlite_nl.ts
  57. BIN
      res/silentdragonlite_pl.qm
  58. 2850
      res/silentdragonlite_pl.ts
  59. BIN
      res/silentdragonlite_pt.qm
  60. 983
      res/silentdragonlite_pt.ts
  61. BIN
      res/silentdragonlite_ru.qm
  62. 1837
      res/silentdragonlite_ru.ts
  63. BIN
      res/silentdragonlite_sr.qm
  64. 967
      res/silentdragonlite_sr.ts
  65. BIN
      res/silentdragonlite_tr.qm
  66. 983
      res/silentdragonlite_tr.ts
  67. BIN
      res/silentdragonlite_zh.qm
  68. 983
      res/silentdragonlite_zh.ts
  69. BIN
      res/synced.png
  70. BIN
      res/transaction0.png
  71. BIN
      res/transaction2.png
  72. BIN
      res/transaction_abandoned.png
  73. BIN
      res/transaction_conflicted.png
  74. BIN
      res/tx_inout.png
  75. BIN
      res/tx_input.png
  76. BIN
      res/tx_mined.png
  77. BIN
      res/tx_output.png
  78. BIN
      res/verify.png
  79. BIN
      res/warning.png
  80. BIN
      res/wormholeconnect.png
  81. 2
      run-after-build.sh
  82. 7
      silentdragon-lite.pro
  83. 2
      src/3rdparty/sodium.h
  84. 2
      src/Chat/Chat.cpp
  85. 2
      src/Chat/Chat.h
  86. 2
      src/Chat/Helper/ChatDelegator.h
  87. 2
      src/Crypto/FileEncryption.cpp
  88. 2
      src/Crypto/FileEncryption.h
  89. 2
      src/Crypto/passwd.cpp
  90. 2
      src/Crypto/passwd.h
  91. 2
      src/DataStore/ChatDataStore.cpp
  92. 2
      src/DataStore/ChatDataStore.h
  93. 2
      src/DataStore/ContactDataStore.cpp
  94. 2
      src/DataStore/ContactDataStore.h
  95. 2
      src/DataStore/DataStore-deprecated.h
  96. 2
      src/DataStore/DataStore.cpp
  97. 2
      src/DataStore/DataStore.h
  98. 2
      src/DataStore/SietchDataStore.cpp
  99. 2
      src/DataStore/SietchDataStore.h
  100. 2
      src/FileSystem/FileSystem.cpp
  101. 2
      src/FileSystem/FileSystem.h
  102. 2
      src/Logger/LogContext.h
  103. 2
      src/Logger/LogCrtitical.h
  104. 2
      src/Logger/LogDebug.h
  105. 2
      src/Logger/LogError.h
  106. 2
      src/Logger/LogFatal.h
  107. 2
      src/Logger/LogInfo.h
  108. 2
      src/Logger/LogStrategy.h
  109. 2
      src/Logger/LogSuccess.h
  110. 2
      src/Logger/LogType.h
  111. 2
      src/Logger/LogWarning.h
  112. 2
      src/Logger/LogWriter.cpp
  113. 2
      src/Logger/LogWriter.h
  114. 2
      src/Logger/Logger.h
  115. 2
      src/Logger/SimpleLogger.h
  116. 2
      src/Logger/test.cpp
  117. 2
      src/Model/ChatItem.cpp
  118. 2
      src/Model/ChatItem.h
  119. 2
      src/Model/ContactItem.cpp
  120. 2
      src/Model/ContactItem.h
  121. 2
      src/Model/ContactRequest.cpp
  122. 2
      src/Model/ContactRequest.h
  123. 2
      src/Model/ContactRequestChatItem.cpp
  124. 2
      src/Model/ContactRequestChatItem.h
  125. 13
      src/about.ui
  126. 3
      src/addressbook.cpp
  127. 4
      src/addressbook.h
  128. 86
      src/addressbook.ui
  129. 2
      src/addresscombo.cpp
  130. 2
      src/addresscombo.h
  131. 16
      src/balancestablemodel.cpp
  132. 8
      src/balancestablemodel.h
  133. 2
      src/camount.cpp
  134. 2
      src/camount.h
  135. 2
      src/chatbubbleme.cpp
  136. 2
      src/chatbubbleme.h
  137. 2
      src/chatbubblepartner.cpp
  138. 2
      src/chatbubblepartner.h
  139. 21
      src/chatmodel.cpp
  140. 2
      src/chatmodel.h
  141. 17
      src/connection.cpp
  142. 2
      src/connection.h
  143. 2
      src/contactmodel.cpp
  144. 2
      src/contactmodel.h
  145. 86
      src/contactrequest.ui
  146. 61
      src/controller.cpp
  147. 2
      src/datamodel.cpp
  148. 2
      src/datamodel.h
  149. 104
      src/deposithush.ui
  150. 23
      src/fillediconlabel.cpp
  151. 2
      src/fillediconlabel.h
  152. 171
      src/firsttimewizard.cpp
  153. 28
      src/firsttimewizard.h
  154. 20
      src/guiconstants.h
  155. 2
      src/liteinterface.cpp
  156. 2
      src/liteinterface.h
  157. 2
      src/logger.cpp
  158. 2
      src/logger.h
  159. 2
      src/main.cpp
  160. 464
      src/mainwindow.cpp
  161. 2
      src/mainwindow.h
  162. 841
      src/mainwindow.ui
  163. 2
      src/memoedit.cpp
  164. 8
      src/memoedit.h
  165. 139
      src/migration.ui
  166. 2
      src/mobileappconnector.cpp
  167. 2
      src/mobileappconnector.h
  168. 2
      src/newseed.ui
  169. 5
      src/newwallet.ui
  170. 2
      src/precompiled.h
  171. 18
      src/qrcodelabel.cpp
  172. 2
      src/qrcodelabel.h
  173. 2
      src/recurring.cpp
  174. 6
      src/recurring.h
  175. 2
      src/recurringdialog.ui
  176. 2
      src/recurringpayments.ui
  177. 90
      src/requestContactDialog.ui
  178. 2
      src/requestdialog.cpp
  179. 2
      src/requestdialog.h
  180. 72
      src/restoreSeed.ui
  181. 2
      src/restoreseed.ui
  182. 19
      src/scripts/translation_analysis.sh
  183. 19
      src/sendtab.cpp
  184. 46
      src/settings.cpp
  185. 3
      src/settings.h
  186. 5
      src/settings.ui
  187. 65
      src/txtablemodel.cpp
  188. 3
      src/txtablemodel.h
  189. 4
      src/version.h
  190. 2
      src/viewalladdresses.cpp
  191. 4
      src/viewalladdresses.h
  192. 8
      src/websockets.cpp
  193. 2
      src/websockets.h
  194. 2
      util/add-linux-icons.sh
  195. 2
      util/install.sh
  196. 42
      util/replace.pl
  197. 14
      util/update-copyrights.sh
  198. 38
      win-static-build.sh

2
.gitignore

@ -42,3 +42,5 @@ silentdragonlite_plugin_import.cpp
silentdragonlite_resource.rc
SilentDragonLite
.gdb_history
.*sw?
core

2
LICENSE

@ -1,4 +1,4 @@
Copyright 2019-2021 The Hush developers
Copyright 2019-2023 The Hush developers
Copyright 2018 adityapk

23
README.md

@ -30,17 +30,30 @@ Go to the [releases page](https://git.hush.is/hush/SilentDragonLite/releases) an
* SilentDragonLite 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) or we recommend installing using your Linux version's package manager (if available).
* **You'll need Rust v1.49**, so install it via [Rustup in Linux](https://rustup.rs/).
* **You'll need Rust v1.49**, so install it via [Rustup in Linux](https://rustup.rs/). **If you use a version greater then 1.63, then it will not currently build** as seen in [Issue #89](https://git.hush.is/hush/SilentDragonLite/issues/89).
#### Building on Linux
**Nothing below will work without rust. Check that your system has rustc 1.49. If not then you need to use [Rustup in Linux](https://rustup.rs/).**
**Nothing below will work without rust. Check that your system has rustc 1.49. If not then you need to use [Rustup in Linux](https://rustup.rs/).**
An example of how to install Rust 1.49 with rustup is below:
```
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Choose: 1) Proceed with installation (default)
source $HOME/.cargo/env
rustup install 1.49
rustup default 1.49
rustup -V
```
**Nothing below will work without the Linux "build-essential" package. Check that your system has it installed. If not, and you're using a Ubuntu/Debian distro, then you can install with `apt install build-essential`.**
Compiling can take some time, so be patient and wait for it to finish. It will take potentially a long time for slower systems. Be Patient and please report compiler problems!
##### Ubuntu 18.04 and 20.04:
```shell script
sudo apt-get -y install qt5-default qt5-qmake libqt5websockets5-dev qtcreator
sudo apt-get -y install build-essential qt5-default qt5-qmake libqt5websockets5-dev qtcreator qttools5-dev-tools
git clone https://git.hush.is/hush/SilentDragonLite
cd SilentDragonLite
./build.sh linguist
@ -78,9 +91,11 @@ Linux: `~/.silentdragonlite`
Windows 10: `C:\Users\%user\AppData\Roaming\silentdragonlite`
Mac: `~/Library/Application Support/silentdragonlite`
## Support
For support join us on [Telegram Support](https://hush.is/telegram_support), or our [Main Telegram](https://hush.is/telegram) or tweet at [@MyHushTeam](https://twitter.com/MyHushTeam), or toot at our [Mastodon](https://fosstodon.org/@myhushteam), or [file an issue](https://git.hush.is/hush/SilentDragonLite/issues).
For support join us on [Telegram Support](https://hush.is/telegram_support), or our [Main Telegram](https://hush.is/telegram), or toot at our [Mastodon](https://fosstodon.org/@myhushteam), or [file an issue](https://git.hush.is/hush/SilentDragonLite/issues).
You can also subscribe to our channels on [PeerTube](https://videos.hush.is), on [YouTube](https://hush.is/yt), or on [Odyssee/LBRY](https://odysee.com/@MyHushTeam:3).

56
application.qrc

@ -8,21 +8,15 @@
<file>res/paymentreq.gif</file>
<file>res/icon.ico</file>
<file>res/mail.png</file>
<file>res/darkwing.png</file>
<file>res/SDLogo.png</file>
<file>res/sdlogo2.png</file>
<file>res/Berg.png</file>
<file>res/Denio.png</file>
<file>res/Duke.png</file>
<file>res/onryo.png</file>
<file>res/fekt.png</file>
<file>res/jahway603.png</file>
<file>res/Sharpee.png</file>
<file>res/Yoda.png</file>
<file>res/Mickey.png</file>
<file>res/Snoopy.png</file>
<file>res/Popey.png</file>
<file>res/Garfield.png</file>
<file>res/Pinguin.png</file>
<file>res/Stag.png</file>
<file>res/Elsa.png</file>
<file>res/Anonymous.png</file>
<file>res/send.png</file>
<file>res/send.svg</file>
<file>res/addcontact.svg</file>
@ -51,7 +45,9 @@
<file>res/money-mouth.png</file>
<file>res/money-outgoing.png</file>
<file>res/hush-money-white.png</file>
<file>res/tx_input.png</file>
<file>res/tx_output.png</file>
<file>res/tx_mined.png</file>
</qresource>
<qresource prefix="/img">
<file>res/hushdlogo.png</file>
@ -62,30 +58,32 @@
<file>res/silentdragonlite-animated-startup-dark.gif</file>
<file>res/loaderblack.gif</file>
<file>res/loaderwhite.gif</file>
<file>res/logobig.gif</file>
</qresource>
<qresource prefix="/emoji">
<file>res/emoji/emoji1.png</file>
<file>res/emoji/laughing.png</file>
<file>res/emoji/money-mouth.png</file>
<file>res/emoji/joy.png</file>
<file>res/emoji/innocent.png</file>
<file>res/emoji/partying_face.png</file>
<file>res/emoji/face_with_3hearts.png</file>
<file>res/emoji/face-with-rolling-eyes.png</file>
<file>res/emoji/face-with-tongue.png</file>
<file>res/emoji/heart_shaped_eyes.png</file>
<file>res/emoji/nauseated-face.png</file>
<file>res/emoji/pile-of-poo.png</file>
<file>res/emoji/serious-face-with-symbols-covering-mouth.png</file>
<file>res/emoji/smiling-face-with-sunglasses.png</file>
<file>res/emoji/stuck-out.png</file>
<file>res/emoji/sweet_smile.png</file>
<file>res/emoji/hush-money-white.png</file>
<file>res/emoji/SD.png</file>
<file>res/emoji/emoji1.png</file>
<file>res/emoji/laughing.png</file>
<file>res/emoji/money-mouth.png</file>
<file>res/emoji/joy.png</file>
<file>res/emoji/innocent.png</file>
<file>res/emoji/partying_face.png</file>
<file>res/emoji/face_with_3hearts.png</file>
<file>res/emoji/face-with-rolling-eyes.png</file>
<file>res/emoji/face-with-tongue.png</file>
<file>res/emoji/heart_shaped_eyes.png</file>
<file>res/emoji/nauseated-face.png</file>
<file>res/emoji/pile-of-poo.png</file>
<file>res/emoji/serious-face-with-symbols-covering-mouth.png</file>
<file>res/emoji/smiling-face-with-sunglasses.png</file>
<file>res/emoji/stuck-out.png</file>
<file>res/emoji/sweet_smile.png</file>
<file>res/emoji/hush-money-white.png</file>
<file>res/emoji/SD.png</file>
</qresource>
<qresource prefix="/translations">
<file>res/silentdragonlite_ar.qm</file>
<file>res/silentdragonlite_be.qm</file>
<file>res/silentdragonlite_pl.qm</file>
<file>res/silentdragonlite_de.qm</file>
<file>res/silentdragonlite_es.qm</file>
<file>res/silentdragonlite_fa.qm</file>

28
build.sh

@ -1,5 +1,6 @@
#!/bin/bash
# Copyright 2019-2021 The Hush Developers
# Copyright 2019-2023 The Hush Developers
# Released under the GPLv3
UNAME=$(uname)
@ -13,6 +14,31 @@ else
JOBS=1
fi
# check if rustc and cargo are installed, otherwise exit with error
if ! command -v rustc &> /dev/null
then
echo "rustc could not be found. Please install it and try again."
exit 1
fi
if ! command -v cargo &> /dev/null
then
echo "cargo could not be found. Please install it and try again."
exit 1
fi
if ! command -v qmake &> /dev/null
then
echo "qmake could not be found. Please install QT and try again."
exit 1
fi
if ! command -v make &> /dev/null
then
echo "make could not be found. Please install it and try again."
exit 1
fi
VERSION=$(cat src/version.h |cut -d\" -f2)
echo "Compiling SilentDragonLite $VERSION with $JOBS threads..."
CONF=silentdragon-lite.pro

58
doc/release-process.md

@ -0,0 +1,58 @@
# SilentDragonLite Release Process
## High-Level Philosophy
Beware of making high-risk changes too close to a new release, because they will not get as much testing as they should. Don't merge large branches which haven't undergone lots of testing just before a release.
It is best to keep doc/relnotes/README.md up to date as changes and bug fixes are made. It's more work to summarize all changes and bugfixes just before the release.
## Check for changes on master that should be on dev
See https://git.hush.is/hush/hush3/src/branch/master/doc/release-process.md#check-for-changes-on-master-that-should-be-on-dev , there is no sense repeating the exact same thing here.
SD+SDL very often has merge conflicts in generated translation files, because QT embeds line numbers in XML.
Read how to deal with them efficiently here: https://git.hush.is/hush/SilentDragon/src/branch/dev/doc/release-process.md#dealing-with-merge-conflicts
## Git Issues
Look for Git issues that should be fixed in the next release: https://git.hush.is/hush/SilentDragonLite/issues Especially low-risk and simple things and like documentation changes and improvements to error messages. Take note that changing strings in the source code, such as adding a new string or changing an existing one, will affect translations.
## Translations
...
```
# update generated translation data
./build.sh linguist
git commit -am "update translations"
git push
```
## Adding Checkpoints
Adding checkpoints make SDL sync much faster, especially for brand new wallets. If there are no recent checkpoints,
when a user makes a new wallet, it will sync from a block far in the past, which wastes time, bandwidth and CPU resources. To add a checkpoint , they are added to the file `lib/src/lightclient/checkpoints.rs` in the silentdragonlite-cli repo, and then the dependency on silentdragonlite-cli is updated in this SDL repo. Here is an example commit that updates checkpoints:
https://git.hush.is/hush/silentdragonlite-cli/commit/ef477f152e1a8bb8a5f7883a99e2a74a6f9eeb0b
To actually generate the checkpoint data, use the `sdl_checkpoints.pl` script in the hush3 repo: https://git.hush.is/hush/hush3/src/branch/master/contrib/sdl_checkpoints.pl . It uses the `getblockmerkletree` RPC to get the merkle tree data for a block height. It prints the data out in the format that checkpoints.rs wants it in, you simply need to copy and paste the output into the checkpoints.rs file. Once the data is updated in silentdragonlite-cli checkpoints.rs file, the file `lib/Cargo.toml` must be updated in this repo, and point to the commit id of the updated data. Once you update the manually-edited `Cargo.toml` you must run `cargo update` to update the generated `Cargo.lock` file. See https://doc.rust-lang.org/cargo/commands/cargo-update.html for more info. Once both files are updates, commit and push.
---
To fix `error: failed to select a version for the requirement 'aes = "^0.3"'` add the following to `.cargo/config.toml`:
```
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"
```
To update the file run `cargo vendor` as was mentioned in https://git.hush.is/hush/SilentDragonLite/issues/91.
---
## Release process
...

33
doc/relnotes.md

@ -0,0 +1,33 @@
# SilentDragonLite v1.5.3 "Mythical Coelacanth"
* Change lite server after sending a tx for improved privacy: https://git.hush.is/hush/SilentDragonLite/commit/a8fc12e0e2b2324db21407f4848f2d4aa59f4575.
* Update silentdragonlite-cli dependency, this makes syncing new wallets drastically faster: https://git.hush.is/hush/SilentDragonLite/commit/670bc598265f70b7140af4b8287ddcf28a6a6a04.
* Add backend servers `lite.hushpool.is` and `lite2.hushpool.is`: https://git.hush.is/hush/SilentDragonLite/commit/6c5ffca05615b21ea3651897f108eb576ecc07a8, https://git.hush.is/hush/SilentDragonLite/commit/1a7af9682c2bb42959d0a8e0c826477f1ee79c95.
* Add backend servers `poop.granitefone.me` and `wtfistheinternet.hush.is`: https://git.hush.is/hush/SilentDragonLite/commit/8a5c8e4898aac993736a150f77c880a3b6c153f8, https://git.hush.is/hush/SilentDragonLite/commit/5427d400e406915562aa285bbc3bb325092672c7.
* Add backend servers `lite.myhush.org` and `lite.hush.community`: https://git.hush.is/hush/SilentDragonLite/commit/c0fe5d281cdd21da6f55d0fc300842ab4f729c22
* Remove sprout code and unused migration ui: https://git.hush.is/hush/SilentDragonLite/commit/6cab5f68f9b2c59b23ae590515ed802abe7d08e7, https://git.hush.is/hush/SilentDragonLite/commit/3f9fc49207c2455dad857f76984fef5ba35560a9.
* Fix cancelEvent warning and better logging and error checking, fix some compiler warnings: https://git.hush.is/hush/SilentDragonLite/commit/5f8babd5a192f0f7a30b2b22321c9919fba67187, https://git.hush.is/hush/SilentDragonLite/commit/cbc77e9d58c4808297f63c6da1950ba9a5945b2c.
* Fix various bugs in the New Wallet Wizard: https://git.hush.is/hush/SilentDragonLite/commit/7649418a7b52c6452726ba047c8039eb90a79714, https://git.hush.is/hush/SilentDragonLite/commit/ff8692fa391ccb6ea889002a6fff14419a5e68c6, https://git.hush.is/hush/SilentDragonLite/commit/5825b30e71847663fa2666f629c598c781b1480d.
* Ignore leading/trailing spaces in wallet birthday when importing a seed: https://git.hush.is/hush/SilentDragonLite/commit/9e8e95200c80cdc9280d406d935dbe9074412a9c.
* Welcome screen fix: https://git.hush.is/hush/SilentDragonLite/commit/1f7b8186f06fe6807e107b0ebe5e24c3551a54fd, https://git.hush.is/hush/SilentDragonLite/commit/7398c70e2b9f592310e8727f5c9542ccbcb933a9, https://git.hush.is/hush/SilentDragonLite/commit/7398c70e2b9f592310e8727f5c9542ccbcb933a9.
* Show QT Version in About screen: https://git.hush.is/hush/SilentDragonLite/commit/825e50b2ea0a1ce9be9bd78bff784c4790cb11e5.
* Removed confusing text about mining: https://git.hush.is/hush/SilentDragonLite/commit/4aeab433a46437ee42b8852c3f455bcae63065e6.
* Update translations for Spanish, Russian and Belarusian languages: https://git.hush.is/hush/SilentDragonLite/commit/aabb8c5f292d11fbb73f007dda6651928de63d63, https://git.hush.is/hush/SilentDragonLite/commit/fc3c445f219532440b262721d6bc52f251e20b5e, https://git.hush.is/hush/SilentDragonLite/commit/19e12ba5a6e17264873e4ed084391bb13c30f475.
* Add Polish language: https://git.hush.is/hush/SilentDragonLite/commit/a1bb19da8d3242cd1acd80acaaecee8a1979a6dd, https://git.hush.is/hush/SilentDragonLite/commit/78806743b665069d0f65d54d6c69edbec2c89de4.
* Memo stuff: https://git.hush.is/hush/SilentDragonLite/commit/25fab30e1dadefdb93f634692d5ff11f10162f0b, https://git.hush.is/hush/SilentDragonLite/commit/fc3f4ce99b813b57e1a81cf053242ccd17ab13d8, https://git.hush.is/hush/SilentDragonLite/commit/fc3f4ce99b813b57e1a81cf053242ccd17ab13d8, https://git.hush.is/hush/SilentDragonLite/commit/fc3f4ce99b813b57e1a81cf053242ccd17ab13d8.
* Fix no connection status on sync: https://git.hush.is/hush/SilentDragonLite/commit/e179e723f5d6243e74a432273da7ea73893fe174.
* Try to avoid coredumping if zrpc object doesn't exist, which can happen if backend server is misbehaving: https://git.hush.is/hush/SilentDragonLite/commit/fd2fb3757add1d407bf9b8a46652712b9ca88fa7, https://git.hush.is/hush/SilentDragonLite/commit/42b5d182ee639933a8dd639f12f5c99e66f55a63.
* Add debugging: https://git.hush.is/hush/SilentDragonLite/commit/f872c0af6b3a8c6116c580cf9883ac21e14b4d6b, https://git.hush.is/hush/SilentDragonLite/commit/760729f1b1833e4a4fdb398abfed09e405c633ff.
* Add rustc, cargo and libsodium checks: https://git.hush.is/hush/SilentDragonLite/commit/e6d3c8db51752179e630ab271eba4eea53dd2ac2, https://git.hush.is/hush/SilentDragonLite/commit/fc474d797dc170126a9451d4336bad3d36101cf4.
* Update graphics: https://git.hush.is/hush/SilentDragonLite/commit/69ea9ace50de72593c86be7f54871130631c3ba1, https://git.hush.is/hush/SilentDragonLite/commit/fe15384c10783e061a41165ea3fd82b55bb932de.
* Less Microsoft: https://git.hush.is/hush/SilentDragonLite/commit/b0d6aa3285706b50b233a8b8c523b9f2899a272f.
* Windows binary was provided. (in progress)
* Linux binary and debian package were provided. (in progress)
# SilentDragonLite v1.5.2 "Zany Zulu"
* Fixes connection problems for older versions
* Updated one of the community servers to new domain: lite.hush.land
* Fix bug where trailing slash on server name crashes SDL
* Improved error-handling of invalid data at libsodium layer
* Avoid showing corrupted ciphertext in GUI

11
DEVELOPING.md → doc/win/DEVELOPING-Ubuntu-18-04.md

@ -1,5 +1,5 @@
## Crosscompile for Windows (only tested for Ubuntu 18.04)
## Crosscompile for Windows (only tested for Ubuntu 18.04) by DenioD
```
# build dependencies
@ -52,7 +52,7 @@ make -j$(nproc) install
```
# Build MXE (Cross-compiled Qt5 for Windows in Linux)
```
mkdir ~/github && cd ~/github
mkdir ~/git && cd ~/git
git clone https://github.com/mxe/mxe.git
cd mxe
@ -71,3 +71,10 @@ echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
./win-static-build.sh
```
# Adding a new SDL lite server backend to the code
* Add the new server name to the array in getRandomServer() in settings.cpp
* Add the new server to dropdown in mainwindow.cpp
TODO: Make both of these places use a single list of servers.

1967
lib/Cargo.lock

File diff suppressed because it is too large

4
lib/Cargo.toml

@ -1,7 +1,7 @@
[package]
name = "qtlib"
version = "0.1.0"
authors = ["zecwallet"]
authors = ["zecwallet", "The Hush Developers"]
edition = "2018"
[lib]
@ -12,4 +12,4 @@ crate-type = ["staticlib"]
libc = "0.2.58"
lazy_static = "1.4.0"
blake3 = "0.3.4"
silentdragonlitelib = { git = "https://git.hush.is/hush/silentdragonlite-cli", rev = "8535a11e3774d79de2ebeaa5540567ccb4988f81" }
silentdragonlitelib = { git = "https://git.hush.is/hush/silentdragonlite-cli", rev = "0181b16fd037f98c760e668bb6af8a41dd0d6267" }

2
lib/src/lib.rs

@ -223,4 +223,4 @@ pub extern fn litelib_rust_free_string(s: *mut c_char) {
if s.is_null() { return }
CString::from_raw(s)
};
}
}

2
peda-session-SilentDragonLite.txt

@ -1,2 +0,0 @@
break FileSystem::readContactsOldFormat

BIN
res/Anonymous.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
res/Berg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

BIN
res/Elsa.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

BIN
res/Garfield.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

BIN
res/Mickey.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

BIN
res/Pinguin.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

BIN
res/Popey.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

BIN
res/Snoopy.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

BIN
res/Stag.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

BIN
res/Yoda.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

4
res/css/Dark.css

@ -1,5 +1,5 @@
QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QTableView::item, QScrollArea, QGroupBox, QPlainTextEdit, QLineEdit, QLabel, MainWindow, ChatModel, requestDialog
QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QScrollArea, QGroupBox, QPlainTextEdit, QLineEdit, QLabel, MainWindow
{
background-color: #303335;
color: #ffffff;
@ -25,7 +25,7 @@ QTabWidget QTabBar::tab:hover {
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #747577, stop: 1 #3E4244);
color:#fff;
border: 1px ridge #fff;
min-height: 20px;
min-height: 20px
}
QHeaderView { /* Table Header */

2
res/css/Light.css

@ -1,4 +1,4 @@
QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QTableView::item, QScrollArea, QGroupBox, QWidget, QPlainTextEdit, QLineEdit, QLabel, MainWindow
QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QScrollArea, QGroupBox, QWidget, QPlainTextEdit, QLineEdit, QLabel, MainWindow
{
background-color: #dadada;
color: #000000;

21
res/css/Midnight.css

@ -9,7 +9,7 @@ Website: https://www.csharpe.me
License: https://opensource.org/licenses/MIT
*/
QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QTableView::item, QScrollArea, QGroupBox, QPlainTextEdit, QLineEdit, QLabel, MainWindow
QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QScrollArea, QGroupBox, QPlainTextEdit, QLineEdit, QLabel, MainWindow, QPixmap, QHBoxLayout, QVBoxLayout, QGridLayout, QAbstractItemView, QFrame
{
background-color: #111;
color: #fff;
@ -23,6 +23,7 @@ QPushButton:hover {
background: #222;
}
/*
QLineEdit, QRadioButton::indicator::unchecked, QCheckBox::indicator::unchecked {
background: #222;
border: 1px solid #333;
@ -35,19 +36,24 @@ font-size: 12px;
QLineEdit:focus {
border: 1px solid #9d8400;
}
}*/
/*
QWidget QLabel {
font-size: 11pt;
}
*/
QWidget QCheckBox {
font-weight: bold;
}
QTabWidget QTabBar::tab {
min-height: 15px;
padding: 15px 25px;
/*min-height: 15px;*/
padding-left:20px;
padding-right:20px;
padding-top:5px;
padding-bottom:5px;
border: 1px ridge #222;
left: 1px; /* Fix 1px alignment */
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #333, stop: 1 #111);
@ -62,6 +68,7 @@ border-bottom: 0px; /* Overwrites border-bottom */
QTabWidget QTabBar::tab:hover {
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #555, stop: 1 #111);
min-height: 20px
}
QHeaderView { /* Table Header */
@ -74,7 +81,7 @@ background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #333, st
color:#fff;
min-height:25px;
font-weight:bold;
font-size:12px;
font-size:11px;
outline:0;
border:1px ridge #222;
padding: 2px 5px;
@ -112,8 +119,8 @@ color: #fff;
QMenuBar::item {
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #222, stop: 1 #111);
color: #fff;
padding: 5px 7px;
margin: 0px;
/*padding: 5px 7px;
margin: 0px;*/
}
QMenuBar::item:selected {

114
res/css/dragonx.css

@ -0,0 +1,114 @@
QWidget, QMainWindow, QMenuBar, QMenu, QDialog, QTabWidget, QTableView, QScrollArea, QGroupBox, QPlainTextEdit, QLineEdit, QLabel, MainWindow {
background-color: #232834;
color: #91a4b8;
}
QTabWidget QTabBar::tab {
padding-left:20px;
padding-right:20px;
padding-top:5px;
padding-bottom:5px;
border: 1px solid #343F4B;
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #343F4B, stop: 1 #232834);
}
QTabWidget QTabBar::tab:selected {
min-height: 10px;
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #343F4B, stop: 1 #232834);
color:#91a4b8;
border: 1px ridge #91a4b8;
}
QTabWidget QTabBar::tab:hover {
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #343F4B, stop: 1 #232834);
color:#91a4b8;
border: 1px ridge #91a4b8;
min-height: 20px
}
QHeaderView {
/* Table Header */
background-color:#232834;
}
QHeaderView::section {
/* Table Header Sections */
qproperty-alignment:center;
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #343F4B, stop: 1 #232834);
color:#91a4b8;
min-height:25px;
font-weight:bold;
font-size:11px;
outline:0;
border:1px solid #343F4B;
border-right:1px solid #91a4b8;
border-left:1px solid #91a4b8;
padding-left:5px;
padding-right:5px;
padding-top:2px;
padding-bottom:2px;
}
QHeaderView::section:last {
border-right: 0px solid #d7d7d7;
}
QScrollArea {
background:transparent;
border:0px;
}
QTableView {
/* Table - has to be selected as a class otherwise it throws off QCalendarWidget */
background:#232834;
}
QTableView::item {
/* Table Item */
background-color:#232834;
border:1px solid #91a4b8;
font-size:12px;
}
QTableView::item:selected {
/* Table Item Selected */
background-color:#91a4b8;
color:#232834;
}
QMenuBar {
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #343F4B, stop: 1 #232834);
color: #91a4b8;
}
QMenuBar::item {
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #343F4B, stop: 1 #232834);
color: #91a4b8;
}
QMenuBar::item:selected {
background-color:qlineargradient(x1: 0, y1: 0, x2: 0, y2: 0.25, stop: 0 #343F4B, stop: 1 #232834);
}
QPushButton#startmining {
background-color: #343F4B;
border-color: #91A4B8;
padding: 10px;
}
QPushButton#startmining:hover {
background-color: #232834;
}
QPushButton#startmining:pressed {
background-color: #232834;
}
QPushButton#startmining:disabled {
background-color: #232834;
}
QPushButton#stopmining {
background-color: #343F4B;
border-color: #91A4B8;
padding: 10px;
margin-top: 7px;
}
QPushButton#stopmining:hover {
background-color: #232834;
}
QPushButton#stopmining:pressed {
background-color: #232834;
}
QPushButton#stopmining:disabled {
background-color: #232834;
}
QComboBox#genproclimit{
font-size: 24px;
height: 40px;
}
QMenu::item:selected{
background-color: #343F4B
}

BIN
res/darkwing.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 KiB

BIN
res/fekt.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

BIN
res/hushdlogo.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 19 KiB

BIN
res/jahway603.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
res/libsodium.a

Binary file not shown.

34
res/libsodium/buildlibsodium.sh

@ -1,26 +1,51 @@
#!/bin/bash
# Copyright 2019-2023 The Hush developers
# Released under the GPLv3
VERSION=1.0.18
# First thing to do is see if libsodium.a exists in the res folder. If it does, then there's nothing to do
if [ -f res/libsodium.a ]; then
echo "libsodium $VERSION is already built! Nothing to do"
exit 0
fi
echo "Building libsodium"
echo "Building libsodium $VERSION"
if ! command -v curl &> /dev/null
then
echo "curl could not be found. Please install it and try again."
exit 1
fi
# Go into the lib sodium directory
cd res/libsodium
if [ ! -f libsodium-1.0.18.tar.gz ]; then
curl -LO https://github.com/MyHush/libsodium/releases/download/1.0.18/libsodium-1.0.18.tar.gz
echo "Downloading libsodium $VERSION"
curl -L https://git.hush.is/attachments/0d9f589e-a9f9-4ddb-acaa-0f1b423b32eb -o libsodium-1.0.18.tar.gz
fi
if [ ! -f libsodium-1.0.18.tar.gz ]; then
echo "Unable to download libsodium $VERSION !!! Aborting"
exit 1
fi
if [ ! -d libsodium-1.0.18 ]; then
echo "Unpacking libsodium $VERSION"
tar xf libsodium-1.0.18.tar.gz
fi
if [ ! -d libsodium-1.0.18 ]; then
echo "Unable to unpack libsodium $VERSION !!! Aborting"
exit 1
fi
# Now build it
cd libsodium-1.0.18
echo "Configuring libsodium $VERSION"
LIBS="" ./configure
make clean
echo "Compiling libsodium $VERSION"
if [[ "$OSTYPE" == "darwin"* ]]; then
make CFLAGS="-mmacosx-version-min=10.11" CPPFLAGS="-mmacosx-version-min=10.11" -j4
else
@ -28,5 +53,10 @@ else
fi
cd ..
if [ ! -e libsodium-1.0.18/src/libsodium/.libs/libsodium.a ]; then
echo "Unable to compile libsodium $VERSION !!! Aborting"
exit 1
fi
# copy the library to the parents's res/ folder
cp libsodium-1.0.18/src/libsodium/.libs/libsodium.a ../

BIN
res/lock_closed.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
res/lock_open.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
res/logobig.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

BIN
res/onryo.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

BIN
res/remove.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
res/send.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
res/silentdragonlite_ar.qm

Binary file not shown.

1004
res/silentdragonlite_ar.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_be.qm

Binary file not shown.

1331
res/silentdragonlite_be.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_de.qm

Binary file not shown.

963
res/silentdragonlite_de.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_es.qm

Binary file not shown.

1015
res/silentdragonlite_es.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_fa.qm

Binary file not shown.

967
res/silentdragonlite_fa.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_fr.qm

Binary file not shown.

983
res/silentdragonlite_fr.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_hr.qm

Binary file not shown.

967
res/silentdragonlite_hr.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_it.qm

Binary file not shown.

1002
res/silentdragonlite_it.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_nl.qm

Binary file not shown.

2843
res/silentdragonlite_nl.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_pl.qm

Binary file not shown.

2850
res/silentdragonlite_pl.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_pt.qm

Binary file not shown.

983
res/silentdragonlite_pt.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_ru.qm

Binary file not shown.

1837
res/silentdragonlite_ru.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_sr.qm

Binary file not shown.

967
res/silentdragonlite_sr.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_tr.qm

Binary file not shown.

983
res/silentdragonlite_tr.ts

File diff suppressed because it is too large

BIN
res/silentdragonlite_zh.qm

Binary file not shown.

983
res/silentdragonlite_zh.ts

File diff suppressed because it is too large

BIN
res/synced.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
res/transaction0.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
res/transaction2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
res/transaction_abandoned.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
res/transaction_conflicted.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
res/tx_inout.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
res/tx_input.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
res/tx_mined.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
res/tx_output.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
res/verify.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
res/warning.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
res/wormholeconnect.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 79 KiB

2
run-after-build.sh

@ -1,4 +1,4 @@
#!/bin/bash
# Copyright 2019-2021 The Hush Developers
# Copyright 2019-2023 The Hush Developers
./build.sh && ./SilentDragonLite

7
silentdragon-lite.pro

@ -3,7 +3,8 @@
# Project created by QtCreator 2018-10-05T09:54:45
#
#-------------------------------------------------
# Copyright 2019-2021 The Hush Developers
# Copyright 2019-2023 The Hush Developers
# Released under the GPLv3
QT += core gui network
@ -87,6 +88,7 @@ SOURCES += \
src/Crypto/passwd.cpp
HEADERS += \
src/guiconstants.h \
src/firsttimewizard.h \
src/mainwindow.h \
src/precompiled.h \
@ -125,7 +127,6 @@ FORMS += \
src/encryption.ui \
src/hushrequest.ui \
src/mainwindow.ui \
src/migration.ui \
src/newseed.ui \
src/newwallet.ui \
src/recurringpayments.ui \
@ -163,7 +164,9 @@ TRANSLATIONS = res/silentdragonlite_ar.ts \
res/silentdragonlite_hr.ts \
res/silentdragonlite_id.ts \
res/silentdragonlite_it.ts \
res/silentdragonlite_nl.ts \
res/silentdragonlite_pt.ts \
res/silentdragonlite_pl.ts \
res/silentdragonlite_ro.ts \
res/silentdragonlite_ru.ts \
res/silentdragonlite_sr.ts \

2
src/3rdparty/sodium.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef sodium_H

2
src/Chat/Chat.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "Chat.h"

2
src/Chat/Chat.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef CHAT_H
#define CHAT_H

2
src/Chat/Helper/ChatDelegator.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// GPLv3
#ifndef CHATDELEGATOR_H

2
src/Crypto/FileEncryption.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "FileEncryption.h"

2
src/Crypto/FileEncryption.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef FILEENCRYPTION_H
#define FILEENCRYPTION_H

2
src/Crypto/passwd.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "passwd.h"

2
src/Crypto/passwd.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef PASSWD_H
#define PASSWD_H

2
src/DataStore/ChatDataStore.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "ChatDataStore.h"

2
src/DataStore/ChatDataStore.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef CHATDATASTORE_H
#define CHATDATASTORE_H

2
src/DataStore/ContactDataStore.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// GPLv3
#include "ContactDataStore.h"

2
src/DataStore/ContactDataStore.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef CONTACTDATASTORE_H
#define CONTACTDATASTORE_H

2
src/DataStore/DataStore-deprecated.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef DATASTORE_H
#define DATASTORE_H

2
src/DataStore/DataStore.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "DataStore.h"

2
src/DataStore/DataStore.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef DATASTORE_H
#define DATASTORE_H

2
src/DataStore/SietchDataStore.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "SietchDataStore.h"

2
src/DataStore/SietchDataStore.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef SIETCHDATASTORE_H
#define SIETCHDATASTORE_H

2
src/FileSystem/FileSystem.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "FileSystem.h"

2
src/FileSystem/FileSystem.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// GPLv3
#ifndef FILESYSTEM_H
#define FILESYSTEM_H

2
src/Logger/LogContext.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef LOGCONTEXT_H
#define LOGCONTEXT_H

2
src/Logger/LogCrtitical.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef LOGCRITICAL_H
#define LOGCRITICAL_H

2
src/Logger/LogDebug.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef LOGDEBUG_H
#define LOGDEBUG_H

2
src/Logger/LogError.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef LOGERROR_H
#define LOGERROR_H

2
src/Logger/LogFatal.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef LOGFATAL_H
#define LOGFATAL_H

2
src/Logger/LogInfo.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef LOGINFO_H
#define LOGINFO_H

2
src/Logger/LogStrategy.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef LOGSTRATEGY_H
#define LOGSTRATEGY_H

2
src/Logger/LogSuccess.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef LOGSUCCESS_H
#define LOGSUCCESS_H

2
src/Logger/LogType.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef LOGTYPE_H
#define LOGTYPE_H

2
src/Logger/LogWarning.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef LOGWARNING_H
#define LOGWARNING_H

2
src/Logger/LogWriter.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "LogWriter.h"

2
src/Logger/LogWriter.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef LOGWRITER_H
#define LOGWRITER_H

2
src/Logger/Logger.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef LOGGER_H
#define LOGGER_H

2
src/Logger/SimpleLogger.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef SIMPLELOGGER_H
#define SIMPLELOGGER_H

2
src/Logger/test.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "SimpleLogger.h"

2
src/Model/ChatItem.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "ChatItem.h"

2
src/Model/ChatItem.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef CHATITEM_H

2
src/Model/ContactItem.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// GPLv3
#include "ContactItem.h"
#include "chatmodel.h"

2
src/Model/ContactItem.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef CONTACTITEM_H
#define CONTACTITEM_H

2
src/Model/ContactRequest.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// GPLv3
#include "ContactRequest.h"

2
src/Model/ContactRequest.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef CONTACTREQUEST_H
#define CONTACTREQUEST_H

2
src/Model/ContactRequestChatItem.cpp

@ -1,3 +1,3 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "ContactRequestChatItem.h"

2
src/Model/ContactRequestChatItem.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifdef CONTACTREQUESTCHATITEM_H
#define CONTACTREQUESTCHATITEM_H

13
src/about.ui

@ -14,6 +14,7 @@
<string>About</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
@ -27,9 +28,19 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="qtversion">
<property name="text">
<string notr="true">QT Version</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
@ -52,7 +63,7 @@
&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; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Copyright (c) 2019-2021 The Hush developers GNU Public License V3&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Copyright (c) 2019-2023 The Hush developers GNU Public License V3&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Copyright (c) 2018-2019 Aditya Kulkarni, Duke Leto, Jane Mercer &lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;

3
src/addressbook.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "addressbook.h"
@ -304,6 +304,7 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target)
});
auto fnSetTargetLabelAddr = [=] (QLineEdit* target, QString label, QString addr, QString myAddr, QString cid, QString avatar) {
qDebug() << __func__ << ": label=" << label << " cid=" << cid << " avatar=" << avatar;
target->setText(label % "/" % addr % myAddr);
};

4
src/addressbook.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef ADDRESSBOOK_H
#define ADDRESSBOOK_H
@ -11,6 +11,8 @@ class MainWindow;
class AddressBookModel : public QAbstractTableModel {
Q_OBJECT
public:
AddressBookModel(QTableView* parent);
~AddressBookModel();

86
src/addressbook.ui

@ -145,11 +145,11 @@
<widget class="QComboBox" name="comboBoxAvatar">
<item>
<property name="text">
<string>SDLogo</string>
<string>Anonymous</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/SDLogo.png</activeon>
<activeon>:/icons/res/Anonymous.png</activeon>
</iconset>
</property>
</item>
@ -165,116 +165,56 @@
</item>
<item>
<property name="text">
<string>Denio</string>
<string>onryo</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Denio.png</activeon>
<activeon>:/icons/res/onryo.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Berg</string>
<string>fekt</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Berg.png</activeon>
<activeon>:/icons/res/fekt.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Sharpee</string>
<string>jahway603</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Sharpee.png</activeon>
<activeon>:/icons/res/jahway603.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Elsa</string>
</property>
<property name="icon">
<iconset>
<normalon>:/icons/res/Elsa.png</normalon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Yoda</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Yoda.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Garflied</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Garfield.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Snoopy</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Snoopy.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Popey</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Popey.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Pinguin</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Pinguin.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Mickey</string>
<string>Denio</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Mickey.png</activeon>
<activeon>:/icons/res/Denio.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Stag</string>
<string>Sharpee</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Stag.png</activeon>
<activeon>:/icons/res/Sharpee.png</activeon>
</iconset>
</property>
</item>
</widget>
</item>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_5">
<property name="text">

2
src/addresscombo.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "addresscombo.h"
#include "addressbook.h"

2
src/addresscombo.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef ADDRESSCOMBO_H
#define ADDRESSCOMBO_H

16
src/balancestablemodel.cpp

@ -1,9 +1,10 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "balancestablemodel.h"
#include "addressbook.h"
#include "settings.h"
#include "camount.h"
#include "guiconstants.h"
BalancesTableModel::BalancesTableModel(QObject *parent): QAbstractTableModel(parent)
{}
@ -100,9 +101,16 @@ QVariant BalancesTableModel::data(const QModelIndex &index, int role) const
}
// Else, just return the default brush
QBrush b;
b.setColor(Qt::black);
// Get current theme name
QString theme_name = Settings::getInstance()->get_theme_name();
QBrush b;
QColor color;
if (theme_name == "Dark" || theme_name == "Midnight") {
color = COLOR_WHITE;
}else{
color = COLOR_BLACK;
}
b.setColor(color);
return b;
}

8
src/balancestablemodel.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef BALANCESTABLEMODEL_H
#define BALANCESTABLEMODEL_H
@ -8,8 +8,10 @@
#include "camount.h"
class BalancesTableModel : public QAbstractTableModel
{
class BalancesTableModel : public QAbstractTableModel {
Q_OBJECT
public:
BalancesTableModel(QObject* parent);
~BalancesTableModel();

2
src/camount.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "camount.h"
#include "settings.h"

2
src/camount.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef CAMOUNT_H
#define CAMOUNT_H

2
src/chatbubbleme.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "chatbubbleme.h"
#include "ui_chatbubbleme.h"

2
src/chatbubbleme.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef CHATBUBBLEME_H
#define CHATBUBBLEME_H

2
src/chatbubblepartner.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "chatbubblepartner.h"
#include "ui_chatbubblepartner.h"

2
src/chatbubblepartner.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef CHATBUBBLEPARTNER_H
#define CHATBUBBLEPARTNER_H

21
src/chatmodel.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "chatmodel.h"
#include "settings.h"
@ -380,19 +380,18 @@ QString MainWindow::createHeaderMemo(QString type, QString cid, QString zaddr, Q
QJsonObject h;
// We use short keynames to use less space for metadata and so allow
// the user to send more actual data in memos
h["h"] = headerNumber; // header number
h["v"] = version; // HushChat version
h["z"] = zaddr; // zaddr to respond to
h["cid"] = cid; // conversation id
h["t"] = type; // Memo or incoming contact request
h["e"] = headerbytes; // Memo or incoming contact request
h["p"] = publickey; // Memo or incoming contact request
h["h"] = headerNumber; // integer, header number starting from 1
h["v"] = version; // integer, HushChat version. currently 0
h["z"] = zaddr; // string, zaddr to respond to
h["cid"] = cid; // string, conversation id (UUID)
h["t"] = type; // string, Memo or incoming contact request
h["e"] = headerbytes; // string, hex-encoded libsodium headerbytes from crypto_secretstream_xchacha20poly1305_init_push()
h["p"] = publickey; // string, hex-encoded libsodium public key from crypto_kx_seed_keypair()
j.setObject(h);
header = j.toJson();
return header;
}
@ -868,8 +867,8 @@ void MainWindow::ContactRequest() {
auto d = new QDialog(this);
auto connD = new Ui_ConnectionDialog();
connD->setupUi(d);
QMovie *movie1 = new QMovie(":/img/res/silentdragonlite-animated.gif");
QMovie *movie2 = new QMovie(":/img/res/silentdragonlite-animated-dark.gif");
QMovie *movie1 = new QMovie(":/img/res/silentdragonlite-animated-startup-dark.gif");
QMovie *movie2 = new QMovie(":/img/res/silentdragonlite-animated-startup-dark.gif");
auto theme = Settings::getInstance()->get_theme_name();
if (theme == "Dark" || theme == "Midnight") {
movie2->setScaledSize(QSize(512,512));

2
src/chatmodel.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef CHATMODEL_H

17
src/connection.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "connection.h"
#include "mainwindow.h"
@ -42,7 +42,7 @@ ConnectionLoader::ConnectionLoader(MainWindow* main, Controller* rpc)
connD->topIcon->setMovie(movie2);
movie2->start();
} else {
QMovie *movie1 = new QMovie(":/img/res/silentdragonlite-animated-startup.gif");;
QMovie *movie1 = new QMovie(":/img/res/silentdragonlite-animated-startup-dark.gif");;
movie1->setScaledSize(size);
qDebug() << "Animation light loaded";
connD->topIcon->setMovie(movie1);
@ -76,14 +76,14 @@ void ConnectionLoader::loadProgress()
void ConnectionLoader::ShowProgress()
{
qDebug() << __func__;
auto config = std::shared_ptr<ConnectionConfig>(new ConnectionConfig());
config->dangerous = false;
config->server = Settings::getInstance()->getSettings().server;
auto connection = makeConnection(config);
auto me = this;
qDebug() << __func__ << ": server=" << config->server
<< " connection=" << connection << " me=" << me;
qDebug() << __func__ << ": server=" << config->server << " connection=" << connection << " me=" << me;
isSyncing = new QAtomicInteger<bool>();
isSyncing->store(true);
@ -147,6 +147,7 @@ void ConnectionLoader::doAutoConnect()
// Check to see if there's an existing wallet
if (litelib_wallet_exists(Settings::getDefaultChainName().toStdString().c_str())) {
qDebug() << __func__ << ": using existing wallet";
main->logger->write(QObject::tr("Using existing wallet."));
char* resp = litelib_initialize_existing(
config->dangerous,
@ -175,6 +176,7 @@ void ConnectionLoader::doAutoConnect()
}
} else {
qDebug() << __func__ << ": no existing wallet";
main->logger->write(QObject::tr("Create/restore wallet."));
createOrRestore(config->dangerous, config->server);
d->show();
@ -248,6 +250,7 @@ void ConnectionLoader::doAutoConnect()
void ConnectionLoader::createOrRestore(bool dangerous, QString server)
{
qDebug() << __func__ << ": server=" << server;
// Close the startup dialog, since we'll be showing the wizard
d->hide();
// Create a wizard
@ -264,13 +267,14 @@ void ConnectionLoader::doRPCSetConnection(Connection* conn)
d->accept();
QTimer::singleShot(1, [=]() { delete this; });
QFile plaintextWallet(dirwalletconnection);
try {
QFile plaintextWallet(dirwalletconnection);
main->logger->write("Path to Wallet.dat : " );
qDebug() << __func__ << ": wallet path =" << plaintextWallet;
plaintextWallet.remove();
} catch (...) {
qDebug() << "No plaintext wallet found! file=" << plaintextWallet;
main->logger->write("no Plaintext wallet.dat");
}
@ -284,13 +288,14 @@ void ConnectionLoader::doRPCSetConnectionShield(Connection* conn)
main->getRPC()->shield([=] (auto) {});
QTimer::singleShot(1, [=]() { delete this; });
QFile plaintextWallet(dirwalletconnection);
try {
QFile plaintextWallet(dirwalletconnection);
main->logger->write("Path to Wallet.dat : " );
qDebug() << __func__ << ": wallet path =" << plaintextWallet;
plaintextWallet.remove();
} catch (...) {
main->logger->write("no Plaintext wallet.dat");
qDebug() << "No plaintext wallet found! file=" << plaintextWallet;
}
}

2
src/connection.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef CONNECTION_H
#define CONNECTION_H

2
src/contactmodel.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// GPLv3
#include "contactmodel.h"

2
src/contactmodel.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef CONTACTMODEL_H
#define CONTACTMODEL_H

86
src/contactrequest.ui

@ -229,11 +229,11 @@
</property>
<item>
<property name="text">
<string>SDLogo</string>
<string>Anonymous</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/SDLogo.png</activeon>
<activeon>:/icons/res/Anonymous.png</activeon>
</iconset>
</property>
</item>
@ -249,116 +249,56 @@
</item>
<item>
<property name="text">
<string>Denio</string>
<string>onryo</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Denio.png</activeon>
<activeon>:/icons/res/onryo.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Berg</string>
<string>fekt</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Berg.png</activeon>
<activeon>:/icons/res/fekt.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Stag</string>
<string>jahway603</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Stag.png</activeon>
<activeon>:/icons/res/jahway603.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Sharpee</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Sharpee.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Elsa</string>
</property>
<property name="icon">
<iconset>
<normalon>:/icons/res/Elsa.png</normalon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Yoda</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Yoda.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Garfield</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Garfield.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Snoopy</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Snoopy.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Popey</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Popey.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Pinguin</string>
<string>Denio</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Pinguin.png</activeon>
<activeon>:/icons/res/Denio.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Mickey</string>
<string>Sharpee</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Mickey.png</activeon>
<activeon>:/icons/res/Sharpee.png</activeon>
</iconset>
</property>
</item>
</widget>
</item>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">

61
src/controller.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "controller.h"
@ -30,6 +30,12 @@ Controller::Controller(MainWindow* main)
this->main = main;
this->ui = main->ui;
auto current_server = Settings::getInstance()->getSettings().server;
main->ui->current_server->setText(current_server);
auto stickyServer = Settings::getInstance()->getSettings().stickyServer;
main->ui->sticky_server->setText( stickyServer ? "True" : "False" );
// Setup balances table model
balancesTableModel = new BalancesTableModel(main->ui->balancesTable);
main->ui->balancesTable->setModel(balancesTableModel);
@ -37,7 +43,7 @@ Controller::Controller(MainWindow* main)
// Setup transactions table model
transactionsTableModel = new TxTableModel(ui->transactionsTable);
main->ui->transactionsTable->setModel(transactionsTableModel);
// Set up timer to refresh Price
priceTimer = new QTimer(main);
QObject::connect(priceTimer, &QTimer::timeout, [=]() {
@ -236,6 +242,7 @@ void Controller::fillTxJsonParams(json& allRecepients, Tx tx)
void Controller::noConnection()
{
qDebug()<< __func__;
QIcon i = QApplication::style()->standardIcon(QStyle::SP_MessageBoxCritical);
main->statusIcon->setPixmap(i.pixmap(16, 16));
main->statusIcon->setToolTip("");
@ -266,8 +273,9 @@ void Controller::noConnection()
/// This will refresh all the balance data from hushd
void Controller::refresh(bool force)
{
qDebug()<< __func__;
if (!zrpc->haveConnection())
return noConnection();
return;
getInfoThenRefresh(force);
}
@ -292,6 +300,7 @@ void Controller::processInfo(const json& info)
void Controller::getInfoThenRefresh(bool force)
{
qDebug()<< __func__;
if (!zrpc->haveConnection())
return noConnection();
@ -618,6 +627,7 @@ void Controller::setLag(int lag)
void Controller::refreshAddresses()
{
qDebug()<< __func__;
if (!zrpc->haveConnection())
return noConnection();
@ -870,6 +880,7 @@ void Controller::updateUIBalances()
void Controller::refreshBalances()
{
qDebug()<< __func__;
if (!zrpc->haveConnection())
return noConnection();
@ -923,6 +934,7 @@ void Controller::refreshBalances()
}
void Controller::refreshTransactions() {
qDebug()<< __func__;
if (!zrpc->haveConnection())
return noConnection();
@ -1083,21 +1095,20 @@ void Controller::refreshTransactions() {
unsigned char tag[crypto_secretstream_xchacha20poly1305_TAG_FINAL];
crypto_secretstream_xchacha20poly1305_state state;
/////Our decrypted message is now in decrypted. We need it as QString to render it
/////Only the QString gives weird data, so convert first to std::string
// crypto_secretstream_xchacha20poly1305_keygen(client_rx);
if (crypto_secretstream_xchacha20poly1305_init_pull(&state, header, server_tx) != 0) {
/* Invalid header, no need to go any further */
qDebug() << "refreshTransactions: crypto_secretstream_xchacha20poly1305_init_pull error!";
qDebug() << "refreshTransactions: crypto_secretstream_xchacha20poly1305_init_pull error! Invalid header";
continue;
}
if (crypto_secretstream_xchacha20poly1305_pull(&state, decrypted, NULL, tag, MESSAGE2, CIPHERTEXT1_LEN, NULL, 0) != 0) {
/* Invalid/incomplete/corrupted ciphertext - abort */
qDebug() << "refreshTransactions: crypto_secretstream_xchacha20poly1305_pull error!";
qDebug() << "refreshTransactions: crypto_secretstream_xchacha20poly1305_pull error! Invalid ciphertext";
continue;
}
/////Our decrypted message is now in decrypted. We need it as QString to render it
/////Only the QString gives weird data, so convert first to std::string
std::string decryptedMemo(reinterpret_cast<char*>(decrypted),MESSAGE1_LEN);
memodecrypt = QString::fromUtf8( decryptedMemo.data(), decryptedMemo.size());
@ -1433,8 +1444,8 @@ void Controller::unlockIfEncrypted(std::function<void(void)> cb, std::function<v
// Wallet is encrypted and locked. Ask for the password and unlock.
QString password = QInputDialog::getText(
main,
main->tr("Wallet Password"),
main->tr("Your wallet is encrypted.\nPlease enter your wallet password"),
QObject::tr("Wallet Password"),
QObject::tr("Your wallet is encrypted.\nPlease enter your wallet password"),
QLineEdit::Password
);
@ -1442,8 +1453,8 @@ void Controller::unlockIfEncrypted(std::function<void(void)> cb, std::function<v
{
QMessageBox::critical(
main,
main->tr("Wallet Decryption Failed"),
main->tr("Please enter a valid password"),
QObject::tr("Wallet Decryption Failed"),
QObject::tr("Please enter a valid password"),
QMessageBox::Ok
);
error();
@ -1462,7 +1473,7 @@ void Controller::unlockIfEncrypted(std::function<void(void)> cb, std::function<v
{
QMessageBox::critical(
main,
main->tr("Wallet Decryption Failed"),
QObject::tr("Wallet Decryption Failed"),
QString::fromStdString(reply["error"].get<json::string_t>()),
QMessageBox::Ok
);
@ -1532,13 +1543,14 @@ void Controller::executeTransaction(Tx tx,
error("", errStr);
});
}, [=]() {
error("", main->tr("Failed to unlock wallet"));
error("", QObject::tr("Failed to unlock wallet"));
});
}
void Controller::checkForUpdate(bool silent)
{
qDebug()<< __func__;
// No checking for updates, needs testing with Gitea
return;
if (!zrpc->haveConnection())
@ -1629,10 +1641,11 @@ void Controller::checkForUpdate(bool silent)
// Get the hush->USD price from coinmarketcap using their API
void Controller::refreshHUSHPrice()
{
qDebug()<< __func__;
if (!zrpc->haveConnection())
return noConnection();
return;
// TODO: use/render all this data
// TODO: use/render all this data
QUrl cmcURL("https://api.coingecko.com/api/v3/simple/price?ids=hush&vs_currencies=btc%2Cusd%2Ceur%2Ceth%2Cgbp%2Ccny%2Cjpy%2Crub%2Ccad%2Csgd%2Cchf%2Cinr%2Caud%2Cinr&include_market_cap=true&include_24hr_vol=true&include_24hr_change=true");
QNetworkRequest req;
@ -1982,7 +1995,12 @@ void Controller::refreshHUSHPrice()
void Controller::shutdownhushd()
{
// Save the wallet and exit the lightclient library cleanly.
if (zrpc->haveConnection())
if (!zrpc) {
zrpc = new LiteInterface();
qDebug() << __func__ << ": created new rpc connection zrpc=" << zrpc;
}
if (zrpc && zrpc->haveConnection())
{
QDialog d(main);
Ui_ConnectionDialog connD;
@ -1997,15 +2015,15 @@ void Controller::shutdownhushd()
connD.topIcon->setMovie(movie2);
movie2->start();
connD.status->setText(QObject::tr("Please wait for SilentDragonLite to exit"));
connD.statusDetail->setText(QObject::tr("Please wait for SilentDragonLite to exit"));
connD.statusDetail->setText(QObject::tr("It may take several minutes"));
} else {
QMovie *movie1 = new QMovie(":/img/res/silentdragonlite-animated-startup.gif");;
QMovie *movie1 = new QMovie(":/img/res/silentdragonlite-animated-startup-dark.gif");;
movie1->setScaledSize(size);
qDebug() << "Animation light loaded";
connD.topIcon->setMovie(movie1);
movie1->start();
connD.status->setText(QObject::tr("Please wait for SilentDragonLite to exit"));
connD.statusDetail->setText(QObject::tr("Waiting for hushd to exit"));
connD.statusDetail->setText(QObject::tr("It may take several minutes"));
}
bool finished = false;
@ -2013,10 +2031,13 @@ void Controller::shutdownhushd()
if (!finished)
d.accept();
finished = true;
qDebug() << __func__ << ": saveWallet finished";
});
if (!finished)
d.exec();
} else {
qDebug() << __func__ << ": No zrpc object, unclean shutdown and unable to call saveWallet!";
}
}

2
src/datamodel.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "datamodel.h"

2
src/datamodel.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef DATAMODEL_H
#define DATAMODEL_H

104
src/deposithush.ui

@ -14,7 +14,64 @@
<string>Deposit Hush</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<item row="2" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>214</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="QRCodeLabel" name="qrcodeDisplayDeposit">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>300</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>300</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: #fff</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="2" column="0">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>214</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="4">
<widget class="QTextBrowser" name="textBrowser">
<property name="maximumSize">
<size>
@ -24,42 +81,44 @@
</property>
<property name="html">
<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;
&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;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
hr { height: 1px; border-width: 0; }
li.unchecked::marker { content: &quot;\2610&quot;; }
li.checked::marker { content: &quot;\2612&quot;; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.AppleSystemUIFont'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Ubuntu'; font-size:16pt;&quot;&gt;Please use the following hush address to transfer funds to SilentDragonLite. You can either copy the address or use the QR Code. &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label">
<item row="5" column="0">
<widget class="QPushButton" name="CopyAddress">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;QR Code of your Hush Address&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>Copy Address</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<item row="3" column="0" colspan="4">
<widget class="QLabel" name="label_2">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; text-decoration: underline;&quot;&gt;Your Hush Address &lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<item row="4" column="0" colspan="4">
<widget class="QLabel" name="zaddr">
<property name="text">
<string>Hush zaddr</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QPushButton" name="CopyAddress">
<property name="text">
<string>Copy Address</string>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="6" column="1">
<item row="6" column="0" colspan="4">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -69,19 +128,10 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QRCodeLabel" name="qrcodeDisplayDeposit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: #fff</string>
</property>
<item row="1" column="0" colspan="4">
<widget class="QLabel" name="label">
<property name="text">
<string/>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;QR Code of your Hush Address&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>

23
src/fillediconlabel.cpp

@ -1,6 +1,8 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2022 The Hush developers
// Released under the GPLv3
#include "fillediconlabel.h"
#include "settings.h"
#include "guiconstants.h"
FilledIconLabel::FilledIconLabel(QWidget* parent) :
QLabel(parent) {
@ -20,8 +22,25 @@ void FilledIconLabel::resizeEvent(QResizeEvent*) {
QPixmap scaled = basePm.scaled(sz, Qt::KeepAspectRatio, Qt::SmoothTransformation);
QString theme_name = Settings::getInstance()->get_theme_name();
QColor color;
if (theme_name == "Blue"){
color = COLOR_BLUE_BG;
}else if(theme_name == "Light"){
color = COLOR_LIGHT_BG;
}else if(theme_name == "Dark"){
color = COLOR_DARK_BG;
}else if(theme_name =="Midnight"){
color = COLOR_MIDNIGHT_BG;
}else if(theme_name =="dragonx"){
color = COLOR_DRAGONX_BG;
}else{
color = COLOR_DEFAULT_BG;
}
QPixmap p(sz);
p.fill(Qt::white);
p.fill(color);
QPainter painter(&p);
painter.drawPixmap((sz.width() - scaled.width()) / 2, (sz.height() - scaled.height()) / 2, scaled);

2
src/fillediconlabel.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef FILLEDICONLABEL_H
#define FILLEDICONLABEL_H

171
src/firsttimewizard.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "firsttimewizard.h"
#include "ui_newseed.h"
@ -7,7 +7,6 @@
#include "ui_newwallet.h"
#include "mainwindow.h"
#include "DataStore/DataStore.h"
#include "../lib/silentdragonlitelib.h"
#ifdef Q_OS_WIN
@ -50,8 +49,13 @@ void FirstTimeWizard::slot_change_theme(const QString& theme_name) {
}
FirstTimeWizard::FirstTimeWizard(bool dangerous, QString server)
{
FirstTimeWizard::FirstTimeWizard(bool dangerous, QString server){
qDebug() << __func__ << ": dangerous=" << dangerous << " server=" << server;
// Set window flags and disable close button - force user to use Wizard's cancel button to prevent funk
this->setWindowFlags(this->windowFlags() | Qt::CustomizeWindowHint);
this->setWindowFlags(this->windowFlags() & ~Qt::WindowCloseButtonHint);
// Include css
QString theme_name;
try
@ -64,21 +68,19 @@ FirstTimeWizard::FirstTimeWizard(bool dangerous, QString server)
}
this->slot_change_theme(theme_name);
setWindowTitle("New wallet wizard");
setWindowTitle(tr("New wallet wizard"));
this->dangerous = dangerous;
this->server = server;
////backup addresslabels.dat if there is one, to restore it later
//backup addresslabels.dat if there is one, to restore it later
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
QString addressbook = dir.filePath("addresslabels.dat.enc");
QFile file(addressbook);
if (file.exists())
{
file.rename(dir.filePath("addresslabels.dat.enc-backup"));
if (file.exists()) {
file.rename(dir.filePath("addresslabels.dat.enc-backup"));
qDebug() << __func__ << ": backed up old addresslabels";
}
// Create the pages
@ -104,88 +106,90 @@ int FirstTimeWizard::nextId() const {
QString FirstTimeWizard::getSeed()
{
return _seed;
}
void FirstTimeWizard::setSeed(QString seed)
{
_seed = seed;
}
QString FirstTimeWizard::getBirthday()
{
return _birthday;
}
void FirstTimeWizard::setBirthday(QString birthday)
{
_birthday = birthday;
}
void FirstTimeWizard::initializePage() {
qDebug() << "FirstTimeWizard:" <<__func__;
}
void NewOrRestorePage::initializePage() {
qDebug() << "NewOrRestorePage:" <<__func__;
}
NewOrRestorePage::NewOrRestorePage(FirstTimeWizard *parent) : QWizardPage(parent) {
setTitle("Create or Restore wallet.");
qDebug() << __func__;
setTitle(tr("Create or Restore wallet."));
QWidget* pageWidget = new QWidget();
Ui_CreateWalletForm form;
form.setupUi(pageWidget);
QGraphicsScene* scene = new QGraphicsScene();
QGraphicsView* view = new QGraphicsView(scene);
form.Logo->setScene(scene);
QPixmap pixmap(":/icons/res/dark-01.png");
scene->addPixmap(pixmap);
form.Logo->show();
setButtonText(QWizard::CommitButton, tr("Next"));
// Remove back button
parent->setOption(QWizard::NoBackButtonOnStartPage);
parent->setOption(QWizard::NoBackButtonOnLastPage);
parent->button(QWizard::CommitButton)->setEnabled(false);
setButtonText(QWizard::CommitButton, "Next");
form.txtPassword->setEnabled(false);
form.txtConfirmPassword->setEnabled(false);
QObject::connect(form.TOS, &QRadioButton::clicked, [=](bool checked) {
QObject::connect(form.TOS, &QRadioButton::clicked, [=](bool checked) {
qDebug() << __func__ << ": TOS radio button clicked";
if (checked) {
form.txtPassword->setEnabled(true);
form.txtConfirmPassword->setEnabled(true);
}else{
qDebug() << __func__ << ": disabling next/commit buttons";
parent->button(QWizard::CommitButton)->setEnabled(false);
parent->button(QWizard::NextButton)->setEnabled(false);
}
});
});
auto fnPasswordEdited = [=](const QString&) {
auto fnPasswordEdited = [=](const QString&) {
// Enable the Finish button if the passwords match.
QString passphraseBlank = form.txtPassword->text();
QString passphrase = QString("HUSH3") + passphraseBlank + QString("SDL");
if (!form.txtPassword->text().isEmpty() &&
form.txtPassword->text() == form.txtConfirmPassword->text() && passphraseBlank.size() >= 16 ){
form.lblPasswordMatch->setText("");
form.radioRestoreWallet->setEnabled(true);
form.radioNewWallet->setEnabled(true);
form.radioNewWallet->setChecked(true);
parent->button(QWizard::NextButton)->setEnabled(false);
int length = passphrase.length();
form.lblPasswordMatch->setText("");
form.radioRestoreWallet->setEnabled(true);
form.radioNewWallet->setEnabled(true);
parent->button(QWizard::NextButton)->setEnabled(false);
int length = passphrase.length();
qDebug() << __func__ << ": passphrase length=" << length;
char *sequence = NULL;
sequence = new char[length+1];
strncpy(sequence, passphrase.toUtf8(), length +1);
QString passphraseHash = blake3_PW(sequence);
char *sequence1 = NULL;
sequence1 = new char[length+1];
@ -200,18 +204,20 @@ NewOrRestorePage::NewOrRestorePage(FirstTimeWizard *parent) : QWizardPage(parent
unsigned char key[KEY_LEN];
if (crypto_pwhash
(key, sizeof key, PASSWORD, strlen(PASSWORD), hash,
if (crypto_pwhash(key, sizeof key, PASSWORD, strlen(PASSWORD), hash,
crypto_pwhash_OPSLIMIT_SENSITIVE, crypto_pwhash_MEMLIMIT_SENSITIVE,
crypto_pwhash_ALG_DEFAULT) != 0) {
/* out of memory */
}
qDebug() << __func__ << ": crypto_pwhash failed! Possibly out of memory";
exit(1);
}
QString passphraseHash1 = QByteArray(reinterpret_cast<const char*>(key), KEY_LEN).toHex();
DataStore::getChatDataStore()->setPassword(passphraseHash1);
// Exclusive buttons
QObject::connect(form.radioNewWallet, &QRadioButton::clicked, [=](bool checked) {
if (checked) {
qDebug() << __func__ << ": new wallet radio button clicked";
form.radioRestoreWallet->setChecked(false);
parent->button(QWizard::CommitButton)->setEnabled(true);
@ -220,18 +226,16 @@ NewOrRestorePage::NewOrRestorePage(FirstTimeWizard *parent) : QWizardPage(parent
QObject::connect(form.radioRestoreWallet, &QRadioButton::clicked, [=](bool checked) {
if (checked) {
qDebug() << __func__ << ": restore wallet radio button clicked";
form.radioNewWallet->setChecked(false);
parent->button(QWizard::CommitButton)->setEnabled(true);
}
});
} else {
form.lblPasswordMatch->setText(tr("Passphrase don't match or You have entered too few letters (16 minimum)"));
qDebug() << __func__ << ": passphrases do not match";
form.lblPasswordMatch->setText(tr("Passphrase don't match or You have entered too few letters (16 minimum)"));
parent->button(QWizard::CommitButton)->setEnabled(false);
form.radioRestoreWallet->setEnabled(false);
@ -243,24 +247,38 @@ NewOrRestorePage::NewOrRestorePage(FirstTimeWizard *parent) : QWizardPage(parent
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(pageWidget);
setLayout(layout);
QObject::connect(form.txtConfirmPassword, &QLineEdit::textChanged, fnPasswordEdited);
QObject::connect(form.txtPassword, &QLineEdit::textChanged, fnPasswordEdited);
registerField("intro.new", form.radioNewWallet);
registerField("intro.restore", form.radioRestoreWallet);
// A trailing * means these are REQUIRED fields and "Next" button will be disabled
// until they are filled
registerField("TOS*", form.TOS);
registerField("txtPassword*", form.txtPassword);
registerField("txtConfirmPassword*", form.txtPassword);
form.radioRestoreWallet->setEnabled(false);
form.radioNewWallet->setEnabled(false);
qDebug() << __func__ << ": disabling next/commit buttons";
setCommitPage(true);
parent->button(QWizard::CommitButton)->setEnabled(false);
parent->button(QWizard::NextButton)->setEnabled(false);
// Connect cancelEvent
disconnect(parent->button(QWizard::CancelButton ), SIGNAL( clicked() ), parent, SLOT( reject() ) );
connect(parent->button(QWizard::CancelButton ), SIGNAL( clicked() ), parent, SLOT( cancelEvent() ) );
}
NewSeedPage::NewSeedPage(FirstTimeWizard *parent) : QWizardPage(parent) {
qDebug() << __func__;
this->parent = parent;
setTitle("Your new wallet");
setTitle(tr("Your new wallet"));
QWidget* pageWidget = new QWidget();
form.setupUi(pageWidget);
@ -273,9 +291,11 @@ NewSeedPage::NewSeedPage(FirstTimeWizard *parent) : QWizardPage(parent) {
void NewSeedPage::initializePage() {
// Call the library to create a new wallet.
qDebug() << __func__;
char* resp = litelib_initialize_new(parent->dangerous,parent->server.toStdString().c_str());
QString reply = litelib_process_response(resp);
qDebug() << __func__ << ": reply=" << reply;
auto parsed = json::parse(reply.toStdString().c_str(), nullptr, false);
if (parsed.is_discarded() || parsed.is_null() || parsed.find("seed") == parsed.end()) {
@ -287,26 +307,27 @@ void NewSeedPage::initializePage() {
parent->setSeed(seed);
parent->setBirthday(birthday);
form.birthday->setPlainText(birthday);
parent->button(QWizard::CancelButton)->setEnabled(false);
disconnect(parent->button(QWizard::CancelButton ), SIGNAL( clicked() ), parent, SLOT( reject() ) );
connect(parent->button(QWizard::CancelButton ), SIGNAL( clicked() ), parent, SLOT( cancelEvent() ) );
qDebug() << __func__ << ": page initialized with birthday=" << birthday;
}
}
void FirstTimeWizard::cancelEvent()
{
if( QMessageBox::question( this, ( "Quit Setup" ), ( "Setup is not complete yet. Are you sure you want to quit setup?" ), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) {
// allow cancel
reject();
}
void FirstTimeWizard::cancelEvent() {
qDebug() << __func__;
if( QMessageBox::question( this, tr(( "Quit Setup" )), tr(( "Setup is not complete yet. Are you sure you want to quit setup and close the app?" )), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) {
qDebug() << __func__ << ": wizard canceled";
// Allow cancel
reject();
// Close the app
qApp->exit();
}
}
// Will be called just before closing. Make sure we can save the seed in the wallet
// before we allow the page to be closed
bool NewSeedPage::validatePage() {
qDebug() << __func__;
Ui_verifyseed verifyseed;
QDialog dialog(this);
@ -315,7 +336,6 @@ bool NewSeedPage::validatePage() {
form.birthday->setVisible(false);
form.txtSeed->setVisible(false);
QString seed = parent->getSeed();
QString birthday = parent->getBirthday();
@ -603,8 +623,7 @@ bool NewSeedPage::validatePage() {
return true;
}
}else{
qDebug()<<"Falscher Seed";
qDebug()<<"Wrong Seed";
QFile file(dirwalletencfirst);
QFile file1(dirwalletfirst);
@ -618,13 +637,15 @@ bool NewSeedPage::validatePage() {
return false;
this->validatePage();
}
return false;
}
RestoreSeedPage::RestoreSeedPage(FirstTimeWizard *parent) : QWizardPage(parent) {
this->parent = parent;
setTitle("Restore wallet from seed");
setTitle(tr("Restore wallet from seed"));
QWidget* pageWidget = new QWidget();
form.setupUi(pageWidget);
@ -637,8 +658,10 @@ RestoreSeedPage::RestoreSeedPage(FirstTimeWizard *parent) : QWizardPage(parent)
bool RestoreSeedPage::validatePage() {
// 1. Validate that we do have 24 words
QString seed = form.txtSeed->toPlainText().replace(QRegExp("[ \n\r\t]+"), " ");
if (seed.trimmed().split(" ").length() != 24) {
QString seed = form.txtSeed->toPlainText().replace(QRegExp("[ \n\r\t]+"), " "); //TODO: use .simplified()
auto seedLength = seed.trimmed().split(" ").length();
qDebug() << __func__ << ": seed length=" << seedLength;
if (seedLength != 24) {
QMessageBox::warning(this, tr("Failed to restore wallet"),
tr("SilentDragonLite needs 24 words to restore wallet"),
QMessageBox::Ok);
@ -648,18 +671,19 @@ bool RestoreSeedPage::validatePage() {
// 2. Validate birthday
QString birthday_str = form.txtBirthday->text();
bool ok;
qint64 birthday = birthday_str.toUInt(&ok);
// simplified() Returns a string that has whitespace removed from the start and the end, and that has each sequence of internal whitespace replaced with a single space.
qint64 birthday = birthday_str.simplified().toUInt(&ok);
if (!ok) {
qDebug() << __func__ << ": Failed to parse wallet birthday=" << birthday_str;
QMessageBox::warning(this, tr("Failed to parse wallet birthday"),
tr("Couldn't understand wallet birthday. This should be a block height from where to rescan the wallet. You can leave it as '0' if you don't know what it should be."),
tr("Couldn't understand wallet birthday. This should be a block height from where to rescan the wallet. You can leave the default if you don't know what it should be."),
QMessageBox::Ok);
return false;
}
///Number
QString number_str = form.number->text();
qint64 number = number_str.toUInt();
///Number
QString number_str = form.number->text();
qint64 number = number_str.toUInt();
// 3. Attempt to restore wallet with the seed phrase
{
char* resp = litelib_initialize_new_from_phrase(parent->dangerous, parent->server.toStdString().c_str(),
@ -681,6 +705,7 @@ qint64 number = number_str.toUInt();
auto parsed = json::parse(reply.toStdString().c_str(), nullptr, false);
if (parsed.is_discarded() || parsed.is_null() || parsed.find("result") == parsed.end()) {
qDebug() << __func__ << ": Failed to save wallet, reply=" << reply;
QMessageBox::warning(this, tr("Failed to save wallet"),
tr("Couldn't save the wallet") + "\n" + reply,
QMessageBox::Ok);

28
src/firsttimewizard.h

@ -1,4 +1,4 @@
// Copyright 2019-2020 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef FIRSTTIMEWIZARD_H
#define FIRSTTIMEWIZARD_H
@ -12,7 +12,7 @@
class FirstTimeWizard: public QWizard
{
Q_OBJECT
public:
FirstTimeWizard(bool dangerous, QString server);
@ -23,16 +23,17 @@ public:
QString _seed;
void setSeed(QString Seed);
void setBirthday(QString Birthday);
void cancelEvent();
public slots:
void slot_change_theme(const QString& themeName);
void cancelEvent();
protected:
int nextId() const;
virtual void initializePage();
private:
FirstTimeWizard* parent;
enum {
Page_NewOrRestore,
Page_New,
@ -46,19 +47,29 @@ private:
friend class NewSeedPage;
friend class RestoreSeedPage;
};
class NewOrRestorePage: public QWizardPage {
Q_OBJECT
public:
NewOrRestorePage(FirstTimeWizard* parent);
protected:
virtual void initializePage();
private:
FirstTimeWizard* parent;
};
class NewSeedPage: public QWizardPage {
Q_OBJECT
public:
NewSeedPage(FirstTimeWizard* parent);
@ -74,6 +85,9 @@ private:
class RestoreSeedPage: public QWizardPage {
Q_OBJECT
public:
RestoreSeedPage(FirstTimeWizard* parent);
@ -85,6 +99,4 @@ private:
Ui_RestoreSeedForm form;
};
#endif // FIRSTTIMEWIZARD_H

20
src/guiconstants.h

@ -0,0 +1,20 @@
// Copyright 2019-2022 The Hush developers
// Released under the GPLv3
#ifndef GUICONSTANTS_H
#define GUICONSTANTS_H
// Generic colors
#define COLOR_BLACK QColor(0, 0, 0)
#define COLOR_WHITE QColor(255, 255, 255)
#define COLOR_UNCONFIRMED_TX QColor(255, 0, 0)
#define COLOR_DRAGONX_TEXT QColor(145, 164, 184)
// Theme background colors
#define COLOR_DEFAULT_BG QColor(229, 229, 229)
#define COLOR_BLUE_BG QColor(229, 229, 229)
#define COLOR_LIGHT_BG QColor(218, 218, 218)
#define COLOR_DARK_BG QColor(48, 51, 53)
#define COLOR_MIDNIGHT_BG QColor(17, 17, 17)
#define COLOR_DRAGONX_BG QColor(35, 40, 52)
#endif // GUICONSTANTS_H

2
src/liteinterface.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "liteinterface.h"

2
src/liteinterface.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef hushDRPC_H
#define hushDRPC_H

2
src/logger.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "logger.h"

2
src/logger.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef LOGGER_H
#define LOGGER_H

2
src/main.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include <singleapplication.h>

464
src/mainwindow.cpp

@ -1,11 +1,10 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "mainwindow.h"
#include "addressbook.h"
#include "viewalladdresses.h"
#include "ui_encryption.h"
#include "ui_mainwindow.h"
#include "ui_mobileappconnector.h"
#include "ui_addressbook.h"
#include "ui_privkey.h"
#include "ui_about.h"
@ -76,12 +75,12 @@ MainWindow::MainWindow(QWidget *parent) :
}
this->slot_change_theme(theme_name);
ui->setupUi(this);
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
if (!dir.exists()){
qDebug() << __func__ << ": creating dir=" << dir.absolutePath();
QDir().mkpath(dir.absolutePath());
}else{}
@ -108,11 +107,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
@ -159,14 +157,6 @@ MainWindow::MainWindow(QWidget *parent) :
// Export transactions
QObject::connect(ui->actionExport_transactions, &QAction::triggered, this, &MainWindow::exportTransactions);
// Connect mobile app
QObject::connect(ui->actionConnect_Mobile_App, &QAction::triggered, this, [=] () {
if (rpc->getConnection() == nullptr)
return;
AppDataServer::getInstance()->connectAppDialog(this);
});
// Rescan
QObject::connect(ui->actionRescan, &QAction::triggered, [=]() {
@ -175,7 +165,6 @@ MainWindow::MainWindow(QWidget *parent) :
restoreSeed.setupUi(&dialog);
Settings::saveRestore(&dialog);
rpc->fetchSeed([=](json reply) {
if (isJsonError(reply)) {
return;
@ -246,26 +235,29 @@ MainWindow::MainWindow(QWidget *parent) :
tr("Couldn't save the wallet") + "\n" + reply,
QMessageBox::Ok);
} else {}
} else {
qDebug() << __func__ << ": saved wallet correctly";
}
dialog.close();
// To rescan, we clear the wallet state, and then reload the connection
dialog.close();
// To rescan, we clear the wallet state, and then reload the connection
// This will start a sync, and show the scanning status.
this->getRPC()->clearWallet([=] (auto) {
qDebug() << "Clearing wallet...";
// Save the wallet
this->getRPC()->saveWallet([=] (auto) {
qDebug() << "Saving wallet...";
// Then reload the connection. The ConnectionLoader deletes itself.
auto cl = new ConnectionLoader(this, rpc);
cl->loadConnection();
});
});
cl->loadConnection();
});
});
}
}
});
dialog.exec();
});
dialog.exec();
});
// Import Privkey
@ -282,6 +274,8 @@ MainWindow::MainWindow(QWidget *parent) :
QString version = QString("Version ") % QString(APP_VERSION) % " (" % QString(__DATE__) % ")";
about.versionLabel->setText(version);
about.qtversion->setText( QString("QT Version ") % QString(QT_VERSION_STR) );
aboutDialog.exec();
});
@ -385,11 +379,14 @@ void MainWindow::closeEvent(QCloseEvent* event) {
s.sync();
// Let the RPC know to shut down any running service.
rpc->shutdownhushd();
int passphraselenght = DataStore::getChatDataStore()->getPassword().length();
if(rpc){
rpc->shutdownhushd();
}
int passphraselength = DataStore::getChatDataStore()->getPassword().length();
// Check is encryption is ON for SDl
if(passphraselenght > 0) {
if(passphraselength > 0) {
// delete old file before
//auto dirHome = QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
@ -432,7 +429,12 @@ void MainWindow::closeEvent(QCloseEvent* event) {
void MainWindow::closeEventpw(QCloseEvent* event) {
// Let the RPC know to shut down any running service.
rpc->shutdownhushd();
qDebug() << __func__ << ": event=" << event << " this=" << this;
if (rpc) {
rpc->shutdownhushd();
} else {
qDebug() << __func__ << ": invalid rpc object!";
}
}
void MainWindow::encryptWallet() {
@ -441,6 +443,8 @@ void MainWindow::encryptWallet() {
Ui_encryptionDialog ed;
ed.setupUi(&d);
qDebug() << __func__ << ": start";
// Handle edits on the password box
auto fnPasswordEdited = [=](const QString&) {
@ -489,12 +493,17 @@ void MainWindow::encryptWallet() {
unsigned char key[KEY_LEN];
if (crypto_pwhash
(key, sizeof key, PASSWORD, strlen(PASSWORD), hash,
if (crypto_pwhash(key, sizeof key, PASSWORD, strlen(PASSWORD), hash,
crypto_pwhash_OPSLIMIT_SENSITIVE, crypto_pwhash_MEMLIMIT_SENSITIVE,
crypto_pwhash_ALG_DEFAULT) != 0) {
/* out of memory */
}
QMessageBox::information(this, tr("Out of memory!"),
QString("Please close some other programs to free up memory and try again"),
QMessageBox::Ok
);
qDebug() << __func__ << ": out of memory!";
exit(1);
}
QString passphraseHash1 = QByteArray(reinterpret_cast<const char*>(key), KEY_LEN).toHex();
DataStore::getChatDataStore()->setPassword(passphraseHash1);
@ -513,19 +522,26 @@ void MainWindow::encryptWallet() {
QMessageBox::Ok
);
}
qDebug() << __func__ << ": finish";
}
void MainWindow::removeWalletEncryption() {
qDebug() << __func__ << ": removing wallet encryption";
QDialog d(this);
Ui_removeencryption ed;
ed.setupUi(&d);
qDebug() << __func__ << ": done with setupUi";
if (fileExists(dirwalletenc) == false) {
QMessageBox::information(this, tr("Wallet is not encrypted"),
tr("Your wallet is not encrypted with a passphrase."),
QMessageBox::Ok
);
qDebug() << __func__ << ": wallet=" << dirwalletenc << " does NOT exist";
return;
} else {
qDebug() << __func__ << ": wallet=" << dirwalletenc << " exists";
}
auto fnPasswordEdited = [=](const QString&) {
@ -545,12 +561,16 @@ void MainWindow::removeWalletEncryption() {
QObject::connect(ed.txtConfirmPassword, &QLineEdit::textChanged, fnPasswordEdited);
QObject::connect(ed.txtPassword, &QLineEdit::textChanged, fnPasswordEdited);
qDebug() << __func__ << ": connected GUI events";
if (d.exec() == QDialog::Accepted) {
QString passphraseBlank = ed.txtPassword->text(); // data comes from user inputs
QString passphrase = QString("HUSH3") + passphraseBlank + QString("SDL");
int length = passphrase.length();
qDebug() << __func__ << ": Passphrase length = " << length;
char *sequence = NULL;
sequence = new char[length+1];
strncpy(sequence, passphrase.toUtf8(), length +1);
@ -561,7 +581,6 @@ void MainWindow::removeWalletEncryption() {
sequence1 = new char[length+1];
strncpy(sequence1, passphraseHash.toUtf8(), length+1);
#define hash ((const unsigned char *) sequence1)
#define PASSWORD sequence
#define KEY_LEN crypto_box_SEEDBYTES
@ -571,62 +590,63 @@ void MainWindow::removeWalletEncryption() {
if (crypto_pwhash(key, sizeof key, PASSWORD, strlen(PASSWORD), hash,
crypto_pwhash_OPSLIMIT_SENSITIVE, crypto_pwhash_MEMLIMIT_SENSITIVE, crypto_pwhash_ALG_DEFAULT) != 0) {
/* out of memory */
qDebug() << "crypto_pwhash failed!";
return;
qDebug() << __func__ << ": crypto_pwhash failed! Possibly out of memory";
return;
}
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
auto dirHome = QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
QString target_encwallet_file = dirwalletenc;
QString target_decwallet_file = dirwallet;
FileEncryption::decrypt(target_decwallet_file, target_encwallet_file, key);
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
auto dirHome = QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
QString target_encwallet_file = dirwalletenc;
QString target_decwallet_file = dirwallet;
FileEncryption::decrypt(target_decwallet_file, target_encwallet_file, key);
QFile filencrypted(dirwalletenc);
QFile wallet(dirwallet);
QFile filencrypted(dirwalletenc);
QFile wallet(dirwallet);
qDebug() << __func__ << ": wallet size=" << wallet.size();
if (wallet.size() > 0) {
QMessageBox::information(this, tr("Wallet decryption Success"),
QString("Successfully delete the encryption"),
QMessageBox::Ok
);
filencrypted.remove();
} else {
QMessageBox::critical(this, tr("Wallet Encryption Failed"),
QString("False password, please try again"),
QMessageBox::Ok
);
this->removeWalletEncryption();
this->removeWalletEncryption();
}
}
}
void MainWindow::removeWalletEncryptionStartUp() {
QDialog d(this);
qDebug() << __func__ << ": removing wallet encryption";
QDialog d(this);
Ui_startup ed;
ed.setupUi(&d);
QObject::connect(ed.new_restore, &QPushButton::clicked, [&] {
// Connect cancel button to close app on queued connection
QObject::connect(ed.buttonBox, &QDialogButtonBox::rejected, qApp, &QCoreApplication::quit, Qt::QueuedConnection);
d.close();
QFile wallet(dirwallet);
QFile walletenc(dirwalletenc);
// Connect new/restore button click
QObject::connect(ed.new_restore, &QPushButton::clicked, [&] {
wallet.remove();
walletenc.remove();
d.close();
QFile wallet(dirwallet);
QFile walletenc(dirwalletenc);
auto cl = new ConnectionLoader(this, rpc);
cl->loadConnection();
});
if (d.exec() == QDialog::Accepted)
{
wallet.remove();
walletenc.remove();
auto cl = new ConnectionLoader(this, rpc);
cl->loadConnection();
});
if (d.exec() == QDialog::Accepted){
QString passphraseBlank = ed.txtPassword->text(); // data comes from user inputs
QString passphrase = QString("HUSH3") + passphraseBlank + QString("SDL");
@ -643,21 +663,23 @@ void MainWindow::removeWalletEncryptionStartUp() {
sequence1 = new char[length+1];
strncpy(sequence1, passphraseHash.toUtf8(), length+1);
#define MESSAGE ((const unsigned char *) sequence)
#define MESSAGE_LEN length
#define hash ((const unsigned char *) sequence1)
#define MESSAGE ((const unsigned char *) sequence)
#define MESSAGE_LEN length
#define hash ((const unsigned char *) sequence1)
#define PASSWORD sequence
#define KEY_LEN crypto_box_SEEDBYTES
#define PASSWORD sequence
#define KEY_LEN crypto_box_SEEDBYTES
unsigned char key[KEY_LEN];
unsigned char key[KEY_LEN];
if (crypto_pwhash(key, sizeof key, PASSWORD, strlen(PASSWORD), hash,
crypto_pwhash_OPSLIMIT_SENSITIVE, crypto_pwhash_MEMLIMIT_SENSITIVE,
crypto_pwhash_ALG_DEFAULT) != 0) {
/* out of memory */
qDebug() << __func__ << ": crypto_pwhash failed! Possibly out of memory";
return;
}
if (crypto_pwhash
(key, sizeof key, PASSWORD, strlen(PASSWORD), hash,
crypto_pwhash_OPSLIMIT_SENSITIVE, crypto_pwhash_MEMLIMIT_SENSITIVE,
crypto_pwhash_ALG_DEFAULT) != 0) {
/* out of memory */
}
QString passphraseHash1 = QByteArray(reinterpret_cast<const char*>(key), KEY_LEN).toHex();
DataStore::getChatDataStore()->setPassword(passphraseHash1);
@ -668,26 +690,21 @@ void MainWindow::removeWalletEncryptionStartUp() {
FileEncryption::decrypt(target_decwallet_file, target_encwallet_file, key);
auto dirHome = QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
QFile wallet(dirwallet);
qDebug() << __func__ << ": wallet size=" << wallet.size();
auto dirHome = QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
QFile wallet(dirwallet);
if (wallet.size() == 0)
{
QMessageBox::critical(this, tr("Wallet Encryption Failed"),
QString("false password please try again"),
QMessageBox::Ok
);
this->removeWalletEncryptionStartUp();
}else{}
if (wallet.size() == 0) {
QMessageBox::critical(this, tr("Wallet Encryption Failed"),
QString("false password please try again"),
QMessageBox::Ok
);
this->removeWalletEncryptionStartUp();
}else{}
}else{
this->doClosePw();
}
}
QString MainWindow::getPassword()
@ -827,10 +844,13 @@ void MainWindow::setupSettingsModal() {
// List of default servers
settings.cmbServer->addItem("https://lite.hush.is");
settings.cmbServer->addItem("https://lite.hush.land");
settings.cmbServer->addItem("https://devo.crabdance.com");
settings.cmbServer->addItem("https://lite.nyami.org");
settings.cmbServer->addItem("https://lite.hush.community");
settings.cmbServer->addItem("https://wtfistheinternet.hush.is");
settings.cmbServer->addItem("https://lite.myhush.org");
settings.cmbServer->addItem("https://poop.granitefone.me");
settings.cmbServer->addItem("https://lite.hushpool.is");
//settings.cmbServer->addItem("https://hush.leto.net:5420");
settings.cmbServer->addItem("https://lite2.hushpool.is");
//TODO: seperate lists of https/Tor servers, only show user or attempt
// connection to .onion if user has it enabled
//settings.cmbServer->addItem("6onaaujm4ozaokzu.onion:80");
@ -895,60 +915,48 @@ void MainWindow::website() {
QDesktopServices::openUrl(QUrl(url));
}
void MainWindow::doImport(QList<QString>* 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<QString>* 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.
@ -990,6 +998,7 @@ bool MainWindow::eventFilter(QObject *object, QEvent *event) {
// will prompt for one. If the myAddr is empty, then the default from address is used to send
// the transaction.
void MainWindow::payhushURI(QString uri, QString myAddr) {
qDebug() << __func__ << ": uri=" << uri << " myAddr=" << myAddr;
// If the Payments UI is not ready (i.e, all balances have not loaded), defer the payment URI
if (!isPaymentsReady()) {
qDebug() << "Payment UI not ready, waiting for UI to pay URI";
@ -1436,8 +1445,7 @@ void MainWindow::setupTransactionsTab() {
int lastPost = memo.trimmed().lastIndexOf(QRegExp("[\r\n]+"));
QString lastWord = memo.right(memo.length() - lastPost - 1);
if (Settings::getInstance()->isSaplingAddress(lastWord) ||
Settings::getInstance()->isSproutAddress(lastWord)) {
if (Settings::getInstance()->isSaplingAddress(lastWord)) {
menu.addAction(tr("Reply to ") + lastWord.left(25) + "...", [=]() {
// First, cancel any pending stuff in the send tab by pretending to click
// the cancel button
@ -2413,22 +2421,19 @@ void MainWindow::addNewZaddr(bool sapling) {
// Just double make sure the z-address is still checked
if ( sapling && ui->rdioZSAddr->isChecked() ) {
ui->listReceiveAddresses->insertItem(0, addr);
ui->listReceiveAddresses->insertItem(0, addr);
ui->listReceiveAddresses->setCurrentIndex(0);
ui->statusBar->showMessage(QString::fromStdString("Created new zaddr") %
(sapling ? "(Sapling)" : "(Sprout)"),
10 * 1000);
ui->statusBar->showMessage(QString::fromStdString("Created new zaddr"), 10 * 1000);
}
});
}
// Adds sapling or sprout z-addresses to the combo box. Technically, returns a
// Adds sapling z-addresses to the combo box. Technically, returns a
// lambda, which can be connected to the appropriate signal
std::function<void(bool)> MainWindow::addZAddrsToComboList(bool sapling) {
return [=] (bool checked) {
if (checked) {
return [=] (bool checked) {
if (checked) {
auto addrs = this->rpc->getModel()->getAllZAddresses();
// Save the current address, so we can update it later
@ -2451,38 +2456,11 @@ std::function<void(bool)> MainWindow::addZAddrsToComboList(bool sapling) {
if (addrs.isEmpty()) {
addNewZaddr(sapling);
}
}
}
};
}
void MainWindow::setupReceiveTab() {
auto addNewTAddr = [=] () {
rpc->createNewTaddr([=] (json reply) {
QString addr = QString::fromStdString(reply.get<json::array_t>()[0]);
// Make sure the RPC class reloads the t-addrs for future use
rpc->refreshAddresses();
// Just double make sure the t-address is still checked
if (ui->rdioTAddr->isChecked()) {
ui->listReceiveAddresses->insertItem(0, addr);
ui->listReceiveAddresses->setCurrentIndex(0);
ui->statusBar->showMessage(tr("Created new t-Addr"), 10 * 1000);
}
});
};
// 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
if (checked) {
updateTAddrCombo(checked);
}
});
// View all addresses goes to "View all private keys"
QObject::connect(ui->btnViewAllAddresses, &QPushButton::clicked, [=] () {
// If there's no RPC, return
@ -2496,12 +2474,8 @@ void MainWindow::setupReceiveTab() {
Settings::saveRestoreTableHeader(viewaddrs.tblAddresses, &d, "viewalladdressestable");
viewaddrs.tblAddresses->horizontalHeader()->setStretchLastSection(true);
QList<QString> allAddresses;
if (ui->rdioTAddr->isChecked()) {
allAddresses = getRPC()->getModel()->getAllTAddresses();
} else {
allAddresses = getRPC()->getModel()->getAllZAddresses();
}
QList<QString> allAddresses;
allAddresses = getRPC()->getModel()->getAllZAddresses();
ViewAllAddressesModel model(viewaddrs.tblAddresses, allAddresses, getRPC());
viewaddrs.tblAddresses->setModel(&model);
@ -2555,18 +2529,16 @@ void MainWindow::setupReceiveTab() {
if (ui->rdioZSAddr->isChecked()) {
addNewZaddr(true);
} else if (ui->rdioTAddr->isChecked()) {
addNewTAddr();
}
});
// Focus enter for the Receive Tab
QObject::connect(ui->tabWidget, &QTabWidget::currentChanged, [=] (int tab) {
if (tab == 2) {
if (tab == 3) {
// Switched to receive tab, select the z-addr radio button
ui->rdioZSAddr->setChecked(true);
// And then select the first one
ui->listReceiveAddresses->setCurrentIndex(0);
}
@ -2680,94 +2652,16 @@ void MainWindow::setupReceiveTab() {
});
}
void MainWindow::updateTAddrCombo(bool checked) {
if (checked) {
auto utxos = this->rpc->getModel()->getUTXOs();
// Save the current address so we can restore it later
auto currentTaddr = ui->listReceiveAddresses->currentText();
ui->listReceiveAddresses->clear();
// Maintain a set of addresses so we don't duplicate any, because we'll be adding
// t addresses multiple times
QSet<QString> addrs;
// 1. Add all t addresses that have a balance
std::for_each(utxos.begin(), utxos.end(), [=, &addrs](auto& utxo) {
auto addr = utxo.address;
if (Settings::isTAddress(addr) && !addrs.contains(addr)) {
auto bal = rpc->getModel()->getAllBalances().value(addr);
ui->listReceiveAddresses->addItem(addr, bal);
addrs.insert(addr);
}
});
// 2. Add all t addresses that have a label
auto allTaddrs = this->rpc->getModel()->getAllTAddresses();
QSet<QString> labels;
for (auto p : AddressBook::getInstance()->getAllAddressLabels()) {
labels.insert(p.getPartnerAddress());
}
std::for_each(allTaddrs.begin(), allTaddrs.end(), [=, &addrs] (auto& taddr) {
// If the address is in the address book, add it.
if (labels.contains(taddr) && !addrs.contains(taddr)) {
addrs.insert(taddr);
ui->listReceiveAddresses->addItem(taddr, CAmount::fromqint64(0));
}
});
// 3. Add all t-addresses. We won't add more than 20 total t-addresses,
// since it will overwhelm the dropdown
for (int i=0; addrs.size() < 20 && i < allTaddrs.size(); i++) {
auto addr = allTaddrs.at(i);
if (!addrs.contains(addr)) {
addrs.insert(addr);
// Balance is zero since it has not been previously added
ui->listReceiveAddresses->addItem(addr, CAmount::fromqint64(0));
}
}
// 4. Add the previously selected t-address
if (!currentTaddr.isEmpty() && Settings::isTAddress(currentTaddr)) {
// Make sure the current taddr is in the list
if (!addrs.contains(currentTaddr)) {
auto bal = rpc->getModel()->getAllBalances().value(currentTaddr);
ui->listReceiveAddresses->addItem(currentTaddr, bal);
}
ui->listReceiveAddresses->setCurrentText(currentTaddr);
}
// 5. Add a last, disabled item if there are remaining items
if (allTaddrs.size() > addrs.size()) {
auto num = QString::number(allTaddrs.size() - addrs.size());
ui->listReceiveAddresses->addItem("-- " + num + " more --", CAmount::fromqint64(0));
QStandardItemModel* model = qobject_cast<QStandardItemModel*>(ui->listReceiveAddresses->model());
QStandardItem* item = model->findItems("--", Qt::MatchStartsWith)[0];
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
}
}
};
// Updates the labels everywhere on the UI. Call this after the labels have been updated
void MainWindow::updateLabels() {
// Update the Receive tab
if (ui->rdioTAddr->isChecked()) {
updateTAddrCombo(true);
}
else {
addZAddrsToComboList(ui->rdioZSAddr->isChecked())(true);
}
addZAddrsToComboList(ui->rdioZSAddr->isChecked())(true);
// Update the autocomplete
updateLabelsAutoComplete();
}
void MainWindow::slot_change_currency(const QString& currency_name)
{
void MainWindow::slot_change_currency(const QString& currency_name) {
Settings::getInstance()->set_currency_name(currency_name);
@ -2783,28 +2677,35 @@ void MainWindow::slot_change_currency(const QString& currency_name)
}
}
void MainWindow::slot_change_theme(const QString& theme_name)
{
void MainWindow::slot_change_theme(const QString& theme_name) {
Settings::getInstance()->set_theme_name(theme_name);
qDebug() << __func__ << ": theme_name=" << theme_name;
if (theme_name == "Dark" || theme_name == "Default" || theme_name == "Light" ||
theme_name == "Midnight" || theme_name == "Blue" || theme_name == "dragonx") {
Settings::getInstance()->set_theme_name(theme_name);
} else {
qDebug() << __func__ << ": ignoring invalid theme_name=" << theme_name;
Settings::getInstance()->set_theme_name("Dark");
}
// Include css
QString saved_theme_name;
try
{
try {
saved_theme_name = Settings::getInstance()->get_theme_name();
}
catch (...)
{
} catch (const std::exception& e) {
qDebug() << QString("Ignoring theme change Exception! : ");
saved_theme_name = "Dark";
}
QFile qFile(":/css/res/css/" + saved_theme_name +".css");
QString filename = ":/css/res/css/" + saved_theme_name +".css";
QFile qFile(filename);
qDebug() << __func__ << ": attempting to open filename=" << filename;
if (qFile.open(QFile::ReadOnly))
{
QString styleSheet = QLatin1String(qFile.readAll());
this->setStyleSheet(""); // resets styles, makes app restart unnecessary
this->setStyleSheet(""); // reset styles
this->setStyleSheet(styleSheet);
}
@ -2837,8 +2738,9 @@ void MainWindow::on_givemeZaddr_clicked()
QMessageBox::information(this, "Your new HushChat address was copied to your clipboard!",hushchataddr);
ui->listReceiveAddresses->insertItem(0, hushchataddr);
ui->listReceiveAddresses->setCurrentIndex(0);
qDebug() << __func__ << ": hushchat zaddr=" << hushchataddr << " created";
});
});
}

2
src/mainwindow.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

841
src/mainwindow.ui

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1308</width>
<height>779</height>
<width>1379</width>
<height>781</height>
</rect>
</property>
<property name="palette">
@ -55,11 +55,11 @@
<normaloff>:/icons/res/icon.ico</normaloff>:/icons/res/icon.ico</iconset>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<number>5</number>
</property>
<widget class="QWidget" name="tab_6">
<attribute name="title">
@ -93,7 +93,6 @@
<widget class="QLabel" name="contactNameMemo">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@ -711,7 +710,6 @@
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@ -724,7 +722,6 @@
<widget class="QLabel" name="balTotal">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@ -883,7 +880,6 @@
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@ -956,8 +952,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1260</width>
<height>509</height>
<width>1301</width>
<height>493</height>
</rect>
</property>
<layout class="QVBoxLayout" name="sendToLayout">
@ -1262,21 +1258,14 @@
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QRadioButton" name="rdioZSAddr">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>z-Addr</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rdioTAddr">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>t-Addr</string>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
@ -1318,6 +1307,9 @@
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<property name="topMargin">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
@ -1434,16 +1426,37 @@
</item>
</layout>
</item>
<item>
<item alignment="Qt::AlignTop">
<widget class="QRCodeLabel" name="qrcodeDisplay">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>228</width>
<height>228</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: #fff</string>
<string notr="true"/>
</property>
<property name="text">
<string/>
@ -1480,390 +1493,447 @@
<attribute name="title">
<string>Information about Hush</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<widget class="FilledIconLabel" name="hushdlogo">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_5">
<property name="minimumSize">
<size>
<width>650</width>
<height>650</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="title">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="FilledIconLabel" name="hushdlogo">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>20</x>
<y>20</y>
<width>300</width>
<height>300</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>300</width>
<height>300</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>300</width>
<height>300</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
</widget>
<widget class="QGroupBox" name="groupBox_5">
<property name="geometry">
<rect>
<x>336</x>
<y>12</y>
<width>1001</width>
<height>650</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>650</width>
<height>650</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="title">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label_16">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Hush Blockchain Information&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_5">
<item row="2" column="1">
<widget class="QLabel" name="label_20">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</widget>
</item>
<item row="9" column="2">
<widget class="QLabel" name="supply_total">
<property name="text">
<string>Loading...</string>
</property>
</spacer>
</widget>
</item>
<item>
<widget class="QLabel" name="label_16">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
<item row="9" column="1">
<widget class="QLabel" name="label_38">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_32">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Hush Blockchain Information&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>Next Halving</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="7" column="2">
<widget class="QLabel" name="supply_taddr">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_5">
<item row="2" column="1">
<widget class="QLabel" name="label_20">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="9" column="2">
<widget class="QLabel" name="supply_total">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLabel" name="label_38">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_32">
<property name="text">
<string>Next Halving</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QLabel" name="supply_taddr">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="label_18">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="blockHeight">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Vendor</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="halvingTime">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="Vendor">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLabel" name="last_notarized">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="difficulty">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_28">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="label_34">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_33">
<property name="text">
<string>Difficulty</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_23">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Last Notarized Block</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="Version">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_26">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_37">
<property name="text">
<string>Total Supply</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_13">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Longestchain</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_29">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Version hushlightd</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_30">
<property name="text">
<string>BlockHeight</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_35">
<property name="text">
<string>Supply zAddr</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_22">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLabel" name="supply_zaddr">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLabel" name="longestchain">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_36">
<property name="text">
<string>Supply tAddr</string>
</property>
</widget>
</item>
</layout>
<item row="6" column="1">
<widget class="QLabel" name="label_18">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="0" column="2">
<widget class="QLabel" name="blockHeight">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_24">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Vendor</string>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QLabel" name="halvingTime">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Hush Market Information&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>Loading...</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="1" column="2">
<widget class="QLabel" name="Vendor">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="2">
<widget class="QLabel" name="marketcapTab">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>Market Cap</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="volumeExchange">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Volume on Exchanges</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_11">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
<item row="4" column="2">
<widget class="QLabel" name="last_notarized">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<item row="6" column="2">
<widget class="QLabel" name="difficulty">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_14">
<item row="5" column="1">
<widget class="QLabel" name="label_28">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;This is a Lightwallet, you cant mine with it!&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="8" column="1">
<widget class="QLabel" name="label_34">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_33">
<property name="text">
<string>Difficulty</string>
</property>
</spacer>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_23">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_27">
<property name="text">
<string>Last Notarized Block</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="Version">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_26">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_37">
<property name="text">
<string>Total Supply</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="current_server_label">
<property name="text">
<string>Current Server</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLabel" name="label_23">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="10" column="2">
<widget class="QLabel" name="current_server">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="sticky_server_label">
<property name="text">
<string>Sticky Server</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QLabel" name="label_23">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="11" column="2">
<widget class="QLabel" name="sticky_server">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_13">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Longestchain</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_29">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Version hushlightd</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_30">
<property name="text">
<string>BlockHeight</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_35">
<property name="text">
<string>Supply zAddr</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_22">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QLabel" name="supply_zaddr">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLabel" name="longestchain">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_36">
<property name="text">
<string>Supply tAddr</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_24">
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Hush Market Information&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="2">
<widget class="QLabel" name="marketcapTab">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>Market Cap</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="volumeExchange">
<property name="text">
<string>Loading...</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Volume on Exchanges</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_11">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;|&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_14">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt; &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
@ -1874,8 +1944,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1308</width>
<height>22</height>
<width>1379</width>
<height>24</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
@ -1896,19 +1966,12 @@
<property name="title">
<string>&amp;Help</string>
</property>
<addaction name="actionDonate"/>
<addaction name="actionTelegram"/>
<addaction name="actionWebsite"/>
<addaction name="actionCheck_for_Updates"/>
<addaction name="actionFile_a_bug"/>
<addaction name="actionAbout"/>
</widget>
<widget class="QMenu" name="menuApps">
<property name="title">
<string>&amp;Apps</string>
</property>
<addaction name="actionConnect_Mobile_App"/>
</widget>
<widget class="QMenu" name="menu_Edit">
<property name="title">
<string>&amp;Edit</string>
@ -1925,7 +1988,6 @@
</widget>
<addaction name="menuFile"/>
<addaction name="menu_Edit"/>
<addaction name="menuApps"/>
<addaction name="menuHelp"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
@ -1995,14 +2057,6 @@
<string>Pay hush &amp;URI...</string>
</property>
</action>
<action name="actionConnect_Mobile_App">
<property name="text">
<string>Connect mobile &amp;app</string>
</property>
<property name="shortcut">
<string>Ctrl+M</string>
</property>
</action>
<action name="action_Recurring_Payments">
<property name="text">
<string>&amp;Recurring Payments</string>
@ -2072,7 +2126,6 @@
<tabstop>sendTransactionButton</tabstop>
<tabstop>cancelSendButton</tabstop>
<tabstop>rdioZSAddr</tabstop>
<tabstop>rdioTAddr</tabstop>
<tabstop>listReceiveAddresses</tabstop>
<tabstop>txtReceive</tabstop>
<tabstop>rcvLabel</tabstop>

2
src/memoedit.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "memoedit.h"

8
src/memoedit.h

@ -1,12 +1,14 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef MEMOEDIT_H
#define MEMOEDIT_H
#include "precompiled.h"
class MemoEdit : public QPlainTextEdit
{
class MemoEdit : public QPlainTextEdit {
Q_OBJECT
public:
MemoEdit(QWidget* parent);

139
src/migration.ui

@ -1,139 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MigrationDialog</class>
<widget class="QDialog" name="MigrationDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>511</width>
<height>498</height>
</rect>
</property>
<property name="windowTitle">
<string>Migration Turnstile</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="9" column="0" colspan="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="7" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Migration History</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="1">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Migrated Amount</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QTableView" name="tblTxids">
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Unmigrated Amount</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="lblUnMigrated">
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="lblMigrated">
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="chkEnabled">
<property name="text">
<string>Sprout -&gt; Sapling migration enabled</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="label">
<property name="text">
<string>If enabled, hushd will slowly migrate your Sprout shielded funds to your Sapling address. </string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="lblSaplingAddress">
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>MigrationDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>MigrationDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

2
src/mobileappconnector.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "mobileappconnector.h"
#include "ui_mobileappconnector.h"

2
src/mobileappconnector.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef MOBILEAPPCONNECTOR_H
#define MOBILEAPPCONNECTOR_H

2
src/newseed.ui

@ -17,7 +17,7 @@
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>This is your new wallet's seed phrase. PLEASE BACK IT UP SECURELY.</string>
<string>This is your new wallet's seed phrase. PLEASE BACK IT UP SECURELY. Write it on paper. Do not store it anywhere others can access it.</string>
</property>
<property name="wordWrap">
<bool>true</bool>

5
src/newwallet.ui

@ -110,6 +110,9 @@ p, li { white-space: pre-wrap; }
<height>16777215</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">color: red;</string>
</property>
<property name="text">
<string>I accept the Terms of Service</string>
</property>
@ -146,7 +149,7 @@ p, li { white-space: pre-wrap; }
<string notr="true">color: red;</string>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;Passphrase don't match&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string></string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>

2
src/precompiled.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#if defined __cplusplus
/* Add C++ includes here */

18
src/qrcodelabel.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "qrcodelabel.h"
@ -12,7 +12,7 @@ QRCodeLabel::QRCodeLabel(QWidget *parent) :
QSize QRCodeLabel::sizeHint() const
{
int w = this->width();
return QSize(w, w); // 1:1
return QSize(w, w); // 1:1
}
void QRCodeLabel::resizeEvent(QResizeEvent*)
@ -25,8 +25,8 @@ QPixmap QRCodeLabel::scaledPixmap() const {
QPixmap pm(size());
pm.fill(Qt::white);
QPainter painter(&pm);
qrcodegen::QrCode qr = qrcodegen::QrCode::encodeText(str.toUtf8().constData(), qrcodegen::QrCode::Ecc::LOW);
qrcodegen::QrCode qr = qrcodegen::QrCode::encodeText(str.toUtf8().constData(), qrcodegen::QrCode::Ecc::HIGH);
const int s = qr.getSize()>0?qr.getSize():1;
const double w = pm.width();
const double h = pm.height();
@ -35,8 +35,8 @@ QPixmap QRCodeLabel::scaledPixmap() const {
const double scale = size/(s+2);
const double woff = (w - size) > 0 ? (w - size) / 2 : 0;
const double hoff = (h - size) > 0 ? (h - size) / 2 : 0;
// NOTE: For performance reasons my implementation only draws the foreground parts
// NOTE: For performance reasons my implementation only draws the foreground parts
painter.setPen(Qt::NoPen);
painter.setBrush(QColor(Qt::black));
for(int y=0; y<s; y++) {
@ -49,7 +49,11 @@ QPixmap QRCodeLabel::scaledPixmap() const {
}
}
}
// TODO: Maybe add logo if it doesn't break QR code - requires setting Ecc to HIGH
painter.drawPixmap((w/2)-50, (h/2)-50, 100, 100, QPixmap(":/img/res/logobig.gif"));
painter.end();
return pm;
}

2
src/qrcodelabel.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef QRCODELABEL_H
#define QRCODELABEL_H

2
src/recurring.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "recurring.h"

6
src/recurring.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef RECURRING_H
#define RECURRING_H
@ -121,6 +121,8 @@ private:
// Model for list of configured recurring payments
class RecurringListViewModel : public QAbstractTableModel {
Q_OBJECT
public:
RecurringListViewModel(QTableView* parent);
~RecurringListViewModel() = default;
@ -138,6 +140,8 @@ private:
// Model for history of payments
class RecurringPaymentsListViewModel : public QAbstractTableModel {
Q_OBJECT
public:
RecurringPaymentsListViewModel(QTableView* parent, RecurringPaymentInfo rpi);
~RecurringPaymentsListViewModel() = default;

2
src/recurringdialog.ui

@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Reccuring Dialog</string>
<string>Recurring Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">

2
src/recurringpayments.ui

@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Reocurring Payments</string>
<string>Recurring Payments</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">

90
src/requestContactDialog.ui

@ -326,29 +326,29 @@
<rect>
<x>417</x>
<y>430</y>
<width>106</width>
<width>130</width>
<height>25</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>106</width>
<width>130</width>
<height>25</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>106</width>
<width>130</width>
<height>25</height>
</size>
</property>
<item>
<property name="text">
<string>SDLogo</string>
<string>Anonymous</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/SDLogo.png</activeon>
<activeon>:/icons/res/Anonymous.png</activeon>
</iconset>
</property>
</item>
@ -364,111 +364,51 @@
</item>
<item>
<property name="text">
<string>Denio</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Denio.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Berg</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Berg.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Sharpee</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Sharpee.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Elsa</string>
<string>onryo</string>
</property>
<property name="icon">
<iconset>
<normalon>:/icons/res/Elsa.png</normalon>
<activeon>:/icons/res/onryo.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Yoda</string>
<string>fekt</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Yoda.png</activeon>
<activeon>:/icons/res/fekt.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Garfield</string>
<string>jahway603</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Garfield.png</activeon>
<activeon>:/icons/res/jahway603.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Snoopy</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Snoopy.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Popey</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Popey.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Pinguin</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Pinguin.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Mickey</string>
<string>Denio</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Mickey.png</activeon>
<activeon>:/icons/res/Denio.png</activeon>
</iconset>
</property>
</item>
<item>
<property name="text">
<string>Stag</string>
<string>Sharpee</string>
</property>
<property name="icon">
<iconset>
<activeon>:/icons/res/Stag.png</activeon>
<activeon>:/icons/res/Sharpee.png</activeon>
</iconset>
</property>
</item>

2
src/requestdialog.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "requestdialog.h"
#include "ui_requestdialog.h"

2
src/requestdialog.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef REQUESTDIALOG_H
#define REQUESTDIALOG_H

72
src/restoreSeed.ui

@ -1,72 +0,0 @@
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>Dialog</class>
<widget class="QDialog" name="Dialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>Dialog</string>
</property>
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="geometry" >
<rect>
<x>30</x>
<y>240</y>
<width>341</width>
<height>32</height>
</rect>
</property>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</widget>
<pixmapfunction></pixmapfunction>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>Dialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel" >
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>Dialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel" >
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

2
src/restoreseed.ui

@ -62,7 +62,7 @@
</font>
</property>
<property name="text">
<string>Wallet birthday is the block height at which the wallet had the first transaction. If you don't know this, you can leave it as &quot;0&quot; (It'll take longer to rescan)</string>
<string>Wallet birthday is the block height at which the wallet had the first transaction. If you don't know this, you can leave the default. (It'll take longer to rescan)</string>
</property>
<property name="wordWrap">
<bool>true</bool>

19
src/scripts/translation_analysis.sh

@ -0,0 +1,19 @@
#!/bin/bash
echo -n AR: ;grep unfinished silentdragonlite_ar.ts | wc -l
echo -n BE: ;grep unfinished silentdragonlite_be.ts | wc -l
echo -n DE: ;grep unfinished silentdragonlite_de.ts | wc -l
echo -n ES: ;grep unfinished silentdragonlite_es.ts | wc -l
echo -n FA: ;grep unfinished silentdragonlite_fa.ts | wc -l
echo -n FR: ;grep unfinished silentdragonlite_fr.ts | wc -l
echo -n HR: ;grep unfinished silentdragonlite_hr.ts | wc -l
echo -n ID: ;grep unfinished silentdragonlite_id.ts | wc -l
echo -n IT: ;grep unfinished silentdragonlite_it.ts | wc -l
echo -n NL: ;grep unfinished silentdragonlite_nl.ts | wc -l
echo -n PT: ;grep unfinished silentdragonlite_pt.ts | wc -l
echo -n RO: ;grep unfinished silentdragonlite_ro.ts | wc -l
echo -n RU: ;grep unfinished silentdragonlite_ru.ts | wc -l
echo -n SR: ;grep unfinished silentdragonlite_sr.ts | wc -l
echo -n TR: ;grep unfinished silentdragonlite_tr.ts | wc -l
echo -n UD: ;grep unfinished silentdragonlite_ud.ts | wc -l
echo -n ZH: ;grep unfinished silentdragonlite_zh.ts | wc -l

19
src/sendtab.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "mainwindow.h"
#include "ui_mainwindow.h"
@ -845,8 +845,8 @@ void MainWindow::sendButton() {
auto d = new QDialog(this);
auto connD = new Ui_ConnectionDialog();
connD->setupUi(d);
QMovie *movie1 = new QMovie(":/img/res/silentdragonlite-animated.gif");;
QMovie *movie2 = new QMovie(":/img/res/silentdragonlite-animated-dark.gif");;
QMovie *movie1 = new QMovie(":/img/res/silentdragonlite-animated-startup-dark.gif");;
QMovie *movie2 = new QMovie(":/img/res/silentdragonlite-animated-startup-dark.gif");;
auto theme = Settings::getInstance()->get_theme_name();
if (theme == "Dark" || theme == "Midnight") {
movie2->setScaledSize(QSize(512,512));
@ -881,6 +881,19 @@ void MainWindow::sendButton() {
ui->tabWidget->setCurrentIndex(0);
});
auto stickyServer = Settings::getInstance()->getSettings().stickyServer;
if(stickyServer) {
qDebug() << "Not changing servers because stickyServer=1";
} else {
// After each transaction, change servers to spread out
// (ip,txid) metadata across different lite servers
// TODO: should we try to ensure that our new random server is actually different?
auto server = Settings::getRandomServer();
qDebug() << "Changed server to " << server << " for extreme privacy";
ui->statusBar->showMessage("Changed server to " % server);
ui->current_server->setText(server);
}
// Force a UI update so we get the unconfirmed Tx
rpc->refresh(true);

46
src/settings.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "mainwindow.h"
#include "settings.h"
@ -23,9 +23,6 @@ Config Settings::getSettings() {
// Load from the QT Settings.
QSettings s;
// this domain is stolen and malicious!
// More info: https://git.hush.is/hush/fraud/#gilardh
auto malicious = "lite.myhush.org";
auto server = s.value("connection/server").toString();
bool sticky = s.value("connection/stickyServer").toBool();
bool torOnly = s.value("connection/torOnly").toBool();
@ -35,13 +32,6 @@ Config Settings::getSettings() {
server.chop(1);
}
// Users that have old configs generated from old SDLs will have this hostname
if(server == malicious or server == (QString("https://") + malicious)) {
qDebug() << "Replacing malicious SDL server with " << server;
server = getRandomServer();
s.setValue("connection/server", server);
}
// default behavior : no server listed in conf, randomly choose from server list, unless sticky
if (server.trimmed().isEmpty()) {
server = Settings::getRandomServer();
@ -95,13 +85,6 @@ bool Settings::isSaplingAddress(QString addr) {
(!isTestnet() && addr.startsWith("zs1"));
}
bool Settings::isSproutAddress(QString addr) {
if (!isValidAddress(addr))
return false;
return isZAddress(addr) && !isSaplingAddress(addr);
}
bool Settings::isZAddress(QString addr) {
if (!isValidAddress(addr))
return false;
@ -302,13 +285,19 @@ QString Settings::getRandomServer() {
// The more servers from different TLDs, the better
QList<QString> servers = {
"https://lite.hush.is",
"https://devo.crabdance.com",
"https://lite.hush.community",
"https://lite.myhush.org",
"https://wtfistheinternet.hush.is",
"https://poop.granitefone.me",
// These can be un-commented to test out how code deals with down servers
//"https://thisisdown1.example.com",
//"https://thisisdown2.example.com",
//"https://thisisdown3.example.com",
//"https://thisisdown4.example.com",
//"https://thisisdown5.example.com",
"https://lite.hush.land"
"https://lite.hush.land",
"https://lite.hushpool.is",
"https://lite2.hushpool.is"
};
// we don't need cryptographic random-ness, but we want
@ -322,7 +311,14 @@ QString Settings::getRandomServer() {
while (tries < servers.size() ) {
qDebug() << "Checking if lite server " << server << " is a alive, try=" << tries;
char* resp = litelib_initialize_existing(false, server.toStdString().c_str());
QString response = litelib_process_response(resp);
QString response = "";
try {
response = litelib_process_response(resp);
} catch (const std::exception& e) {
qDebug() << __func__ << ": litelib_process_response threw an exception, ignoring: " << e.what();
}
// if we see a valid connection, return this server
if (response.toUpper().trimmed() == "OK") {
@ -358,14 +354,6 @@ QString Settings::getTokenName() {
}
}
QString Settings::getDonationAddr() {
if (Settings::getInstance()->isTestnet())
return "ztestsaplingXXX";
else
return "zs1fq9f7vg797qaeac9lyx0njyjmjg4w7m60hwq6lhyhvdcqltl5hdkm8vwx9cxy60ehuuz2x49jxt";
}
CAmount Settings::getMinerFee() {
return CAmount::fromqint64(10000);
}

3
src/settings.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef SETTINGS_H
#define SETTINGS_H
@ -42,7 +42,6 @@ public:
void setTestnet(bool isTestnet);
bool isSaplingAddress(QString addr);
bool isSproutAddress(QString addr);
bool isValidSaplingPrivateKey(QString pk);

5
src/settings.ui

@ -138,11 +138,6 @@
<string>Default</string>
</property>
</item>
<item>
<property name="text">
<string>test</string>
</property>
</item>
</widget>
<widget class="QCheckBox" name="chkFetchPrices">
<property name="geometry">

65
src/txtablemodel.cpp

@ -1,8 +1,9 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "txtablemodel.h"
#include "settings.h"
#include "controller.h"
#include "guiconstants.h"
TxTableModel::TxTableModel(QObject *parent)
: QAbstractTableModel(parent) {
@ -87,6 +88,17 @@ QString TxTableModel::concatMultipleMemos(const TransactionItem& dat) const {
};
QVariant TxTableModel::data(const QModelIndex &index, int role) const {
// Get current theme name
QString theme_name = Settings::getInstance()->get_theme_name();
QBrush b;
QColor color;
if (theme_name == "Dark" || theme_name == "Midnight") {
color = COLOR_WHITE;
}else{
color = COLOR_BLACK;
}
// Align numeric columns (confirmations, amount) right
if (role == Qt::TextAlignmentRole &&
(index.column() == Column::Confirmations || index.column() == Column::Amount))
@ -95,15 +107,11 @@ QVariant TxTableModel::data(const QModelIndex &index, int role) const {
auto dat = modeldata->at(index.row());
if (role == Qt::ForegroundRole) {
if (dat.confirmations <= 0) {
QBrush b;
b.setColor(Qt::red);
return b;
}
// Else, just return the default brush
QBrush b;
b.setColor(Qt::black);
return b;
b.setColor(color);
return b;
}
if (role == Qt::DisplayRole) {
@ -195,29 +203,30 @@ QVariant TxTableModel::data(const QModelIndex &index, int role) const {
hasMemo = true;
}
}
// If the memo is a Payment URI, then show a payment request icon
if (dat.items.length() == 1 && dat.items[0].memo.startsWith("hush:")) {
QIcon icon(":/icons/res/paymentreq.gif");
QImage image = colorizeIcon(QIcon(":/icons/res/paymentreq.gif"), color);
QIcon icon;
icon.addPixmap(QPixmap::fromImage(image));
return QVariant(icon.pixmap(16, 16));
} else if (hasMemo) {
// Return the info pixmap to indicate memo
QIcon icon(":/icons/res/mail.png");
return QVariant(icon.pixmap(16, 16));
} else {
if (dat.type == "Receive"){
// Empty pixmap to make it align
QPixmap p(16, 16);
QIcon icon = QApplication::style()->standardIcon(QStyle::SP_ArrowLeft);
return QVariant(icon.pixmap(16, 16));
}
if (dat.type == "Receive"){
QImage image = colorizeIcon(QIcon(":/icons/res/tx_input.png"), color);
QIcon icon;
icon.addPixmap(QPixmap::fromImage(image));
return QVariant(icon.pixmap(16, 16));
}
if (dat.type == "send"){
// Empty pixmap to make it align
QPixmap p(16, 16);
QIcon icon = QApplication::style()->standardIcon(QStyle::SP_ArrowForward);
return QVariant(icon.pixmap(16, 16));
}
QImage image = colorizeIcon(QIcon(":/icons/res/tx_output.png"), color);
QIcon icon;
icon.addPixmap(QPixmap::fromImage(image));
return QVariant(icon.pixmap(16, 16));
}
}
}
@ -278,3 +287,17 @@ QString TxTableModel::getAmt(int row) const {
}
return total.toDecimalString();
}
QImage TxTableModel::colorizeIcon(QIcon icon, QColor color) const{
QImage img(icon.pixmap(16, 16).toImage());
img = img.convertToFormat(QImage::Format_ARGB32);
for (int x = img.width(); x--; )
{
for (int y = img.height(); y--; )
{
const QRgb rgb = img.pixel(x, y);
img.setPixel(x, y, qRgba(color.red(), color.green(), color.blue(), qAlpha(rgb)));
}
}
return img;
}

3
src/txtablemodel.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef STRINGSTABLEMODEL_H
#define STRINGSTABLEMODEL_H
@ -38,6 +38,7 @@ public:
int columnCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
QImage colorizeIcon(const QIcon icon, const QColor color) const;
private:
QString concatMultipleMemos(const TransactionItem&) const;

4
src/version.h

@ -1,3 +1,3 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#define APP_VERSION "1.5.2"
#define APP_VERSION "1.5.3"

2
src/viewalladdresses.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "viewalladdresses.h"
#include "camount.h"

4
src/viewalladdresses.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef VIEWALLADDRESSES_H
#define VIEWALLADDRESSES_H
@ -8,6 +8,8 @@
class ViewAllAddressesModel : public QAbstractTableModel {
Q_OBJECT
public:
ViewAllAddressesModel(QTableView* parent, QList<QString> taddrs, Controller* rpc);
~ViewAllAddressesModel() = default;

8
src/websockets.cpp

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#include "websockets.h"
#include "controller.h"
@ -705,9 +705,6 @@ void AppDataServer::processSendTx(QJsonObject sendTx, MainWindow* mainwindow, st
auto allBalances = mainwindow->getRPC()->getModel()->getAllBalances();
QList<QPair<QString, CAmount>> bals;
for (auto i : allBalances.keys()) {
// Filter out sprout addresses
if (Settings::getInstance()->isSproutAddress(i))
continue;
// Filter out balances that don't have the requisite amount
if (allBalances.value(i) < amt)
continue;
@ -796,9 +793,6 @@ void AppDataServer::processSendManyTx(QJsonObject sendmanyTx, MainWindow* mainwi
auto allBalances = mainwindow->getRPC()->getModel()->getAllBalances();
QList<QPair<QString, CAmount>> bals;
for (auto i : allBalances.keys()) {
// Filter out sprout addresses
if (Settings::getInstance()->isSproutAddress(i))
continue;
// Filter out balances that don't have the requisite amount
if (allBalances.value(i) < amt)
continue;

2
src/websockets.h

@ -1,4 +1,4 @@
// Copyright 2019-2021 The Hush developers
// Copyright 2019-2023 The Hush developers
// Released under the GPLv3
#ifndef WEBSOCKETS_H
#define WEBSOCKETS_H

2
util/add-linux-icons.sh

@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2019-2021 The Hush Developers
# Copyright 2019-2023 The Hush Developers
username=$(id -un)
sed -i "s|\/home\/.*\/SilentDragonLite\/|\/home\/$username\/SilentDragonLite\/|g" SilentDragonLite.desktop

2
util/install.sh

@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2019-2021 The Hush Developers
# Copyright 2019-2023 The Hush Developers
cd ../ && ./build.sh linguist && ./build.sh
# should be better

42
util/replace.pl

@ -0,0 +1,42 @@
#!/usr/bin/perl
# Copyright (c) 2016-2023 The Hush developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
use strict;
use warnings;
use autodie;
use Data::Dumper;
my ($find,$replace,@files) = @ARGV;
usage() unless $find && defined $replace;
unless( @files ) {
printf "No files to replace stuff!";
exit 0;
}
my $fh;
print "Going to replace $find with $replace in " . scalar(@files) . " files\n";
for my $file (@files) {
if (-d $file) {
printf "Skipping directory $file\n";
next;
}
unless ( -e $file ) {
printf "$file does not exist!\n";
next;
}
open $fh, '<', $file;
my $content = join('',<$fh>);
$content =~ s/\Q$find\E/$replace/g;
close $fh;
open $fh, '>', $file;
print $fh $content;
close $fh;
}
sub usage {
die "$0 stringtofind stringtoreplace file [more files...]\n";
}

14
util/update-copyrights.sh

@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Copyright (c) 2016-2023 The Hush developers
# Released under the GPLv3
# Usage: update-copyrights.sh 2021 2022
# TODO: verify $1 and $2 exist
# TODO: verify ack and xargs exist on this system
# This update comments in source code
ack -l -i "20..-20..*Hush dev" | xargs ./util/replace.pl -$1 -$2
# This updates the define which is used by C++ help output
./util/replace.pl "COPYRIGHT_YEAR $1" "COPYRIGHT_YEAR $2" src/clientversion.h
./util/replace.pl "COPYRIGHT_YEAR, $1" "COPYRIGHT_YEAR, $2" configure.ac

38
win-static-build.sh

@ -0,0 +1,38 @@
#!/bin/bash
# Copyright 2019-2023 The Hush Developers
VERSION=$(cat src/version.h |cut -d\" -f2)
echo "Compiling SilentDragonLite $VERSION .exe with $JOBS threads..."
CONF=silentdragon-lite.pro
set -e
echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
CC_x86_64_pc_windows_gnu="x86_64-w64-mingw32.static-gcc"
PATH="/home/$USER/git/mxe/usr/bin:${PATH}"
if [ ! -d "release" ]
then
mkdir release
fi
cp src/precompiled.h release/
qbuild () {
/home/$USER/git/mxe/usr/bin/x86_64-w64-mingw32.static-qmake-qt5 $CONF CONFIG+=release
#lupdate $CONF
#lrelease $CONF
make -j2
}
if [ "$1" == "clean" ]; then
make clean
elif [ "$1" == "linguist" ]; then
lupdate $CONF
lrelease $CONF
elif [ "$1" == "cleanbuild" ]; then
make clean
qbuild
else
qbuild
fi
Loading…
Cancel
Save