Skip to content

Commit a31e2e5

Browse files
author
gsherman
committed
Fixed help viewer to handle cases where no LANG (locale) is set.
Updated mapserver export tool to support context help. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6124 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 7469095 commit a31e2e5

File tree

5 files changed

+22
-3
lines changed

5 files changed

+22
-3
lines changed

src/helpviewer/qgshelpviewer.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ void QgsHelpViewer::loadContext(const QString &contextId)
7575
* the context id
7676
*/
7777
QString lang(QTextCodec::locale());
78+
/*
79+
* If the language isn't set on the system, assume en_US,
80+
* otherwise we get the banner at the top of the help file
81+
* saying it isn't available in "your" language. Some systems
82+
* may be installed without the LANG environment being set.
83+
*/
84+
if(lang.length() == 0 || lang == "C")
85+
{
86+
lang = "en_US";
87+
}
7888
QString fullHelpPath = helpFilesPath + contextId + "_" + lang;
7989
// get the help content and title from the localized file
8090
QString helpContents;

tools/mapserver_export/Makefile.am

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ BUILT_SOURCES = $(msexport_MOC) $(msexport_UI)
6060

6161

6262

63-
msexport_LDADD = $(QT_LDADD) $(PYTHON_LIB)
63+
msexport_LDADD = $(QT_LDADD) $(PYTHON_LIB) ../../src/core/libqgis_core.la ../../src/gui/libqgis_gui.la
64+
6465
msexport_CXXFLAGS = $(CXXFLAGS) $(PKGDATAPATH) $(EXTRA_CXXFLAGS) $(QT_CXXFLAGS) $(PYTHON_INCLUDE_DIR) -I../../src
6566

6667
CLEANFILES = $(BUILT_SOURCES)

tools/mapserver_export/qgsmapserverexport.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ email : sherman at mrcc.com
2929
#include <qstring.h>
3030
#include <QWidget>
3131
#include <QApplication>
32+
#include "../src/core/qgscontexthelp.h"
3233
#include "qgsmapserverexport.h"
3334

3435

@@ -167,6 +168,11 @@ void QgsMapserverExport::on_buttonOk_clicked()
167168
Py_DECREF(pstr);
168169

169170
}
171+
void QgsMapserverExport::on_buttonHelp_clicked()
172+
{
173+
QgsContextHelp::run(context_id);
174+
}
175+
170176
/** End of Auto-connected Slots **/
171177

172178
// Write the map file

tools/mapserver_export/qgsmapserverexport.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ Q_OBJECT
5151
OPEN
5252
};
5353
public slots:
54-
void showHelp();
54+
void showHelp();
55+
void on_buttonHelp_clicked();
5556
void on_btnChooseFile_clicked();
5657
void on_chkExpLayersOnly_clicked(bool);
5758
void on_btnChooseProjectFile_clicked();
@@ -63,6 +64,7 @@ Q_OBJECT
6364
QString qgisProjectFile;
6465
bool neverSaved;
6566
int action;
67+
static const int context_id = 863656587;
6668
};
6769

6870
#endif //QGSMAPSERVEREXPORT_H

tools/mapserver_export/qgsmapserverexportbase.ui

+1-1
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@
450450
<item row="1" column="0" >
451451
<widget class="QLabel" name="textLabel7_2" >
452452
<property name="text" >
453-
<string>QGIS Project File</string>
453+
<string>QGIS project file</string>
454454
</property>
455455
<property name="buddy" >
456456
<cstring>txtQgisFilePath</cstring>

0 commit comments

Comments
 (0)