From 9411aa0de2e43d715460fce58f254139ae328d64 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Wed, 7 Nov 2012 22:41:01 +0100 Subject: [PATCH] When saving title, ask to embed image only if there is one --- src/titlewidget.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/titlewidget.cpp b/src/titlewidget.cpp index 5a938749..0fc6c42d 100644 --- a/src/titlewidget.cpp +++ b/src/titlewidget.cpp @@ -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 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 fs = new KFileDialog(KUrl(m_projectTitlePath), "application/x-kdenlivetitle", this); -- 2.39.5