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