Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Don't warn on timeline preview codec change if no preview exists, fix adding...

Don't warn on timeline preview codec change if no preview exists, fix adding preview range not working if preview not started
parent 8935d445
......@@ -470,6 +470,14 @@ void Core::refreshProjectItem(const ObjectId &id)
}
}
bool Core::hasTimelinePreview() const
{
if (!m_guiConstructed) {
return false;
}
return m_mainWindow->getCurrentTimeline()->controller()->renderedChunks().size() > 0;
}
KdenliveDoc *Core::currentDoc()
{
return m_projectManager->current();
......
......@@ -171,6 +171,8 @@ public:
void clearSelection();
/** @brief Returns the current project duration */
int projectDuration() const;
/** @brief Returns true if current project has some rendered timeline preview */
bool hasTimelinePreview() const;
private:
explicit Core();
......
......@@ -426,8 +426,8 @@ void ProjectSettings::accept()
if (!params.isEmpty()) {
if (params.section(QLatin1Char(';'), 0, 0) != m_previewparams || params.section(QLatin1Char(';'), 1, 1) != m_previewextension ||
m_resizePreview != resize_preview->isChecked() || m_previewHeight != preview_height->value()) {
// Timeline preview settings changed, warn
if (KMessageBox::warningContinueCancel(this,
// Timeline preview settings changed, warn if there are existing previews
if (pCore->hasTimelinePreview() && KMessageBox::warningContinueCancel(this,
i18n("You changed the timeline preview profile. This will remove all existing timeline previews for "
"this project.\n Are you sure you want to proceed?"),
i18n("Confirm profile change")) == KMessageBox::Cancel) {
......
......@@ -1293,7 +1293,13 @@ void TimelineController::removeSplitOverlay()
void TimelineController::addPreviewRange(bool add)
{
if (m_timelinePreview && !m_zone.isNull()) {
if (m_zone.isNull()) {
return;
}
if (!m_timelinePreview) {
initializePreview();
}
if (m_timelinePreview) {
m_timelinePreview->addPreviewRange(m_zone, add);
}
}
......
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