]> git.sesse.net Git - kdenlive/blobdiff - src/dvdwizardvob.cpp
Check the system for dvd authoring programs
[kdenlive] / src / dvdwizardvob.cpp
index 2e8797add0bb55f3bfe342296bc269c172226ef5..b39d63ede20c6299d495f16f71c5ee075832ccb1 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <KUrlRequester>
 #include <KDebug>
+#include <KStandardDirs>
 
 #include "dvdwizardvob.h"
 
@@ -29,7 +30,10 @@ DvdWizardVob::DvdWizardVob(QWidget *parent): QWizardPage(parent) {
     m_view.intro_vob->setFilter("video/mpeg");
     connect(m_view.use_intro, SIGNAL(toggled(bool)), m_view.intro_vob, SLOT(setEnabled(bool)));
     connect(m_view.vob_1, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckVobList(const QString &)));
-
+    if (KStandardDirs::findExe("dvdauthor").isEmpty()) m_errorMessage.append(i18n("<strong>Program %1 is required for the dvd wizard.<br />", i18n("dvdauthor")));
+    if (KStandardDirs::findExe("mkisofs").isEmpty()) m_errorMessage.append(i18n("<strong>Program %1 is required for the dvd wizard.", i18n("mkisofs")));
+    if (m_errorMessage.isEmpty()) m_view.error_message->setVisible(false);
+    else m_view.error_message->setText(m_errorMessage);
 }
 
 DvdWizardVob::~DvdWizardVob() {
@@ -40,6 +44,7 @@ DvdWizardVob::~DvdWizardVob() {
 // virtual
 
 bool DvdWizardVob::isComplete() const {
+    if (!m_view.error_message->text().isEmpty()) return false;
     if (m_view.vob_1->url().path().isEmpty()) return false;
     if (QFile::exists(m_view.vob_1->url().path())) return true;
     return false;
@@ -57,6 +62,12 @@ QStringList DvdWizardVob::selectedUrls() const {
             result.append(allUrls.at(i)->url().path());
         }
     }
+    return result;
+}
+
+QString DvdWizardVob::introMovie() const {
+    if (!m_view.use_intro->isChecked()) return QString();
+    return m_view.intro_vob->url().path();
 }
 
 void DvdWizardVob::slotCheckVobList(const QString &text) {