Merge remote-tracking branch 'remotes/upstream/dev' into dev
This commit is contained in:
@@ -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:
|
##### Ubuntu 18.04 and 20.04:
|
||||||
```shell script
|
```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
|
git clone https://git.hush.is/hush/SilentDragonLite
|
||||||
cd SilentDragonLite
|
cd SilentDragonLite
|
||||||
./build.sh linguist
|
./build.sh linguist
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Name=SilentDragonLite
|
|
||||||
Exec=/home/user/SilentDragonLite/SilentDragonLite
|
|
||||||
Icon=/home/user/SilentDragonLite/res/SDLogo.png
|
|
||||||
Terminal=false
|
|
||||||
Type=Application
|
|
||||||
@@ -71,3 +71,10 @@ echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
|
|||||||
./win-static-build.sh
|
./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.
|
||||||
|
|||||||
10
install.sh
10
install.sh
@@ -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
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
break FileSystem::readContactsOldFormat
|
|
||||||
|
|
||||||
@@ -3,7 +3,8 @@
|
|||||||
# Project created by QtCreator 2018-10-05T09:54:45
|
# 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
|
QT += core gui network
|
||||||
|
|
||||||
@@ -125,7 +126,6 @@ FORMS += \
|
|||||||
src/encryption.ui \
|
src/encryption.ui \
|
||||||
src/hushrequest.ui \
|
src/hushrequest.ui \
|
||||||
src/mainwindow.ui \
|
src/mainwindow.ui \
|
||||||
src/migration.ui \
|
|
||||||
src/newseed.ui \
|
src/newseed.ui \
|
||||||
src/newwallet.ui \
|
src/newwallet.ui \
|
||||||
src/recurringpayments.ui \
|
src/recurringpayments.ui \
|
||||||
|
|||||||
2
src/3rdparty/sodium.h
vendored
2
src/3rdparty/sodium.h
vendored
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
|
|
||||||
#ifndef sodium_H
|
#ifndef sodium_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
|
|
||||||
#include "Chat.h"
|
#include "Chat.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef CHAT_H
|
#ifndef CHAT_H
|
||||||
#define CHAT_H
|
#define CHAT_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// GPLv3
|
// GPLv3
|
||||||
|
|
||||||
#ifndef CHATDELEGATOR_H
|
#ifndef CHATDELEGATOR_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "FileEncryption.h"
|
#include "FileEncryption.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef FILEENCRYPTION_H
|
#ifndef FILEENCRYPTION_H
|
||||||
#define FILEENCRYPTION_H
|
#define FILEENCRYPTION_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "passwd.h"
|
#include "passwd.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef PASSWD_H
|
#ifndef PASSWD_H
|
||||||
#define PASSWD_H
|
#define PASSWD_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
|
|
||||||
#include "ChatDataStore.h"
|
#include "ChatDataStore.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef CHATDATASTORE_H
|
#ifndef CHATDATASTORE_H
|
||||||
#define CHATDATASTORE_H
|
#define CHATDATASTORE_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// GPLv3
|
// GPLv3
|
||||||
|
|
||||||
#include "ContactDataStore.h"
|
#include "ContactDataStore.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef CONTACTDATASTORE_H
|
#ifndef CONTACTDATASTORE_H
|
||||||
#define CONTACTDATASTORE_H
|
#define CONTACTDATASTORE_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef DATASTORE_H
|
#ifndef DATASTORE_H
|
||||||
#define DATASTORE_H
|
#define DATASTORE_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "DataStore.h"
|
#include "DataStore.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef DATASTORE_H
|
#ifndef DATASTORE_H
|
||||||
#define DATASTORE_H
|
#define DATASTORE_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "SietchDataStore.h"
|
#include "SietchDataStore.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef SIETCHDATASTORE_H
|
#ifndef SIETCHDATASTORE_H
|
||||||
#define SIETCHDATASTORE_H
|
#define SIETCHDATASTORE_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "FileSystem.h"
|
#include "FileSystem.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// GPLv3
|
// GPLv3
|
||||||
#ifndef FILESYSTEM_H
|
#ifndef FILESYSTEM_H
|
||||||
#define FILESYSTEM_H
|
#define FILESYSTEM_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef LOGCONTEXT_H
|
#ifndef LOGCONTEXT_H
|
||||||
#define LOGCONTEXT_H
|
#define LOGCONTEXT_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef LOGCRITICAL_H
|
#ifndef LOGCRITICAL_H
|
||||||
#define LOGCRITICAL_H
|
#define LOGCRITICAL_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef LOGDEBUG_H
|
#ifndef LOGDEBUG_H
|
||||||
#define LOGDEBUG_H
|
#define LOGDEBUG_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef LOGERROR_H
|
#ifndef LOGERROR_H
|
||||||
#define LOGERROR_H
|
#define LOGERROR_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef LOGFATAL_H
|
#ifndef LOGFATAL_H
|
||||||
#define LOGFATAL_H
|
#define LOGFATAL_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef LOGINFO_H
|
#ifndef LOGINFO_H
|
||||||
#define LOGINFO_H
|
#define LOGINFO_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef LOGSTRATEGY_H
|
#ifndef LOGSTRATEGY_H
|
||||||
#define LOGSTRATEGY_H
|
#define LOGSTRATEGY_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef LOGSUCCESS_H
|
#ifndef LOGSUCCESS_H
|
||||||
#define LOGSUCCESS_H
|
#define LOGSUCCESS_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef LOGTYPE_H
|
#ifndef LOGTYPE_H
|
||||||
#define LOGTYPE_H
|
#define LOGTYPE_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef LOGWARNING_H
|
#ifndef LOGWARNING_H
|
||||||
#define LOGWARNING_H
|
#define LOGWARNING_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "LogWriter.h"
|
#include "LogWriter.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef LOGWRITER_H
|
#ifndef LOGWRITER_H
|
||||||
#define LOGWRITER_H
|
#define LOGWRITER_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef LOGGER_H
|
#ifndef LOGGER_H
|
||||||
#define LOGGER_H
|
#define LOGGER_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef SIMPLELOGGER_H
|
#ifndef SIMPLELOGGER_H
|
||||||
#define SIMPLELOGGER_H
|
#define SIMPLELOGGER_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "SimpleLogger.h"
|
#include "SimpleLogger.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
|
|
||||||
#include "ChatItem.h"
|
#include "ChatItem.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
|
|
||||||
#ifndef CHATITEM_H
|
#ifndef CHATITEM_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// GPLv3
|
// GPLv3
|
||||||
#include "ContactItem.h"
|
#include "ContactItem.h"
|
||||||
#include "chatmodel.h"
|
#include "chatmodel.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef CONTACTITEM_H
|
#ifndef CONTACTITEM_H
|
||||||
#define CONTACTITEM_H
|
#define CONTACTITEM_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// GPLv3
|
// GPLv3
|
||||||
|
|
||||||
#include "ContactRequest.h"
|
#include "ContactRequest.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef CONTACTREQUEST_H
|
#ifndef CONTACTREQUEST_H
|
||||||
#define CONTACTREQUEST_H
|
#define CONTACTREQUEST_H
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "ContactRequestChatItem.h"
|
#include "ContactRequestChatItem.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifdef CONTACTREQUESTCHATITEM_H
|
#ifdef CONTACTREQUESTCHATITEM_H
|
||||||
#define CONTACTREQUESTCHATITEM_H
|
#define CONTACTREQUESTCHATITEM_H
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||||
p, li { white-space: pre-wrap; }
|
p, li { white-space: pre-wrap; }
|
||||||
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
|
</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="-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=" 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>
|
<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>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
|
|
||||||
#include "addressbook.h"
|
#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) {
|
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);
|
target->setText(label % "/" % addr % myAddr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef ADDRESSBOOK_H
|
#ifndef ADDRESSBOOK_H
|
||||||
#define ADDRESSBOOK_H
|
#define ADDRESSBOOK_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "addresscombo.h"
|
#include "addresscombo.h"
|
||||||
#include "addressbook.h"
|
#include "addressbook.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef ADDRESSCOMBO_H
|
#ifndef ADDRESSCOMBO_H
|
||||||
#define ADDRESSCOMBO_H
|
#define ADDRESSCOMBO_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "balancestablemodel.h"
|
#include "balancestablemodel.h"
|
||||||
#include "addressbook.h"
|
#include "addressbook.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef BALANCESTABLEMODEL_H
|
#ifndef BALANCESTABLEMODEL_H
|
||||||
#define BALANCESTABLEMODEL_H
|
#define BALANCESTABLEMODEL_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "camount.h"
|
#include "camount.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef CAMOUNT_H
|
#ifndef CAMOUNT_H
|
||||||
#define CAMOUNT_H
|
#define CAMOUNT_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "chatbubbleme.h"
|
#include "chatbubbleme.h"
|
||||||
#include "ui_chatbubbleme.h"
|
#include "ui_chatbubbleme.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef CHATBUBBLEME_H
|
#ifndef CHATBUBBLEME_H
|
||||||
#define CHATBUBBLEME_H
|
#define CHATBUBBLEME_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "chatbubblepartner.h"
|
#include "chatbubblepartner.h"
|
||||||
#include "ui_chatbubblepartner.h"
|
#include "ui_chatbubblepartner.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef CHATBUBBLEPARTNER_H
|
#ifndef CHATBUBBLEPARTNER_H
|
||||||
#define CHATBUBBLEPARTNER_H
|
#define CHATBUBBLEPARTNER_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "chatmodel.h"
|
#include "chatmodel.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
|
|
||||||
#ifndef CHATMODEL_H
|
#ifndef CHATMODEL_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "connection.h"
|
#include "connection.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
@@ -76,14 +76,14 @@ void ConnectionLoader::loadProgress()
|
|||||||
|
|
||||||
void ConnectionLoader::ShowProgress()
|
void ConnectionLoader::ShowProgress()
|
||||||
{
|
{
|
||||||
|
qDebug() << __func__;
|
||||||
auto config = std::shared_ptr<ConnectionConfig>(new ConnectionConfig());
|
auto config = std::shared_ptr<ConnectionConfig>(new ConnectionConfig());
|
||||||
config->dangerous = false;
|
config->dangerous = false;
|
||||||
config->server = Settings::getInstance()->getSettings().server;
|
config->server = Settings::getInstance()->getSettings().server;
|
||||||
|
|
||||||
auto connection = makeConnection(config);
|
auto connection = makeConnection(config);
|
||||||
auto me = this;
|
auto me = this;
|
||||||
qDebug() << __func__ << ": server=" << config->server
|
qDebug() << __func__ << ": server=" << config->server << " connection=" << connection << " me=" << me;
|
||||||
<< " connection=" << connection << " me=" << me;
|
|
||||||
|
|
||||||
isSyncing = new QAtomicInteger<bool>();
|
isSyncing = new QAtomicInteger<bool>();
|
||||||
isSyncing->store(true);
|
isSyncing->store(true);
|
||||||
@@ -147,6 +147,7 @@ void ConnectionLoader::doAutoConnect()
|
|||||||
|
|
||||||
// Check to see if there's an existing wallet
|
// Check to see if there's an existing wallet
|
||||||
if (litelib_wallet_exists(Settings::getDefaultChainName().toStdString().c_str())) {
|
if (litelib_wallet_exists(Settings::getDefaultChainName().toStdString().c_str())) {
|
||||||
|
qDebug() << __func__ << ": using existing wallet";
|
||||||
main->logger->write(QObject::tr("Using existing wallet."));
|
main->logger->write(QObject::tr("Using existing wallet."));
|
||||||
char* resp = litelib_initialize_existing(
|
char* resp = litelib_initialize_existing(
|
||||||
config->dangerous,
|
config->dangerous,
|
||||||
@@ -175,6 +176,7 @@ void ConnectionLoader::doAutoConnect()
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
qDebug() << __func__ << ": no existing wallet";
|
||||||
main->logger->write(QObject::tr("Create/restore wallet."));
|
main->logger->write(QObject::tr("Create/restore wallet."));
|
||||||
createOrRestore(config->dangerous, config->server);
|
createOrRestore(config->dangerous, config->server);
|
||||||
d->show();
|
d->show();
|
||||||
@@ -248,6 +250,7 @@ void ConnectionLoader::doAutoConnect()
|
|||||||
|
|
||||||
void ConnectionLoader::createOrRestore(bool dangerous, QString server)
|
void ConnectionLoader::createOrRestore(bool dangerous, QString server)
|
||||||
{
|
{
|
||||||
|
qDebug() << __func__ << ": server=" << server;
|
||||||
// Close the startup dialog, since we'll be showing the wizard
|
// Close the startup dialog, since we'll be showing the wizard
|
||||||
d->hide();
|
d->hide();
|
||||||
// Create a wizard
|
// Create a wizard
|
||||||
@@ -264,13 +267,14 @@ void ConnectionLoader::doRPCSetConnection(Connection* conn)
|
|||||||
d->accept();
|
d->accept();
|
||||||
QTimer::singleShot(1, [=]() { delete this; });
|
QTimer::singleShot(1, [=]() { delete this; });
|
||||||
|
|
||||||
|
QFile plaintextWallet(dirwalletconnection);
|
||||||
try {
|
try {
|
||||||
QFile plaintextWallet(dirwalletconnection);
|
|
||||||
main->logger->write("Path to Wallet.dat : " );
|
main->logger->write("Path to Wallet.dat : " );
|
||||||
qDebug() << __func__ << ": wallet path =" << plaintextWallet;
|
qDebug() << __func__ << ": wallet path =" << plaintextWallet;
|
||||||
plaintextWallet.remove();
|
plaintextWallet.remove();
|
||||||
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
qDebug() << "No plaintext wallet found! file=" << plaintextWallet;
|
||||||
main->logger->write("no Plaintext wallet.dat");
|
main->logger->write("no Plaintext wallet.dat");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,13 +288,14 @@ void ConnectionLoader::doRPCSetConnectionShield(Connection* conn)
|
|||||||
main->getRPC()->shield([=] (auto) {});
|
main->getRPC()->shield([=] (auto) {});
|
||||||
QTimer::singleShot(1, [=]() { delete this; });
|
QTimer::singleShot(1, [=]() { delete this; });
|
||||||
|
|
||||||
|
QFile plaintextWallet(dirwalletconnection);
|
||||||
try {
|
try {
|
||||||
QFile plaintextWallet(dirwalletconnection);
|
|
||||||
main->logger->write("Path to Wallet.dat : " );
|
main->logger->write("Path to Wallet.dat : " );
|
||||||
qDebug() << __func__ << ": wallet path =" << plaintextWallet;
|
qDebug() << __func__ << ": wallet path =" << plaintextWallet;
|
||||||
plaintextWallet.remove();
|
plaintextWallet.remove();
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
main->logger->write("no Plaintext wallet.dat");
|
main->logger->write("no Plaintext wallet.dat");
|
||||||
|
qDebug() << "No plaintext wallet found! file=" << plaintextWallet;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef CONNECTION_H
|
#ifndef CONNECTION_H
|
||||||
#define CONNECTION_H
|
#define CONNECTION_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// GPLv3
|
// GPLv3
|
||||||
|
|
||||||
#include "contactmodel.h"
|
#include "contactmodel.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef CONTACTMODEL_H
|
#ifndef CONTACTMODEL_H
|
||||||
#define CONTACTMODEL_H
|
#define CONTACTMODEL_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
|
|
||||||
#include "controller.h"
|
#include "controller.h"
|
||||||
@@ -44,7 +44,6 @@ Controller::Controller(MainWindow* main)
|
|||||||
transactionsTableModel = new TxTableModel(ui->transactionsTable);
|
transactionsTableModel = new TxTableModel(ui->transactionsTable);
|
||||||
main->ui->transactionsTable->setModel(transactionsTableModel);
|
main->ui->transactionsTable->setModel(transactionsTableModel);
|
||||||
|
|
||||||
|
|
||||||
// Set up timer to refresh Price
|
// Set up timer to refresh Price
|
||||||
priceTimer = new QTimer(main);
|
priceTimer = new QTimer(main);
|
||||||
QObject::connect(priceTimer, &QTimer::timeout, [=]() {
|
QObject::connect(priceTimer, &QTimer::timeout, [=]() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "datamodel.h"
|
#include "datamodel.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef DATAMODEL_H
|
#ifndef DATAMODEL_H
|
||||||
#define DATAMODEL_H
|
#define DATAMODEL_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "fillediconlabel.h"
|
#include "fillediconlabel.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef FILLEDICONLABEL_H
|
#ifndef FILLEDICONLABEL_H
|
||||||
#define FILLEDICONLABEL_H
|
#define FILLEDICONLABEL_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "firsttimewizard.h"
|
#include "firsttimewizard.h"
|
||||||
#include "ui_newseed.h"
|
#include "ui_newseed.h"
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
#include "ui_newwallet.h"
|
#include "ui_newwallet.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "DataStore/DataStore.h"
|
#include "DataStore/DataStore.h"
|
||||||
|
|
||||||
#include "../lib/silentdragonlitelib.h"
|
#include "../lib/silentdragonlitelib.h"
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
@@ -52,6 +51,7 @@ 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;
|
||||||
// Include css
|
// Include css
|
||||||
QString theme_name;
|
QString theme_name;
|
||||||
try
|
try
|
||||||
@@ -64,21 +64,19 @@ FirstTimeWizard::FirstTimeWizard(bool dangerous, QString server)
|
|||||||
}
|
}
|
||||||
this->slot_change_theme(theme_name);
|
this->slot_change_theme(theme_name);
|
||||||
|
|
||||||
setWindowTitle("New wallet wizard");
|
setWindowTitle(tr("New wallet wizard"));
|
||||||
this->dangerous = dangerous;
|
this->dangerous = dangerous;
|
||||||
this->server = server;
|
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));
|
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
||||||
QString addressbook = dir.filePath("addresslabels.dat.enc");
|
QString addressbook = dir.filePath("addresslabels.dat.enc");
|
||||||
QFile file(addressbook);
|
QFile file(addressbook);
|
||||||
|
|
||||||
if (file.exists())
|
if (file.exists()) {
|
||||||
{
|
file.rename(dir.filePath("addresslabels.dat.enc-backup"));
|
||||||
file.rename(dir.filePath("addresslabels.dat.enc-backup"));
|
qDebug() << __func__ << ": backed up old addresslabels";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the pages
|
// Create the pages
|
||||||
@@ -104,81 +102,83 @@ int FirstTimeWizard::nextId() const {
|
|||||||
|
|
||||||
QString FirstTimeWizard::getSeed()
|
QString FirstTimeWizard::getSeed()
|
||||||
{
|
{
|
||||||
|
|
||||||
return _seed;
|
return _seed;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FirstTimeWizard::setSeed(QString seed)
|
void FirstTimeWizard::setSeed(QString seed)
|
||||||
{
|
{
|
||||||
|
|
||||||
_seed = seed;
|
_seed = seed;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FirstTimeWizard::getBirthday()
|
QString FirstTimeWizard::getBirthday()
|
||||||
{
|
{
|
||||||
|
|
||||||
return _birthday;
|
return _birthday;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FirstTimeWizard::setBirthday(QString birthday)
|
void FirstTimeWizard::setBirthday(QString birthday)
|
||||||
{
|
{
|
||||||
|
|
||||||
_birthday = birthday;
|
_birthday = birthday;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FirstTimeWizard::initializePage() {
|
||||||
|
qDebug() << "FirstTimeWizard:" <<__func__;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void NewOrRestorePage::initializePage() {
|
||||||
|
qDebug() << "NewOrRestorePage:" <<__func__;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
NewOrRestorePage::NewOrRestorePage(FirstTimeWizard *parent) : QWizardPage(parent) {
|
NewOrRestorePage::NewOrRestorePage(FirstTimeWizard *parent) : QWizardPage(parent) {
|
||||||
setTitle("Create or Restore wallet.");
|
qDebug() << __func__;
|
||||||
|
setTitle(tr("Create or Restore wallet."));
|
||||||
|
|
||||||
QWidget* pageWidget = new QWidget();
|
QWidget* pageWidget = new QWidget();
|
||||||
Ui_CreateWalletForm form;
|
Ui_CreateWalletForm form;
|
||||||
form.setupUi(pageWidget);
|
form.setupUi(pageWidget);
|
||||||
|
|
||||||
QGraphicsScene* scene = new QGraphicsScene();
|
QGraphicsScene* scene = new QGraphicsScene();
|
||||||
QGraphicsView* view = new QGraphicsView(scene);
|
|
||||||
form.Logo->setScene(scene);
|
form.Logo->setScene(scene);
|
||||||
QPixmap pixmap(":/icons/res/dark-01.png");
|
QPixmap pixmap(":/icons/res/dark-01.png");
|
||||||
scene->addPixmap(pixmap);
|
scene->addPixmap(pixmap);
|
||||||
form.Logo->show();
|
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.txtPassword->setEnabled(false);
|
||||||
form.txtConfirmPassword->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) {
|
if (checked) {
|
||||||
|
|
||||||
form.txtPassword->setEnabled(true);
|
form.txtPassword->setEnabled(true);
|
||||||
form.txtConfirmPassword->setEnabled(true);
|
form.txtConfirmPassword->setEnabled(true);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
qDebug() << __func__ << ": disabling next/commit buttons";
|
||||||
parent->button(QWizard::CommitButton)->setEnabled(false);
|
parent->button(QWizard::CommitButton)->setEnabled(false);
|
||||||
parent->button(QWizard::NextButton)->setEnabled(false);
|
parent->button(QWizard::NextButton)->setEnabled(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
auto fnPasswordEdited = [=](const QString&) {
|
||||||
auto fnPasswordEdited = [=](const QString&) {
|
|
||||||
// Enable the Finish button if the passwords match.
|
// Enable the Finish button if the passwords match.
|
||||||
QString passphraseBlank = form.txtPassword->text();
|
QString passphraseBlank = form.txtPassword->text();
|
||||||
|
|
||||||
QString passphrase = QString("HUSH3") + passphraseBlank + QString("SDL");
|
QString passphrase = QString("HUSH3") + passphraseBlank + QString("SDL");
|
||||||
|
|
||||||
|
|
||||||
if (!form.txtPassword->text().isEmpty() &&
|
if (!form.txtPassword->text().isEmpty() &&
|
||||||
form.txtPassword->text() == form.txtConfirmPassword->text() && passphraseBlank.size() >= 16 ){
|
form.txtPassword->text() == form.txtConfirmPassword->text() && passphraseBlank.size() >= 16 ){
|
||||||
|
|
||||||
form.lblPasswordMatch->setText("");
|
form.lblPasswordMatch->setText("");
|
||||||
|
|
||||||
|
form.radioRestoreWallet->setEnabled(true);
|
||||||
|
form.radioNewWallet->setEnabled(true);
|
||||||
|
parent->button(QWizard::NextButton)->setEnabled(false);
|
||||||
|
|
||||||
form.radioRestoreWallet->setEnabled(true);
|
int length = passphrase.length();
|
||||||
form.radioNewWallet->setEnabled(true);
|
qDebug() << __func__ << ": passphrase length=" << length;
|
||||||
form.radioNewWallet->setChecked(true);
|
|
||||||
parent->button(QWizard::NextButton)->setEnabled(false);
|
|
||||||
|
|
||||||
|
|
||||||
int length = passphrase.length();
|
|
||||||
|
|
||||||
char *sequence = NULL;
|
char *sequence = NULL;
|
||||||
sequence = new char[length+1];
|
sequence = new char[length+1];
|
||||||
@@ -186,7 +186,6 @@ NewOrRestorePage::NewOrRestorePage(FirstTimeWizard *parent) : QWizardPage(parent
|
|||||||
|
|
||||||
QString passphraseHash = blake3_PW(sequence);
|
QString passphraseHash = blake3_PW(sequence);
|
||||||
|
|
||||||
|
|
||||||
char *sequence1 = NULL;
|
char *sequence1 = NULL;
|
||||||
sequence1 = new char[length+1];
|
sequence1 = new char[length+1];
|
||||||
strncpy(sequence1, passphraseHash.toUtf8(), length+1);
|
strncpy(sequence1, passphraseHash.toUtf8(), length+1);
|
||||||
@@ -200,18 +199,20 @@ NewOrRestorePage::NewOrRestorePage(FirstTimeWizard *parent) : QWizardPage(parent
|
|||||||
|
|
||||||
unsigned char key[KEY_LEN];
|
unsigned char key[KEY_LEN];
|
||||||
|
|
||||||
if (crypto_pwhash
|
if (crypto_pwhash(key, sizeof key, PASSWORD, strlen(PASSWORD), hash,
|
||||||
(key, sizeof key, PASSWORD, strlen(PASSWORD), hash,
|
|
||||||
crypto_pwhash_OPSLIMIT_SENSITIVE, crypto_pwhash_MEMLIMIT_SENSITIVE,
|
crypto_pwhash_OPSLIMIT_SENSITIVE, crypto_pwhash_MEMLIMIT_SENSITIVE,
|
||||||
crypto_pwhash_ALG_DEFAULT) != 0) {
|
crypto_pwhash_ALG_DEFAULT) != 0) {
|
||||||
/* out of memory */
|
/* 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();
|
QString passphraseHash1 = QByteArray(reinterpret_cast<const char*>(key), KEY_LEN).toHex();
|
||||||
DataStore::getChatDataStore()->setPassword(passphraseHash1);
|
DataStore::getChatDataStore()->setPassword(passphraseHash1);
|
||||||
|
|
||||||
// Exclusive buttons
|
// Exclusive buttons
|
||||||
QObject::connect(form.radioNewWallet, &QRadioButton::clicked, [=](bool checked) {
|
QObject::connect(form.radioNewWallet, &QRadioButton::clicked, [=](bool checked) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
|
qDebug() << __func__ << ": new wallet radio button clicked";
|
||||||
form.radioRestoreWallet->setChecked(false);
|
form.radioRestoreWallet->setChecked(false);
|
||||||
parent->button(QWizard::CommitButton)->setEnabled(true);
|
parent->button(QWizard::CommitButton)->setEnabled(true);
|
||||||
|
|
||||||
@@ -220,18 +221,16 @@ NewOrRestorePage::NewOrRestorePage(FirstTimeWizard *parent) : QWizardPage(parent
|
|||||||
|
|
||||||
QObject::connect(form.radioRestoreWallet, &QRadioButton::clicked, [=](bool checked) {
|
QObject::connect(form.radioRestoreWallet, &QRadioButton::clicked, [=](bool checked) {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
|
qDebug() << __func__ << ": restore wallet radio button clicked";
|
||||||
form.radioNewWallet->setChecked(false);
|
form.radioNewWallet->setChecked(false);
|
||||||
parent->button(QWizard::CommitButton)->setEnabled(true);
|
parent->button(QWizard::CommitButton)->setEnabled(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} 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);
|
parent->button(QWizard::CommitButton)->setEnabled(false);
|
||||||
form.radioRestoreWallet->setEnabled(false);
|
form.radioRestoreWallet->setEnabled(false);
|
||||||
@@ -244,23 +243,33 @@ NewOrRestorePage::NewOrRestorePage(FirstTimeWizard *parent) : QWizardPage(parent
|
|||||||
layout->addWidget(pageWidget);
|
layout->addWidget(pageWidget);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
|
|
||||||
QObject::connect(form.txtConfirmPassword, &QLineEdit::textChanged, fnPasswordEdited);
|
QObject::connect(form.txtConfirmPassword, &QLineEdit::textChanged, fnPasswordEdited);
|
||||||
QObject::connect(form.txtPassword, &QLineEdit::textChanged, fnPasswordEdited);
|
QObject::connect(form.txtPassword, &QLineEdit::textChanged, fnPasswordEdited);
|
||||||
|
|
||||||
registerField("intro.new", form.radioNewWallet);
|
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.radioRestoreWallet->setEnabled(false);
|
||||||
form.radioNewWallet->setEnabled(false);
|
form.radioNewWallet->setEnabled(false);
|
||||||
|
|
||||||
|
qDebug() << __func__ << ": disabling next/commit buttons";
|
||||||
setCommitPage(true);
|
setCommitPage(true);
|
||||||
|
|
||||||
|
parent->button(QWizard::CommitButton)->setEnabled(false);
|
||||||
|
parent->button(QWizard::NextButton)->setEnabled(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NewSeedPage::NewSeedPage(FirstTimeWizard *parent) : QWizardPage(parent) {
|
NewSeedPage::NewSeedPage(FirstTimeWizard *parent) : QWizardPage(parent) {
|
||||||
|
qDebug() << __func__;
|
||||||
this->parent = parent;
|
this->parent = parent;
|
||||||
|
|
||||||
setTitle("Your new wallet");
|
setTitle(tr("Your new wallet"));
|
||||||
|
|
||||||
QWidget* pageWidget = new QWidget();
|
QWidget* pageWidget = new QWidget();
|
||||||
form.setupUi(pageWidget);
|
form.setupUi(pageWidget);
|
||||||
@@ -273,9 +282,11 @@ NewSeedPage::NewSeedPage(FirstTimeWizard *parent) : QWizardPage(parent) {
|
|||||||
|
|
||||||
void NewSeedPage::initializePage() {
|
void NewSeedPage::initializePage() {
|
||||||
// Call the library to create a new wallet.
|
// Call the library to create a new wallet.
|
||||||
|
qDebug() << __func__;
|
||||||
|
|
||||||
char* resp = litelib_initialize_new(parent->dangerous,parent->server.toStdString().c_str());
|
char* resp = litelib_initialize_new(parent->dangerous,parent->server.toStdString().c_str());
|
||||||
QString reply = litelib_process_response(resp);
|
QString reply = litelib_process_response(resp);
|
||||||
|
qDebug() << __func__ << ": reply=" << reply;
|
||||||
|
|
||||||
auto parsed = json::parse(reply.toStdString().c_str(), nullptr, false);
|
auto parsed = json::parse(reply.toStdString().c_str(), nullptr, false);
|
||||||
if (parsed.is_discarded() || parsed.is_null() || parsed.find("seed") == parsed.end()) {
|
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);
|
parent->button(QWizard::CancelButton)->setEnabled(false);
|
||||||
disconnect(parent->button(QWizard::CancelButton ), SIGNAL( clicked() ), parent, SLOT( reject() ) );
|
disconnect(parent->button(QWizard::CancelButton ), SIGNAL( clicked() ), parent, SLOT( reject() ) );
|
||||||
connect(parent->button(QWizard::CancelButton ), SIGNAL( clicked() ), parent, SLOT( cancelEvent() ) );
|
connect(parent->button(QWizard::CancelButton ), SIGNAL( clicked() ), parent, SLOT( cancelEvent() ) );
|
||||||
|
qDebug() << __func__ << ": page initialized with birthday=" << birthday;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FirstTimeWizard::cancelEvent()
|
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 ) {
|
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
|
qDebug() << __func__ << ": wizard canceled";
|
||||||
reject();
|
// allow cancel
|
||||||
}
|
reject();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Will be called just before closing. Make sure we can save the seed in the wallet
|
// Will be called just before closing. Make sure we can save the seed in the wallet
|
||||||
// before we allow the page to be closed
|
// before we allow the page to be closed
|
||||||
bool NewSeedPage::validatePage() {
|
bool NewSeedPage::validatePage() {
|
||||||
|
qDebug() << __func__;
|
||||||
|
|
||||||
Ui_verifyseed verifyseed;
|
Ui_verifyseed verifyseed;
|
||||||
QDialog dialog(this);
|
QDialog dialog(this);
|
||||||
@@ -316,7 +328,6 @@ bool NewSeedPage::validatePage() {
|
|||||||
form.birthday->setVisible(false);
|
form.birthday->setVisible(false);
|
||||||
form.txtSeed->setVisible(false);
|
form.txtSeed->setVisible(false);
|
||||||
|
|
||||||
|
|
||||||
QString seed = parent->getSeed();
|
QString seed = parent->getSeed();
|
||||||
QString birthday = parent->getBirthday();
|
QString birthday = parent->getBirthday();
|
||||||
QString word1 = seed.split(" ").at(13);
|
QString word1 = seed.split(" ").at(13);
|
||||||
@@ -603,8 +614,7 @@ bool NewSeedPage::validatePage() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
qDebug()<<"Wrong Seed";
|
||||||
qDebug()<<"Falscher Seed";
|
|
||||||
QFile file(dirwalletencfirst);
|
QFile file(dirwalletencfirst);
|
||||||
QFile file1(dirwalletfirst);
|
QFile file1(dirwalletfirst);
|
||||||
|
|
||||||
@@ -618,13 +628,15 @@ bool NewSeedPage::validatePage() {
|
|||||||
return false;
|
return false;
|
||||||
this->validatePage();
|
this->validatePage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RestoreSeedPage::RestoreSeedPage(FirstTimeWizard *parent) : QWizardPage(parent) {
|
RestoreSeedPage::RestoreSeedPage(FirstTimeWizard *parent) : QWizardPage(parent) {
|
||||||
this->parent = parent;
|
this->parent = parent;
|
||||||
|
|
||||||
setTitle("Restore wallet from seed");
|
setTitle(tr("Restore wallet from seed"));
|
||||||
|
|
||||||
QWidget* pageWidget = new QWidget();
|
QWidget* pageWidget = new QWidget();
|
||||||
form.setupUi(pageWidget);
|
form.setupUi(pageWidget);
|
||||||
@@ -638,7 +650,9 @@ RestoreSeedPage::RestoreSeedPage(FirstTimeWizard *parent) : QWizardPage(parent)
|
|||||||
bool RestoreSeedPage::validatePage() {
|
bool RestoreSeedPage::validatePage() {
|
||||||
// 1. Validate that we do have 24 words
|
// 1. Validate that we do have 24 words
|
||||||
QString seed = form.txtSeed->toPlainText().replace(QRegExp("[ \n\r\t]+"), " ");
|
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"),
|
QMessageBox::warning(this, tr("Failed to restore wallet"),
|
||||||
tr("SilentDragonLite needs 24 words to restore wallet"),
|
tr("SilentDragonLite needs 24 words to restore wallet"),
|
||||||
QMessageBox::Ok);
|
QMessageBox::Ok);
|
||||||
@@ -650,16 +664,16 @@ bool RestoreSeedPage::validatePage() {
|
|||||||
bool ok;
|
bool ok;
|
||||||
qint64 birthday = birthday_str.toUInt(&ok);
|
qint64 birthday = birthday_str.toUInt(&ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
|
qDebug() << __func__ << ": Failed to parse wallet birthday=" << birthday_str;
|
||||||
QMessageBox::warning(this, tr("Failed to parse wallet birthday"),
|
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 it as '0' if you don't know what it should be."),
|
||||||
QMessageBox::Ok);
|
QMessageBox::Ok);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
///Number
|
///Number
|
||||||
|
QString number_str = form.number->text();
|
||||||
QString number_str = form.number->text();
|
qint64 number = number_str.toUInt();
|
||||||
qint64 number = number_str.toUInt();
|
|
||||||
// 3. Attempt to restore wallet with the seed phrase
|
// 3. Attempt to restore wallet with the seed phrase
|
||||||
{
|
{
|
||||||
char* resp = litelib_initialize_new_from_phrase(parent->dangerous, parent->server.toStdString().c_str(),
|
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);
|
auto parsed = json::parse(reply.toStdString().c_str(), nullptr, false);
|
||||||
if (parsed.is_discarded() || parsed.is_null() || parsed.find("result") == parsed.end()) {
|
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"),
|
QMessageBox::warning(this, tr("Failed to save wallet"),
|
||||||
tr("Couldn't save the wallet") + "\n" + reply,
|
tr("Couldn't save the wallet") + "\n" + reply,
|
||||||
QMessageBox::Ok);
|
QMessageBox::Ok);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2020 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef FIRSTTIMEWIZARD_H
|
#ifndef FIRSTTIMEWIZARD_H
|
||||||
#define FIRSTTIMEWIZARD_H
|
#define FIRSTTIMEWIZARD_H
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
class FirstTimeWizard: public QWizard
|
class FirstTimeWizard: public QWizard
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FirstTimeWizard(bool dangerous, QString server);
|
FirstTimeWizard(bool dangerous, QString server);
|
||||||
@@ -31,8 +31,10 @@ public slots:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
int nextId() const;
|
int nextId() const;
|
||||||
|
virtual void initializePage();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
FirstTimeWizard* parent;
|
||||||
enum {
|
enum {
|
||||||
Page_NewOrRestore,
|
Page_NewOrRestore,
|
||||||
Page_New,
|
Page_New,
|
||||||
@@ -46,15 +48,20 @@ private:
|
|||||||
friend class NewSeedPage;
|
friend class NewSeedPage;
|
||||||
friend class RestoreSeedPage;
|
friend class RestoreSeedPage;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class NewOrRestorePage: public QWizardPage {
|
class NewOrRestorePage: public QWizardPage {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
NewOrRestorePage(FirstTimeWizard* parent);
|
NewOrRestorePage(FirstTimeWizard* parent);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void initializePage();
|
||||||
|
|
||||||
|
private:
|
||||||
|
FirstTimeWizard* parent;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -85,6 +92,4 @@ private:
|
|||||||
Ui_RestoreSeedForm form;
|
Ui_RestoreSeedForm form;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // FIRSTTIMEWIZARD_H
|
#endif // FIRSTTIMEWIZARD_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "liteinterface.h"
|
#include "liteinterface.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef hushDRPC_H
|
#ifndef hushDRPC_H
|
||||||
#define hushDRPC_H
|
#define hushDRPC_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef LOGGER_H
|
#ifndef LOGGER_H
|
||||||
#define LOGGER_H
|
#define LOGGER_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include <singleapplication.h>
|
#include <singleapplication.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "addressbook.h"
|
#include "addressbook.h"
|
||||||
@@ -77,11 +77,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
|
|
||||||
this->slot_change_theme(theme_name);
|
this->slot_change_theme(theme_name);
|
||||||
|
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
||||||
if (!dir.exists()){
|
if (!dir.exists()){
|
||||||
|
qDebug() << __func__ << ": creating dir=" << dir.absolutePath();
|
||||||
QDir().mkpath(dir.absolutePath());
|
QDir().mkpath(dir.absolutePath());
|
||||||
}else{}
|
}else{}
|
||||||
|
|
||||||
@@ -175,7 +175,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
restoreSeed.setupUi(&dialog);
|
restoreSeed.setupUi(&dialog);
|
||||||
Settings::saveRestore(&dialog);
|
Settings::saveRestore(&dialog);
|
||||||
|
|
||||||
|
|
||||||
rpc->fetchSeed([=](json reply) {
|
rpc->fetchSeed([=](json reply) {
|
||||||
if (isJsonError(reply)) {
|
if (isJsonError(reply)) {
|
||||||
return;
|
return;
|
||||||
@@ -246,26 +245,29 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
tr("Couldn't save the wallet") + "\n" + reply,
|
tr("Couldn't save the wallet") + "\n" + reply,
|
||||||
QMessageBox::Ok);
|
QMessageBox::Ok);
|
||||||
|
|
||||||
} else {}
|
} else {
|
||||||
|
qDebug() << __func__ << ": saved wallet correctly";
|
||||||
|
}
|
||||||
|
|
||||||
dialog.close();
|
dialog.close();
|
||||||
// To rescan, we clear the wallet state, and then reload the connection
|
// To rescan, we clear the wallet state, and then reload the connection
|
||||||
// This will start a sync, and show the scanning status.
|
// This will start a sync, and show the scanning status.
|
||||||
this->getRPC()->clearWallet([=] (auto) {
|
this->getRPC()->clearWallet([=] (auto) {
|
||||||
|
qDebug() << "Clearing wallet...";
|
||||||
// Save the wallet
|
// Save the wallet
|
||||||
this->getRPC()->saveWallet([=] (auto) {
|
this->getRPC()->saveWallet([=] (auto) {
|
||||||
|
qDebug() << "Saving wallet...";
|
||||||
// Then reload the connection. The ConnectionLoader deletes itself.
|
// Then reload the connection. The ConnectionLoader deletes itself.
|
||||||
auto cl = new ConnectionLoader(this, rpc);
|
auto cl = new ConnectionLoader(this, rpc);
|
||||||
cl->loadConnection();
|
cl->loadConnection();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
});
|
||||||
|
|
||||||
});
|
dialog.exec();
|
||||||
|
|
||||||
dialog.exec();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Import Privkey
|
// Import Privkey
|
||||||
@@ -432,6 +434,7 @@ void MainWindow::closeEvent(QCloseEvent* event) {
|
|||||||
|
|
||||||
void MainWindow::closeEventpw(QCloseEvent* event) {
|
void MainWindow::closeEventpw(QCloseEvent* event) {
|
||||||
// Let the RPC know to shut down any running service.
|
// Let the RPC know to shut down any running service.
|
||||||
|
qDebug() << __func__ << ": event=" << event;
|
||||||
rpc->shutdownhushd();
|
rpc->shutdownhushd();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -489,12 +492,16 @@ void MainWindow::encryptWallet() {
|
|||||||
|
|
||||||
unsigned char key[KEY_LEN];
|
unsigned char key[KEY_LEN];
|
||||||
|
|
||||||
if (crypto_pwhash
|
if (crypto_pwhash(key, sizeof key, PASSWORD, strlen(PASSWORD), hash,
|
||||||
(key, sizeof key, PASSWORD, strlen(PASSWORD), hash,
|
|
||||||
crypto_pwhash_OPSLIMIT_SENSITIVE, crypto_pwhash_MEMLIMIT_SENSITIVE,
|
crypto_pwhash_OPSLIMIT_SENSITIVE, crypto_pwhash_MEMLIMIT_SENSITIVE,
|
||||||
crypto_pwhash_ALG_DEFAULT) != 0) {
|
crypto_pwhash_ALG_DEFAULT) != 0) {
|
||||||
/* out of memory */
|
/* 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<const char*>(key), KEY_LEN).toHex();
|
QString passphraseHash1 = QByteArray(reinterpret_cast<const char*>(key), KEY_LEN).toHex();
|
||||||
DataStore::getChatDataStore()->setPassword(passphraseHash1);
|
DataStore::getChatDataStore()->setPassword(passphraseHash1);
|
||||||
|
|
||||||
@@ -835,6 +842,8 @@ void MainWindow::setupSettingsModal() {
|
|||||||
settings.cmbServer->addItem("https://devo.crabdance.com");
|
settings.cmbServer->addItem("https://devo.crabdance.com");
|
||||||
settings.cmbServer->addItem("https://lite.nyami.org");
|
settings.cmbServer->addItem("https://lite.nyami.org");
|
||||||
settings.cmbServer->addItem("https://poop.granitefone.me:9067");
|
settings.cmbServer->addItem("https://poop.granitefone.me:9067");
|
||||||
|
settings.cmbServer->addItem("https://lite.hushpool.is");
|
||||||
|
|
||||||
//settings.cmbServer->addItem("https://hush.leto.net:5420");
|
//settings.cmbServer->addItem("https://hush.leto.net:5420");
|
||||||
//TODO: seperate lists of https/Tor servers, only show user or attempt
|
//TODO: seperate lists of https/Tor servers, only show user or attempt
|
||||||
// connection to .onion if user has it enabled
|
// 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
|
// will prompt for one. If the myAddr is empty, then the default from address is used to send
|
||||||
// the transaction.
|
// the transaction.
|
||||||
void MainWindow::payhushURI(QString uri, QString myAddr) {
|
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 the Payments UI is not ready (i.e, all balances have not loaded), defer the payment URI
|
||||||
if (!isPaymentsReady()) {
|
if (!isPaymentsReady()) {
|
||||||
qDebug() << "Payment UI not ready, waiting for UI to pay URI";
|
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]+"));
|
int lastPost = memo.trimmed().lastIndexOf(QRegExp("[\r\n]+"));
|
||||||
QString lastWord = memo.right(memo.length() - lastPost - 1);
|
QString lastWord = memo.right(memo.length() - lastPost - 1);
|
||||||
|
|
||||||
if (Settings::getInstance()->isSaplingAddress(lastWord) ||
|
if (Settings::getInstance()->isSaplingAddress(lastWord)) {
|
||||||
Settings::getInstance()->isSproutAddress(lastWord)) {
|
|
||||||
menu.addAction(tr("Reply to ") + lastWord.left(25) + "...", [=]() {
|
menu.addAction(tr("Reply to ") + lastWord.left(25) + "...", [=]() {
|
||||||
// First, cancel any pending stuff in the send tab by pretending to click
|
// First, cancel any pending stuff in the send tab by pretending to click
|
||||||
// the cancel button
|
// 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
|
// lambda, which can be connected to the appropriate signal
|
||||||
std::function<void(bool)> MainWindow::addZAddrsToComboList(bool sapling) {
|
std::function<void(bool)> MainWindow::addZAddrsToComboList(bool sapling) {
|
||||||
return [=] (bool checked) {
|
return [=] (bool checked) {
|
||||||
@@ -2770,9 +2779,7 @@ void MainWindow::updateLabels() {
|
|||||||
updateLabelsAutoComplete();
|
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);
|
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);
|
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);
|
QMessageBox::information(this, "Your new HushChat address was copied to your clipboard!",hushchataddr);
|
||||||
ui->listReceiveAddresses->insertItem(0, hushchataddr);
|
ui->listReceiveAddresses->insertItem(0, hushchataddr);
|
||||||
ui->listReceiveAddresses->setCurrentIndex(0);
|
ui->listReceiveAddresses->setCurrentIndex(0);
|
||||||
|
qDebug() << __func__ << ": hushchat zaddr=" << hushchataddr << " created";
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef MAINWINDOW_H
|
#ifndef MAINWINDOW_H
|
||||||
#define MAINWINDOW_H
|
#define MAINWINDOW_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "memoedit.h"
|
#include "memoedit.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef MEMOEDIT_H
|
#ifndef MEMOEDIT_H
|
||||||
#define MEMOEDIT_H
|
#define MEMOEDIT_H
|
||||||
|
|||||||
139
src/migration.ui
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 -> 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>
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "mobileappconnector.h"
|
#include "mobileappconnector.h"
|
||||||
#include "ui_mobileappconnector.h"
|
#include "ui_mobileappconnector.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef MOBILEAPPCONNECTOR_H
|
#ifndef MOBILEAPPCONNECTOR_H
|
||||||
#define MOBILEAPPCONNECTOR_H
|
#define MOBILEAPPCONNECTOR_H
|
||||||
|
|||||||
@@ -110,6 +110,9 @@ p, li { white-space: pre-wrap; }
|
|||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">color: red;</string>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>I accept the Terms of Service</string>
|
<string>I accept the Terms of Service</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -146,7 +149,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<string notr="true">color: red;</string>
|
<string notr="true">color: red;</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string><html><head/><body><p><span style=" font-style:italic;">Passphrase don't match</span></p></body></html></string>
|
<string></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignCenter</set>
|
<set>Qt::AlignCenter</set>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#if defined __cplusplus
|
#if defined __cplusplus
|
||||||
/* Add C++ includes here */
|
/* Add C++ includes here */
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "qrcodelabel.h"
|
#include "qrcodelabel.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef QRCODELABEL_H
|
#ifndef QRCODELABEL_H
|
||||||
#define QRCODELABEL_H
|
#define QRCODELABEL_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "recurring.h"
|
#include "recurring.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef RECURRING_H
|
#ifndef RECURRING_H
|
||||||
#define RECURRING_H
|
#define RECURRING_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "requestdialog.h"
|
#include "requestdialog.h"
|
||||||
#include "ui_requestdialog.h"
|
#include "ui_requestdialog.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef REQUESTDIALOG_H
|
#ifndef REQUESTDIALOG_H
|
||||||
#define REQUESTDIALOG_H
|
#define REQUESTDIALOG_H
|
||||||
|
|||||||
@@ -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>
|
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
@@ -95,13 +95,6 @@ bool Settings::isSaplingAddress(QString addr) {
|
|||||||
(!isTestnet() && addr.startsWith("zs1"));
|
(!isTestnet() && addr.startsWith("zs1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Settings::isSproutAddress(QString addr) {
|
|
||||||
if (!isValidAddress(addr))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return isZAddress(addr) && !isSaplingAddress(addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Settings::isZAddress(QString addr) {
|
bool Settings::isZAddress(QString addr) {
|
||||||
if (!isValidAddress(addr))
|
if (!isValidAddress(addr))
|
||||||
return false;
|
return false;
|
||||||
@@ -305,12 +298,14 @@ QString Settings::getRandomServer() {
|
|||||||
"https://devo.crabdance.com",
|
"https://devo.crabdance.com",
|
||||||
"https://lite.nyami.org",
|
"https://lite.nyami.org",
|
||||||
"https://poop.granitefone.me:9067",
|
"https://poop.granitefone.me:9067",
|
||||||
|
// These can be un-commented to test out how code deals with down servers
|
||||||
//"https://thisisdown1.example.com",
|
//"https://thisisdown1.example.com",
|
||||||
//"https://thisisdown2.example.com",
|
//"https://thisisdown2.example.com",
|
||||||
//"https://thisisdown3.example.com",
|
//"https://thisisdown3.example.com",
|
||||||
//"https://thisisdown4.example.com",
|
//"https://thisisdown4.example.com",
|
||||||
//"https://thisisdown5.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
|
// we don't need cryptographic random-ness, but we want
|
||||||
@@ -324,7 +319,14 @@ QString Settings::getRandomServer() {
|
|||||||
while (tries < servers.size() ) {
|
while (tries < servers.size() ) {
|
||||||
qDebug() << "Checking if lite server " << server << " is a alive, try=" << tries;
|
qDebug() << "Checking if lite server " << server << " is a alive, try=" << tries;
|
||||||
char* resp = litelib_initialize_existing(false, server.toStdString().c_str());
|
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 we see a valid connection, return this server
|
||||||
if (response.toUpper().trimmed() == "OK") {
|
if (response.toUpper().trimmed() == "OK") {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef SETTINGS_H
|
#ifndef SETTINGS_H
|
||||||
#define SETTINGS_H
|
#define SETTINGS_H
|
||||||
@@ -42,7 +42,6 @@ public:
|
|||||||
void setTestnet(bool isTestnet);
|
void setTestnet(bool isTestnet);
|
||||||
|
|
||||||
bool isSaplingAddress(QString addr);
|
bool isSaplingAddress(QString addr);
|
||||||
bool isSproutAddress(QString addr);
|
|
||||||
|
|
||||||
bool isValidSaplingPrivateKey(QString pk);
|
bool isValidSaplingPrivateKey(QString pk);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#include "txtablemodel.h"
|
#include "txtablemodel.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2019-2021 The Hush developers
|
// Copyright 2019-2022 The Hush developers
|
||||||
// Released under the GPLv3
|
// Released under the GPLv3
|
||||||
#ifndef STRINGSTABLEMODEL_H
|
#ifndef STRINGSTABLEMODEL_H
|
||||||
#define STRINGSTABLEMODEL_H
|
#define STRINGSTABLEMODEL_H
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user