@@ -39,6 +39,18 @@ QString ChatDataStore::getPassword()
|
|||||||
return _password;
|
return _password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ChatDataStore::getSendZaddr()
|
||||||
|
{
|
||||||
|
|
||||||
|
return _zaddr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChatDataStore::setSendZaddr(QString zaddr)
|
||||||
|
{
|
||||||
|
|
||||||
|
_zaddr = zaddr;
|
||||||
|
}
|
||||||
|
|
||||||
void ChatDataStore::setPassword(QString password)
|
void ChatDataStore::setPassword(QString password)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,14 @@ class ChatDataStore
|
|||||||
std::map<QString, ChatItem> getAllOldContactRequests();
|
std::map<QString, ChatItem> getAllOldContactRequests();
|
||||||
std::map<QString, ChatItem> getAllMemos();
|
std::map<QString, ChatItem> getAllMemos();
|
||||||
QString getPassword();
|
QString getPassword();
|
||||||
|
QString getSendZaddr();
|
||||||
|
|
||||||
void setPassword(QString Password);
|
void setSendZaddr(QString Password);
|
||||||
QString _password;
|
QString _password;
|
||||||
|
|
||||||
|
void setPassword(QString zaddr);
|
||||||
|
QString _zaddr;
|
||||||
|
|
||||||
QString dump();
|
QString dump();
|
||||||
|
|
||||||
~ChatDataStore()
|
~ChatDataStore()
|
||||||
|
|||||||
@@ -386,25 +386,67 @@ AddressBook::AddressBook()
|
|||||||
|
|
||||||
void AddressBook::readFromStorage()
|
void AddressBook::readFromStorage()
|
||||||
{
|
{
|
||||||
QFile file(AddressBook::writeableFile());
|
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
||||||
|
QString target_decaddr_file = dir.filePath("addresslabels.dat");
|
||||||
|
QString target_encaddr_file = dir.filePath("addresslabels.dat.enc");
|
||||||
|
QFile file(target_encaddr_file);
|
||||||
|
QFile file1(target_decaddr_file);
|
||||||
|
|
||||||
if (file.exists())
|
if (file.exists())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
qDebug() << "Existiert";
|
||||||
|
QString password = DataStore::getChatDataStore()->getPassword();
|
||||||
|
int length = password.length();
|
||||||
|
char *sequence = NULL;
|
||||||
|
sequence = new char[length+1];
|
||||||
|
strncpy(sequence, password.toLocal8Bit(), length +1);
|
||||||
|
|
||||||
|
#define MESSAGE ((const unsigned char *) sequence)
|
||||||
|
#define MESSAGE_LEN length
|
||||||
|
|
||||||
|
unsigned char hash[crypto_secretstream_xchacha20poly1305_KEYBYTES];
|
||||||
|
|
||||||
|
crypto_hash_sha256(hash,MESSAGE, MESSAGE_LEN);
|
||||||
|
|
||||||
|
#define PASSWORD sequence
|
||||||
|
#define KEY_LEN crypto_box_SEEDBYTES
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////we use the Hash of the Password as Salt, not perfect but still a good solution.
|
||||||
|
|
||||||
|
unsigned char key[KEY_LEN];
|
||||||
|
|
||||||
|
if (crypto_pwhash
|
||||||
|
(key, sizeof key, PASSWORD, strlen(PASSWORD), hash,
|
||||||
|
crypto_pwhash_OPSLIMIT_SENSITIVE, crypto_pwhash_MEMLIMIT_SENSITIVE,
|
||||||
|
crypto_pwhash_ALG_DEFAULT) != 0) {
|
||||||
|
/* out of memory */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FileEncryption::decrypt(target_decaddr_file, target_encaddr_file, key);
|
||||||
|
qDebug() << "entschlüsselt";
|
||||||
|
|
||||||
allLabels.clear();
|
allLabels.clear();
|
||||||
file.open(QIODevice::ReadOnly);
|
file1.open(QIODevice::ReadOnly);
|
||||||
QDataStream in(&file); // read the data serialized from the file
|
QDataStream in(&file1); // read the data serialized from the file
|
||||||
QString version;
|
QString version;
|
||||||
in >> version;
|
in >> version;
|
||||||
QList<QList<QString>> stuff;
|
QList<QList<QString>> stuff;
|
||||||
in >> stuff;
|
in >> stuff;
|
||||||
|
|
||||||
//////////////found old addrbook, and rename it to .bak
|
//////////////found old addrbook, and rename it to .bak
|
||||||
if (version != "v2")
|
if (version == "v1")
|
||||||
{
|
{
|
||||||
auto filename = QStringLiteral("addresslabels.dat");
|
auto filename = QStringLiteral("addresslabels.dat");
|
||||||
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
||||||
QFile address(dir.filePath(filename));
|
QFile address(dir.filePath(filename));
|
||||||
|
|
||||||
|
qDebug() << "is v1";
|
||||||
|
|
||||||
address.rename(dir.filePath("addresslabels.bak"));
|
address.rename(dir.filePath("addresslabels.bak"));
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
@@ -419,21 +461,16 @@ void AddressBook::readFromStorage()
|
|||||||
|
|
||||||
|
|
||||||
// qDebug() << "Read " << version << " Hush contacts from disk...";
|
// qDebug() << "Read " << version << " Hush contacts from disk...";
|
||||||
file.close();
|
file1.close();
|
||||||
|
|
||||||
|
FileEncryption::encrypt(target_encaddr_file, target_decaddr_file, key);
|
||||||
|
file1.remove();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << "No Hush contacts found on disk!";
|
qDebug() << "No Hush contacts found on disk!";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special.
|
|
||||||
// Add the default silentdragon donation address if it isn't already present
|
|
||||||
// QList<QString> allAddresses;
|
|
||||||
// std::transform(allLabels.begin(), allLabels.end(),
|
|
||||||
// std::back_inserter(allAddresses), [=] (auto i) { return i.getPartnerAddress(); });
|
|
||||||
// if (!allAddresses.contains(Settings::getDonationAddr(true))) {
|
|
||||||
// allLabels.append(QPair<QString, QString>("silentdragon donation", Settings::getDonationAddr(true)));
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -443,11 +480,48 @@ void AddressBook::writeToStorage()
|
|||||||
|
|
||||||
// FileSystem::getInstance()->writeContactsOldFormat(AddressBook::writeableFile(), allLabels);
|
// FileSystem::getInstance()->writeContactsOldFormat(AddressBook::writeableFile(), allLabels);
|
||||||
|
|
||||||
|
QString password = DataStore::getChatDataStore()->getPassword();
|
||||||
|
int length = password.length();
|
||||||
|
char *sequence = NULL;
|
||||||
|
sequence = new char[length+1];
|
||||||
|
strncpy(sequence, password.toLocal8Bit(), length +1);
|
||||||
|
|
||||||
QFile file(AddressBook::writeableFile());
|
#define MESSAGE ((const unsigned char *) sequence)
|
||||||
|
#define MESSAGE_LEN length
|
||||||
|
|
||||||
|
unsigned char hash[crypto_secretstream_xchacha20poly1305_KEYBYTES];
|
||||||
|
|
||||||
|
crypto_hash_sha256(hash,MESSAGE, MESSAGE_LEN);
|
||||||
|
|
||||||
|
#define PASSWORD sequence
|
||||||
|
#define KEY_LEN crypto_box_SEEDBYTES
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/////////we use the Hash of the Password as Salt, not perfect but still a good solution.
|
||||||
|
|
||||||
|
unsigned char key[KEY_LEN];
|
||||||
|
|
||||||
|
if (crypto_pwhash
|
||||||
|
(key, sizeof key, PASSWORD, strlen(PASSWORD), hash,
|
||||||
|
crypto_pwhash_OPSLIMIT_SENSITIVE, crypto_pwhash_MEMLIMIT_SENSITIVE,
|
||||||
|
crypto_pwhash_ALG_DEFAULT) != 0) {
|
||||||
|
/* out of memory */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
||||||
|
QString target_encaddr_file = dir.filePath("addresslabels.dat.enc");
|
||||||
|
QString target_decaddr_file = dir.filePath("addresslabels.dat");
|
||||||
|
|
||||||
|
FileEncryption::decrypt(target_decaddr_file, target_encaddr_file, key);
|
||||||
|
|
||||||
|
QFile file(target_decaddr_file);
|
||||||
file.open(QIODevice::ReadWrite | QIODevice::Truncate);
|
file.open(QIODevice::ReadWrite | QIODevice::Truncate);
|
||||||
QDataStream out(&file); // we will serialize the data into the file
|
QDataStream out(&file); // we will serialize the data into the file
|
||||||
QList<QList<QString>> contacts;
|
QList<QList<QString>> contacts;
|
||||||
|
|
||||||
for(auto &item: allLabels)
|
for(auto &item: allLabels)
|
||||||
{
|
{
|
||||||
QList<QString> c;
|
QList<QString> c;
|
||||||
@@ -457,9 +531,19 @@ void AddressBook::writeToStorage()
|
|||||||
c.push_back(item.getCid());
|
c.push_back(item.getCid());
|
||||||
c.push_back(item.getAvatar());
|
c.push_back(item.getAvatar());
|
||||||
contacts.push_back(c);
|
contacts.push_back(c);
|
||||||
|
|
||||||
}
|
}
|
||||||
out << QString("v2") << contacts;
|
out << QString("v2") << contacts;
|
||||||
|
qDebug()<<"schreibe in Datei: ";
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
|
||||||
|
FileEncryption::encrypt(target_encaddr_file, target_decaddr_file , key);
|
||||||
|
QFile file1(target_decaddr_file);
|
||||||
|
file1.remove();
|
||||||
|
|
||||||
|
qDebug()<<"encrypt Addrbook writeToStorage";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AddressBook::writeableFile()
|
QString AddressBook::writeableFile()
|
||||||
|
|||||||
@@ -158,10 +158,12 @@ void MainWindow::renderContactRequest(){
|
|||||||
QString label_contact = index.data(Qt::DisplayRole).toString();
|
QString label_contact = index.data(Qt::DisplayRole).toString();
|
||||||
QStandardItemModel* contactMemo = new QStandardItemModel();
|
QStandardItemModel* contactMemo = new QStandardItemModel();
|
||||||
|
|
||||||
|
qDebug()<<label_contact;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ((c.second.isOutgoing() == false) && (label_contact == c.second.getContact()))
|
|
||||||
|
if ((c.second.isOutgoing() == false) && (label_contact == c.second.getRequestZaddr() && (c.second.getMemo().startsWith("{") == false)))
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -192,12 +194,12 @@ void MainWindow::renderContactRequest(){
|
|||||||
QString label_contactold = index.data(Qt::DisplayRole).toString();
|
QString label_contactold = index.data(Qt::DisplayRole).toString();
|
||||||
QStandardItemModel* contactMemo = new QStandardItemModel();
|
QStandardItemModel* contactMemo = new QStandardItemModel();
|
||||||
|
|
||||||
if ((c.second.isOutgoing() == false) && (label_contactold == c.second.getContact()))
|
if ((c.second.isOutgoing() == false) && (label_contactold == c.second.getContact()) && (c.second.getMemo().startsWith("{") == false))
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
QStandardItem* Items = new QStandardItem(c.second.getMemo());
|
QStandardItem* Items = new QStandardItem(c.second.getMemo());
|
||||||
contactMemo->appendRow(Items);
|
contactMemo->appendRow(Items);
|
||||||
requestContact.requestMemo->setModel(contactMemo);
|
requestContact.requestMemo->setModel(contactMemo);
|
||||||
requestContact.requestMemo->show();
|
requestContact.requestMemo->show();
|
||||||
|
|
||||||
@@ -708,8 +710,8 @@ void::MainWindow::addContact()
|
|||||||
request.setupUi(&dialog);
|
request.setupUi(&dialog);
|
||||||
Settings::saveRestore(&dialog);
|
Settings::saveRestore(&dialog);
|
||||||
|
|
||||||
QObject::connect(request.newZaddr, &QPushButton::clicked, [&] () {
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bool sapling = true;
|
bool sapling = true;
|
||||||
rpc->createNewZaddr(sapling, [=] (json reply) {
|
rpc->createNewZaddr(sapling, [=] (json reply) {
|
||||||
@@ -718,6 +720,9 @@ QObject::connect(request.newZaddr, &QPushButton::clicked, [&] () {
|
|||||||
request.myzaddr->setText(myAddr);
|
request.myzaddr->setText(myAddr);
|
||||||
ui->listReceiveAddresses->insertItem(0, myAddr);
|
ui->listReceiveAddresses->insertItem(0, myAddr);
|
||||||
ui->listReceiveAddresses->setCurrentIndex(0);
|
ui->listReceiveAddresses->setCurrentIndex(0);
|
||||||
|
DataStore::getChatDataStore()->setSendZaddr(myAddr);
|
||||||
|
|
||||||
|
qDebug()<<"Zaddr: "<<myAddr;
|
||||||
});
|
});
|
||||||
|
|
||||||
}catch(...)
|
}catch(...)
|
||||||
@@ -726,29 +731,14 @@ QObject::connect(request.newZaddr, &QPushButton::clicked, [&] () {
|
|||||||
|
|
||||||
qDebug() << QString("Caught something nasty with myZaddr Contact");
|
qDebug() << QString("Caught something nasty with myZaddr Contact");
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
QString cid = QUuid::createUuid().toString(QUuid::WithoutBraces);
|
QString cid = QUuid::createUuid().toString(QUuid::WithoutBraces);
|
||||||
|
|
||||||
QObject::connect(request.sendRequestButton, &QPushButton::clicked, [&] () {
|
|
||||||
|
|
||||||
QString addr = request.zaddr->text();
|
|
||||||
QString myAddr = request.myzaddr->text().trimmed();
|
|
||||||
QString memo = request.memorequest->toPlainText().trimmed();
|
|
||||||
QString avatar = QString(":/icons/res/") + request.comboBoxAvatar->currentText() + QString(".png");
|
|
||||||
QString label = request.labelRequest->text().trimmed();
|
|
||||||
|
|
||||||
|
|
||||||
contactRequest.setSenderAddress(myAddr);
|
|
||||||
contactRequest.setReceiverAddress(addr);
|
|
||||||
contactRequest.setMemo(memo);
|
|
||||||
contactRequest.setCid(cid);
|
|
||||||
contactRequest.setAvatar(avatar);
|
|
||||||
contactRequest.setLabel(label);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
QObject::connect(request.sendRequestButton, &QPushButton::clicked, this, &MainWindow::saveandsendContact);
|
QObject::connect(request.sendRequestButton, &QPushButton::clicked, this, &MainWindow::saveandsendContact);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// QObject::connect(request.onlyAdd, &QPushButton::clicked, this, &MainWindow::saveContact);
|
// QObject::connect(request.onlyAdd, &QPushButton::clicked, this, &MainWindow::saveContact);
|
||||||
|
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
@@ -776,7 +766,7 @@ Tx MainWindow::createTxForSafeContactRequest()
|
|||||||
totalAmt = totalAmt + amt;
|
totalAmt = totalAmt + amt;
|
||||||
|
|
||||||
QString cid = contactRequest.getCid();
|
QString cid = contactRequest.getCid();
|
||||||
QString myAddr = contactRequest.getSenderAddress();
|
QString myAddr = DataStore::getChatDataStore()->getSendZaddr();
|
||||||
QString type = "Cont";
|
QString type = "Cont";
|
||||||
QString addr = contactRequest.getReceiverAddress();
|
QString addr = contactRequest.getReceiverAddress();
|
||||||
|
|
||||||
@@ -833,16 +823,6 @@ void MainWindow::ContactRequest() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contactRequest.getSenderAddress().size() > 80) {
|
|
||||||
|
|
||||||
QMessageBox msg(QMessageBox::Critical, tr("Missing HushChat Address"),
|
|
||||||
tr("You have to create your HushChat address to send a contact request,\n"),
|
|
||||||
QMessageBox::Ok, this);
|
|
||||||
|
|
||||||
msg.exec();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
int max = 235;
|
int max = 235;
|
||||||
QString chattext = contactRequest.getMemo();;
|
QString chattext = contactRequest.getMemo();;
|
||||||
int size = chattext.size();
|
int size = chattext.size();
|
||||||
|
|||||||
@@ -122,22 +122,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="newZaddr">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Create New Address</string>
|
|
||||||
</property>
|
|
||||||
<property name="autoDefault">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|||||||
@@ -16,6 +16,18 @@ FirstTimeWizard::FirstTimeWizard(bool dangerous, QString server)
|
|||||||
this->dangerous = dangerous;
|
this->dangerous = dangerous;
|
||||||
this->server = server;
|
this->server = server;
|
||||||
|
|
||||||
|
////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"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// Create the pages
|
// Create the pages
|
||||||
setPage(Page_NewOrRestore, new NewOrRestorePage(this));
|
setPage(Page_NewOrRestore, new NewOrRestorePage(this));
|
||||||
setPage(Page_New, new NewSeedPage(this));
|
setPage(Page_New, new NewSeedPage(this));
|
||||||
|
|||||||
@@ -338,20 +338,20 @@ void MainWindow::closeEvent(QCloseEvent* event) {
|
|||||||
|
|
||||||
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
||||||
// auto dirHome = QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
|
// auto dirHome = QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
|
||||||
QString source_file = dir.filePath("addresslabels.dat");
|
// QString source_file = dir.filePath("addresslabels.dat");
|
||||||
QString target_enc_file = dir.filePath("addresslabels.dat.enc");
|
// QString target_enc_file = dir.filePath("addresslabels.dat.enc");
|
||||||
QString sourceWallet_file = dirwallet;
|
QString sourceWallet_file = dirwallet;
|
||||||
QString target_encWallet_file = dirwalletenc;
|
QString target_encWallet_file = dirwalletenc;
|
||||||
|
|
||||||
FileEncryption::encrypt(target_enc_file, source_file, key);
|
// FileEncryption::encrypt(target_enc_file, source_file, key);
|
||||||
FileEncryption::encrypt(target_encWallet_file, sourceWallet_file, key);
|
FileEncryption::encrypt(target_encWallet_file, sourceWallet_file, key);
|
||||||
|
|
||||||
///////////////// we rename the plaintext wallet.dat to Backup, for testing.
|
///////////////// we rename the plaintext wallet.dat to Backup, for testing.
|
||||||
|
|
||||||
QFile wallet(dirwallet);
|
QFile wallet(dirwallet);
|
||||||
QFile address(dir.filePath("addresslabels.dat"));
|
// QFile address(dir.filePath("addresslabels.dat"));
|
||||||
wallet.remove();
|
wallet.remove();
|
||||||
address.remove();
|
//address.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -432,18 +432,18 @@ void MainWindow::encryptWallet() {
|
|||||||
|
|
||||||
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
||||||
auto dirHome = QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
|
auto dirHome = QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
|
||||||
QString source_file = dir.filePath("addresslabels.dat");
|
// QString source_file = dir.filePath("addresslabels.dat");
|
||||||
QString target_enc_file = dir.filePath("addresslabels.dat.enc");
|
// QString target_enc_file = dir.filePath("addresslabels.dat.enc");
|
||||||
QString sourceWallet_file = dirwallet;
|
QString sourceWallet_file = dirwallet;
|
||||||
QString target_encWallet_file = dirwalletenc;
|
QString target_encWallet_file = dirwalletenc;
|
||||||
|
|
||||||
FileEncryption::encrypt(target_enc_file, source_file, key);
|
// FileEncryption::encrypt(target_enc_file, source_file, key);
|
||||||
FileEncryption::encrypt(target_encWallet_file, sourceWallet_file, key);
|
FileEncryption::encrypt(target_encWallet_file, sourceWallet_file, key);
|
||||||
|
|
||||||
QFile wallet(dirwallet);
|
QFile wallet(dirwallet);
|
||||||
QFile address(dir.filePath("addresslabels.dat"));
|
// QFile address(dir.filePath("addresslabels.dat"));
|
||||||
wallet.rename(dirwalletbackup);
|
wallet.rename(dirwalletbackup);
|
||||||
address.rename(dir.filePath("addresslabels.datBackup"));
|
// address.rename(dir.filePath("addresslabels.datBackup"));
|
||||||
|
|
||||||
QMessageBox::information(this, tr("Wallet Encryption Success"),
|
QMessageBox::information(this, tr("Wallet Encryption Success"),
|
||||||
QString("Successfully encrypted your wallet"),
|
QString("Successfully encrypted your wallet"),
|
||||||
@@ -520,11 +520,11 @@ void MainWindow::removeWalletEncryption() {
|
|||||||
auto dirHome = QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
|
auto dirHome = QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
|
||||||
QString target_encwallet_file = dirwalletenc;
|
QString target_encwallet_file = dirwalletenc;
|
||||||
QString target_decwallet_file = dirwallet;
|
QString target_decwallet_file = dirwallet;
|
||||||
QString target_encaddr_file = dir.filePath("addresslabels.dat.enc");
|
// QString target_encaddr_file = dir.filePath("addresslabels.dat.enc");
|
||||||
QString target_decaddr_file = dir.filePath("addresslabels.dat");
|
// QString target_decaddr_file = dir.filePath("addresslabels.dat");
|
||||||
|
|
||||||
FileEncryption::decrypt(target_decwallet_file, target_encwallet_file, key);
|
FileEncryption::decrypt(target_decwallet_file, target_encwallet_file, key);
|
||||||
FileEncryption::decrypt(target_decaddr_file, target_encaddr_file, key);
|
// FileEncryption::decrypt(target_decaddr_file, target_encaddr_file, key);
|
||||||
|
|
||||||
QFile filencrypted(dirwalletenc);
|
QFile filencrypted(dirwalletenc);
|
||||||
QFile wallet(dirwallet);
|
QFile wallet(dirwallet);
|
||||||
@@ -595,11 +595,11 @@ void MainWindow::removeWalletEncryptionStartUp() {
|
|||||||
auto dirHome = QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
|
auto dirHome = QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
|
||||||
QString target_encwallet_file = dirwalletenc;
|
QString target_encwallet_file = dirwalletenc;
|
||||||
QString target_decwallet_file = dirwallet;
|
QString target_decwallet_file = dirwallet;
|
||||||
QString target_encaddr_file = dir.filePath("addresslabels.dat.enc");
|
// QString target_encaddr_file = dir.filePath("addresslabels.dat.enc");
|
||||||
QString target_decaddr_file = dir.filePath("addresslabels.dat");
|
// QString target_decaddr_file = dir.filePath("addresslabels.dat");
|
||||||
|
|
||||||
FileEncryption::decrypt(target_decwallet_file, target_encwallet_file, key);
|
FileEncryption::decrypt(target_decwallet_file, target_encwallet_file, key);
|
||||||
FileEncryption::decrypt(target_decaddr_file, target_encaddr_file, key);
|
// FileEncryption::decrypt(target_decaddr_file, target_encaddr_file, key);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1169,7 +1169,7 @@ void MainWindow::setupBalancesTab() {
|
|||||||
QList<QString> allAddresses;
|
QList<QString> allAddresses;
|
||||||
|
|
||||||
allAddresses = getRPC()->getModel()->getAllZAddresses();
|
allAddresses = getRPC()->getModel()->getAllZAddresses();
|
||||||
QString depositzaddr = allAddresses[1];
|
QString depositzaddr = allAddresses[0];
|
||||||
deposithush.qrcodeDisplayDeposit->setQrcodeString(depositzaddr);
|
deposithush.qrcodeDisplayDeposit->setQrcodeString(depositzaddr);
|
||||||
deposithush.zaddr->setText(depositzaddr);
|
deposithush.zaddr->setText(depositzaddr);
|
||||||
|
|
||||||
@@ -1344,6 +1344,8 @@ void MainWindow::setupTransactionsTab() {
|
|||||||
|
|
||||||
void MainWindow::setupchatTab() {
|
void MainWindow::setupchatTab() {
|
||||||
|
|
||||||
|
ui->memoTxtChat->setEnabled(false);
|
||||||
|
|
||||||
/////////////Setting Icons for Chattab and different themes
|
/////////////Setting Icons for Chattab and different themes
|
||||||
|
|
||||||
auto theme = Settings::getInstance()->get_theme_name();
|
auto theme = Settings::getInstance()->get_theme_name();
|
||||||
@@ -1530,6 +1532,7 @@ void MainWindow::setupchatTab() {
|
|||||||
ui->listContactWidget->addAction(HushAction);
|
ui->listContactWidget->addAction(HushAction);
|
||||||
ui->listContactWidget->addAction(requestHushAction);
|
ui->listContactWidget->addAction(requestHushAction);
|
||||||
ui->listContactWidget->addAction(subatomicAction);
|
ui->listContactWidget->addAction(subatomicAction);
|
||||||
|
ui->memoTxtChat->setEnabled(true);
|
||||||
|
|
||||||
/*QObject::connect(requestHushAction, &QAction::triggered, [=]() {
|
/*QObject::connect(requestHushAction, &QAction::triggered, [=]() {
|
||||||
QModelIndex index = ui->listContactWidget->currentIndex();
|
QModelIndex index = ui->listContactWidget->currentIndex();
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>2</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
#define APP_VERSION "1.3.2-Chat-Beta"
|
#define APP_VERSION "1.3.3"
|
||||||
|
|||||||
Reference in New Issue
Block a user