refresh when a new contact get add
This commit is contained in:
@@ -239,19 +239,15 @@ void MainWindow::renderContactRequest(){
|
|||||||
|
|
||||||
qDebug()<<"Beginn kopiert" <<cid << addr << newLabel << myAddr;
|
qDebug()<<"Beginn kopiert" <<cid << addr << newLabel << myAddr;
|
||||||
AddressBook::getInstance()->addAddressLabel(newLabel, addr, myAddr, cid, avatar);
|
AddressBook::getInstance()->addAddressLabel(newLabel, addr, myAddr, cid, avatar);
|
||||||
|
rpc->refreshContacts(
|
||||||
|
ui->listContactWidget);
|
||||||
|
|
||||||
QMessageBox::information(this, "Added Contact","successfully added your new contact. You can now Chat with this contact");
|
QMessageBox::information(this, "Added Contact","successfully added your new contact. You can now Chat with this contact");
|
||||||
rpc->refreshContacts(
|
|
||||||
ui->listContactWidget
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatModel::addCid(QString tx, QString cid)
|
void ChatModel::addCid(QString tx, QString cid)
|
||||||
@@ -565,15 +561,7 @@ void::MainWindow::addContact()
|
|||||||
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, [&] () {
|
QObject::connect(request.sendRequestButton, &QPushButton::clicked, [&] () {
|
||||||
|
|
||||||
@@ -723,7 +711,10 @@ void MainWindow::ContactRequest() {
|
|||||||
delete d;
|
delete d;
|
||||||
|
|
||||||
});
|
});
|
||||||
QString addr = contactRequest.getReceiverAddress();
|
|
||||||
|
/////Add this contact after we sent the request
|
||||||
|
|
||||||
|
QString addr = contactRequest.getReceiverAddress();
|
||||||
QString newLabel = contactRequest.getLabel();
|
QString newLabel = contactRequest.getLabel();
|
||||||
QString myAddr = contactRequest.getSenderAddress();
|
QString myAddr = contactRequest.getSenderAddress();
|
||||||
QString cid = contactRequest.getCid();
|
QString cid = contactRequest.getCid();
|
||||||
@@ -756,17 +747,22 @@ void MainWindow::ContactRequest() {
|
|||||||
|
|
||||||
////// Success, so show it
|
////// Success, so show it
|
||||||
AddressBook::getInstance()->addAddressLabel(newLabel, addr, myAddr, cid, avatar);
|
AddressBook::getInstance()->addAddressLabel(newLabel, addr, myAddr, cid, avatar);
|
||||||
|
rpc->refreshContacts(
|
||||||
|
ui->listContactWidget);
|
||||||
QMessageBox::information(
|
QMessageBox::information(
|
||||||
this,
|
this,
|
||||||
QObject::tr("Added Contact"),
|
QObject::tr("Added Contact"),
|
||||||
QObject::tr("successfully added your new contact").arg(newLabel),
|
QObject::tr("successfully added your new contact").arg(newLabel),
|
||||||
QMessageBox::Ok
|
QMessageBox::Ok
|
||||||
|
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
// Force a UI update so we get the unconfirmed Tx
|
// Force a UI update so we get the unconfirmed Tx
|
||||||
// rpc->refresh(true);
|
// rpc->refresh(true);
|
||||||
ui->memoTxtChat->clear();
|
ui->memoTxtChat->clear();
|
||||||
rpc->refresh(true);
|
rpc->refresh(true);
|
||||||
|
rpc->refreshContacts(
|
||||||
|
ui->listContactWidget);
|
||||||
|
|
||||||
},
|
},
|
||||||
// Errored out
|
// Errored out
|
||||||
|
|||||||
@@ -922,8 +922,6 @@ void Controller::refreshTransactions() {
|
|||||||
isNotarized = false;
|
isNotarized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug()<<"Conf : " << confirmations;
|
|
||||||
|
|
||||||
ChatItem item = ChatItem(
|
ChatItem item = ChatItem(
|
||||||
datetime,
|
datetime,
|
||||||
address,
|
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
|
// 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
|
// 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
|
// Update model data, which updates the table view
|
||||||
transactionsTableModel->replaceData(txdata);
|
transactionsTableModel->replaceData(txdata);
|
||||||
chat->renderChatBox(ui, ui->listChat,ui->memoSizeChat);
|
chat->renderChatBox(ui, ui->listChat,ui->memoSizeChat);
|
||||||
// refreshContacts(
|
|
||||||
// ui->listContactWidget
|
|
||||||
|
|
||||||
// );
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user