Browse Source

refresh when a new contact get add

pull/130/head
DenioD 4 years ago
parent
commit
715317087f
  1. 24
      src/chatmodel.cpp
  2. 6
      src/controller.cpp

24
src/chatmodel.cpp

@ -239,19 +239,15 @@ void MainWindow::renderContactRequest(){
qDebug()<<"Beginn kopiert" <<cid << addr << newLabel << myAddr;
AddressBook::getInstance()->addAddressLabel(newLabel, addr, myAddr, cid, avatar);
QMessageBox::information(this, "Added Contact","successfully added your new contact. You can now Chat with this contact");
rpc->refreshContacts(
ui->listContactWidget
);
ui->listContactWidget);
QMessageBox::information(this, "Added Contact","successfully added your new contact. You can now Chat with this contact");
});
dialog.exec();
}
void ChatModel::addCid(QString tx, QString cid)
@ -567,14 +563,6 @@ void::MainWindow::addContact()
QString cid = QUuid::createUuid().toString(QUuid::WithoutBraces);
QObject::connect(request.sendRequestButton, &QPushButton::clicked, [&] () {
QString addr = request.zaddr->text();
@ -723,6 +711,9 @@ void MainWindow::ContactRequest() {
delete d;
});
/////Add this contact after we sent the request
QString addr = contactRequest.getReceiverAddress();
QString newLabel = contactRequest.getLabel();
QString myAddr = contactRequest.getSenderAddress();
@ -756,17 +747,22 @@ void MainWindow::ContactRequest() {
////// Success, so show it
AddressBook::getInstance()->addAddressLabel(newLabel, addr, myAddr, cid, avatar);
rpc->refreshContacts(
ui->listContactWidget);
QMessageBox::information(
this,
QObject::tr("Added Contact"),
QObject::tr("successfully added your new contact").arg(newLabel),
QMessageBox::Ok
);
return;
// Force a UI update so we get the unconfirmed Tx
// rpc->refresh(true);
ui->memoTxtChat->clear();
rpc->refresh(true);
rpc->refreshContacts(
ui->listContactWidget);
},
// Errored out

6
src/controller.cpp

@ -922,8 +922,6 @@ void Controller::refreshTransactions() {
isNotarized = false;
}
qDebug()<<"Conf : " << confirmations;
ChatItem item = ChatItem(
datetime,
address,
@ -1078,7 +1076,6 @@ void Controller::refreshTransactions() {
}
}
}
qDebug()<<"get Lag" << getLag();
// Calculate the total unspent amount that's pending. This will need to be
// shown in the UI so the user can keep track of pending funds
@ -1098,10 +1095,7 @@ void Controller::refreshTransactions() {
// Update model data, which updates the table view
transactionsTableModel->replaceData(txdata);
chat->renderChatBox(ui, ui->listChat,ui->memoSizeChat);
// refreshContacts(
// ui->listContactWidget
// );
});
}

Loading…
Cancel
Save