Commit 04ca6f33 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Solved bug when closing rendering window.

The number of frame is now printed in the dialog.
parent cb56d7e8
......@@ -29,6 +29,9 @@
WorkflowFileRendererDialog::WorkflowFileRendererDialog()
{
m_ui.setupUi( this );
m_workflow = MainWorkflow::getInstance();
connect( m_workflow, SIGNAL( frameChanged( qint64, MainWorkflow::FrameChangedReason ) ),
this, SLOT( frameChanged( qint64, MainWorkflow::FrameChangedReason ) ) );
}
void WorkflowFileRendererDialog::setOutputFileName( const QString& outputFileName )
......@@ -47,3 +50,10 @@ void WorkflowFileRendererDialog::updatePreview( const uchar* buff )
{
m_ui.previewLabel->setPixmap( QPixmap::fromImage( QImage( buff, VIDEOWIDTH, VIDEOHEIGHT, QImage::Format_RGB888 ).rgbSwapped() ) );
}
void WorkflowFileRendererDialog::frameChanged( qint64 frame, MainWorkflow::FrameChangedReason reason )
{
if ( reason == MainWorkflow::Renderer )
m_ui.frameCounter->setText( tr("Rendering frame %1 / %2").arg(QString::number( frame ),
QString::number(m_workflow->getLengthFrame() ) ) );
}
......@@ -26,6 +26,8 @@
#include <QDialog>
#include "ui_WorkflowFileRendererDialog.h"
#include "MainWorkflow.h"
class WorkflowFileRendererDialog : public QDialog
{
Q_OBJECT
......@@ -34,12 +36,17 @@ public:
WorkflowFileRendererDialog();
void setOutputFileName( const QString& filename );
void setProgressBarValue( int val );
private:
Ui::WorkflowFileRendererDialog m_ui;
MainWorkflow* m_workflow;
public slots:
void updatePreview( const uchar* buff );
private slots:
void frameChanged( qint64, MainWorkflow::FrameChangedReason );
friend class WorkflowFileRenderer;
};
......
......@@ -20,6 +20,44 @@
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="renderInProgress">
<property name="text">
<string>Render in progress...</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="frameCounter">
<property name="text">
<string>Frame</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="previewLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QProgressBar" name="progressBar">
<property name="value">
......@@ -58,20 +96,6 @@
</item>
</layout>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Render in progress...</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="previewLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
......
......@@ -29,10 +29,11 @@ WorkflowFileRenderer::WorkflowFileRenderer( const QString& outputFileName ) :
{
m_image = NULL;
m_timer.setSingleShot( true );
m_dialog = new WorkflowFileRendererDialog;
m_dialog = new WorkflowFileRendererDialog();
m_dialog->setModal( true );
m_dialog->setOutputFileName( outputFileName );
connect( m_dialog->m_ui.cancelButton, SIGNAL( clicked() ), this, SLOT( cancelButtonClicked() ) );
connect( m_dialog, SIGNAL( finished(int) ), this, SLOT( stop() ) );
connect( this, SIGNAL( imageUpdated( const uchar* ) ), m_dialog, SLOT( updatePreview( const uchar* ) ) );
}
......@@ -75,12 +76,12 @@ void WorkflowFileRenderer::run()
void WorkflowFileRenderer::stop()
{
WorkflowRenderer::stop();
m_dialog->done( 0 );
}
void WorkflowFileRenderer::cancelButtonClicked()
{
stop();
m_dialog->done( 0 );
}
float WorkflowFileRenderer::getFps() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment