rename sdlogo, refresh at new contact
This commit is contained in:
@@ -103,7 +103,7 @@ QList<ContactItem> FileSystem::readContactsOldFormat(QString file)
|
||||
{
|
||||
ContactItem contact = ContactItem(stuff[i][0],stuff[i][1], stuff[i][2], stuff[i][3],stuff[i][4]);
|
||||
contacts.push_back(contact);
|
||||
i++;
|
||||
|
||||
}
|
||||
|
||||
_file.close();
|
||||
|
||||
@@ -39,9 +39,7 @@ void AddressBookModel::loadData()
|
||||
parent->horizontalHeader()->restoreState(
|
||||
QSettings().value(
|
||||
"addresstablegeometry"
|
||||
).toByteArray()
|
||||
|
||||
|
||||
).toByteArray()
|
||||
);
|
||||
|
||||
}
|
||||
@@ -241,9 +239,14 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target)
|
||||
return;
|
||||
|
||||
|
||||
rpc->refresh(true);
|
||||
// rpc->refresh(true);
|
||||
model.updateUi();
|
||||
|
||||
rpc->refreshContacts(
|
||||
parent->ui->listContactWidget
|
||||
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
// AddressBook::getInstance()->addAddressLabel(newLabel, ab.addr->text(), cid);
|
||||
@@ -394,37 +397,36 @@ void AddressBook::readFromStorage()
|
||||
QList<QList<QString>> stuff;
|
||||
in >> stuff;
|
||||
//qDebug() << "Stuff: " << stuff;
|
||||
|
||||
for (int i=0; i < stuff.size(); i++)
|
||||
{
|
||||
//qDebug() << "0:" << stuff[i][0];
|
||||
//qDebug() << "0:" << stuff[i][0];
|
||||
//qDebug() << "1:" << stuff[i][1];
|
||||
//qDebug() << "2:" << stuff[i][2];
|
||||
ContactItem contact = ContactItem(stuff[i][0],stuff[i][1], stuff[i][2], stuff[i][3],stuff[i][4]);
|
||||
//qDebug() << "contact=" << contact.toQTString();
|
||||
allLabels.push_back(contact);
|
||||
}
|
||||
|
||||
{
|
||||
qDebug() << "Read " << version << " Hush contacts from disk...";
|
||||
|
||||
|
||||
qDebug() << "Read " << version << " Hush contacts from disk...";
|
||||
file.close();
|
||||
}
|
||||
}else{
|
||||
{
|
||||
qDebug() << "No Hush contacts found on disk!";
|
||||
}
|
||||
}
|
||||
// allLabels = FileSystem::getInstance()->readContacts(AddressBook::writeableFile());
|
||||
|
||||
// test to see if the contact items in datastore are correctly dumped to json
|
||||
for(ContactItem item: allLabels)
|
||||
else
|
||||
{
|
||||
DataStore::getContactDataStore()->setData(item.getCid(), item);
|
||||
qDebug() << "No Hush contacts found on disk!";
|
||||
}
|
||||
|
||||
AddressBook::writeToStorage();
|
||||
// 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)));
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
void AddressBook::writeToStorage()
|
||||
{
|
||||
//FileSystem::getInstance()->writeContacts(AddressBook::writeableFile(), DataStore::getContactDataStore()->dump());
|
||||
|
||||
@@ -240,16 +240,18 @@ 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");
|
||||
QMessageBox::information(this, "Added Contact","successfully added your new contact. You can now Chat with this contact");
|
||||
rpc->refreshContacts(
|
||||
ui->listContactWidget
|
||||
|
||||
);
|
||||
|
||||
|
||||
});
|
||||
|
||||
dialog.exec();
|
||||
|
||||
rpc->refreshContacts(
|
||||
ui->listContactWidget
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
void ChatModel::addCid(QString tx, QString cid)
|
||||
@@ -374,10 +376,7 @@ Tx MainWindow::createTxFromChatPage() {
|
||||
|
||||
|
||||
QString hmemo= createHeaderMemo(type,cid,myAddr);
|
||||
QString memo = ui->memoTxtChat->toPlainText().trimmed();
|
||||
|
||||
|
||||
|
||||
QString memo = ui->memoTxtChat->toPlainText().trimmed();
|
||||
|
||||
tx.toAddrs.push_back(ToFields{addr, amt, hmemo});
|
||||
tx.toAddrs.push_back(ToFields{addr, amt, memo});
|
||||
@@ -547,7 +546,8 @@ void::MainWindow::addContact()
|
||||
request.setupUi(&dialog);
|
||||
Settings::saveRestore(&dialog);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
bool sapling = true;
|
||||
rpc->createNewZaddr(sapling, [=] (json reply) {
|
||||
QString myAddr = QString::fromStdString(reply.get<json::array_t>()[0]);
|
||||
@@ -557,8 +557,20 @@ void::MainWindow::addContact()
|
||||
ui->listReceiveAddresses->setCurrentIndex(0);
|
||||
qDebug() << "new generated myAddr add Contact" << myAddr;
|
||||
});
|
||||
|
||||
}catch(...)
|
||||
{
|
||||
|
||||
|
||||
qDebug() << QString("Caught something nasty with myZaddr Contact");
|
||||
}
|
||||
|
||||
QString cid = QUuid::createUuid().toString(QUuid::WithoutBraces);
|
||||
|
||||
|
||||
|
||||
|
||||
QString cid = QUuid::createUuid().toString(QUuid::WithoutBraces);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user