Exemplo n.º 1
0
void
ViewModule::loadSelf()
{
    if ( m_loader )
    {
        PluginFactory* pf = qobject_cast< PluginFactory* >( m_loader->instance() );
        if ( !pf )
        {
            cDebug() << Q_FUNC_INFO << "No factory:" << m_loader->errorString();
            return;
        }

        m_viewStep = pf->create< Calamares::ViewStep >();
        if ( !m_viewStep )
        {
            cDebug() << Q_FUNC_INFO << "create() failed" << m_loader->errorString();
            return;
        }
//        cDebug() << "ViewModule loading self for instance" << instanceKey()
//                 << "\nViewModule at address" << this
//                 << "\nCalamares::PluginFactory at address" << pf
//                 << "\nViewStep at address" << m_viewStep;

        m_viewStep->setModuleInstanceKey( instanceKey() );
        m_viewStep->setConfigurationMap( m_configurationMap );
        ViewManager::instance()->addViewStep( m_viewStep );
        m_loaded = true;
        cDebug() << "ViewModule" << instanceKey() << "loading complete.";
    }
}
Exemplo n.º 2
0
void
ViewModule::loadSelf()
{
    if ( m_loader )
    {
        PluginFactory* pf = qobject_cast< PluginFactory* >( m_loader->instance() );
        if ( !pf )
        {
            cWarning() << Q_FUNC_INFO << "No factory:" << m_loader->errorString();
            return;
        }

        m_viewStep = pf->create< Calamares::ViewStep >();
        if ( !m_viewStep )
        {
            cWarning() << Q_FUNC_INFO << "create() failed" << m_loader->errorString();
            return;
        }
    }

    // TODO: allow internal view steps to be created here; they would
    //       have to be linked into the main application somehow.

    // If any method created the view step, use it now.
    if ( m_viewStep )
    {
        m_viewStep->setModuleInstanceKey( instanceKey() );
        m_viewStep->setConfigurationMap( m_configurationMap );
        ViewManager::instance()->addViewStep( m_viewStep );
        m_loaded = true;
        cDebug() << "ViewModule" << instanceKey() << "loading complete.";
    }
    else
        cWarning() << Q_FUNC_INFO << "No view step was created";
}