]> git.sesse.net Git - kdenlive/blobdiff - src/titlewidget.cpp
Add some context info for translaters
[kdenlive] / src / titlewidget.cpp
index 5a9387491edcd1d7668cd8df8ecea27767ac6a83..53bec5d1fce107fe303c4ea833a4222c3ccba3a7 100644 (file)
@@ -447,7 +447,7 @@ TitleWidget::TitleWidget(KUrl url, Timecode tc, QString projectTitlePath, Render
     m_titledocument.setScene(m_scene, m_frameWidth, m_frameHeight);
     connect(m_scene, SIGNAL(changed(QList<QRectF>)), this, SLOT(slotChanged()));
     connect(font_size, SIGNAL(valueChanged(int)), m_scene, SLOT(slotUpdateFontSize(int)));
-
+    
     // a gradient background
     /*QRadialGradient *gradient = new QRadialGradient(0, 0, 10);
     gradient->setSpread(QGradient::ReflectSpread);
@@ -1849,9 +1849,20 @@ 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)
+
+    // If we have images in the title, ask for embed
+    QList <QGraphicsItem *> list = graphicsView->scene()->items();
+    QGraphicsPixmapItem pix;
+    int pixmapType = pix.type();
+    foreach(const QGraphicsItem *item, list) {
+       if (item->type() == pixmapType && item != m_frameImage) {
+           embed_image = true;
+           break;
+       }
+    }
+    if (embed_image && KMessageBox::questionYesNo(this, i18n("Do you want to embed Images into this TitleDocument?\nThis is most needed for sharing Titles.")) != KMessageBox::Yes)
     {
-        embed_image=true;      
+        embed_image=false;
     }
     if (url.isEmpty()) {
         QPointer<KFileDialog> fs = new KFileDialog(KUrl(m_projectTitlePath), "application/x-kdenlivetitle", this);
@@ -1872,21 +1883,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()));
+    doc.documentElement().setAttribute("duration", m_tc.getFrameCount(title_duration->text()));
     return doc;
 }
 
-int TitleWidget::outPoint() const
+int TitleWidget::duration() const
 {
     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_projectTitlePath);
+    int duration;
+    m_count = m_titledocument.loadFromXml(doc, m_startViewport, m_endViewport, &duration, m_projectTitlePath);
     adjustFrameSize();
-    title_duration->setText(m_tc.getTimecode(GenTime(out, m_render->fps())));
+    title_duration->setText(m_tc.getTimecode(GenTime(duration, 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));
@@ -2143,8 +2154,8 @@ void TitleWidget::slotAnimEnd(bool anim)
 void TitleWidget::addAnimInfoText()
 {
     // add text to anim viewport
-    QGraphicsTextItem *t = new QGraphicsTextItem(i18n("Start"), m_startViewport);
-    QGraphicsTextItem *t2 = new QGraphicsTextItem(i18n("End"), m_endViewport);
+    QGraphicsTextItem *t = new QGraphicsTextItem(i18nc("Indicates the start of an animation", "Start"), m_startViewport);
+    QGraphicsTextItem *t2 = new QGraphicsTextItem(i18nc("Indicates the end of an animation", "End"), m_endViewport);
     QFont font = t->font();
     font.setPixelSize(m_startViewport->rect().width() / 10);
     QColor col = m_startViewport->pen().color();