]> git.sesse.net Git - kdenlive/blobdiff - src/titledocument.cpp
Cleanup, fix mem leaks, fix unused clips not correctly updated on profile change
[kdenlive] / src / titledocument.cpp
index 99ca180a8d06ade43ccc5ad2066dcefa826554cb..5c077a0a296a768eb3b208cf054e2399f6bc89a4 100644 (file)
@@ -216,6 +216,14 @@ int TitleDocument::loadFromXml(QDomDocument doc, QGraphicsPolygonItem* startv, Q
 {
     QDomNodeList titles = doc.elementsByTagName("kdenlivetitle");
     //TODO: Check if the opened title size is equal to project size, otherwise warn user and rescale
+    if (doc.documentElement().hasAttribute("width") && doc.documentElement().hasAttribute("height")) {
+        int doc_width = doc.documentElement().attribute("width").toInt();
+        int doc_height = doc.documentElement().attribute("height").toInt();
+        if (doc_width != m_width || doc_height != m_height) {
+            KMessageBox::information(kapp->activeWindow(), i18n("This title clip was created with a different frame size. It will now be converted to the current project's size."), i18n("Resizing Title Clip"));
+            //TODO: convert using QTransform
+        }
+    }
     //TODO: get default title duration instead of hardcoded one
     if (doc.documentElement().hasAttribute("out"))
         *out = doc.documentElement().attribute("out").toDouble();