Skip to content

Commit

Permalink
[needs-docs] Show "Untitled Project" in title bar for new unsaved
Browse files Browse the repository at this point in the history
projects

Also show current profile name, if multiple profiles exist

(Maybe doesn't needs-docs)
  • Loading branch information
nyalldawson committed Mar 10, 2018
1 parent cc0c1bc commit 354a261
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/app/qgisapp.cpp
Expand Up @@ -461,8 +461,8 @@ static void setTitleBarText_( QWidget &qgisApp )
{
if ( QgsProject::instance()->fileName().isEmpty() )
{
// no project title nor file name, so just leave caption with
// application name and version
// new project
caption = QgisApp::tr( "Untitled Project" );
}
else
{
Expand All @@ -488,6 +488,13 @@ static void setTitleBarText_( QWidget &qgisApp )
caption += QStringLiteral( " %1" ).arg( Qgis::QGIS_DEV_VERSION );
}

if ( QgisApp::instance()->userProfileManager()->allProfiles().count() > 1 )
{
// add current profile
QgsUserProfile *profile = QgisApp::instance()->userProfileManager()->userProfile();
caption += QStringLiteral( " [%1]" ).arg( profile->name() );
}

qgisApp.setWindowTitle( caption );
}

Expand Down Expand Up @@ -5110,7 +5117,6 @@ bool QgisApp::fileNew( bool promptToSaveFlag, bool forceBlank )
// write the projections _proj string_ to project settings
prj->setCrs( srs );
prj->setEllipsoid( srs.ellipsoidAcronym() );
prj->setDirty( false );

/* New Empty Project Created
(before attempting to load custom project templates/filepaths) */
Expand All @@ -5133,6 +5139,8 @@ bool QgisApp::fileNew( bool promptToSaveFlag, bool forceBlank )
// set the initial map tool
mMapCanvas->setMapTool( mMapTools.mPan );
mNonEditMapTool = mMapTools.mPan; // signals are not yet setup to catch this

prj->setDirty( false );
return true;
}

Expand Down

0 comments on commit 354a261

Please sign in to comment.