Skip to content

Commit 5704ff1

Browse files
committedFeb 1, 2012
Expression builder: Nicer help not found message
1 parent e87ff24 commit 5704ff1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
 

‎src/gui/qgsexpressionbuilderwidget.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,11 @@ QString QgsExpressionBuilderWidget::loadFunctionHelp( QgsExpressionItem* functio
409409
QString helpContents;
410410
QFile file( fullHelpPath );
411411
// check to see if the localized version exists
412+
413+
QString missingError = tr("<h3>Opps! QGIS can't find help for this function.</h3>"
414+
"The help file for %1 was not found for your language<br>"
415+
"If you would like to create it, contact the QGIS development team"
416+
).arg( functionName->text() );
412417
if ( !file.exists() )
413418
{
414419
// change the file name to the en_US version (default)
@@ -419,14 +424,14 @@ QString QgsExpressionBuilderWidget::loadFunctionHelp( QgsExpressionItem* functio
419424
// translate this for us message
420425
if ( !lang.contains( "en_" ) )
421426
{
422-
helpContents = "<i>" + tr( "This help file is not available in your language %1. If you would like to translate it, please contact the QGIS development team." ).arg( lang ) + "</i><hr />";
427+
helpContents = missingError;
423428
}
424429

425430
}
431+
426432
if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
427433
{
428-
helpContents = tr( "This help file does not exist for your language:<p><b>%1</b><p>If you would like to create it, contact the QGIS development team" )
429-
.arg( fullHelpPath );
434+
helpContents = missingError;
430435
}
431436
else
432437
{
@@ -438,6 +443,7 @@ QString QgsExpressionBuilderWidget::loadFunctionHelp( QgsExpressionItem* functio
438443
helpContents += line;
439444
}
440445
}
446+
441447
file.close();
442448

443449
// Set the browser text to the help contents

0 commit comments

Comments
 (0)
Please sign in to comment.