]> git.sesse.net Git - kdenlive/blobdiff - src/wizard.cpp
Complete rewrite of the video4linux capture to use MLT, in progress.
[kdenlive] / src / wizard.cpp
index 13b8a547a6ccadf4905992b183e43ffe3a6492c5..985aa4d25af4328390de3b783b05adb24c1fcae9 100644 (file)
 #include "wizard.h"
 #include "kdenlivesettings.h"
 #include "profilesdialog.h"
+#include "v4l/v4lcapture.h"
+#include "kdenlive-config.h"
 
 #include <KStandardDirs>
 #include <KLocale>
 #include <KProcess>
 #include <kmimetype.h>
+#include <KRun>
+#include <KService>
+#include <KMimeTypeTrader>
 
 #include <QLabel>
 #include <QFile>
 #include <QXmlStreamWriter>
 #include <QTimer>
 
-const double recommendedMltVersion = 36;
+const double recommendedMltVersion = 510;
+static const char kdenlive_version[] = VERSION;
 
-Wizard::Wizard(bool upgrade, QWidget *parent): QWizard(parent)
+Wizard::Wizard(bool upgrade, QWidget *parent) :
+    QWizard(parent)
 {
+    setWindowTitle(i18n("Config Wizard"));
     setPixmap(QWizard::WatermarkPixmap, QPixmap(KStandardDirs::locate("appdata", "banner.png")));
 
     QWizardPage *page1 = new QWizardPage;
     page1->setTitle(i18n("Welcome"));
     QLabel *label;
     if (upgrade)
-        label = new QLabel(i18n("Your Kdenlive version was upgraded. Please take some time to review the basic settings"));
+        label = new QLabel(i18n("Your Kdenlive version was upgraded to version %1. Please take some time to review the basic settings", QString(kdenlive_version).section(' ', 0, 0)));
     else
         label = new QLabel(i18n("This is the first time you run Kdenlive. This wizard will let you adjust some basic settings, you will be ready to edit your first movie in a few seconds..."));
     label->setWordWrap(true);
     m_startLayout = new QVBoxLayout;
     m_startLayout->addWidget(label);
+    QPushButton *but = new QPushButton(KIcon("help-about"), i18n("Discover the features of this Kdenlive release"), this);
+    connect(but, SIGNAL(clicked()), this, SLOT(slotShowWebInfos()));
+    m_startLayout->addStretch();
+    m_startLayout->addWidget(but);
+
+
     page1->setLayout(m_startLayout);
     addPage(page1);
 
@@ -66,32 +80,41 @@ Wizard::Wizard(bool upgrade, QWidget *parent): QWizard(parent)
     m_badIcon = KIcon("dialog-close");
 
     // build profiles lists
-    m_profilesInfo = ProfilesDialog::getProfilesInfo();
-    QMap<QString, QString>::const_iterator i = m_profilesInfo.constBegin();
-    while (i != m_profilesInfo.constEnd()) {
+    QMap<QString, QString> profilesInfo = ProfilesDialog::getProfilesInfo();
+    QMap<QString, QString>::const_iterator i = profilesInfo.constBegin();
+    while (i != profilesInfo.constEnd()) {
         QMap< QString, QString > profileData = ProfilesDialog::getSettingsFromFile(i.value());
-        if (profileData.value("width") == "720") m_dvProfiles.append(i.key());
-        else if (profileData.value("width").toInt() >= 1080) m_hdvProfiles.append(i.key());
-        else m_otherProfiles.append(i.key());
+        if (profileData.value("width") == "720") m_dvProfiles.insert(i.key(), i.value());
+        else if (profileData.value("width").toInt() >= 1080) m_hdvProfiles.insert(i.key(), i.value());
+        else m_otherProfiles.insert(i.key(), i.value());
         ++i;
     }
 
+    m_standard.button_all->setChecked(true);
     connect(m_standard.button_all, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
     connect(m_standard.button_hdv, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
     connect(m_standard.button_dv, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
-    m_standard.button_all->setChecked(true);
+    slotCheckStandard();
     connect(m_standard.profiles_list, SIGNAL(itemSelectionChanged()), this, SLOT(slotCheckSelectedItem()));
 
     // select default profile
-    QList<QListWidgetItem *> profiles = m_standard.profiles_list->findItems(ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()), Qt::MatchExactly);
-    if (profiles.count() > 0) m_standard.profiles_list->setCurrentItem(profiles.at(0));
+    if (!KdenliveSettings::default_profile().isEmpty()) {
+        for (int i = 0; i < m_standard.profiles_list->count(); i++) {
+            if (m_standard.profiles_list->item(i)->data(Qt::UserRole).toString() == KdenliveSettings::default_profile()) {
+                m_standard.profiles_list->setCurrentRow(i);
+                m_standard.profiles_list->scrollToItem(m_standard.profiles_list->currentItem());
+                break;
+            }
+        }
+    }
+
     addPage(page2);
 
     QWizardPage *page3 = new QWizardPage;
     page3->setTitle(i18n("Additional Settings"));
     m_extra.setupUi(page3);
     m_extra.projectfolder->setMode(KFile::Directory);
-    m_extra.projectfolder->setPath(QDir::homePath() + "/kdenlive");
+    m_extra.projectfolder->setUrl(KUrl(KdenliveSettings::defaultprojectfolder()));
     m_extra.videothumbs->setChecked(KdenliveSettings::videothumbnails());
     m_extra.audiothumbs->setChecked(KdenliveSettings::audiothumbnails());
     m_extra.autosave->setChecked(KdenliveSettings::crashrecovery());
@@ -100,6 +123,17 @@ Wizard::Wizard(bool upgrade, QWidget *parent): QWizard(parent)
     slotCheckThumbs();
     addPage(page3);
 
+#ifndef Q_WS_MAC
+    QWizardPage *page6 = new QWizardPage;
+    page6->setTitle(i18n("Webcam"));
+    m_capture.setupUi(page6);
+    connect(m_capture.button_reload, SIGNAL(clicked()), this, SLOT(slotDetectWebcam()));
+    connect(m_capture.v4l_devices, SIGNAL(currentIndexChanged(int)), this, SLOT(slotUpdateCaptureParameters()));
+    connect(m_capture.v4l_formats, SIGNAL(currentIndexChanged(int)), this, SLOT(slotSaveCaptureFormat()));
+    m_capture.button_reload->setIcon(KIcon("view-refresh"));
+
+    addPage(page6);
+#endif
 
     QWizardPage *page5 = new QWizardPage;
     page5->setTitle(i18n("Checking system"));
@@ -108,16 +142,101 @@ Wizard::Wizard(bool upgrade, QWidget *parent): QWizard(parent)
 
     listViewDelegate = new WizardDelegate(m_check.programList);
     m_check.programList->setItemDelegate(listViewDelegate);
-
+    slotDetectWebcam();
     QTimer::singleShot(500, this, SLOT(slotCheckMlt()));
 }
 
+void Wizard::slotDetectWebcam()
+{
+#if !defined(Q_WS_MAC) && !defined(Q_OS_FREEBSD)
+    m_capture.v4l_devices->blockSignals(true);
+    m_capture.v4l_devices->clear();
+
+    // Video 4 Linux device detection
+    for (int i = 0; i < 10; i++) {
+        QString path = "/dev/video" + QString::number(i);
+        if (QFile::exists(path)) {
+            QStringList deviceInfo = V4lCaptureHandler::getDeviceName(path.toUtf8().constData());
+            if (!deviceInfo.isEmpty()) {
+                m_capture.v4l_devices->addItem(deviceInfo.at(0), path);
+                m_capture.v4l_devices->setItemData(m_capture.v4l_devices->count() - 1, deviceInfo.at(1), Qt::UserRole + 1);
+            }
+        }
+    }
+    if (m_capture.v4l_devices->count() > 0) {
+        m_capture.v4l_status->setText(i18n("Select your default video4linux device"));
+        // select default device
+        bool found = false;
+        for (int i = 0; i < m_capture.v4l_devices->count(); i++) {
+            QString device = m_capture.v4l_devices->itemData(i).toString();
+            if (device == KdenliveSettings::video4vdevice()) {
+                m_capture.v4l_devices->setCurrentIndex(i);
+                found = true;
+                break;
+            }
+        }
+        slotUpdateCaptureParameters();
+        if (!found) m_capture.v4l_devices->setCurrentIndex(0);
+    } else m_capture.v4l_status->setText(i18n("No device found, plug your webcam and refresh."));
+    m_capture.v4l_devices->blockSignals(false);
+#endif
+}
+
+void Wizard::slotUpdateCaptureParameters()
+{
+    QString device = m_capture.v4l_devices->itemData(m_capture.v4l_devices->currentIndex()).toString();
+    if (!device.isEmpty()) KdenliveSettings::setVideo4vdevice(device);
+
+    QString formats = m_capture.v4l_devices->itemData(m_capture.v4l_devices->currentIndex(), Qt::UserRole + 1).toString();
+
+    m_capture.v4l_formats->blockSignals(true);
+    m_capture.v4l_formats->clear();
+
+    QString vl4ProfilePath = KStandardDirs::locateLocal("appdata", "profiles/video4linux");
+    if (QFile::exists(vl4ProfilePath)) {
+        MltVideoProfile profileInfo = ProfilesDialog::getVideoProfile(vl4ProfilePath);
+        m_capture.v4l_formats->addItem(i18n("Current settings (%1x%2, %3/%4fps)", profileInfo.width, profileInfo.height, profileInfo.frame_rate_num, profileInfo.frame_rate_den), QStringList() << QString("unknown") <<QString::number(profileInfo.width)<<QString::number(profileInfo.height)<<QString::number(profileInfo.frame_rate_num)<<QString::number(profileInfo.frame_rate_den));
+    }
+    QStringList pixelformats = formats.split(">", QString::SkipEmptyParts);
+    QString itemSize;
+    QString pixelFormat;
+    QStringList itemRates;
+    for (int i = 0; i < pixelformats.count(); i++) {
+        QString format = pixelformats.at(i).section(':', 0, 0);
+        QStringList sizes = pixelformats.at(i).split(":", QString::SkipEmptyParts);
+        pixelFormat = sizes.takeFirst();
+        for (int j = 0; j < sizes.count(); j++) {
+            itemSize = sizes.at(j).section("=", 0, 0);
+            itemRates = sizes.at(j).section("=", 1, 1).split(",", QString::SkipEmptyParts);
+            for (int k = 0; k < itemRates.count(); k++) {
+                m_capture.v4l_formats->addItem("[" + format + "] " + itemSize + " (" + itemRates.at(k) + ")", QStringList() << format << itemSize.section('x', 0, 0) << itemSize.section('x', 1, 1) << itemRates.at(k).section('/', 0, 0) << itemRates.at(k).section('/', 1, 1));
+            }
+        }
+    }
+    if (!QFile::exists(vl4ProfilePath)) {
+        if (m_capture.v4l_formats->count() > 9) slotSaveCaptureFormat();
+        else {
+            // No existing profile and no autodetected profiles
+            MltVideoProfile profileInfo;
+            profileInfo.width = 320;
+            profileInfo.height = 200;
+            profileInfo.frame_rate_num = 15;
+            profileInfo.frame_rate_den = 1;
+            profileInfo.display_aspect_num = 4;
+            profileInfo.display_aspect_den = 3;
+            profileInfo.sample_aspect_num = 1;
+            profileInfo.sample_aspect_den = 1;
+            profileInfo.progressive = 1;
+            profileInfo.colorspace = 601;
+            ProfilesDialog::saveProfile(profileInfo, vl4ProfilePath);
+            m_capture.v4l_formats->addItem(i18n("Default settings (%1x%2, %3/%4fps)", profileInfo.width, profileInfo.height, profileInfo.frame_rate_num, profileInfo.frame_rate_den), QStringList() << QString("unknown") <<QString::number(profileInfo.width)<<QString::number(profileInfo.height)<<QString::number(profileInfo.frame_rate_num)<<QString::number(profileInfo.frame_rate_den));
+        }
+    }
+    m_capture.v4l_formats->blockSignals(false);
+}
 
 void Wizard::checkMltComponents()
 {
-    m_mltCheck.programList->setColumnCount(2);
-    m_mltCheck.programList->setRootIsDecorated(false);
-    m_mltCheck.programList->setHeaderHidden(true);
     QSize itemSize(20, fontMetrics().height() * 2.5);
     m_mltCheck.programList->setColumnWidth(0, 30);
     m_mltCheck.programList->setIconSize(QSize(24, 24));
@@ -125,17 +244,17 @@ void Wizard::checkMltComponents()
 
     QTreeWidgetItem *mltitem = new QTreeWidgetItem(m_mltCheck.programList);
 
-    QTreeWidgetItem *inigoitem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Inigo") + " (" + KdenliveSettings::rendererpath() + ')');
-    inigoitem->setData(1, Qt::UserRole, i18n("Required for rendering (part of MLT package)"));
-    inigoitem->setSizeHint(0, itemSize);
-    inigoitem->setIcon(0, m_okIcon);
+    QTreeWidgetItem *meltitem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Melt") + " (" + KdenliveSettings::rendererpath() + ')');
+    meltitem->setData(1, Qt::UserRole, i18n("Required for rendering (part of MLT package)"));
+    meltitem->setSizeHint(0, itemSize);
+    meltitem->setIcon(0, m_okIcon);
 
     // Check MLT's installed producers
     QProcess checkProcess;
     checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "producer");
     if (!checkProcess.waitForStarted()) {
-        inigoitem->setIcon(0, m_badIcon);
-        inigoitem->setData(1, Qt::UserRole, i18n("Error starting MLT's command line player (inigo)"));
+        meltitem->setIcon(0, m_badIcon);
+        meltitem->setData(1, Qt::UserRole, i18n("Error starting MLT's command line player (melt)"));
         button(QWizard::NextButton)->setEnabled(false);
     } else {
         checkProcess.waitForFinished();
@@ -151,20 +270,18 @@ void Wizard::checkMltComponents()
         } else {
             avformatItem->setIcon(0, m_okIcon);
             // Make sure we have MLT > 0.3.4
-            bool recentMlt = false;
             int version = 0;
             QString mltVersion;
             QString exepath = KStandardDirs::findExe("pkg-config");
             if (!exepath.isEmpty()) {
-                checkProcess.start(exepath, QStringList() << "--variable=version" << "mlt-framework");
+                checkProcess.start(exepath, QStringList() << "--variable=version" << "mlt++");
                 if (!checkProcess.waitForStarted()) {
                     kDebug() << "// Error querying MLT's version";
                 } else {
                     checkProcess.waitForFinished();
                     mltVersion = checkProcess.readAllStandardOutput();
-                    version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
+                    version = 1000 * mltVersion.section('.', 0, 0).toInt() + 100 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
                     kDebug() << "// FOUND MLT's pkgconfig version: " << version;
-                    if (version > 34) recentMlt = true;
                 }
             }
             if (version == 0) {
@@ -176,23 +293,24 @@ void Wizard::checkMltComponents()
                     mltVersion = checkProcess.readAllStandardError();
                     mltVersion = mltVersion.section('\n', 0, 0).simplified();
                     mltVersion = mltVersion.section(' ', -1).simplified();
-                    version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
+                    version = 1000 * mltVersion.section('.', 0, 0).toInt() + 100 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
                     kDebug() << "// FOUND MLT version: " << version;
-                    if (version > 34) recentMlt = true;
                 }
             }
 
             mltitem->setText(1, i18n("MLT version: %1", mltVersion.simplified()));
             mltitem->setSizeHint(0, itemSize);
-            if (version < recommendedMltVersion) {
-                mltitem->setData(1, Qt::UserRole, i18n("Please upgrade to the latest MLT version"));
+            if (version < 506) {
+                mltitem->setData(1, Qt::UserRole, i18n("Your MLT version is unsupported!!!"));
                 mltitem->setIcon(0, m_badIcon);
             } else {
-                mltitem->setData(1, Qt::UserRole, i18n("MLT version is correct"));
-                mltitem->setIcon(0, m_okIcon);
-            }
-
-            if (recentMlt) {
+                if (version < recommendedMltVersion) {
+                    mltitem->setData(1, Qt::UserRole, i18n("Please upgrade to the latest MLT version"));
+                    mltitem->setIcon(0, m_badIcon);
+                } else {
+                    mltitem->setData(1, Qt::UserRole, i18n("MLT version is correct"));
+                    mltitem->setIcon(0, m_okIcon);
+                }
                 // Check installed audio codecs
                 QProcess checkProcess2;
                 checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "noise:" << "-consumer" << "avformat" << "acodec=list");
@@ -281,14 +399,23 @@ void Wizard::checkMltComponents()
         } else {
             imageItem->setIcon(0, m_okIcon);
         }
+
+        // Check MLT title module
+        QTreeWidgetItem *titleItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Title module"));
+        titleItem->setData(1, Qt::UserRole, i18n("Required to work with titles"));
+        titleItem->setSizeHint(0, itemSize);
+        if (!result.contains("- kdenlivetitle")) {
+            KdenliveSettings::setHastitleproducer(false);
+            titleItem->setIcon(0, m_badIcon);
+        } else {
+            titleItem->setIcon(0, m_okIcon);
+            KdenliveSettings::setHastitleproducer(true);
+        }
     }
 }
 
 void Wizard::slotCheckPrograms()
 {
-    m_check.programList->setColumnCount(2);
-    m_check.programList->setRootIsDecorated(false);
-    m_check.programList->setHeaderHidden(true);
     QSize itemSize(20, fontMetrics().height() * 2.5);
     m_check.programList->setColumnWidth(0, 30);
     m_check.programList->setIconSize(QSize(24, 24));
@@ -301,30 +428,60 @@ void Wizard::slotCheckPrograms()
     else if (KStandardDirs::findExe("ffplay").isEmpty()) item->setIcon(0, m_badIcon);
     else item->setIcon(0, m_okIcon);
 
-    item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Recordmydesktop"));
+#ifndef Q_WS_MAC
+    item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("recordmydesktop"));
     item->setData(1, Qt::UserRole, i18n("Required for screen capture"));
     item->setSizeHint(0, itemSize);
     if (KStandardDirs::findExe("recordmydesktop").isEmpty()) item->setIcon(0, m_badIcon);
     else item->setIcon(0, m_okIcon);
 
-    item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Dvgrab"));
+    item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("dvgrab"));
     item->setData(1, Qt::UserRole, i18n("Required for firewire capture"));
     item->setSizeHint(0, itemSize);
     if (KStandardDirs::findExe("dvgrab").isEmpty()) item->setIcon(0, m_badIcon);
     else item->setIcon(0, m_okIcon);
+#endif
 
-    item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Dvdauthor"));
+    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, m_badIcon);
     else item->setIcon(0, m_okIcon);
 
-    item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Mkisofs"));
+
+    item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("genisoimage or 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, m_badIcon);
-    else item->setIcon(0, m_okIcon);
-
+    if (KStandardDirs::findExe("genisoimage").isEmpty()) {
+        // no GenIso, check for mkisofs
+        if (!KStandardDirs::findExe("mkisofs").isEmpty()) {
+            item->setIcon(0, m_okIcon);
+        } else item->setIcon(0, m_badIcon);
+    } else item->setIcon(0, m_okIcon);
+    
+    item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("xine"));
+    item->setData(1, Qt::UserRole, i18n("Required to preview your DVD"));
+    item->setSizeHint(0, itemSize);
+    if (KStandardDirs::findExe("xine").isEmpty()) item->setIcon(0, m_badIcon);
+    else item->setIcon(0, m_okIcon); 
+    
+    // set up some default applications
+    QString program;
+    if (KdenliveSettings::defaultimageapp().isEmpty()) {
+        program = KStandardDirs::findExe("gimp");
+        if (program.isEmpty()) program = KStandardDirs::findExe("krita");
+        if (!program.isEmpty()) KdenliveSettings::setDefaultimageapp(program);
+    }
+    if (KdenliveSettings::defaultaudioapp().isEmpty()) {
+        program = KStandardDirs::findExe("audacity");
+        if (program.isEmpty()) program = KStandardDirs::findExe("traverso");
+        if (!program.isEmpty()) KdenliveSettings::setDefaultaudioapp(program);
+    }
+    if (KdenliveSettings::defaultplayerapp().isEmpty()) {
+        KService::Ptr offer = KMimeTypeTrader::self()->preferredService("video/mpeg");
+        if (offer)
+            KdenliveSettings::setDefaultplayerapp(KRun::binaryName(offer->exec(), true));
+    }
 }
 
 void Wizard::installExtraMimes(QString baseName, QStringList globs)
@@ -337,7 +494,7 @@ void Wizard::installExtraMimes(QString baseName, QStringList globs)
     } else {
         QStringList extensions = mime->patterns();
         QString comment = mime->comment();
-        foreach(const QString &glob, globs) {
+        foreach(const QString & glob, globs) {
             if (!extensions.contains(glob)) extensions << glob;
         }
         kDebug() << "EXTS: " << extensions;
@@ -364,7 +521,7 @@ void Wizard::installExtraMimes(QString baseName, QStringList globs)
             writer.writeEndElement(); // comment
         }
 
-        foreach(const QString& pattern, extensions) {
+        foreach(const QString & pattern, extensions) {
             writer.writeStartElement(nsUri, "glob");
             writer.writeAttribute("pattern", pattern);
             writer.writeEndElement(); // glob
@@ -407,23 +564,39 @@ void Wizard::slotCheckStandard()
 {
     m_standard.profiles_list->clear();
     QStringList profiles;
-    if (m_standard.button_dv->isChecked()) {
+    if (!m_standard.button_hdv->isChecked()) {
         // DV standard
-        m_standard.profiles_list->addItems(m_dvProfiles);
-    } else if (m_standard.button_hdv->isChecked()) {
+        QMapIterator<QString, QString> i(m_dvProfiles);
+        while (i.hasNext()) {
+            i.next();
+            QListWidgetItem *item = new QListWidgetItem(i.key(), m_standard.profiles_list);
+            item->setData(Qt::UserRole, i.value());
+        }
+    }
+    if (!m_standard.button_dv->isChecked()) {
         // HDV standard
-        m_standard.profiles_list->addItems(m_hdvProfiles);
-    } else {
-        m_standard.profiles_list->addItems(m_dvProfiles);
-        m_standard.profiles_list->addItems(m_hdvProfiles);
-        m_standard.profiles_list->addItems(m_otherProfiles);
+        QMapIterator<QString, QString> i(m_hdvProfiles);
+        while (i.hasNext()) {
+            i.next();
+            QListWidgetItem *item = new QListWidgetItem(i.key(), m_standard.profiles_list);
+            item->setData(Qt::UserRole, i.value());
+        }
+    }
+    if (m_standard.button_all->isChecked()) {
+        QMapIterator<QString, QString> i(m_otherProfiles);
+        while (i.hasNext()) {
+            i.next();
+            QListWidgetItem *item = new QListWidgetItem(i.key(), m_standard.profiles_list);
+            item->setData(Qt::UserRole, i.value());
+        }
         //m_standard.profiles_list->sortItems();
     }
 
     for (int i = 0; i < m_standard.profiles_list->count(); i++) {
         QListWidgetItem *item = m_standard.profiles_list->item(i);
-        MltVideoProfile prof = ProfilesDialog::getVideoProfile(m_profilesInfo.value(item->text()));
-        const QString infoString = ("<strong>" + i18n("Frame size:") + " </strong>%1x%2<br /><strong>" + i18n("Frame rate:") + " </strong>%3/%4<br /><strong>" + i18n("Pixel aspect ratio:") + "</strong>%5/%6<br /><strong>" + i18n("Display aspect ratio:") + " </strong>%7/%8").arg(QString::number(prof.width), QString::number(prof.height), QString::number(prof.frame_rate_num), QString::number(prof.frame_rate_den), QString::number(prof.sample_aspect_num), QString::number(prof.sample_aspect_den), QString::number(prof.display_aspect_num), QString::number(prof.display_aspect_den));
+
+        QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(item->data(Qt::UserRole).toString());
+        const QString infoString = ("<strong>" + i18n("Frame size:") + " </strong>%1x%2<br /><strong>" + i18n("Frame rate:") + " </strong>%3/%4<br /><strong>" + i18n("Pixel aspect ratio:") + "</strong>%5/%6<br /><strong>" + i18n("Display aspect ratio:") + " </strong>%7/%8").arg(values.value("width"), values.value("height"), values.value("frame_rate_num"), values.value("frame_rate_den"), values.value("sample_aspect_num"), values.value("sample_aspect_den"), values.value("display_aspect_num"), values.value("display_aspect_den"));
         item->setToolTip(infoString);
     }
 
@@ -442,7 +615,7 @@ void Wizard::adjustSettings()
 {
     if (m_extra.installmimes->isChecked()) {
         QStringList globs;
-        globs << "*.mts" << "*.m2t" << "*.mod" << "*.ts";
+        globs << "*.mts" << "*.m2t" << "*.mod" << "*.ts" << "*.m2ts";
         installExtraMimes("video/mpeg", globs);
         globs.clear();
         globs << "*.dv";
@@ -453,13 +626,14 @@ void Wizard::adjustSettings()
     KdenliveSettings::setVideothumbnails(m_extra.videothumbs->isChecked());
     KdenliveSettings::setCrashrecovery(m_extra.autosave->isChecked());
     if (m_standard.profiles_list->currentItem()) {
-        QString selectedProfile = m_profilesInfo.value(m_standard.profiles_list->currentItem()->text());
+        QString selectedProfile = m_standard.profiles_list->currentItem()->data(Qt::UserRole).toString();
         if (selectedProfile.isEmpty()) selectedProfile = "dv_pal";
         KdenliveSettings::setDefault_profile(selectedProfile);
     }
     QString path = m_extra.projectfolder->url().path();
-    if (KStandardDirs::makeDir(path) == false) kDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path;
-    KdenliveSettings::setDefaultprojectfolder(path);
+    if (KStandardDirs::makeDir(path) == false) {
+        kDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path;
+    } else KdenliveSettings::setDefaultprojectfolder(path);
 
 }
 
@@ -467,12 +641,12 @@ void Wizard::slotCheckMlt()
 {
     QString errorMessage;
     if (KdenliveSettings::rendererpath().isEmpty()) {
-        errorMessage.append(i18n("your MLT installation cannot be found. Install MLT and restart Kdenlive.\n"));
+        errorMessage.append(i18n("Your MLT installation cannot be found. Install MLT and restart Kdenlive.\n"));
     }
     /*QProcess checkProcess;
     checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "producer");
     if (!checkProcess.waitForStarted())
-        errorMessage.append(i18n("Error starting MLT's command line player (inigo)") + ".\n");
+        errorMessage.append(i18n("Error starting MLT's command line player (melt)") + ".\n");
 
     checkProcess.waitForFinished();
 
@@ -482,7 +656,7 @@ void Wizard::slotCheckMlt()
     QProcess checkProcess2;
     checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "consumer");
     if (!checkProcess2.waitForStarted())
-        errorMessage.append(i18n("Error starting MLT's command line player (inigo).") + '\n');
+        errorMessage.append(i18n("Error starting MLT's command line player (melt).") + '\n');
 
     checkProcess2.waitForFinished();
 
@@ -490,7 +664,7 @@ void Wizard::slotCheckMlt()
     if (!result.contains("sdl") || !result.contains("sdl_preview")) errorMessage.append(i18n("MLT's SDL module not found. Please check your MLT install. Kdenlive will not work until this issue is fixed.") + '\n');
 
     if (!errorMessage.isEmpty()) {
-        errorMessage.prepend(QString("<b>%1</b><br>").arg(i18n("Fatal Error")));
+        errorMessage.prepend(QString("<b>%1</b><br />").arg(i18n("Fatal Error")));
         QLabel *pix = new QLabel();
         pix->setPixmap(KIcon("dialog-error").pixmap(30));
         QLabel *label = new QLabel(errorMessage);
@@ -511,4 +685,29 @@ bool Wizard::isOk() const
     return m_systemCheckIsOk;
 }
 
+void Wizard::slotShowWebInfos()
+{
+    KRun::runUrl(KUrl("http://kdenlive.org/discover/" + QString(kdenlive_version).section(' ', 0, 0)), "text/html", this);
+}
+
+void Wizard::slotSaveCaptureFormat()
+{
+    QStringList format = m_capture.v4l_formats->itemData(m_capture.v4l_formats->currentIndex()).toStringList();
+    if (format.isEmpty()) return;
+    MltVideoProfile profile;
+    profile.description = "Video4Linux capture";
+    profile.colorspace = 601;
+    profile.width = format.at(1).toInt();
+    profile.height = format.at(2).toInt();
+    profile.sample_aspect_num = 1;
+    profile.sample_aspect_den = 1;
+    profile.display_aspect_num = format.at(1).toInt();
+    profile.display_aspect_den = format.at(2).toInt();
+    profile.frame_rate_num = format.at(3).toInt();
+    profile.frame_rate_den = format.at(4).toInt();
+    profile.progressive = 1;
+    QString vl4ProfilePath = KStandardDirs::locateLocal("appdata", "profiles/video4linux");
+    ProfilesDialog::saveProfile(profile, vl4ProfilePath);
+}
+
 #include "wizard.moc"