]> git.sesse.net Git - kdenlive/blob - src/projectlist.cpp
5bd6d499f2de5e7c0e56bc07a29666d9517c19d6
[kdenlive] / src / projectlist.cpp
1 /***************************************************************************
2  *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
4  *   This program is free software; you can redistribute it and/or modify  *
5  *   it under the terms of the GNU General Public License as published by  *
6  *   the Free Software Foundation; either version 2 of the License, or     *
7  *   (at your option) any later version.                                   *
8  *                                                                         *
9  *   This program is distributed in the hope that it will be useful,       *
10  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
11  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
12  *   GNU General Public License for more details.                          *
13  *                                                                         *
14  *   You should have received a copy of the GNU General Public License     *
15  *   along with this program; if not, write to the                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20
21 #include <QMouseEvent>
22 #include <QStylePainter>
23 #include <QPixmap>
24 #include <QIcon>
25 #include <QDialog>
26 #include <QtGui>
27
28 #include <KDebug>
29 #include <KAction>
30 #include <KLocale>
31 #include <KFileDialog>
32 #include <KInputDialog>
33 #include <KMessageBox>
34
35 #include <nepomuk/global.h>
36 #include <nepomuk/resource.h>
37 #include <nepomuk/tag.h>
38
39 #include "projectlist.h"
40 #include "projectitem.h"
41 #include "kdenlivesettings.h"
42 #include "slideshowclip.h"
43 #include "ui_colorclip_ui.h"
44 #include "titlewidget.h"
45
46
47 #include "definitions.h"
48 #include "clipmanager.h"
49 #include "docclipbase.h"
50 #include "kdenlivedoc.h"
51 #include "renderer.h"
52 #include "kthumb.h"
53 #include "projectlistview.h"
54
55 ProjectList::ProjectList(QWidget *parent)
56         : QWidget(parent), m_render(NULL), m_fps(-1), m_commandStack(NULL), m_selectedItem(NULL) {
57
58     QWidget *vbox = new QWidget;
59     listView = new ProjectListView(this);;
60     QVBoxLayout *layout = new QVBoxLayout;
61     m_clipIdCounter = 0;
62
63     // setup toolbar
64     searchView = new KTreeWidgetSearchLine(this);
65     m_toolbar = new QToolBar("projectToolBar", this);
66     m_toolbar->addWidget(searchView);
67
68     QToolButton *addButton = new QToolButton(m_toolbar);
69     QMenu *addMenu = new QMenu(this);
70     addButton->setMenu(addMenu);
71     addButton->setPopupMode(QToolButton::MenuButtonPopup);
72     m_toolbar->addWidget(addButton);
73
74     QAction *addClipButton = addMenu->addAction(KIcon("kdenlive-add-clip"), i18n("Add Clip"));
75     connect(addClipButton, SIGNAL(triggered()), this, SLOT(slotAddClip()));
76
77     QAction *addColorClip = addMenu->addAction(KIcon("kdenlive-add-color-clip"), i18n("Add Color Clip"));
78     connect(addColorClip, SIGNAL(triggered()), this, SLOT(slotAddColorClip()));
79
80     QAction *addSlideClip = addMenu->addAction(KIcon("kdenlive-add-slide-clip"), i18n("Add Slideshow Clip"));
81     connect(addSlideClip, SIGNAL(triggered()), this, SLOT(slotAddSlideshowClip()));
82
83     QAction *addTitleClip = addMenu->addAction(KIcon("kdenlive-add-text-clip"), i18n("Add Title Clip"));
84     connect(addTitleClip, SIGNAL(triggered()), this, SLOT(slotAddTitleClip()));
85
86     m_deleteAction = m_toolbar->addAction(KIcon("edit-delete"), i18n("Delete Clip"));
87     connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(slotRemoveClip()));
88
89     m_editAction = m_toolbar->addAction(KIcon("document-properties"), i18n("Edit Clip"));
90     connect(m_editAction, SIGNAL(triggered()), this, SLOT(slotEditClip()));
91
92     QAction *addFolderButton = addMenu->addAction(KIcon("folder-new"), i18n("Create Folder"));
93     connect(addFolderButton, SIGNAL(triggered()), this, SLOT(slotAddFolder()));
94
95     addButton->setDefaultAction(addClipButton);
96
97     layout->addWidget(m_toolbar);
98     layout->addWidget(listView);
99     setLayout(layout);
100     //m_toolbar->setEnabled(false);
101
102     searchView->setTreeWidget(listView);
103
104     m_menu = new QMenu();
105     m_menu->addAction(addClipButton);
106     m_menu->addAction(addColorClip);
107     m_menu->addAction(addSlideClip);
108     m_menu->addAction(addTitleClip);
109     m_menu->addAction(m_editAction);
110     m_menu->addAction(m_deleteAction);
111     m_menu->addAction(addFolderButton);
112     m_menu->insertSeparator(m_deleteAction);
113
114     connect(listView, SIGNAL(itemSelectionChanged()), this, SLOT(slotClipSelected()));
115     connect(listView, SIGNAL(focusMonitor()), this, SLOT(slotClipSelected()));
116     connect(listView, SIGNAL(requestMenu(const QPoint &, QTreeWidgetItem *)), this, SLOT(slotContextMenu(const QPoint &, QTreeWidgetItem *)));
117     connect(listView, SIGNAL(addClip()), this, SLOT(slotAddClip()));
118     connect(listView, SIGNAL(addClip(QUrl, const QString &)), this, SLOT(slotAddClip(QUrl, const QString &)));
119     connect(listView, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotItemEdited(QTreeWidgetItem *, int)));
120     connect(listView, SIGNAL(showProperties(DocClipBase *)), this, SIGNAL(showClipProperties(DocClipBase *)));
121
122     m_listViewDelegate = new ItemDelegate(listView);
123     listView->setItemDelegate(m_listViewDelegate);
124 }
125
126 ProjectList::~ProjectList() {
127     delete m_menu;
128     delete m_toolbar;
129 }
130
131 void ProjectList::slotEditClip() {
132     ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
133     if (item && !item->isGroup()) {
134         emit clipSelected(item->referencedClip());
135         emit showClipProperties(item->referencedClip());
136     }
137 }
138
139
140
141 void ProjectList::setRenderer(Render *projectRender) {
142     m_render = projectRender;
143 }
144
145 void ProjectList::slotClipSelected() {
146     if (listView->currentItem()) {
147         ProjectItem *clip = static_cast <ProjectItem*>(listView->currentItem());
148         if (!clip->isGroup()) {
149             m_selectedItem = clip;
150             emit clipSelected(clip->referencedClip());
151         }
152         m_editAction->setEnabled(true);
153         m_deleteAction->setEnabled(true);
154     } else {
155         m_editAction->setEnabled(false);
156         m_deleteAction->setEnabled(false);
157     }
158 }
159
160 void ProjectList::slotUpdateClipProperties(const QString &id, QMap <QString, QString> properties) {
161     ProjectItem *item = getItemById(id);
162     if (item) {
163         slotUpdateClipProperties(item, properties);
164         if (properties.contains("colour") || properties.contains("resource") || properties.contains("xmldata")) slotRefreshClipThumbnail(item);
165         if (properties.contains("out")) item->changeDuration(properties.value("out").toInt());
166     }
167 }
168
169 void ProjectList::slotUpdateClipProperties(ProjectItem *clip, QMap <QString, QString> properties) {
170     if (!clip) return;
171     if (!clip->isGroup()) clip->setProperties(properties);
172     if (properties.contains("description")) {
173         CLIPTYPE type = clip->clipType();
174         clip->setText(2, properties.value("description"));
175         if (KdenliveSettings::activate_nepomuk() && (type == AUDIO || type == VIDEO || type == AV || type == IMAGE || type == PLAYLIST)) {
176             // Use Nepomuk system to store clip description
177             Nepomuk::Resource f(clip->clipUrl().path());
178             if (f.isValid()) {
179                 f.setDescription(properties.value("description"));
180             } else {
181                 KMessageBox::sorry(this, i18n("Cannot access Desktop Search info for %1.\nDisabling Desktop Search integration.", clip->clipUrl().path()));
182                 KdenliveSettings::setActivate_nepomuk(false);
183             }
184         }
185         emit projectModified();
186     }
187 }
188
189 void ProjectList::slotItemEdited(QTreeWidgetItem *item, int column) {
190     ProjectItem *clip = static_cast <ProjectItem*>(item);
191     if (column == 2) {
192         QMap <QString, QString> props;
193         props["description"] = item->text(2);
194         slotUpdateClipProperties(clip, props);
195     } else if (column == 1 && clip->isGroup()) {
196         m_doc->slotEditFolder(item->text(1), clip->groupName(), clip->clipId());
197         const int children = item->childCount();
198         for (int i = 0; i < children; i++) {
199             ProjectItem *child = static_cast <ProjectItem *>(item->child(i));
200             child->setProperty("groupname", item->text(1));
201         }
202     }
203 }
204
205 void ProjectList::slotContextMenu(const QPoint &pos, QTreeWidgetItem *item) {
206     bool enable = false;
207     if (item) {
208         enable = true;
209     }
210     m_editAction->setEnabled(enable);
211     m_deleteAction->setEnabled(enable);
212     m_menu->popup(pos);
213 }
214
215 void ProjectList::slotRemoveClip() {
216     if (!listView->currentItem()) return;
217     QList <QString> ids;
218     QMap <QString, QString> folderids;
219     QList<QTreeWidgetItem *> selected = listView->selectedItems();
220     ProjectItem *item;
221     for (int i = 0; i < selected.count(); i++) {
222         item = static_cast <ProjectItem *>(selected.at(i));
223         if (item->isGroup()) folderids[item->groupName()] = item->clipId();
224         else ids << item->clipId();
225         if (item->numReferences() > 0) {
226             if (KMessageBox::questionYesNo(this, i18np("Delete clip <b>%2</b> ?<br>This will also remove the clip in timeline", "Delete clip <b>%2</b> ?<br>This will also remove its %1 clips in timeline", item->numReferences(), item->names().at(1)), i18n("Delete Clip")) != KMessageBox::Yes) return;
227         } else if (item->isGroup() && item->childCount() > 0) {
228             int children = item->childCount();
229             if (KMessageBox::questionYesNo(this, i18n("Delete folder <b>%2</b> ?<br>This will also remove the %1 clips in that folder", children, item->names().at(1)), i18n("Delete Folder")) != KMessageBox::Yes) return;
230             for (int i = 0; i < children; ++i) {
231                 ProjectItem *child = static_cast <ProjectItem *>(item->child(i));
232                 ids << child->clipId();
233             }
234         }
235     }
236     if (!ids.isEmpty()) m_doc->deleteProjectClip(ids);
237     if (!folderids.isEmpty()) m_doc->deleteProjectFolder(folderids);
238     if (listView->topLevelItemCount() == 0) {
239         m_editAction->setEnabled(false);
240         m_deleteAction->setEnabled(false);
241     }
242 }
243
244 void ProjectList::selectItemById(const QString &clipId) {
245     ProjectItem *item = getItemById(clipId);
246     if (item) listView->setCurrentItem(item);
247 }
248
249
250 void ProjectList::slotDeleteClip(const QString &clipId) {
251     ProjectItem *item = getItemById(clipId);
252     QTreeWidgetItem *p = item->parent();
253     if (p) {
254         kDebug() << "///////  DELETEED CLIP HAS A PARENT... " << p->indexOfChild(item);
255         QTreeWidgetItem *clone = p->takeChild(p->indexOfChild(item));
256     } else if (item) {
257         delete item;
258     }
259 }
260
261 void ProjectList::slotAddFolder() {
262
263     // QString folderName = KInputDialog::getText(i18n("New Folder"), i18n("Enter new folder name: "));
264     // if (folderName.isEmpty()) return;
265     m_doc->slotAddFolder(i18n("Folder")); //folderName);
266 }
267
268 void ProjectList::slotAddFolder(const QString foldername, const QString &clipId, bool remove, bool edit) {
269     if (remove) {
270         ProjectItem *item;
271         QTreeWidgetItemIterator it(listView);
272         while (*it) {
273             item = static_cast <ProjectItem *>(*it);
274             if (item->isGroup() && item->clipId() == clipId) {
275                 delete item;
276                 break;
277             }
278             ++it;
279         }
280     } else {
281         if (edit) {
282             disconnect(listView, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotUpdateItemDescription(QTreeWidgetItem *, int)));
283             ProjectItem *item;
284             QTreeWidgetItemIterator it(listView);
285             while (*it) {
286                 item = static_cast <ProjectItem *>(*it);
287                 if (item->isGroup() && item->clipId() == clipId) {
288                     item->setText(1, foldername);
289                     const int children = item->childCount();
290                     for (int i = 0; i < children; i++) {
291                         ProjectItem *child = static_cast <ProjectItem *>(item->child(i));
292                         child->setProperty("groupname", foldername);
293                     }
294                     break;
295                 }
296                 ++it;
297             }
298             connect(listView, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotUpdateItemDescription(QTreeWidgetItem *, int)));
299         } else {
300             QStringList text;
301             text << QString() << foldername;
302             (void) new ProjectItem(listView, text, clipId);
303         }
304     }
305 }
306
307 void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties) {
308     const QString parent = clip->getProperty("groupid");
309     ProjectItem *item = NULL;
310     if (!parent.isEmpty()) {
311         ProjectItem *parentitem = getItemById(parent);
312         if (!parentitem) {
313             QStringList text;
314             QString groupName = clip->getProperty("groupname");
315             if (groupName.isEmpty()) groupName = i18n("Folder");
316             text << QString() << groupName;
317             listView->blockSignals(true);
318             parentitem = new ProjectItem(listView, text, parent);
319             listView->blockSignals(false);
320         }
321         if (parentitem) item = new ProjectItem(parentitem, clip);
322     }
323     if (item == NULL) item = new ProjectItem(listView, clip);
324
325     KUrl url = clip->fileURL();
326     if (!url.isEmpty() && KdenliveSettings::activate_nepomuk()) {
327         // if file has Nepomuk comment, use it
328         Nepomuk::Resource f(url.path());
329         QString annotation;
330         if (f.isValid()) {
331             annotation = f.description();
332             /*
333             Nepomuk::Tag tag("test");
334             f.addTag(tag);*/
335         } else {
336             KMessageBox::sorry(this, i18n("Cannot access Desktop Search info for %1.\nDisabling Desktop Search integration.", url.path()));
337             KdenliveSettings::setActivate_nepomuk(false);
338         }
339         if (!annotation.isEmpty()) item->setText(2, annotation);
340     }
341     if (getProperties) emit getFileProperties(clip->toXML(), clip->getId());
342 }
343
344 void ProjectList::slotUpdateClip(const QString &id) {
345     ProjectItem *item = getItemById(id);
346     item->setData(1, UsageRole, QString::number(item->numReferences()));
347 }
348
349 void ProjectList::updateAllClips() {
350     QTreeWidgetItemIterator it(listView);
351     while (*it) {
352         ProjectItem *item = static_cast <ProjectItem *>(*it);
353         if (!item->isGroup()) {
354             if (item->referencedClip()->producer() == NULL) {
355                 DocClipBase *clip = item->referencedClip();
356                 if (clip->clipType() == TEXT && !QFile::exists(clip->fileURL().path())) {
357                     // regenerate text clip image if required
358                     TitleWidget *dia_ui = new TitleWidget(KUrl(), QString(), m_render, this);
359                     QDomDocument doc;
360                     doc.setContent(clip->getProperty("xmldata"));
361                     dia_ui->setXml(doc);
362                     QPixmap pix = dia_ui->renderedPixmap();
363                     pix.save(clip->fileURL().path());
364                     delete dia_ui;
365                 }
366                 emit getFileProperties(clip->toXML(), clip->getId());
367             } else {
368                 slotRefreshClipThumbnail(item, false);
369                 item->changeDuration(item->referencedClip()->producer()->get_playtime());
370             }
371             item->setData(1, UsageRole, QString::number(item->numReferences()));
372             qApp->processEvents();
373         }
374         ++it;
375     }
376 }
377
378 void ProjectList::slotAddClip(QUrl givenUrl, QString group) {
379     if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!!  NO CMD STK";
380     KUrl::List list;
381     if (givenUrl.isEmpty()) {
382         list = KFileDialog::getOpenUrls(KUrl("kfiledialog:///clipfolder"), "application/x-kdenlive application/x-flash-video application/vnd.rn-realmedia video/x-dv video/dv video/x-msvideo video/mpeg video/x-ms-wmv audio/mpeg audio/x-mp3 audio/x-wav application/ogg video/mp4 video/quicktime image/gif image/jpeg image/png image/x-bmp image/svg+xml image/tiff image/x-xcf-gimp image/x-vnd.adobe.photoshop image/x-pcx image/x-exr video/mlt-playlist audio/x-flac audio/mp4", this);
383     } else list.append(givenUrl);
384     if (list.isEmpty()) return;
385
386     QString groupId = QString();
387     if (group.isEmpty()) {
388         ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
389         if (item && item->clipType() != FOLDER) {
390             while (item->parent()) {
391                 item = static_cast <ProjectItem*>(item->parent());
392                 if (item->clipType() == FOLDER) break;
393             }
394         }
395         if (item && item->clipType() == FOLDER) {
396             group = item->groupName();
397             groupId = item->clipId();
398         }
399     }
400     m_doc->slotAddClipList(list, group, groupId);
401 }
402
403 void ProjectList::slotRemoveInvalidClip(const QString &id) {
404     ProjectItem *item = getItemById(id);
405     if (item) {
406         QString path = item->referencedClip()->fileURL().path();
407         if (!path.isEmpty()) KMessageBox::sorry(this, i18n("<qt>Clip <b>%1</b><br>is invalid, will be removed from project.", path));
408
409     }
410     QList <QString> ids;
411     ids << id;
412     m_doc->deleteProjectClip(ids);
413 }
414
415 void ProjectList::slotAddColorClip() {
416     if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!!  NO CMD STK";
417     QDialog *dia = new QDialog(this);
418     Ui::ColorClip_UI *dia_ui = new Ui::ColorClip_UI();
419     dia_ui->setupUi(dia);
420     dia_ui->clip_name->setText(i18n("Color Clip"));
421     dia_ui->clip_duration->setText(KdenliveSettings::color_duration());
422     if (dia->exec() == QDialog::Accepted) {
423         QString color = dia_ui->clip_color->color().name();
424         color = color.replace(0, 1, "0x") + "ff";
425
426         QString group = QString();
427         QString groupId = QString();
428         ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
429         if (item && item->clipType() != FOLDER) {
430             while (item->parent()) {
431                 item = static_cast <ProjectItem*>(item->parent());
432                 if (item->clipType() == FOLDER) break;
433             }
434         }
435         if (item && item->clipType() == FOLDER) {
436             group = item->groupName();
437             groupId = item->clipId();
438         }
439
440         m_doc->slotAddColorClipFile(dia_ui->clip_name->text(), color, dia_ui->clip_duration->text(), group, groupId);
441     }
442     delete dia_ui;
443     delete dia;
444 }
445
446
447 void ProjectList::slotAddSlideshowClip() {
448     if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!!  NO CMD STK";
449     SlideshowClip *dia = new SlideshowClip(this);
450
451     if (dia->exec() == QDialog::Accepted) {
452
453         QString group = QString();
454         QString groupId = QString();
455         ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
456         if (item && item->clipType() != FOLDER) {
457             while (item->parent()) {
458                 item = static_cast <ProjectItem*>(item->parent());
459                 if (item->clipType() == FOLDER) break;
460             }
461         }
462         if (item && item->clipType() == FOLDER) {
463             group = item->groupName();
464             groupId = item->clipId();
465         }
466
467         m_doc->slotAddSlideshowClipFile(dia->clipName(), dia->selectedPath(), dia->imageCount(), dia->clipDuration(), dia->loop(), dia->fade(), dia->lumaDuration(), dia->lumaFile(), dia->softness(), group, groupId);
468     }
469     delete dia;
470 }
471
472 void ProjectList::slotAddTitleClip() {
473     QString group = QString();
474     QString groupId = QString();
475     ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
476     if (item && item->clipType() != FOLDER) {
477         while (item->parent()) {
478             item = static_cast <ProjectItem*>(item->parent());
479             if (item->clipType() == FOLDER) break;
480         }
481     }
482     if (item && item->clipType() == FOLDER) {
483         group = item->groupName();
484         groupId = item->clipId();
485     }
486
487     m_doc->slotCreateTextClip(group, groupId);
488 }
489
490 void ProjectList::setDocument(KdenliveDoc *doc) {
491     listView->clear();
492     QList <DocClipBase*> list = doc->clipManager()->documentClipList();
493     for (int i = 0; i < list.count(); i++) {
494         slotAddClip(list.at(i), false);
495     }
496
497     m_fps = doc->fps();
498     m_timecode = doc->timecode();
499     m_commandStack = doc->commandStack();
500     m_doc = doc;
501     QTreeWidgetItem *first = listView->topLevelItem(0);
502     if (first) listView->setCurrentItem(first);
503     m_toolbar->setEnabled(true);
504 }
505
506 QDomElement ProjectList::producersList() {
507     QDomDocument doc;
508     QDomElement prods = doc.createElement("producerlist");
509     doc.appendChild(prods);
510     kDebug() << "////////////  PRO LIST BUILD PRDSLIST ";
511     QTreeWidgetItemIterator it(listView);
512     while (*it) {
513         if (!((ProjectItem *)(*it))->isGroup())
514             prods.appendChild(doc.importNode(((ProjectItem *)(*it))->toXml(), true));
515         ++it;
516     }
517     return prods;
518 }
519
520 void ProjectList::slotRefreshClipThumbnail(const QString &clipId) {
521     ProjectItem *item = getItemById(clipId);
522     if (item) slotRefreshClipThumbnail(item);
523 }
524
525 void ProjectList::slotRefreshClipThumbnail(ProjectItem *item, bool update) {
526     if (item) {
527         int height = 50;
528         int width = (int)(height  * m_render->dar());
529         QPixmap pix = item->referencedClip()->thumbProducer()->extractImage(item->referencedClip()->getClipThumbFrame(), width, height);
530         item->setIcon(0, pix);
531         if (update) emit projectModified();
532     }
533 }
534
535 void ProjectList::slotReplyGetFileProperties(const QString &clipId, Mlt::Producer *producer, const QMap < QString, QString > &properties, const QMap < QString, QString > &metadata) {
536     ProjectItem *item = getItemById(clipId);
537     if (item) {
538         item->setProperties(properties, metadata);
539         item->referencedClip()->setProducer(producer);
540         emit receivedClipDuration(clipId, item->clipMaxDuration());
541     } else kDebug() << "////////  COULD NOT FIND CLIP TO UPDATE PRPS...";
542 }
543
544 void ProjectList::slotReplyGetImage(const QString &clipId, int pos, const QPixmap &pix, int w, int h) {
545     ProjectItem *item = getItemById(clipId);
546     if (item) item->setIcon(0, pix);
547 }
548
549 ProjectItem *ProjectList::getItemById(const QString &id) {
550     QTreeWidgetItemIterator it(listView);
551     while (*it) {
552         if (((ProjectItem *)(*it))->clipId() == id)
553             break;
554         ++it;
555     }
556     if (*it) return ((ProjectItem *)(*it));
557     return NULL;
558 }
559
560 void ProjectList::slotSelectClip(const QString &ix) {
561     ProjectItem *p = getItemById(ix);
562     if (p) {
563         listView->setCurrentItem(p);
564         listView->scrollToItem(p);
565         m_editAction->setEnabled(true);
566         m_deleteAction->setEnabled(true);
567     }
568 }
569
570 #include "projectlist.moc"