add recovery save on exception
This commit is contained in:
@@ -354,7 +354,9 @@
|
||||
<Natvis Include="libs\glm\util\glm.natvis" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Xml Include="data\layout.xml" />
|
||||
<Xml Include="data\layout.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</Xml>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
|
||||
@@ -606,6 +606,14 @@ void App::initLayout()
|
||||
init_menu_layer();
|
||||
init_menu_timelapse();
|
||||
|
||||
if (auto* menu_entry = layout[main_id]->find<NodeButtonCustom>("menu-about"))
|
||||
{
|
||||
menu_entry->on_click = [=](Node*) {
|
||||
// int x = 0;
|
||||
// sin(time(0) / x);
|
||||
};
|
||||
}
|
||||
|
||||
Brush b;
|
||||
b.m_tex_id = brushes->get_texture_id(0);
|
||||
b.id = brushes->get_brush_id(0);
|
||||
|
||||
@@ -245,6 +245,16 @@ static void SetupExceptionHandler()
|
||||
BT_AddLogFile(wpath);
|
||||
|
||||
BT_SetPreErrHandler([](INT_PTR){
|
||||
if (ui::Canvas::I)
|
||||
{
|
||||
auto path = App::I.data_path + "/recovery.pano";
|
||||
ui::Canvas::I->project_save_thread(path);
|
||||
static char abspath[MAX_PATH];
|
||||
GetFullPathNameA(path.c_str(), MAX_PATH, abspath, NULL);
|
||||
static char message[4096];
|
||||
snprintf(message, sizeof(message), "File recovered in: %s", abspath);
|
||||
MessageBoxA(NULL, message, "File Recovery", MB_OK | MB_ICONWARNING);
|
||||
}
|
||||
LogRemote::I.file_close();
|
||||
}, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user