void QmlProject::addedRunConfiguration(ProjectExplorer::RunConfiguration *rc)
{
    // The enabled state of qml runconfigurations can only be decided after
    // they have been added to a project
    QmlProjectRunConfiguration *qmlrc = qobject_cast<QmlProjectRunConfiguration *>(rc);
    if (qmlrc)
        qmlrc->updateEnabled();
}
Esempio n. 2
0
ProjectExplorer::RunConfiguration *QmlProjectRunConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map)
{
    if (!canRestore(parent, map))
        return 0;
    QmlProjectTarget *qmlparent = static_cast<QmlProjectTarget *>(parent);
    QmlProjectRunConfiguration *rc = new QmlProjectRunConfiguration(qmlparent);
    if (rc->fromMap(map))
        return rc;
    delete rc;
    return 0;
}
bool QmlRunControlFactory::canRun(RunConfiguration *runConfiguration,
                                  const QString &mode) const
{
    QmlProjectRunConfiguration *config =
        qobject_cast<QmlProjectRunConfiguration*>(runConfiguration);
    if (mode == ProjectExplorer::Constants::RUNMODE)
        return config != 0 && !config->viewerPath().isEmpty();

    bool qmlDebugSupportInstalled =
        Debugger::DebuggerPlugin::isActiveDebugLanguage(Debugger::QmlLanguage);

    if (config && qmlDebugSupportInstalled) {
        if (!config->observerPath().isEmpty())
            return true;
        if (config->qtVersion() && Qt4ProjectManager::QmlObserverTool::canBuild(config->qtVersion()))
            return true;
    }

    return false;
}
Esempio n. 4
0
bool QmlProjectRunControlFactory::canRun(RunConfiguration *runConfiguration,
                                  const QString &mode) const
{
    QmlProjectRunConfiguration *config =
        qobject_cast<QmlProjectRunConfiguration*>(runConfiguration);
    if (!config)
        return false;
    if (mode == ProjectExplorer::Constants::RUNMODE)
        return !config->viewerPath().isEmpty();
    if (mode != Debugger::Constants::DEBUGMODE)
        return false;

    if (!Debugger::DebuggerPlugin::isActiveDebugLanguage(Debugger::QmlLanguage))
        return false;

    if (!config->observerPath().isEmpty())
        return true;
    if (!config->qtVersion())
        return false;
    if (!config->qtVersion()->needsQmlDebuggingLibrary())
        return true;
    if (QtSupport::QmlObserverTool::canBuild(config->qtVersion()))
        return true;
    return false;
}
bool QmlProjectRunControlFactory::canRun(RunConfiguration *runConfiguration,
                                         RunMode mode) const
{
    QmlProjectRunConfiguration *config =
        qobject_cast<QmlProjectRunConfiguration*>(runConfiguration);
    if (!config)
        return false;
    if (mode == NormalRunMode)
        return !config->viewerPath().isEmpty();
    if (mode != DebugRunMode)
        return false;

    if (!config->observerPath().isEmpty())
        return true;
    if (!config->qtVersion())
        return false;
    if (!config->qtVersion()->needsQmlDebuggingLibrary())
        return true;
    if (QtSupport::QmlObserverTool::canBuild(config->qtVersion()))
        return true;
    return false;
}