]> git.sesse.net Git - kdenlive/commitdiff
Cleanup + small fix in dvd wizard menu page
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 11 Mar 2009 22:11:52 +0000 (22:11 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 11 Mar 2009 22:11:52 +0000 (22:11 +0000)
svn path=/trunk/kdenlive/; revision=3140

src/docclipbase.cpp
src/docclipbase.h
src/dvdwizardmenu.cpp

index 0984f9232d32ecb4c2881f5a52c67e0f25b3ba01..b3a17693195ccc0823969b4888407b85a304264f 100644 (file)
@@ -1,7 +1,7 @@
 /***************************************************************************
- *                         DocClipBase.cpp  -  description                *
- *                           -------------------                          *
- *   begin                : Fri Apr 12 2002                               *
+ *                         DocClipBase.cpp  -  description                 *
+ *                           -------------------                           *
+ *   begin                : Fri Apr 12 2002                                *
  *   Copyright (C) 2002 by Jason Wood (jasonwood@blueyonder.co.uk)         *
  *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
  *                                                                         *
@@ -217,49 +217,6 @@ QDomElement DocClipBase::toXML() const {
     return doc.documentElement();
 }
 
-DocClipBase *DocClipBase::
-createClip(KdenliveDoc */*doc*/, const QDomElement & element) {
-    DocClipBase *clip = 0;
-    QString description;
-    QDomNode node = element;
-    node.normalize();
-    if (element.tagName() != "kdenliveclip") {
-        kWarning() <<
-        "DocClipBase::createClip() element has unknown tagName : " << element.tagName();
-        return 0;
-    }
-
-    QDomNode n = element.firstChild();
-
-    while (!n.isNull()) {
-        QDomElement e = n.toElement();
-        if (!e.isNull()) {
-            QString tagName = e.tagName();
-            if (e.tagName() == "avfile") {
-                // clip = DocClipAVFile::createClip(e);
-            } else if (e.tagName() == "DocTrackBaseList") {
-                // clip = DocClipProject::createClip(doc, e);
-            }
-        } else {
-            QDomText text = n.toText();
-            if (!text.isNull()) {
-                description = text.nodeValue();
-            }
-        }
-
-        n = n.nextSibling();
-    }
-    if (clip == 0) {
-        kWarning() << "DocClipBase::createClip() unable to create clip";
-    } else {
-        // setup DocClipBase specifics of the clip.
-        QMap <QString, QString> props;
-        props.insert("description", description);
-        clip->setProperties(props);
-        clip->setAudioThumbCreated(false);
-    }
-    return clip;
-}
 
 void DocClipBase::setAudioThumbCreated(bool isDone) {
     m_audioThumbCreated = isDone;
index 03bc49ed49f19bd13ef60a1421150022e19201f4..242d78026f537488ec8836f827549d1b175f5c1b 100644 (file)
@@ -154,7 +154,6 @@ Q_OBJECT public:
     /** Returns the thumbnail used by this clip */
     const QPixmap & thumbnail() const;
 
-    static DocClipBase *createClip(KdenliveDoc *doc, const QDomElement & element);
     /** Cache for every audio Frame with 10 Bytes */
     /** format is frame -> channel ->bytes */
     QMap<int, QMap<int, QByteArray> > audioFrameChache;
index e068b01775365a9a4dc20de23027b90226640844..5278b0b84256e5e81904d95bfcdba58886ca6e1b 100644 (file)
@@ -132,13 +132,22 @@ bool DvdWizardMenu::isComplete() const {
             QList<QGraphicsItem *> collisions = button->collidingItems();
             if (!collisions.isEmpty()) {
                 for (int j = 0; j < collisions.count(); j++) {
-                    if (list.at(j)->type() == button->type()) return false;
+                    if (collisions.at(j)->type() == button->type()) return false;
                 }
             }
             targets.append(button->target());
         }
     }
-    if (buttonCount == 0) return false;
+    if (buttonCount == 0) {
+        // We need at least one button
+        return false;
+    }
+
+    if (!m_view.background_image->isHidden()) {
+        // Make sure user selected a valid image / video file
+        if (!QFile::exists(m_view.background_image->url().path())) return false;
+    }
+
     // check that we have a "Play all" entry
     if (targets.contains(0)) return true;
     // ... or that each video file has a button
@@ -278,6 +287,7 @@ void DvdWizardMenu::buildColor() {
 }
 
 void DvdWizardMenu::buildImage() {
+    emit completeChanged();
     if (m_view.background_image->url().isEmpty()) {
         m_scene->removeItem(m_background);
         return;