Skip to content

Commit 7dca9dd

Browse files
committed
Help viewer: Add nicer help not found message; reduce margins
1 parent 6e7610a commit 7dca9dd

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/helpviewer/qgshelpviewer.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ void QgsHelpViewer::loadContext( const QString &contextId )
127127
// get the help content and title from the localized file
128128
QString helpContents;
129129
QFile file( fullHelpPath );
130+
131+
QString missingError = tr("<h3>Opps! QGIS can't find help for this form.</h3>"
132+
"The help file for %1 was not found for your language<br>"
133+
"If you would like to create it, contact the QGIS development team"
134+
).arg( contextId );
135+
130136
// check to see if the localized version exists
131137
if ( !file.exists() )
132138
{
@@ -137,13 +143,12 @@ void QgsHelpViewer::loadContext( const QString &contextId )
137143
// translate this for us message
138144
if ( !lang.contains( "en_" ) )
139145
{
140-
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 />";
146+
helpContents = missingError;
141147
}
142148
}
143149
if ( !file.open( QIODevice::ReadOnly | QIODevice::Text ) )
144150
{
145-
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" )
146-
.arg( fullHelpPath );
151+
helpContents = missingError;
147152
}
148153
else
149154
{

src/helpviewer/qgshelpviewerbase.ui

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
<bool>true</bool>
2323
</property>
2424
<layout class="QGridLayout" name="gridLayout">
25+
<property name="margin">
26+
<number>0</number>
27+
</property>
2528
<item row="0" column="0">
2629
<widget class="QWebView" name="webView">
2730
<property name="url">

0 commit comments

Comments
 (0)