]> git.sesse.net Git - kdenlive/blobdiff - src/mainwindow.cpp
Allow to select between timecode (hh:mm:ss:ff) and frame count overlay when rendering
[kdenlive] / src / mainwindow.cpp
index 34ecc812b61d0503cc81c3a026dd4aed4e90208a..bc1dc8389ab1d9e4422243fbe6ab35366e1c9013 100644 (file)
@@ -156,6 +156,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     if (!KdenliveSettings::colortheme().isEmpty()) slotChangePalette(NULL, KdenliveSettings::colortheme());
     setFont(KGlobalSettings::toolBarFont());
     parseProfiles(MltPath);
+    KdenliveSettings::setCurrent_profile(KdenliveSettings::default_profile());
     m_commandStack = new QUndoGroup;
     setDockNestingEnabled(true);
     m_timelineArea = new KTabWidget(this);
@@ -220,7 +221,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     m_notesWidget = new KTextEdit();
     m_notesWidget->setTabChangesFocus(true);
 #if KDE_IS_VERSION(4,4,0)
-    m_notesWidget->setClickMessage(i18n("Enter your project notes here..."));
+    m_notesWidget->setClickMessage(i18n("Enter your project notes here ..."));
 #endif
     m_notesDock->setWidget(m_notesWidget);
     addDockWidget(Qt::TopDockWidgetArea, m_notesDock);
@@ -369,11 +370,13 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     tabifyDockWidget(m_vectorscopeDock, m_undoViewDock);
     tabifyDockWidget(m_vectorscopeDock, m_effectListDock);
 
+    tabifyDockWidget(m_vectorscopeDock, m_spectrogramDock);
+    tabifyDockWidget(m_vectorscopeDock, m_audioSpectrumDock);
+
 
     setCentralWidget(m_timelineArea);
 
 
-    KdenliveSettings::setCurrent_profile(KdenliveSettings::default_profile());
     m_fileOpenRecent = KStandardAction::openRecent(this, SLOT(openFile(const KUrl &)), actionCollection());
     readOptions();
     m_fileRevert = KStandardAction::revert(this, SLOT(slotRevert()), actionCollection());
@@ -398,7 +401,6 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     // Stop motion actions. Beware of the order, we MUST use the same order in stopmotion/stopmotion.cpp
     m_stopmotion_actions = new KActionCategory(i18n("Stop Motion"), actionCollection());
     action = new KAction(KIcon("media-record"), i18n("Capture frame"), this);
-    action->setShortcut(Qt::Key_Space);
     //action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
     m_stopmotion_actions->addAction("stopmotion_capture", action);
     action = new KAction(i18n("Switch live / captured frame"), this);
@@ -408,6 +410,13 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     action->setCheckable(true);
     action->setChecked(false);
     m_stopmotion_actions->addAction("stopmotion_overlay", action);
+
+    // Build effects menu
+    m_effectsMenu = new QMenu(i18n("Add Effect"));
+    m_effectActions = new KActionCategory(i18n("Effects"), actionCollection());
+    m_effectList->reloadEffectList(m_effectsMenu, m_effectActions);
+    m_effectsActionCollection->readSettings();
+    
     setupGUI();
 
 
@@ -486,33 +495,20 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     connect(themesMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotChangePalette(QAction*)));
 
     // Setup and fill effects and transitions menus.
-    m_videoEffectsMenu = static_cast<QMenu*>(factory()->container("video_effects_menu", this));
-    for (int i = 0; i < videoEffects.count(); ++i)
-        m_videoEffectsMenu->addAction(m_videoEffects[i]);
-    m_audioEffectsMenu = static_cast<QMenu*>(factory()->container("audio_effects_menu", this));
-    for (int i = 0; i < audioEffects.count(); ++i)
-        m_audioEffectsMenu->addAction(m_audioEffects[i]);
-    m_customEffectsMenu = static_cast<QMenu*>(factory()->container("custom_effects_menu", this));
-    if (customEffects.isEmpty())
-        m_customEffectsMenu->setEnabled(false);
-    else
-        m_customEffectsMenu->setEnabled(true);
-    for (int i = 0; i < customEffects.count(); ++i)
-        m_customEffectsMenu->addAction(m_customEffects[i]);
+
+
+    QMenu *m = static_cast<QMenu*>(factory()->container("video_effects_menu", this));
+    m = m_effectsMenu;
+
+
     m_transitionsMenu = new QMenu(i18n("Add Transition"), this);
     for (int i = 0; i < transitions.count(); ++i)
         m_transitionsMenu->addAction(m_transitions[i]);
 
-    connect(m_videoEffectsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddVideoEffect(QAction *)));
-    connect(m_audioEffectsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddAudioEffect(QAction *)));
-    connect(m_customEffectsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddCustomEffect(QAction *)));
+    connect(m_effectsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddVideoEffect(QAction *)));
     connect(m_transitionsMenu, SIGNAL(triggered(QAction *)), this, SLOT(slotAddTransition(QAction *)));
 
-    QMenu *newEffect = new QMenu(this);
-    newEffect->addMenu(m_videoEffectsMenu);
-    newEffect->addMenu(m_audioEffectsMenu);
-    newEffect->addMenu(m_customEffectsMenu);
-    m_effectStack->setMenu(newEffect);
+    m_effectStack->setMenu(m_effectsMenu);
 
     QMenu *viewMenu = static_cast<QMenu*>(factory()->container("dockwindows", this));
     const QList<QAction *> viewActions = createPopupMenu()->actions();
@@ -544,9 +540,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
     m_timelineContextClipMenu->addMenu(markersMenu);
     m_timelineContextClipMenu->addSeparator();
     m_timelineContextClipMenu->addMenu(m_transitionsMenu);
-    m_timelineContextClipMenu->addMenu(m_videoEffectsMenu);
-    m_timelineContextClipMenu->addMenu(m_audioEffectsMenu);
-    m_timelineContextClipMenu->addMenu(m_customEffectsMenu);
+    m_timelineContextClipMenu->addMenu(m_effectsMenu);
 
     m_timelineContextTransitionMenu->addAction(actionCollection()->action("edit_item_duration"));
     m_timelineContextTransitionMenu->addAction(actionCollection()->action("delete_item"));
@@ -618,13 +612,6 @@ MainWindow::~MainWindow()
     Mlt::Factory::close();
 }
 
-void MainWindow::queryQuit()
-{
-    if (queryClose()) {
-        close();
-    }
-}
-
 //virtual
 bool MainWindow::queryClose()
 {
@@ -768,26 +755,8 @@ void MainWindow::readProperties(const KConfigGroup &config)
 
 void MainWindow::slotReloadEffects()
 {
-    m_customEffectsMenu->clear();
     initEffects::parseCustomEffectsFile();
-    QAction *action;
-    QStringList effectInfo;
-    QMap<QString, QStringList> effectsList;
-    for (int ix = 0; ix < customEffects.count(); ix++) {
-        effectInfo = customEffects.effectIdInfo(ix);
-        effectsList.insert(effectInfo.at(0).toLower(), effectInfo);
-    }
-    if (effectsList.isEmpty())
-        m_customEffectsMenu->setEnabled(false);
-    else
-        m_customEffectsMenu->setEnabled(true);
-
-    foreach(const QStringList & value, effectsList) {
-        action = new QAction(value.at(0), this);
-        action->setData(value);
-        m_customEffectsMenu->addAction(action);
-    }
-    m_effectList->reloadEffectList();
+    m_effectList->reloadEffectList(m_effectsMenu, m_effectActions);
 }
 
 #ifndef NO_JOGSHUTTLE
@@ -863,13 +832,14 @@ void MainWindow::slotConnectMonitors()
     connect(m_projectList, SIGNAL(deleteProjectClips(QStringList, QMap<QString, QString>)), this, SLOT(slotDeleteProjectClips(QStringList, QMap<QString, QString>)));
     connect(m_projectList, SIGNAL(showClipProperties(DocClipBase *)), this, SLOT(slotShowClipProperties(DocClipBase *)));
     connect(m_projectList, SIGNAL(showClipProperties(QList <DocClipBase *>, QMap<QString, QString>)), this, SLOT(slotShowClipProperties(QList <DocClipBase *>, QMap<QString, QString>)));
-    connect(m_projectList, SIGNAL(getFileProperties(const QDomElement, const QString &, int, bool)), m_projectMonitor->render, SLOT(getFileProperties(const QDomElement, const QString &, int, bool)));
+    connect(m_projectList, SIGNAL(getFileProperties(const QDomElement, const QString &, int, bool, bool)), m_projectMonitor->render, SLOT(getFileProperties(const QDomElement, const QString &, int, bool, bool)));
     connect(m_projectMonitor->render, SIGNAL(replyGetImage(const QString &, const QPixmap &)), m_projectList, SLOT(slotReplyGetImage(const QString &, const QPixmap &)));
-    connect(m_projectMonitor->render, SIGNAL(replyGetFileProperties(const QString &, Mlt::Producer*, const QMap < QString, QString > &, const QMap < QString, QString > &, bool)), m_projectList, SLOT(slotReplyGetFileProperties(const QString &, Mlt::Producer*, const QMap < QString, QString > &, const QMap < QString, QString > &, bool)));
+    connect(m_projectMonitor->render, SIGNAL(replyGetFileProperties(const QString &, Mlt::Producer*, const QMap < QString, QString > &, const QMap < QString, QString > &, bool, bool)), m_projectList, SLOT(slotReplyGetFileProperties(const QString &, Mlt::Producer*, const QMap < QString, QString > &, const QMap < QString, QString > &, bool, bool)));
 
     connect(m_projectMonitor->render, SIGNAL(removeInvalidClip(const QString &, bool)), m_projectList, SLOT(slotRemoveInvalidClip(const QString &, bool)));
+    connect(m_projectMonitor->render, SIGNAL(removeInvalidProxy(const QString &)), m_projectList, SLOT(slotRemoveInvalidProxy(const QString &)));
 
-    connect(m_clipMonitor, SIGNAL(refreshClipThumbnail(const QString &)), m_projectList, SLOT(slotRefreshClipThumbnail(const QString &)));
+    connect(m_clipMonitor, SIGNAL(refreshClipThumbnail(const QString &, bool)), m_projectList, SLOT(slotRefreshClipThumbnail(const QString &, bool)));
 
     connect(m_clipMonitor, SIGNAL(adjustMonitorSize()), this, SLOT(slotAdjustClipMonitor()));
     connect(m_projectMonitor, SIGNAL(adjustMonitorSize()), this, SLOT(slotAdjustProjectMonitor()));
@@ -1429,6 +1399,7 @@ void MainWindow::setupActions()
     connect(deleteAllClipMarkers, SIGNAL(triggered(bool)), this, SLOT(slotDeleteAllClipMarkers()));
 
     KAction* editClipMarker = new KAction(KIcon("document-properties"), i18n("Edit Marker"), this);
+    editClipMarker->setData(QString("edit_marker"));
     collection.addAction("edit_clip_marker", editClipMarker);
     connect(editClipMarker, SIGNAL(triggered(bool)), this, SLOT(slotEditClipMarker()));
 
@@ -1527,7 +1498,7 @@ void MainWindow::setupActions()
     connect(maxCurrent, SIGNAL(triggered(bool)), this, SLOT(slotMaximizeCurrent(bool)));*/
 
     m_closeAction = KStandardAction::close(this,  SLOT(closeCurrentDocument()),   collection);
-    KStandardAction::quit(this,                   SLOT(queryQuit()),              collection);
+    KStandardAction::quit(this,                   SLOT(close()),              collection);
     KStandardAction::open(this,                   SLOT(openFile()),               collection);
     m_saveAction = KStandardAction::save(this,    SLOT(saveFile()),               collection);
     KStandardAction::saveAs(this,                 SLOT(saveFileAs()),             collection);
@@ -1622,36 +1593,6 @@ void MainWindow::setupActions()
 
     // Setup effects and transitions actions.
     m_effectsActionCollection = new KActionCollection(this, KGlobal::mainComponent());
-    //KActionCategory *videoEffectActions = new KActionCategory(i18n("Video Effects"), m_effectsActionCollection);
-    KActionCategory *videoEffectActions = new KActionCategory(i18n("Video Effects"), collection);
-    m_videoEffects = new KAction*[videoEffects.count()];
-    for (int i = 0; i < videoEffects.count(); ++i) {
-        QStringList effectInfo = videoEffects.effectIdInfo(i);
-        m_videoEffects[i] = new KAction(KIcon("kdenlive-show-video"), effectInfo.at(0), this);
-        m_videoEffects[i]->setData(effectInfo);
-        m_videoEffects[i]->setIconVisibleInMenu(false);
-        videoEffectActions->addAction("video_effect_" + effectInfo.at(0), m_videoEffects[i]);
-    }
-    //KActionCategory *audioEffectActions = new KActionCategory(i18n("Audio Effects"), m_effectsActionCollection);
-    KActionCategory *audioEffectActions = new KActionCategory(i18n("Audio Effects"), collection);
-    m_audioEffects = new KAction*[audioEffects.count()];
-    for (int i = 0; i < audioEffects.count(); ++i) {
-        QStringList effectInfo = audioEffects.effectIdInfo(i);
-        m_audioEffects[i] = new KAction(KIcon("kdenlive-show-audio"), effectInfo.at(0), this);
-        m_audioEffects[i]->setData(effectInfo);
-        m_audioEffects[i]->setIconVisibleInMenu(false);
-        audioEffectActions->addAction("audio_effect_" + effectInfo.at(0), m_audioEffects[i]);
-    }
-    //KActionCategory *customEffectActions = new KActionCategory(i18n("Custom Effects"), m_effectsActionCollection);
-    KActionCategory *customEffectActions = new KActionCategory(i18n("Custom Effects"), collection);
-    m_customEffects = new KAction*[customEffects.count()];
-    for (int i = 0; i < customEffects.count(); ++i) {
-        QStringList effectInfo = customEffects.effectIdInfo(i);
-        m_customEffects[i] = new KAction(KIcon("kdenlive-custom-effect"), effectInfo.at(0), this);
-        m_customEffects[i]->setData(effectInfo);
-        m_customEffects[i]->setIconVisibleInMenu(false);
-        customEffectActions->addAction("custom_effect_" + effectInfo.at(0), m_customEffects[i]);
-    }
     //KActionCategory *transitionActions = new KActionCategory(i18n("Transitions"), m_effectsActionCollection);
     KActionCategory *transitionActions = new KActionCategory(i18n("Transitions"), collection);
     m_transitions = new KAction*[transitions.count()];
@@ -1660,9 +1601,11 @@ void MainWindow::setupActions()
         m_transitions[i] = new KAction(effectInfo.at(0), this);
         m_transitions[i]->setData(effectInfo);
         m_transitions[i]->setIconVisibleInMenu(false);
-        transitionActions->addAction("transition_" + effectInfo.at(0), m_transitions[i]);
+        QString id = effectInfo.at(2);
+        if (id.isEmpty()) id = effectInfo.at(1);
+        transitionActions->addAction("transition_" + id, m_transitions[i]);
     }
-    m_effectsActionCollection->readSettings();
+    //m_effectsActionCollection->readSettings();
 
     //connect(collection, SIGNAL( clearStatusText() ),
     //statusBar(), SLOT( clear() ) );
@@ -1803,8 +1746,17 @@ void MainWindow::newFile(bool showProjectSettings, bool force)
     m_fileRevert->setEnabled(false);
     QString profileName = KdenliveSettings::default_profile();
     KUrl projectFolder = KdenliveSettings::defaultprojectfolder();
+    QMap <QString, QString> documentProperties;
     QPoint projectTracks(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks());
     if (!showProjectSettings) {
+        // set up default properties
+        documentProperties.insert("enableproxy", QString::number((int) KdenliveSettings::enableproxy()));
+        documentProperties.insert("generateproxy", QString::number((int) KdenliveSettings::generateproxy()));
+        documentProperties.insert("proxyminsize", QString::number(KdenliveSettings::proxyminsize()));
+        documentProperties.insert("proxyparams", KdenliveSettings::proxyparams());
+        documentProperties.insert("proxyextension", KdenliveSettings::proxyextension());
+        documentProperties.insert("generateimageproxy", QString::number((int) KdenliveSettings::generateimageproxy()));
+        documentProperties.insert("proxyimageminsize", QString::number(KdenliveSettings::proxyimageminsize()));
         if (!KdenliveSettings::activatetabs())
             if (!closeCurrentDocument())
                 return;
@@ -1822,11 +1774,19 @@ void MainWindow::newFile(bool showProjectSettings, bool force)
         profileName = w->selectedProfile();
         projectFolder = w->selectedFolder();
         projectTracks = w->tracks();
+        documentProperties.insert("enableproxy", QString::number((int) w->useProxy()));
+        documentProperties.insert("generateproxy", QString::number((int) w->generateProxy()));
+        documentProperties.insert("proxyminsize", QString::number(w->proxyMinSize()));
+        documentProperties.insert("proxyparams", w->proxyParams());
+        documentProperties.insert("proxyextension", w->proxyExtension());
+        documentProperties.insert("generateimageproxy", QString::number((int) w->generateImageProxy()));
+        documentProperties.insert("proxyimageminsize", QString::number(w->proxyImageMinSize()));
         delete w;
     }
     m_timelineArea->setEnabled(true);
     m_projectList->setEnabled(true);
-    KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, projectTracks, m_projectMonitor->render, m_notesWidget, this);
+    
+    KdenliveDoc *doc = new KdenliveDoc(KUrl(), projectFolder, m_commandStack, profileName, documentProperties, projectTracks, m_projectMonitor->render, m_notesWidget, this);
     doc->m_autosave = new KAutoSaveFile(KUrl(), doc);
     bool ok;
     TrackView *trackView = new TrackView(doc, &ok, this);
@@ -1912,7 +1872,7 @@ bool MainWindow::saveFileAs(const QString &outputFileName)
     QString currentSceneList;
     m_monitorManager->stopActiveMonitor();
 
-    if (m_activeDocument->saveSceneList(outputFileName, m_projectMonitor->sceneList()) == false)
+    if (m_activeDocument->saveSceneList(outputFileName, m_projectMonitor->sceneList(), m_projectList->expandedFolders()) == false)
         return false;
 
     // Save timeline thumbnails
@@ -2039,7 +1999,7 @@ void MainWindow::doOpenFile(const KUrl &url, KAutoSaveFile *stale)
     progressDialog.progressBar()->setValue(0);
     qApp->processEvents();
 
-    KdenliveDoc *doc = new KdenliveDoc(url, KdenliveSettings::defaultprojectfolder(), m_commandStack, KdenliveSettings::default_profile(), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), m_projectMonitor->render, m_notesWidget, this, &progressDialog);
+    KdenliveDoc *doc = new KdenliveDoc(url, KdenliveSettings::defaultprojectfolder(), m_commandStack, KdenliveSettings::default_profile(), QMap <QString, QString> (), QPoint(KdenliveSettings::videotracks(), KdenliveSettings::audiotracks()), m_projectMonitor->render, m_notesWidget, this, &progressDialog);
 
     progressDialog.progressBar()->setValue(1);
     progressDialog.progressBar()->setMaximum(4);
@@ -2220,6 +2180,39 @@ void MainWindow::slotEditProjectSettings()
         if (KdenliveSettings::videothumbnails() != w->enableVideoThumbs()) slotSwitchVideoThumbs();
         if (KdenliveSettings::audiothumbnails() != w->enableAudioThumbs()) slotSwitchAudioThumbs();
         if (m_activeDocument->profilePath() != profile) slotUpdateProjectProfile(profile);
+        if (m_activeDocument->getDocumentProperty("proxyparams") != w->proxyParams()) {
+            m_activeDocument->setModified();
+            m_activeDocument->setDocumentProperty("proxyparams", w->proxyParams());
+            if (m_activeDocument->clipManager()->clipsCount() > 0 && KMessageBox::questionYesNo(this, i18n("You have changed the proxy parameters. Do you want to recreate all proxy clips for this project?")) == KMessageBox::Yes) {
+                //TODO: rebuild all proxies
+                //m_activeDocument->rebuildAllProxies();
+            }
+        }
+        if (m_activeDocument->getDocumentProperty("proxyextension") != w->proxyExtension()) {
+            m_activeDocument->setModified();
+            m_activeDocument->setDocumentProperty("proxyextension", w->proxyExtension());
+        }
+        if (m_activeDocument->getDocumentProperty("generateproxy") != QString::number((int) w->generateProxy())) {
+            m_activeDocument->setModified();
+            m_activeDocument->setDocumentProperty("generateproxy", QString::number((int) w->generateProxy()));
+        }
+        if (m_activeDocument->getDocumentProperty("proxyminsize") != QString::number(w->proxyMinSize())) {
+            m_activeDocument->setModified();
+            m_activeDocument->setDocumentProperty("proxyminsize", QString::number(w->proxyMinSize()));
+        }
+        if (m_activeDocument->getDocumentProperty("generateimageproxy") != QString::number((int) w->generateImageProxy())) {
+            m_activeDocument->setModified();
+            m_activeDocument->setDocumentProperty("generateimageproxy", QString::number((int) w->generateImageProxy()));
+        }
+        if (m_activeDocument->getDocumentProperty("proxyimageminsize") != QString::number(w->proxyImageMinSize())) {
+            m_activeDocument->setModified();
+            m_activeDocument->setDocumentProperty("proxyimageminsize", QString::number(w->proxyImageMinSize()));
+        }
+        if (QString::number((int) w->useProxy()) != m_activeDocument->getDocumentProperty("enableproxy")) {
+            m_activeDocument->setDocumentProperty("enableproxy", QString::number((int) w->useProxy()));
+            m_activeDocument->setModified();
+            slotUpdateProxySettings();
+        }
     }
     delete w;
 }
@@ -2266,7 +2259,7 @@ void MainWindow::slotRenderProject()
 {
     if (!m_renderWidget) {
         QString projectfolder = m_activeDocument ? m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) : KdenliveSettings::defaultprojectfolder();
-        m_renderWidget = new RenderWidget(projectfolder, this);
+        m_renderWidget = new RenderWidget(projectfolder, m_projectList->useProxy(), this);
         connect(m_renderWidget, SIGNAL(shutdown()), this, SLOT(slotShutdown()));
         connect(m_renderWidget, SIGNAL(selectedRenderProfile(QMap <QString, QString>)), this, SLOT(slotSetDocumentRenderProfile(QMap <QString, QString>)));
         connect(m_renderWidget, SIGNAL(prepareRenderingData(bool, bool, const QString&)), this, SLOT(slotPrepareRendering(bool, bool, const QString&)));
@@ -2404,11 +2397,12 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
             disconnect(m_projectList, SIGNAL(displayMessage(const QString&, int)), this, SLOT(slotGotProgressInfo(const QString&, int)));
             disconnect(m_projectList, SIGNAL(updateRenderStatus()), this, SLOT(slotCheckRenderStatus()));
             disconnect(m_projectList, SIGNAL(clipNeedsReload(const QString&, bool)), m_activeTimeline->projectView(), SLOT(slotUpdateClip(const QString &, bool)));
+            disconnect(m_projectList, SIGNAL(refreshClip(const QString &)), m_activeTimeline->projectView(), SLOT(slotRefreshThumbs(const QString &)));
             m_effectStack->clear();
         }
         //m_activeDocument->setRenderer(NULL);
         disconnect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
-        disconnect(m_projectList, SIGNAL(refreshClip()), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
+        disconnect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
         m_clipMonitor->stop();
     }
     KdenliveSettings::setCurrent_profile(doc->profilePath());
@@ -2418,7 +2412,8 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     m_transitionConfig->updateProjectFormat(doc->mltProfile(), doc->timecode(), doc->tracksList());
     m_effectStack->updateProjectFormat(doc->mltProfile(), doc->timecode());
     connect(m_projectList, SIGNAL(clipSelected(DocClipBase *, QPoint)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *, QPoint)));
-    connect(m_projectList, SIGNAL(refreshClip()), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
+    connect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
+    connect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), trackView->projectView(), SLOT(slotRefreshThumbs(const QString &, bool)));
     connect(m_projectList, SIGNAL(clipNeedsReload(const QString&, bool)), trackView->projectView(), SLOT(slotUpdateClip(const QString &, bool)));
 
     connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
@@ -2572,7 +2567,6 @@ void MainWindow::slotPreferences(int page, int option)
     
     KdenliveSettingsDialog* dialog = new KdenliveSettingsDialog(actions, this);
     connect(dialog, SIGNAL(settingsChanged(const QString&)), this, SLOT(updateConfiguration()));
-    connect(dialog, SIGNAL(updateProxySettings()), this, SLOT(slotUpdateProxySettings()));
     connect(dialog, SIGNAL(doResetProfile()), m_monitorManager, SLOT(slotResetProfiles()));
 #ifndef Q_WS_MAC
     connect(dialog, SIGNAL(updateCaptureFolder()), this, SLOT(slotUpdateCaptureFolder()));
@@ -2972,10 +2966,20 @@ void MainWindow::slotAddTransition(QAction *result)
 void MainWindow::slotAddVideoEffect(QAction *result)
 {
     if (!result) return;
+    const int EFFECT_VIDEO = 1;
+    const int EFFECT_AUDIO = 2;
     QStringList info = result->data().toStringList();
-    if (info.isEmpty()) return;
-    QDomElement effect = videoEffects.getEffectByTag(info.at(1), info.at(2));
-    slotAddEffect(effect);
+
+    if (info.isEmpty() || info.size() < 3) return;
+    QDomElement effect ;
+    if (info.at(2) == QString::number((int) EFFECT_VIDEO))
+            effect = videoEffects.getEffectByTag(info.at(0), info.at(1));
+    else if (info.at(2) == QString::number((int) EFFECT_AUDIO))
+            effect = audioEffects.getEffectByTag(info.at(0), info.at(1));
+    else
+            effect = customEffects.getEffectByTag(info.at(0), info.at(1));
+    if (!effect.isNull()) slotAddEffect(effect);
+    else m_messageLabel->setMessage(i18n("Cannot find effect %1 / %2").arg(info.at(0)).arg(info.at(1)), ErrorMessage);
 }
 
 void MainWindow::slotAddAudioEffect(QAction *result)
@@ -3134,6 +3138,10 @@ void MainWindow::slotShowClipProperties(DocClipBase *clip)
             if (dia_ui->outPoint() != clip->duration().frames(m_activeDocument->fps()) - 1) {
                 // duration changed, we need to update duration
                 newprops.insert("out", QString::number(dia_ui->outPoint()));
+                int currentLength = QString(clip->producerProperty("length")).toInt();
+                if (currentLength <= dia_ui->outPoint())
+                        newprops.insert("length", QString::number(dia_ui->outPoint() + 1));
+                else newprops.insert("length", clip->producerProperty("length"));
             }
             if (!path.isEmpty()) {
                 // we are editing an external file, asked if we want to detach from that file or save the result to that title file.
@@ -3181,9 +3189,17 @@ void MainWindow::slotShowClipProperties(QList <DocClipBase *> cliplist, QMap<QSt
     if (dia.exec() == QDialog::Accepted) {
         QUndoCommand *command = new QUndoCommand();
         command->setText(i18n("Edit clips"));
+        QMap <QString, QString> newImageProps = dia.properties();
+        // Transparency setting applies only for images
+        QMap <QString, QString> newProps = newImageProps;
+        newProps.remove("transparency");
+
         for (int i = 0; i < cliplist.count(); i++) {
             DocClipBase *clip = cliplist.at(i);
-            new EditClipCommand(m_projectList, clip->getId(), clip->properties(), dia.properties(), true, command);
+            if (clip->clipType() == IMAGE)
+                new EditClipCommand(m_projectList, clip->getId(), clip->properties(), newImageProps, true, command);
+            else 
+                new EditClipCommand(m_projectList, clip->getId(), clip->properties(), newProps, true, command);
         }
         m_activeDocument->commandStack()->push(command);
         for (int i = 0; i < cliplist.count(); i++)
@@ -3804,7 +3820,7 @@ void MainWindow::slotPrepareRendering(bool scriptExport, bool zoneOnly, const QS
     } else exportAudio = m_renderWidget->selectedAudioExport();
     
     // Do we want proxy rendering
-    if (KdenliveSettings::enableproxy() && !m_renderWidget->proxyRendering()) {
+    if (m_projectList->useProxy() && !m_renderWidget->proxyRendering()) {
         // replace proxy clips with originals
         QMap <QString, QString> proxies = m_projectList->getProxies();
         QMapIterator<QString, QString> i(proxies);
@@ -3886,9 +3902,9 @@ void MainWindow::slotChangePalette(QAction *action, const QString &themename)
     KdenliveSettings::setColortheme(theme);
     // Make palette for all widgets.
     QPalette plt;
-    if (theme.isEmpty())
+    if (theme.isEmpty()) {
         plt = QApplication::desktop()->palette();
-    else {
+    else {
         KSharedConfigPtr config = KSharedConfig::openConfig(theme);
         plt = KGlobalSettings::createApplicationPalette(config);
     }
@@ -4138,7 +4154,7 @@ void MainWindow::slotDeleteClip(const QString &id)
 
 void MainWindow::slotUpdateProxySettings()
 {
-    if (m_renderWidget) m_renderWidget->updateProxyConfig();
+    if (m_renderWidget) m_renderWidget->updateProxyConfig(m_projectList->useProxy());
     if (KdenliveSettings::enableproxy())
         KStandardDirs::makeDir(m_activeDocument->projectFolder().path(KUrl::AddTrailingSlash) + "proxy/");
     m_projectList->updateProxyConfig();