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