backup encrypted addresslabels to restore it later if needed
This commit is contained in:
@@ -734,25 +734,7 @@ void::MainWindow::addContact()
|
||||
|
||||
|
||||
QString cid = QUuid::createUuid().toString(QUuid::WithoutBraces);
|
||||
|
||||
QObject::connect(request.sendRequestButton, &QPushButton::clicked, [&] () {
|
||||
|
||||
QString addr = request.zaddr->text();
|
||||
QString myAddr = request.myzaddr->text().trimmed();
|
||||
QString memo = request.memorequest->toPlainText().trimmed();
|
||||
QString avatar = QString(":/icons/res/") + request.comboBoxAvatar->currentText() + QString(".png");
|
||||
QString label = request.labelRequest->text().trimmed();
|
||||
|
||||
|
||||
contactRequest.setSenderAddress(myAddr);
|
||||
contactRequest.setReceiverAddress(addr);
|
||||
contactRequest.setMemo(memo);
|
||||
contactRequest.setCid(cid);
|
||||
contactRequest.setAvatar(avatar);
|
||||
contactRequest.setLabel(label);
|
||||
|
||||
});
|
||||
|
||||
|
||||
QObject::connect(request.sendRequestButton, &QPushButton::clicked, this, &MainWindow::saveandsendContact);
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,18 @@ FirstTimeWizard::FirstTimeWizard(bool dangerous, QString server)
|
||||
this->dangerous = dangerous;
|
||||
this->server = server;
|
||||
|
||||
////backup addresslabels.dat if there is one, to restore it later
|
||||
|
||||
auto dir = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));
|
||||
QString addressbook = dir.filePath("addresslabels.dat.enc");
|
||||
QFile file(addressbook);
|
||||
|
||||
if (file.exists())
|
||||
{
|
||||
file.rename(dir.filePath("addresslabels.dat.enc-backup"));
|
||||
|
||||
}
|
||||
|
||||
// Create the pages
|
||||
setPage(Page_NewOrRestore, new NewOrRestorePage(this));
|
||||
setPage(Page_New, new NewSeedPage(this));
|
||||
|
||||
Reference in New Issue
Block a user