mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8269 Show project name (without path) in application title for 3D and 2D window
This commit is contained in:
@@ -334,8 +334,6 @@ void RiaGuiApplication::storeTreeViewState()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiaGuiApplication::setWindowCaptionFromAppState()
|
void RiaGuiApplication::setWindowCaptionFromAppState()
|
||||||
{
|
{
|
||||||
if ( !m_mainWindow ) return;
|
|
||||||
|
|
||||||
// The stuff being done here should really be handled by Qt automatically as a result of
|
// The stuff being done here should really be handled by Qt automatically as a result of
|
||||||
// setting applicationName and windowFilePath
|
// setting applicationName and windowFilePath
|
||||||
// Was unable to make this work in Qt4.4.0!
|
// Was unable to make this work in Qt4.4.0!
|
||||||
@@ -346,13 +344,21 @@ void RiaGuiApplication::setWindowCaptionFromAppState()
|
|||||||
#endif
|
#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";
|
if ( projFileName.isEmpty() ) projFileName = "Untitled project";
|
||||||
|
|
||||||
capt = projFileName + QString( "[*]" ) + QString( " - " ) + capt;
|
capt = projFileName + QString( "[*]" ) + QString( " - " ) + capt;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_mainWindow->setWindowTitle( capt );
|
if ( m_mainWindow ) m_mainWindow->setWindowTitle( capt );
|
||||||
|
if ( m_mainPlotWindow ) m_mainPlotWindow->setWindowTitle( capt );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user