Call node->initError instead of InitError from GUI code
Avoids GUI code calling a node function, and having to live in the same process as g_ui_signals and uiInterface global variables.
This commit is contained in:
1 parent
fad2502240
commit
fa6f402bde
3 files changed
+8
-4
No files matched your search
+4
-4
@@ -456,7 +456,7 @@ int GuiMain(int argc, char* argv[])
|
||||
SetupUIArgs();
|
||||
std::string error;
|
||||
if (!node->parseParameters(argc, argv, error)) {
|
||||
InitError(strprintf("Error parsing command line arguments: %s\n", error));
|
||||
node->initError(strprintf("Error parsing command line arguments: %s\n", error));
|
||||
// Create a message box, because the gui has neither been created nor has subscribed to core signals
|
||||
QMessageBox::critical(nullptr, PACKAGE_NAME,
|
||||
// message can not be translated because translations have not been initialized
|
||||
@@ -496,13 +496,13 @@ int GuiMain(int argc, char* argv[])
|
||||
/// - Do not call GetDataDir(true) before this step finishes
|
||||
if (!fs::is_directory(GetDataDir(false)))
|
||||
{
|
||||
InitError(strprintf("Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "")));
|
||||
node->initError(strprintf("Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "")));
|
||||
QMessageBox::critical(nullptr, PACKAGE_NAME,
|
||||
QObject::tr("Error: Specified data directory \"%1\" does not exist.").arg(QString::fromStdString(gArgs.GetArg("-datadir", ""))));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (!node->readConfigFiles(error)) {
|
||||
InitError(strprintf("Error reading configuration file: %s\n", error));
|
||||
node->initError(strprintf("Error reading configuration file: %s\n", error));
|
||||
QMessageBox::critical(nullptr, PACKAGE_NAME,
|
||||
QObject::tr("Error: Cannot parse configuration file: %1.").arg(QString::fromStdString(error)));
|
||||
return EXIT_FAILURE;
|
||||
@@ -518,7 +518,7 @@ int GuiMain(int argc, char* argv[])
|
||||
try {
|
||||
node->selectParams(gArgs.GetChainName());
|
||||
} catch(std::exception &e) {
|
||||
InitError(strprintf("%s\n", e.what()));
|
||||
node->initError(strprintf("%s\n", e.what()));
|
||||
QMessageBox::critical(nullptr, PACKAGE_NAME, QObject::tr("Error: %1").arg(e.what()));
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user