summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <jb@kdenlive.org>2016-11-27 18:00:41 (GMT)
committerJean-Baptiste Mardelle <jb@kdenlive.org>2016-11-27 18:01:28 (GMT)
commit2719cc32779afbef53d60805f1083c9464c1b7cf (patch)
tree3fb4befe83f066dd765cbe9356b481f04efd5db6
parentcb9c8eef091f1552e7279696629ed5782dca9a0f (diff)
Several First run wizard fixes:
Fix icon, codec detection, add warning if frei0r or breeze are not installed BUG: 372867
-rw-r--r--src/dialogs/wizard.cpp64
-rw-r--r--src/mainwindow.cpp2
2 files changed, 47 insertions, 19 deletions
diff --git a/src/dialogs/wizard.cpp b/src/dialogs/wizard.cpp
index 204d1de..71ac70c 100644
--- a/src/dialogs/wizard.cpp
+++ b/src/dialogs/wizard.cpp
@@ -87,7 +87,7 @@ Wizard::Wizard(bool autoClose, QWidget *parent) :
m_page = new MyWizardPage(this);
m_page->setTitle(i18n("Welcome to Kdenlive %1", QString(kdenlive_version)));
m_page->setSubTitle(i18n("Using MLT %1", mlt_version_get_string()));
- setPixmap(QWizard::LogoPixmap, KoIconUtils::themedIcon("kdenlive").pixmap(logoHeight, logoHeight));
+ setPixmap(QWizard::LogoPixmap, KoIconUtils::themedIcon(":/pics/kdenlive.png").pixmap(logoHeight, logoHeight));
m_startLayout = new QVBoxLayout;
m_errorWidget = new KMessageWidget(this);
m_startLayout->addWidget(m_errorWidget);
@@ -103,7 +103,6 @@ Wizard::Wizard(bool autoClose, QWidget *parent) :
setButtonText(QWizard::FinishButton, i18n("Ok"));
slotCheckMlt();
- m_startLayout->addStretch();
if (!m_errors.isEmpty() || !m_warnings.isEmpty() || !m_infos.isEmpty()) {
QLabel *lab = new QLabel(this);
lab->setText(i18n("Startup error or warning, check our <a href='#'>online manual</a>."));
@@ -129,6 +128,7 @@ Wizard::Wizard(bool autoClose, QWidget *parent) :
KMessageWidget *errorLabel = new KMessageWidget(this);
errorLabel->setText("<ul>" + m_errors + "</ul>");
errorLabel->setMessageType(KMessageWidget::Error);
+ errorLabel->setWordWrap(true);
errorLabel->setCloseButtonVisible(false);
m_startLayout->addWidget(errorLabel);
m_page->setComplete(false);
@@ -146,6 +146,7 @@ Wizard::Wizard(bool autoClose, QWidget *parent) :
KMessageWidget *errorLabel = new KMessageWidget(this);
errorLabel->setText("<ul>" + m_warnings + "</ul>");
errorLabel->setMessageType(KMessageWidget::Warning);
+ errorLabel->setWordWrap(true);
errorLabel->setCloseButtonVisible(false);
m_startLayout->addWidget(errorLabel);
errorLabel->show();
@@ -154,6 +155,7 @@ Wizard::Wizard(bool autoClose, QWidget *parent) :
KMessageWidget *errorLabel = new KMessageWidget(this);
errorLabel->setText("<ul>" + m_infos + "</ul>");
errorLabel->setMessageType(KMessageWidget::Information);
+ errorLabel->setWordWrap(true);
errorLabel->setCloseButtonVisible(false);
m_startLayout->addWidget(errorLabel);
errorLabel->show();
@@ -341,6 +343,38 @@ void Wizard::checkMltComponents()
producersItemList << producers->get_name(i);
delete producers;
+ // Check that we have the frei0r effects installed
+ Mlt::Properties *filters = repository->filters();
+ bool hasFrei0r = false;
+ QString filterName;
+ for (int i = 0; i < filters->count(); ++i) {
+ filterName = filters->get_name(i);
+ if (filterName.startsWith(QStringLiteral("frei0r."))) {
+ hasFrei0r = true;
+ break;
+ }
+ }
+ delete filters;
+ if (!hasFrei0r) {
+ // Frei0r effects not found
+ m_warnings.append(QString("<li>Missing package: <b>Frei0r</b> effects (frei0r-plugins)<br/>provides many effects and transitions. Install recommanded</li>"));
+ }
+
+ // Check that we have the breeze icon theme installed
+ QStringList iconPaths = QIcon::themeSearchPaths();
+ bool hasBreeze = false;
+ foreach(const QString &path, iconPaths) {
+ QDir dir(path);
+ if (dir.exists(QStringLiteral("breeze"))) {
+ hasBreeze = true;
+ break;
+ }
+ }
+ if (!hasBreeze) {
+ // Breeze icons not found
+ m_warnings.append(QString("<li>Missing package: <b>Breeze</b> icons (breeze-icon-theme)<br/>provides many icons used in Kdenlive. Install recommanded</li>"));
+ }
+
Mlt::Properties *consumers = repository->consumers();
QStringList consumersItemList;
for (int i = 0; i < consumers->count(); ++i)
@@ -411,19 +445,23 @@ void Wizard::checkMissingCodecs()
if (acodecsList.contains(QStringLiteral("libvorbis"))) replaceVorbisCodec = true;
bool replaceLibfaacCodec = false;
if (!acodecsList.contains(QStringLiteral("aac")) && acodecsList.contains(QStringLiteral("libfaac"))) replaceLibfaacCodec = true;
-
- QString exportFolder = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/export/";
- QDir directory = QDir(exportFolder);
+ QStringList profilesList;
+ profilesList << QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("export/profiles.xml"));
+ QDir directory = QDir(QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/export/");
QStringList filter;
filter << QStringLiteral("*.xml");
QStringList fileList = directory.entryList(filter, QDir::Files);
+ foreach(const QString &filename, fileList) {
+ profilesList << directory.absoluteFilePath(filename);
+ }
+
// We should parse customprofiles.xml in last position, so that user profiles
// can also override profiles installed by KNewStuff
QStringList requiredACodecs;
QStringList requiredVCodecs;
- foreach(const QString &filename, fileList) {
+ foreach(const QString &filename, profilesList) {
QDomDocument doc;
- QFile file(exportFolder + filename);
+ QFile file(filename);
doc.setContent(&file, false);
file.close();
QString std;
@@ -455,7 +493,6 @@ void Wizard::checkMissingCodecs()
requiredACodecs.replace(ix, QStringLiteral("libfaac"));
}
}
-
for (int i = 0; i < acodecsList.count(); ++i)
requiredACodecs.removeAll(acodecsList.at(i));
for (int i = 0; i < vcodecsList.count(); ++i)
@@ -465,16 +502,7 @@ void Wizard::checkMissingCodecs()
if (!missing.isEmpty() && !requiredVCodecs.isEmpty()) missing.append(',');
missing.append(requiredVCodecs.join(QStringLiteral(",")));
missing.prepend(i18n("The following codecs were not found on your system. Check our <a href=''>online manual</a> if you need them: "));
- // Some codecs required for rendering are not present on this system, warn user
- show();
- KMessageWidget *infoMessage = new KMessageWidget(this);
- m_startLayout->insertWidget(1, infoMessage);
- infoMessage->setCloseButtonVisible(false);
- infoMessage->setWordWrap(true);
- infoMessage->setMessageType(KMessageWidget::Warning);
- connect(infoMessage, &KMessageWidget::linkActivated, this, &Wizard::slotOpenManual);
- infoMessage->setText(missing);
- infoMessage->animatedShow();
+ m_infos.append(QString("<li>%1</li>").arg(missing));
}
}
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index d45586b..dd3203b 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -667,7 +667,7 @@ MainWindow::MainWindow(const QString &MltPath, const QUrl &Url, const QString &
#endif
scmanager->slotCheckActiveScopes();
//TODO: remove for release
- m_messageLabel->setMessage("This is a beta version. Always backup your data", MltError);
+ //m_messageLabel->setMessage("This is a beta version. Always backup your data", MltError);
}
void MainWindow::slotThemeChanged(const QString &theme)