--Bug fixes

-Returning to main window after closing the final render dialog wouldn't restart the renderer.

--Code changes
 -Recreate the final render dialog each time it's shown.
This commit is contained in:
Person 2019-12-30 21:12:10 -08:00
parent 7ced17a6b2
commit 96d72004fc
6 changed files with 40 additions and 6 deletions

View File

@ -9,7 +9,7 @@ else
}
$benchprefix = "./bench/"
$devices = "2"#Set this to whatever device index your main GPU resides at. If you are unsure, just run emberrender --opencl info to find out.
$devices = "2"#Set this to whatever device index your main GPU resides at. If you are unsure, just run emberrender --openclinfo to find out.
$cpuquality = 150
$gpuquality = 2000
$verbose = "--verbose"

View File

@ -65,7 +65,6 @@ Fractorium::Fractorium(QWidget* p)
m_ColorDialog = new QColorDialog(this);
m_Settings = FractoriumSettings::Instance();
m_QssDialog = new QssDialog(this);
m_FinalRenderDialog = new FractoriumFinalRenderDialog(this);
m_OptionsDialog = new FractoriumOptionsDialog(this);
m_VarDialog = new FractoriumVariationsDialog(this);
m_AboutDialog = new FractoriumAboutDialog(this);
@ -789,6 +788,30 @@ QString Fractorium::SetupSaveFolderDialog()
return filename;
}
/// <summary>
/// Setup the final render dialog.
/// Note this deletes the existing instance before creating the new one.
/// This must be called every time the final render dialog is shown because
/// there are problems with reusing it.
/// </summary>
/// <returns>True if created successfully, else false</returns>
bool Fractorium::SetupFinalRenderDialog()
{
if (m_FinalRenderDialog)
{
delete m_FinalRenderDialog;
m_FinalRenderDialog = nullptr;
}
if (m_FinalRenderDialog = new FractoriumFinalRenderDialog(this))
{
connect(m_FinalRenderDialog, SIGNAL(finished(int)), this, SLOT(OnFinalRenderClose(int)), Qt::QueuedConnection);
return true;
}
return false;
}
/// <summary>
/// Thin wrapper around QMessageBox::critical() to allow it to be invoked from another thread.
/// </summary>

View File

@ -458,6 +458,7 @@ private:
QString SetupSaveXmlDialog(const QString& defaultFilename);
QString SetupSaveImageDialog(const QString& defaultFilename);
QString SetupSaveFolderDialog();
bool SetupFinalRenderDialog();
QColorDialog* m_ColorDialog = nullptr;
FractoriumFinalRenderDialog* m_FinalRenderDialog = nullptr;
FractoriumOptionsDialog* m_OptionsDialog = nullptr;

View File

@ -755,6 +755,9 @@ void Fractorium::OnSequenceRenderButtonClicked(bool checked)
m_Controller->StopAllPreviewRenderers();
m_Controller->SaveCurrentToOpenedFile(false);//Save whatever was edited back to the current open file.
m_RenderStatusLabel->setText("Renderer stopped.");
SetupFinalRenderDialog();
if (m_FinalRenderDialog)
m_FinalRenderDialog->Show(true);//Show with a bool specifying that it came from the sequence generator.
}
}

View File

@ -41,7 +41,6 @@ void Fractorium::InitMenusUI()
connect(ui.ActionStopRenderingPreviews, SIGNAL(triggered(bool)), this, SLOT(OnActionStopRenderingPreviews(bool)), Qt::QueuedConnection);
connect(ui.ActionRenderPreviews, SIGNAL(triggered(bool)), this, SLOT(OnActionRenderPreviews(bool)), Qt::QueuedConnection);
connect(ui.ActionFinalRender, SIGNAL(triggered(bool)), this, SLOT(OnActionFinalRender(bool)), Qt::QueuedConnection);
connect(m_FinalRenderDialog, SIGNAL(finished(int)), this, SLOT(OnFinalRenderClose(int)), Qt::QueuedConnection);
connect(ui.ActionOptions, SIGNAL(triggered(bool)), this, SLOT(OnActionOptions(bool)), Qt::QueuedConnection);
//Help menu.
connect(ui.ActionAbout, SIGNAL(triggered(bool)), this, SLOT(OnActionAbout(bool)), Qt::QueuedConnection);
@ -936,6 +935,9 @@ void Fractorium::OnActionFinalRender(bool checked)
m_Controller->StopAllPreviewRenderers();
m_Controller->SaveCurrentToOpenedFile(false);//Save whatever was edited back to the current open file.
m_RenderStatusLabel->setText("Renderer stopped.");
SetupFinalRenderDialog();
if (m_FinalRenderDialog)
m_FinalRenderDialog->Show(false);
}
@ -949,6 +951,8 @@ void Fractorium::OnFinalRenderClose(int result)
StartRenderTimer(false);//Re-create the renderer and start rendering again.
ui.ActionStartStopRenderer->setChecked(false);//Re-enable any controls that might have been disabled.
OnActionStartStopRenderer(false);
delete m_FinalRenderDialog;
m_FinalRenderDialog = nullptr;
}
/// <summary>

View File

@ -701,7 +701,10 @@ bool Fractorium::CreateRendererFromOptions(bool updatePreviews)
ui.ActionCopyKernel->setEnabled(false);
m_OptionsDialog->ui.OpenCLCheckBox->setChecked(false);
m_OptionsDialog->ui.SharedTextureCheckBox->setChecked(false);
if (m_FinalRenderDialog)
m_FinalRenderDialog->ui.FinalRenderOpenCLCheckBox->setChecked(false);
ok = false;
}