tristate KexiReportDesignView::afterSwitchFrom(Kexi::ViewMode mode)
{
    kDebug() << tempData()->document;
    if (tempData()->document.isEmpty()) {
        _rd = new ReportDesigner(this, KexiMainWindowIface::global()->project()->dbConnection());
    } else {
        if (_rd) {
            scr->takeWidget();
            delete _rd;
            _rd = 0;

        }
        _rd = new ReportDesigner(this, KexiMainWindowIface::global()->project()->dbConnection(), tempData()->document);
    }

    scr->setWidget(_rd);

    //plugSharedAction ( "edit_copy", _rd, SLOT ( slotEditCopy() ) );
    //plugSharedAction ( "edit_cut", _rd, SLOT ( slotEditCut() ) );
    //plugSharedAction ( "edit_paste", _rd, SLOT ( slotEditPaste() ) );
    //plugSharedAction ( "edit_delete", _rd, SLOT ( slotEditDelete() ) );

    connect(_rd, SIGNAL(propertySetChanged()), this, SLOT(slotDesignerPropertySetChanged()));
    connect(_rd, SIGNAL(dirty()), this, SLOT(setDirty()));

    //Edit Actions
    connect(editCutAction, SIGNAL(activated()), _rd, SLOT(slotEditCut()));
    connect(editCopyAction, SIGNAL(activated()), _rd, SLOT(slotEditCopy()));
    connect(editPasteAction, SIGNAL(activated()), _rd, SLOT(slotEditPaste()));
    connect(editDeleteAction, SIGNAL(activated()), _rd, SLOT(slotEditDelete()));

    connect(sectionEdit, SIGNAL(activated()), _rd, SLOT(slotSectionEditor()));

    //Control Actions
    connect(res->itemLabel, SIGNAL(clicked()), this, SLOT(slotLabel()));
    connect(res->itemField, SIGNAL(clicked()), this, SLOT(slotField()));
    connect(res->itemText, SIGNAL(clicked()), this, SLOT(slotText()));
    connect(res->itemLine, SIGNAL(clicked()), this, SLOT(slotLine()));
    connect(res->itemBarcode, SIGNAL(clicked()), this, SLOT(slotBarcode()));
    connect(res->itemChart, SIGNAL(clicked()),this, SLOT(slotChart()));
    connect(res->itemImage, SIGNAL(clicked()), this, SLOT(slotImage()));
    connect(res->itemShape, SIGNAL(clicked()), this, SLOT(slotShape()));
connect(res->itemCheck, SIGNAL(clicked()), this, SLOT(slotCheck()));

    //Raise/Lower
    connect(itemRaiseAction, SIGNAL(activated()), _rd, SLOT(slotRaiseSelected()));
    connect(itemLowerAction, SIGNAL(activated()), _rd, SLOT(slotLowerSelected()));
    return true;
}
void VideoJobManager::run()
{
    m_stop = false;
    int i = 1;
    int size = m_jobList.size();
    while (m_jobList.size() > 0)
    {
        if (m_stop)
        {
            qDebug() << "run killed";
            emit finished();
            break;
        }
        
        VideoJob v = m_jobList.first();
        m_currentJob = &v;
        
        connect(&v, SIGNAL(labelChanged(QString)), this, SLOT(slotLabel(QString)));
        connect(&v, SIGNAL(minimumChanged(int)), this, SLOT(slotMinimum(int)));
        connect(&v, SIGNAL(maximumChanged(int)), this, SLOT(slotMaximum(int)));
        connect(&v, SIGNAL(valueChanged(int)), this, SLOT(slotValue(int)));
        
        qDebug() << QString("Encoding item %1 of %2: ").arg(i).arg(size);
        emit labelChanged(tr("Encoding item %1 of %2: ").arg(i).arg(size));
        m_currentLabel = tr("Encoding item %1 of %2: ").arg(i).arg(size);
        if (v.run(m_ffmpeg))
        {
            m_jobList.takeFirst();
            i++;
        }
        else
        {
            qDebug() << QString("Error encoding item %1").arg(i);
            FileManager::deleteFile(v.getOutputFile());
            m_success = false;
            emit finished();
            break;
        }
        
    }
    qDebug() << "run ended";
    emit finished();
}
Exemple #3
0
tristate ReportDesignView::afterSwitchFrom ( ::ViewMode mode ) {
    kDebug(planDbg()) << tempData()->document;
    if ( tempData()->document.isEmpty() ) {
        _rd = new ReportDesigner ( this );
    } else {
        if ( _rd ) {
            scr->takeWidget();
            delete _rd;
            _rd = 0;
        }

        QDomDocument doc;
        doc.setContent ( tempData()->document );
        QDomElement root = doc.documentElement();
        QDomElement korep = root.firstChildElement( "koreport" );
        QDomElement conn = root.firstChildElement( "connection" );
        if ( !korep.isNull() ) {
            _rd = new ReportDesigner ( this, korep );
            if (!conn.isNull()) {
                srcsel->setConnectionData(conn);
            }
        } else {
            kDebug(planDbg()) << "no koreport section";

            //TODO remove...just create a blank document
            //Temp - allow load old style report definitions (no data)
            root.setTagName("koreport");
            _rd = new ReportDesigner ( this, root );
        }
    }

    scr->setWidget ( _rd );

    //plugSharedAction ( "edit_copy", _rd, SLOT(slotEditCopy()) );
    //plugSharedAction ( "edit_cut", _rd, SLOT(slotEditCut()) );
    //plugSharedAction ( "edit_paste", _rd, SLOT(slotEditPaste()) );
    //plugSharedAction ( "edit_delete", _rd, SLOT(slotEditDelete()) );

    connect ( _rd, SIGNAL(propertySetChanged()), this, SLOT(slotDesignerPropertySetChanged()) );
    connect ( _rd, SIGNAL(dirty()), this, SLOT(setDirty()) );

    //Edit Actions
    connect ( editCutAction, SIGNAL(activated()), _rd, SLOT(slotEditCut()) );
    connect ( editCopyAction, SIGNAL(activated()), _rd, SLOT(slotEditCopy()) );
    connect ( editPasteAction, SIGNAL(activated()), _rd, SLOT(slotEditPaste()) );
    connect ( editDeleteAction, SIGNAL(activated()), _rd, SLOT(slotEditDelete()) );

    connect ( sectionEdit, SIGNAL(activated()), _rd, SLOT(slotSectionEditor()) );

    //Control Actions
    connect ( res->itemLabel, SIGNAL(clicked()), this, SLOT(slotLabel()) );
    connect ( res->itemField, SIGNAL(clicked()), this, SLOT(slotField()) );
    connect ( res->itemText, SIGNAL(clicked()), this, SLOT(slotText()) );
    connect ( res->itemLine, SIGNAL(clicked()), this, SLOT(slotLine()) );
    connect ( res->itemBarcode, SIGNAL(clicked()), this, SLOT(slotBarcode()) );
    connect ( res->itemChart, SIGNAL(clicked()),this, SLOT(slotChart()) );
    connect ( res->itemImage, SIGNAL(clicked()), this, SLOT(slotImage()) );
    connect ( res->itemShape, SIGNAL(clicked()), this, SLOT(slotShape()) );
    connect ( res->itemCheck, SIGNAL(clicked()), this, SLOT(slotCheck()) );

    //Raise/Lower
    connect ( itemRaiseAction, SIGNAL(activated()), _rd, SLOT(slotRaiseSelected()) );
    connect ( itemLowerAction, SIGNAL(activated()), _rd, SLOT(slotLowerSelected()) );
    return true;
}