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);
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);
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));
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();