rename sdlogo, refresh at new contact
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
<file>res/icon.ico</file>
|
<file>res/icon.ico</file>
|
||||||
<file>res/mail.png</file>
|
<file>res/mail.png</file>
|
||||||
<file>res/darkwing.png</file>
|
<file>res/darkwing.png</file>
|
||||||
<file>res/sdlogo.png</file>
|
<file>res/SDLogo.png</file>
|
||||||
<file>res/sdlogo2.png</file>
|
<file>res/sdlogo2.png</file>
|
||||||
<file>res/Berg.png</file>
|
<file>res/Berg.png</file>
|
||||||
<file>res/Denio.png</file>
|
<file>res/Denio.png</file>
|
||||||
|
|||||||
6
lib/Cargo.lock
generated
6
lib/Cargo.lock
generated
@@ -1177,7 +1177,7 @@ version = "0.1.0"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"silentdragonlitelib 0.1.0 (git+https://github.com/DenioD/silentdragonlite-cli?rev=d196ad938a22810c0b6b4164e6bf8f1db0409763)",
|
"silentdragonlitelib 0.1.0 (git+https://github.com/DenioD/silentdragonlite-cli?rev=d2887d07879a93bdd9b2c8bd12504bb977e82fe0)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1640,7 +1640,7 @@ dependencies = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "silentdragonlitelib"
|
name = "silentdragonlitelib"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/DenioD/silentdragonlite-cli?rev=d196ad938a22810c0b6b4164e6bf8f1db0409763#d196ad938a22810c0b6b4164e6bf8f1db0409763"
|
source = "git+https://github.com/DenioD/silentdragonlite-cli?rev=d2887d07879a93bdd9b2c8bd12504bb977e82fe0#d2887d07879a93bdd9b2c8bd12504bb977e82fe0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"bellman 0.1.0 (git+https://github.com/MyHush/librustzcash.git?rev=1a0204113d487cdaaf183c2967010e5214ff9e37)",
|
"bellman 0.1.0 (git+https://github.com/MyHush/librustzcash.git?rev=1a0204113d487cdaaf183c2967010e5214ff9e37)",
|
||||||
@@ -2631,7 +2631,7 @@ dependencies = [
|
|||||||
"checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35"
|
"checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35"
|
||||||
"checksum sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0"
|
"checksum sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0"
|
||||||
"checksum signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41"
|
"checksum signal-hook-registry 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41"
|
||||||
"checksum silentdragonlitelib 0.1.0 (git+https://github.com/DenioD/silentdragonlite-cli?rev=d196ad938a22810c0b6b4164e6bf8f1db0409763)" = "<none>"
|
"checksum silentdragonlitelib 0.1.0 (git+https://github.com/DenioD/silentdragonlite-cli?rev=d2887d07879a93bdd9b2c8bd12504bb977e82fe0)" = "<none>"
|
||||||
"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
|
"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
|
||||||
"checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6"
|
"checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6"
|
||||||
"checksum socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85"
|
"checksum socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e8b74de517221a2cb01a53349cf54182acdc31a074727d3079068448c0676d85"
|
||||||
|
|||||||
@@ -11,4 +11,4 @@ crate-type = ["staticlib"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
libc = "0.2.58"
|
libc = "0.2.58"
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
silentdragonlitelib = { git = "https://github.com/DenioD/silentdragonlite-cli", rev = "d196ad938a22810c0b6b4164e6bf8f1db0409763" }
|
silentdragonlitelib = { git = "https://github.com/DenioD/silentdragonlite-cli", rev = "d2887d07879a93bdd9b2c8bd12504bb977e82fe0" }
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
@@ -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]);
|
ContactItem contact = ContactItem(stuff[i][0],stuff[i][1], stuff[i][2], stuff[i][3],stuff[i][4]);
|
||||||
contacts.push_back(contact);
|
contacts.push_back(contact);
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_file.close();
|
_file.close();
|
||||||
|
|||||||
@@ -40,8 +40,6 @@ void AddressBookModel::loadData()
|
|||||||
QSettings().value(
|
QSettings().value(
|
||||||
"addresstablegeometry"
|
"addresstablegeometry"
|
||||||
).toByteArray()
|
).toByteArray()
|
||||||
|
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -241,9 +239,14 @@ void AddressBook::open(MainWindow* parent, QLineEdit* target)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
rpc->refresh(true);
|
// rpc->refresh(true);
|
||||||
model.updateUi();
|
model.updateUi();
|
||||||
|
|
||||||
|
rpc->refreshContacts(
|
||||||
|
parent->ui->listContactWidget
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// AddressBook::getInstance()->addAddressLabel(newLabel, ab.addr->text(), cid);
|
// AddressBook::getInstance()->addAddressLabel(newLabel, ab.addr->text(), cid);
|
||||||
@@ -394,9 +397,10 @@ void AddressBook::readFromStorage()
|
|||||||
QList<QList<QString>> stuff;
|
QList<QList<QString>> stuff;
|
||||||
in >> stuff;
|
in >> stuff;
|
||||||
//qDebug() << "Stuff: " << stuff;
|
//qDebug() << "Stuff: " << stuff;
|
||||||
|
|
||||||
for (int i=0; i < stuff.size(); i++)
|
for (int i=0; i < stuff.size(); i++)
|
||||||
{
|
{
|
||||||
//qDebug() << "0:" << stuff[i][0];
|
//qDebug() << "0:" << stuff[i][0];
|
||||||
//qDebug() << "1:" << stuff[i][1];
|
//qDebug() << "1:" << stuff[i][1];
|
||||||
//qDebug() << "2:" << stuff[i][2];
|
//qDebug() << "2:" << stuff[i][2];
|
||||||
ContactItem contact = ContactItem(stuff[i][0],stuff[i][1], stuff[i][2], stuff[i][3],stuff[i][4]);
|
ContactItem contact = ContactItem(stuff[i][0],stuff[i][1], stuff[i][2], stuff[i][3],stuff[i][4]);
|
||||||
@@ -404,27 +408,25 @@ void AddressBook::readFromStorage()
|
|||||||
allLabels.push_back(contact);
|
allLabels.push_back(contact);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
qDebug() << "Read " << version << " Hush contacts from disk...";
|
||||||
qDebug() << "Read " << version << " Hush contacts from disk...";
|
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
}else{
|
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)
|
|
||||||
{
|
{
|
||||||
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()
|
void AddressBook::writeToStorage()
|
||||||
{
|
{
|
||||||
//FileSystem::getInstance()->writeContacts(AddressBook::writeableFile(), DataStore::getContactDataStore()->dump());
|
//FileSystem::getInstance()->writeContacts(AddressBook::writeableFile(), DataStore::getContactDataStore()->dump());
|
||||||
|
|||||||
@@ -241,15 +241,17 @@ void MainWindow::renderContactRequest(){
|
|||||||
AddressBook::getInstance()->addAddressLabel(newLabel, addr, myAddr, cid, avatar);
|
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();
|
dialog.exec();
|
||||||
|
|
||||||
rpc->refreshContacts(
|
|
||||||
ui->listContactWidget
|
|
||||||
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatModel::addCid(QString tx, QString cid)
|
void ChatModel::addCid(QString tx, QString cid)
|
||||||
@@ -376,9 +378,6 @@ Tx MainWindow::createTxFromChatPage() {
|
|||||||
QString hmemo= createHeaderMemo(type,cid,myAddr);
|
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, hmemo});
|
||||||
tx.toAddrs.push_back(ToFields{addr, amt, memo});
|
tx.toAddrs.push_back(ToFields{addr, amt, memo});
|
||||||
|
|
||||||
@@ -547,7 +546,8 @@ void::MainWindow::addContact()
|
|||||||
request.setupUi(&dialog);
|
request.setupUi(&dialog);
|
||||||
Settings::saveRestore(&dialog);
|
Settings::saveRestore(&dialog);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
bool sapling = true;
|
bool sapling = true;
|
||||||
rpc->createNewZaddr(sapling, [=] (json reply) {
|
rpc->createNewZaddr(sapling, [=] (json reply) {
|
||||||
QString myAddr = QString::fromStdString(reply.get<json::array_t>()[0]);
|
QString myAddr = QString::fromStdString(reply.get<json::array_t>()[0]);
|
||||||
@@ -558,7 +558,19 @@ void::MainWindow::addContact()
|
|||||||
qDebug() << "new generated myAddr add Contact" << myAddr;
|
qDebug() << "new generated myAddr add Contact" << myAddr;
|
||||||
});
|
});
|
||||||
|
|
||||||
QString cid = QUuid::createUuid().toString(QUuid::WithoutBraces);
|
}catch(...)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
qDebug() << QString("Caught something nasty with myZaddr Contact");
|
||||||
|
}
|
||||||
|
|
||||||
|
QString cid = QUuid::createUuid().toString(QUuid::WithoutBraces);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user