add dangerous option

This commit is contained in:
DenioD
2020-07-25 14:56:16 +02:00
parent ab46276cee
commit 1171aca5df
9 changed files with 87 additions and 60 deletions

View File

@@ -69,6 +69,7 @@ void ConnectionLoader::doAutoConnect()
{
qDebug() << "Doing autoconnect";
auto config = std::shared_ptr<ConnectionConfig>(new ConnectionConfig());
config->dangerous = false;
config->server = Settings::getInstance()->getSettings().server;
// Initialize the library
@@ -79,6 +80,7 @@ void ConnectionLoader::doAutoConnect()
{
main->logger->write(QObject::tr("Using existing wallet."));
char* resp = litelib_initialize_existing(
config->dangerous,
config->server.toStdString().c_str()
);
QString response = litelib_process_response(resp);
@@ -93,7 +95,7 @@ void ConnectionLoader::doAutoConnect()
else
{
main->logger->write(QObject::tr("Create/restore wallet."));
createOrRestore(config->server);
createOrRestore(config->dangerous, config->server);
d->show();
}
@@ -160,12 +162,12 @@ void ConnectionLoader::doAutoConnect()
});
}
void ConnectionLoader::createOrRestore(QString server)
void ConnectionLoader::createOrRestore(bool dangerous, QString server)
{
// Close the startup dialog, since we'll be showing the wizard
d->hide();
// Create a wizard
FirstTimeWizard wizard(server);
FirstTimeWizard wizard(dangerous,server);
main->logger->write("Start new Wallet with FirstimeWizard");
wizard.exec();
}