]> git.sesse.net Git - kdenlive/commitdiff
Show info message if dvgrab or recordmydesktop is missing
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 15 Nov 2008 22:10:01 +0000 (22:10 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 15 Nov 2008 22:10:01 +0000 (22:10 +0000)
svn path=/branches/KDE4/; revision=2705

src/kdenlivesettings.kcfg
src/kdenlivesettingsdialog.cpp
src/recmonitor.cpp

index 4aac71c6ca3f93824ae525f39d1c5a83e036f448..e82bd659980dd52487a2b1201c0129cf641212c4 100644 (file)
       <label>Path for the recordmydesktop binary.</label>
       <default></default>
     </entry>
+
+    <entry name="dvgrab_path" type="String">
+      <label>Path for the dvgrab binary.</label>
+      <default></default>
+    </entry>
   </group>
 
   <group name="shuttle">
index b95ce62c486878322d2ce19ca29a7edf95f2d270..838a6c615b75798c92558e59559527a6ebc0112e 100644 (file)
@@ -128,32 +128,39 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog(
 
     //HACK: check dvgrab version, because only dvgrab >= 3.3 supports
     //   --timestamp option without bug
-    double dvgrabVersion = 0;
-
-    QProcess *versionCheck = new QProcess;
-    versionCheck->setProcessChannelMode(QProcess::MergedChannels);
-    versionCheck->start("dvgrab", QStringList() << "--version");
-    if (versionCheck->waitForFinished()) {
-        QString version = QString(versionCheck->readAll()).simplified();
-        if (version.contains(' ')) version = version.section(' ', -1);
-        dvgrabVersion = version.toDouble();
 
-        kDebug() << "// FOUND DVGRAB VERSION: " << dvgrabVersion;
-    }
-    if (versionCheck) delete versionCheck;
-    if (dvgrabVersion < 3.3) {
-        KdenliveSettings::setFirewiretimestamp(false);
-        m_configCapture.kcfg_firewiretimestamp->setEnabled(false);
+    if (KdenliveSettings::dvgrab_path().isEmpty() || !QFile::exists(KdenliveSettings::dvgrab_path())) {
+        QString dvgrabpath = KStandardDirs::findExe("dvgrab");
+        KdenliveSettings::setDvgrab_path(dvgrabpath);
     }
 
-    QString rmdpath = KStandardDirs::findExe("recordmydesktop");
-    if (rmdpath.isEmpty()) {
-        KdenliveSettings::setRmd_path(QString());
-        m_configCapture.rmd_info->setText(i18n("Recordmydesktop utility not found, please install it for screen grabs"));
-    } else {
+
+    double dvgrabVersion = 0;
+    if (!KdenliveSettings::dvgrab_path().isEmpty()) {
+        QProcess *versionCheck = new QProcess;
+        versionCheck->setProcessChannelMode(QProcess::MergedChannels);
+        versionCheck->start("dvgrab", QStringList() << "--version");
+        if (versionCheck->waitForFinished()) {
+            QString version = QString(versionCheck->readAll()).simplified();
+            if (version.contains(' ')) version = version.section(' ', -1);
+            dvgrabVersion = version.toDouble();
+
+            kDebug() << "// FOUND DVGRAB VERSION: " << dvgrabVersion;
+        }
+        if (versionCheck) delete versionCheck;
+        if (dvgrabVersion < 3.3) {
+            KdenliveSettings::setFirewiretimestamp(false);
+            m_configCapture.kcfg_firewiretimestamp->setEnabled(false);
+        }
+        m_configCapture.dvgrab_info->setText(i18n("dvgrab version %1 at %2", dvgrabVersion, KdenliveSettings::dvgrab_path()));
+    } else m_configCapture.dvgrab_info->setText(i18n("<b>dvgrab utility not found, please install it for firewire capture</b>"));
+
+    if (KdenliveSettings::rmd_path().isEmpty() || !QFile::exists(KdenliveSettings::rmd_path())) {
+        QString rmdpath = KStandardDirs::findExe("recordmydesktop");
         KdenliveSettings::setRmd_path(rmdpath);
-        m_configCapture.rmd_info->setText(i18n("Recordmydesktop found at: %1", rmdpath));
     }
+    if (KdenliveSettings::rmd_path().isEmpty()) m_configCapture.rmd_info->setText(i18n("<b>Recordmydesktop utility not found, please install it for screen grabs</b>"));
+    else m_configCapture.rmd_info->setText(i18n("Recordmydesktop found at: %1", KdenliveSettings::rmd_path()));
 }
 
 KdenliveSettingsDialog::~KdenliveSettingsDialog() {}
index 4160d102eceeea7315b75bdcf0296623eca5e685..67ef5d12406e4925a4d2fbf63624ad821e13256e 100644 (file)
@@ -143,10 +143,10 @@ void RecMonitor::slotVideoDeviceChanged(int ix) {
         m_playAction->setEnabled(false);
         if (KdenliveSettings::rmd_path().isEmpty()) {
             QString rmdpath = KStandardDirs::findExe("recordmydesktop");
-            if (rmdpath.isEmpty()) ui.video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("Recordmydesktop utility not found, please install it for screen grabs")));
+            if (rmdpath.isEmpty()) ui.video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("Recordmydesktop utility not found,\n please install it for screen grabs")));
             else KdenliveSettings::setRmd_path(rmdpath);
         }
-        ui.video_frame->setPixmap(mergeSideBySide(KIcon("video-display").pixmap(QSize(50, 50)), i18n("Press record button\nto start screen capture\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
+        if (!KdenliveSettings::rmd_path().isEmpty()) ui.video_frame->setPixmap(mergeSideBySide(KIcon("video-display").pixmap(QSize(50, 50)), i18n("Press record button\nto start screen capture\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
         //ui.video_frame->setText(i18n("Press record button\nto start screen capture"));
         break;
     case VIDEO4LINUX:
@@ -166,7 +166,13 @@ void RecMonitor::slotVideoDeviceChanged(int ix) {
         m_rewAction->setEnabled(false);
         m_fwdAction->setEnabled(false);
         //ui.video_frame->setText(i18n("Plug your camcorder and\npress connect button\nto initialize connection"));
-        ui.video_frame->setPixmap(mergeSideBySide(KIcon("network-connect").pixmap(QSize(50, 50)), i18n("Plug your camcorder and\npress connect button\nto initialize connection\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
+        if (KdenliveSettings::dvgrab_path().isEmpty()) {
+            QString dvgrabpath = KStandardDirs::findExe("dvgrab");
+            if (dvgrabpath.isEmpty()) ui.video_frame->setPixmap(mergeSideBySide(KIcon("dialog-warning").pixmap(QSize(50, 50)), i18n("dvgrab utility not found,\n please install it for firewire capture")));
+            else KdenliveSettings::setDvgrab_path(dvgrabpath);
+        }
+
+        if (!KdenliveSettings::dvgrab_path().isEmpty()) ui.video_frame->setPixmap(mergeSideBySide(KIcon("network-connect").pixmap(QSize(50, 50)), i18n("Plug your camcorder and\npress connect button\nto initialize connection\nFiles will be saved in:\n%1", KdenliveSettings::capturefolder())));
         break;
     }
 }