]> git.sesse.net Git - kdenlive/blobdiff - src/dvdwizardvob.cpp
Clip cuts in project tree can now have a description
[kdenlive] / src / dvdwizardvob.cpp
index f88fab2fc604114d66843de4eeb25da7cfef9e31..e49c3c3f8c036de516daec79406ad7ab29b89bab 100644 (file)
@@ -32,6 +32,7 @@
 #include <QHBoxLayout>
 #include <QDomDocument>
 #include <QTreeWidgetItem>
+#include <QHeaderView>
 
 DvdWizardVob::DvdWizardVob(const QString &profile, QWidget *parent) :
         QWizardPage(parent)
@@ -51,8 +52,8 @@ DvdWizardVob::DvdWizardVob(const QString &profile, QWidget *parent) :
     connect(m_view.vobs_list, SIGNAL(itemSelectionChanged()), this, SLOT(slotCheckVobList()));
     m_view.vobs_list->setIconSize(QSize(60, 45));
 
-    if (KStandardDirs::findExe("dvdauthor").isEmpty()) m_errorMessage.append(i18n("<strong>Program %1 is required for the DVD wizard.", i18n("dvdauthor")));
-    if (KStandardDirs::findExe("mkisofs").isEmpty()) m_errorMessage.append(i18n("<strong>Program %1 is required for the DVD wizard.", i18n("mkisofs")));
+    if (KStandardDirs::findExe("dvdauthor").isEmpty()) m_errorMessage.append(i18n("<strong>Program %1 is required for the DVD wizard.</strong>", i18n("dvdauthor")));
+    if (KStandardDirs::findExe("mkisofs").isEmpty() && KStandardDirs::findExe("genisoimage").isEmpty()) m_errorMessage.append(i18n("<strong>Program %1 or %2 is required for the DVD wizard.</strong>", i18n("mkisofs"), i18n("genisoimage")));
     if (m_errorMessage.isEmpty()) m_view.error_message->setVisible(false);
     else m_view.error_message->setText(m_errorMessage);
 
@@ -122,17 +123,18 @@ void DvdWizardVob::slotAddVobFile(KUrl url, const QString &chapters)
     delete[] tmp;
 
     if (producer->is_blank() == false) {
-        pix = KThumb::getFrame(producer, 0, 60, 45);
-        item->setIcon(0, pix);
+        int width = 45.0 * profile.dar();
+        if (width % 2 == 1) width++;
+        item->setIcon(0, QPixmap::fromImage(KThumb::getFrame(producer, 0, width, 45)));
         int playTime = producer->get_playtime();
         item->setText(1, Timecode::getStringTimecode(playTime, profile.fps()));
         item->setData(1, Qt::UserRole, playTime);
     }
     delete producer;
 
-    if (chapters.isEmpty() == false) {
+    if (chapters.isEmpty() == false)
         item->setData(1, Qt::UserRole + 1, chapters);
-    else if (QFile::exists(url.path() + ".dvdchapter")) {
+    else if (QFile::exists(url.path() + ".dvdchapter")) {
         // insert chapters as children
         QFile file(url.path() + ".dvdchapter");
         if (file.open(QIODevice::ReadOnly)) {
@@ -146,7 +148,8 @@ void DvdWizardVob::slotAddVobFile(KUrl url, const QString &chapters)
             }
             item->setData(1, Qt::UserRole + 1, chaptersList.join(";"));
         }
-    }
+    } else // Explicitly add a chapter at 00:00:00:00
+        item->setData(1, Qt::UserRole + 1, "0");
 
     slotCheckVobList();
 }
@@ -182,7 +185,7 @@ void DvdWizardVob::changeFormat()
         delete[] tmp;
 
         if (producer->is_blank() == false) {
-            //pix = KThumb::getFrame(producer, 0, 180, 135);
+            //pix = KThumb::getFrame(producer, 0, 135 * profile.dar(), 135);
             //item->setIcon(0, pix);
             item->setText(1, Timecode::getStringTimecode(producer->get_playtime(), profile.fps()));
         }
@@ -283,7 +286,7 @@ QString DvdWizardVob::introMovie() const
 
 void DvdWizardVob::setIntroMovie(const QString path)
 {
-    m_view.intro_vob->setPath(path);
+    m_view.intro_vob->setUrl(KUrl(path));
     m_view.use_intro->setChecked(path.isEmpty() == false);
 }
 
@@ -354,4 +357,4 @@ void DvdWizardVob::setProfile(const QString profile)
 void DvdWizardVob::clear()
 {
     m_view.vobs_list->clear();
-}
\ No newline at end of file
+}