summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog/CMakeSetupDialog.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-19 14:13:08 (GMT)
committerBrad King <brad.king@kitware.com>2015-05-21 12:59:32 (GMT)
commit8ea2db2639b55b5c3590a594f9beddd9740cf679 (patch)
tree5178410311dfa0930a95ec1967a33d791100a6fd /Source/QtDialog/CMakeSetupDialog.cxx
parent438ce4a0fb92b7288a46e17524418522468eb0a2 (diff)
downloadCMake-8ea2db2639b55b5c3590a594f9beddd9740cf679.zip
CMake-8ea2db2639b55b5c3590a594f9beddd9740cf679.tar.gz
CMake-8ea2db2639b55b5c3590a594f9beddd9740cf679.tar.bz2
cmake-gui: Replace command-line install dialog with information box
The QMacInstallDialog infrastructure no longer works on modern OS X versions. Drop it and replace the dialog with a simple info box that explains to the user how to run 'cmake-gui --install' to add symlinks. Also suggest simply modifying the PATH. This approach is similar to the Xcode 'xcode-select --install' method of installing Xcode Command Line Tools.
Diffstat (limited to 'Source/QtDialog/CMakeSetupDialog.cxx')
-rw-r--r--Source/QtDialog/CMakeSetupDialog.cxx36
1 files changed, 32 insertions, 4 deletions
diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx
index b8077f2..426fa12 100644
--- a/Source/QtDialog/CMakeSetupDialog.cxx
+++ b/Source/QtDialog/CMakeSetupDialog.cxx
@@ -27,7 +27,6 @@
#include <QUrl>
#include <QShortcut>
#include <QKeySequence>
-#include <QMacInstallDialog.h>
#include <QInputDialog>
#include "QCMake.h"
@@ -121,7 +120,7 @@ CMakeSetupDialog::CMakeSetupDialog()
this, SLOT(showUserChanges()));
#if defined(Q_WS_MAC) || defined(Q_OS_MAC)
this->InstallForCommandLineAction
- = ToolsMenu->addAction(tr("&Install For Command Line Use"));
+ = ToolsMenu->addAction(tr("&How to Install For Command Line Use"));
QObject::connect(this->InstallForCommandLineAction, SIGNAL(triggered(bool)),
this, SLOT(doInstallForCommandLine()));
#endif
@@ -420,8 +419,37 @@ bool CMakeSetupDialog::doConfigureInternal()
void CMakeSetupDialog::doInstallForCommandLine()
{
- QMacInstallDialog setupdialog(0);
- setupdialog.exec();
+ QString title = tr("How to Install For Command Line Use");
+ QString msg = tr(
+ "One may add CMake to the PATH:\n"
+ "\n"
+ " PATH=\"%1\":\"$PATH\"\n"
+ "\n"
+ "Or, to install symlinks to '/usr/bin', run:\n"
+ "\n"
+ " sudo \"%2\" --install\n"
+ "\n"
+ "Or, to install symlinks to another directory, run:\n"
+ "\n"
+ " sudo \"%3\" --install=/path/to/bin\n"
+ );
+ msg = msg.arg(cmSystemTools::GetFilenamePath(
+ cmSystemTools::GetCMakeCommand()).c_str());
+ msg = msg.arg(cmSystemTools::GetCMakeGUICommand().c_str());
+ msg = msg.arg(cmSystemTools::GetCMakeGUICommand().c_str());
+
+ QDialog dialog;
+ dialog.setWindowTitle(title);
+ QVBoxLayout* l = new QVBoxLayout(&dialog);
+ QLabel* lab = new QLabel(&dialog);
+ l->addWidget(lab);
+ lab->setText(msg);
+ lab->setWordWrap(false);
+ QDialogButtonBox* btns = new QDialogButtonBox(QDialogButtonBox::Ok,
+ Qt::Horizontal, &dialog);
+ QObject::connect(btns, SIGNAL(accepted()), &dialog, SLOT(accept()));
+ l->addWidget(btns);
+ dialog.exec();
}
bool CMakeSetupDialog::doGenerateInternal()