Add a generic variable chooser widget.

The chooser allows choosing variables from a list, and inserting them
into previously focused line edit, text edit, or plain text edit.
Variables are now registered with a description in the variable manager.
Also make the QT_INSTALL_BINS --> CurrentProject:QT_INSTALL_BINS for
consistency.
This commit is contained in:
con
2011-02-10 20:58:17 +01:00
parent 738d1ccec9
commit b40500a7bf
13 changed files with 329 additions and 22 deletions

View File

@@ -76,6 +76,8 @@ using ProjectExplorer::FormType;
using ProjectExplorer::ResourceType;
using ProjectExplorer::UnknownFileType;
static const char * const kInstallBins = "CurrentProject:QT_INSTALL_BINS";
// Known file types of a Qt 4 project
static const char* qt4FileTypes[] = {
"CppHeaderFiles",
@@ -134,7 +136,10 @@ void Qt4Manager::init()
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)),
this, SLOT(editorChanged(Core::IEditor*)));
connect(Core::VariableManager::instance(), SIGNAL(variableUpdateRequested(QString)),
Core::VariableManager *vm = Core::VariableManager::instance();
vm->registerVariable(QLatin1String(kInstallBins),
tr("Full path to the bin/ install directory of the current project's Qt version."));
connect(vm, SIGNAL(variableUpdateRequested(QString)),
this, SLOT(updateVariable(QString)));
}
@@ -179,7 +184,6 @@ void Qt4Manager::editorAboutToClose(Core::IEditor *editor)
void Qt4Manager::updateVariable(const QString &variable)
{
static const char * const kInstallBins = "QT_INSTALL_BINS";
if (variable == QLatin1String(kInstallBins)) {
Qt4Project *qt4pro = qobject_cast<Qt4Project *>(projectExplorer()->currentProject());
if (!qt4pro) {