Skip to content

Commit

Permalink
Fixed help viewer to handle cases where no LANG (locale) is set.
Browse files Browse the repository at this point in the history
Updated mapserver export tool to support context help.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6124 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gsherman committed Nov 26, 2006
1 parent 7469095 commit a31e2e5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
10 changes: 10 additions & 0 deletions src/helpviewer/qgshelpviewer.cpp
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion tools/mapserver_export/Makefile.am
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions tools/mapserver_export/qgsmapserverexport.cpp
Expand Up @@ -29,6 +29,7 @@ email : sherman at mrcc.com
#include <qstring.h>
#include <QWidget>
#include <QApplication>
#include "../src/core/qgscontexthelp.h"
#include "qgsmapserverexport.h"


Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tools/mapserver_export/qgsmapserverexport.h
Expand Up @@ -51,7 +51,8 @@ Q_OBJECT
OPEN
};
public slots:
void showHelp();
void showHelp();
void on_buttonHelp_clicked();
void on_btnChooseFile_clicked();
void on_chkExpLayersOnly_clicked(bool);
void on_btnChooseProjectFile_clicked();
Expand All @@ -63,6 +64,7 @@ Q_OBJECT
QString qgisProjectFile;
bool neverSaved;
int action;
static const int context_id = 863656587;
};

#endif //QGSMAPSERVEREXPORT_H
Expand Down
2 changes: 1 addition & 1 deletion tools/mapserver_export/qgsmapserverexportbase.ui
Expand Up @@ -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>
Expand Down

0 comments on commit a31e2e5

Please sign in to comment.