diff --git a/README.md b/README.md index 0e5d0f9..c670421 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Compiling can take some time, so be patient and wait for it to finish. It will t ##### Ubuntu 18.04 and 20.04: ```shell script -sudo apt-get -y install qt5-default qt5-qmake libqt5websockets5-dev qtcreator qttools5-dev-tools +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 diff --git a/SilentDragonLite.desktop b/SilentDragonLite.desktop deleted file mode 100644 index 490da53..0000000 --- a/SilentDragonLite.desktop +++ /dev/null @@ -1,6 +0,0 @@ -[Desktop Entry] -Name=SilentDragonLite -Exec=/home/user/SilentDragonLite/SilentDragonLite -Icon=/home/user/SilentDragonLite/res/SDLogo.png -Terminal=false -Type=Application diff --git a/doc/win/DEVELOPING-Ubuntu-18-04.md b/doc/win/DEVELOPING-Ubuntu-18-04.md index 502d9d8..fca6704 100644 --- a/doc/win/DEVELOPING-Ubuntu-18-04.md +++ b/doc/win/DEVELOPING-Ubuntu-18-04.md @@ -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. diff --git a/install.sh b/install.sh deleted file mode 100755 index 2d7299d..0000000 --- a/install.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# Copyright 2019-2021 The Hush Developers - -./build.sh linguist && ./build.sh - -username=$(id -un) - -sed -i "s|\/home\/.*\/SilentDragonLite\/|\/home\/$username\/SilentDragonLite\/|g" SilentDragonLite.desktop - -mv SilentDragonLite.desktop ~/.local/share/applications diff --git a/peda-session-SilentDragonLite.txt b/peda-session-SilentDragonLite.txt deleted file mode 100644 index 12c5dfb..0000000 --- a/peda-session-SilentDragonLite.txt +++ /dev/null @@ -1,2 +0,0 @@ -break FileSystem::readContactsOldFormat - diff --git a/silentdragon-lite.pro b/silentdragon-lite.pro index b7baea7..5eb33af 100644 --- a/silentdragon-lite.pro +++ b/silentdragon-lite.pro @@ -3,7 +3,8 @@ # Project created by QtCreator 2018-10-05T09:54:45 # #------------------------------------------------- -# Copyright 2019-2021 The Hush Developers +# Copyright 2019-2022 The Hush Developers +# Released under the GPLv3 QT += core gui network @@ -125,7 +126,6 @@ FORMS += \ src/encryption.ui \ src/hushrequest.ui \ src/mainwindow.ui \ - src/migration.ui \ src/newseed.ui \ src/newwallet.ui \ src/recurringpayments.ui \ diff --git a/src/3rdparty/sodium.h b/src/3rdparty/sodium.h index fb71bd6..0fac232 100644 --- a/src/3rdparty/sodium.h +++ b/src/3rdparty/sodium.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef sodium_H diff --git a/src/Chat/Chat.cpp b/src/Chat/Chat.cpp index 09f9199..cfb0f0a 100644 --- a/src/Chat/Chat.cpp +++ b/src/Chat/Chat.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "Chat.h" diff --git a/src/Chat/Chat.h b/src/Chat/Chat.h index cd63563..6027360 100644 --- a/src/Chat/Chat.h +++ b/src/Chat/Chat.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef CHAT_H #define CHAT_H diff --git a/src/Chat/Helper/ChatDelegator.h b/src/Chat/Helper/ChatDelegator.h index d319abb..2f820f7 100644 --- a/src/Chat/Helper/ChatDelegator.h +++ b/src/Chat/Helper/ChatDelegator.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // GPLv3 #ifndef CHATDELEGATOR_H diff --git a/src/Crypto/FileEncryption.cpp b/src/Crypto/FileEncryption.cpp index 2a8f066..99a23df 100644 --- a/src/Crypto/FileEncryption.cpp +++ b/src/Crypto/FileEncryption.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "FileEncryption.h" diff --git a/src/Crypto/FileEncryption.h b/src/Crypto/FileEncryption.h index 3893ee0..6ab1f28 100644 --- a/src/Crypto/FileEncryption.h +++ b/src/Crypto/FileEncryption.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef FILEENCRYPTION_H #define FILEENCRYPTION_H diff --git a/src/Crypto/passwd.cpp b/src/Crypto/passwd.cpp index 143821b..0a466f3 100644 --- a/src/Crypto/passwd.cpp +++ b/src/Crypto/passwd.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "passwd.h" diff --git a/src/Crypto/passwd.h b/src/Crypto/passwd.h index c50dabb..8e85949 100644 --- a/src/Crypto/passwd.h +++ b/src/Crypto/passwd.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef PASSWD_H #define PASSWD_H diff --git a/src/DataStore/ChatDataStore.cpp b/src/DataStore/ChatDataStore.cpp index 0230012..5748de7 100644 --- a/src/DataStore/ChatDataStore.cpp +++ b/src/DataStore/ChatDataStore.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "ChatDataStore.h" diff --git a/src/DataStore/ChatDataStore.h b/src/DataStore/ChatDataStore.h index ba4f32f..fa6f404 100644 --- a/src/DataStore/ChatDataStore.h +++ b/src/DataStore/ChatDataStore.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef CHATDATASTORE_H #define CHATDATASTORE_H diff --git a/src/DataStore/ContactDataStore.cpp b/src/DataStore/ContactDataStore.cpp index 67e1d85..99dd80f 100644 --- a/src/DataStore/ContactDataStore.cpp +++ b/src/DataStore/ContactDataStore.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // GPLv3 #include "ContactDataStore.h" diff --git a/src/DataStore/ContactDataStore.h b/src/DataStore/ContactDataStore.h index 4171043..ae55985 100644 --- a/src/DataStore/ContactDataStore.h +++ b/src/DataStore/ContactDataStore.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef CONTACTDATASTORE_H #define CONTACTDATASTORE_H diff --git a/src/DataStore/DataStore-deprecated.h b/src/DataStore/DataStore-deprecated.h index 39bc31f..c41d9e0 100644 --- a/src/DataStore/DataStore-deprecated.h +++ b/src/DataStore/DataStore-deprecated.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef DATASTORE_H #define DATASTORE_H diff --git a/src/DataStore/DataStore.cpp b/src/DataStore/DataStore.cpp index 5f2ffdd..bd6763b 100644 --- a/src/DataStore/DataStore.cpp +++ b/src/DataStore/DataStore.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "DataStore.h" diff --git a/src/DataStore/DataStore.h b/src/DataStore/DataStore.h index 530c6b9..cca0ccf 100644 --- a/src/DataStore/DataStore.h +++ b/src/DataStore/DataStore.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef DATASTORE_H #define DATASTORE_H diff --git a/src/DataStore/SietchDataStore.cpp b/src/DataStore/SietchDataStore.cpp index 35808fe..3c020c7 100644 --- a/src/DataStore/SietchDataStore.cpp +++ b/src/DataStore/SietchDataStore.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "SietchDataStore.h" diff --git a/src/DataStore/SietchDataStore.h b/src/DataStore/SietchDataStore.h index d1e1efc..890a9db 100644 --- a/src/DataStore/SietchDataStore.h +++ b/src/DataStore/SietchDataStore.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef SIETCHDATASTORE_H #define SIETCHDATASTORE_H diff --git a/src/FileSystem/FileSystem.cpp b/src/FileSystem/FileSystem.cpp index 6cb2cea..c6acf50 100644 --- a/src/FileSystem/FileSystem.cpp +++ b/src/FileSystem/FileSystem.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "FileSystem.h" diff --git a/src/FileSystem/FileSystem.h b/src/FileSystem/FileSystem.h index 930caa7..6234e10 100644 --- a/src/FileSystem/FileSystem.h +++ b/src/FileSystem/FileSystem.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // GPLv3 #ifndef FILESYSTEM_H #define FILESYSTEM_H diff --git a/src/Logger/LogContext.h b/src/Logger/LogContext.h index c34e717..9182f6d 100644 --- a/src/Logger/LogContext.h +++ b/src/Logger/LogContext.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef LOGCONTEXT_H #define LOGCONTEXT_H diff --git a/src/Logger/LogCrtitical.h b/src/Logger/LogCrtitical.h index d5091de..b61fc93 100644 --- a/src/Logger/LogCrtitical.h +++ b/src/Logger/LogCrtitical.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef LOGCRITICAL_H #define LOGCRITICAL_H diff --git a/src/Logger/LogDebug.h b/src/Logger/LogDebug.h index fb7d782..356804f 100644 --- a/src/Logger/LogDebug.h +++ b/src/Logger/LogDebug.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef LOGDEBUG_H #define LOGDEBUG_H diff --git a/src/Logger/LogError.h b/src/Logger/LogError.h index 0ebfb1f..513998d 100644 --- a/src/Logger/LogError.h +++ b/src/Logger/LogError.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef LOGERROR_H #define LOGERROR_H diff --git a/src/Logger/LogFatal.h b/src/Logger/LogFatal.h index cda7874..dce2e7c 100644 --- a/src/Logger/LogFatal.h +++ b/src/Logger/LogFatal.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef LOGFATAL_H #define LOGFATAL_H diff --git a/src/Logger/LogInfo.h b/src/Logger/LogInfo.h index df02790..ce0049c 100644 --- a/src/Logger/LogInfo.h +++ b/src/Logger/LogInfo.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef LOGINFO_H #define LOGINFO_H diff --git a/src/Logger/LogStrategy.h b/src/Logger/LogStrategy.h index 3cb1c82..8ec8265 100644 --- a/src/Logger/LogStrategy.h +++ b/src/Logger/LogStrategy.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef LOGSTRATEGY_H #define LOGSTRATEGY_H diff --git a/src/Logger/LogSuccess.h b/src/Logger/LogSuccess.h index d17f28d..904c7b7 100644 --- a/src/Logger/LogSuccess.h +++ b/src/Logger/LogSuccess.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef LOGSUCCESS_H #define LOGSUCCESS_H diff --git a/src/Logger/LogType.h b/src/Logger/LogType.h index 5a67f36..1389ebd 100644 --- a/src/Logger/LogType.h +++ b/src/Logger/LogType.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef LOGTYPE_H #define LOGTYPE_H diff --git a/src/Logger/LogWarning.h b/src/Logger/LogWarning.h index 3dc3d18..b47d665 100644 --- a/src/Logger/LogWarning.h +++ b/src/Logger/LogWarning.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef LOGWARNING_H #define LOGWARNING_H diff --git a/src/Logger/LogWriter.cpp b/src/Logger/LogWriter.cpp index 4743bfa..aae493a 100644 --- a/src/Logger/LogWriter.cpp +++ b/src/Logger/LogWriter.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "LogWriter.h" diff --git a/src/Logger/LogWriter.h b/src/Logger/LogWriter.h index b2215c6..aeb8857 100644 --- a/src/Logger/LogWriter.h +++ b/src/Logger/LogWriter.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef LOGWRITER_H #define LOGWRITER_H diff --git a/src/Logger/Logger.h b/src/Logger/Logger.h index 8e747d0..0566481 100644 --- a/src/Logger/Logger.h +++ b/src/Logger/Logger.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef LOGGER_H #define LOGGER_H diff --git a/src/Logger/SimpleLogger.h b/src/Logger/SimpleLogger.h index 93857f6..f7a8728 100644 --- a/src/Logger/SimpleLogger.h +++ b/src/Logger/SimpleLogger.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef SIMPLELOGGER_H #define SIMPLELOGGER_H diff --git a/src/Logger/test.cpp b/src/Logger/test.cpp index ea79fe2..a10e224 100644 --- a/src/Logger/test.cpp +++ b/src/Logger/test.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "SimpleLogger.h" diff --git a/src/Model/ChatItem.cpp b/src/Model/ChatItem.cpp index b381752..1f61bea 100644 --- a/src/Model/ChatItem.cpp +++ b/src/Model/ChatItem.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "ChatItem.h" diff --git a/src/Model/ChatItem.h b/src/Model/ChatItem.h index 1ba1d98..31bc222 100644 --- a/src/Model/ChatItem.h +++ b/src/Model/ChatItem.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef CHATITEM_H diff --git a/src/Model/ContactItem.cpp b/src/Model/ContactItem.cpp index db3f947..6511ea0 100644 --- a/src/Model/ContactItem.cpp +++ b/src/Model/ContactItem.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // GPLv3 #include "ContactItem.h" #include "chatmodel.h" diff --git a/src/Model/ContactItem.h b/src/Model/ContactItem.h index 2f91ff0..fac1cb9 100644 --- a/src/Model/ContactItem.h +++ b/src/Model/ContactItem.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef CONTACTITEM_H #define CONTACTITEM_H diff --git a/src/Model/ContactRequest.cpp b/src/Model/ContactRequest.cpp index d8d356b..d8040d8 100644 --- a/src/Model/ContactRequest.cpp +++ b/src/Model/ContactRequest.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // GPLv3 #include "ContactRequest.h" diff --git a/src/Model/ContactRequest.h b/src/Model/ContactRequest.h index 75f2a06..9f6147b 100644 --- a/src/Model/ContactRequest.h +++ b/src/Model/ContactRequest.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef CONTACTREQUEST_H #define CONTACTREQUEST_H diff --git a/src/Model/ContactRequestChatItem.cpp b/src/Model/ContactRequestChatItem.cpp index 1674467..e3924d1 100644 --- a/src/Model/ContactRequestChatItem.cpp +++ b/src/Model/ContactRequestChatItem.cpp @@ -1,3 +1,3 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "ContactRequestChatItem.h" diff --git a/src/Model/ContactRequestChatItem.h b/src/Model/ContactRequestChatItem.h index 1f9e9e2..3028b1c 100644 --- a/src/Model/ContactRequestChatItem.h +++ b/src/Model/ContactRequestChatItem.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifdef CONTACTREQUESTCHATITEM_H #define CONTACTREQUESTCHATITEM_H diff --git a/src/about.ui b/src/about.ui index b167f44..9165731 100644 --- a/src/about.ui +++ b/src/about.ui @@ -52,7 +52,7 @@ <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Copyright (c) 2019-2021 The Hush developers GNU Public License V3</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Copyright (c) 2019-2022 The Hush developers GNU Public License V3</p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Copyright (c) 2018-2019 Aditya Kulkarni, Duke Leto, Jane Mercer </p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> diff --git a/src/addressbook.cpp b/src/addressbook.cpp index 2a80795..4ebe851 100644 --- a/src/addressbook.cpp +++ b/src/addressbook.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 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); }; diff --git a/src/addressbook.h b/src/addressbook.h index dc52801..49decac 100644 --- a/src/addressbook.h +++ b/src/addressbook.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef ADDRESSBOOK_H #define ADDRESSBOOK_H diff --git a/src/addresscombo.cpp b/src/addresscombo.cpp index 2a5db38..4a81003 100644 --- a/src/addresscombo.cpp +++ b/src/addresscombo.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "addresscombo.h" #include "addressbook.h" diff --git a/src/addresscombo.h b/src/addresscombo.h index 9b8412e..941a6b2 100644 --- a/src/addresscombo.h +++ b/src/addresscombo.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef ADDRESSCOMBO_H #define ADDRESSCOMBO_H diff --git a/src/balancestablemodel.cpp b/src/balancestablemodel.cpp index 747b7dd..6be86cd 100644 --- a/src/balancestablemodel.cpp +++ b/src/balancestablemodel.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "balancestablemodel.h" #include "addressbook.h" diff --git a/src/balancestablemodel.h b/src/balancestablemodel.h index a1bbb4b..aec1f08 100644 --- a/src/balancestablemodel.h +++ b/src/balancestablemodel.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef BALANCESTABLEMODEL_H #define BALANCESTABLEMODEL_H diff --git a/src/camount.cpp b/src/camount.cpp index 9e67dcc..90ba61f 100644 --- a/src/camount.cpp +++ b/src/camount.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "camount.h" #include "settings.h" diff --git a/src/camount.h b/src/camount.h index 4940ae7..f54e1b0 100644 --- a/src/camount.h +++ b/src/camount.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef CAMOUNT_H #define CAMOUNT_H diff --git a/src/chatbubbleme.cpp b/src/chatbubbleme.cpp index 5762aec..acc6dd4 100644 --- a/src/chatbubbleme.cpp +++ b/src/chatbubbleme.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "chatbubbleme.h" #include "ui_chatbubbleme.h" diff --git a/src/chatbubbleme.h b/src/chatbubbleme.h index e08ae2e..8c70ccc 100644 --- a/src/chatbubbleme.h +++ b/src/chatbubbleme.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef CHATBUBBLEME_H #define CHATBUBBLEME_H diff --git a/src/chatbubblepartner.cpp b/src/chatbubblepartner.cpp index e0b49a8..070e186 100644 --- a/src/chatbubblepartner.cpp +++ b/src/chatbubblepartner.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "chatbubblepartner.h" #include "ui_chatbubblepartner.h" diff --git a/src/chatbubblepartner.h b/src/chatbubblepartner.h index 13ea740..f03e644 100644 --- a/src/chatbubblepartner.h +++ b/src/chatbubblepartner.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef CHATBUBBLEPARTNER_H #define CHATBUBBLEPARTNER_H diff --git a/src/chatmodel.cpp b/src/chatmodel.cpp index 1fa80f1..5fba149 100644 --- a/src/chatmodel.cpp +++ b/src/chatmodel.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "chatmodel.h" #include "settings.h" diff --git a/src/chatmodel.h b/src/chatmodel.h index 585d081..b2710fa 100644 --- a/src/chatmodel.h +++ b/src/chatmodel.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef CHATMODEL_H diff --git a/src/connection.cpp b/src/connection.cpp index ad6dcd9..0db30a2 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "connection.h" #include "mainwindow.h" @@ -76,14 +76,14 @@ void ConnectionLoader::loadProgress() void ConnectionLoader::ShowProgress() { + qDebug() << __func__; auto config = std::shared_ptr(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(); 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; } } diff --git a/src/connection.h b/src/connection.h index 2b5aa27..428d034 100644 --- a/src/connection.h +++ b/src/connection.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef CONNECTION_H #define CONNECTION_H diff --git a/src/contactmodel.cpp b/src/contactmodel.cpp index b398f33..bbabb91 100644 --- a/src/contactmodel.cpp +++ b/src/contactmodel.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // GPLv3 #include "contactmodel.h" diff --git a/src/contactmodel.h b/src/contactmodel.h index 11e783f..da6414b 100644 --- a/src/contactmodel.h +++ b/src/contactmodel.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef CONTACTMODEL_H #define CONTACTMODEL_H diff --git a/src/controller.cpp b/src/controller.cpp index 4b3b89b..dcccc01 100644 --- a/src/controller.cpp +++ b/src/controller.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "controller.h" @@ -44,7 +44,6 @@ Controller::Controller(MainWindow* main) 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, [=]() { diff --git a/src/datamodel.cpp b/src/datamodel.cpp index 4b65bdf..551e16a 100644 --- a/src/datamodel.cpp +++ b/src/datamodel.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "datamodel.h" diff --git a/src/datamodel.h b/src/datamodel.h index b903ee3..bd248f2 100644 --- a/src/datamodel.h +++ b/src/datamodel.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef DATAMODEL_H #define DATAMODEL_H diff --git a/src/fillediconlabel.cpp b/src/fillediconlabel.cpp index 6f06138..bd7efdb 100644 --- a/src/fillediconlabel.cpp +++ b/src/fillediconlabel.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "fillediconlabel.h" diff --git a/src/fillediconlabel.h b/src/fillediconlabel.h index 6211028..5defe6d 100644 --- a/src/fillediconlabel.h +++ b/src/fillediconlabel.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef FILLEDICONLABEL_H #define FILLEDICONLABEL_H diff --git a/src/firsttimewizard.cpp b/src/firsttimewizard.cpp index b8bfffc..8bc4dcb 100644 --- a/src/firsttimewizard.cpp +++ b/src/firsttimewizard.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 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 @@ -52,6 +51,7 @@ void FirstTimeWizard::slot_change_theme(const QString& theme_name) { FirstTimeWizard::FirstTimeWizard(bool dangerous, QString server) { + qDebug() << __func__ << ": dangerous=" << dangerous << " server=" << server; // Include css QString theme_name; try @@ -64,21 +64,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 +102,89 @@ 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")); + + parent->setOption(QWizard::NoBackButtonOnStartPage); - 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 +199,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(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 +221,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 +242,34 @@ 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); - setCommitPage(true); + qDebug() << __func__ << ": disabling next/commit buttons"; + setCommitPage(true); - - + parent->button(QWizard::CommitButton)->setEnabled(false); + parent->button(QWizard::NextButton)->setEnabled(false); } 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 +282,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()) { @@ -290,23 +301,24 @@ void NewSeedPage::initializePage() { 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, ( "Quit Setup" ), ( "Setup is not complete yet. Are you sure you want to quit setup?" ), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { + qDebug() << __func__ << ": wizard canceled"; + // allow cancel + reject(); } +} // 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 +327,6 @@ bool NewSeedPage::validatePage() { form.birthday->setVisible(false); form.txtSeed->setVisible(false); - QString seed = parent->getSeed(); QString birthday = parent->getBirthday(); @@ -603,8 +614,7 @@ bool NewSeedPage::validatePage() { return true; } }else{ - - qDebug()<<"Falscher Seed"; + qDebug()<<"Wrong Seed"; QFile file(dirwalletencfirst); QFile file1(dirwalletfirst); @@ -618,13 +628,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); @@ -638,7 +650,9 @@ 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) { + 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); @@ -650,16 +664,16 @@ bool RestoreSeedPage::validatePage() { bool ok; qint64 birthday = birthday_str.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."), 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 +695,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); diff --git a/src/firsttimewizard.h b/src/firsttimewizard.h index 71eac11..8af3510 100644 --- a/src/firsttimewizard.h +++ b/src/firsttimewizard.h @@ -1,4 +1,4 @@ -// Copyright 2019-2020 The Hush developers +// Copyright 2019-2022 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); @@ -31,8 +31,10 @@ public slots: protected: int nextId() const; + virtual void initializePage(); private: + FirstTimeWizard* parent; enum { Page_NewOrRestore, Page_New, @@ -46,15 +48,20 @@ private: friend class NewSeedPage; friend class RestoreSeedPage; - - }; class NewOrRestorePage: public QWizardPage { + public: NewOrRestorePage(FirstTimeWizard* parent); +protected: + virtual void initializePage(); + +private: + FirstTimeWizard* parent; + }; @@ -85,6 +92,4 @@ private: Ui_RestoreSeedForm form; }; - - #endif // FIRSTTIMEWIZARD_H diff --git a/src/liteinterface.cpp b/src/liteinterface.cpp index cca3e13..a411229 100644 --- a/src/liteinterface.cpp +++ b/src/liteinterface.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "liteinterface.h" diff --git a/src/liteinterface.h b/src/liteinterface.h index 1e61d45..883b048 100644 --- a/src/liteinterface.h +++ b/src/liteinterface.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef hushDRPC_H #define hushDRPC_H diff --git a/src/logger.cpp b/src/logger.cpp index ca7d30a..ec51ad2 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "logger.h" diff --git a/src/logger.h b/src/logger.h index 1e7f13f..9832cf2 100644 --- a/src/logger.h +++ b/src/logger.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef LOGGER_H #define LOGGER_H diff --git a/src/main.cpp b/src/main.cpp index 720d7be..e18b61a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 8bbffc6..de6b588 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "mainwindow.h" #include "addressbook.h" @@ -76,12 +76,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{} @@ -175,7 +175,6 @@ MainWindow::MainWindow(QWidget *parent) : restoreSeed.setupUi(&dialog); Settings::saveRestore(&dialog); - rpc->fetchSeed([=](json reply) { if (isJsonError(reply)) { return; @@ -246,26 +245,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 @@ -432,6 +434,7 @@ void MainWindow::closeEvent(QCloseEvent* event) { void MainWindow::closeEventpw(QCloseEvent* event) { // Let the RPC know to shut down any running service. + qDebug() << __func__ << ": event=" << event; rpc->shutdownhushd(); } @@ -489,12 +492,16 @@ 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 + ); + exit(1); + } QString passphraseHash1 = QByteArray(reinterpret_cast(key), KEY_LEN).toHex(); DataStore::getChatDataStore()->setPassword(passphraseHash1); @@ -835,6 +842,8 @@ void MainWindow::setupSettingsModal() { settings.cmbServer->addItem("https://devo.crabdance.com"); settings.cmbServer->addItem("https://lite.nyami.org"); settings.cmbServer->addItem("https://poop.granitefone.me:9067"); + settings.cmbServer->addItem("https://lite.hushpool.is"); + //settings.cmbServer->addItem("https://hush.leto.net:5420"); //TODO: seperate lists of https/Tor servers, only show user or attempt // connection to .onion if user has it enabled @@ -995,6 +1004,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"; @@ -1441,8 +1451,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 @@ -2429,7 +2438,7 @@ void MainWindow::addNewZaddr(bool sapling) { } -// 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 MainWindow::addZAddrsToComboList(bool sapling) { return [=] (bool checked) { @@ -2770,9 +2779,7 @@ void MainWindow::updateLabels() { 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); @@ -2788,9 +2795,7 @@ 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); @@ -2842,8 +2847,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"; - }); + }); } diff --git a/src/mainwindow.h b/src/mainwindow.h index df79a86..12b1d08 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef MAINWINDOW_H #define MAINWINDOW_H diff --git a/src/memoedit.cpp b/src/memoedit.cpp index a32baac..46699ad 100644 --- a/src/memoedit.cpp +++ b/src/memoedit.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "memoedit.h" diff --git a/src/memoedit.h b/src/memoedit.h index 1db0510..f5ac495 100644 --- a/src/memoedit.h +++ b/src/memoedit.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef MEMOEDIT_H #define MEMOEDIT_H diff --git a/src/migration.ui b/src/migration.ui deleted file mode 100644 index 588c864..0000000 --- a/src/migration.ui +++ /dev/null @@ -1,139 +0,0 @@ - - - MigrationDialog - - - - 0 - 0 - 511 - 498 - - - - Migration Turnstile - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - Migration History - - - - - - Migrated Amount - - - - - - - true - - - - - - - Unmigrated Amount - - - - - - - TextLabel - - - - - - - TextLabel - - - - - - - - - - Sprout -> Sapling migration enabled - - - - - - - If enabled, hushd will slowly migrate your Sprout shielded funds to your Sapling address. - - - true - - - - - - - Qt::Horizontal - - - - - - - - - - - - - - - - buttonBox - accepted() - MigrationDialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - MigrationDialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - diff --git a/src/mobileappconnector.cpp b/src/mobileappconnector.cpp index b06590e..d34c0de 100644 --- a/src/mobileappconnector.cpp +++ b/src/mobileappconnector.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "mobileappconnector.h" #include "ui_mobileappconnector.h" diff --git a/src/mobileappconnector.h b/src/mobileappconnector.h index fb5efcc..c1b3593 100644 --- a/src/mobileappconnector.h +++ b/src/mobileappconnector.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef MOBILEAPPCONNECTOR_H #define MOBILEAPPCONNECTOR_H diff --git a/src/newwallet.ui b/src/newwallet.ui index f1ab614..e208d4e 100644 --- a/src/newwallet.ui +++ b/src/newwallet.ui @@ -110,6 +110,9 @@ p, li { white-space: pre-wrap; } 16777215 + + color: red; + I accept the Terms of Service @@ -146,7 +149,7 @@ p, li { white-space: pre-wrap; } color: red; - <html><head/><body><p><span style=" font-style:italic;">Passphrase don't match</span></p></body></html> + Qt::AlignCenter diff --git a/src/precompiled.h b/src/precompiled.h index cacfc7c..7a3608c 100644 --- a/src/precompiled.h +++ b/src/precompiled.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #if defined __cplusplus /* Add C++ includes here */ diff --git a/src/qrcodelabel.cpp b/src/qrcodelabel.cpp index 2283785..d26da13 100644 --- a/src/qrcodelabel.cpp +++ b/src/qrcodelabel.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "qrcodelabel.h" diff --git a/src/qrcodelabel.h b/src/qrcodelabel.h index af20559..2de4fea 100644 --- a/src/qrcodelabel.h +++ b/src/qrcodelabel.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef QRCODELABEL_H #define QRCODELABEL_H diff --git a/src/recurring.cpp b/src/recurring.cpp index a5f9a57..412bb92 100644 --- a/src/recurring.cpp +++ b/src/recurring.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "recurring.h" diff --git a/src/recurring.h b/src/recurring.h index 9ab317f..5e4a3bd 100644 --- a/src/recurring.h +++ b/src/recurring.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef RECURRING_H #define RECURRING_H diff --git a/src/requestdialog.cpp b/src/requestdialog.cpp index dee5959..442a223 100644 --- a/src/requestdialog.cpp +++ b/src/requestdialog.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "requestdialog.h" #include "ui_requestdialog.h" diff --git a/src/requestdialog.h b/src/requestdialog.h index ed2b227..9053cab 100644 --- a/src/requestdialog.h +++ b/src/requestdialog.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef REQUESTDIALOG_H #define REQUESTDIALOG_H diff --git a/src/restoreSeed.ui b/src/restoreSeed.ui deleted file mode 100644 index fb923db..0000000 --- a/src/restoreSeed.ui +++ /dev/null @@ -1,72 +0,0 @@ - - - - - Dialog - - - - 0 - 0 - 400 - 300 - - - - Dialog - - - - - 30 - 240 - 341 - 32 - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - buttonBox - accepted() - Dialog - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - Dialog - reject() - - - 316 - 260 - - - 286 - 274 - - - - - - diff --git a/src/sendtab.cpp b/src/sendtab.cpp index da30d5a..0b0856a 100644 --- a/src/sendtab.cpp +++ b/src/sendtab.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "mainwindow.h" #include "ui_mainwindow.h" diff --git a/src/settings.cpp b/src/settings.cpp index e265daf..bddd737 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "mainwindow.h" #include "settings.h" @@ -95,13 +95,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; @@ -305,12 +298,14 @@ QString Settings::getRandomServer() { "https://devo.crabdance.com", "https://lite.nyami.org", "https://poop.granitefone.me:9067", + // 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" }; // we don't need cryptographic random-ness, but we want @@ -324,7 +319,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") { diff --git a/src/settings.h b/src/settings.h index 8343424..6fb2709 100644 --- a/src/settings.h +++ b/src/settings.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 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); diff --git a/src/txtablemodel.cpp b/src/txtablemodel.cpp index b106a1a..d4ee1c6 100644 --- a/src/txtablemodel.cpp +++ b/src/txtablemodel.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "txtablemodel.h" #include "settings.h" diff --git a/src/txtablemodel.h b/src/txtablemodel.h index f5a7449..f2c87a2 100644 --- a/src/txtablemodel.h +++ b/src/txtablemodel.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef STRINGSTABLEMODEL_H #define STRINGSTABLEMODEL_H diff --git a/src/version.h b/src/version.h index ce3696d..44a5ad6 100644 --- a/src/version.h +++ b/src/version.h @@ -1,3 +1,3 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #define APP_VERSION "1.5.2" diff --git a/src/viewalladdresses.cpp b/src/viewalladdresses.cpp index 9c246cf..ea737fa 100644 --- a/src/viewalladdresses.cpp +++ b/src/viewalladdresses.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #include "viewalladdresses.h" #include "camount.h" diff --git a/src/viewalladdresses.h b/src/viewalladdresses.h index 56c6906..673c763 100644 --- a/src/viewalladdresses.h +++ b/src/viewalladdresses.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef VIEWALLADDRESSES_H #define VIEWALLADDRESSES_H diff --git a/src/websockets.cpp b/src/websockets.cpp index d65c6de..bc49149 100644 --- a/src/websockets.cpp +++ b/src/websockets.cpp @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 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> 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> 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; diff --git a/src/websockets.h b/src/websockets.h index 1d03fe3..15b0458 100644 --- a/src/websockets.h +++ b/src/websockets.h @@ -1,4 +1,4 @@ -// Copyright 2019-2021 The Hush developers +// Copyright 2019-2022 The Hush developers // Released under the GPLv3 #ifndef WEBSOCKETS_H #define WEBSOCKETS_H diff --git a/util/install.sh b/util/install.sh index 2d7299d..250f530 100755 --- a/util/install.sh +++ b/util/install.sh @@ -1,10 +1,12 @@ #!/bin/bash # Copyright 2019-2021 The Hush Developers -./build.sh linguist && ./build.sh +cd ../ && ./build.sh linguist && ./build.sh +# should be better username=$(id -un) -sed -i "s|\/home\/.*\/SilentDragonLite\/|\/home\/$username\/SilentDragonLite\/|g" SilentDragonLite.desktop +cd util/ && sed -i "s|\/home\/.*\/SilentDragonLite\/|\/home\/$username\/SilentDragonLite\/|g" SilentDragonLite.desktop -mv SilentDragonLite.desktop ~/.local/share/applications +cp SilentDragonLite.desktop ~/.local/share/applications +# might be /usr/share/applications/ that requires sudo \ No newline at end of file