diff options
Diffstat (limited to 'Source/QtDialog')
-rw-r--r-- | Source/QtDialog/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Source/QtDialog/CMakeSetup.cxx | 6 | ||||
-rw-r--r-- | Source/QtDialog/CMakeSetupDialog.cxx | 6 | ||||
-rw-r--r-- | Source/QtDialog/QCMake.cxx | 36 | ||||
-rw-r--r-- | Source/QtDialog/QCMake.h | 6 | ||||
-rw-r--r-- | Source/QtDialog/QCMakeWidgets.cxx | 6 | ||||
-rw-r--r-- | Source/QtDialog/QtDialogCPack.cmake.in | 3 | ||||
-rwxr-xr-x | Source/QtDialog/postflight.sh.in | 3 | ||||
-rwxr-xr-x | Source/QtDialog/postupgrade.sh.in | 2 |
9 files changed, 44 insertions, 32 deletions
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 7885a0c..8da88c1 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -154,14 +154,6 @@ if(UNIX) endif() if(APPLE) - set(CMAKE_POSTFLIGHT_SCRIPT - "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh") - set(CMAKE_POSTUPGRADE_SCRIPT - "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh") - configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postflight.sh.in" - "${CMake_BINARY_DIR}/Source/QtDialog/postflight.sh") - configure_file("${CMake_SOURCE_DIR}/Source/QtDialog/postupgrade.sh.in" - "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh") install(CODE "execute_process(COMMAND ln -s \"../MacOS/CMake\" cmake-gui WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)") endif() diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 821121e..82fa3a3 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -14,6 +14,7 @@ #include <QDir> #include <QTranslator> #include <QLocale> +#include <QTextCodec> #include "QMacInstallDialog.h" #include "CMakeSetupDialog.h" #include "cmDocumentation.h" @@ -78,6 +79,11 @@ int main(int argc, char** argv) QApplication app(argc, argv); +#if defined(CMAKE_ENCODING_UTF8) + QTextCodec* utf8_codec = QTextCodec::codecForName("UTF-8"); + QTextCodec::setCodecForLocale(utf8_codec); +#endif + // clean out standard Qt paths for plugins, which we don't use anyway // when creating Mac bundles, it potentially causes problems foreach(QString p, QApplication::libraryPaths()) diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 10879c0..8a37797 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -578,7 +578,8 @@ void CMakeSetupDialog::doInterrupt() void CMakeSetupDialog::doSourceBrowse() { QString dir = QFileDialog::getExistingDirectory(this, - tr("Enter Path to Source"), this->SourceDirectory->text()); + tr("Enter Path to Source"), this->SourceDirectory->text(), + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if(!dir.isEmpty()) { this->setSourceDirectory(dir); @@ -608,7 +609,8 @@ void CMakeSetupDialog::updateBinaryDirectory(const QString& dir) void CMakeSetupDialog::doBinaryBrowse() { QString dir = QFileDialog::getExistingDirectory(this, - tr("Enter Path to Build"), this->BinaryDirectory->currentText()); + tr("Enter Path to Build"), this->BinaryDirectory->currentText(), + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if(!dir.isEmpty() && dir != this->BinaryDirectory->currentText()) { this->setBinaryDirectory(dir); diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 0fe5f8c..b833648 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -35,7 +35,9 @@ QCMake::QCMake(QObject* p) cmSystemTools::DisableRunCommandOutput(); cmSystemTools::SetRunCommandHideConsole(true); - cmSystemTools::SetErrorCallback(QCMake::errorCallback, this); + cmSystemTools::SetMessageCallback(QCMake::messageCallback, this); + cmSystemTools::SetStdoutCallback(QCMake::stdoutCallback, this); + cmSystemTools::SetStderrCallback(QCMake::stderrCallback, this); this->CMakeInstance = new cmake; this->CMakeInstance->SetCMakeEditCommand( @@ -111,13 +113,13 @@ void QCMake::setBinaryDirectory(const QString& _dir) cmCacheManager::CacheIterator itm = cachem->NewIterator(); if ( itm.Find("CMAKE_HOME_DIRECTORY")) { - setSourceDirectory(QString::fromLocal8Bit(itm.GetValue())); + setSourceDirectory(QString::fromLocal8Bit(itm.GetValue().c_str())); } if ( itm.Find("CMAKE_GENERATOR")) { const char* extraGen = cachem->GetCacheValue("CMAKE_EXTRA_GENERATOR"); std::string curGen = cmExternalMakefileProjectGenerator:: - CreateFullGeneratorName(itm.GetValue(), extraGen); + CreateFullGeneratorName(itm.GetValue(), extraGen? extraGen : ""); this->setGenerator(QString::fromLocal8Bit(curGen.c_str())); } } @@ -201,11 +203,11 @@ void QCMake::setProperties(const QCMakePropertyList& newProps) } QCMakeProperty prop; - prop.Key = QString::fromLocal8Bit(i.GetName()); + prop.Key = QString::fromLocal8Bit(i.GetName().c_str()); int idx = props.indexOf(prop); if(idx == -1) { - toremove.append(QString::fromLocal8Bit(i.GetName())); + toremove.append(QString::fromLocal8Bit(i.GetName().c_str())); } else { @@ -286,15 +288,15 @@ QCMakePropertyList QCMake::properties() const } QCMakeProperty prop; - prop.Key = QString::fromLocal8Bit(i.GetName()); + prop.Key = QString::fromLocal8Bit(i.GetName().c_str()); prop.Help = QString::fromLocal8Bit(i.GetProperty("HELPSTRING")); - prop.Value = QString::fromLocal8Bit(i.GetValue()); + prop.Value = QString::fromLocal8Bit(i.GetValue().c_str()); prop.Advanced = i.GetPropertyAsBool("ADVANCED"); if(i.GetType() == cmCacheManager::BOOL) { prop.Type = QCMakeProperty::BOOL; - prop.Value = cmSystemTools::IsOn(i.GetValue()); + prop.Value = cmSystemTools::IsOn(i.GetValue().c_str()); } else if(i.GetType() == cmCacheManager::PATH) { @@ -348,14 +350,28 @@ void QCMake::progressCallback(const char* msg, float percent, void* cd) QCoreApplication::processEvents(); } -void QCMake::errorCallback(const char* msg, const char* /*title*/, - bool& /*stop*/, void* cd) +void QCMake::messageCallback(const char* msg, const char* /*title*/, + bool& /*stop*/, void* cd) { QCMake* self = reinterpret_cast<QCMake*>(cd); emit self->errorMessage(QString::fromLocal8Bit(msg)); QCoreApplication::processEvents(); } +void QCMake::stdoutCallback(const char* msg, size_t len, void* cd) +{ + QCMake* self = reinterpret_cast<QCMake*>(cd); + emit self->outputMessage(QString::fromLocal8Bit(msg,int(len))); + QCoreApplication::processEvents(); +} + +void QCMake::stderrCallback(const char* msg, size_t len, void* cd) +{ + QCMake* self = reinterpret_cast<QCMake*>(cd); + emit self->outputMessage(QString::fromLocal8Bit(msg,int(len))); + QCoreApplication::processEvents(); +} + QString QCMake::binaryDirectory() const { return this->BinaryDirectory; diff --git a/Source/QtDialog/QCMake.h b/Source/QtDialog/QCMake.h index 93ac8ab..bd82f0d 100644 --- a/Source/QtDialog/QCMake.h +++ b/Source/QtDialog/QCMake.h @@ -136,8 +136,10 @@ protected: static bool interruptCallback(void*); static void progressCallback(const char* msg, float percent, void* cd); - static void errorCallback(const char* msg, const char* title, - bool&, void* cd); + static void messageCallback(const char* msg, const char* title, + bool&, void* cd); + static void stdoutCallback(const char* msg, size_t len, void* cd); + static void stderrCallback(const char* msg, size_t len, void* cd); bool SuppressDevWarnings; bool WarnUninitializedMode; bool WarnUnusedMode; diff --git a/Source/QtDialog/QCMakeWidgets.cxx b/Source/QtDialog/QCMakeWidgets.cxx index a0c5e17..41f98b5 100644 --- a/Source/QtDialog/QCMakeWidgets.cxx +++ b/Source/QtDialog/QCMakeWidgets.cxx @@ -67,7 +67,8 @@ void QCMakeFilePathEditor::chooseFile() title = title.arg(this->Variable); } this->fileDialogExists(true); - path = QFileDialog::getOpenFileName(this, title, info.absolutePath()); + path = QFileDialog::getOpenFileName(this, title, info.absolutePath(), + QString(), NULL, QFileDialog::DontResolveSymlinks); this->fileDialogExists(false); if(!path.isEmpty()) @@ -91,7 +92,8 @@ void QCMakePathEditor::chooseFile() title = title.arg(this->Variable); } this->fileDialogExists(true); - path = QFileDialog::getExistingDirectory(this, title, this->text()); + path = QFileDialog::getExistingDirectory(this, title, this->text(), + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); this->fileDialogExists(false); if(!path.isEmpty()) { diff --git a/Source/QtDialog/QtDialogCPack.cmake.in b/Source/QtDialog/QtDialogCPack.cmake.in index 3196471..7ae8605 100644 --- a/Source/QtDialog/QtDialogCPack.cmake.in +++ b/Source/QtDialog/QtDialogCPack.cmake.in @@ -9,9 +9,6 @@ if(CMAKE_PACKAGE_QTGUI) # / and then install # cmake into the bundle for cmake-gui and must use DESTDIR set(CPACK_SET_DESTDIR TRUE) - # we also want to run post install stuff to setup command line - set(CPACK_POSTFLIGHT_SCRIPT "@CMAKE_POSTFLIGHT_SCRIPT@") - set(CPACK_POSTUPGRADE_SCRIPT "@CMAKE_POSTUPGRADE_SCRIPT@") endif() endif() diff --git a/Source/QtDialog/postflight.sh.in b/Source/QtDialog/postflight.sh.in deleted file mode 100755 index 0b96889..0000000 --- a/Source/QtDialog/postflight.sh.in +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -"$2@CMAKE_INSTALL_SUBDIR@/CMake.app/Contents/MacOS/CMake" --mac-install -exit 0 diff --git a/Source/QtDialog/postupgrade.sh.in b/Source/QtDialog/postupgrade.sh.in deleted file mode 100755 index 06bd986..0000000 --- a/Source/QtDialog/postupgrade.sh.in +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -exit 0 |