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@6124 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
gsherman 2006-11-26 20:17:58 +00:00
parent f4734765f9
commit 48304a3e83
5 changed files with 22 additions and 3 deletions

View File

@ -75,6 +75,16 @@ void QgsHelpViewer::loadContext(const QString &contextId)
* the context id
*/
QString lang(QTextCodec::locale());
/*
* If the language isn't set on the system, assume en_US,
* otherwise we get the banner at the top of the help file
* saying it isn't available in "your" language. Some systems
* may be installed without the LANG environment being set.
*/
if(lang.length() == 0 || lang == "C")
{
lang = "en_US";
}
QString fullHelpPath = helpFilesPath + contextId + "_" + lang;
// get the help content and title from the localized file
QString helpContents;

View File

@ -60,7 +60,8 @@ BUILT_SOURCES = $(msexport_MOC) $(msexport_UI)
msexport_LDADD = $(QT_LDADD) $(PYTHON_LIB)
msexport_LDADD = $(QT_LDADD) $(PYTHON_LIB) ../../src/core/libqgis_core.la ../../src/gui/libqgis_gui.la
msexport_CXXFLAGS = $(CXXFLAGS) $(PKGDATAPATH) $(EXTRA_CXXFLAGS) $(QT_CXXFLAGS) $(PYTHON_INCLUDE_DIR) -I../../src
CLEANFILES = $(BUILT_SOURCES)

View File

@ -29,6 +29,7 @@ email : sherman at mrcc.com
#include <qstring.h>
#include <QWidget>
#include <QApplication>
#include "../src/core/qgscontexthelp.h"
#include "qgsmapserverexport.h"
@ -167,6 +168,11 @@ void QgsMapserverExport::on_buttonOk_clicked()
Py_DECREF(pstr);
}
void QgsMapserverExport::on_buttonHelp_clicked()
{
QgsContextHelp::run(context_id);
}
/** End of Auto-connected Slots **/
// Write the map file

View File

@ -51,7 +51,8 @@ public:
OPEN
};
public slots:
void showHelp();
void showHelp();
void on_buttonHelp_clicked();
void on_btnChooseFile_clicked();
void on_chkExpLayersOnly_clicked(bool);
void on_btnChooseProjectFile_clicked();
@ -63,6 +64,7 @@ public:
QString qgisProjectFile;
bool neverSaved;
int action;
static const int context_id = 863656587;
};
#endif //QGSMAPSERVEREXPORT_H

View File

@ -450,7 +450,7 @@
<item row="1" column="0" >
<widget class="QLabel" name="textLabel7_2" >
<property name="text" >
<string>QGIS Project File</string>
<string>QGIS project file</string>
</property>
<property name="buddy" >
<cstring>txtQgisFilePath</cstring>