mirror of
https://github.com/wolfpld/tracy.git
synced 2026-07-27 08:29:17 +00:00
Handle load failure exceptions.
This commit is contained in:
@@ -31,6 +31,9 @@ void BadVersionImpl( BadVersionState& badVer, ImFont* big )
|
||||
case BadVersionState::LegacyVersion:
|
||||
ImGui::OpenPopup( "Legacy file version" );
|
||||
break;
|
||||
case BadVersionState::LoadFailure:
|
||||
ImGui::OpenPopup( "Trace load failure" );
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
@@ -98,6 +101,22 @@ void BadVersionImpl( BadVersionState& badVer, ImFont* big )
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
if( ImGui::BeginPopupModal( "Trace load failure", nullptr, ImGuiWindowFlags_AlwaysAutoResize ) )
|
||||
{
|
||||
ImGui::PushFont( big );
|
||||
TextCentered( ICON_FA_BOMB );
|
||||
ImGui::PopFont();
|
||||
ImGui::TextUnformatted( "The file you are trying to open is corrupted." );
|
||||
ImGui::Spacing();
|
||||
ImGui::TextUnformatted( badVer.msg.c_str() );
|
||||
ImGui::Separator();
|
||||
if( ImGui::Button( "OK" ) )
|
||||
{
|
||||
ImGui::CloseCurrentPopup();
|
||||
badVer.state = BadVersionState::Ok;
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user