Commit 280bc87e authored by Dmitry Kazakov's avatar Dmitry Kazakov

Don't reset animation export range every time

(but reset it only when document path changes)
parent 684d9aed
......@@ -78,9 +78,6 @@ void AnimaterionRenderer::slotRenderAnimation()
KisConfig kisConfig;
KisPropertiesConfigurationSP cfg = new KisPropertiesConfiguration();
cfg->fromXML(kisConfig.exportConfiguration("IMAGESEQUENCE"));
// Override the saved start/end with the ones from the image in case of using gui.
cfg->setProperty("first_frame", image->animationInterface()->playbackRange().start());
cfg->setProperty("last_frame", image->animationInterface()->playbackRange().end());
dlgAnimationRenderer.setSequenceConfiguration(cfg);
cfg->clearProperties();
......
......@@ -50,6 +50,7 @@
DlgAnimationRenderer::DlgAnimationRenderer(KisDocument *doc, QWidget *parent)
: KoDialog(parent)
, m_image(doc->image())
, m_doc(doc)
, m_defaultFileName(QFileInfo(doc->url().toLocalFile()).completeBaseName())
{
KisConfig cfg;
......@@ -177,6 +178,7 @@ KisPropertiesConfigurationSP DlgAnimationRenderer::getSequenceConfiguration() co
{
KisPropertiesConfigurationSP cfg = new KisPropertiesConfiguration();
cfg->setProperty("basename", m_page->txtBasename->text());
cfg->setProperty("last_document_path", m_doc->localFilePath());
cfg->setProperty("directory", m_page->dirRequester->fileName());
cfg->setProperty("first_frame", m_page->intStart->value());
cfg->setProperty("last_frame", m_page->intEnd->value());
......@@ -188,6 +190,13 @@ KisPropertiesConfigurationSP DlgAnimationRenderer::getSequenceConfiguration() co
void DlgAnimationRenderer::setSequenceConfiguration(KisPropertiesConfigurationSP cfg)
{
m_page->txtBasename->setText(cfg->getString("basename", "frame"));
if (cfg->getString("last_document_path") != m_doc->localFilePath()) {
cfg->removeProperty("first_frame");
cfg->removeProperty("last_frame");
cfg->removeProperty("sequence_start");
}
m_page->dirRequester->setFileName(cfg->getString("directory", QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)));
m_page->intStart->setValue(cfg->getInt("first_frame", m_image->animationInterface()->playbackRange().start()));
m_page->intEnd->setValue(cfg->getInt("last_frame", m_image->animationInterface()->playbackRange().end()));
......
......@@ -84,7 +84,8 @@ private:
static QString findFFMpeg();
KisImageWSP m_image;
KisImageSP m_image;
KisDocument *m_doc;
WdgAnimaterionRenderer *m_page {0};
QList<QSharedPointer<KisImportExportFilter>> m_renderFilters;
KisConfigWidget *m_encoderConfigWidget {0};
......
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