From ee672cfcca1e6a091b62219e3a4603aa80d3c100 Mon Sep 17 00:00:00 2001 From: DenioD <41270280+DenioD@users.noreply.github.com> Date: Thu, 21 May 2020 17:41:12 +0200 Subject: [PATCH] contact gui fix --- src/chatmodel.cpp | 11 +- src/contactrequest.ui | 150 +++++++++++++++++++----- src/mainwindow.ui | 227 +----------------------------------- src/requestContactDialog.ui | 144 ++++++++++++----------- 4 files changed, 206 insertions(+), 326 deletions(-) diff --git a/src/chatmodel.cpp b/src/chatmodel.cpp index 42a2419..29ba9c9 100644 --- a/src/chatmodel.cpp +++ b/src/chatmodel.cpp @@ -127,7 +127,6 @@ void MainWindow::renderContactRequest(){ requestContact.requestZaddr->setText(c.second.getRequestZaddr()); - requestContact.requestCID->setText(c.second.getCid()); requestContact.requestMyAddr->setText(c.second.getAddress()); }else{} } @@ -152,9 +151,8 @@ void MainWindow::renderContactRequest(){ requestContact.requestMemo->setModel(contactMemo); requestContact.requestMemo->show(); - - requestContact.requestZaddr->setText(c.second.getRequestZaddr()); requestContact.requestCID->setText(c.second.getCid()); + requestContact.requestZaddr->setText(c.second.getRequestZaddr()); requestContact.requestMyAddr->setText(c.second.getAddress()); }else{} } @@ -468,14 +466,15 @@ void::MainWindow::addContact() bool sapling = true; rpc->createNewZaddr(sapling, [=] (json reply) { QString myAddr = QString::fromStdString(reply.get()[0]); + rpc->refreshAddresses(); request.myzaddr->setText(myAddr); ui->listReceiveAddresses->insertItem(0, myAddr); ui->listReceiveAddresses->setCurrentIndex(0); - qDebug() << "new generated myAddr" << myAddr; + qDebug() << "new generated myAddr add Contact" << myAddr; }); QString cid = QUuid::createUuid().toString(QUuid::WithoutBraces); - request.cid->setText(cid); + @@ -483,7 +482,7 @@ void::MainWindow::addContact() QString addr = request.zaddr->text(); QString myAddr = request.myzaddr->text().trimmed(); - QString memo = request.memorequest->toPlainText().trimmed(); + QString memo = request.memorequest->text().trimmed(); QString avatar = QString(":/icons/res/") + request.comboBoxAvatar->currentText() + QString(".png"); QString label = request.labelRequest->text().trimmed(); diff --git a/src/contactrequest.ui b/src/contactrequest.ui index 5f4d6ec..8667057 100644 --- a/src/contactrequest.ui +++ b/src/contactrequest.ui @@ -10,25 +10,31 @@ 427 + + + 780 + 427 + + Send a contact request - + - <html><head/><body><p align="right">Choose a avatar for your contact :</p></body></html> + <html><head/><body><p align="right"><span style=" font-weight:600; text-decoration: underline;">Choose a avatar for your contact :</span></p></body></html> - <html><head/><body><p>Please insert a Nickname for your contact :</p></body></html> + <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Please insert a Nickname for your contact :</span></p></body></html> - + @@ -168,49 +174,120 @@ - <html><head/><body><p>Please insert the Address of your contact :</p></body></html> + <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Please insert the Address of your contact :</span></p></body></html> - - - - - - - Insert a memo for the request + + + + + 650 + 25 + + + + + 650 + 25 + - Your HushChat Address + <html><head/><body><p><span style=" font-weight:600; text-decoration: underline;">Your HushChat Address :</span></p></body></html> - - - - - - - - + + + + + 650 + 25 + + + + + 650 + 25 + + - The Conversation ID + <html><head/><body><p><span style=" color:#d3d7cf;">Generate your HushChat Address - please wait a second - </span></p></body></html> - - + + + + Qt::Vertical + + + + 20 + 148 + + + + + + - + <html><head/><body><p align="center"><span style=" font-weight:600; text-decoration: underline;">Insert a memo for your request</span></p></body></html> + + + + + + + + 500 + 71 + + + + + 500 + 71 + + + + Qt::NoContextMenu + + + false + + + Qt::ImhSensitiveData + + + 512 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + false + + + Add some memo to your request + + + true + + + 80 + 25 + + 100 @@ -220,6 +297,9 @@ Cancel + + false + false @@ -240,6 +320,12 @@ + + + 152 + 25 + + 100 @@ -249,13 +335,22 @@ Only add this contact + + false + false - + + + + 188 + 25 + + 100 @@ -265,6 +360,9 @@ Add Contact & send request + + false + false diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 82b4260..1ce2a50 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -1569,7 +1569,7 @@ - 50 + 0 20 61 51 @@ -1607,7 +1607,7 @@ - 210 + 70 20 61 51 @@ -1633,229 +1633,6 @@ true - - - - 90 - 10 - 21 - 16 - - - - - - - - - 204 - 0 - 0 - - - - - - - 204 - 0 - 0 - - - - - - - 239 - 41 - 41 - - - - - - - 204 - 0 - 0 - - - - - - - 204 - 0 - 0 - - - - - - - 204 - 0 - 0 - - - - - - - 204 - 0 - 0 - - - - - - - - - 204 - 0 - 0 - - - - - - - 204 - 0 - 0 - - - - - - - 239 - 41 - 41 - - - - - - - 204 - 0 - 0 - - - - - - - 204 - 0 - 0 - - - - - - - 204 - 0 - 0 - - - - - - - 204 - 0 - 0 - - - - - - - - - 190 - 190 - 190 - - - - - - - 190 - 190 - 190 - - - - - - - 239 - 41 - 41 - - - - - - - 190 - 190 - 190 - - - - - - - 204 - 0 - 0 - - - - - - - 204 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - - 12 - - - - Qt::LeftToRight - - - 1 - - - Qt::AutoText - - diff --git a/src/requestContactDialog.ui b/src/requestContactDialog.ui index d2a3b68..7e676e7 100644 --- a/src/requestContactDialog.ui +++ b/src/requestContactDialog.ui @@ -14,10 +14,26 @@ Incoming contact request - - + + - <html><head/><body><p align="center"><span style=" font-weight:600; text-decoration: underline;">Open requests</span></p></body></html> + My Zaddr : + + + + + + + true + + + QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked + + + false + + + QAbstractItemView::SingleSelection @@ -44,6 +60,16 @@ + + + + + + + Give a Nickname: + + + @@ -72,13 +98,6 @@ - - - - <html><head/><body><p align="center"><span style=" font-weight:600; text-decoration: underline;">Recently closed requests</span></p></body></html> - - - @@ -86,66 +105,10 @@ - - - - true - - - QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked - - - false - - - QAbstractItemView::SingleSelection - - - - - + + - Request from : - - - - - - - - - - Cid : - - - - - - - - - - My Zaddr : - - - - - - - - - - Nickname - - - - - - - - - - <html><head/><body><p align="right">Choose a avatar for your contact :</p></body></html> + <html><head/><body><p align="center"><span style=" font-weight:600; text-decoration: underline;">Open requests</span></p></body></html> @@ -283,6 +246,19 @@ + + + + <html><head/><body><p align="center"><span style=" font-weight:600; text-decoration: underline;">Recently closed requests</span></p></body></html> + + + + + + + + + @@ -294,6 +270,9 @@ Cancel + + false + false @@ -304,6 +283,33 @@ Add this new Contact + + false + + + + + + + Request from : + + + + + + + <html><head/><body><p align="right">Choose a avatar for your contact :</p></body></html> + + + + + + + + + + Cid : +