[cmake-commits] clinton committed CMakeSetup.cxx 1.15 1.16
CMakeSetupDialog.cxx 1.34 1.35 CMakeSetupDialog.h 1.19 1.20
QCMake.cxx 1.16 1.17 QCMakeCacheView.cxx 1.24 1.25
cmake-commits at cmake.org
cmake-commits at cmake.org
Thu Feb 14 18:18:13 EST 2008
Update of /cvsroot/CMake/CMake/Source/QtDialog
In directory public:/mounts/ram/cvs-serv29667
Modified Files:
CMakeSetup.cxx CMakeSetupDialog.cxx CMakeSetupDialog.h
QCMake.cxx QCMakeCacheView.cxx
Log Message:
ENH: Add shortcut to start search/filter.
A bit of cleanup.
Disable tab navigation in cache variable list.
Enable home/end keys.
BUG: Ensure currently edited values are saved before doing configure.
Index: QCMakeCacheView.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/QCMakeCacheView.cxx,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- QCMakeCacheView.cxx 13 Feb 2008 18:58:35 -0000 1.24
+++ QCMakeCacheView.cxx 14 Feb 2008 23:18:10 -0000 1.25
@@ -75,6 +75,9 @@
QAbstractItemView::EditKeyPressed |
QAbstractItemView::AnyKeyPressed);
+ // tab, backtab doesn't step through items
+ this->setTabKeyNavigation(false);
+
// set up headers and sizes
int h = 0;
QFontMetrics met(this->font());
@@ -105,33 +108,14 @@
QModelIndex QCMakeCacheView::moveCursor(CursorAction act,
Qt::KeyboardModifiers mod)
{
- // tab through values only (not names)
- QModelIndex current = this->currentIndex();
- if(act == MoveNext)
+ // want home/end to go to begin/end of rows, not columns
+ if(act == MoveHome)
{
- if(!current.isValid())
- {
- return this->model()->index(0, 1);
- }
- else if(current.column() == 0)
- {
- return this->model()->index(current.row(), 1);
- }
- else
- {
- return this->model()->index(current.row()+1, 1);
- }
+ return this->model()->index(0, 1);
}
- else if(act == MovePrevious)
+ else if(act == MoveEnd)
{
- if(!current.isValid())
- {
- return this->model()->index(0, 1);
- }
- else
- {
- return this->model()->index(current.row()-1, 1);
- }
+ return this->model()->index(this->model()->rowCount()-1, 1);
}
return QTableView::moveCursor(act, mod);
}
Index: CMakeSetupDialog.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/CMakeSetupDialog.cxx,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- CMakeSetupDialog.cxx 14 Feb 2008 20:06:05 -0000 1.34
+++ CMakeSetupDialog.cxx 14 Feb 2008 23:18:10 -0000 1.35
@@ -32,6 +32,7 @@
#include <QDragEnterEvent>
#include <QMimeData>
#include <QUrl>
+#include <QShortcut>
#include "QCMake.h"
#include "QCMakeCacheView.h"
@@ -96,6 +97,7 @@
this->GenerateAction = ToolsMenu->addAction(tr("&Generate"));
QObject::connect(this->GenerateAction, SIGNAL(triggered(bool)),
this, SLOT(doGenerate()));
+
QMenu* HelpMenu = this->menuBar()->addMenu(tr("&Help"));
QAction* a = HelpMenu->addAction(tr("About"));
@@ -105,6 +107,10 @@
QObject::connect(a, SIGNAL(triggered(bool)),
this, SLOT(doHelp()));
+ QShortcut* filterShortcut = new QShortcut(QKeySequence::Find, this);
+ QObject::connect(filterShortcut, SIGNAL(activated()),
+ this, SLOT(startSearch()));
+
this->setAcceptDrops(true);
// get the saved binary directories
@@ -266,6 +272,7 @@
this->enterState(Configuring);
this->Output->clear();
+ this->CacheValues->selectionModel()->clear();
QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(),
"setProperties", Qt::QueuedConnection,
Q_ARG(QCMakeCachePropertyList,
@@ -829,3 +836,10 @@
}
}
+void CMakeSetupDialog::startSearch()
+{
+ this->Search->setFocus(Qt::OtherFocusReason);
+ this->Search->selectAll();
+}
+
+
Index: CMakeSetupDialog.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/CMakeSetupDialog.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- CMakeSetupDialog.h 14 Feb 2008 20:06:05 -0000 1.19
+++ CMakeSetupDialog.h 14 Feb 2008 23:18:10 -0000 1.20
@@ -71,6 +71,7 @@
void removeSelectedCacheEntries();
void selectionChanged();
void addCacheEntry();
+ void startSearch();
protected:
Index: CMakeSetup.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/CMakeSetup.cxx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- CMakeSetup.cxx 12 Feb 2008 14:49:42 -0000 1.15
+++ CMakeSetup.cxx 14 Feb 2008 23:18:10 -0000 1.16
@@ -23,7 +23,6 @@
#include "CMakeSetupDialog.h"
#include "cmDocumentation.h"
-#include "cmSystemTools.h"
#include "cmake.h"
#include "cmVersion.h"
#include <cmsys/CommandLineArguments.hxx>
@@ -73,7 +72,6 @@
#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;
Index: QCMake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/QtDialog/QCMake.cxx,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- QCMake.cxx 14 Feb 2008 13:55:29 -0000 1.16
+++ QCMake.cxx 14 Feb 2008 23:18:10 -0000 1.17
@@ -31,22 +31,27 @@
qRegisterMetaType<QCMakeCacheProperty>();
qRegisterMetaType<QCMakeCachePropertyList>();
- QDir appDir(QCoreApplication::applicationDirPath());
-#if defined(Q_OS_WIN)
- this->CMakeExecutable = appDir.filePath("cmake.exe");
-#elif defined(Q_OS_MAC)
- appDir.cd("../../../"); // path to cmake in build directory (need to fix for deployment)
- this->CMakeExecutable = appDir.filePath("cmake");
-#else
- this->CMakeExecutable = appDir.filePath("cmake");
+ QDir execDir(QCoreApplication::applicationDirPath());
+
+ QString cmakeGUICommand = QString("cmake-gui")+cmSystemTools::GetExecutableExtension();
+ cmakeGUICommand = execDir.filePath(cmakeGUICommand);
+
+#if defined(Q_OS_MAC)
+ execDir.cd("../../../"); // path to cmake in build directory (need to fix for deployment)
#endif
- // TODO: check for existence?
+
+ QString cmakeCommand = QString("cmake")+cmSystemTools::GetExecutableExtension();
+ cmakeCommand = execDir.filePath(cmakeCommand);
+
cmSystemTools::DisableRunCommandOutput();
cmSystemTools::SetRunCommandHideConsole(true);
cmSystemTools::SetErrorCallback(QCMake::errorCallback, this);
+ cmSystemTools::FindExecutableDirectory(cmakeCommand.toAscii().data());
this->CMakeInstance = new cmake;
+ this->CMakeInstance->SetCMakeCommand(cmakeCommand.toAscii().data());
+ //this->CMakeInstance->SetCMakeEditCommand(cmakeGUICommand.toAscii().data());
this->CMakeInstance->SetCMakeEditCommand("cmake-gui");
this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this);
@@ -131,7 +136,6 @@
this->CMakeInstance->SetStartOutputDirectory(this->BinaryDirectory.toAscii().data());
this->CMakeInstance->SetGlobalGenerator(
this->CMakeInstance->CreateGlobalGenerator(this->Generator.toAscii().data()));
- this->CMakeInstance->SetCMakeCommand(this->CMakeExecutable.toAscii().data());
this->CMakeInstance->LoadCache();
this->CMakeInstance->PreLoadCMakeFiles();
More information about the Cmake-commits
mailing list