Skip to content

Commit 490f5f0

Browse files
committedApr 20, 2017
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).
1 parent 1341537 commit 490f5f0

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -389,25 +389,15 @@ class QTreeWidgetItem;
389389
390390
If the current project title is null
391391
if the project file is null then
392-
set title text to just application name and version
392+
set title text to just application name
393393
else
394394
set set title text to the project file name
395395
else
396396
set the title text to project title
397397
*/
398398
static void setTitleBarText_( QWidget &qgisApp )
399399
{
400-
QString caption = QgisApp::tr( "QGIS " );
401-
402-
if ( Qgis::QGIS_VERSION.endsWith( QLatin1String( "Master" ) ) )
403-
{
404-
caption += QStringLiteral( "%1" ).arg( Qgis::QGIS_DEV_VERSION );
405-
}
406-
else
407-
{
408-
caption += Qgis::QGIS_VERSION;
409-
}
410-
400+
QString caption;
411401
if ( QgsProject::instance()->title().isEmpty() )
412402
{
413403
if ( QgsProject::instance()->fileName().isEmpty() )
@@ -418,16 +408,23 @@ static void setTitleBarText_( QWidget &qgisApp )
418408
else
419409
{
420410
QFileInfo projectFileInfo( QgsProject::instance()->fileName() );
421-
caption += " - " + projectFileInfo.completeBaseName();
411+
caption = projectFileInfo.completeBaseName() + " - ";
422412
}
423413
}
424414
else
425415
{
426-
caption += " - " + QgsProject::instance()->title();
416+
caption = QgsProject::instance()->title() + " - ";
417+
}
418+
419+
caption += QgisApp::tr( "QGIS" );
420+
421+
if ( Qgis::QGIS_VERSION.endsWith( QLatin1String( "Master" ) ) )
422+
{
423+
caption += QStringLiteral( " %1" ).arg( Qgis::QGIS_DEV_VERSION );
427424
}
428425

429426
qgisApp.setWindowTitle( caption );
430-
} // setTitleBarText_( QWidget * qgisApp )
427+
}
431428

432429
/**
433430
Creator function for output viewer

0 commit comments

Comments
 (0)
Please sign in to comment.