]> git.sesse.net Git - kdenlive/blobdiff - src/titlewidget.cpp
Notify user of extracting process
[kdenlive] / src / titlewidget.cpp
index d0de78736fca0584f801fd13562363c285ddbea5..7af47ac43256cebdc82613b1a4cd61ad5e9788e3 100644 (file)
@@ -782,7 +782,7 @@ void TitleWidget::displayBackgroundFrame()
         p.end();
         m_frameImage->setPixmap(bg);
     } else {
-        m_frameImage->setPixmap(QPixmap::fromImage(m_render->extractFrame((int) m_render->seekPosition().frames(m_render->fps()), m_frameWidth / 2, m_frameHeight / 2)));
+        m_frameImage->setPixmap(QPixmap::fromImage(m_render->extractFrame((int) m_render->seekPosition().frames(m_render->fps()), QString(), m_frameWidth / 2, m_frameHeight / 2)));
     }
 }
 
@@ -1787,6 +1787,11 @@ void TitleWidget::saveTitle(KUrl url)
 {
     if (anim_start->isChecked()) slotAnimStart(false);
     if (anim_end->isChecked()) slotAnimEnd(false);
+    bool embed_image=false;
+    if (KMessageBox::questionYesNo(this, i18n("Do you want to embed Images into this TitleDocument?\nThis is most needed for sharing Titles.")) != KMessageBox::No)
+    {
+        embed_image=true;      
+    }
     if (url.isEmpty()) {
         KFileDialog *fs = new KFileDialog(KUrl(m_projectTitlePath), "application/x-kdenlivetitle", this);
         fs->setOperationMode(KFileDialog::Saving);
@@ -1800,7 +1805,7 @@ void TitleWidget::saveTitle(KUrl url)
         delete fs;
     }
     if (!url.isEmpty()) {
-        if (m_titledocument.saveDocument(url, m_startViewport, m_endViewport, m_tc.getFrameCount(title_duration->text()) - 1) == false)
+        if (m_titledocument.saveDocument(url, m_startViewport, m_endViewport, m_tc.getFrameCount(title_duration->text()), embed_image) == false)
             KMessageBox::error(this, i18n("Cannot write to file %1", url.path()));
     }
 }
@@ -1808,21 +1813,21 @@ void TitleWidget::saveTitle(KUrl url)
 QDomDocument TitleWidget::xml()
 {
     QDomDocument doc = m_titledocument.xml(m_startViewport, m_endViewport);
-    doc.documentElement().setAttribute("out", m_tc.getFrameCount(title_duration->text()) - 1);
+    doc.documentElement().setAttribute("out", m_tc.getFrameCount(title_duration->text()));
     return doc;
 }
 
 int TitleWidget::outPoint() const
 {
-    return m_tc.getFrameCount(title_duration->text()) - 1;
+    return m_tc.getFrameCount(title_duration->text());
 }
 
 void TitleWidget::setXml(QDomDocument doc)
 {
     int out;
-    m_count = m_titledocument.loadFromXml(doc, m_startViewport, m_endViewport, &out);
+    m_count = m_titledocument.loadFromXml(doc, m_startViewport, m_endViewport, &out, m_projectTitlePath);
     adjustFrameSize();
-    title_duration->setText(m_tc.getTimecode(GenTime(out + 1, m_render->fps())));
+    title_duration->setText(m_tc.getTimecode(GenTime(out, m_render->fps())));
     /*if (doc.documentElement().hasAttribute("out")) {
     GenTime duration = GenTime(doc.documentElement().attribute("out").toDouble() / 1000.0);
     title_duration->setText(m_tc.getTimecode(duration));