]> git.sesse.net Git - kdenlive/blob - src/wizard.cpp
Add m2ts extension to the list of supported files:
[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     m_profilesInfo = ProfilesDialog::getProfilesInfo();
71     QMap<QString, QString>::const_iterator i = m_profilesInfo.constBegin();
72     while (i != m_profilesInfo.constEnd()) {
73         QMap< QString, QString > profileData = ProfilesDialog::getSettingsFromFile(i.value());
74         if (profileData.value("width") == "720") m_dvProfiles.append(i.key());
75         else if (profileData.value("width").toInt() >= 1080) m_hdvProfiles.append(i.key());
76         else m_otherProfiles.append(i.key());
77         ++i;
78     }
79
80     connect(m_standard.button_all, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
81     connect(m_standard.button_hdv, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
82     connect(m_standard.button_dv, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
83     m_standard.button_all->setChecked(true);
84     connect(m_standard.profiles_list, SIGNAL(itemSelectionChanged()), this, SLOT(slotCheckSelectedItem()));
85
86     // select default profile
87     QList<QListWidgetItem *> profiles = m_standard.profiles_list->findItems(ProfilesDialog::getProfileDescription(KdenliveSettings::default_profile()), Qt::MatchExactly);
88     if (profiles.count() > 0) m_standard.profiles_list->setCurrentItem(profiles.at(0));
89     addPage(page2);
90
91     QWizardPage *page3 = new QWizardPage;
92     page3->setTitle(i18n("Additional Settings"));
93     m_extra.setupUi(page3);
94     m_extra.projectfolder->setMode(KFile::Directory);
95     m_extra.projectfolder->setPath(QDir::homePath() + "/kdenlive");
96     m_extra.videothumbs->setChecked(KdenliveSettings::videothumbnails());
97     m_extra.audiothumbs->setChecked(KdenliveSettings::audiothumbnails());
98     m_extra.autosave->setChecked(KdenliveSettings::crashrecovery());
99     connect(m_extra.videothumbs, SIGNAL(stateChanged(int)), this, SLOT(slotCheckThumbs()));
100     connect(m_extra.audiothumbs, SIGNAL(stateChanged(int)), this, SLOT(slotCheckThumbs()));
101     slotCheckThumbs();
102     addPage(page3);
103
104
105     QWizardPage *page5 = new QWizardPage;
106     page5->setTitle(i18n("Checking system"));
107     m_check.setupUi(page5);
108     addPage(page5);
109
110     listViewDelegate = new WizardDelegate(m_check.programList);
111     m_check.programList->setItemDelegate(listViewDelegate);
112
113     QTimer::singleShot(500, this, SLOT(slotCheckMlt()));
114 }
115
116
117 void Wizard::checkMltComponents()
118 {
119     m_mltCheck.programList->setColumnCount(2);
120     m_mltCheck.programList->setRootIsDecorated(false);
121     m_mltCheck.programList->setHeaderHidden(true);
122     QSize itemSize(20, fontMetrics().height() * 2.5);
123     m_mltCheck.programList->setColumnWidth(0, 30);
124     m_mltCheck.programList->setIconSize(QSize(24, 24));
125
126
127     QTreeWidgetItem *mltitem = new QTreeWidgetItem(m_mltCheck.programList);
128
129     QTreeWidgetItem *meltitem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Melt") + " (" + KdenliveSettings::rendererpath() + ')');
130     meltitem->setData(1, Qt::UserRole, i18n("Required for rendering (part of MLT package)"));
131     meltitem->setSizeHint(0, itemSize);
132     meltitem->setIcon(0, m_okIcon);
133
134     // Check MLT's installed producers
135     QProcess checkProcess;
136     checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "producer");
137     if (!checkProcess.waitForStarted()) {
138         meltitem->setIcon(0, m_badIcon);
139         meltitem->setData(1, Qt::UserRole, i18n("Error starting MLT's command line player (melt)"));
140         button(QWizard::NextButton)->setEnabled(false);
141     } else {
142         checkProcess.waitForFinished();
143         QByteArray result = checkProcess.readAllStandardError();
144
145         // Check MLT avformat module
146         QTreeWidgetItem *avformatItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Avformat module (FFmpeg)"));
147         avformatItem->setData(1, Qt::UserRole, i18n("Required to work with various video formats (hdv, mpeg, flash, ...)"));
148         avformatItem->setSizeHint(0, itemSize);
149         if (!result.contains("- avformat")) {
150             avformatItem->setIcon(0, m_badIcon);
151             m_mltCheck.tabWidget->setTabEnabled(1, false);
152         } else {
153             avformatItem->setIcon(0, m_okIcon);
154             // Make sure we have MLT > 0.3.4
155             bool recentMlt = false;
156             int version = 0;
157             QString mltVersion;
158             QString exepath = KStandardDirs::findExe("pkg-config");
159             if (!exepath.isEmpty()) {
160                 checkProcess.start(exepath, QStringList() << "--variable=version" << "mlt++");
161                 if (!checkProcess.waitForStarted()) {
162                     kDebug() << "// Error querying MLT's version";
163                 } else {
164                     checkProcess.waitForFinished();
165                     mltVersion = checkProcess.readAllStandardOutput();
166                     version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
167                     kDebug() << "// FOUND MLT's pkgconfig version: " << version;
168                     if (version > 34) recentMlt = true;
169                 }
170             }
171             if (version == 0) {
172                 checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "--version");
173                 if (!checkProcess.waitForStarted()) {
174                     kDebug() << "// Error querying MLT's version";
175                 } else {
176                     checkProcess.waitForFinished();
177                     mltVersion = checkProcess.readAllStandardError();
178                     mltVersion = mltVersion.section('\n', 0, 0).simplified();
179                     mltVersion = mltVersion.section(' ', -1).simplified();
180                     version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
181                     kDebug() << "// FOUND MLT version: " << version;
182                     if (version > 34) recentMlt = true;
183                 }
184             }
185
186             mltitem->setText(1, i18n("MLT version: %1", mltVersion.simplified()));
187             mltitem->setSizeHint(0, itemSize);
188             if (version < recommendedMltVersion) {
189                 mltitem->setData(1, Qt::UserRole, i18n("Please upgrade to the latest MLT version"));
190                 mltitem->setIcon(0, m_badIcon);
191             } else {
192                 mltitem->setData(1, Qt::UserRole, i18n("MLT version is correct"));
193                 mltitem->setIcon(0, m_okIcon);
194             }
195
196             if (recentMlt) {
197                 // Check installed audio codecs
198                 QProcess checkProcess2;
199                 checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "noise:" << "-consumer" << "avformat" << "acodec=list");
200                 if (!checkProcess2.waitForStarted()) {
201                     m_mltCheck.tabWidget->setTabEnabled(1, false);
202                     kDebug() << "// Error parsing MLT's avformat codecs";
203                 } else {
204                     checkProcess2.waitForFinished();
205                     QByteArray codecList = checkProcess2.readAllStandardError();
206                     QString acodecList(codecList);
207                     QStringList result;
208                     QStringList alist = acodecList.split('\n', QString::SkipEmptyParts);
209                     for (int i = 0; i < alist.count(); i++) {
210                         if (alist.at(i).contains("- ")) result.append(alist.at(i).section("- ", 1).simplified().toLower());
211                     }
212                     m_mltCheck.acodecs_list->addItems(result);
213                     KdenliveSettings::setAudiocodecs(result);
214                     //kDebug()<<"// FOUND LIST:\n\n"<<m_audioCodecs<<"\n\n++++++++++++++++++++";
215                 }
216                 // Check video codecs
217                 checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "noise:" << "-consumer" << "avformat" << "vcodec=list");
218                 if (!checkProcess2.waitForStarted()) {
219                     kDebug() << "// Error parsing MLT's avformat codecs";
220                 } else {
221                     checkProcess2.waitForFinished();
222                     QByteArray codecList = checkProcess2.readAllStandardError();
223                     QString vcodecList(codecList);
224                     QStringList result;
225                     QStringList vlist = vcodecList.split('\n', QString::SkipEmptyParts);
226                     for (int i = 0; i < vlist.count(); i++) {
227                         if (vlist.at(i).contains("- ")) result.append(vlist.at(i).section("- ", 1).simplified().toLower());
228                     }
229                     m_mltCheck.vcodecs_list->addItems(result);
230                     KdenliveSettings::setVideocodecs(result);
231                     //kDebug()<<"// FOUND LIST:\n\n"<<m_videoCodecs<<"\n\n++++++++++++++++++++";
232                 }
233                 // Check formats
234                 checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "noise:" << "-consumer" << "avformat" << "f=list");
235                 if (!checkProcess2.waitForStarted()) {
236                     kDebug() << "// Error parsing MLT's avformat codecs";
237                 } else {
238                     checkProcess2.waitForFinished();
239                     QByteArray codecList = checkProcess2.readAllStandardError();
240                     QString vcodecList(codecList);
241                     QStringList result;
242                     QStringList vlist = vcodecList.split('\n', QString::SkipEmptyParts);
243                     for (int i = 0; i < vlist.count(); i++) {
244                         if (vlist.at(i).contains("- ")) {
245                             QString format = vlist.at(i).section("- ", 1).simplified().toLower();
246                             if (format.contains(',')) {
247                                 QStringList sub = format.split(',', QString::SkipEmptyParts);
248                                 for (int j = 0; j < sub.count(); j++)
249                                     result.append(sub.at(j));
250                             } else result.append(format);
251                         }
252                     }
253                     m_mltCheck.formats_list->addItems(result);
254                     KdenliveSettings::setSupportedformats(result);
255                     //kDebug()<<"// FOUND LIST:\n\n"<<m_videoCodecs<<"\n\n++++++++++++++++++++";
256                 }
257             }
258
259         }
260
261         // Check MLT dv module
262         QTreeWidgetItem *dvItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("DV module (libdv)"));
263         dvItem->setData(1, Qt::UserRole, i18n("Required to work with dv files if avformat module is not installed"));
264         dvItem->setSizeHint(0, itemSize);
265         if (!result.contains("- libdv")) {
266             dvItem->setIcon(0, m_badIcon);
267         } else {
268             dvItem->setIcon(0, m_okIcon);
269         }
270
271         // Check MLT image format module
272         QTreeWidgetItem *imageItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("QImage module"));
273         imageItem->setData(1, Qt::UserRole, i18n("Required to work with images"));
274         imageItem->setSizeHint(0, itemSize);
275         if (!result.contains("- qimage")) {
276             imageItem->setIcon(0, m_badIcon);
277             imageItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Pixbuf module"));
278             imageItem->setData(1, Qt::UserRole, i18n("Required to work with images"));
279             imageItem->setSizeHint(0, itemSize);
280             if (!result.contains("- pixbuf")) imageItem->setIcon(0, m_badIcon);
281             else imageItem->setIcon(0, m_okIcon);
282         } else {
283             imageItem->setIcon(0, m_okIcon);
284         }
285     }
286 }
287
288 void Wizard::slotCheckPrograms()
289 {
290     m_check.programList->setColumnCount(2);
291     m_check.programList->setRootIsDecorated(false);
292     m_check.programList->setHeaderHidden(true);
293     QSize itemSize(20, fontMetrics().height() * 2.5);
294     m_check.programList->setColumnWidth(0, 30);
295     m_check.programList->setIconSize(QSize(24, 24));
296
297     QTreeWidgetItem *item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("FFmpeg & ffplay"));
298     item->setData(1, Qt::UserRole, i18n("Required for webcam capture"));
299     item->setSizeHint(0, itemSize);
300     QString exepath = KStandardDirs::findExe("ffmpeg");
301     if (exepath.isEmpty()) item->setIcon(0, m_badIcon);
302     else if (KStandardDirs::findExe("ffplay").isEmpty()) item->setIcon(0, m_badIcon);
303     else item->setIcon(0, m_okIcon);
304
305     item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Recordmydesktop"));
306     item->setData(1, Qt::UserRole, i18n("Required for screen capture"));
307     item->setSizeHint(0, itemSize);
308     if (KStandardDirs::findExe("recordmydesktop").isEmpty()) item->setIcon(0, m_badIcon);
309     else item->setIcon(0, m_okIcon);
310
311     item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Dvgrab"));
312     item->setData(1, Qt::UserRole, i18n("Required for firewire capture"));
313     item->setSizeHint(0, itemSize);
314     if (KStandardDirs::findExe("dvgrab").isEmpty()) item->setIcon(0, m_badIcon);
315     else item->setIcon(0, m_okIcon);
316
317     item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Dvdauthor"));
318     item->setData(1, Qt::UserRole, i18n("Required for creation of DVD"));
319     item->setSizeHint(0, itemSize);
320     if (KStandardDirs::findExe("dvdauthor").isEmpty()) item->setIcon(0, m_badIcon);
321     else item->setIcon(0, m_okIcon);
322
323     item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("Mkisofs"));
324     item->setData(1, Qt::UserRole, i18n("Required for creation of DVD ISO images"));
325     item->setSizeHint(0, itemSize);
326     if (KStandardDirs::findExe("mkisofs").isEmpty()) item->setIcon(0, m_badIcon);
327     else item->setIcon(0, m_okIcon);
328
329 }
330
331 void Wizard::installExtraMimes(QString baseName, QStringList globs)
332 {
333     QString mimefile = baseName;
334     mimefile.replace('/', '-');
335     KMimeType::Ptr mime = KMimeType::mimeType(baseName);
336     if (!mime) {
337         kDebug() << "KMimeTypeTrader: mimeType " << baseName << " not found";
338     } else {
339         QStringList extensions = mime->patterns();
340         QString comment = mime->comment();
341         foreach(const QString &glob, globs) {
342             if (!extensions.contains(glob)) extensions << glob;
343         }
344         kDebug() << "EXTS: " << extensions;
345         QString packageFileName = KStandardDirs::locateLocal("xdgdata-mime", "packages/" + mimefile + ".xml");
346         kDebug() << "INSTALLING NEW MIME TO: " << packageFileName;
347         QFile packageFile(packageFileName);
348         if (!packageFile.open(QIODevice::WriteOnly)) {
349             kError() << "Couldn't open" << packageFileName << "for writing";
350             return;
351         }
352         QXmlStreamWriter writer(&packageFile);
353         writer.setAutoFormatting(true);
354         writer.writeStartDocument();
355
356         const QString nsUri = "http://www.freedesktop.org/standards/shared-mime-info";
357         writer.writeDefaultNamespace(nsUri);
358         writer.writeStartElement("mime-info");
359         writer.writeStartElement(nsUri, "mime-type");
360         writer.writeAttribute("type", baseName);
361
362         if (!comment.isEmpty()) {
363             writer.writeStartElement(nsUri, "comment");
364             writer.writeCharacters(comment);
365             writer.writeEndElement(); // comment
366         }
367
368         foreach(const QString& pattern, extensions) {
369             writer.writeStartElement(nsUri, "glob");
370             writer.writeAttribute("pattern", pattern);
371             writer.writeEndElement(); // glob
372         }
373
374         writer.writeEndElement(); // mime-info
375         writer.writeEndElement(); // mime-type
376         writer.writeEndDocument();
377     }
378 }
379
380 void Wizard::runUpdateMimeDatabase()
381 {
382     const QString localPackageDir = KStandardDirs::locateLocal("xdgdata-mime", QString());
383     //Q_ASSERT(!localPackageDir.isEmpty());
384     KProcess proc;
385     proc << "update-mime-database";
386     proc << localPackageDir;
387     const int exitCode = proc.execute();
388     if (exitCode) {
389         kWarning() << proc.program() << "exited with error code" << exitCode;
390     }
391 }
392
393 void Wizard::slotCheckThumbs()
394 {
395     QString pixname = "timeline_vthumbs.png";
396     if (!m_extra.audiothumbs->isChecked() && !m_extra.videothumbs->isChecked()) {
397         pixname = "timeline_nothumbs.png";
398     } else if (m_extra.audiothumbs->isChecked()) {
399         if (m_extra.videothumbs->isChecked())
400             pixname = "timeline_avthumbs.png";
401         else pixname = "timeline_athumbs.png";
402     }
403
404     m_extra.timeline_preview->setPixmap(QPixmap(KStandardDirs::locate("appdata", pixname)));
405 }
406
407 void Wizard::slotCheckStandard()
408 {
409     m_standard.profiles_list->clear();
410     QStringList profiles;
411     if (m_standard.button_dv->isChecked()) {
412         // DV standard
413         m_standard.profiles_list->addItems(m_dvProfiles);
414     } else if (m_standard.button_hdv->isChecked()) {
415         // HDV standard
416         m_standard.profiles_list->addItems(m_hdvProfiles);
417     } else {
418         m_standard.profiles_list->addItems(m_dvProfiles);
419         m_standard.profiles_list->addItems(m_hdvProfiles);
420         m_standard.profiles_list->addItems(m_otherProfiles);
421         //m_standard.profiles_list->sortItems();
422     }
423
424     for (int i = 0; i < m_standard.profiles_list->count(); i++) {
425         QListWidgetItem *item = m_standard.profiles_list->item(i);
426         MltVideoProfile prof = ProfilesDialog::getVideoProfile(m_profilesInfo.value(item->text()));
427         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));
428         item->setToolTip(infoString);
429     }
430
431     m_standard.profiles_list->setSortingEnabled(true);
432     m_standard.profiles_list->setCurrentRow(0);
433 }
434
435 void Wizard::slotCheckSelectedItem()
436 {
437     // Make sure we always have an item highlighted
438     m_standard.profiles_list->setCurrentRow(m_standard.profiles_list->currentRow());
439 }
440
441
442 void Wizard::adjustSettings()
443 {
444     if (m_extra.installmimes->isChecked()) {
445         QStringList globs;
446         globs << "*.mts" << "*.m2t" << "*.mod" << "*.ts" << "*.m2ts";
447         installExtraMimes("video/mpeg", globs);
448         globs.clear();
449         globs << "*.dv";
450         installExtraMimes("video/dv", globs);
451         runUpdateMimeDatabase();
452     }
453     KdenliveSettings::setAudiothumbnails(m_extra.audiothumbs->isChecked());
454     KdenliveSettings::setVideothumbnails(m_extra.videothumbs->isChecked());
455     KdenliveSettings::setCrashrecovery(m_extra.autosave->isChecked());
456     if (m_standard.profiles_list->currentItem()) {
457         QString selectedProfile = m_profilesInfo.value(m_standard.profiles_list->currentItem()->text());
458         if (selectedProfile.isEmpty()) selectedProfile = "dv_pal";
459         KdenliveSettings::setDefault_profile(selectedProfile);
460     }
461     QString path = m_extra.projectfolder->url().path();
462     if (KStandardDirs::makeDir(path) == false) kDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path;
463     KdenliveSettings::setDefaultprojectfolder(path);
464
465 }
466
467 void Wizard::slotCheckMlt()
468 {
469     QString errorMessage;
470     if (KdenliveSettings::rendererpath().isEmpty()) {
471         errorMessage.append(i18n("your MLT installation cannot be found. Install MLT and restart Kdenlive.\n"));
472     }
473     /*QProcess checkProcess;
474     checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "producer");
475     if (!checkProcess.waitForStarted())
476         errorMessage.append(i18n("Error starting MLT's command line player (melt)") + ".\n");
477
478     checkProcess.waitForFinished();
479
480     QByteArray result = checkProcess.readAllStandardError();
481     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");*/
482
483     QProcess checkProcess2;
484     checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "consumer");
485     if (!checkProcess2.waitForStarted())
486         errorMessage.append(i18n("Error starting MLT's command line player (melt).") + '\n');
487
488     checkProcess2.waitForFinished();
489
490     QByteArray result = checkProcess2.readAllStandardError();
491     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');
492
493     if (!errorMessage.isEmpty()) {
494         errorMessage.prepend(QString("<b>%1</b><br>").arg(i18n("Fatal Error")));
495         QLabel *pix = new QLabel();
496         pix->setPixmap(KIcon("dialog-error").pixmap(30));
497         QLabel *label = new QLabel(errorMessage);
498         label->setWordWrap(true);
499         m_startLayout->addSpacing(40);
500         m_startLayout->addWidget(pix);
501         m_startLayout->addWidget(label);
502         m_systemCheckIsOk = false;
503         button(QWizard::NextButton)->setEnabled(false);
504     } else m_systemCheckIsOk = true;
505
506     if (m_systemCheckIsOk) checkMltComponents();
507     slotCheckPrograms();
508 }
509
510 bool Wizard::isOk() const
511 {
512     return m_systemCheckIsOk;
513 }
514
515 #include "wizard.moc"