X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmainwindow.cpp;h=a6019f7feb55850242fcf0b28769ecfefdcda1e0;hb=5273a3b061a94e37ec3289211f67006731c93cab;hp=005ed0e61a625f444038803c6a7f692c11c5d21d;hpb=7d1f818376b25f793ad6e8960b73a24a39605945;p=kdenlive diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 005ed0e6..a6019f7f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -412,7 +412,7 @@ bool MainWindow::queryClose() if (m_renderWidget) { int waitingJobs = m_renderWidget->waitingJobsCount(); if (waitingJobs > 0) { - switch (KMessageBox::warningYesNoCancel(this, i18n("You have %1 rendering jobs waiting in the queue.\nWhat do you want to do with these jobs?", waitingJobs), QString(), KGuiItem(i18n("Start them now")), KGuiItem(i18n("Delete them")))) { + switch (KMessageBox::warningYesNoCancel(this, i18np("You have 1 rendering job waiting in the queue.\nWhat do you want to do with this job?", "You have %1 rendering jobs waiting in the queue.\nWhat do you want to do with these jobs?", waitingJobs), QString(), KGuiItem(i18n("Start them now")), KGuiItem(i18n("Delete them")))) { case KMessageBox::Yes : // create script with waiting jobs and start it if (m_renderWidget->startWaitingRenderJobs() == false) return false; @@ -853,6 +853,10 @@ void MainWindow::setupActions() projectRender->setShortcut(Qt::CTRL + Qt::Key_Return); connect(projectRender, SIGNAL(triggered(bool)), this, SLOT(slotRenderProject())); + KAction* projectClean = new KAction(KIcon("edit-clear"), i18n("Clean Project"), this); + collection->addAction("project_clean", projectClean); + connect(projectClean, SIGNAL(triggered(bool)), this, SLOT(slotCleanProject())); + KAction* monitorPlay = new KAction(KIcon("media-playback-start"), i18n("Play"), this); KShortcut playShortcut; playShortcut.setPrimary(Qt::Key_Space); @@ -1255,7 +1259,7 @@ void MainWindow::newFile(bool showProjectSettings) profileName = KdenliveSettings::default_profile(); projectFolder = KdenliveSettings::defaultprojectfolder(); } else { - ProjectSettings *w = new ProjectSettings(projectTracks.x(), projectTracks.y(), KdenliveSettings::defaultprojectfolder(), false, this); + ProjectSettings *w = new ProjectSettings(projectTracks.x(), projectTracks.y(), KdenliveSettings::defaultprojectfolder(), false, true, this); if (w->exec() != QDialog::Accepted) return; if (!KdenliveSettings::activatetabs()) closeCurrentDocument(); KdenliveSettings::setVideothumbnails(w->enableVideoThumbs()); @@ -1613,7 +1617,7 @@ void MainWindow::slotDetectAudioDriver() void MainWindow::slotEditProjectSettings() { QPoint p = m_activeDocument->getTracksCount(); - ProjectSettings *w = new ProjectSettings(p.x(), p.y(), m_activeDocument->projectFolder().path(), true, this); + ProjectSettings *w = new ProjectSettings(p.x(), p.y(), m_activeDocument->projectFolder().path(), true, !m_activeDocument->isModified(), this); if (w->exec() == QDialog::Accepted) { QString profile = w->selectedProfile(); @@ -1642,7 +1646,8 @@ void MainWindow::slotEditProjectSettings() //m_activeDocument->clipManager()->resetProducersList(m_projectMonitor->render->producersList()); if (dar != m_activeDocument->dar()) m_projectList->reloadClipThumbnails(); if (updateFps) m_activeTimeline->updateProjectFps(); - + m_activeDocument->setModified(true); + m_commandStack->activeStack()->clear(); // We need to desactivate & reactivate monitors to get a refresh //m_monitorManager->switchMonitors(); } @@ -1683,6 +1688,12 @@ void MainWindow::setRenderingFinished(const QString &url, int status, const QStr if (m_renderWidget) m_renderWidget->setRenderStatus(url, status, error); } +void MainWindow::slotCleanProject() +{ + if (KMessageBox::warningContinueCancel(this, i18n("This will remove all unused clips from your project."), i18n("Clean up project")) == KMessageBox::Cancel) return; + m_projectList->cleanup(); +} + void MainWindow::slotUpdateMousePosition(int pos) { if (m_activeDocument) @@ -1762,6 +1773,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //cha disconnect(m_activeTimeline->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor())); disconnect(m_activeTimeline, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int))); disconnect(m_projectList, SIGNAL(loadingIsOver()), m_activeTimeline->projectView(), SLOT(slotUpdateAllThumbs())); + disconnect(m_projectList, SIGNAL(displayMessage(const QString&, MessageType)), m_messageLabel, SLOT(setMessage(const QString&, MessageType))); m_effectStack->clear(); } //m_activeDocument->setRenderer(NULL); @@ -1827,7 +1839,9 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //cha connect(trackView->projectView(), SIGNAL(activateDocumentMonitor()), m_projectMonitor, SLOT(activateMonitor())); connect(trackView, SIGNAL(zoneMoved(int, int)), this, SLOT(slotZoneMoved(int, int))); connect(m_projectList, SIGNAL(loadingIsOver()), trackView->projectView(), SLOT(slotUpdateAllThumbs())); + connect(m_projectList, SIGNAL(displayMessage(const QString&, MessageType)), m_messageLabel, SLOT(setMessage(const QString&, MessageType))); + trackView->projectView()->setContextMenu(m_timelineContextMenu, m_timelineContextClipMenu, m_timelineContextTransitionMenu, m_clipTypeGroup); m_activeTimeline = trackView; if (m_renderWidget) {