Commit 35ad30e3 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix resetting rendered animation filename

1) Use "Untitled" when the document has no name
2) Don't reset name if use canceled the file name selection dialog
parent 280bc87e
......@@ -95,5 +95,9 @@ void KisFileNameRequester::slotSelectFile()
Q_ASSERT(!m_mime_filter_list.isEmpty());
dialog.setMimeTypeFilters(m_mime_filter_list, m_mime_default_filter);
setFileName(dialog.filename());
QString newFileName = dialog.filename();
if (!newFileName.isEmpty()) {
setFileName(newFileName);
}
}
......@@ -59,6 +59,10 @@ DlgAnimationRenderer::DlgAnimationRenderer(KisDocument *doc, QWidget *parent)
setButtons(Ok | Cancel);
setDefaultButton(Ok);
if (m_defaultFileName.isEmpty()) {
m_defaultFileName = i18n("Untitled");
}
m_page = new WdgAnimaterionRenderer(this);
m_page->layout()->setMargin(0);
m_page->dirRequester->setMode(KoFileDialog::OpenDirectory);
......@@ -295,6 +299,7 @@ void DlgAnimationRenderer::selectRenderType(int index)
m_defaultFileName = QFileInfo(m_page->videoFilename->fileName()).completeBaseName();
}
m_page->videoFilename->setMimeTypeFilters(QStringList() << mimetype, mimetype);
m_page->videoFilename->setFileName(m_defaultFileName + "." + KisMimeDatabase::suffixesForMimeType(mimetype).first());
}
......
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