diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2008-02-08 15:42:14 (GMT) |
---|---|---|
committer | Clinton Stimpson <clinton@elemtech.com> | 2008-02-08 15:42:14 (GMT) |
commit | 45cf2ade08351ccbc880856ba7774da52db06f0b (patch) | |
tree | 858fec6cbf426e7a9f98eeaa4b5ca542cb58319c /Source/QtDialog/CMakeSetup.cxx | |
parent | a71d56096cb2690514712c8b8cd843d10fba8e31 (diff) | |
download | CMake-45cf2ade08351ccbc880856ba7774da52db06f0b.zip CMake-45cf2ade08351ccbc880856ba7774da52db06f0b.tar.gz CMake-45cf2ade08351ccbc880856ba7774da52db06f0b.tar.bz2 |
COMP: Fix build with Qt 4.2.
BUG: Fix new editors stealing focus while typing search text.
ENH: Look for translation in data dir, not bin dir.
Diffstat (limited to 'Source/QtDialog/CMakeSetup.cxx')
-rw-r--r-- | Source/QtDialog/CMakeSetup.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 13237f2..5d8f3c1 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -19,6 +19,7 @@ #include <QFileInfo> #include <QDir> #include <QTranslator> +#include <QLocale> #include "CMakeSetupDialog.h" #include "cmDocumentation.h" @@ -65,22 +66,29 @@ static const char * cmDocumentationOptions[][3] = int main(int argc, char** argv) { QApplication app(argc, argv); - + + // tell the cmake library where cmake is QDir cmExecDir(QApplication::applicationDirPath()); #if defined(Q_OS_MAC) cmExecDir.cd("../../../"); #endif cmSystemTools::FindExecutableDirectory(cmExecDir.filePath("cmake").toAscii().data()); + // pick up translation files if they exists in the data directory + QDir translationsDir = cmExecDir; + translationsDir.cd(".." CMAKE_DATA_DIR); + translationsDir.cd("i18n"); QTranslator translator; QString transfile = QString("cmake_%1").arg(QLocale::system().name()); - translator.load(transfile, app.applicationDirPath()); + translator.load(transfile, translationsDir.path()); app.installTranslator(&translator); + // app setup app.setApplicationName("CMakeSetup"); app.setOrganizationName("Kitware"); app.setWindowIcon(QIcon(":/Icons/CMakeSetup.png")); + // do docs, if args were given cmDocumentation doc; if(app.arguments().size() > 1 && doc.CheckOptions(app.argc(), app.argv())) |