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