]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
Improve profile selection in First run wizard
[kdenlive] / src / mainwindow.cpp
index 3a2fe9e0c0c53ab543b940fc17162ea33fd145e5..f4f28149768b730e04ca44d0fb8d70ff472059d8 100644 (file)
@@ -813,6 +813,10 @@ void MainWindow::setupActions() {
     collection->addAction("delete_track", deleteTrack);
     connect(deleteTrack, SIGNAL(triggered()), this, SLOT(slotDeleteTrack()));
 
+    KAction *changeTrack = new KAction(KIcon(), i18n("Change Track"), this);
+    collection->addAction("change_track", changeTrack);
+    connect(changeTrack, SIGNAL(triggered()), this, SLOT(slotChangeTrack()));
+
     KAction *addGuide = new KAction(KIcon("document-new"), i18n("Add Guide"), this);
     collection->addAction("add_guide", addGuide);
     connect(addGuide, SIGNAL(triggered()), this, SLOT(slotAddGuide()));
@@ -896,6 +900,13 @@ void MainWindow::readOptions() {
         } 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());
@@ -906,12 +917,12 @@ void MainWindow::readOptions() {
 void MainWindow::newFile(bool showProjectSettings) {
     QString profileName;
     KUrl projectFolder;
-    QPoint projectTracks(3, 2);
+    QPoint projectTracks(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks());
     if (!showProjectSettings && m_timelineArea->count() == 0) {
         if (!KdenliveSettings::activatetabs()) closeCurrentDocument();
         profileName = KdenliveSettings::default_profile();
     } else {
-        ProjectSettings *w = new ProjectSettings;
+        ProjectSettings *w = new ProjectSettings(projectTracks.x(), projectTracks.y(), KdenliveSettings::defaultprojectfolder(), false, this);
         if (w->exec() != QDialog::Accepted) return;
         if (!KdenliveSettings::activatetabs()) closeCurrentDocument();
         profileName = w->selectedProfile();
@@ -1182,7 +1193,9 @@ void MainWindow::slotEditProfiles() {
 }
 
 void MainWindow::slotEditProjectSettings() {
-    ProjectSettings *w = new ProjectSettings;
+    QPoint p = m_activeDocument->getTracksCount();
+    ProjectSettings *w = new ProjectSettings(p.x(), p.y(), m_activeDocument->projectFolder().path(), true, this);
+
     if (w->exec() == QDialog::Accepted) {
         QString profile = w->selectedProfile();
         m_activeDocument->setProfilePath(profile);
@@ -1315,6 +1328,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) { //cha
             disconnect(m_activeTimeline, SIGNAL(cursorMoved()), m_projectMonitor, SLOT(activateMonitor()));
             disconnect(m_activeTimeline, SIGNAL(insertTrack(int)), this, SLOT(slotInsertTrack(int)));
             disconnect(m_activeTimeline, SIGNAL(deleteTrack(int)), this, SLOT(slotDeleteTrack(int)));
+            disconnect(m_activeTimeline, SIGNAL(changeTrack(int)), this, SLOT(slotChangeTrack(int)));
             disconnect(m_activeDocument, SIGNAL(docModified(bool)), this, SLOT(slotUpdateDocumentState(bool)));
             disconnect(effectStack, SIGNAL(updateClipEffect(ClipItem*, QDomElement, QDomElement, int)), m_activeTimeline->projectView(), SLOT(slotUpdateClipEffect(ClipItem*, QDomElement, QDomElement, int)));
             disconnect(effectStack, SIGNAL(removeEffect(ClipItem*, QDomElement)), m_activeTimeline->projectView(), SLOT(slotDeleteEffect(ClipItem*, QDomElement)));
@@ -1345,6 +1359,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) { //cha
     connect(trackView, SIGNAL(cursorMoved()), m_projectMonitor, SLOT(activateMonitor()));
     connect(trackView, SIGNAL(insertTrack(int)), this, SLOT(slotInsertTrack(int)));
     connect(trackView, SIGNAL(deleteTrack(int)), this, SLOT(slotDeleteTrack(int)));
+    connect(trackView, SIGNAL(changeTrack(int)), this, SLOT(slotChangeTrack(int)));
     connect(trackView, SIGNAL(mousePosition(int)), this, SLOT(slotUpdateMousePosition(int)));
     connect(m_projectMonitor, SIGNAL(renderPosition(int)), trackView, SLOT(moveCursorPos(int)));
     connect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), trackView, SLOT(slotSetZone(QPoint)));
@@ -1635,6 +1650,12 @@ void MainWindow::slotDeleteTrack(int ix) {
         m_activeTimeline->projectView()->slotDeleteTrack(ix);
 }
 
+void MainWindow::slotChangeTrack(int ix) {
+    m_projectMonitor->activateMonitor();
+    if (m_activeTimeline)
+        m_activeTimeline->projectView()->slotChangeTrack(ix);
+}
+
 void MainWindow::slotEditGuide() {
     if (m_activeTimeline)
         m_activeTimeline->projectView()->slotEditGuide();