]> git.sesse.net Git - kdenlive/commitdiff
Show Config wizard if Kdenlive version changed
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 13 Mar 2009 10:51:12 +0000 (10:51 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 13 Mar 2009 10:51:12 +0000 (10:51 +0000)
svn path=/trunk/kdenlive/; revision=3149

src/mainwindow.cpp
src/wizard.cpp
src/wizard.h

index 6c57b06079b6c328d1ef4daf7ea696518b43aad9..ea63023225d9f0405374913db48afefcc62373e2 100644 (file)
@@ -49,6 +49,7 @@
 #include "markerdialog.h"
 #include "clipitem.h"
 #include "interfaces.h"
+#include "kdenlive-config.h"
 
 #include <KApplication>
 #include <KAction>
@@ -85,6 +86,8 @@
 
 #include <stdlib.h>
 
+static const char version[] = VERSION;
+
 static const int ID_STATUS_MSG = 1;
 static const int ID_EDITMODE_MSG = 2;
 static const int ID_TIMELINE_MSG = 3;
@@ -1072,23 +1075,32 @@ void MainWindow::readOptions() {
     KSharedConfigPtr config = KGlobal::config();
     m_fileOpenRecent->loadEntries(KConfigGroup(config, "Recent Files"));
     KConfigGroup initialGroup(config, "version");
-    if (!initialGroup.exists()) {
+    bool upgrade = false;
+    if (initialGroup.exists()) {
+        if (initialGroup.readEntry("version", QString()).section(' ', 0, 0) != QString(version).section(' ', 0, 0))
+            upgrade = true;
+
+        if (initialGroup.readEntry("version") == "0.7") {
+            //Add new settings from 0.7.1
+            if (KdenliveSettings::defaultprojectfolder().isEmpty()) {
+                QString path = QDir::homePath() + "/kdenlive";
+                if (KStandardDirs::makeDir(path)  == false) kDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path;
+                KdenliveSettings::setDefaultprojectfolder(path);
+            }
+        }
+
+    }
+
+    if (!initialGroup.exists() || upgrade) {
         // this is our first run, show Wizard
-        Wizard *w = new Wizard(this);
+        Wizard *w = new Wizard(upgrade, this);
         if (w->exec() == QDialog::Accepted && w->isOk()) {
             w->adjustSettings();
-            initialGroup.writeEntry("version", "0.7");
+            initialGroup.writeEntry("version", version);
             delete w;
         } else {
             ::exit(1);
         }
-    } else if (initialGroup.readEntry("version") == "0.7") {
-        //Add new settings from 0.7.1
-        if (KdenliveSettings::defaultprojectfolder().isEmpty()) {
-            QString path = QDir::homePath() + "/kdenlive";
-            if (KStandardDirs::makeDir(path)  == false) kDebug() << "/// ERROR CREATING PROJECT FOLDER: " << path;
-            KdenliveSettings::setDefaultprojectfolder(path);
-        }
     }
     KConfigGroup treecolumns(config, "Project Tree");
     const QByteArray state = treecolumns.readEntry("columns", QByteArray());
index 5444d21037c4357ebf2741df61b239f43a314d56..375e4f7cf38dc7ef49bdc3569960e9f3d0ec8847 100644 (file)
 
 const double recommendedMltVersion = 36;
 
-Wizard::Wizard(QWidget *parent): QWizard(parent) {
+Wizard::Wizard(bool upgrade, QWidget *parent): QWizard(parent) {
     setPixmap(QWizard::WatermarkPixmap, QPixmap(KStandardDirs::locate("appdata", "banner.png")));
 
     QWizardPage *page1 = new QWizardPage;
     page1->setTitle(i18n("Welcome"));
-    QLabel *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..."));
+    QLabel *label;
+    if (upgrade)
+        label = new QLabel(i18n("Your Kdenlive version was upgraded. Please take some time to review the basic settings"));
+    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);
@@ -99,7 +103,6 @@ Wizard::Wizard(QWidget *parent): QWizard(parent) {
     QWizardPage *page5 = new QWizardPage;
     page5->setTitle(i18n("Checking system"));
     m_check.setupUi(page5);
-    slotCheckPrograms();
     addPage(page5);
 
     listViewDelegate = new WizardDelegate(m_check.programList);
@@ -490,6 +493,7 @@ void Wizard::slotCheckMlt() {
     } else m_systemCheckIsOk = true;
 
     if (m_systemCheckIsOk) checkMltComponents();
+    slotCheckPrograms();
 }
 
 bool Wizard::isOk() const {
index 39bf35d2e894bcbb3b30900f5ffebab822962713..4b922028d18068666caba659aa40a9d8e7630c12 100644 (file)
@@ -73,7 +73,7 @@ public:
 class Wizard : public QWizard {
     Q_OBJECT
 public:
-    Wizard(QWidget * parent = 0);
+    Wizard(bool upgrade, QWidget * parent = 0);
     void installExtraMimes(QString baseName, QStringList globs);
     void runUpdateMimeDatabase();
     void adjustSettings();