]> git.sesse.net Git - kdenlive/commitdiff
First steps for downloadable rendering profiles
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 14 Feb 2009 18:17:30 +0000 (18:17 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 14 Feb 2009 18:17:30 +0000 (18:17 +0000)
svn path=/branches/KDE4/; revision=3050

src/CMakeLists.txt
src/kdenlive.knsrc
src/kdenlive_render.knsrc [new file with mode: 0644]
src/kdenliveui.rc
src/mainwindow.cpp
src/mainwindow.h
src/renderwidget.cpp
src/renderwidget.h

index ba64d308b9d3ca757c3c30854e439f69d2ded208..96a0eec5599198f0014cdf612f18797e79de465f 100644 (file)
@@ -185,7 +185,7 @@ install( FILES kdenliveui.rc kdenlive.notifyrc DESTINATION  ${DATA_INSTALL_DIR}/
 install (FILES kdenlivesettings.kcfg DESTINATION share/config.kcfg)
 install (FILES kdenlive.desktop DESTINATION share/applications/kde)
 install (FILES application-x-kdenlive.svgz video-mlt-playlist.svgz DESTINATION share/icons/oxygen/scalable/mimetypes)
-install( FILES kdenlive.knsrc  DESTINATION  ${CONFIG_INSTALL_DIR} )
+install( FILES kdenlive.knsrc kdenlive_render.knsrc DESTINATION  ${CONFIG_INSTALL_DIR} )
 kde4_install_icons( ${ICON_INSTALL_DIR} )
 
 
index 593662d54875a390bde6017ae2f18d4f427dfd10..6301796a8ea51608b032d1bf4eec718c532e9d53 100644 (file)
@@ -1,4 +1,4 @@
 [KNewStuff2]
 ProvidersUrl=http://download.kde.org/khotnewstuff/kdenlive-providers.xml
 TargetDir=kdenlive/lumas
-Uncompress=archive
\ No newline at end of file
+Uncompress=archive
diff --git a/src/kdenlive_render.knsrc b/src/kdenlive_render.knsrc
new file mode 100644 (file)
index 0000000..2d7855e
--- /dev/null
@@ -0,0 +1,4 @@
+[KNewStuff2]
+ProvidersUrl=http://kdenlive.org/data/rendersources.xml
+TargetDir=kdenlive/export
+Uncompress=archive
index 220b028d6590369bd5087337a5464a5dd30b5715..eea052fc6b44b3bf5507b1362efab734da421628 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<gui name="kdenlive" version="32">
+<gui name="kdenlive" version="33">
   <ToolBar name="extraToolBar" >
     <text>Extra Toolbar</text>
        <Action name="project_render" />
     </Menu>
     <Menu name="settings" >
       <Action name="manage_profiles" />
-      <Action name="get_new_stuff" />      
+      <Action name="get_new_lumas" />
+      <Action name="get_new_profiles" />
       <Action name="run_wizard" />   
 </Menu>
   </MenuBar>
index 012649d347c1f67e7853e882b7c35f79ffdc7abb..711a000b09b86fca468698764bd0dd59463c2250 100644 (file)
@@ -776,7 +776,9 @@ void MainWindow::setupActions() {
     collection->addAction("manage_profiles", profilesAction);
     connect(profilesAction, SIGNAL(triggered(bool)), this, SLOT(slotEditProfiles()));
 
-    KAction* fileGHNS = KNS::standardAction(i18n("Download New Lumas..."), this, SLOT(slotGetNewStuff()), actionCollection(), "get_new_stuff");
+    KNS::standardAction(i18n("Download New Lumas..."), this, SLOT(slotGetNewLumaStuff()), actionCollection(), "get_new_lumas");
+
+    KNS::standardAction(i18n("Download New Profiles..."), this, SLOT(slotGetNewRenderStuff()), actionCollection(), "get_new_profiles");
 
     KAction* wizAction = new KAction(KIcon("configure"), i18n("Run Config Wizard"), this);
     collection->addAction("run_wizard", wizAction);
@@ -2248,7 +2250,7 @@ void MainWindow::slotSetOutPoint() {
     } else m_activeTimeline->projectView()->setOutPoint();
 }
 
-void MainWindow::slotGetNewStuff() {
+void MainWindow::slotGetNewLumaStuff() {
     //KNS::Entry::List download();
     KNS::Entry::List entries = KNS::Engine::download();
     int numberInstalled = 0;
@@ -2266,6 +2268,27 @@ void MainWindow::slotGetNewStuff() {
     initEffects::refreshLumas();
 }
 
+void MainWindow::slotGetNewRenderStuff() {
+    //KNS::Entry::List download();
+
+    KNS::Engine engine(0);
+    if (engine.init("kdenlive_render.knsrc")) {
+        KNS::Entry::List entries = engine.downloadDialogModal(this);
+
+        if (entries.size() > 0) {
+            foreach(KNS::Entry* entry, entries) {
+                // care only about installed ones
+                if (entry->status() == KNS::Entry::Installed) {
+                    foreach(const QString &file, entry->installedFiles()) {
+                        kDebug() << "// CURRENTLY INSTALLED: " << file;
+                    }
+                }
+            }
+        }
+        if (m_renderWidget) m_renderWidget->reloadProfiles();
+    }
+}
+
 void MainWindow::slotAutoTransition() {
     m_activeTimeline->projectView()->autoTransition();
 }
index 95a532e2c7bfd0949eb7afec62aeef041c81c5e1..2dd79beaed0bbb650dc487f27c087c5b6b10df91 100644 (file)
@@ -283,7 +283,8 @@ private slots:
     void slotInsertTrack(int ix = 0);
     void slotDeleteTrack(int ix = 0);
     void slotChangeTrack(int ix = 0);
-    void slotGetNewStuff();
+    void slotGetNewLumaStuff();
+    void slotGetNewRenderStuff();
     void slotAutoTransition();
     void slotRunWizard();
     void generateClip();
index 175f0f2f91d03a0e2bffade17a34e95cf356ec2d..83d3270db0badedddd659dd09a23ecce52b49e6b 100644 (file)
@@ -746,6 +746,10 @@ void RenderWidget::refreshParams() {
     m_view.buttonStart->setEnabled(true);
 }
 
+void RenderWidget::reloadProfiles() {
+    parseProfiles();
+}
+
 void RenderWidget::parseProfiles(QString group, QString profile) {
     m_view.size_list->clear();
     m_view.format_list->clear();
@@ -753,13 +757,22 @@ void RenderWidget::parseProfiles(QString group, QString profile) {
     m_view.destination_list->addItem(KIcon("video-x-generic"), i18n("File rendering"));
     QString exportFile = KStandardDirs::locate("appdata", "export/profiles.xml");
     parseFile(exportFile, false);
-    exportFile = KStandardDirs::locateLocal("appdata", "export/customprofiles.xml");
-    if (QFile::exists(exportFile)) parseFile(exportFile, true);
+
+
+    QString exportFolder = KStandardDirs::locateLocal("appdata", "export/");
+    QDir directory = QDir(exportFolder);
+    QStringList filter;
+    filter << "*.xml";
+    const QStringList fileList = directory.entryList(filter, QDir::Files);
+    foreach(const QString filename, fileList)
+    parseFile(exportFolder + '/' + filename, true);
+
     refreshView();
     QList<QListWidgetItem *> child;
-    child = m_view.format_list->findItems(group, Qt::MatchExactly);
+    if (!group.isEmpty()) child = m_view.format_list->findItems(group, Qt::MatchExactly);
     if (!child.isEmpty()) m_view.format_list->setCurrentItem(child.at(0));
-    child = m_view.size_list->findItems(profile, Qt::MatchExactly);
+    child.clear();
+    if (!profile.isEmpty()) child = m_view.size_list->findItems(profile, Qt::MatchExactly);
     if (!child.isEmpty()) m_view.size_list->setCurrentItem(child.at(0));
 }
 
@@ -801,6 +814,7 @@ void RenderWidget::parseFile(QString exportFile, bool editable) {
                 else if (metagroupId == "websites") icon = KIcon("applications-internet");
                 else if (metagroupId == "mediaplayers") icon = KIcon("applications-multimedia");
                 else if (metagroupId == "lossless") icon = KIcon("drive-harddisk");
+                else if (metagroupId == "mobile") icon = KIcon("pda");
                 m_view.destination_list->addItem(icon, i18n(metagroupName.toUtf8().data()), metagroupId);
             }
         }
index 58308a66dfed41755af2435d640fb950662d6e29..4093dac0bb0abeb6022481ebb06e6b56fcedc99e 100644 (file)
@@ -141,6 +141,7 @@ public:
     void setRenderJob(const QString &dest, int progress = 0);
     void setRenderStatus(const QString &dest, int status, const QString &error);
     void setDocumentPath(const QString path);
+    void reloadProfiles();
 
 private slots:
     void slotUpdateButtons(KUrl url);