add button to create a new zaddr

This commit is contained in:
DenioD
2020-06-07 21:55:39 +02:00
parent d9f51aa833
commit 1bc63f41f6
5 changed files with 222 additions and 209 deletions

View File

@@ -708,6 +708,7 @@ void::MainWindow::addContact()
request.setupUi(&dialog);
Settings::saveRestore(&dialog);
QObject::connect(request.newZaddr, &QPushButton::clicked, [&] () {
try
{
bool sapling = true;
@@ -725,6 +726,7 @@ void::MainWindow::addContact()
qDebug() << QString("Caught something nasty with myZaddr Contact");
}
});
QString cid = QUuid::createUuid().toString(QUuid::WithoutBraces);
@@ -823,8 +825,6 @@ void MainWindow::ContactRequest() {
if (contactRequest.getReceiverAddress().isEmpty() || contactRequest.getMemo().isEmpty()) {
// auto addr = "";
// if (! Settings::isZAddress(AddressBook::addressFromAddressLabel(addr->text()))) {
QMessageBox msg(QMessageBox::Critical, tr("You have to select a contact and insert a Memo"),
tr("You have selected no Contact from Contactlist,\n") + tr("\nor your Memo is empty"),
QMessageBox::Ok, this);
@@ -833,6 +833,16 @@ void MainWindow::ContactRequest() {
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;
QString chattext = contactRequest.getMemo();;
int size = chattext.size();