]> git.sesse.net Git - kdenlive/blobdiff - src/wizard.cpp
disable release build!
[kdenlive] / src / wizard.cpp
index c4043ef778fc99fa8350189e90cde24b6dba9f85..20983bab7ba6fb09536c6d62825a12e67e531afe 100644 (file)
 #include "wizard.h"
 #include "kdenlivesettings.h"
 #include "profilesdialog.h"
+#include "kdenlive-config.h"
 
 #include <KStandardDirs>
 #include <KLocale>
 #include <KProcess>
 #include <kmimetype.h>
+#include <KRun>
 
 #include <QLabel>
 #include <QFile>
 #include <QTimer>
 
 const double recommendedMltVersion = 40;
+static const char version[] = VERSION;
 
 Wizard::Wizard(bool upgrade, QWidget *parent) :
         QWizard(parent)
 {
-    setWindowTitle("Config Wizard");
+    setWindowTitle(i18n("Config Wizard"));
     setPixmap(QWizard::WatermarkPixmap, QPixmap(KStandardDirs::locate("appdata", "banner.png")));
 
     QWizardPage *page1 = new QWizardPage;
     page1->setTitle(i18n("Welcome"));
     QLabel *label;
     if (upgrade)
-        label = new QLabel(i18n("Your Kdenlive version was upgraded. Please take some time to review the basic settings"));
+        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)));
     else
         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..."));
     label->setWordWrap(true);
     m_startLayout = new QVBoxLayout;
     m_startLayout->addWidget(label);
+    QPushButton *but = new QPushButton(KIcon("help-about"), i18n("Discover the features of this Kdenlive release"), this);
+    connect(but, SIGNAL(clicked()), this, SLOT(slotShowWebInfos()));
+    m_startLayout->addStretch();
+    m_startLayout->addWidget(but);
+
+
     page1->setLayout(m_startLayout);
     addPage(page1);
 
@@ -168,7 +177,6 @@ void Wizard::checkMltComponents()
         } else {
             avformatItem->setIcon(0, m_okIcon);
             // Make sure we have MLT > 0.3.4
-            bool recentMlt = false;
             int version = 0;
             QString mltVersion;
             QString exepath = KStandardDirs::findExe("pkg-config");
@@ -181,7 +189,6 @@ void Wizard::checkMltComponents()
                     mltVersion = checkProcess.readAllStandardOutput();
                     version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
                     kDebug() << "// FOUND MLT's pkgconfig version: " << version;
-                    if (version > 34) recentMlt = true;
                 }
             }
             if (version == 0) {
@@ -195,21 +202,22 @@ void Wizard::checkMltComponents()
                     mltVersion = mltVersion.section(' ', -1).simplified();
                     version = 100 * mltVersion.section('.', 0, 0).toInt() + 10 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
                     kDebug() << "// FOUND MLT version: " << version;
-                    if (version >= 40) recentMlt = true;
                 }
             }
 
             mltitem->setText(1, i18n("MLT version: %1", mltVersion.simplified()));
             mltitem->setSizeHint(0, itemSize);
-            if (version < recommendedMltVersion) {
-                mltitem->setData(1, Qt::UserRole, i18n("Please upgrade to the latest MLT version"));
+            if (version < 40) {
+                mltitem->setData(1, Qt::UserRole, i18n("Your MLT version is unsupported!!!"));
                 mltitem->setIcon(0, m_badIcon);
             } else {
-                mltitem->setData(1, Qt::UserRole, i18n("MLT version is correct"));
-                mltitem->setIcon(0, m_okIcon);
-            }
-
-            if (recentMlt) {
+                if (version < recommendedMltVersion) {
+                    mltitem->setData(1, Qt::UserRole, i18n("Please upgrade to the latest MLT version"));
+                    mltitem->setIcon(0, m_badIcon);
+                } else {
+                    mltitem->setData(1, Qt::UserRole, i18n("MLT version is correct"));
+                    mltitem->setIcon(0, m_okIcon);
+                }
                 // Check installed audio codecs
                 QProcess checkProcess2;
                 checkProcess2.start(KdenliveSettings::rendererpath(), QStringList() << "noise:" << "-consumer" << "avformat" << "acodec=list");
@@ -544,4 +552,9 @@ bool Wizard::isOk() const
     return m_systemCheckIsOk;
 }
 
+bool Wizard::slotShowWebInfos()
+{
+    KRun::runUrl(KUrl("http://kdenlive.org/discover/" + QString(version).section(' ', 0, 0)), "text/html", this);
+}
+
 #include "wizard.moc"