Skip to content

Commit

Permalink
Help viewer: Add nicer help not found message; reduce margins
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 committed Feb 1, 2012
1 parent 6e7610a commit 7dca9dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/helpviewer/qgshelpviewer.cpp
Expand Up @@ -127,6 +127,12 @@ void QgsHelpViewer::loadContext( const QString &contextId )
// get the help content and title from the localized file
QString helpContents;
QFile file( fullHelpPath );

QString missingError = tr("<h3>Opps! QGIS can't find help for this form.</h3>"
"The help file for %1 was not found for your language<br>"
"If you would like to create it, contact the QGIS development team"
).arg( contextId );

// check to see if the localized version exists
if ( !file.exists() )
{
Expand All @@ -137,13 +143,12 @@ void QgsHelpViewer::loadContext( const QString &contextId )
// translate this for us message
if ( !lang.contains( "en_" ) )
{
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 />";
helpContents = missingError;
}
}
if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
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" )
.arg( fullHelpPath );
helpContents = missingError;
}
else
{
Expand Down
3 changes: 3 additions & 0 deletions src/helpviewer/qgshelpviewerbase.ui
Expand Up @@ -22,6 +22,9 @@
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QWebView" name="webView">
<property name="url">
Expand Down

0 comments on commit 7dca9dd

Please sign in to comment.