Commit 419e1b2f authored by Julius Künzel's avatar Julius Künzel
Browse files

[Setup Wizard] Show codes if there are only info messages, fix doc link

parent 9d3a7c6e
......@@ -42,6 +42,7 @@ SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#if KIO_VERSION >= QT_VERSION_CHECK(5,71,0)
#include <KIO/OpenUrlJob>
#include <KIO/JobUiDelegate>
#endif
// Recommended MLT version
......@@ -125,8 +126,18 @@ Wizard::Wizard(bool autoClose, bool appImageCheck, QWidget *parent)
lab->setText(i18n("Startup error or warning, check our <a href='#'>online manual</a>."));
connect(lab, &QLabel::linkActivated, this, &Wizard::slotOpenManual);
m_startLayout->addWidget(lab);
} else {
// Everything is ok, auto close the wizard
}
if (!m_infos.isEmpty()) {
auto *errorLabel = new KMessageWidget(this);
errorLabel->setText(QStringLiteral("<ul>") + m_infos + QStringLiteral("</ul>"));
errorLabel->setMessageType(KMessageWidget::Information);
errorLabel->setWordWrap(true);
errorLabel->setCloseButtonVisible(false);
m_startLayout->addWidget(errorLabel);
errorLabel->show();
}
if (m_errors.isEmpty() && m_warnings.isEmpty()) {
// Everything is ok only some info message, show codec status
m_page->setComplete(true);
if (autoClose) {
QTimer::singleShot(0, this, &QDialog::accept);
......@@ -184,15 +195,6 @@ Wizard::Wizard(bool autoClose, bool appImageCheck, QWidget *parent)
m_startLayout->addWidget(errorLabel);
errorLabel->show();
}
if (!m_infos.isEmpty()) {
auto *errorLabel = new KMessageWidget(this);
errorLabel->setText(QStringLiteral("<ul>") + m_infos + QStringLiteral("</ul>"));
errorLabel->setMessageType(KMessageWidget::Information);
errorLabel->setWordWrap(true);
errorLabel->setCloseButtonVisible(false);
m_startLayout->addWidget(errorLabel);
errorLabel->show();
}
// build profiles lists
/*QMap<QString, QString> profilesInfo = ProfilesDialog::getProfilesInfo();
QMap<QString, QString>::const_iterator i = profilesInfo.constBegin();
......@@ -732,7 +734,7 @@ void Wizard::slotCheckPrograms(QString &infos, QString &warnings)
if (KdenliveSettings::mediainfopath().isEmpty() || !QFileInfo::exists(KdenliveSettings::mediainfopath())) {
program = QStandardPaths::findExecutable(QStringLiteral("mediainfo"));
if (program.isEmpty()) {
infos.append(i18n("<li>Missing app: <b>mediainfo</b><br/>optional for technical clip information/li>"));
infos.append(i18n("<li>Missing app: <b>mediainfo</b><br/>optional for technical clip information</li>"));
} else {
KdenliveSettings::setMediainfopath(program);
}
......@@ -935,7 +937,12 @@ bool Wizard::isOk() const
void Wizard::slotOpenManual()
{
#if KIO_VERSION >= QT_VERSION_CHECK(5,71,0)
KIO::OpenUrlJob(QUrl(QStringLiteral("https://kdenlive.org/troubleshooting")), QStringLiteral("text/html"));
auto *job = new KIO::OpenUrlJob(QUrl(QStringLiteral("https://kdenlive.org/troubleshooting")));
job->setUiDelegate(new KIO::JobUiDelegate(KJobUiDelegate::AutoHandlingEnabled, this));
// methods like setRunExecutables, setSuggestedFilename, setEnableExternalBrowser, setFollowRedirections
// exist in both classes
job->start();
//KIO::OpenUrlJob(QUrl(QStringLiteral("https://kdenlive.org/troubleshooting")), QStringLiteral("text/html"));
#else
KRun::runUrl(QUrl(QStringLiteral("https://kdenlive.org/troubleshooting")), QStringLiteral("text/html"), this, KRun::RunFlags());
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment