]> git.sesse.net Git - kdenlive/blob - src/wizard.cpp
fix a typo and set mlt 0.4.0 as the minimum version supported
[kdenlive] / src / wizard.cpp
1 /***************************************************************************
2  *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20 #include "wizard.h"
21 #include "kdenlivesettings.h"
22 #include "profilesdialog.h"
23
24 #include <KStandardDirs>
25 #include <KLocale>
26 #include <KProcess>
27 #include <kmimetype.h>
28
29 #include <QLabel>
30 #include <QFile>
31 #include <QXmlStreamWriter>
32 #include <QTimer>
33
34 const double recommendedMltVersion = 40;
35
36 Wizard::Wizard(bool upgrade, QWidget *parent) :
37         QWizard(parent)
38 {
39     setPixmap(QWizard::WatermarkPixmap, QPixmap(KStandardDirs::locate("appdata", "banner.png")));
40
41     QWizardPage *page1 = new QWizardPage;
42     page1->setTitle(i18n("Welcome"));
43     QLabel *label;
44     if (upgrade)
45         label = new QLabel(i18n("Your Kdenlive version was upgraded. Please take some time to review the basic settings"));
46     else
47         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..."));
48     label->setWordWrap(true);
49     m_startLayout = new QVBoxLayout;
50     m_startLayout->addWidget(label);
51     page1->setLayout(m_startLayout);
52     addPage(page1);
53
54     QWizardPage *page4 = new QWizardPage;
55     page4->setTitle(i18n("Checking MLT engine"));
56     m_mltCheck.setupUi(page4);
57     addPage(page4);
58
59     WizardDelegate *listViewDelegate = new WizardDelegate(m_mltCheck.programList);
60     m_mltCheck.programList->setItemDelegate(listViewDelegate);
61
62     QWizardPage *page2 = new QWizardPage;
63     page2->setTitle(i18n("Video Standard"));
64     m_standard.setupUi(page2);
65
66     m_okIcon = KIcon("dialog-ok");
67     m_badIcon = KIcon("dialog-close");
68
69     // build profiles lists
70     QMap<QString, QString> profilesInfo = ProfilesDialog::getProfilesInfo();
71     QMap<QString, QString>::const_iterator i = profilesInfo.constBegin();
72     while (i != profilesInfo.constEnd()) {
73         QMap< QString, QString > profileData = ProfilesDialog::getSettingsFromFile(i.value());
74         if (profileData.value("width") == "720") m_dvProfiles.insert(i.key(), i.value());
75         else if (profileData.value("width").toInt() >= 1080) m_hdvProfiles.insert(i.key(), i.value());
76         else m_otherProfiles.insert(i.key(), i.value());
77         ++i;
78     }
79
80     m_standard.button_all->setChecked(true);
81     connect(m_standard.button_all, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
82     connect(m_standard.button_hdv, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
83     connect(m_standard.button_dv, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
84     slotCheckStandard();
85     connect(m_standard.profiles_list, SIGNAL(itemSelectionChanged()), this, SLOT(slotCheckSelectedItem()));
86
87
88     if (!KdenliveSettings::default_profile().isEmpty()) {
89         for (int i = 0; i < m_standard.profiles_list->count(); i++) {
90             if (m_standard.profiles_list->item(i)->data(Qt::UserRole).toString() == KdenliveSettings::default_profile()) {
91                 m_standard.profiles_list->setCurrentRow(i);
92                 m_standard.profiles_list->scrollToItem(m_standard.profiles_list->currentItem());
93                 break;
94             }
95         }
96     }
97
98     // select default profile
99     fprintf(stderr, "LOOKING FOR: %s", ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()).toUtf8().data());
100     QList<QListWidgetItem *> profiles = m_standard.profiles_list->findItems(ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()), Qt::MatchExactly);
101     if (profiles.count() > 0) m_standard.profiles_list->setCurrentItem(profiles.at(0));
102
103     fprintf(stderr, "LOOKING FOR: %s // %d", ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()).toUtf8().data(), profiles.count());
104     addPage(page2);
105
106     QWizardPage *page3 = new QWizardPage;
107     page3->setTitle(i18n("Additional Settings"));
108     m_extra.setupUi(page3);
109     m_extra.projectfolder->setMode(KFile::Directory);
110     m_extra.projectfolder->setPath(KdenliveSettings::defaultprojectfolder());
111     m_extra.videothumbs->setChecked(KdenliveSettings::videothumbnails());
112     m_extra.audiothumbs->setChecked(KdenliveSettings::audiothumbnails());
113     m_extra.autosave->setChecked(KdenliveSettings::crashrecovery());
114     connect(m_extra.videothumbs, SIGNAL(stateChanged(int)), this, SLOT(slotCheckThumbs()));
115     connect(m_extra.audiothumbs, SIGNAL(stateChanged(int)), this, SLOT(slotCheckThumbs()));
116     slotCheckThumbs();
117     addPage(page3);
118
119
120     QWizardPage *page5 = new QWizardPage;
121     page5->setTitle(i18n("Checking system"));
122     m_check.setupUi(page5);
123     addPage(page5);
124
125     listViewDelegate = new WizardDelegate(m_check.programList);
126     m_check.programList->setItemDelegate(listViewDelegate);
127
128     QTimer::singleShot(500, this, SLOT(slotCheckMlt()));
129 }
130
131
132 void Wizard::checkMltComponents()
133 {
134     m_mltCheck.programList->setColumnCount(2);
135     m_mltCheck.programList->setRootIsDecorated(false);
136     m_mltCheck.programList->setHeaderHidden(true);
137     QSize itemSize(20, fontMetrics().height() * 2.5);
138     m_mltCheck.programList->setColumnWidth(0, 30);
139     m_mltCheck.programList->setIconSize(QSize(24, 24));
140
141
142     QTreeWidgetItem *mltitem = new QTreeWidgetItem(m_mltCheck.programList);
143
144     QTreeWidgetItem *meltitem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Melt") + " (" + KdenliveSettings::rendererpath() + ')');
145     meltitem->setData(1, Qt::UserRole, i18n("Required for rendering (part of MLT package)"));
146     meltitem->setSizeHint(0, itemSize);
147     meltitem->setIcon(0, m_okIcon);
148
149     // Check MLT's installed producers
150     QProcess checkProcess;
151     checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "producer");
152     if (!checkProcess.waitForStarted()) {
153         meltitem->setIcon(0, m_badIcon);
154         meltitem->setData(1, Qt::UserRole, i18n("Error starting MLT's command line player (melt)"));
155         button(QWizard::NextButton)->setEnabled(false);
156     } else {
157         checkProcess.waitForFinished();
158         QByteArray result = checkProcess.readAllStandardError();
159
160         // Check MLT avformat module
161         QTreeWidgetItem *avformatItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Avformat module (FFmpeg)"));
162         avformatItem->setData(1, Qt::UserRole, i18n("Required to work with various video formats (hdv, mpeg, flash, ...)"));
163         avformatItem->setSizeHint(0, itemSize);
164         if (!result.contains("- avformat")) {
165             avformatItem->setIcon(0, m_badIcon);
166             m_mltCheck.tabWidget->setTabEnabled(1, false);
167         } else {
168             avformatItem->setIcon(0, m_okIcon);
169             // Make sure we have MLT > 0.3.4
170             bool recentMlt = false;
171             int version = 0;
172             QString mltVersion;
173             QString exepath = KStandardDirs::findExe("pkg-config");
174             if (!exepath.isEmpty()) {
175                 checkProcess.start(exepath, QStringList() << "--variable=version" << "mlt++");
176                 if (!checkProcess.waitForStarted()) {
177                     kDebug() << "// Error querying MLT's version";
178                 } else {
179                     checkProcess.waitForFinished();
180                     mltVersion = checkProcess.readAllStandardOutput();
181                     version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
182                     kDebug() << "// FOUND MLT's pkgconfig version: " << version;
183                     if (version > 34) recentMlt = true;
184                 }
185             }
186             if (version == 0) {
187                 checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "--version");
188                 if (!checkProcess.waitForStarted()) {
189                     kDebug() << "// Error querying MLT's version";
190                 } else {
191                     checkProcess.waitForFinished();
192                     mltVersion = checkProcess.readAllStandardError();
193                     mltVersion = mltVersion.section('\n', 0, 0).simplified();
194                     mltVersion = mltVersion.section(' ', -1).simplified();
195                     version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
196                     kDebug() << "// FOUND MLT version: " << version;
197                     if (version >= 40) recentMlt = true;
198                 }
199             }
200
201             mltitem->setText(1, i18n("MLT version: %1", mltVersion.simplified()));
202             mltitem->setSizeHint(0, itemSize);
203             if (version < recommendedMltVersion) {
204                 mltitem->setData(1, Qt::UserRole, i18n("Please upgrade to the latest MLT version"));
205                 mltitem->setIcon(0, m_badIcon);
206             } else {
207                 mltitem->setData(1, Qt::UserRole, i18n("MLT version is correct"));
208                 mltitem->setIcon(0, m_okIcon);
209             }
210
211             if (recentMlt) {
212                 // Check installed audio codecs
213                 QProcess checkProcess2;
214                 checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "noise:" << "-consumer" << "avformat" << "acodec=list");
215                 if (!checkProcess2.waitForStarted()) {
216                     m_mltCheck.tabWidget->setTabEnabled(1, false);
217                     kDebug() << "// Error parsing MLT's avformat codecs";
218                 } else {
219                     checkProcess2.waitForFinished();
220                     QByteArray codecList = checkProcess2.readAllStandardError();
221                     QString acodecList(codecList);
222                     QStringList result;
223                     QStringList alist = acodecList.split('\n', QString::SkipEmptyParts);
224                     for (int i = 0; i < alist.count(); i++) {
225                         if (alist.at(i).contains("- ")) result.append(alist.at(i).section("- ", 1).simplified().toLower());
226                     }
227                     m_mltCheck.acodecs_list->addItems(result);
228                     KdenliveSettings::setAudiocodecs(result);
229                     //kDebug()<<"// FOUND LIST:\n\n"<<m_audioCodecs<<"\n\n++++++++++++++++++++";
230                 }
231                 // Check video codecs
232                 checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "noise:" << "-consumer" << "avformat" << "vcodec=list");
233                 if (!checkProcess2.waitForStarted()) {
234                     kDebug() << "// Error parsing MLT's avformat codecs";
235                 } else {
236                     checkProcess2.waitForFinished();
237                     QByteArray codecList = checkProcess2.readAllStandardError();
238                     QString vcodecList(codecList);
239                     QStringList result;
240                     QStringList vlist = vcodecList.split('\n', QString::SkipEmptyParts);
241                     for (int i = 0; i < vlist.count(); i++) {
242                         if (vlist.at(i).contains("- ")) result.append(vlist.at(i).section("- ", 1).simplified().toLower());
243                     }
244                     m_mltCheck.vcodecs_list->addItems(result);
245                     KdenliveSettings::setVideocodecs(result);
246                     //kDebug()<<"// FOUND LIST:\n\n"<<m_videoCodecs<<"\n\n++++++++++++++++++++";
247                 }
248                 // Check formats
249                 checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "noise:" << "-consumer" << "avformat" << "f=list");
250                 if (!checkProcess2.waitForStarted()) {
251                     kDebug() << "// Error parsing MLT's avformat codecs";
252                 } else {
253                     checkProcess2.waitForFinished();
254                     QByteArray codecList = checkProcess2.readAllStandardError();
255                     QString vcodecList(codecList);
256                     QStringList result;
257                     QStringList vlist = vcodecList.split('\n', QString::SkipEmptyParts);
258                     for (int i = 0; i < vlist.count(); i++) {
259                         if (vlist.at(i).contains("- ")) {
260                             QString format = vlist.at(i).section("- ", 1).simplified().toLower();
261                             if (format.contains(',')) {
262                                 QStringList sub = format.split(',', QString::SkipEmptyParts);
263                                 for (int j = 0; j < sub.count(); j++)
264                                     result.append(sub.at(j));
265                             } else result.append(format);
266                         }
267                     }
268                     m_mltCheck.formats_list->addItems(result);
269                     KdenliveSettings::setSupportedformats(result);
270                     //kDebug()<<"// FOUND LIST:\n\n"<<m_videoCodecs<<"\n\n++++++++++++++++++++";
271                 }
272             }
273
274         }
275
276         // Check MLT dv module
277         QTreeWidgetItem *dvItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("DV module (libdv)"));
278         dvItem->setData(1, Qt::UserRole, i18n("Required to work with dv files if avformat module is not installed"));
279         dvItem->setSizeHint(0, itemSize);
280         if (!result.contains("- libdv")) {
281             dvItem->setIcon(0, m_badIcon);
282         } else {
283             dvItem->setIcon(0, m_okIcon);
284         }
285
286         // Check MLT image format module
287         QTreeWidgetItem *imageItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("QImage module"));
288         imageItem->setData(1, Qt::UserRole, i18n("Required to work with images"));
289         imageItem->setSizeHint(0, itemSize);
290         if (!result.contains("- qimage")) {
291             imageItem->setIcon(0, m_badIcon);
292             imageItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Pixbuf module"));
293             imageItem->setData(1, Qt::UserRole, i18n("Required to work with images"));
294             imageItem->setSizeHint(0, itemSize);
295             if (!result.contains("- pixbuf")) imageItem->setIcon(0, m_badIcon);
296             else imageItem->setIcon(0, m_okIcon);
297         } else {
298             imageItem->setIcon(0, m_okIcon);
299         }
300     }
301 }
302
303 void Wizard::slotCheckPrograms()
304 {
305     m_check.programList->setColumnCount(2);
306     m_check.programList->setRootIsDecorated(false);
307     m_check.programList->setHeaderHidden(true);
308     QSize itemSize(20, fontMetrics().height() * 2.5);
309     m_check.programList->setColumnWidth(0, 30);
310     m_check.programList->setIconSize(QSize(24, 24));
311
312     QTreeWidgetItem *item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("FFmpeg & ffplay"));
313     item->setData(1, Qt::UserRole, i18n("Required for webcam capture"));
314     item->setSizeHint(0, itemSize);
315     QString exepath = KStandardDirs::findExe("ffmpeg");
316     if (exepath.isEmpty()) item->setIcon(0, m_badIcon);
317     else if (KStandardDirs::findExe("ffplay").isEmpty()) item->setIcon(0, m_badIcon);
318     else item->setIcon(0, m_okIcon);
319
320     item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Recordmydesktop"));
321     item->setData(1, Qt::UserRole, i18n("Required for screen capture"));
322     item->setSizeHint(0, itemSize);
323     if (KStandardDirs::findExe("recordmydesktop").isEmpty()) item->setIcon(0, m_badIcon);
324     else item->setIcon(0, m_okIcon);
325
326     item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Dvgrab"));
327     item->setData(1, Qt::UserRole, i18n("Required for firewire capture"));
328     item->setSizeHint(0, itemSize);
329     if (KStandardDirs::findExe("dvgrab").isEmpty()) item->setIcon(0, m_badIcon);
330     else item->setIcon(0, m_okIcon);
331
332     item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Dvdauthor"));
333     item->setData(1, Qt::UserRole, i18n("Required for creation of DVD"));
334     item->setSizeHint(0, itemSize);
335     if (KStandardDirs::findExe("dvdauthor").isEmpty()) item->setIcon(0, m_badIcon);
336     else item->setIcon(0, m_okIcon);
337
338     item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Mkisofs"));
339     item->setData(1, Qt::UserRole, i18n("Required for creation of DVD ISO images"));
340     item->setSizeHint(0, itemSize);
341     if (KStandardDirs::findExe("mkisofs").isEmpty()) item->setIcon(0, m_badIcon);
342     else item->setIcon(0, m_okIcon);
343
344 }
345
346 void Wizard::installExtraMimes(QString baseName, QStringList globs)
347 {
348     QString mimefile = baseName;
349     mimefile.replace('/', '-');
350     KMimeType::Ptr mime = KMimeType::mimeType(baseName);
351     if (!mime) {
352         kDebug() << "KMimeTypeTrader: mimeType " << baseName << " not found";
353     } else {
354         QStringList extensions = mime->patterns();
355         QString comment = mime->comment();
356         foreach(const QString &glob, globs) {
357             if (!extensions.contains(glob)) extensions << glob;
358         }
359         kDebug() << "EXTS: " << extensions;
360         QString packageFileName = KStandardDirs::locateLocal("xdgdata-mime", "packages/" + mimefile + ".xml");
361         kDebug() << "INSTALLING NEW MIME TO: " << packageFileName;
362         QFile packageFile(packageFileName);
363         if (!packageFile.open(QIODevice::WriteOnly)) {
364             kError() << "Couldn't open" << packageFileName << "for writing";
365             return;
366         }
367         QXmlStreamWriter writer(&packageFile);
368         writer.setAutoFormatting(true);
369         writer.writeStartDocument();
370
371         const QString nsUri = "http://www.freedesktop.org/standards/shared-mime-info";
372         writer.writeDefaultNamespace(nsUri);
373         writer.writeStartElement("mime-info");
374         writer.writeStartElement(nsUri, "mime-type");
375         writer.writeAttribute("type", baseName);
376
377         if (!comment.isEmpty()) {
378             writer.writeStartElement(nsUri, "comment");
379             writer.writeCharacters(comment);
380             writer.writeEndElement(); // comment
381         }
382
383         foreach(const QString& pattern, extensions) {
384             writer.writeStartElement(nsUri, "glob");
385             writer.writeAttribute("pattern", pattern);
386             writer.writeEndElement(); // glob
387         }
388
389         writer.writeEndElement(); // mime-info
390         writer.writeEndElement(); // mime-type
391         writer.writeEndDocument();
392     }
393 }
394
395 void Wizard::runUpdateMimeDatabase()
396 {
397     const QString localPackageDir = KStandardDirs::locateLocal("xdgdata-mime", QString());
398     //Q_ASSERT(!localPackageDir.isEmpty());
399     KProcess proc;
400     proc << "update-mime-database";
401     proc << localPackageDir;
402     const int exitCode = proc.execute();
403     if (exitCode) {
404         kWarning() << proc.program() << "exited with error code" << exitCode;
405     }
406 }
407
408 void Wizard::slotCheckThumbs()
409 {
410     QString pixname = "timeline_vthumbs.png";
411     if (!m_extra.audiothumbs->isChecked() && !m_extra.videothumbs->isChecked()) {
412         pixname = "timeline_nothumbs.png";
413     } else if (m_extra.audiothumbs->isChecked()) {
414         if (m_extra.videothumbs->isChecked())
415             pixname = "timeline_avthumbs.png";
416         else pixname = "timeline_athumbs.png";
417     }
418
419     m_extra.timeline_preview->setPixmap(QPixmap(KStandardDirs::locate("appdata", pixname)));
420 }
421
422 void Wizard::slotCheckStandard()
423 {
424     m_standard.profiles_list->clear();
425     QStringList profiles;
426     if (!m_standard.button_hdv->isChecked()) {
427         // DV standard
428         QMapIterator<QString, QString> i(m_dvProfiles);
429         while (i.hasNext()) {
430             i.next();
431             QListWidgetItem *item = new QListWidgetItem(i.key(), m_standard.profiles_list);
432             item->setData(Qt::UserRole, i.value());
433         }
434     }
435     if (!m_standard.button_dv->isChecked()) {
436         // HDV standard
437         QMapIterator<QString, QString> i(m_hdvProfiles);
438         while (i.hasNext()) {
439             i.next();
440             QListWidgetItem *item = new QListWidgetItem(i.key(), m_standard.profiles_list);
441             item->setData(Qt::UserRole, i.value());
442         }
443     }
444     if (m_standard.button_all->isChecked()) {
445         QMapIterator<QString, QString> i(m_otherProfiles);
446         while (i.hasNext()) {
447             i.next();
448             QListWidgetItem *item = new QListWidgetItem(i.key(), m_standard.profiles_list);
449             item->setData(Qt::UserRole, i.value());
450         }
451         //m_standard.profiles_list->sortItems();
452     }
453
454     for (int i = 0; i < m_standard.profiles_list->count(); i++) {
455         QListWidgetItem *item = m_standard.profiles_list->item(i);
456
457         QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(item->data(Qt::UserRole).toString());
458         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"));
459         item->setToolTip(infoString);
460     }
461
462     m_standard.profiles_list->setSortingEnabled(true);
463     m_standard.profiles_list->setCurrentRow(0);
464 }
465
466 void Wizard::slotCheckSelectedItem()
467 {
468     // Make sure we always have an item highlighted
469     m_standard.profiles_list->setCurrentRow(m_standard.profiles_list->currentRow());
470 }
471
472
473 void Wizard::adjustSettings()
474 {
475     if (m_extra.installmimes->isChecked()) {
476         QStringList globs;
477         globs << "*.mts" << "*.m2t" << "*.mod" << "*.ts" << "*.m2ts";
478         installExtraMimes("video/mpeg", globs);
479         globs.clear();
480         globs << "*.dv";
481         installExtraMimes("video/dv", globs);
482         runUpdateMimeDatabase();
483     }
484     KdenliveSettings::setAudiothumbnails(m_extra.audiothumbs->isChecked());
485     KdenliveSettings::setVideothumbnails(m_extra.videothumbs->isChecked());
486     KdenliveSettings::setCrashrecovery(m_extra.autosave->isChecked());
487     if (m_standard.profiles_list->currentItem()) {
488         QString selectedProfile = m_standard.profiles_list->currentItem()->data(Qt::UserRole).toString();
489         if (selectedProfile.isEmpty()) selectedProfile = "dv_pal";
490         KdenliveSettings::setDefault_profile(selectedProfile);
491     }
492     QString path = m_extra.projectfolder->url().path();
493     if (KStandardDirs::makeDir(path) == false) kDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path;
494     KdenliveSettings::setDefaultprojectfolder(path);
495
496 }
497
498 void Wizard::slotCheckMlt()
499 {
500     QString errorMessage;
501     if (KdenliveSettings::rendererpath().isEmpty()) {
502         errorMessage.append(i18n("Your MLT installation cannot be found. Install MLT and restart Kdenlive.\n"));
503     }
504     /*QProcess checkProcess;
505     checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "producer");
506     if (!checkProcess.waitForStarted())
507         errorMessage.append(i18n("Error starting MLT's command line player (melt)") + ".\n");
508
509     checkProcess.waitForFinished();
510
511     QByteArray result = checkProcess.readAllStandardError();
512     if (!result.contains("- avformat")) errorMessage.append(i18n("MLT's avformat (FFMPEG) module not found. Please check your FFMPEG and MLT install. Kdenlive will not work until this issue is fixed.") + "\n");*/
513
514     QProcess checkProcess2;
515     checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "consumer");
516     if (!checkProcess2.waitForStarted())
517         errorMessage.append(i18n("Error starting MLT's command line player (melt).") + '\n');
518
519     checkProcess2.waitForFinished();
520
521     QByteArray result = checkProcess2.readAllStandardError();
522     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');
523
524     if (!errorMessage.isEmpty()) {
525         errorMessage.prepend(QString("<b>%1</b><br>").arg(i18n("Fatal Error")));
526         QLabel *pix = new QLabel();
527         pix->setPixmap(KIcon("dialog-error").pixmap(30));
528         QLabel *label = new QLabel(errorMessage);
529         label->setWordWrap(true);
530         m_startLayout->addSpacing(40);
531         m_startLayout->addWidget(pix);
532         m_startLayout->addWidget(label);
533         m_systemCheckIsOk = false;
534         button(QWizard::NextButton)->setEnabled(false);
535     } else m_systemCheckIsOk = true;
536
537     if (m_systemCheckIsOk) checkMltComponents();
538     slotCheckPrograms();
539 }
540
541 bool Wizard::isOk() const
542 {
543     return m_systemCheckIsOk;
544 }
545
546 #include "wizard.moc"