parent
a9bf98b2a6
commit
8e8acb7aab
|
@ -34,7 +34,7 @@
|
||||||
#include "FirstConfigure.h"
|
#include "FirstConfigure.h"
|
||||||
#include "cmVersion.h"
|
#include "cmVersion.h"
|
||||||
|
|
||||||
QCMakeThread::QCMakeThread(QObject* p)
|
QCMakeThread::QCMakeThread(QObject* p)
|
||||||
: QThread(p), CMakeInstance(NULL)
|
: QThread(p), CMakeInstance(NULL)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -76,7 +76,7 @@ CMakeSetupDialog::CMakeSetupDialog()
|
||||||
this->ProgressBar->reset();
|
this->ProgressBar->reset();
|
||||||
this->RemoveEntry->setEnabled(false);
|
this->RemoveEntry->setEnabled(false);
|
||||||
this->AddEntry->setEnabled(false);
|
this->AddEntry->setEnabled(false);
|
||||||
|
|
||||||
QByteArray p = settings.value("SplitterSizes").toByteArray();
|
QByteArray p = settings.value("SplitterSizes").toByteArray();
|
||||||
this->Splitter->restoreState(p);
|
this->Splitter->restoreState(p);
|
||||||
|
|
||||||
|
@ -86,48 +86,48 @@ CMakeSetupDialog::CMakeSetupDialog()
|
||||||
|
|
||||||
QMenu* FileMenu = this->menuBar()->addMenu(tr("&File"));
|
QMenu* FileMenu = this->menuBar()->addMenu(tr("&File"));
|
||||||
this->ReloadCacheAction = FileMenu->addAction(tr("&Reload Cache"));
|
this->ReloadCacheAction = FileMenu->addAction(tr("&Reload Cache"));
|
||||||
QObject::connect(this->ReloadCacheAction, SIGNAL(triggered(bool)),
|
QObject::connect(this->ReloadCacheAction, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(doReloadCache()));
|
this, SLOT(doReloadCache()));
|
||||||
this->DeleteCacheAction = FileMenu->addAction(tr("&Delete Cache"));
|
this->DeleteCacheAction = FileMenu->addAction(tr("&Delete Cache"));
|
||||||
QObject::connect(this->DeleteCacheAction, SIGNAL(triggered(bool)),
|
QObject::connect(this->DeleteCacheAction, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(doDeleteCache()));
|
this, SLOT(doDeleteCache()));
|
||||||
this->ExitAction = FileMenu->addAction(tr("E&xit"));
|
this->ExitAction = FileMenu->addAction(tr("E&xit"));
|
||||||
QObject::connect(this->ExitAction, SIGNAL(triggered(bool)),
|
QObject::connect(this->ExitAction, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(close()));
|
this, SLOT(close()));
|
||||||
|
|
||||||
QMenu* ToolsMenu = this->menuBar()->addMenu(tr("&Tools"));
|
QMenu* ToolsMenu = this->menuBar()->addMenu(tr("&Tools"));
|
||||||
this->ConfigureAction = ToolsMenu->addAction(tr("&Configure"));
|
this->ConfigureAction = ToolsMenu->addAction(tr("&Configure"));
|
||||||
// prevent merging with Preferences menu item on Mac OS X
|
// prevent merging with Preferences menu item on Mac OS X
|
||||||
this->ConfigureAction->setMenuRole(QAction::NoRole);
|
this->ConfigureAction->setMenuRole(QAction::NoRole);
|
||||||
QObject::connect(this->ConfigureAction, SIGNAL(triggered(bool)),
|
QObject::connect(this->ConfigureAction, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(doConfigure()));
|
this, SLOT(doConfigure()));
|
||||||
this->GenerateAction = ToolsMenu->addAction(tr("&Generate"));
|
this->GenerateAction = ToolsMenu->addAction(tr("&Generate"));
|
||||||
QObject::connect(this->GenerateAction, SIGNAL(triggered(bool)),
|
QObject::connect(this->GenerateAction, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(doGenerate()));
|
this, SLOT(doGenerate()));
|
||||||
QAction* showChangesAction = ToolsMenu->addAction(tr("&Show My Changes"));
|
QAction* showChangesAction = ToolsMenu->addAction(tr("&Show My Changes"));
|
||||||
QObject::connect(showChangesAction, SIGNAL(triggered(bool)),
|
QObject::connect(showChangesAction, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(showUserChanges()));
|
this, SLOT(showUserChanges()));
|
||||||
#if defined(Q_WS_MAC)
|
#if defined(Q_WS_MAC)
|
||||||
this->InstallForCommandLineAction
|
this->InstallForCommandLineAction
|
||||||
= ToolsMenu->addAction(tr("&Install For Command Line Use"));
|
= ToolsMenu->addAction(tr("&Install For Command Line Use"));
|
||||||
QObject::connect(this->InstallForCommandLineAction, SIGNAL(triggered(bool)),
|
QObject::connect(this->InstallForCommandLineAction, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(doInstallForCommandLine()));
|
this, SLOT(doInstallForCommandLine()));
|
||||||
#endif
|
#endif
|
||||||
QMenu* OptionsMenu = this->menuBar()->addMenu(tr("&Options"));
|
QMenu* OptionsMenu = this->menuBar()->addMenu(tr("&Options"));
|
||||||
this->SuppressDevWarningsAction = OptionsMenu->addAction(tr("&Suppress dev Warnings (-Wno-dev)"));
|
this->SuppressDevWarningsAction = OptionsMenu->addAction(tr("&Suppress dev Warnings (-Wno-dev)"));
|
||||||
this->SuppressDevWarningsAction->setCheckable(true);
|
this->SuppressDevWarningsAction->setCheckable(true);
|
||||||
|
|
||||||
QAction* debugAction = OptionsMenu->addAction(tr("&Debug Output"));
|
QAction* debugAction = OptionsMenu->addAction(tr("&Debug Output"));
|
||||||
debugAction->setCheckable(true);
|
debugAction->setCheckable(true);
|
||||||
QObject::connect(debugAction, SIGNAL(toggled(bool)),
|
QObject::connect(debugAction, SIGNAL(toggled(bool)),
|
||||||
this, SLOT(setDebugOutput(bool)));
|
this, SLOT(setDebugOutput(bool)));
|
||||||
|
|
||||||
OptionsMenu->addSeparator();
|
OptionsMenu->addSeparator();
|
||||||
QAction* expandAction = OptionsMenu->addAction(tr("&Expand Grouped Entries"));
|
QAction* expandAction = OptionsMenu->addAction(tr("&Expand Grouped Entries"));
|
||||||
QObject::connect(expandAction, SIGNAL(triggered(bool)),
|
QObject::connect(expandAction, SIGNAL(triggered(bool)),
|
||||||
this->CacheValues, SLOT(expandAll()));
|
this->CacheValues, SLOT(expandAll()));
|
||||||
QAction* collapseAction = OptionsMenu->addAction(tr("&Collapse Grouped Entries"));
|
QAction* collapseAction = OptionsMenu->addAction(tr("&Collapse Grouped Entries"));
|
||||||
QObject::connect(collapseAction, SIGNAL(triggered(bool)),
|
QObject::connect(collapseAction, SIGNAL(triggered(bool)),
|
||||||
this->CacheValues, SLOT(collapseAll()));
|
this->CacheValues, SLOT(collapseAll()));
|
||||||
|
|
||||||
QMenu* HelpMenu = this->menuBar()->addMenu(tr("&Help"));
|
QMenu* HelpMenu = this->menuBar()->addMenu(tr("&Help"));
|
||||||
|
@ -137,17 +137,17 @@ CMakeSetupDialog::CMakeSetupDialog()
|
||||||
a = HelpMenu->addAction(tr("Help"));
|
a = HelpMenu->addAction(tr("Help"));
|
||||||
QObject::connect(a, SIGNAL(triggered(bool)),
|
QObject::connect(a, SIGNAL(triggered(bool)),
|
||||||
this, SLOT(doHelp()));
|
this, SLOT(doHelp()));
|
||||||
|
|
||||||
QShortcut* filterShortcut = new QShortcut(QKeySequence::Find, this);
|
QShortcut* filterShortcut = new QShortcut(QKeySequence::Find, this);
|
||||||
QObject::connect(filterShortcut, SIGNAL(activated()),
|
QObject::connect(filterShortcut, SIGNAL(activated()),
|
||||||
this, SLOT(startSearch()));
|
this, SLOT(startSearch()));
|
||||||
|
|
||||||
this->setAcceptDrops(true);
|
this->setAcceptDrops(true);
|
||||||
|
|
||||||
// get the saved binary directories
|
// get the saved binary directories
|
||||||
QStringList buildPaths = this->loadBuildPaths();
|
QStringList buildPaths = this->loadBuildPaths();
|
||||||
this->BinaryDirectory->addItems(buildPaths);
|
this->BinaryDirectory->addItems(buildPaths);
|
||||||
|
|
||||||
this->BinaryDirectory->setCompleter(new QCMakeFileCompleter(this, true));
|
this->BinaryDirectory->setCompleter(new QCMakeFileCompleter(this, true));
|
||||||
this->SourceDirectory->setCompleter(new QCMakeFileCompleter(this, true));
|
this->SourceDirectory->setCompleter(new QCMakeFileCompleter(this, true));
|
||||||
|
|
||||||
|
@ -159,23 +159,23 @@ CMakeSetupDialog::CMakeSetupDialog()
|
||||||
// start the cmake worker thread
|
// start the cmake worker thread
|
||||||
this->CMakeThread = new QCMakeThread(this);
|
this->CMakeThread = new QCMakeThread(this);
|
||||||
QObject::connect(this->CMakeThread, SIGNAL(cmakeInitialized()),
|
QObject::connect(this->CMakeThread, SIGNAL(cmakeInitialized()),
|
||||||
this, SLOT(initialize()), Qt::QueuedConnection);
|
this, SLOT(initialize()), Qt::QueuedConnection);
|
||||||
this->CMakeThread->start();
|
this->CMakeThread->start();
|
||||||
|
|
||||||
this->enterState(ReadyConfigure);
|
this->enterState(ReadyConfigure);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeSetupDialog::initialize()
|
void CMakeSetupDialog::initialize()
|
||||||
{
|
{
|
||||||
// now the cmake worker thread is running, lets make our connections to it
|
// now the cmake worker thread is running, lets make our connections to it
|
||||||
QObject::connect(this->CMakeThread->cmakeInstance(),
|
QObject::connect(this->CMakeThread->cmakeInstance(),
|
||||||
SIGNAL(propertiesChanged(const QCMakePropertyList&)),
|
SIGNAL(propertiesChanged(const QCMakePropertyList&)),
|
||||||
this->CacheValues->cacheModel(),
|
this->CacheValues->cacheModel(),
|
||||||
SLOT(setProperties(const QCMakePropertyList&)));
|
SLOT(setProperties(const QCMakePropertyList&)));
|
||||||
|
|
||||||
QObject::connect(this->ConfigureButton, SIGNAL(clicked(bool)),
|
QObject::connect(this->ConfigureButton, SIGNAL(clicked(bool)),
|
||||||
this, SLOT(doConfigure()));
|
this, SLOT(doConfigure()));
|
||||||
QObject::connect(this->CMakeThread->cmakeInstance(),
|
QObject::connect(this->CMakeThread->cmakeInstance(),
|
||||||
SIGNAL(configureDone(int)),
|
SIGNAL(configureDone(int)),
|
||||||
this, SLOT(finishConfigure(int)));
|
this, SLOT(finishConfigure(int)));
|
||||||
QObject::connect(this->CMakeThread->cmakeInstance(),
|
QObject::connect(this->CMakeThread->cmakeInstance(),
|
||||||
|
@ -184,12 +184,12 @@ void CMakeSetupDialog::initialize()
|
||||||
|
|
||||||
QObject::connect(this->GenerateButton, SIGNAL(clicked(bool)),
|
QObject::connect(this->GenerateButton, SIGNAL(clicked(bool)),
|
||||||
this, SLOT(doGenerate()));
|
this, SLOT(doGenerate()));
|
||||||
|
|
||||||
QObject::connect(this->BrowseSourceDirectoryButton, SIGNAL(clicked(bool)),
|
QObject::connect(this->BrowseSourceDirectoryButton, SIGNAL(clicked(bool)),
|
||||||
this, SLOT(doSourceBrowse()));
|
this, SLOT(doSourceBrowse()));
|
||||||
QObject::connect(this->BrowseBinaryDirectoryButton, SIGNAL(clicked(bool)),
|
QObject::connect(this->BrowseBinaryDirectoryButton, SIGNAL(clicked(bool)),
|
||||||
this, SLOT(doBinaryBrowse()));
|
this, SLOT(doBinaryBrowse()));
|
||||||
|
|
||||||
QObject::connect(this->BinaryDirectory, SIGNAL(editTextChanged(QString)),
|
QObject::connect(this->BinaryDirectory, SIGNAL(editTextChanged(QString)),
|
||||||
this, SLOT(onBinaryDirectoryChanged(QString)));
|
this, SLOT(onBinaryDirectoryChanged(QString)));
|
||||||
QObject::connect(this->SourceDirectory, SIGNAL(textChanged(QString)),
|
QObject::connect(this->SourceDirectory, SIGNAL(textChanged(QString)),
|
||||||
|
@ -201,11 +201,11 @@ void CMakeSetupDialog::initialize()
|
||||||
QObject::connect(this->CMakeThread->cmakeInstance(),
|
QObject::connect(this->CMakeThread->cmakeInstance(),
|
||||||
SIGNAL(binaryDirChanged(QString)),
|
SIGNAL(binaryDirChanged(QString)),
|
||||||
this, SLOT(updateBinaryDirectory(QString)));
|
this, SLOT(updateBinaryDirectory(QString)));
|
||||||
|
|
||||||
QObject::connect(this->CMakeThread->cmakeInstance(),
|
QObject::connect(this->CMakeThread->cmakeInstance(),
|
||||||
SIGNAL(progressChanged(QString, float)),
|
SIGNAL(progressChanged(QString, float)),
|
||||||
this, SLOT(showProgress(QString,float)));
|
this, SLOT(showProgress(QString,float)));
|
||||||
|
|
||||||
QObject::connect(this->CMakeThread->cmakeInstance(),
|
QObject::connect(this->CMakeThread->cmakeInstance(),
|
||||||
SIGNAL(errorMessage(QString)),
|
SIGNAL(errorMessage(QString)),
|
||||||
this, SLOT(error(QString)));
|
this, SLOT(error(QString)));
|
||||||
|
@ -218,29 +218,29 @@ void CMakeSetupDialog::initialize()
|
||||||
this, SLOT(setGroupedView(bool)));
|
this, SLOT(setGroupedView(bool)));
|
||||||
QObject::connect(this->advancedCheck, SIGNAL(toggled(bool)),
|
QObject::connect(this->advancedCheck, SIGNAL(toggled(bool)),
|
||||||
this, SLOT(setAdvancedView(bool)));
|
this, SLOT(setAdvancedView(bool)));
|
||||||
QObject::connect(this->Search, SIGNAL(textChanged(QString)),
|
QObject::connect(this->Search, SIGNAL(textChanged(QString)),
|
||||||
this, SLOT(setSearchFilter(QString)));
|
this, SLOT(setSearchFilter(QString)));
|
||||||
|
|
||||||
QObject::connect(this->CMakeThread->cmakeInstance(),
|
QObject::connect(this->CMakeThread->cmakeInstance(),
|
||||||
SIGNAL(generatorChanged(QString)),
|
SIGNAL(generatorChanged(QString)),
|
||||||
this, SLOT(updateGeneratorLabel(QString)));
|
this, SLOT(updateGeneratorLabel(QString)));
|
||||||
this->updateGeneratorLabel(QString());
|
this->updateGeneratorLabel(QString());
|
||||||
|
|
||||||
QObject::connect(this->CacheValues->cacheModel(),
|
QObject::connect(this->CacheValues->cacheModel(),
|
||||||
SIGNAL(dataChanged(QModelIndex,QModelIndex)),
|
SIGNAL(dataChanged(QModelIndex,QModelIndex)),
|
||||||
this, SLOT(setCacheModified()));
|
this, SLOT(setCacheModified()));
|
||||||
|
|
||||||
QObject::connect(this->CacheValues->selectionModel(),
|
QObject::connect(this->CacheValues->selectionModel(),
|
||||||
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
|
||||||
this, SLOT(selectionChanged()));
|
this, SLOT(selectionChanged()));
|
||||||
QObject::connect(this->RemoveEntry, SIGNAL(clicked(bool)),
|
QObject::connect(this->RemoveEntry, SIGNAL(clicked(bool)),
|
||||||
this, SLOT(removeSelectedCacheEntries()));
|
this, SLOT(removeSelectedCacheEntries()));
|
||||||
QObject::connect(this->AddEntry, SIGNAL(clicked(bool)),
|
QObject::connect(this->AddEntry, SIGNAL(clicked(bool)),
|
||||||
this, SLOT(addCacheEntry()));
|
this, SLOT(addCacheEntry()));
|
||||||
|
|
||||||
QObject::connect(this->SuppressDevWarningsAction, SIGNAL(triggered(bool)),
|
QObject::connect(this->SuppressDevWarningsAction, SIGNAL(triggered(bool)),
|
||||||
this->CMakeThread->cmakeInstance(), SLOT(setSuppressDevWarnings(bool)));
|
this->CMakeThread->cmakeInstance(), SLOT(setSuppressDevWarnings(bool)));
|
||||||
|
|
||||||
if(!this->SourceDirectory->text().isEmpty() ||
|
if(!this->SourceDirectory->text().isEmpty() ||
|
||||||
!this->BinaryDirectory->lineEdit()->text().isEmpty())
|
!this->BinaryDirectory->lineEdit()->text().isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -265,7 +265,7 @@ CMakeSetupDialog::~CMakeSetupDialog()
|
||||||
this->CMakeThread->quit();
|
this->CMakeThread->quit();
|
||||||
this->CMakeThread->wait(2000);
|
this->CMakeThread->wait(2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeSetupDialog::doConfigure()
|
void CMakeSetupDialog::doConfigure()
|
||||||
{
|
{
|
||||||
if(this->CurrentState == Configuring)
|
if(this->CurrentState == Configuring)
|
||||||
|
@ -287,7 +287,7 @@ void CMakeSetupDialog::doConfigure()
|
||||||
msg += bindir;
|
msg += bindir;
|
||||||
QString title = tr("Create Directory");
|
QString title = tr("Create Directory");
|
||||||
QMessageBox::StandardButton btn;
|
QMessageBox::StandardButton btn;
|
||||||
btn = QMessageBox::information(this, title, msg,
|
btn = QMessageBox::information(this, title, msg,
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
if(btn == QMessageBox::No)
|
if(btn == QMessageBox::No)
|
||||||
{
|
{
|
||||||
|
@ -295,8 +295,8 @@ void CMakeSetupDialog::doConfigure()
|
||||||
}
|
}
|
||||||
if(!dir.mkpath("."))
|
if(!dir.mkpath("."))
|
||||||
{
|
{
|
||||||
QMessageBox::information(this, tr("Create Directory Failed"),
|
QMessageBox::information(this, tr("Create Directory Failed"),
|
||||||
QString(tr("Failed to create directory %1")).arg(dir.path()),
|
QString(tr("Failed to create directory %1")).arg(dir.path()),
|
||||||
QMessageBox::Ok);
|
QMessageBox::Ok);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -314,12 +314,12 @@ void CMakeSetupDialog::doConfigure()
|
||||||
|
|
||||||
// remember path
|
// remember path
|
||||||
this->addBinaryPath(dir.absolutePath());
|
this->addBinaryPath(dir.absolutePath());
|
||||||
|
|
||||||
this->enterState(Configuring);
|
this->enterState(Configuring);
|
||||||
|
|
||||||
this->CacheValues->selectionModel()->clear();
|
this->CacheValues->selectionModel()->clear();
|
||||||
QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
|
QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
|
||||||
"setProperties", Qt::QueuedConnection,
|
"setProperties", Qt::QueuedConnection,
|
||||||
Q_ARG(QCMakePropertyList,
|
Q_ARG(QCMakePropertyList,
|
||||||
this->CacheValues->cacheModel()->properties()));
|
this->CacheValues->cacheModel()->properties()));
|
||||||
QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
|
QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
|
||||||
|
@ -337,11 +337,11 @@ void CMakeSetupDialog::finishConfigure(int err)
|
||||||
this->enterState(ReadyConfigure);
|
this->enterState(ReadyConfigure);
|
||||||
this->CacheValues->scrollToTop();
|
this->CacheValues->scrollToTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(err != 0)
|
if(err != 0)
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, tr("Error"),
|
QMessageBox::critical(this, tr("Error"),
|
||||||
tr("Error in configuration process, project files may be invalid"),
|
tr("Error in configuration process, project files may be invalid"),
|
||||||
QMessageBox::Ok);
|
QMessageBox::Ok);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -351,7 +351,7 @@ void CMakeSetupDialog::finishGenerate(int err)
|
||||||
this->enterState(ReadyConfigure);
|
this->enterState(ReadyConfigure);
|
||||||
if(err != 0)
|
if(err != 0)
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, tr("Error"),
|
QMessageBox::critical(this, tr("Error"),
|
||||||
tr("Error in generation process, project files may be invalid"),
|
tr("Error in generation process, project files may be invalid"),
|
||||||
QMessageBox::Ok);
|
QMessageBox::Ok);
|
||||||
}
|
}
|
||||||
|
@ -375,7 +375,7 @@ void CMakeSetupDialog::doGenerate()
|
||||||
QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
|
QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
|
||||||
"generate", Qt::QueuedConnection);
|
"generate", Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeSetupDialog::closeEvent(QCloseEvent* e)
|
void CMakeSetupDialog::closeEvent(QCloseEvent* e)
|
||||||
{
|
{
|
||||||
// prompt for close if there are unsaved changes, and we're not busy
|
// prompt for close if there are unsaved changes, and we're not busy
|
||||||
|
@ -466,7 +466,7 @@ void CMakeSetupDialog::doInterrupt()
|
||||||
|
|
||||||
void CMakeSetupDialog::doSourceBrowse()
|
void CMakeSetupDialog::doSourceBrowse()
|
||||||
{
|
{
|
||||||
QString dir = QFileDialog::getExistingDirectory(this,
|
QString dir = QFileDialog::getExistingDirectory(this,
|
||||||
tr("Enter Path to Source"), this->SourceDirectory->text());
|
tr("Enter Path to Source"), this->SourceDirectory->text());
|
||||||
if(!dir.isEmpty())
|
if(!dir.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -496,7 +496,7 @@ void CMakeSetupDialog::updateBinaryDirectory(const QString& dir)
|
||||||
|
|
||||||
void CMakeSetupDialog::doBinaryBrowse()
|
void CMakeSetupDialog::doBinaryBrowse()
|
||||||
{
|
{
|
||||||
QString dir = QFileDialog::getExistingDirectory(this,
|
QString dir = QFileDialog::getExistingDirectory(this,
|
||||||
tr("Enter Path to Build"), this->BinaryDirectory->currentText());
|
tr("Enter Path to Build"), this->BinaryDirectory->currentText());
|
||||||
if(!dir.isEmpty() && dir != this->BinaryDirectory->currentText())
|
if(!dir.isEmpty() && dir != this->BinaryDirectory->currentText())
|
||||||
{
|
{
|
||||||
|
@ -585,7 +585,7 @@ bool CMakeSetupDialog::setupFirstConfigure()
|
||||||
{
|
{
|
||||||
dialog.saveToSettings();
|
dialog.saveToSettings();
|
||||||
this->CMakeThread->cmakeInstance()->setGenerator(dialog.getGenerator());
|
this->CMakeThread->cmakeInstance()->setGenerator(dialog.getGenerator());
|
||||||
|
|
||||||
QCMakeCacheModel* m = this->CacheValues->cacheModel();
|
QCMakeCacheModel* m = this->CacheValues->cacheModel();
|
||||||
|
|
||||||
if(dialog.compilerSetup())
|
if(dialog.compilerSetup())
|
||||||
|
@ -593,20 +593,20 @@ bool CMakeSetupDialog::setupFirstConfigure()
|
||||||
QString fortranCompiler = dialog.getFortranCompiler();
|
QString fortranCompiler = dialog.getFortranCompiler();
|
||||||
if(!fortranCompiler.isEmpty())
|
if(!fortranCompiler.isEmpty())
|
||||||
{
|
{
|
||||||
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER",
|
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER",
|
||||||
"Fortran compiler.", fortranCompiler, false);
|
"Fortran compiler.", fortranCompiler, false);
|
||||||
}
|
}
|
||||||
QString cxxCompiler = dialog.getCXXCompiler();
|
QString cxxCompiler = dialog.getCXXCompiler();
|
||||||
if(!cxxCompiler.isEmpty())
|
if(!cxxCompiler.isEmpty())
|
||||||
{
|
{
|
||||||
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER",
|
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER",
|
||||||
"CXX compiler.", cxxCompiler, false);
|
"CXX compiler.", cxxCompiler, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString cCompiler = dialog.getCCompiler();
|
QString cCompiler = dialog.getCCompiler();
|
||||||
if(!cCompiler.isEmpty())
|
if(!cCompiler.isEmpty())
|
||||||
{
|
{
|
||||||
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER",
|
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER",
|
||||||
"C compiler.", cCompiler, false);
|
"C compiler.", cCompiler, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -615,38 +615,38 @@ bool CMakeSetupDialog::setupFirstConfigure()
|
||||||
QString fortranCompiler = dialog.getFortranCompiler();
|
QString fortranCompiler = dialog.getFortranCompiler();
|
||||||
if(!fortranCompiler.isEmpty())
|
if(!fortranCompiler.isEmpty())
|
||||||
{
|
{
|
||||||
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER",
|
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER",
|
||||||
"Fortran compiler.", fortranCompiler, false);
|
"Fortran compiler.", fortranCompiler, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString mode = dialog.getCrossIncludeMode();
|
QString mode = dialog.getCrossIncludeMode();
|
||||||
m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE",
|
m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE",
|
||||||
"CMake Find Include Mode", mode, false);
|
"CMake Find Include Mode", mode, false);
|
||||||
mode = dialog.getCrossLibraryMode();
|
mode = dialog.getCrossLibraryMode();
|
||||||
m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY",
|
m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY",
|
||||||
"CMake Find Library Mode", mode, false);
|
"CMake Find Library Mode", mode, false);
|
||||||
mode = dialog.getCrossProgramMode();
|
mode = dialog.getCrossProgramMode();
|
||||||
m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM",
|
m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM",
|
||||||
"CMake Find Program Mode", mode, false);
|
"CMake Find Program Mode", mode, false);
|
||||||
|
|
||||||
QString rootPath = dialog.getCrossRoot();
|
QString rootPath = dialog.getCrossRoot();
|
||||||
m->insertProperty(QCMakeProperty::PATH, "CMAKE_FIND_ROOT_PATH",
|
m->insertProperty(QCMakeProperty::PATH, "CMAKE_FIND_ROOT_PATH",
|
||||||
"CMake Find Root Path", rootPath, false);
|
"CMake Find Root Path", rootPath, false);
|
||||||
|
|
||||||
QString systemName = dialog.getSystemName();
|
QString systemName = dialog.getSystemName();
|
||||||
m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_NAME",
|
m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_NAME",
|
||||||
"CMake System Name", systemName, false);
|
"CMake System Name", systemName, false);
|
||||||
QString cxxCompiler = dialog.getCXXCompiler();
|
QString cxxCompiler = dialog.getCXXCompiler();
|
||||||
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER",
|
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER",
|
||||||
"CXX compiler.", cxxCompiler, false);
|
"CXX compiler.", cxxCompiler, false);
|
||||||
QString cCompiler = dialog.getCCompiler();
|
QString cCompiler = dialog.getCCompiler();
|
||||||
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER",
|
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER",
|
||||||
"C compiler.", cCompiler, false);
|
"C compiler.", cCompiler, false);
|
||||||
}
|
}
|
||||||
else if(dialog.crossCompilerToolChainFile())
|
else if(dialog.crossCompilerToolChainFile())
|
||||||
{
|
{
|
||||||
QString toolchainFile = dialog.getCrossCompilerToolChainFile();
|
QString toolchainFile = dialog.getCrossCompilerToolChainFile();
|
||||||
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE",
|
m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE",
|
||||||
"Cross Compile ToolChain File", toolchainFile, false);
|
"Cross Compile ToolChain File", toolchainFile, false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -676,11 +676,11 @@ void CMakeSetupDialog::doReloadCache()
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeSetupDialog::doDeleteCache()
|
void CMakeSetupDialog::doDeleteCache()
|
||||||
{
|
{
|
||||||
QString title = tr("Delete Cache");
|
QString title = tr("Delete Cache");
|
||||||
QString msg = "Are you sure you want to delete the cache?";
|
QString msg = "Are you sure you want to delete the cache?";
|
||||||
QMessageBox::StandardButton btn;
|
QMessageBox::StandardButton btn;
|
||||||
btn = QMessageBox::information(this, title, msg,
|
btn = QMessageBox::information(this, title, msg,
|
||||||
QMessageBox::Yes | QMessageBox::No);
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
if(btn == QMessageBox::No)
|
if(btn == QMessageBox::No)
|
||||||
{
|
{
|
||||||
|
@ -721,7 +721,7 @@ void CMakeSetupDialog::setExitAfterGenerate(bool b)
|
||||||
void CMakeSetupDialog::addBinaryPath(const QString& path)
|
void CMakeSetupDialog::addBinaryPath(const QString& path)
|
||||||
{
|
{
|
||||||
QString cleanpath = QDir::cleanPath(path);
|
QString cleanpath = QDir::cleanPath(path);
|
||||||
|
|
||||||
// update UI
|
// update UI
|
||||||
this->BinaryDirectory->blockSignals(true);
|
this->BinaryDirectory->blockSignals(true);
|
||||||
int idx = this->BinaryDirectory->findText(cleanpath);
|
int idx = this->BinaryDirectory->findText(cleanpath);
|
||||||
|
@ -732,7 +732,7 @@ void CMakeSetupDialog::addBinaryPath(const QString& path)
|
||||||
this->BinaryDirectory->insertItem(0, cleanpath);
|
this->BinaryDirectory->insertItem(0, cleanpath);
|
||||||
this->BinaryDirectory->setCurrentIndex(0);
|
this->BinaryDirectory->setCurrentIndex(0);
|
||||||
this->BinaryDirectory->blockSignals(false);
|
this->BinaryDirectory->blockSignals(false);
|
||||||
|
|
||||||
// save to registry
|
// save to registry
|
||||||
QStringList buildPaths = this->loadBuildPaths();
|
QStringList buildPaths = this->loadBuildPaths();
|
||||||
buildPaths.removeAll(cleanpath);
|
buildPaths.removeAll(cleanpath);
|
||||||
|
@ -742,7 +742,7 @@ void CMakeSetupDialog::addBinaryPath(const QString& path)
|
||||||
|
|
||||||
void CMakeSetupDialog::dragEnterEvent(QDragEnterEvent* e)
|
void CMakeSetupDialog::dragEnterEvent(QDragEnterEvent* e)
|
||||||
{
|
{
|
||||||
if(!(this->CurrentState == ReadyConfigure ||
|
if(!(this->CurrentState == ReadyConfigure ||
|
||||||
this->CurrentState == ReadyGenerate))
|
this->CurrentState == ReadyGenerate))
|
||||||
{
|
{
|
||||||
e->ignore();
|
e->ignore();
|
||||||
|
@ -752,7 +752,7 @@ void CMakeSetupDialog::dragEnterEvent(QDragEnterEvent* e)
|
||||||
const QMimeData* dat = e->mimeData();
|
const QMimeData* dat = e->mimeData();
|
||||||
QList<QUrl> urls = dat->urls();
|
QList<QUrl> urls = dat->urls();
|
||||||
QString file = urls.count() ? urls[0].toLocalFile() : QString();
|
QString file = urls.count() ? urls[0].toLocalFile() : QString();
|
||||||
if(!file.isEmpty() &&
|
if(!file.isEmpty() &&
|
||||||
(file.endsWith("CMakeCache.txt", Qt::CaseInsensitive) ||
|
(file.endsWith("CMakeCache.txt", Qt::CaseInsensitive) ||
|
||||||
file.endsWith("CMakeLists.txt", Qt::CaseInsensitive) ) )
|
file.endsWith("CMakeLists.txt", Qt::CaseInsensitive) ) )
|
||||||
{
|
{
|
||||||
|
@ -766,7 +766,7 @@ void CMakeSetupDialog::dragEnterEvent(QDragEnterEvent* e)
|
||||||
|
|
||||||
void CMakeSetupDialog::dropEvent(QDropEvent* e)
|
void CMakeSetupDialog::dropEvent(QDropEvent* e)
|
||||||
{
|
{
|
||||||
if(!(this->CurrentState == ReadyConfigure ||
|
if(!(this->CurrentState == ReadyConfigure ||
|
||||||
this->CurrentState == ReadyGenerate))
|
this->CurrentState == ReadyGenerate))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -801,7 +801,7 @@ QStringList CMakeSetupDialog::loadBuildPaths()
|
||||||
|
|
||||||
QStringList buildPaths;
|
QStringList buildPaths;
|
||||||
for(int i=0; i<10; i++)
|
for(int i=0; i<10; i++)
|
||||||
{
|
{
|
||||||
QString p = settings.value(QString("WhereBuild%1").arg(i)).toString();
|
QString p = settings.value(QString("WhereBuild%1").arg(i)).toString();
|
||||||
if(!p.isEmpty())
|
if(!p.isEmpty())
|
||||||
{
|
{
|
||||||
|
@ -823,11 +823,11 @@ void CMakeSetupDialog::saveBuildPaths(const QStringList& paths)
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i=0; i<num; i++)
|
for(int i=0; i<num; i++)
|
||||||
{
|
{
|
||||||
settings.setValue(QString("WhereBuild%1").arg(i), paths[i]);
|
settings.setValue(QString("WhereBuild%1").arg(i), paths[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeSetupDialog::setCacheModified()
|
void CMakeSetupDialog::setCacheModified()
|
||||||
{
|
{
|
||||||
this->CacheModified = true;
|
this->CacheModified = true;
|
||||||
|
@ -851,8 +851,8 @@ void CMakeSetupDialog::removeSelectedCacheEntries()
|
||||||
void CMakeSetupDialog::selectionChanged()
|
void CMakeSetupDialog::selectionChanged()
|
||||||
{
|
{
|
||||||
QModelIndexList idxs = this->CacheValues->selectionModel()->selectedRows();
|
QModelIndexList idxs = this->CacheValues->selectionModel()->selectedRows();
|
||||||
if(idxs.count() &&
|
if(idxs.count() &&
|
||||||
(this->CurrentState == ReadyConfigure ||
|
(this->CurrentState == ReadyConfigure ||
|
||||||
this->CurrentState == ReadyGenerate) )
|
this->CurrentState == ReadyGenerate) )
|
||||||
{
|
{
|
||||||
this->RemoveEntry->setEnabled(true);
|
this->RemoveEntry->setEnabled(true);
|
||||||
|
@ -862,7 +862,7 @@ void CMakeSetupDialog::selectionChanged()
|
||||||
this->RemoveEntry->setEnabled(false);
|
this->RemoveEntry->setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeSetupDialog::enterState(CMakeSetupDialog::State s)
|
void CMakeSetupDialog::enterState(CMakeSetupDialog::State s)
|
||||||
{
|
{
|
||||||
if(s == this->CurrentState)
|
if(s == this->CurrentState)
|
||||||
|
@ -953,11 +953,11 @@ void CMakeSetupDialog::setGroupedView(bool v)
|
||||||
{
|
{
|
||||||
this->CacheValues->cacheModel()->setViewType(v ? QCMakeCacheModel::GroupView : QCMakeCacheModel::FlatView);
|
this->CacheValues->cacheModel()->setViewType(v ? QCMakeCacheModel::GroupView : QCMakeCacheModel::FlatView);
|
||||||
this->CacheValues->setRootIsDecorated(v);
|
this->CacheValues->setRootIsDecorated(v);
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
settings.beginGroup("Settings/StartPath");
|
settings.beginGroup("Settings/StartPath");
|
||||||
settings.setValue("GroupView", v);
|
settings.setValue("GroupView", v);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeSetupDialog::setAdvancedView(bool v)
|
void CMakeSetupDialog::setAdvancedView(bool v)
|
||||||
|
@ -984,7 +984,7 @@ void CMakeSetupDialog::showUserChanges()
|
||||||
|
|
||||||
QString command;
|
QString command;
|
||||||
QString cache;
|
QString cache;
|
||||||
|
|
||||||
foreach(QCMakeProperty prop, changes)
|
foreach(QCMakeProperty prop, changes)
|
||||||
{
|
{
|
||||||
QString type;
|
QString type;
|
||||||
|
@ -1020,13 +1020,13 @@ void CMakeSetupDialog::showUserChanges()
|
||||||
command += QString("-D%1\"%2\" ").arg(line).arg(value);
|
command += QString("-D%1\"%2\" ").arg(line).arg(value);
|
||||||
cache += QString("%1%2\n").arg(line).arg(value);
|
cache += QString("%1%2\n").arg(line).arg(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
textedit->append(tr("Commandline options:"));
|
textedit->append(tr("Commandline options:"));
|
||||||
textedit->append(command);
|
textedit->append(command);
|
||||||
textedit->append("\n");
|
textedit->append("\n");
|
||||||
textedit->append(tr("Cache file:"));
|
textedit->append(tr("Cache file:"));
|
||||||
textedit->append(cache);
|
textedit->append(cache);
|
||||||
|
|
||||||
dialog.exec();
|
dialog.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue