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 authored and alexbruy committed Feb 11, 2012
1 parent 78d2ee7 commit 49cdac0
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 @@ -126,6 +126,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 @@ -136,13 +142,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 49cdac0

Please sign in to comment.