]> git.sesse.net Git - kdenlive/commitdiff
Allow users to download new MLT project profiles from the Kdenlive website with KNewstuff
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 27 Feb 2009 00:36:09 +0000 (00:36 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 27 Feb 2009 00:36:09 +0000 (00:36 +0000)
svn path=/branches/KDE4/; revision=3079

src/CMakeLists.txt
src/kdenlive_mltprofiles.knsrc [new file with mode: 0644]
src/kdenlivesettingsdialog.cpp
src/kdenliveui.rc
src/mainwindow.cpp
src/mainwindow.h

index 96a0eec5599198f0014cdf612f18797e79de465f..ea6360d21f6083903da8c2e6792eb38a01aa4de9 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 kdenlive_render.knsrc DESTINATION  ${CONFIG_INSTALL_DIR} )
+install( FILES kdenlive.knsrc kdenlive_render.knsrc kdenlive_mltprofiles.knsrc DESTINATION  ${CONFIG_INSTALL_DIR} )
 kde4_install_icons( ${ICON_INSTALL_DIR} )
 
 
diff --git a/src/kdenlive_mltprofiles.knsrc b/src/kdenlive_mltprofiles.knsrc
new file mode 100644 (file)
index 0000000..3fb5a5b
--- /dev/null
@@ -0,0 +1,4 @@
+[KNewStuff2]
+ProvidersUrl=http://kdenlive.org/data/mltprofilesources.xml
+TargetDir=kdenlive/profiles
+Uncompress=archive
index 47a4f2edf7a148cbb0556058133193949c4eff0d..3d00638057a1c02887f9f5a949011a39a3e384c3 100644 (file)
@@ -110,13 +110,6 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(QWidget * parent): KConfigDialog(
     connect(m_configEnv.kp_audio, SIGNAL(clicked()), this, SLOT(slotEditAudioApplication()));
     connect(m_configEnv.kp_player, SIGNAL(clicked()), this, SLOT(slotEditVideoApplication()));
 
-    QMap <QString, QString> profilesInfo = ProfilesDialog::getProfilesInfo();
-    QMapIterator<QString, QString> i(profilesInfo);
-    while (i.hasNext()) {
-        i.next();
-        m_configMisc.kcfg_profiles_list->addItem(i.key(), i.value());
-    }
-
     checkProfile();
 
     slotUpdateDisplay();
@@ -172,6 +165,14 @@ void KdenliveSettingsDialog::slotUpdateRmdRegionStatus() {
 }
 
 void KdenliveSettingsDialog::checkProfile() {
+    m_configMisc.kcfg_profiles_list->clear();
+    QMap <QString, QString> profilesInfo = ProfilesDialog::getProfilesInfo();
+    QMapIterator<QString, QString> i(profilesInfo);
+    while (i.hasNext()) {
+        i.next();
+        m_configMisc.kcfg_profiles_list->addItem(i.key(), i.value());
+    }
+
     if (!KdenliveSettings::default_profile().isEmpty()) {
         for (int i = 0; i < m_configMisc.kcfg_profiles_list->count(); i++) {
             if (m_configMisc.kcfg_profiles_list->itemData(i).toString() == KdenliveSettings::default_profile()) {
index 9f30d2a0f875a92d7f3645b82a53ab370bbc71fe..20ff76c6c43081c97aa978aef708160c5dcbf2b0 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<gui name="kdenlive" version="35">
+<gui name="kdenlive" version="36">
   <ToolBar name="extraToolBar" >
     <text>Extra Toolbar</text>
        <Action name="project_render" />
       <Action name="manage_profiles" />
       <Action name="get_new_lumas" />
       <Action name="get_new_profiles" />
-      <Action name="run_wizard" />   
+      <Action name="get_new_mlt_profiles" />
+      <Action name="run_wizard" />
 </Menu>
   </MenuBar>
 </gui>
\ No newline at end of file
index f2804eab0e58e93ce4ab9b23252bfa18d13bc78d..7147d3b8789430e3207c32018f683d3184e331b6 100644 (file)
@@ -772,13 +772,15 @@ void MainWindow::setupActions() {
     m_projectSearchNext->setShortcut(Qt::Key_F3);
     m_projectSearchNext->setEnabled(false);
 
-    KAction* profilesAction = new KAction(KIcon("document-new"), i18n("Manage Profiles"), this);
+    KAction* profilesAction = new KAction(KIcon("document-new"), i18n("Manage Project Profiles"), this);
     collection->addAction("manage_profiles", profilesAction);
     connect(profilesAction, SIGNAL(triggered(bool)), this, SLOT(slotEditProfiles()));
 
     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");
+    KNS::standardAction(i18n("Download New Render Profiles..."), this, SLOT(slotGetNewRenderStuff()), actionCollection(), "get_new_profiles");
+
+    KNS::standardAction(i18n("Download New Project Profiles..."), this, SLOT(slotGetNewMltProfileStuff()), actionCollection(), "get_new_mlt_profiles");
 
     KAction* wizAction = new KAction(KIcon("configure"), i18n("Run Config Wizard"), this);
     collection->addAction("run_wizard", wizAction);
@@ -1398,7 +1400,10 @@ void MainWindow::parseProfiles(const QString &mltPath) {
 
 void MainWindow::slotEditProfiles() {
     ProfilesDialog *w = new ProfilesDialog;
-    w->exec();
+    if (w->exec() == QDialog::Accepted) {
+        KdenliveSettingsDialog* d = static_cast <KdenliveSettingsDialog*>(KConfigDialog::exists("settings"));
+        if (d) d->checkProfile();
+    }
     delete w;
 }
 
@@ -1720,7 +1725,6 @@ void MainWindow::slotPreferences(int page, int option) {
     if (KConfigDialog::showDialog("settings")) {
         KdenliveSettingsDialog* d = static_cast <KdenliveSettingsDialog*>(KConfigDialog::exists("settings"));
         if (page != -1) d->showPage(page, option);
-        d->checkProfile();
         return;
     }
 
@@ -2320,6 +2324,30 @@ void MainWindow::slotGetNewRenderStuff() {
     }
 }
 
+void MainWindow::slotGetNewMltProfileStuff() {
+    //KNS::Entry::List download();
+
+    KNS::Engine engine(0);
+    if (engine.init("kdenlive_mltprofiles.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;
+                    }
+                }
+            }
+
+            // update the list of profiles in settings dialog
+            KdenliveSettingsDialog* d = static_cast <KdenliveSettingsDialog*>(KConfigDialog::exists("settings"));
+            if (d) d->checkProfile();
+        }
+    }
+}
+
 void MainWindow::slotAutoTransition() {
     m_activeTimeline->projectView()->autoTransition();
 }
index 2dd79beaed0bbb650dc487f27c087c5b6b10df91..4f4601fca1bf43e2d3a019d313721aff2c7b8573 100644 (file)
@@ -285,6 +285,7 @@ private slots:
     void slotChangeTrack(int ix = 0);
     void slotGetNewLumaStuff();
     void slotGetNewRenderStuff();
+    void slotGetNewMltProfileStuff();
     void slotAutoTransition();
     void slotRunWizard();
     void generateClip();