Cleanup, deprecate projectlist

parent ac469280
......@@ -364,7 +364,7 @@ void Bin::slotAddClip()
{
// Check if we are in a folder
QStringList folderInfo = getFolderInfo();
ClipCreationDialogDialog::createClipsCommand(pCore->projectManager()->current(), folderInfo, this);
ClipCreationDialog::createClipsCommand(pCore->projectManager()->current(), folderInfo, this);
}
void Bin::deleteClip(const QString &id)
......@@ -424,7 +424,7 @@ void Bin::slotDeleteClip()
}
// For some reason, we get duplicates, which is not expected
//ids.removeDuplicates();
pCore->projectManager()->deleteProjectClips(clipIds, foldersIds);
m_doc->clipManager()->deleteProjectItems(clipIds, foldersIds);
}
void Bin::slotReloadClip()
......@@ -505,6 +505,9 @@ void Bin::setDocument(KdenliveDoc* project)
connect(m_discardCurrentClipJobs, SIGNAL(triggered()), m_jobManager, SLOT(slotDiscardClipJobs()));
connect(m_cancelJobs, SIGNAL(triggered()), m_jobManager, SLOT(slotCancelJobs()));
connect(m_jobManager, SIGNAL(updateJobStatus(QString,int,int,QString,QString,QString)), this, SLOT(slotUpdateJobStatus(QString,int,int,QString,QString,QString)));
connect(m_jobManager, SIGNAL(gotFilterJobResults(QString,int,int,stringMap,stringMap)), this, SLOT(gotFilterJobResults(QString,int,int,stringMap,stringMap)));
//connect(m_itemModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), m_itemView
//connect(m_itemModel, SIGNAL(updateCurrentItem()), this, SLOT(autoSelect()));
slotInitView(NULL);
......@@ -516,7 +519,7 @@ void Bin::slotAddUrl(QString url, QString,QString)
QList <QUrl>urls;
urls << QUrl::fromLocalFile(url);
QStringList folderInfo = getFolderInfo();
ClipCreationDialogDialog::createClipsCommand(m_doc, urls, folderInfo, this);
ClipCreationDialog::createClipsCommand(m_doc, urls, folderInfo, this);
}
void Bin::createClip(QDomElement xml)
......@@ -578,6 +581,14 @@ QModelIndex Bin::getIndexForId(const QString &id, bool folderWanted) const
return QModelIndex();
}
void Bin::selectClipById(const QString &id)
{
QModelIndex ix = getIndexForId(id, false);
if (ix.isValid()) {
m_proxyModel->selectionModel()->select(m_proxyModel->mapFromSource(ix), QItemSelectionModel::ClearAndSelect);
}
}
void Bin::doAddFolder(const QString &id, const QString &name, const QString &parentId)
{
ProjectFolder *parentFolder = m_rootFolder->folder(parentId);
......@@ -1273,13 +1284,16 @@ void Bin::slotCreateProjectClip()
QStringList folderInfo = getFolderInfo();
switch (type) {
case Color:
ClipCreationDialogDialog::createColorClip(pCore->projectManager()->current(), folderInfo, this);
ClipCreationDialog::createColorClip(pCore->projectManager()->current(), folderInfo, this);
break;
case SlideShow:
ClipCreationDialogDialog::createSlideshowClip(pCore->projectManager()->current(), folderInfo, this);
ClipCreationDialog::createSlideshowClip(pCore->projectManager()->current(), folderInfo, this);
break;
case Text:
ClipCreationDialogDialog::createTitleClip(pCore->projectManager()->current(), folderInfo, QString(), this);
ClipCreationDialog::createTitleClip(pCore->projectManager()->current(), folderInfo, QString(), this);
break;
case TextTemplate:
ClipCreationDialog::createTitleTemplateClip(pCore->projectManager()->current(), folderInfo, QString(), this);
break;
default:
break;
......@@ -1342,7 +1356,7 @@ void Bin::slotItemDropped(const QList<QUrl>&urls, const QModelIndex &parent)
}
}
//TODO: verify if urls exist, check for folders
ClipCreationDialogDialog::createClipsCommand(pCore->projectManager()->current(), urls, folderInfo, this);
ClipCreationDialog::createClipsCommand(pCore->projectManager()->current(), urls, folderInfo, this);
}
void Bin::slotItemEdited(QModelIndex ix,QModelIndex,QVector<int>)
......@@ -1460,5 +1474,22 @@ void Bin::removeClipCut(const QString&id, int in, int out)
}
}
void Bin::slotStartFilterJob(const ItemInfo &info, const QString&id, QMap <QString, QString> &filterParams, QMap <QString, QString> &consumerParams, QMap <QString, QString> &extraParams)
{
ProjectClip *clip = getBinClip(id);
if (!clip) return;
QMap <QString, QString> producerParams = QMap <QString, QString> ();
producerParams.insert("in", QString::number((int) info.cropStart.frames(m_doc->fps())));
producerParams.insert("out", QString::number((int) (info.cropStart + info.cropDuration).frames(m_doc->fps())));
extraParams.insert("clipStartPos", QString::number((int) info.startPos.frames(m_doc->fps())));
extraParams.insert("clipTrack", QString::number(info.track));
m_jobManager->prepareJobFromTimeline(clip, producerParams, filterParams, consumerParams, extraParams);
}
void Bin::focusBinView() const
{
m_itemView->setFocus();
}
......@@ -372,6 +372,11 @@ public:
/** @brief Create the subclips defined in the parent clip. */
void loadSubClips(const QString&id, const QMap <QString,QString> data);
/** @brief Select a clip in the Bin from its id. */
void selectClipById(const QString &id);
/** @brief Set focus to the Bin view. */
void focusBinView() const;
private slots:
void slotAddClip();
......@@ -398,8 +403,6 @@ private slots:
void slotAddUrl(QString url, QString,QString);
void slotPrepareJobsMenu();
void slotShowJobLog();
/** @brief Add a sub clip */
void slotAddClipCut(const QString&id, int in, int out);
public slots:
void slotThumbnailReady(const QString &id, const QImage &img);
......@@ -422,6 +425,10 @@ public slots:
void slotStartClipJob(bool enable);
void slotEditClipCommand(const QString &id, QMap<QString, QString>oldProps, QMap<QString, QString>newProps);
void slotCancelRunningJob(const QString &id, const QMap<QString, QString> &newProps);
/** @brief Start a filter job requested by a filter applied in timeline */
void slotStartFilterJob(const ItemInfo &info, const QString&id, QMap <QString, QString> &filterParams, QMap <QString, QString> &consumerParams, QMap <QString, QString> &extraParams);
/** @brief Add a sub clip */
void slotAddClipCut(const QString&id, int in, int out);
protected:
void contextMenuEvent(QContextMenuEvent *event);
......@@ -481,6 +488,7 @@ signals:
void itemUpdated(AbstractProjectItem*);
void producerReady(const QString &id);
void storeFolder(QString,QString);
void gotFilterJobResults(QString,int,int,stringMap,stringMap);
};
#endif
......@@ -92,7 +92,8 @@ enum ClipType {
SlideShow = 7,
Virtual = 8,
Playlist = 9,
WebVfx = 10
WebVfx = 10,
TextTemplate = 11,
};
enum ProjectItemType {
......
......@@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "bin/bin.h"
#include "bin/bincommands.h"
#include "ui_colorclip_ui.h"
#include "ui_templateclip_ui.h"
#include "timecodedisplay.h"
#include "doc/doccommands.h"
#include "titler/titlewidget.h"
......@@ -43,8 +44,36 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QPointer>
#include <QMimeDatabase>
// static
QStringList ClipCreationDialog::getExtensions()
{
// Build list of mime types
QStringList mimeTypes = QStringList() << "application/x-kdenlive" << "application/x-kdenlivetitle" << "video/mlt-playlist" << "text/plain";
// Video mimes
mimeTypes << "video/x-flv" << "application/vnd.rn-realmedia" << "video/x-dv" << "video/dv" << "video/x-msvideo" << "video/x-matroska" << "video/mpeg" << "video/ogg" << "video/x-ms-wmv" << "video/mp4" << "video/quicktime" << "video/webm" << "video/3gpp" << "video/mp2t";
// Audio mimes
mimeTypes << "audio/x-flac" << "audio/x-matroska" << "audio/mp4" << "audio/mpeg" << "audio/x-mp3" << "audio/ogg" << "audio/x-wav" << "audio/x-aiff" << "audio/aiff" << "application/ogg" << "application/mxf" << "application/x-shockwave-flash" << "audio/ac3";
// Image mimes
mimeTypes << "image/gif" << "image/jpeg" << "image/png" << "image/x-tga" << "image/x-bmp" << "image/svg+xml" << "image/tiff" << "image/x-xcf" << "image/x-xcf-gimp" << "image/x-vnd.adobe.photoshop" << "image/x-pcx" << "image/x-exr" << "image/x-portable-pixmap";
QMimeDatabase db;
QStringList allExtensions;
foreach(const QString & mimeType, mimeTypes) {
QMimeType mime = db.mimeTypeForName(mimeType);
if (mime.isValid()) {
allExtensions.append(mime.globPatterns());
}
}
allExtensions.removeDuplicates();
return allExtensions;
}
//static
void ClipCreationDialogDialog::createColorClip(KdenliveDoc *doc, QStringList groupInfo, Bin *bin)
void ClipCreationDialog::createColorClip(KdenliveDoc *doc, QStringList groupInfo, Bin *bin)
{
QPointer<QDialog> dia = new QDialog(bin);
Ui::ColorClip_UI dia_ui;
......@@ -86,7 +115,7 @@ void ClipCreationDialogDialog::createColorClip(KdenliveDoc *doc, QStringList gro
}
//static
void ClipCreationDialogDialog::createSlideshowClip(KdenliveDoc *doc, QStringList groupInfo, Bin *bin)
void ClipCreationDialog::createSlideshowClip(KdenliveDoc *doc, QStringList groupInfo, Bin *bin)
{
QPointer<SlideshowClip> dia = new SlideshowClip(doc->timecode(), bin);
......@@ -120,7 +149,7 @@ void ClipCreationDialogDialog::createSlideshowClip(KdenliveDoc *doc, QStringList
delete dia;
}
void ClipCreationDialogDialog::createTitleClip(KdenliveDoc *doc, QStringList groupInfo, QString templatePath, Bin *bin)
void ClipCreationDialog::createTitleClip(KdenliveDoc *doc, QStringList groupInfo, QString templatePath, Bin *bin)
{
// Make sure the titles folder exists
QDir dir(doc->projectFolder().path());
......@@ -153,7 +182,74 @@ void ClipCreationDialogDialog::createTitleClip(KdenliveDoc *doc, QStringList gro
delete dia_ui;
}
void ClipCreationDialogDialog::addXmlProperties(QDomElement &producer, QMap <QString, QString> &properties)
void ClipCreationDialog::createTitleTemplateClip(KdenliveDoc *doc, QStringList groupInfo, QString templatePath, Bin *bin)
{
// Get the list of existing templates
QStringList filter;
filter << "*.kdenlivetitle";
const QString path = doc->projectFolder().path() + QDir::separator() + "titles/";
QStringList templateFiles = QDir(path).entryList(filter, QDir::Files);
QPointer<QDialog> dia = new QDialog(QApplication::activeWindow());
Ui::TemplateClip_UI dia_ui;
dia_ui.setupUi(dia);
for (int i = 0; i < templateFiles.size(); ++i)
dia_ui.template_list->comboBox()->addItem(templateFiles.at(i), path + templateFiles.at(i));
if (!templateFiles.isEmpty())
dia_ui.buttonBox->button(QDialogButtonBox::Ok)->setFocus();
QStringList mimeTypeFilters;
mimeTypeFilters <<"application/x-kdenlivetitle";
dia_ui.template_list->setFilter(mimeTypeFilters.join(' '));
//warning: setting base directory doesn't work??
dia_ui.template_list->setUrl(QUrl::fromLocalFile(path));
dia_ui.text_box->setHidden(true);
if (dia->exec() == QDialog::Accepted) {
QString textTemplate = dia_ui.template_list->comboBox()->itemData(dia_ui.template_list->comboBox()->currentIndex()).toString();
if (textTemplate.isEmpty()) textTemplate = dia_ui.template_list->comboBox()->currentText();
// Create a cloned template clip
QDomDocument xml;
QDomElement prod = xml.createElement("producer");
xml.appendChild(prod);
QMap <QString, QString> properties;
properties.insert("resource", textTemplate);
properties.insert("kdenlive:clipname", i18n("Template title clip"));
if (!groupInfo.isEmpty()) {
properties.insert("kdenlive:folderid", groupInfo.at(0));
}
addXmlProperties(prod, properties);
uint id = bin->getFreeClipId();
prod.setAttribute("id", QString::number(id));
prod.setAttribute("type", (int) Text);
prod.setAttribute("transparency", "1");
prod.setAttribute("in", "0");
int duration = 0;
QDomDocument titledoc;
QFile txtfile(textTemplate);
if (txtfile.open(QIODevice::ReadOnly) && titledoc.setContent(&txtfile)) {
if (titledoc.documentElement().hasAttribute("duration")) {
duration = titledoc.documentElement().attribute("duration").toInt();
} else {
// keep some time for backwards compatibility - 26/12/12
duration = titledoc.documentElement().attribute("out").toInt();
}
}
txtfile.close();
if (duration == 0) duration = doc->getFramePos(KdenliveSettings::title_duration());
prod.setAttribute("duration", duration - 1);
prod.setAttribute("out", duration - 1);
AddClipCommand *command = new AddClipCommand(doc, xml.documentElement(), QString::number(id), true);
doc->commandStack()->push(command);
}
delete dia;
}
void ClipCreationDialog::addXmlProperties(QDomElement &producer, QMap <QString, QString> &properties)
{
QMapIterator<QString, QString> i(properties);
while (i.hasNext()) {
......@@ -166,7 +262,7 @@ void ClipCreationDialogDialog::addXmlProperties(QDomElement &producer, QMap <QSt
}
}
void ClipCreationDialogDialog::createClipsCommand(KdenliveDoc *doc, const QList<QUrl> &urls, QStringList groupInfo, Bin *bin)
void ClipCreationDialog::createClipsCommand(KdenliveDoc *doc, const QList<QUrl> &urls, QStringList groupInfo, Bin *bin)
{
QUndoCommand *addClips = new QUndoCommand();
......@@ -311,11 +407,12 @@ void ClipCreationDialogDialog::createClipsCommand(KdenliveDoc *doc, const QList<
}
}
void ClipCreationDialogDialog::createClipsCommand(KdenliveDoc *doc, QStringList groupInfo, Bin *bin)
void ClipCreationDialog::createClipsCommand(KdenliveDoc *doc, QStringList groupInfo, Bin *bin)
{
QList <QUrl> list;
QString allExtensions = "*"; //getExtensions().join(" ");
const QString dialogFilter = i18n("All Supported Files") + "(" + allExtensions + ");;" + i18n("All Files") + "(*)";
QString allExtensions = getExtensions().join(" ");
QStringList dialogFilter; //i18n("All Supported Files") + "(" + allExtensions + ");;" + i18n("All Files") + "(*)";
dialogFilter << allExtensions << "application/octet-stream";
QCheckBox *b = new QCheckBox(i18n("Import image sequence"));
b->setChecked(KdenliveSettings::autoimagesequence());
QCheckBox *c = new QCheckBox(i18n("Transparent background for images"));
......@@ -331,10 +428,11 @@ void ClipCreationDialogDialog::createClipsCommand(KdenliveDoc *doc, QStringList
if (clipFolder.isEmpty()) {
clipFolder = QDir::homePath();
}
QPointer<QFileDialog> d = new QFileDialog(QApplication::activeWindow(), i18n("Open Clips"), clipFolder, dialogFilter);
QPointer<QFileDialog> d = new QFileDialog(QApplication::activeWindow(), i18n("Open Clips"), clipFolder);
//TODO: KF5, how to add a custom widget to file dialog
/*QGridLayout *layout = (QGridLayout*)d->layout();
layout->addWidget(f, 0, 0);*/
d->setMimeTypeFilters(dialogFilter);
d->setFileMode(QFileDialog::ExistingFiles);
if (d->exec() == QDialog::Accepted) {
KdenliveSettings::setAutoimagetransparency(c->isChecked());
......@@ -388,7 +486,7 @@ void ClipCreationDialogDialog::createClipsCommand(KdenliveDoc *doc, QStringList
}
delete d;
if (!list.isEmpty()) {
ClipCreationDialogDialog::createClipsCommand(doc, list, groupInfo, bin);
ClipCreationDialog::createClipsCommand(doc, list, groupInfo, bin);
}
}
......
......@@ -30,18 +30,20 @@ class KdenliveDoc;
class Bin;
/**
* @class ClipCreationDialogDialog
* @class ClipCreationDialog
* @brief This class contains a list of static methods displaying widgets
* allowing creation of all clip types.
*/
class ClipCreationDialogDialog
class ClipCreationDialog
{
public:
static QStringList getExtensions();
static void createColorClip(KdenliveDoc *doc, QStringList groupInfo, Bin *bin);
static void createSlideshowClip(KdenliveDoc *doc, QStringList groupInfo, Bin *bin);
static void createTitleClip(KdenliveDoc *doc, QStringList groupInfo, QString templatePath, Bin *bin);
static void createTitleTemplateClip(KdenliveDoc *doc, QStringList groupInfo, QString templatePath, Bin *bin);
static void createClipsCommand(KdenliveDoc *doc, const QList<QUrl> &urls, QStringList groupInfo, Bin *bin);
static void createClipsCommand(KdenliveDoc *doc, QStringList groupInfo, Bin *bin);
static void addXmlProperties(QDomElement &producer, QMap <QString, QString> &properties);
......
......@@ -274,7 +274,8 @@ KdenliveDoc::KdenliveDoc(const QUrl &url, const QUrl &projectFolder, QUndoGroup
for (int i = 0; i < folders.count(); ++i) {
e = folders.item(i).cloneNode().toElement();
if (e.hasAttribute("opened")) expandedFolders.append(e.attribute("id"));
m_clipManager->addFolder(e.attribute("id"), e.attribute("name"));
//Deprecated
//m_clipManager->addFolder(e.attribute("id"), e.attribute("name"));
}
m_documentProperties["expandedfolders"] = expandedFolders.join(";");
......@@ -613,6 +614,12 @@ QDomElement KdenliveDoc::guidesXml() const
return m_guidesXml.documentElement();
}
bool KdenliveDoc::useProxy() const
{
return m_documentProperties.value("enableproxy").toInt();
}
void KdenliveDoc::slotAutoSave()
{
if (m_render && m_autosave) {
......@@ -621,7 +628,7 @@ void KdenliveDoc::slotAutoSave()
//qDebug() << "ERROR; CANNOT CREATE AUTOSAVE FILE";
}
//qDebug() << "// AUTOSAVE FILE: " << m_autosave->fileName();
saveSceneList(m_autosave->fileName(), m_render->sceneList(), QStringList(), true);
saveSceneList(m_autosave->fileName(), m_render->sceneList(), true);
}
}
......@@ -647,7 +654,7 @@ QPoint KdenliveDoc::zone() const
return QPoint(m_documentProperties.value("zonein").toInt(), m_documentProperties.value("zoneout").toInt());
}
QDomDocument KdenliveDoc::xmlSceneList(const QString &scene, const QStringList &expandedFolders)
QDomDocument KdenliveDoc::xmlSceneList(const QString &scene)
{
QDomDocument sceneList;
sceneList.setContent(scene, true);
......@@ -760,7 +767,6 @@ QDomDocument KdenliveDoc::xmlSceneList(const QString &scene, const QStringList &
QDomElement folder = sceneList.createElement("folder");
folder.setAttribute("id", f.key());
folder.setAttribute("name", f.value());
if (expandedFolders.contains(f.key())) folder.setAttribute("opened", "1");
addedXml.appendChild(folder);
}
......@@ -794,9 +800,9 @@ QDomDocument KdenliveDoc::xmlSceneList(const QString &scene, const QStringList &
return sceneList;
}
bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene, const QStringList &expandedFolders, bool autosave)
bool KdenliveDoc::saveSceneList(const QString &path, const QString &scene, bool autosave)
{
QDomDocument sceneList = xmlSceneList(scene, expandedFolders);
QDomDocument sceneList = xmlSceneList(scene);
if (sceneList.isNull()) {
//Make sure we don't save if scenelist is corrupted
KMessageBox::error(QApplication::activeWindow(), i18n("Cannot write to file %1, scene list is corrupted.", path));
......
......@@ -118,9 +118,9 @@ public:
double dar() const;
double projectDuration() const;
/** @brief Returns the project file xml. */
QDomDocument xmlSceneList(const QString &scene, const QStringList &expandedFolders);
QDomDocument xmlSceneList(const QString &scene);
/** @brief Saves the project file xml to a file. */
bool saveSceneList(const QString &path, const QString &scene, const QStringList &expandedFolders, bool autosave = false);
bool saveSceneList(const QString &path, const QString &scene, bool autosave = false);
int tracksCount() const;
TrackInfo trackInfoAt(int ix) const;
void insertTrack(int ix, const TrackInfo &type);
......@@ -180,6 +180,8 @@ public:
/** @brief Add url to the file watcher so that we monitor changes */
void watchFile(const QUrl &url);
bool useProxy() const;
private:
QUrl m_url;
QDomDocument m_document;
......
......@@ -21,7 +21,7 @@
#include "collapsibleeffect.h"
#include "effectslist/effectslist.h"
#include "kdenlivesettings.h"
#include "project/projectlist.h"
#include "dialogs/clipcreationdialog.h"
#include <QInputDialog>
#include <QDialog>
......@@ -157,7 +157,7 @@ void CollapsibleEffect::slotCreateGroup()
void CollapsibleEffect::slotCreateRegion()
{
QString allExtensions = ProjectList::getExtensions().join(" ");
QString allExtensions = ClipCreationDialog::getExtensions().join(" ");
const QString dialogFilter = allExtensions + ' ' + QLatin1Char('|') + i18n("All Supported Files") + "\n* " + QLatin1Char('|') + i18n("All Files");
QString clipFolder = KRecentDirs::dir(":KdenliveClipFolder");
if (clipFolder.isEmpty()) clipFolder = QDir::homePath();
......
......@@ -128,8 +128,8 @@ void EffectStackView2::slotClipItemSelected(ClipItem* c)
// If monitor scene is displayed, hide it
if (m_monitorSceneWanted) {
m_effectMetaInfo.monitor->slotShowEffectScene(false);
m_monitorSceneWanted = false;
}
m_monitorSceneWanted = false;
clear();
return;
}
......
......@@ -35,7 +35,7 @@
#include "mainwindow.h"
#include "colortools.h"
#include "dialogs/profilesdialog.h"
#include "project/projectlist.h"
#include "dialogs/clipcreationdialog.h"
#include "timeline/customtrackview.h"
#include "onmonitoritems/rotoscoping/rotowidget.h"
......@@ -417,7 +417,7 @@ ParameterContainer::ParameterContainer(const QDomElement &effect, const ItemInfo
cval->setupUi(toFillin);
cval->label->setText(paramName);
cval->setToolTip(comment);
cval->urlwidget->setFilter(ProjectList::getExtensions().join(' '));
cval->urlwidget->setFilter(ClipCreationDialog::getExtensions().join(' '));
m_valueItems[paramName] = cval;
cval->urlwidget->setUrl(QUrl(value));
connect(cval->urlwidget, SIGNAL(returnPressed()) , this, SLOT(slotCollectAllParameters()));
......
This diff is collapsed.
......@@ -47,7 +47,6 @@
#include "stopmotion/stopmotion.h"
class KdenliveDoc;
class ProjectList;
class EffectsListView;
class EffectStackView;
class EffectStackView2;
......@@ -104,7 +103,6 @@ public:
// TODO make private again
QTabWidget* m_timelineArea;
ProjectList *m_projectList;
StopmotionWidget *m_stopmotion;
QUndoGroup *m_commandStack;
KActionCollection *m_tracksActionCollection;
......@@ -421,9 +419,6 @@ private slots:
/** @brief Update the capture folder if user asked a change. */
void slotUpdateCaptureFolder();
/** @brief Delete a clip from current project */
void slotDeleteClip(const QString &id);
/** @brief The monitor informs that it needs (or not) to have frames sent by the renderer. */
void slotMonitorRequestRenderFrame(bool request);
/** @brief Open the stopmotion dialog. */
......
......@@ -7,14 +7,14 @@ set(kdenlive_SRCS
# project/clippropertiesmanager.cpp
project/clipstabilize.cpp
project/cliptranscode.cpp
project/folderprojectitem.cpp
# project/folderprojectitem.cpp
project/invaliddialog.cpp
project/projectcommands.cpp
project/projectmanager.cpp
project/projectitem.cpp
project/projectlist.cpp
project/projectlistview.cpp
project/subprojectitem.cpp
# project/projectitem.cpp
# project/projectlist.cpp
# project/projectlistview.cpp
# project/subprojectitem.cpp
project/transitionsettings.cpp
project/notesplugin.cpp
PARENT_SCOPE)
......@@ -25,6 +25,8 @@
#include "doc/kthumb.h"
#include "doc/doccommands.h"
#include "doc/kdenlivedoc.h"
#include "project/projectmanager.h"
#include "timeline/trackview.h"
#include "timeline/abstractclipitem.h"
#include "timeline/abstractgroupitem.h"
#include "titler/titledocument.h"
......@@ -394,6 +396,25 @@ QMap <QString, QString> ClipManager::documentFolderList() const
return m_folderList;
}
void ClipManager::deleteProjectItems(QStringList clipIds, QStringList folderIds)
{
// Create meta command
QUndoCommand *deleteCommand = new QUndoCommand();
deleteCommand->setText(i18n("Delete clips"));
if (pCore->projectManager()->currentTrackView()) {
// Remove clips from timeline
if (!clipIds.isEmpty()) {
for (int i = 0; i < clipIds.size(); ++i) {
pCore->projectManager()->currentTrackView()->slotDeleteClip(clipIds.at(i), deleteCommand);
}
}
// remove clips and folders from bin
slotDeleteClips(clipIds, folderIds, deleteCommand);
m_doc->setModified(true);
}
}
void ClipManager::deleteProjectClip(const QString &clipId)
{
pCore->bin()->deleteClip(clipId);
......@@ -401,14 +422,10 @@ void ClipManager::deleteProjectClip(const QString &clipId)
void ClipManager::slotDeleteClips(QStringList clipIds, QStringList folderIds, QUndoCommand *deleteCommand)
{
/*QUndoCommand *delClips = new QUndoCommand();
delClips->setText(i18np("Delete clip", "Delete clips", ids.size()));*/
for (int i = 0; i < clipIds.size(); ++i) {
QString xml = pCore->binController()->xmlFromId(clipIds.at(i));
QDomDocument doc;
doc.setContent(xml);
//DocClipBase *clip = getClipById(ids.at(i));
if (!xml.isNull()) {
new AddClipCommand(m_doc, doc.documentElement(), clipIds.at(i), false, deleteCommand);
}
......@@ -543,15 +560,6 @@ QString ClipManager::projectFolder() const
return m_doc->projectFolder().path();
}
void ClipManager::addFolder(const QString &id, const QString &name)
{
m_folderList.insert(id, name);
}
void ClipManager::deleteFolder(const QString &id)
{
m_folderList.remove(id);
}
AbstractGroupItem *ClipManager::createGroup()
{
......