2010-05-20 15:47:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
|
|
|
|
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
|
|
|
**
|
|
|
|
|
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
|
|
|
**
|
|
|
|
|
** Commercial Usage
|
|
|
|
|
**
|
|
|
|
|
** Licensees holding valid Qt Commercial licenses may use this file in
|
|
|
|
|
** accordance with the Qt Commercial License Agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Nokia.
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
**
|
|
|
|
|
** If you are unsure which license is appropriate for your use, please
|
|
|
|
|
** contact the sales department at qt-sales@nokia.com.
|
|
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
#include "maemoqemumanager.h"
|
2010-05-20 15:47:42 +02:00
|
|
|
|
|
|
|
|
#include "maemorunconfiguration.h"
|
|
|
|
|
#include "maemotoolchain.h"
|
|
|
|
|
#include "qtversionmanager.h"
|
|
|
|
|
#include "qt4project.h"
|
|
|
|
|
#include "qt4projectmanagerconstants.h"
|
|
|
|
|
|
|
|
|
|
#include <coreplugin/actionmanager/actionmanager.h>
|
|
|
|
|
#include <coreplugin/actionmanager/command.h>
|
|
|
|
|
#include <coreplugin/coreconstants.h>
|
|
|
|
|
#include <coreplugin/icore.h>
|
2010-06-25 12:56:16 +02:00
|
|
|
#include <coreplugin/icontext.h>
|
2010-05-20 15:47:42 +02:00
|
|
|
#include <coreplugin/modemanager.h>
|
|
|
|
|
|
|
|
|
|
#include <projectexplorer/projectexplorer.h>
|
|
|
|
|
#include <projectexplorer/session.h>
|
|
|
|
|
|
|
|
|
|
#include <QtCore/QDir>
|
|
|
|
|
#include <QtCore/QList>
|
|
|
|
|
#include <QtCore/QSet>
|
2010-05-21 09:12:35 +02:00
|
|
|
#include <QtCore/QStringBuilder>
|
2010-05-20 15:47:42 +02:00
|
|
|
#include <QtCore/QTextStream>
|
|
|
|
|
|
|
|
|
|
#include <QtGui/QMessageBox>
|
2010-05-27 13:28:07 +02:00
|
|
|
#include <QtGui/QAction>
|
2010-05-20 15:47:42 +02:00
|
|
|
|
|
|
|
|
using namespace ProjectExplorer;
|
|
|
|
|
using namespace Qt4ProjectManager;
|
|
|
|
|
using namespace Qt4ProjectManager::Internal;
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
MaemoQemuManager *MaemoQemuManager::m_instance = 0;
|
2010-05-20 15:47:42 +02:00
|
|
|
|
|
|
|
|
const QSize iconSize = QSize(24, 20);
|
|
|
|
|
const QLatin1String binQmake("/bin/qmake" EXEC_SUFFIX);
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
MaemoQemuManager::MaemoQemuManager(QObject *parent)
|
2010-05-20 15:47:42 +02:00
|
|
|
: QObject(parent)
|
|
|
|
|
, m_qemuAction(0)
|
|
|
|
|
, m_qemuProcess(new QProcess(this))
|
|
|
|
|
, m_runningQtId(-1)
|
|
|
|
|
, m_needsSetup(true)
|
|
|
|
|
, m_userTerminated(false)
|
|
|
|
|
{
|
|
|
|
|
m_qemuStarterIcon.addFile(":/qt-maemo/images/qemu-run.png", iconSize);
|
|
|
|
|
m_qemuStarterIcon.addFile(":/qt-maemo/images/qemu-stop.png", iconSize,
|
|
|
|
|
QIcon::Normal, QIcon::On);
|
|
|
|
|
|
|
|
|
|
m_qemuAction = new QAction("Maemo Emulator", this);
|
|
|
|
|
m_qemuAction->setEnabled(false);
|
|
|
|
|
m_qemuAction->setVisible(false);
|
|
|
|
|
m_qemuAction->setIcon(m_qemuStarterIcon.pixmap(iconSize));
|
|
|
|
|
m_qemuAction->setToolTip(tr("Start Maemo Emulator"));
|
|
|
|
|
connect(m_qemuAction, SIGNAL(triggered()), this, SLOT(startRuntime()));
|
|
|
|
|
|
|
|
|
|
Core::ICore *core = Core::ICore::instance();
|
|
|
|
|
Core::ActionManager *actionManager = core->actionManager();
|
|
|
|
|
Core::Command *qemuCommand = actionManager->registerAction(m_qemuAction,
|
2010-06-28 14:30:03 +02:00
|
|
|
"MaemoEmulator", Core::Context(Core::Constants::C_GLOBAL));
|
2010-05-20 15:47:42 +02:00
|
|
|
qemuCommand->setAttribute(Core::Command::CA_UpdateText);
|
|
|
|
|
qemuCommand->setAttribute(Core::Command::CA_UpdateIcon);
|
|
|
|
|
|
|
|
|
|
Core::ModeManager *modeManager = core->modeManager();
|
|
|
|
|
modeManager->addAction(qemuCommand, 1);
|
|
|
|
|
|
|
|
|
|
// listen to qt version changes to update the start button
|
|
|
|
|
connect(QtVersionManager::instance(), SIGNAL(qtVersionsChanged(QList<int>)),
|
|
|
|
|
this, SLOT(qtVersionsChanged(QList<int>)));
|
|
|
|
|
|
|
|
|
|
// listen to project add, remove and startup changes to udate start button
|
|
|
|
|
SessionManager *session = ProjectExplorerPlugin::instance()->session();
|
|
|
|
|
connect(session, SIGNAL(projectAdded(ProjectExplorer::Project*)), this,
|
|
|
|
|
SLOT(projectAdded(ProjectExplorer::Project*)));
|
|
|
|
|
connect(session, SIGNAL(projectRemoved(ProjectExplorer::Project*)), this,
|
|
|
|
|
SLOT(projectRemoved(ProjectExplorer::Project*)));
|
|
|
|
|
connect(session, SIGNAL(startupProjectChanged(ProjectExplorer::Project*)),
|
|
|
|
|
this, SLOT(projectChanged(ProjectExplorer::Project*)));
|
|
|
|
|
|
|
|
|
|
connect(m_qemuProcess, SIGNAL(error(QProcess::ProcessError)), this,
|
|
|
|
|
SLOT(qemuProcessError(QProcess::ProcessError)));
|
|
|
|
|
connect(m_qemuProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this,
|
|
|
|
|
SLOT(qemuProcessFinished()));
|
2010-07-22 12:10:44 +02:00
|
|
|
connect(m_qemuProcess, SIGNAL(readyReadStandardOutput()), this,
|
|
|
|
|
SLOT(qemuOutput()));
|
|
|
|
|
connect(m_qemuProcess, SIGNAL(readyReadStandardError()), this,
|
|
|
|
|
SLOT(qemuOutput()));
|
2010-05-20 15:47:42 +02:00
|
|
|
connect(this, SIGNAL(qemuProcessStatus(QemuStatus, QString)),
|
|
|
|
|
this, SLOT(qemuStatusChanged(QemuStatus, QString)));
|
2010-08-18 16:33:11 +02:00
|
|
|
|
|
|
|
|
m_runtimeRootWatcher = new QFileSystemWatcher(this);
|
|
|
|
|
connect(m_runtimeRootWatcher, SIGNAL(directoryChanged(QString)), this,
|
|
|
|
|
SLOT(runtimeRootChanged(QString)));
|
|
|
|
|
m_runtimeFolderWatcher = new QFileSystemWatcher(this);
|
|
|
|
|
connect(m_runtimeFolderWatcher, SIGNAL(directoryChanged(QString)), this,
|
|
|
|
|
SLOT(runtimeFolderChanged(QString)));
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
MaemoQemuManager::~MaemoQemuManager()
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
terminateRuntime();
|
2010-05-25 13:43:16 +02:00
|
|
|
m_instance = 0;
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
MaemoQemuManager &MaemoQemuManager::instance(QObject *parent)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
2010-05-25 13:43:16 +02:00
|
|
|
if (m_instance == 0)
|
2010-07-28 09:36:30 +02:00
|
|
|
m_instance = new MaemoQemuManager(parent);
|
2010-05-20 15:47:42 +02:00
|
|
|
return *m_instance;
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
bool MaemoQemuManager::runtimeForQtVersion(int uniqueId, Runtime *rt) const
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
2010-08-18 16:33:11 +02:00
|
|
|
*rt = m_runtimes.value(uniqueId, Runtime());
|
|
|
|
|
return rt->isValid();
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::qtVersionsChanged(const QList<int> &uniqueIds)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
if (m_needsSetup)
|
|
|
|
|
setupRuntimes();
|
|
|
|
|
|
|
|
|
|
QtVersionManager *manager = QtVersionManager::instance();
|
|
|
|
|
foreach (int uniqueId, uniqueIds) {
|
|
|
|
|
if (manager->isValidId(uniqueId)) {
|
2010-08-18 16:33:11 +02:00
|
|
|
QtVersion *version = manager->version(uniqueId);
|
|
|
|
|
if (version->supportsTargetId(Constants::MAEMO_DEVICE_TARGET_ID)) {
|
|
|
|
|
const QString &qmake = version->qmakeCommand();
|
|
|
|
|
const QString &runtimeRoot = runtimeForQtVersion(qmake);
|
|
|
|
|
if (!runtimeRoot.isEmpty()) {
|
|
|
|
|
Runtime runtime(runtimeRoot);
|
|
|
|
|
if (QFile::exists(runtimeRoot))
|
|
|
|
|
fillRuntimeInformation(&runtime);
|
|
|
|
|
runtime.m_watchPath =
|
|
|
|
|
runtimeRoot.left(runtimeRoot.lastIndexOf(QLatin1Char('/')));
|
|
|
|
|
m_runtimes.insert(uniqueId, runtime);
|
|
|
|
|
if (!m_runtimeRootWatcher->directories().contains(runtime.m_watchPath))
|
|
|
|
|
m_runtimeRootWatcher->addPath(runtime.m_watchPath);
|
|
|
|
|
} else {
|
|
|
|
|
m_runtimes.remove(uniqueId);
|
|
|
|
|
}
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// this qt version has been removed from the settings
|
|
|
|
|
m_runtimes.remove(uniqueId);
|
|
|
|
|
if (uniqueId == m_runningQtId) {
|
|
|
|
|
terminateRuntime();
|
|
|
|
|
emit qemuProcessStatus(QemuUserReason, tr("Qemu has been shut "
|
|
|
|
|
"down, because you removed the corresponding Qt version."));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// make visible only if we have a runtime and a maemo target
|
|
|
|
|
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::projectAdded(ProjectExplorer::Project *project)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
// handle all target related changes, add, remove, etc...
|
|
|
|
|
connect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), this,
|
|
|
|
|
SLOT(targetAdded(ProjectExplorer::Target*)));
|
|
|
|
|
connect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)), this,
|
|
|
|
|
SLOT(targetRemoved(ProjectExplorer::Target*)));
|
|
|
|
|
connect(project, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),
|
|
|
|
|
this, SLOT(targetChanged(ProjectExplorer::Target*)));
|
|
|
|
|
|
|
|
|
|
foreach (Target *target, project->targets())
|
|
|
|
|
targetAdded(target);
|
|
|
|
|
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::projectRemoved(ProjectExplorer::Project *project)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
disconnect(project, SIGNAL(addedTarget(ProjectExplorer::Target*)), this,
|
|
|
|
|
SLOT(targetAdded(ProjectExplorer::Target*)));
|
|
|
|
|
disconnect(project, SIGNAL(removedTarget(ProjectExplorer::Target*)), this,
|
|
|
|
|
SLOT(targetRemoved(ProjectExplorer::Target*)));
|
|
|
|
|
disconnect(project, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),
|
|
|
|
|
this, SLOT(targetChanged(ProjectExplorer::Target*)));
|
|
|
|
|
|
|
|
|
|
foreach (Target *target, project->targets())
|
|
|
|
|
targetRemoved(target);
|
|
|
|
|
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::projectChanged(ProjectExplorer::Project *project)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
2010-07-16 17:09:05 +02:00
|
|
|
if (project) {
|
2010-06-21 13:25:34 +02:00
|
|
|
toggleStarterButton(project->activeTarget());
|
2010-07-16 17:09:05 +02:00
|
|
|
deviceConfigurationChanged(project->activeTarget());
|
|
|
|
|
}
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool targetIsMaemo(const QString &id)
|
|
|
|
|
{
|
|
|
|
|
return id == QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID);
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::targetAdded(ProjectExplorer::Target *target)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
if (!target || !targetIsMaemo(target->id()))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
// handle all run configuration changes, add, remove, etc...
|
|
|
|
|
connect(target, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration*)),
|
|
|
|
|
this, SLOT(runConfigurationAdded(ProjectExplorer::RunConfiguration*)));
|
|
|
|
|
connect(target, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration*)),
|
|
|
|
|
this, SLOT(runConfigurationRemoved(ProjectExplorer::RunConfiguration*)));
|
|
|
|
|
connect(target, SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)),
|
|
|
|
|
this, SLOT(runConfigurationChanged(ProjectExplorer::RunConfiguration*)));
|
|
|
|
|
|
|
|
|
|
// handle all build configuration changes, add, remove, etc...
|
|
|
|
|
connect(target, SIGNAL(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*)),
|
|
|
|
|
this, SLOT(buildConfigurationAdded(ProjectExplorer::BuildConfiguration*)));
|
|
|
|
|
connect(target, SIGNAL(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*)),
|
|
|
|
|
this, SLOT(buildConfigurationRemoved(ProjectExplorer::BuildConfiguration*)));
|
|
|
|
|
connect(target, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
|
|
|
|
this, SLOT(buildConfigurationChanged(ProjectExplorer::BuildConfiguration*)));
|
|
|
|
|
|
|
|
|
|
// handle the qt version changes the build configuration uses
|
|
|
|
|
connect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
|
|
|
|
|
|
2010-06-21 13:25:34 +02:00
|
|
|
foreach (RunConfiguration *rc, target->runConfigurations())
|
|
|
|
|
toggleDeviceConnections(qobject_cast<MaemoRunConfiguration*> (rc), true);
|
2010-05-20 15:47:42 +02:00
|
|
|
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::targetRemoved(ProjectExplorer::Target *target)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
if (!target || !targetIsMaemo(target->id()))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
disconnect(target, SIGNAL(addedRunConfiguration(ProjectExplorer::RunConfiguration*)),
|
|
|
|
|
this, SLOT(runConfigurationAdded(ProjectExplorer::RunConfiguration*)));
|
|
|
|
|
disconnect(target, SIGNAL(removedRunConfiguration(ProjectExplorer::RunConfiguration*)),
|
|
|
|
|
this, SLOT(runConfigurationRemoved(ProjectExplorer::RunConfiguration*)));
|
|
|
|
|
disconnect(target, SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)),
|
|
|
|
|
this, SLOT(runConfigurationChanged(ProjectExplorer::RunConfiguration*)));
|
|
|
|
|
|
|
|
|
|
disconnect(target, SIGNAL(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*)),
|
|
|
|
|
this, SLOT(buildConfigurationAdded(ProjectExplorer::BuildConfiguration*)));
|
|
|
|
|
disconnect(target, SIGNAL(removedBuildConfiguration(ProjectExplorer::BuildConfiguration*)),
|
|
|
|
|
this, SLOT(buildConfigurationRemoved(ProjectExplorer::BuildConfiguration*)));
|
|
|
|
|
disconnect(target, SIGNAL(activeBuildConfigurationChanged(ProjectExplorer::BuildConfiguration*)),
|
|
|
|
|
this, SLOT(buildConfigurationChanged(ProjectExplorer::BuildConfiguration*)));
|
|
|
|
|
|
|
|
|
|
disconnect(target, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
|
|
|
|
|
|
2010-06-21 13:25:34 +02:00
|
|
|
foreach (RunConfiguration *rc, target->runConfigurations())
|
|
|
|
|
toggleDeviceConnections(qobject_cast<MaemoRunConfiguration*> (rc), false);
|
2010-05-20 15:47:42 +02:00
|
|
|
m_qemuAction->setVisible(!m_runtimes.isEmpty() && sessionHasMaemoTarget());
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::targetChanged(ProjectExplorer::Target *target)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
2010-07-16 17:09:05 +02:00
|
|
|
if (target) {
|
2010-06-21 13:25:34 +02:00
|
|
|
toggleStarterButton(target);
|
2010-07-16 17:09:05 +02:00
|
|
|
deviceConfigurationChanged(target);
|
|
|
|
|
}
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::runConfigurationAdded(ProjectExplorer::RunConfiguration *rc)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
if (!rc || !targetIsMaemo(rc->target()->id()))
|
|
|
|
|
return;
|
2010-06-21 13:25:34 +02:00
|
|
|
toggleDeviceConnections(qobject_cast<MaemoRunConfiguration*> (rc), true);
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::runConfigurationRemoved(ProjectExplorer::RunConfiguration *rc)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
if (!rc || rc->target()->id() != QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID))
|
|
|
|
|
return;
|
2010-06-21 13:25:34 +02:00
|
|
|
toggleDeviceConnections(qobject_cast<MaemoRunConfiguration*> (rc), false);
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::runConfigurationChanged(ProjectExplorer::RunConfiguration *rc)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
if (rc)
|
2010-07-22 12:10:44 +02:00
|
|
|
m_qemuAction->setEnabled(targetUsesMatchingRuntimeConfig(rc->target()));
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::buildConfigurationAdded(ProjectExplorer::BuildConfiguration *bc)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
if (!bc || !targetIsMaemo(bc->target()->id()))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
connect(bc, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::buildConfigurationRemoved(ProjectExplorer::BuildConfiguration *bc)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
if (!bc || !targetIsMaemo(bc->target()->id()))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
disconnect(bc, SIGNAL(environmentChanged()), this, SLOT(environmentChanged()));
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::buildConfigurationChanged(ProjectExplorer::BuildConfiguration *bc)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
if (bc)
|
2010-06-21 13:25:34 +02:00
|
|
|
toggleStarterButton(bc->target());
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::environmentChanged()
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
// likely to happen when the qt version changes the build config is using
|
|
|
|
|
if (ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance()) {
|
|
|
|
|
if (Project *project = explorer->session()->startupProject())
|
2010-06-21 13:25:34 +02:00
|
|
|
toggleStarterButton(project->activeTarget());
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::deviceConfigurationChanged(ProjectExplorer::Target *target)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
2010-07-22 12:10:44 +02:00
|
|
|
m_qemuAction->setEnabled(targetUsesMatchingRuntimeConfig(target));
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::startRuntime()
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
m_userTerminated = false;
|
|
|
|
|
Project *p = ProjectExplorerPlugin::instance()->session()->startupProject();
|
|
|
|
|
if (!p)
|
|
|
|
|
return;
|
2010-07-22 12:10:44 +02:00
|
|
|
QtVersion *version;
|
|
|
|
|
if (!targetUsesMatchingRuntimeConfig(p->activeTarget(), &version)) {
|
|
|
|
|
qWarning("Strange: Qemu button was enabled, but target does not match.");
|
2010-05-20 15:47:42 +02:00
|
|
|
return;
|
2010-07-22 12:10:44 +02:00
|
|
|
}
|
2010-05-20 15:47:42 +02:00
|
|
|
|
2010-07-22 12:10:44 +02:00
|
|
|
m_runningQtId = version->uniqueId();
|
|
|
|
|
const QString root
|
|
|
|
|
= QDir::toNativeSeparators(maddeRoot(version->qmakeCommand())
|
2010-05-20 15:47:42 +02:00
|
|
|
+ QLatin1Char('/'));
|
2010-07-22 12:10:44 +02:00
|
|
|
const Runtime rt = m_runtimes.value(version->uniqueId());
|
|
|
|
|
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
2010-05-20 15:47:42 +02:00
|
|
|
#ifdef Q_OS_WIN
|
2010-07-22 12:10:44 +02:00
|
|
|
const QLatin1Char colon(';');
|
|
|
|
|
const QLatin1String key("PATH");
|
|
|
|
|
env.insert(key, env.value(key) % colon % root % QLatin1String("bin"));
|
|
|
|
|
env.insert(key, env.value(key) % colon % root % QLatin1String("madlib"));
|
2010-05-20 15:47:42 +02:00
|
|
|
#elif defined(Q_OS_UNIX)
|
2010-07-22 12:10:44 +02:00
|
|
|
const QLatin1String key("LD_LIBRARY_PATH");
|
|
|
|
|
env.insert(key, env.value(key) % QLatin1Char(':') % rt.m_libPath);
|
2010-05-20 15:47:42 +02:00
|
|
|
#endif
|
2010-07-22 12:10:44 +02:00
|
|
|
m_qemuProcess->setProcessEnvironment(env);
|
|
|
|
|
m_qemuProcess->setWorkingDirectory(rt.m_root);
|
2010-05-20 15:47:42 +02:00
|
|
|
|
2010-07-22 12:10:44 +02:00
|
|
|
// This is complex because of extreme MADDE weirdness.
|
|
|
|
|
const bool pathIsRelative = QFileInfo(rt.m_bin).isRelative();
|
|
|
|
|
const QString app =
|
2010-07-21 17:00:40 +02:00
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
|
root % (pathIsRelative
|
2010-06-17 15:57:08 +02:00
|
|
|
? QLatin1String("madlib/") % rt.m_bin // Fremantle.
|
|
|
|
|
: rt.m_bin) // Haramattan.
|
2010-07-21 17:00:40 +02:00
|
|
|
% QLatin1String(".exe");
|
|
|
|
|
#else
|
|
|
|
|
pathIsRelative
|
|
|
|
|
? root % QLatin1String("madlib/") % rt.m_bin // Fremantle.
|
|
|
|
|
: rt.m_bin; // Haramattan.
|
2010-05-20 15:47:42 +02:00
|
|
|
#endif
|
|
|
|
|
|
2010-07-22 12:10:44 +02:00
|
|
|
m_qemuProcess->start(app % QLatin1Char(' ') % rt.m_args,
|
|
|
|
|
QIODevice::ReadWrite);
|
|
|
|
|
if (!m_qemuProcess->waitForStarted())
|
|
|
|
|
return;
|
2010-06-17 15:57:08 +02:00
|
|
|
|
2010-07-22 12:10:44 +02:00
|
|
|
emit qemuProcessStatus(QemuStarting);
|
|
|
|
|
connect(m_qemuAction, SIGNAL(triggered()), this, SLOT(terminateRuntime()));
|
|
|
|
|
disconnect(m_qemuAction, SIGNAL(triggered()), this, SLOT(startRuntime()));
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::terminateRuntime()
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
m_userTerminated = true;
|
|
|
|
|
|
|
|
|
|
if (m_qemuProcess->state() != QProcess::NotRunning) {
|
|
|
|
|
m_qemuProcess->terminate();
|
|
|
|
|
m_qemuProcess->kill();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
connect(m_qemuAction, SIGNAL(triggered()), this, SLOT(startRuntime()));
|
|
|
|
|
disconnect(m_qemuAction, SIGNAL(triggered()), this, SLOT(terminateRuntime()));
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::qemuProcessFinished()
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
m_runningQtId = -1;
|
|
|
|
|
QemuStatus status = QemuFinished;
|
2010-07-22 12:10:44 +02:00
|
|
|
QString error;
|
2010-05-20 15:47:42 +02:00
|
|
|
|
|
|
|
|
if (!m_userTerminated) {
|
2010-07-22 12:10:44 +02:00
|
|
|
if (m_qemuProcess->exitStatus() == QProcess::CrashExit) {
|
|
|
|
|
status = QemuCrashed;
|
|
|
|
|
error = m_qemuProcess->errorString();
|
|
|
|
|
} else if (m_qemuProcess->exitCode() != 0) {
|
|
|
|
|
error = tr("Qemu finished with error: Exit code was %1.")
|
|
|
|
|
.arg(m_qemuProcess->exitCode());
|
|
|
|
|
}
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_userTerminated = false;
|
2010-07-22 12:10:44 +02:00
|
|
|
emit qemuProcessStatus(status, error);
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::qemuProcessError(QProcess::ProcessError error)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
if (error == QProcess::FailedToStart)
|
|
|
|
|
emit qemuProcessStatus(QemuFailedToStart, m_qemuProcess->errorString());
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::qemuStatusChanged(QemuStatus status, const QString &error)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
QString message;
|
|
|
|
|
bool running = false;
|
|
|
|
|
|
|
|
|
|
switch (status) {
|
|
|
|
|
case QemuStarting:
|
|
|
|
|
running = true;
|
|
|
|
|
break;
|
|
|
|
|
case QemuFailedToStart:
|
|
|
|
|
message = tr("Qemu failed to start: %1").arg(error);
|
|
|
|
|
break;
|
|
|
|
|
case QemuCrashed:
|
|
|
|
|
message = tr("Qemu crashed");
|
|
|
|
|
break;
|
|
|
|
|
case QemuFinished:
|
2010-07-22 12:10:44 +02:00
|
|
|
message = error;
|
2010-05-20 15:47:42 +02:00
|
|
|
break;
|
|
|
|
|
case QemuUserReason:
|
|
|
|
|
message = error;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
Q_ASSERT(!"Missing handling of Qemu status");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!message.isEmpty())
|
|
|
|
|
QMessageBox::warning(0, tr("Qemu error"), message);
|
|
|
|
|
updateStarterIcon(running);
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::qemuOutput()
|
2010-07-22 12:10:44 +02:00
|
|
|
{
|
|
|
|
|
qDebug("%s", m_qemuProcess->readAllStandardOutput().data());
|
|
|
|
|
qDebug("%s", m_qemuProcess->readAllStandardError().data());
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-18 16:33:11 +02:00
|
|
|
void MaemoQemuManager::runtimeRootChanged(const QString &directory)
|
|
|
|
|
{
|
|
|
|
|
QList<int> uniqueIds;
|
|
|
|
|
QMap<int, Runtime>::const_iterator it;
|
|
|
|
|
for (it = m_runtimes.constBegin(); it != m_runtimes.constEnd(); ++it) {
|
|
|
|
|
if (QDir(it.value().m_watchPath) == QDir(directory))
|
|
|
|
|
uniqueIds.append(it.key());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (int uniqueId, uniqueIds) {
|
|
|
|
|
Runtime runtime = m_runtimes.value(uniqueId, Runtime());
|
|
|
|
|
if (runtime.isValid()) {
|
|
|
|
|
if (QFile::exists(runtime.m_root)) {
|
|
|
|
|
// nothing changed, so we can remove it
|
|
|
|
|
uniqueIds.removeAll(uniqueId);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (QFile::exists(runtime.m_root)) {
|
|
|
|
|
if (!QFile::exists(runtime.m_root + QLatin1String("/information"))) {
|
|
|
|
|
// install might be still in progress
|
|
|
|
|
uniqueIds.removeAll(uniqueId);
|
|
|
|
|
m_runtimeFolderWatcher->addPath(runtime.m_root);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
notify(uniqueIds);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MaemoQemuManager::runtimeFolderChanged(const QString &directory)
|
|
|
|
|
{
|
|
|
|
|
if (QFile::exists(directory + QLatin1String("/information"))) {
|
|
|
|
|
QList<int> uniqueIds;
|
|
|
|
|
QMap<int, Runtime>::const_iterator it;
|
|
|
|
|
for (it = m_runtimes.constBegin(); it != m_runtimes.constEnd(); ++it) {
|
|
|
|
|
if (QDir(it.value().m_root) == QDir(directory))
|
|
|
|
|
uniqueIds.append(it.key());
|
|
|
|
|
}
|
|
|
|
|
notify(uniqueIds);
|
|
|
|
|
m_runtimeFolderWatcher->removePath(directory);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-20 15:47:42 +02:00
|
|
|
// -- private
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::setupRuntimes()
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
m_needsSetup = false;
|
|
|
|
|
|
|
|
|
|
const QList<QtVersion*> &versions = QtVersionManager::instance()
|
|
|
|
|
->versionsForTargetId(Constants::MAEMO_DEVICE_TARGET_ID);
|
|
|
|
|
|
|
|
|
|
QList<int> uniqueIds;
|
|
|
|
|
foreach (QtVersion *version, versions)
|
|
|
|
|
uniqueIds.append(version->uniqueId());
|
|
|
|
|
qtVersionsChanged(uniqueIds);
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::updateStarterIcon(bool running)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
QIcon::State state;
|
|
|
|
|
QString toolTip;
|
|
|
|
|
if (running) {
|
|
|
|
|
state = QIcon::On;
|
|
|
|
|
toolTip = tr("Stop Maemo Emulator");
|
|
|
|
|
} else {
|
|
|
|
|
state = QIcon::Off;
|
|
|
|
|
toolTip = tr("Start Maemo Emulator");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_qemuAction->setToolTip(toolTip);
|
|
|
|
|
m_qemuAction->setIcon(m_qemuStarterIcon.pixmap(iconSize, QIcon::Normal,
|
|
|
|
|
state));
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::toggleStarterButton(Target *target)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
if (m_needsSetup)
|
|
|
|
|
setupRuntimes();
|
|
|
|
|
|
|
|
|
|
int uniqueId = -1;
|
|
|
|
|
if (target) {
|
|
|
|
|
if (Qt4Target *qt4Target = qobject_cast<Qt4Target*>(target)) {
|
|
|
|
|
if (Qt4BuildConfiguration *bc = qt4Target->activeBuildConfiguration()) {
|
|
|
|
|
if (QtVersion *version = bc->qtVersion())
|
|
|
|
|
uniqueId = version->uniqueId();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool isRunning = m_qemuProcess->state() != QProcess::NotRunning;
|
|
|
|
|
if (m_runningQtId == uniqueId)
|
|
|
|
|
isRunning = false;
|
|
|
|
|
|
2010-08-18 16:33:11 +02:00
|
|
|
m_qemuAction->setEnabled(m_runtimes.value(uniqueId, Runtime()).isValid()
|
2010-07-22 12:10:44 +02:00
|
|
|
&& targetUsesMatchingRuntimeConfig(target) && !isRunning);
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
bool MaemoQemuManager::sessionHasMaemoTarget() const
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
bool result = false;
|
|
|
|
|
ProjectExplorerPlugin *explorer = ProjectExplorerPlugin::instance();
|
|
|
|
|
const QList<Project*> &projects = explorer->session()->projects();
|
|
|
|
|
foreach (const Project *p, projects)
|
|
|
|
|
result |= p->target(QLatin1String(Constants::MAEMO_DEVICE_TARGET_ID)) != 0;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
bool MaemoQemuManager::targetUsesMatchingRuntimeConfig(Target *target,
|
2010-07-22 12:10:44 +02:00
|
|
|
QtVersion **qtVersion)
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
if (!target)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
MaemoRunConfiguration *mrc =
|
|
|
|
|
qobject_cast<MaemoRunConfiguration *> (target->activeRunConfiguration());
|
2010-07-21 17:00:40 +02:00
|
|
|
if (!mrc)
|
|
|
|
|
return false;
|
|
|
|
|
Qt4BuildConfiguration *bc
|
|
|
|
|
= qobject_cast<Qt4BuildConfiguration *>(target->activeBuildConfiguration());
|
|
|
|
|
if (!bc)
|
|
|
|
|
return false;
|
|
|
|
|
QtVersion *version = bc->qtVersion();
|
2010-08-18 16:33:11 +02:00
|
|
|
if (!version || !m_runtimes.value(version->uniqueId(), Runtime()).isValid())
|
2010-07-21 17:00:40 +02:00
|
|
|
return false;
|
|
|
|
|
|
2010-07-22 12:10:44 +02:00
|
|
|
if (qtVersion)
|
|
|
|
|
*qtVersion = version;
|
2010-07-21 17:00:40 +02:00
|
|
|
const MaemoDeviceConfig &config = mrc->deviceConfig();
|
|
|
|
|
return config.isValid() && config.type == MaemoDeviceConfig::Simulator;
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
QString MaemoQemuManager::maddeRoot(const QString &qmake) const
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
QDir dir(QDir::cleanPath(qmake).remove(binQmake));
|
|
|
|
|
dir.cdUp(); dir.cdUp();
|
|
|
|
|
return dir.absolutePath();
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
QString MaemoQemuManager::targetRoot(const QString &qmake) const
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
const QString target = QDir::cleanPath(qmake).remove(binQmake);
|
|
|
|
|
return target.mid(target.lastIndexOf(QLatin1Char('/')) + 1);
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
bool MaemoQemuManager::fillRuntimeInformation(Runtime *runtime) const
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
const QStringList files = QDir(runtime->m_root).entryList(QDir::Files
|
|
|
|
|
| QDir::NoSymLinks | QDir::NoDotAndDotDot);
|
|
|
|
|
|
2010-08-18 16:33:11 +02:00
|
|
|
// we need at least the information file
|
2010-05-20 15:47:42 +02:00
|
|
|
const QLatin1String infoFile("information");
|
2010-08-18 16:33:11 +02:00
|
|
|
if (files.contains(infoFile)) {
|
2010-05-20 15:47:42 +02:00
|
|
|
QFile file(runtime->m_root + QLatin1Char('/') + infoFile);
|
|
|
|
|
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
|
|
|
|
QMap<QString, QString> map;
|
|
|
|
|
QTextStream stream(&file);
|
|
|
|
|
while (!stream.atEnd()) {
|
|
|
|
|
const QString &line = stream.readLine().trimmed();
|
|
|
|
|
const int index = line.indexOf(QLatin1Char('='));
|
|
|
|
|
map.insert(line.mid(0, index).remove(QLatin1Char('\'')),
|
|
|
|
|
line.mid(index + 1).remove(QLatin1Char('\'')));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
runtime->m_bin = map.value(QLatin1String("qemu"));
|
|
|
|
|
runtime->m_args = map.value(QLatin1String("qemu_args"));
|
|
|
|
|
const QString &libPathSpec = map.value(QLatin1String("libpath"));
|
|
|
|
|
runtime->m_libPath =
|
|
|
|
|
libPathSpec.mid(libPathSpec.indexOf(QLatin1Char('=')) + 1);
|
|
|
|
|
runtime->m_sshPort = map.value(QLatin1String("sshport"));
|
2010-08-13 15:25:22 +02:00
|
|
|
runtime->m_freePorts = MaemoPortList();
|
|
|
|
|
int i = 2;
|
|
|
|
|
while (true) {
|
|
|
|
|
const QString port = map.value(QLatin1String("redirport")
|
|
|
|
|
+ QString::number(i++));
|
|
|
|
|
if (port.isEmpty())
|
|
|
|
|
break;
|
|
|
|
|
runtime->m_freePorts.addPort(port.toInt());
|
|
|
|
|
}
|
2010-05-20 15:47:42 +02:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
QString MaemoQemuManager::runtimeForQtVersion(const QString &qmakeCommand) const
|
2010-05-20 15:47:42 +02:00
|
|
|
{
|
|
|
|
|
const QString &target = targetRoot(qmakeCommand);
|
|
|
|
|
const QString &madRoot = maddeRoot(qmakeCommand);
|
|
|
|
|
|
|
|
|
|
QFile file(madRoot + QLatin1String("/cache/madde.conf"));
|
|
|
|
|
if (file.exists() && file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
|
|
|
|
QTextStream stream(&file);
|
|
|
|
|
while (!stream.atEnd()) {
|
|
|
|
|
QString line = stream.readLine().trimmed();
|
|
|
|
|
if (!line.startsWith(QLatin1String("target")))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
const QStringList &list = line.split(QLatin1Char(' '));
|
|
|
|
|
if (list.count() <= 1 || list.at(1) != target)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
line = stream.readLine().trimmed();
|
|
|
|
|
while (!stream.atEnd() && line != QLatin1String("end")) {
|
|
|
|
|
if (line.startsWith(QLatin1String("runtime"))) {
|
|
|
|
|
const QStringList &list = line.split(QLatin1Char(' '));
|
|
|
|
|
if (list.count() > 1) {
|
2010-08-18 16:33:11 +02:00
|
|
|
return QDir::fromNativeSeparators(madRoot
|
|
|
|
|
+ QLatin1String("/runtimes/") + list.at(1).trimmed());
|
2010-05-20 15:47:42 +02:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
line = stream.readLine().trimmed();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return QString();
|
|
|
|
|
}
|
2010-06-21 13:25:34 +02:00
|
|
|
|
2010-08-18 16:33:11 +02:00
|
|
|
void MaemoQemuManager::notify(const QList<int> uniqueIds)
|
|
|
|
|
{
|
|
|
|
|
qtVersionsChanged(uniqueIds);
|
|
|
|
|
environmentChanged(); // to toggle the start button
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-28 09:36:30 +02:00
|
|
|
void MaemoQemuManager::toggleDeviceConnections(MaemoRunConfiguration *mrc,
|
2010-06-21 13:25:34 +02:00
|
|
|
bool _connect)
|
|
|
|
|
{
|
|
|
|
|
if (!mrc)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (_connect) { // handle device configuration changes
|
|
|
|
|
connect(mrc, SIGNAL(deviceConfigurationChanged(ProjectExplorer::Target*)),
|
|
|
|
|
this, SLOT(deviceConfigurationChanged(ProjectExplorer::Target*)));
|
|
|
|
|
} else {
|
|
|
|
|
disconnect(mrc, SIGNAL(deviceConfigurationChanged(ProjectExplorer::Target*)),
|
|
|
|
|
this, SLOT(deviceConfigurationChanged(ProjectExplorer::Target*)));
|
|
|
|
|
}
|
|
|
|
|
}
|