connect(m_scene, SIGNAL(newRect(QGraphicsRectItem *)), this , SLOT(slotNewRect(QGraphicsRectItem *)));
connect(m_scene, SIGNAL(newText(QGraphicsTextItem *)), this , SLOT(slotNewText(QGraphicsTextItem *)));
connect(zoom_slider, SIGNAL(valueChanged(int)), this , SLOT(slotUpdateZoom(int)));
-
+ connect(zoom_spin, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateZoom(int)));
// mbd: load saved settings
readChoices();
void TitleWidget::slotUpdateZoom(int pos)
{
+ zoom_spin->setValue(pos);
+ zoom_slider->setValue(pos);
m_scene->setZoom((double) pos / 100);
- zoom_label->setText(QString::number(pos) + '%');
}
void TitleWidget::slotZoom(bool up)
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));
QColor bgColor = QColor(titleConfig.readEntry("rect_background_color", rectBColor->color()));
#if KDE_IS_VERSION(4,5,0)
- fgColor.setAlpha(titleConfig.readEntry("rect_background_alpha", fgColor.alpha()));
+ fgColor.setAlpha(titleConfig.readEntry("rect_foreground_alpha", fgColor.alpha()));
bgColor.setAlpha(titleConfig.readEntry("rect_background_alpha", bgColor.alpha()));
#else
rectFAlpha->setValue(titleConfig.readEntry("rect_foreground_alpha", rectFAlpha->value()));