1
0
Fork 0
forked from lthn/blockchain

added exception handling in main thread + log message at exit

This commit is contained in:
cryptozoidberg 2019-08-30 20:48:02 +02:00
parent 12e5c65e46
commit 566d1d2d19
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC

View file

@ -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);
} }