]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
cleanup & fix crash on project saving with Qt 4.5:
[kdenlive] / src / mainwindow.cpp
index f0191d85fa8d79cbaac421e2f817be6d7a183dca..61023a80177ea047aafbab009b47bbf26988ecbf 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);
@@ -892,6 +894,7 @@ void MainWindow::setupActions() {
 
     KAction* editTimelineClipSpeed = new KAction(i18n("Change Clip Speed"), this);
     collection->addAction("change_clip_speed", editTimelineClipSpeed);
+    editTimelineClipSpeed->setData("change_speed");
     connect(editTimelineClipSpeed, SIGNAL(triggered(bool)), this, SLOT(slotChangeClipSpeed()));
 
     KAction *stickTransition = collection->addAction("auto_transition");
@@ -960,6 +963,7 @@ void MainWindow::setupActions() {
 
     QAction *pasteEffects = new KAction(KIcon("edit-paste"), i18n("Paste Effects"), this);
     collection->addAction("paste_effects", pasteEffects);
+    pasteEffects->setData("paste_effects");
     connect(pasteEffects , SIGNAL(triggered()), this, SLOT(slotPasteEffects()));
 
     m_closeAction = KStandardAction::close(this, SLOT(closeCurrentDocument()), collection);
@@ -1177,7 +1181,7 @@ void MainWindow::closeCurrentDocument() {
 }
 
 bool MainWindow::saveFileAs(const QString &outputFileName) {
-    QDomDocument currentSceneList;
+    QString currentSceneList;
     if (KdenliveSettings::dropbframes()) {
         KdenliveSettings::setDropbframes(false);
         m_activeDocument->clipManager()->updatePreviewSettings();
@@ -1396,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;
 }
 
@@ -1718,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;
     }
 
@@ -2318,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();
 }