Example #1
0
bool TupProject::resetScene(int pos, const QString &newName)
{
    #ifdef K_DEBUG
        #ifdef Q_OS_WIN
            qDebug() << "[TupProject::resetScene()]";
        #else
            T_FUNCINFO;
        #endif
    #endif
   
    TupScene *scene = sceneAt(pos);
    if (scene) {
        k->undoScenes << k->scenes.takeAt(pos);

        TupScene *basic = new TupScene(this, k->dimension, "#ffffff");
        basic->setSceneName(newName);
        basic->setBasicStructure();
        k->scenes.insert(pos, basic);

        return true;
    } else {
        #ifdef K_DEBUG
            QString msg = "TupProject::resetScene() - No scene at index -> " + QString::number(pos);
            #ifdef Q_OS_WIN
                qDebug() << msg;
            #else
                tError() << msg;
            #endif
        #endif
    }

    return false;
}
Example #2
0
bool TupCommandExecutor::renameScene(TupSceneResponse *response)
{
    int position = response->sceneIndex();
    QString newName = response->arg().toString();
    TupScene *scene = m_project->scene(position);

    if (!scene)
        return false;
    
    // TupProjectRequest request = TupRequestBuilder::createSceneRequest(position, TupProjectRequest::Rename, newName);
    
    scene->setSceneName(newName);
    
    emit responsed(response);

    return true;
}
Example #3
0
TupScene *TupProject::createScene(QString name, int position, bool loaded)
{
    #ifdef K_DEBUG
        #ifdef Q_OS_WIN
            qDebug() << "[TupProject::createScene()]";
        #else
            T_FUNCINFO;
        #endif
    #endif

    if (position < 0 || position > k->scenes.count())
        return 0;

    TupScene *scene = new TupScene(this, k->dimension, k->bgColor);
    k->scenes.insert(position, scene);
    k->sceneCounter++;
    scene->setSceneName(name);
    
    if (loaded)
        TupProjectLoader::createScene(scene->sceneName(), position, this);

    return scene;
}