Skip to content
Permalink
Browse files

[hig] Show standard '*' prefix in application title bar when project

has unsaved changes

E.g.

'*my project - QGIS'
  • Loading branch information
nyalldawson committed Mar 5, 2018
1 parent 7ffc148 commit d4a3520bc9fda9ead0191352018c1c96c4d46071
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/app/qgisapp.cpp
@@ -467,12 +467,18 @@ static void setTitleBarText_( QWidget &qgisApp )
else
{
QFileInfo projectFileInfo( QgsProject::instance()->fileName() );
caption = projectFileInfo.completeBaseName() + " - ";
caption = projectFileInfo.completeBaseName();
}
}
else
{
caption = QgsProject::instance()->title() + " - ";
caption = QgsProject::instance()->title();
}
if ( !caption.isEmpty() )
{
if ( QgsProject::instance()->isDirty() )
caption.prepend( '*' );
caption += " - ";
}

caption += QgisApp::tr( "QGIS" );
@@ -748,6 +754,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
mMapCanvas->setCanvasColor( QColor( myRed, myGreen, myBlue ) );
endProfile();

connect( QgsProject::instance(), &QgsProject::projectDirty, this, [ = ] { setTitleBarText_( *this ); } );

// what type of project to auto-open
mProjOpen = settings.value( QStringLiteral( "qgis/projOpenAtLaunch" ), 0 ).toInt();

0 comments on commit d4a3520

Please sign in to comment.
You can’t perform that action at this time.