Permalink
Browse files

Core: Added more debug options in SystemSettings. Made setting indivi…

…dual for each exe.
  • Loading branch information...
petersteneteg committed Sep 20, 2018
1 parent 0859450 commit 4d5235c821e4db80c8f41a09774c64e81dede2ff
View
@@ -1,5 +1,12 @@
Here we document changes that affect the public API or changes that needs to be communicated to other developers.
## 2018-09-21
Settings are no longer shared between executables. I.e. The Inviwo app and the integration test will not use the same settings any more. We now prefix the settings with the InviwoApplication display name. This also implies that any existing Inviwo app settings will be lost. To keep old setting one can prefix all the ".ivs" file in the inviwo settings folder with "Inviwo_". On windows the inviwo settings can be found in %APPDATA%/inviwo.
Added System settings for breaking into the debugger on various log message levels, and on throwing exceptions. Also added an option to add stacktraces to exceptions. All to help with debugging.
The inviwo app will now catch unchought inviwo exceptions in main and present an dialog with information and an option to continue or abort. It will also give an option to save your workspace before closing.
## 2018-08-21
The property class identifier system no longer uses the `InviwoPropertyInfo` / `PropertyClassIdentifier` macros but rather implements
```
View
@@ -55,7 +55,7 @@ int main(int argc, char** argv) {
inviwo::LogCentral::init(&logger);
auto logCounter = std::make_shared<inviwo::LogErrorCounter>();
logger.registerLogger(logCounter);
inviwo::InviwoApplicationQt inviwoApp("Inviwo", argc, argv);
inviwo::InviwoApplicationQt inviwoApp(argc, argv, "Inviwo");
inviwoApp.setWindowIcon(QIcon(":/inviwo/inviwo_light.png"));
inviwoApp.setAttribute(Qt::AA_NativeWindows);
QFile styleSheetFile(":/stylesheets/inviwo.qss");
@@ -124,20 +124,22 @@ int main(int argc, char** argv) {
std::stringstream ss;
auto j = inviwo::util::make_ostream_joiner(ss, "\n");
std::copy(e.getStack().begin(), e.getStack().end(), j);
LogErrorCustom("inviwo.app", ss.str());
LogErrorCustom("Inviwo", ss.str());
}
{
std::stringstream ss;
ss << e.getMessage() + "\n Stack Trace:\n";
auto j = inviwo::util::make_ostream_joiner(ss, "\n");
if (std::distance(e.getStack().begin(), e.getStack().end()) > 10) {
std::copy(e.getStack().begin(), e.getStack().begin() + 10, j);
ss << "\n...";
} else {
std::copy(e.getStack().begin(), e.getStack().end(), j);
ss << e.getMessage();
if (!e.getStack().empty()) {
ss << "\nStack Trace:\n";
auto j = inviwo::util::make_ostream_joiner(ss, "\n");
if (std::distance(e.getStack().begin(), e.getStack().end()) > 10) {
std::copy(e.getStack().begin(), e.getStack().begin() + 10, j);
ss << "\n...";
} else {
std::copy(e.getStack().begin(), e.getStack().end(), j);
}
}
ss << "\nApplication state might be corrupted, be warned.";
auto res = QMessageBox::critical(
&mainWin, "Fatal Error", QString::fromStdString(ss.str()),
QMessageBox::Ignore | QMessageBox::Close, QMessageBox::Close);
@@ -148,11 +150,19 @@ int main(int argc, char** argv) {
}
} catch (const std::exception& e) {
LogErrorCustom("inviwo.cpp", e.what());
QMessageBox::critical(nullptr, "Fatal Error", e.what());
return 1;
LogErrorCustom("Inviwo", e.what());
std::stringstream ss;
ss << e.what();
ss << "\nApplication state might be corrupted, be warned.";
auto res =
QMessageBox::critical(&mainWin, "Fatal Error", QString::fromStdString(ss.str()),
QMessageBox::Ignore | QMessageBox::Close, QMessageBox::Close);
if (res == QMessageBox::Close) {
mainWin.askToSaveWorkspaceChanges();
return 1;
}
} catch (...) {
LogErrorCustom("inviwo.cpp", "Uncaught exception, terminating");
LogErrorCustom("Inviwo", "Uncaught exception, terminating");
QMessageBox::critical(nullptr, "Fatal Error", "Uncaught exception, terminating");
return 1;
}
@@ -56,7 +56,7 @@ int main(int argc, char** argv) {
auto logger = std::make_shared<inviwo::ConsoleLogger>();
LogCentral::getPtr()->registerLogger(logger);
InviwoApplication inviwoApp(argc, argv, "Inviwo v" + IVW_VERSION + " - GLFWApp");
InviwoApplication inviwoApp(argc, argv, "Inviwo-GLFW");
inviwoApp.printApplicationInfo();
inviwoApp.setPostEnqueueFront([]() { glfwPostEmptyEvent(); });
inviwoApp.setProgressCallback([](std::string m) {
@@ -49,8 +49,7 @@ int main(int argc, char** argv) {
auto logger = std::make_shared<inviwo::ConsoleLogger>();
LogCentral::getPtr()->registerLogger(logger);
std::string appName = "Inviwo v" + IVW_VERSION + " - QtApp";
InviwoApplicationQt inviwoApp(appName, argc, argv);
InviwoApplicationQt inviwoApp(argc, argv, "Inviwo-Qt");
inviwoApp.printApplicationInfo();
inviwoApp.setAttribute(Qt::AA_NativeWindows);
inviwoApp.setProgressCallback([](std::string m) {
Oops, something went wrong.

0 comments on commit 4d5235c

Please sign in to comment.