]> git.sesse.net Git - kdenlive/commitdiff
Fix bug in project default rendering settings:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 1 Feb 2010 21:16:52 +0000 (21:16 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 1 Feb 2010 21:16:52 +0000 (21:16 +0000)
http://kdenlive.org/mantis/view.php?id=1402

svn path=/trunk/kdenlive/; revision=4267

src/mainwindow.cpp
src/mainwindow.h
src/renderer.cpp
src/renderwidget.cpp
src/renderwidget.h

index 9274d5af2e7e3df748cb181379cae1e56ab37e7e..15afb56e9e4bf79eecc299363ea8ed46b90b3b82 100644 (file)
@@ -1852,7 +1852,7 @@ void MainWindow::slotRenderProject()
         QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) : KdenliveSettings::defaultprojectfolder();
         m_renderWidget = new RenderWidget(projectfolder, this);
         connect(m_renderWidget, SIGNAL(shutdown()), this, SLOT(slotShutdown()));
-        connect(m_renderWidget, SIGNAL(selectedRenderProfile(const QString &, const QString &, const QString&)), this, SLOT(slotSetDocumentRenderProfile(const QString &, const QString &, const QString&)));
+        connect(m_renderWidget, SIGNAL(selectedRenderProfile(const QString &, const QString &, const QString &, const QString&)), this, SLOT(slotSetDocumentRenderProfile(const QString &, const QString &, const QString &, const QString&)));
         connect(m_renderWidget, SIGNAL(prepareRenderingData(bool, bool, const QString&)), this, SLOT(slotPrepareRendering(bool, bool, const QString&)));
         connect(m_renderWidget, SIGNAL(abortProcess(const QString &)), this, SIGNAL(abortRenderJob(const QString &)));
         connect(m_renderWidget, SIGNAL(openDvdWizard(const QString &, const QString &)), this, SLOT(slotDvdWizard(const QString &, const QString &)));
@@ -1860,7 +1860,7 @@ void MainWindow::slotRenderProject()
             m_renderWidget->setProfile(m_activeDocument->mltProfile());
             m_renderWidget->setGuides(m_activeDocument->guidesXml(), m_activeDocument->projectDuration());
             m_renderWidget->setDocumentPath(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash));
-            m_renderWidget->setRenderProfile(m_activeDocument->getDocumentProperty("renderdestination"), m_activeDocument->getDocumentProperty("renderprofile"), m_activeDocument->getDocumentProperty("renderurl"));
+            m_renderWidget->setRenderProfile(m_activeDocument->getDocumentProperty("renderdestination"), m_activeDocument->getDocumentProperty("rendercategory"), m_activeDocument->getDocumentProperty("renderprofile"), m_activeDocument->getDocumentProperty("renderurl"));
         }
     }
     /*TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
@@ -2051,7 +2051,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
         m_renderWidget->setProfile(doc->mltProfile());
         m_renderWidget->setGuides(doc->guidesXml(), doc->projectDuration());
         m_renderWidget->setDocumentPath(doc->projectFolder().path(KUrl::AddTrailingSlash));
-        m_renderWidget->setRenderProfile(doc->getDocumentProperty("renderdestination"), doc->getDocumentProperty("renderprofile"), doc->getDocumentProperty("renderurl"));
+        m_renderWidget->setRenderProfile(doc->getDocumentProperty("renderdestination"), doc->getDocumentProperty("rendercategory"), doc->getDocumentProperty("renderprofile"), doc->getDocumentProperty("renderurl"));
     }
     //doc->setRenderer(m_projectMonitor->render);
     m_commandStack->setActiveStack(doc->commandStack());
@@ -3073,10 +3073,11 @@ void MainWindow::slotTranscodeClip()
     slotTranscode(urls);
 }
 
-void MainWindow::slotSetDocumentRenderProfile(const QString &dest, const QString &name, const QString &file)
+void MainWindow::slotSetDocumentRenderProfile(const QString &dest, const QString &group, const QString &name, const QString &file)
 {
     if (m_activeDocument == NULL) return;
     m_activeDocument->setDocumentProperty("renderdestination", dest);
+    m_activeDocument->setDocumentProperty("rendercategory", group);
     m_activeDocument->setDocumentProperty("renderprofile", name);
     m_activeDocument->setDocumentProperty("renderurl", file);
     m_activeDocument->setModified(true);
index 86ca504ccf637047b1101c51ed69f75db27fb448..a5d44a4e9ae123c8b09028df208fe47a466f42c6 100644 (file)
@@ -324,7 +324,7 @@ private slots:
     void slotMaximizeCurrent(bool show);
     void slotTranscode(KUrl::List urls = KUrl::List());
     void slotTranscodeClip();
-    void slotSetDocumentRenderProfile(const QString &dest, const QString &name, const QString &file);
+    void slotSetDocumentRenderProfile(const QString &dest, const QString &group, const QString &name, const QString &file);
     void slotPrepareRendering(bool scriptExport, bool zoneOnly, const QString &chapterFile);
     void slotUpdateTimecodeFormat(int ix);
     /** Removes the focus of anything */
index d5123fa2929c862d4db5f04a709c845a5770c4e7..6788360e5a9d266ff37d7610bfd65b9748c446f4 100644 (file)
@@ -1341,7 +1341,7 @@ void Render::playZone(const GenTime & startTime, const GenTime & stopTime)
         return;
     m_isBlocked = false;
     if (!m_isZoneMode) m_originalOut = m_mltProducer->get_playtime() - 1;
-    m_mltProducer->set("out", (int) (stopTime.frames(m_fps)));
+    m_mltProducer->set("out", (int)(stopTime.frames(m_fps)));
     m_mltProducer->seek((int)(startTime.frames(m_fps)));
     m_mltProducer->set_speed(1.0);
     m_mltConsumer->set("refresh", 1);
index 26cd92944549c23c822e4ac079d58b5782227d11..a778a22145785bee235f8dedf45b98bee2cc9325 100644 (file)
@@ -808,7 +808,7 @@ void RenderWidget::slotExport(bool scriptExport, int zoneIn, int zoneOut, const
     m_view.tabWidget->setCurrentIndex(1);
 
     // Save rendering profile to document
-    emit selectedRenderProfile(m_view.size_list->currentItem()->data(MetaGroupRole).toString(), m_view.size_list->currentItem()->text(), dest);
+    emit selectedRenderProfile(m_view.size_list->currentItem()->data(MetaGroupRole).toString(), m_view.size_list->currentItem()->data(GroupRole).toString(), m_view.size_list->currentItem()->text(), dest);
 
     // insert item in running jobs list
     QTreeWidgetItem *renderItem;
@@ -1659,34 +1659,37 @@ void RenderWidget::slotHideLog()
     m_view.error_box->setVisible(false);
 }
 
-void RenderWidget::setRenderProfile(const QString &dest, const QString &name, const QString &url)
+void RenderWidget::setRenderProfile(const QString &dest, const QString &group, const QString &name, const QString &url)
 {
     m_view.destination_list->blockSignals(true);
     m_view.format_list->blockSignals(true);
-    m_view.size_list->blockSignals(true);
 
     if (!url.isEmpty()) m_view.out_file->setUrl(KUrl(url));
 
+    // set destination
     for (int i = 0; i < m_view.destination_list->count(); i++) {
         if (m_view.destination_list->itemData(i, Qt::UserRole) == dest) {
             m_view.destination_list->setCurrentIndex(i);
             break;
         }
     }
+    refreshCategory();
+
+    // set category
+    if (!group.isEmpty()) {
+        QList<QListWidgetItem *> childs = m_view.format_list->findItems(group, Qt::MatchExactly);
+        if (!childs.isEmpty()) {
+            m_view.format_list->setCurrentItem(childs.at(0));
+        }
+        refreshView();
+    }
+
+    // set profile
     QList<QListWidgetItem *> childs = m_view.size_list->findItems(name, Qt::MatchExactly);
     if (!childs.isEmpty()) {
-        QListWidgetItem *profile = childs.at(0);
-        if (profile->isHidden()) {
-            QString group = profile->data(GroupRole).toString();
-            childs = m_view.format_list->findItems(group, Qt::MatchExactly);
-            if (!childs.isEmpty()) {
-                m_view.format_list->setCurrentItem(childs.at(0));
-            }
-        }
-        //refreshView();
-        m_view.size_list->blockSignals(false);
-        m_view.size_list->setCurrentItem(profile);
-    } else m_view.size_list->blockSignals(false);
+        m_view.size_list->setCurrentItem(childs.at(0));
+    }
+    //refreshView();
     m_view.destination_list->blockSignals(false);
     m_view.format_list->blockSignals(false);
 
index fd808535cf3d7cf371e51d782637d56604345208..57b4c65a3b508e33cefee9c28eed83bf1a3336ae 100644 (file)
@@ -108,7 +108,7 @@ public:
     void setRenderStatus(const QString &dest, int status, const QString &error);
     void setDocumentPath(const QString path);
     void reloadProfiles();
-    void setRenderProfile(const QString &dest, const QString &name, const QString &url);
+    void setRenderProfile(const QString &dest, const QString &group, const QString &name, const QString &url);
     int waitingJobsCount() const;
     QString getFreeScriptName(const QString &prefix = QString());
     bool startWaitingRenderJobs();
@@ -167,7 +167,7 @@ signals:
     void openDvdWizard(const QString &url, const QString &profile);
     /** Send the infos about rendering that will be saved in the document:
     (profile destination, profile name and url of rendered file */
-    void selectedRenderProfile(const QString &, const QString &, const QString &);
+    void selectedRenderProfile(const QString &, const QString &, const QString &, const QString &);
     void prepareRenderingData(bool scriptExport, bool zoneOnly, const QString &chapterFile);
     void shutdown();
 };