]> git.sesse.net Git - kdenlive/commitdiff
Check the system for dvd authoring programs
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 26 Jan 2009 12:15:20 +0000 (12:15 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 26 Jan 2009 12:15:20 +0000 (12:15 +0000)
svn path=/branches/KDE4/; revision=2970

src/dvdwizardvob.cpp
src/dvdwizardvob.h
src/widgets/dvdwizardvob_ui.ui
src/wizard.cpp

index d127c804d49bcfd4b2697f12b1805846b1e654ed..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;
index a8f68ea767b978c8e5a3592791a416627bebd3fe..34970a472e972aaa3f3414b9782d55a5f66a483e 100644 (file)
@@ -38,6 +38,7 @@ public:
 
 private:
     Ui::DvdWizardVob_UI m_view;
+    QString m_errorMessage;
 
 private slots:
     void slotCheckVobList(const QString &text);
index e982a76cfe2b5e34f7e7a471ae328e5e90689a73..626378d7346f9c3757fc03a23edbf252ca797916 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>348</width>
-    <height>153</height>
+    <width>359</width>
+    <height>177</height>
    </rect>
   </property>
   <property name="windowTitle" >
    </item>
    <item row="1" column="0" colspan="2" >
     <widget class="QGroupBox" name="vob_list" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="MinimumExpanding" hsizetype="Preferred" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="title" >
       <string>DVD Files</string>
      </property>
      </layout>
     </widget>
    </item>
-   <item row="2" column="0" colspan="2" >
+   <item row="3" column="0" colspan="2" >
+    <widget class="QLabel" name="error_message" >
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text" >
+      <string/>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="0" >
     <spacer name="verticalSpacer" >
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
index 6b811fd5f44db39fbcdc73589464ac8acaca0fa7..94ee17df06eaba98935eda0cec79024149a78978 100644 (file)
@@ -262,6 +262,18 @@ void Wizard::slotCheckPrograms() {
     if (KStandardDirs::findExe("dvgrab").isEmpty()) item->setIcon(0, missingIcon);
     else item->setIcon(0, okIcon);
 
+    item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Dvdauthor"));
+    item->setData(1, Qt::UserRole, i18n("Required for creation of dvd"));
+    item->setSizeHint(0, itemSize);
+    if (KStandardDirs::findExe("dvdauthor").isEmpty()) item->setIcon(0, missingIcon);
+    else item->setIcon(0, okIcon);
+
+    item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Mkisofs"));
+    item->setData(1, Qt::UserRole, i18n("Required for creation of dvd iso images"));
+    item->setSizeHint(0, itemSize);
+    if (KStandardDirs::findExe("mkisofs").isEmpty()) item->setIcon(0, missingIcon);
+    else item->setIcon(0, okIcon);
+
 }
 
 void Wizard::installExtraMimes(QString baseName, QStringList globs) {