forked from lthn/blockchain
added exception handling in main thread + log message at exit
This commit is contained in:
parent
12e5c65e46
commit
566d1d2d19
1 changed files with 20 additions and 16 deletions
|
|
@ -42,25 +42,29 @@ int main(int argc, char *argv[])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
epee::string_tools::set_module_name_and_folder(argv[0]);
|
TRY_ENTRY();
|
||||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
epee::string_tools::set_module_name_and_folder(argv[0]);
|
||||||
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#if _MSC_VER >= 1910
|
#if _MSC_VER >= 1910
|
||||||
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps
|
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); //HiDPI pixmaps
|
||||||
qputenv("QT_SCALE_FACTOR", "0.75");
|
qputenv("QT_SCALE_FACTOR", "0.75");
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
MainWindow viewer;
|
MainWindow viewer;
|
||||||
if (!viewer.init_backend(argc, argv))
|
if (!viewer.init_backend(argc, argv))
|
||||||
{
|
{
|
||||||
static_cast<view::i_view*>(&viewer)->show_msg_box("Failed to initialize backend, check debug logs for more details.");
|
static_cast<view::i_view*>(&viewer)->show_msg_box("Failed to initialize backend, check debug logs for more details.");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
app.installNativeEventFilter(&viewer);
|
app.installNativeEventFilter(&viewer);
|
||||||
viewer.setWindowTitle(CURRENCY_NAME_BASE);
|
viewer.setWindowTitle(CURRENCY_NAME_BASE);
|
||||||
viewer.show_inital();
|
viewer.show_inital();
|
||||||
|
|
||||||
return app.exec();
|
int res = app.exec();
|
||||||
|
LOG_PRINT_L0("Process exit with code: " << res);
|
||||||
|
return res;
|
||||||
|
CATCH_ENTRY2(0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue