Show trace description/filename on titlebar.

This commit is contained in:
Bartosz Taudul
2023-06-29 23:53:37 +02:00
parent 0cb6d8588b
commit 57bd63dab6
5 changed files with 30 additions and 1 deletions

View File

@@ -870,4 +870,30 @@ void View::Attention( bool& alreadyDone )
}
}
void View::UpdateTitle()
{
auto captureName = m_worker.GetCaptureName().c_str();
const auto& desc = m_userData.GetDescription();
if( !desc.empty() )
{
char buf[1024];
snprintf( buf, 1024, "%s (%s)", captureName, desc.c_str() );
m_stcb( buf );
}
else if( !m_filename.empty() )
{
auto fptr = m_filename.c_str() + m_filename.size() - 1;
while( fptr > m_filename.c_str() && *fptr != '/' && *fptr != '\\' ) fptr--;
if( *fptr == '/' || *fptr == '\\' ) fptr++;
char buf[1024];
snprintf( buf, 1024, "%s (%s)", captureName, fptr );
m_stcb( buf );
}
else
{
m_stcb( captureName );
}
}
}