Skip to content
Permalink
Browse files
Revise main window title bar text
- Change order to "project name - QGIS" to follow standard
convention (also avoids possible truncation of project name which is
more useful then the "QGIS" text)
- Don't show version number in release builds. Only show version
in dev builds instead. Showing the version number violates the
HIG for Windows and OSX (and probably Linux DEs too).
  • Loading branch information
nyalldawson committed Apr 20, 2017
1 parent 1341537 commit 490f5f06feabce6dd2115fcec0231b13120d09b9
Showing with 12 additions and 15 deletions.
  1. +12 −15 src/app/qgisapp.cpp
@@ -389,25 +389,15 @@ class QTreeWidgetItem;

If the current project title is null
if the project file is null then
set title text to just application name and version
set title text to just application name
else
set set title text to the project file name
else
set the title text to project title
*/
static void setTitleBarText_( QWidget &qgisApp )
{
QString caption = QgisApp::tr( "QGIS " );

if ( Qgis::QGIS_VERSION.endsWith( QLatin1String( "Master" ) ) )
{
caption += QStringLiteral( "%1" ).arg( Qgis::QGIS_DEV_VERSION );
}
else
{
caption += Qgis::QGIS_VERSION;
}

QString caption;
if ( QgsProject::instance()->title().isEmpty() )
{
if ( QgsProject::instance()->fileName().isEmpty() )
@@ -418,16 +408,23 @@ 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() + " - ";
}

caption += QgisApp::tr( "QGIS" );

if ( Qgis::QGIS_VERSION.endsWith( QLatin1String( "Master" ) ) )
{
caption += QStringLiteral( " %1" ).arg( Qgis::QGIS_DEV_VERSION );
}

qgisApp.setWindowTitle( caption );
} // setTitleBarText_( QWidget * qgisApp )
}

/**
Creator function for output viewer

0 comments on commit 490f5f0

Please sign in to comment.