1 /***************************************************************************
2 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
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. *
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. *
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 ***************************************************************************/
21 #include "kdenlivesettings.h"
22 #include "profilesdialog.h"
23 #include "kdenlive-config.h"
25 #include <KStandardDirs>
28 #include <kmimetype.h>
31 #include <KMimeTypeTrader>
35 #include <QXmlStreamWriter>
38 const double recommendedMltVersion = 510;
39 static const char kdenlive_version[] = VERSION;
41 Wizard::Wizard(bool upgrade, QWidget *parent) :
44 setWindowTitle(i18n("Config Wizard"));
45 setPixmap(QWizard::WatermarkPixmap, QPixmap(KStandardDirs::locate("appdata", "banner.png")));
47 QWizardPage *page1 = new QWizardPage;
48 page1->setTitle(i18n("Welcome"));
51 label = new QLabel(i18n("Your Kdenlive version was upgraded to version %1. Please take some time to review the basic settings", QString(kdenlive_version).section(' ', 0, 0)));
53 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..."));
54 label->setWordWrap(true);
55 m_startLayout = new QVBoxLayout;
56 m_startLayout->addWidget(label);
57 QPushButton *but = new QPushButton(KIcon("help-about"), i18n("Discover the features of this Kdenlive release"), this);
58 connect(but, SIGNAL(clicked()), this, SLOT(slotShowWebInfos()));
59 m_startLayout->addStretch();
60 m_startLayout->addWidget(but);
63 page1->setLayout(m_startLayout);
66 QWizardPage *page4 = new QWizardPage;
67 page4->setTitle(i18n("Checking MLT engine"));
68 m_mltCheck.setupUi(page4);
71 WizardDelegate *listViewDelegate = new WizardDelegate(m_mltCheck.programList);
72 m_mltCheck.programList->setItemDelegate(listViewDelegate);
74 QWizardPage *page2 = new QWizardPage;
75 page2->setTitle(i18n("Video Standard"));
76 m_standard.setupUi(page2);
78 m_okIcon = KIcon("dialog-ok");
79 m_badIcon = KIcon("dialog-close");
81 // build profiles lists
82 QMap<QString, QString> profilesInfo = ProfilesDialog::getProfilesInfo();
83 QMap<QString, QString>::const_iterator i = profilesInfo.constBegin();
84 while (i != profilesInfo.constEnd()) {
85 QMap< QString, QString > profileData = ProfilesDialog::getSettingsFromFile(i.value());
86 if (profileData.value("width") == "720") m_dvProfiles.insert(i.key(), i.value());
87 else if (profileData.value("width").toInt() >= 1080) m_hdvProfiles.insert(i.key(), i.value());
88 else m_otherProfiles.insert(i.key(), i.value());
92 m_standard.button_all->setChecked(true);
93 connect(m_standard.button_all, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
94 connect(m_standard.button_hdv, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
95 connect(m_standard.button_dv, SIGNAL(toggled(bool)), this, SLOT(slotCheckStandard()));
97 connect(m_standard.profiles_list, SIGNAL(itemSelectionChanged()), this, SLOT(slotCheckSelectedItem()));
99 // select default profile
100 if (!KdenliveSettings::default_profile().isEmpty()) {
101 for (int i = 0; i < m_standard.profiles_list->count(); i++) {
102 if (m_standard.profiles_list->item(i)->data(Qt::UserRole).toString() == KdenliveSettings::default_profile()) {
103 m_standard.profiles_list->setCurrentRow(i);
104 m_standard.profiles_list->scrollToItem(m_standard.profiles_list->currentItem());
112 QWizardPage *page3 = new QWizardPage;
113 page3->setTitle(i18n("Additional Settings"));
114 m_extra.setupUi(page3);
115 m_extra.projectfolder->setMode(KFile::Directory);
116 m_extra.projectfolder->setUrl(KUrl(KdenliveSettings::defaultprojectfolder()));
117 m_extra.videothumbs->setChecked(KdenliveSettings::videothumbnails());
118 m_extra.audiothumbs->setChecked(KdenliveSettings::audiothumbnails());
119 m_extra.autosave->setChecked(KdenliveSettings::crashrecovery());
120 connect(m_extra.videothumbs, SIGNAL(stateChanged(int)), this, SLOT(slotCheckThumbs()));
121 connect(m_extra.audiothumbs, SIGNAL(stateChanged(int)), this, SLOT(slotCheckThumbs()));
126 QWizardPage *page5 = new QWizardPage;
127 page5->setTitle(i18n("Checking system"));
128 m_check.setupUi(page5);
131 listViewDelegate = new WizardDelegate(m_check.programList);
132 m_check.programList->setItemDelegate(listViewDelegate);
134 QTimer::singleShot(500, this, SLOT(slotCheckMlt()));
138 void Wizard::checkMltComponents()
140 QSize itemSize(20, fontMetrics().height() * 2.5);
141 m_mltCheck.programList->setColumnWidth(0, 30);
142 m_mltCheck.programList->setIconSize(QSize(24, 24));
145 QTreeWidgetItem *mltitem = new QTreeWidgetItem(m_mltCheck.programList);
147 QTreeWidgetItem *meltitem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Melt") + " (" + KdenliveSettings::rendererpath() + ')');
148 meltitem->setData(1, Qt::UserRole, i18n("Required for rendering (part of MLT package)"));
149 meltitem->setSizeHint(0, itemSize);
150 meltitem->setIcon(0, m_okIcon);
152 // Check MLT's installed producers
153 QProcess checkProcess;
154 checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "producer");
155 if (!checkProcess.waitForStarted()) {
156 meltitem->setIcon(0, m_badIcon);
157 meltitem->setData(1, Qt::UserRole, i18n("Error starting MLT's command line player (melt)"));
158 button(QWizard::NextButton)->setEnabled(false);
160 checkProcess.waitForFinished();
161 QByteArray result = checkProcess.readAllStandardError();
163 // Check MLT avformat module
164 QTreeWidgetItem *avformatItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Avformat module (FFmpeg)"));
165 avformatItem->setData(1, Qt::UserRole, i18n("Required to work with various video formats (hdv, mpeg, flash, ...)"));
166 avformatItem->setSizeHint(0, itemSize);
167 if (!result.contains("- avformat")) {
168 avformatItem->setIcon(0, m_badIcon);
169 m_mltCheck.tabWidget->setTabEnabled(1, false);
171 avformatItem->setIcon(0, m_okIcon);
172 // Make sure we have MLT > 0.3.4
175 QString exepath = KStandardDirs::findExe("pkg-config");
176 if (!exepath.isEmpty()) {
177 checkProcess.start(exepath, QStringList() << "--variable=version" << "mlt++");
178 if (!checkProcess.waitForStarted()) {
179 kDebug() << "// Error querying MLT's version";
181 checkProcess.waitForFinished();
182 mltVersion = checkProcess.readAllStandardOutput();
183 version = 1000 * mltVersion.section('.', 0, 0).toInt() + 100 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
184 kDebug() << "// FOUND MLT's pkgconfig version: " << version;
188 checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "--version");
189 if (!checkProcess.waitForStarted()) {
190 kDebug() << "// Error querying MLT's version";
192 checkProcess.waitForFinished();
193 mltVersion = checkProcess.readAllStandardError();
194 mltVersion = mltVersion.section('\n', 0, 0).simplified();
195 mltVersion = mltVersion.section(' ', -1).simplified();
196 version = 1000 * mltVersion.section('.', 0, 0).toInt() + 100 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
197 kDebug() << "// FOUND MLT version: " << version;
201 mltitem->setText(1, i18n("MLT version: %1", mltVersion.simplified()));
202 mltitem->setSizeHint(0, itemSize);
204 mltitem->setData(1, Qt::UserRole, i18n("Your MLT version is unsupported!!!"));
205 mltitem->setIcon(0, m_badIcon);
207 if (version < recommendedMltVersion) {
208 mltitem->setData(1, Qt::UserRole, i18n("Please upgrade to the latest MLT version"));
209 mltitem->setIcon(0, m_badIcon);
211 mltitem->setData(1, Qt::UserRole, i18n("MLT version is correct"));
212 mltitem->setIcon(0, m_okIcon);
214 // Check installed audio codecs
215 QProcess checkProcess2;
216 checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "noise:" << "-consumer" << "avformat" << "acodec=list");
217 if (!checkProcess2.waitForStarted()) {
218 m_mltCheck.tabWidget->setTabEnabled(1, false);
219 kDebug() << "// Error parsing MLT's avformat codecs";
221 checkProcess2.waitForFinished();
222 QByteArray codecList = checkProcess2.readAllStandardError();
223 QString acodecList(codecList);
225 QStringList alist = acodecList.split('\n', QString::SkipEmptyParts);
226 for (int i = 0; i < alist.count(); i++) {
227 if (alist.at(i).contains("- ")) result.append(alist.at(i).section("- ", 1).simplified().toLower());
229 m_mltCheck.acodecs_list->addItems(result);
230 KdenliveSettings::setAudiocodecs(result);
231 //kDebug()<<"// FOUND LIST:\n\n"<<m_audioCodecs<<"\n\n++++++++++++++++++++";
233 // Check video codecs
234 checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "noise:" << "-consumer" << "avformat" << "vcodec=list");
235 if (!checkProcess2.waitForStarted()) {
236 kDebug() << "// Error parsing MLT's avformat codecs";
238 checkProcess2.waitForFinished();
239 QByteArray codecList = checkProcess2.readAllStandardError();
240 QString vcodecList(codecList);
242 QStringList vlist = vcodecList.split('\n', QString::SkipEmptyParts);
243 for (int i = 0; i < vlist.count(); i++) {
244 if (vlist.at(i).contains("- ")) result.append(vlist.at(i).section("- ", 1).simplified().toLower());
246 m_mltCheck.vcodecs_list->addItems(result);
247 KdenliveSettings::setVideocodecs(result);
248 //kDebug()<<"// FOUND LIST:\n\n"<<m_videoCodecs<<"\n\n++++++++++++++++++++";
251 checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "noise:" << "-consumer" << "avformat" << "f=list");
252 if (!checkProcess2.waitForStarted()) {
253 kDebug() << "// Error parsing MLT's avformat codecs";
255 checkProcess2.waitForFinished();
256 QByteArray codecList = checkProcess2.readAllStandardError();
257 QString vcodecList(codecList);
259 QStringList vlist = vcodecList.split('\n', QString::SkipEmptyParts);
260 for (int i = 0; i < vlist.count(); i++) {
261 if (vlist.at(i).contains("- ")) {
262 QString format = vlist.at(i).section("- ", 1).simplified().toLower();
263 if (format.contains(',')) {
264 QStringList sub = format.split(',', QString::SkipEmptyParts);
265 for (int j = 0; j < sub.count(); j++)
266 result.append(sub.at(j));
267 } else result.append(format);
270 m_mltCheck.formats_list->addItems(result);
271 KdenliveSettings::setSupportedformats(result);
272 //kDebug()<<"// FOUND LIST:\n\n"<<m_videoCodecs<<"\n\n++++++++++++++++++++";
278 // Check MLT dv module
279 QTreeWidgetItem *dvItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("DV module (libdv)"));
280 dvItem->setData(1, Qt::UserRole, i18n("Required to work with dv files if avformat module is not installed"));
281 dvItem->setSizeHint(0, itemSize);
282 if (!result.contains("- libdv")) {
283 dvItem->setIcon(0, m_badIcon);
285 dvItem->setIcon(0, m_okIcon);
288 // Check MLT image format module
289 QTreeWidgetItem *imageItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("QImage module"));
290 imageItem->setData(1, Qt::UserRole, i18n("Required to work with images"));
291 imageItem->setSizeHint(0, itemSize);
292 if (!result.contains("- qimage")) {
293 imageItem->setIcon(0, m_badIcon);
294 imageItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Pixbuf module"));
295 imageItem->setData(1, Qt::UserRole, i18n("Required to work with images"));
296 imageItem->setSizeHint(0, itemSize);
297 if (!result.contains("- pixbuf")) imageItem->setIcon(0, m_badIcon);
298 else imageItem->setIcon(0, m_okIcon);
300 imageItem->setIcon(0, m_okIcon);
303 // Check MLT title module
304 QTreeWidgetItem *titleItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Title module"));
305 titleItem->setData(1, Qt::UserRole, i18n("Required to work with titles"));
306 titleItem->setSizeHint(0, itemSize);
307 if (!result.contains("- kdenlivetitle")) {
308 KdenliveSettings::setHastitleproducer(false);
309 titleItem->setIcon(0, m_badIcon);
311 titleItem->setIcon(0, m_okIcon);
312 KdenliveSettings::setHastitleproducer(true);
317 void Wizard::slotCheckPrograms()
319 QSize itemSize(20, fontMetrics().height() * 2.5);
320 m_check.programList->setColumnWidth(0, 30);
321 m_check.programList->setIconSize(QSize(24, 24));
323 QTreeWidgetItem *item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("FFmpeg & ffplay"));
324 item->setData(1, Qt::UserRole, i18n("Required for webcam capture"));
325 item->setSizeHint(0, itemSize);
326 QString exepath = KStandardDirs::findExe("ffmpeg");
327 if (exepath.isEmpty()) item->setIcon(0, m_badIcon);
328 else if (KStandardDirs::findExe("ffplay").isEmpty()) item->setIcon(0, m_badIcon);
329 else item->setIcon(0, m_okIcon);
332 item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("recordmydesktop"));
333 item->setData(1, Qt::UserRole, i18n("Required for screen capture"));
334 item->setSizeHint(0, itemSize);
335 if (KStandardDirs::findExe("recordmydesktop").isEmpty()) item->setIcon(0, m_badIcon);
336 else item->setIcon(0, m_okIcon);
338 item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("dvgrab"));
339 item->setData(1, Qt::UserRole, i18n("Required for firewire capture"));
340 item->setSizeHint(0, itemSize);
341 if (KStandardDirs::findExe("dvgrab").isEmpty()) item->setIcon(0, m_badIcon);
342 else item->setIcon(0, m_okIcon);
345 item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("dvdauthor"));
346 item->setData(1, Qt::UserRole, i18n("Required for creation of DVD"));
347 item->setSizeHint(0, itemSize);
348 if (KStandardDirs::findExe("dvdauthor").isEmpty()) item->setIcon(0, m_badIcon);
349 else item->setIcon(0, m_okIcon);
352 item = new QTreeWidgetItem(m_check.programList, QStringList() << QString() << i18n("genisoimage or mkisofs"));
353 item->setData(1, Qt::UserRole, i18n("Required for creation of DVD ISO images"));
354 item->setSizeHint(0, itemSize);
355 if (KStandardDirs::findExe("genisoimage").isEmpty()) {
356 // no GenIso, check for mkisofs
357 if (!KStandardDirs::findExe("mkisofs").isEmpty()) {
358 item->setIcon(0, m_okIcon);
359 } else item->setIcon(0, m_badIcon);
360 } else item->setIcon(0, m_okIcon);
362 // set up some default applications
364 if (KdenliveSettings::defaultimageapp().isEmpty()) {
365 program = KStandardDirs::findExe("gimp");
366 if (program.isEmpty()) program = KStandardDirs::findExe("krita");
367 if (!program.isEmpty()) KdenliveSettings::setDefaultimageapp(program);
369 if (KdenliveSettings::defaultaudioapp().isEmpty()) {
370 program = KStandardDirs::findExe("audacity");
371 if (program.isEmpty()) program = KStandardDirs::findExe("traverso");
372 if (!program.isEmpty()) KdenliveSettings::setDefaultaudioapp(program);
374 if (KdenliveSettings::defaultplayerapp().isEmpty()) {
375 KService::Ptr offer = KMimeTypeTrader::self()->preferredService("video/mpeg");
377 KdenliveSettings::setDefaultplayerapp(KRun::binaryName(offer->exec(), true));
381 void Wizard::installExtraMimes(QString baseName, QStringList globs)
383 QString mimefile = baseName;
384 mimefile.replace('/', '-');
385 KMimeType::Ptr mime = KMimeType::mimeType(baseName);
387 kDebug() << "KMimeTypeTrader: mimeType " << baseName << " not found";
389 QStringList extensions = mime->patterns();
390 QString comment = mime->comment();
391 foreach(const QString &glob, globs) {
392 if (!extensions.contains(glob)) extensions << glob;
394 kDebug() << "EXTS: " << extensions;
395 QString packageFileName = KStandardDirs::locateLocal("xdgdata-mime", "packages/" + mimefile + ".xml");
396 kDebug() << "INSTALLING NEW MIME TO: " << packageFileName;
397 QFile packageFile(packageFileName);
398 if (!packageFile.open(QIODevice::WriteOnly)) {
399 kError() << "Couldn't open" << packageFileName << "for writing";
402 QXmlStreamWriter writer(&packageFile);
403 writer.setAutoFormatting(true);
404 writer.writeStartDocument();
406 const QString nsUri = "http://www.freedesktop.org/standards/shared-mime-info";
407 writer.writeDefaultNamespace(nsUri);
408 writer.writeStartElement("mime-info");
409 writer.writeStartElement(nsUri, "mime-type");
410 writer.writeAttribute("type", baseName);
412 if (!comment.isEmpty()) {
413 writer.writeStartElement(nsUri, "comment");
414 writer.writeCharacters(comment);
415 writer.writeEndElement(); // comment
418 foreach(const QString& pattern, extensions) {
419 writer.writeStartElement(nsUri, "glob");
420 writer.writeAttribute("pattern", pattern);
421 writer.writeEndElement(); // glob
424 writer.writeEndElement(); // mime-info
425 writer.writeEndElement(); // mime-type
426 writer.writeEndDocument();
430 void Wizard::runUpdateMimeDatabase()
432 const QString localPackageDir = KStandardDirs::locateLocal("xdgdata-mime", QString());
433 //Q_ASSERT(!localPackageDir.isEmpty());
435 proc << "update-mime-database";
436 proc << localPackageDir;
437 const int exitCode = proc.execute();
439 kWarning() << proc.program() << "exited with error code" << exitCode;
443 void Wizard::slotCheckThumbs()
445 QString pixname = "timeline_vthumbs.png";
446 if (!m_extra.audiothumbs->isChecked() && !m_extra.videothumbs->isChecked()) {
447 pixname = "timeline_nothumbs.png";
448 } else if (m_extra.audiothumbs->isChecked()) {
449 if (m_extra.videothumbs->isChecked())
450 pixname = "timeline_avthumbs.png";
451 else pixname = "timeline_athumbs.png";
454 m_extra.timeline_preview->setPixmap(QPixmap(KStandardDirs::locate("appdata", pixname)));
457 void Wizard::slotCheckStandard()
459 m_standard.profiles_list->clear();
460 QStringList profiles;
461 if (!m_standard.button_hdv->isChecked()) {
463 QMapIterator<QString, QString> i(m_dvProfiles);
464 while (i.hasNext()) {
466 QListWidgetItem *item = new QListWidgetItem(i.key(), m_standard.profiles_list);
467 item->setData(Qt::UserRole, i.value());
470 if (!m_standard.button_dv->isChecked()) {
472 QMapIterator<QString, QString> i(m_hdvProfiles);
473 while (i.hasNext()) {
475 QListWidgetItem *item = new QListWidgetItem(i.key(), m_standard.profiles_list);
476 item->setData(Qt::UserRole, i.value());
479 if (m_standard.button_all->isChecked()) {
480 QMapIterator<QString, QString> i(m_otherProfiles);
481 while (i.hasNext()) {
483 QListWidgetItem *item = new QListWidgetItem(i.key(), m_standard.profiles_list);
484 item->setData(Qt::UserRole, i.value());
486 //m_standard.profiles_list->sortItems();
489 for (int i = 0; i < m_standard.profiles_list->count(); i++) {
490 QListWidgetItem *item = m_standard.profiles_list->item(i);
492 QMap< QString, QString > values = ProfilesDialog::getSettingsFromFile(item->data(Qt::UserRole).toString());
493 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"));
494 item->setToolTip(infoString);
497 m_standard.profiles_list->setSortingEnabled(true);
498 m_standard.profiles_list->setCurrentRow(0);
501 void Wizard::slotCheckSelectedItem()
503 // Make sure we always have an item highlighted
504 m_standard.profiles_list->setCurrentRow(m_standard.profiles_list->currentRow());
508 void Wizard::adjustSettings()
510 if (m_extra.installmimes->isChecked()) {
512 globs << "*.mts" << "*.m2t" << "*.mod" << "*.ts" << "*.m2ts";
513 installExtraMimes("video/mpeg", globs);
516 installExtraMimes("video/dv", globs);
517 runUpdateMimeDatabase();
519 KdenliveSettings::setAudiothumbnails(m_extra.audiothumbs->isChecked());
520 KdenliveSettings::setVideothumbnails(m_extra.videothumbs->isChecked());
521 KdenliveSettings::setCrashrecovery(m_extra.autosave->isChecked());
522 if (m_standard.profiles_list->currentItem()) {
523 QString selectedProfile = m_standard.profiles_list->currentItem()->data(Qt::UserRole).toString();
524 if (selectedProfile.isEmpty()) selectedProfile = "dv_pal";
525 KdenliveSettings::setDefault_profile(selectedProfile);
527 QString path = m_extra.projectfolder->url().path();
528 if (KStandardDirs::makeDir(path) == false) {
529 kDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path;
530 } else KdenliveSettings::setDefaultprojectfolder(path);
534 void Wizard::slotCheckMlt()
536 QString errorMessage;
537 if (KdenliveSettings::rendererpath().isEmpty()) {
538 errorMessage.append(i18n("Your MLT installation cannot be found. Install MLT and restart Kdenlive.\n"));
540 /*QProcess checkProcess;
541 checkProcess.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "producer");
542 if (!checkProcess.waitForStarted())
543 errorMessage.append(i18n("Error starting MLT's command line player (melt)") + ".\n");
545 checkProcess.waitForFinished();
547 QByteArray result = checkProcess.readAllStandardError();
548 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");*/
550 QProcess checkProcess2;
551 checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "-query" << "consumer");
552 if (!checkProcess2.waitForStarted())
553 errorMessage.append(i18n("Error starting MLT's command line player (melt).") + '\n');
555 checkProcess2.waitForFinished();
557 QByteArray result = checkProcess2.readAllStandardError();
558 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');
560 if (!errorMessage.isEmpty()) {
561 errorMessage.prepend(QString("<b>%1</b><br />").arg(i18n("Fatal Error")));
562 QLabel *pix = new QLabel();
563 pix->setPixmap(KIcon("dialog-error").pixmap(30));
564 QLabel *label = new QLabel(errorMessage);
565 label->setWordWrap(true);
566 m_startLayout->addSpacing(40);
567 m_startLayout->addWidget(pix);
568 m_startLayout->addWidget(label);
569 m_systemCheckIsOk = false;
570 button(QWizard::NextButton)->setEnabled(false);
571 } else m_systemCheckIsOk = true;
573 if (m_systemCheckIsOk) checkMltComponents();
577 bool Wizard::isOk() const
579 return m_systemCheckIsOk;
582 void Wizard::slotShowWebInfos()
584 KRun::runUrl(KUrl("http://kdenlive.org/discover/" + QString(kdenlive_version).section(' ', 0, 0)), "text/html", this);
587 #include "wizard.moc"