Skip to content

Commit

Permalink
#8269 Show project name (without path) in application title for 3D an…
Browse files Browse the repository at this point in the history
…d 2D window
  • Loading branch information
magnesj committed Nov 11, 2021
1 parent 07d6b90 commit 56a4560
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ApplicationLibCode/Application/RiaGuiApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ void RiaGuiApplication::storeTreeViewState()
//--------------------------------------------------------------------------------------------------
void RiaGuiApplication::setWindowCaptionFromAppState()
{
if ( !m_mainWindow ) return;

// The stuff being done here should really be handled by Qt automatically as a result of
// setting applicationName and windowFilePath
// Was unable to make this work in Qt4.4.0!
Expand All @@ -346,13 +344,21 @@ void RiaGuiApplication::setWindowCaptionFromAppState()
#endif

{
QString projFileName = m_project->fileName();
QString projFileName;

if ( !m_project->fileName().isEmpty() )
{
QFileInfo fi( m_project->fileName() );
projFileName = fi.fileName();
}

if ( projFileName.isEmpty() ) projFileName = "Untitled project";

capt = projFileName + QString( "[*]" ) + QString( " - " ) + capt;
}

m_mainWindow->setWindowTitle( capt );
if ( m_mainWindow ) m_mainWindow->setWindowTitle( capt );
if ( m_mainPlotWindow ) m_mainPlotWindow->setWindowTitle( capt );
}

//--------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 56a4560

Please sign in to comment.