]> git.sesse.net Git - kdenlive/commitdiff
Some new actions: delete all guides, delete all markers, fix crash in delete clip...
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 8 Jul 2008 22:41:04 +0000 (22:41 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 8 Jul 2008 22:41:04 +0000 (22:41 +0000)
svn path=/branches/KDE4/; revision=2302

14 files changed:
src/addmarkercommand.cpp
src/addmarkercommand.h
src/addtimelineclipcommand.cpp
src/addtimelineclipcommand.h
src/addtransitioncommand.cpp
src/addtransitioncommand.h
src/customruler.cpp
src/customtrackview.cpp
src/customtrackview.h
src/editguidecommand.cpp
src/editguidecommand.h
src/kdenliveui.rc
src/mainwindow.cpp
src/mainwindow.h

index f4c47421648e77def3a068c24b0f23859ed45b64..5dc764f6f671f420d0656f4473ec469614fdbf84 100644 (file)
@@ -19,7 +19,7 @@
 #include "addmarkercommand.h"
 #include "customtrackview.h"
 
-AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const QString &oldcomment, const QString &comment, const int id, const GenTime &pos, bool doIt) : m_view(view), m_oldcomment(oldcomment), m_comment(comment), m_id(id), m_pos(pos), m_doIt(doIt) {
+AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const QString &oldcomment, const QString &comment, const int id, const GenTime &pos, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_oldcomment(oldcomment), m_comment(comment), m_id(id), m_pos(pos), m_doIt(doIt) {
     if (m_comment.isEmpty()) setText(i18n("Delete marker"));
     else if (m_oldcomment.isEmpty()) setText(i18n("Add marker"));
     else setText(i18n("Edit marker"));
index 0c839daa1941bcb7839e8728d7f9ac74b34c9c03..cc16bf61e1a1f26cc41528f1a8c28a808a4a1685 100644 (file)
@@ -31,7 +31,7 @@ class CustomTrackView;
 
 class AddMarkerCommand : public QUndoCommand {
 public:
-    AddMarkerCommand(CustomTrackView *view, const QString &oldcomment, const QString &comment, const int id, const GenTime &pos, bool doIt);
+    AddMarkerCommand(CustomTrackView *view, const QString &oldcomment, const QString &comment, const int id, const GenTime &pos, bool doIt, QUndoCommand * parent = 0);
     virtual void undo();
     virtual void redo();
 
index 15ac2bddc773982927f4e9dd08d49b1416f39c4b..7827b25c5d5bccba1d47628d8bdf29c71b3f4c7e 100644 (file)
@@ -22,8 +22,7 @@
 #include "addtimelineclipcommand.h"
 #include "customtrackview.h"
 
-AddTimelineClipCommand::AddTimelineClipCommand(CustomTrackView *view, QDomElement xml, int clipId, ItemInfo info, bool doIt, bool doRemove)
-        : m_view(view), m_xml(xml), m_clipId(clipId), m_clipInfo(info), m_doIt(doIt), m_remove(doRemove) {
+AddTimelineClipCommand::AddTimelineClipCommand(CustomTrackView *view, QDomElement xml, int clipId, ItemInfo info, bool doIt, bool doRemove, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_xml(xml), m_clipId(clipId), m_clipInfo(info), m_doIt(doIt), m_remove(doRemove) {
     if (!m_remove) setText(i18n("Add timeline clip"));
     else setText(i18n("Delete timeline clip"));
 }
index 487e18ea18f1de1087a7e28cd7900cd23f174016..c09638c8fb8e97dd219b600c4601a63eb94c6e5b 100644 (file)
@@ -34,7 +34,7 @@ class CustomTrackView;
 
 class AddTimelineClipCommand : public QUndoCommand {
 public:
-    AddTimelineClipCommand(CustomTrackView *view, QDomElement xml, int clipId, ItemInfo info, bool doIt, bool doRemove);
+    AddTimelineClipCommand(CustomTrackView *view, QDomElement xml, int clipId, ItemInfo info, bool doIt, bool doRemove, QUndoCommand * parent = 0);
     virtual void undo();
     virtual void redo();
 
index 6650bb4a0dd3245e415982637be46b5bdfa1f35a..4d3f075027aab48260118bda82aebadd2470c550 100644 (file)
@@ -19,7 +19,7 @@
 #include "addtransitioncommand.h"
 #include "customtrackview.h"
 
-AddTransitionCommand::AddTransitionCommand(CustomTrackView *view, ItemInfo info, int transitiontrack, QDomElement params, bool remove, bool doIt) : m_view(view), m_info(info), m_track(transitiontrack), m_params(params), m_remove(remove), m_doIt(doIt) {
+AddTransitionCommand::AddTransitionCommand(CustomTrackView *view, ItemInfo info, int transitiontrack, QDomElement params, bool remove, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_info(info), m_track(transitiontrack), m_params(params), m_remove(remove), m_doIt(doIt) {
     if (m_remove) setText(i18n("Delete transition from clip"));
     else setText(i18n("Add transition to clip"));
 }
index 75af055916cc03c73bf6ab500aeb9db5bec23e3e..67c3383b8b9fb71533a62ad09b3b6378db36b032 100644 (file)
@@ -31,7 +31,7 @@ class CustomTrackView;
 
 class AddTransitionCommand : public QUndoCommand {
 public:
-    AddTransitionCommand(CustomTrackView *view, ItemInfo info, int transitiontrack, QDomElement params, bool remove, bool doIt);
+    AddTransitionCommand(CustomTrackView *view, ItemInfo info, int transitiontrack, QDomElement params, bool remove, bool doIt, QUndoCommand * parent = 0);
     virtual void undo();
     virtual void redo();
 
index 0806f5e9f279c92f87070770c74457ff55184371..a7133bb16d0d5aa319900ef81bb4789a13d91a02 100644 (file)
@@ -90,10 +90,12 @@ CustomRuler::CustomRuler(Timecode tc, CustomTrackView *parent)
     m_contextMenu = new QMenu(this);
     QAction *addGuide = m_contextMenu->addAction(KIcon("document-new"), i18n("Add Guide"));
     connect(addGuide, SIGNAL(triggered()), m_view, SLOT(slotAddGuide()));
-    QAction *delGuide = m_contextMenu->addAction(KIcon("document-new"), i18n("Delete Guide"));
-    connect(delGuide, SIGNAL(triggered()), m_view, SLOT(slotDeleteGuide()));
-    QAction *editGuide = m_contextMenu->addAction(KIcon("document-new"), i18n("Edit Guide"));
+    QAction *editGuide = m_contextMenu->addAction(KIcon("document-properties"), i18n("Edit Guide"));
     connect(editGuide, SIGNAL(triggered()), m_view, SLOT(slotEditGuide()));
+    QAction *delGuide = m_contextMenu->addAction(KIcon("edit-delete"), i18n("Delete Guide"));
+    connect(delGuide, SIGNAL(triggered()), m_view, SLOT(slotDeleteGuide()));
+    QAction *delAllGuides = m_contextMenu->addAction(KIcon("edit-delete"), i18n("Delete All Guides"));
+    connect(delAllGuides, SIGNAL(triggered()), m_view, SLOT(slotDeleteAllGuides()));
     setMouseTracking(true);
 }
 
index 8610843be801041f45b7776c097c0db5a5a218db..95c592ba6dbc201e65da55ca2a67b29359260582 100644 (file)
@@ -1188,6 +1188,10 @@ void CustomTrackView::deleteClip(ItemInfo info) {
 }
 
 void CustomTrackView::deleteSelectedClips() {
+
+    QUndoCommand *deleteSelected = new QUndoCommand();
+    deleteSelected->setText("Delete selected items");
+
     QList<QGraphicsItem *> itemList = scene()->selectedItems();
     for (int i = 0; i < itemList.count(); i++) {
         if (itemList.at(i)->type() == AVWIDGET) {
@@ -1196,18 +1200,17 @@ void CustomTrackView::deleteSelectedClips() {
             info.startPos = item->startPos();
             info.endPos = item->endPos();
             info.track = item->track();
-            AddTimelineClipCommand *command = new AddTimelineClipCommand(this, item->xml(), item->clipProducer(), info, true, true);
-            m_commandStack->push(command);
+            new AddTimelineClipCommand(this, item->xml(), item->clipProducer(), info, true, true, deleteSelected);
         } else if (itemList.at(i)->type() == TRANSITIONWIDGET) {
             Transition *item = (Transition *) itemList.at(i);
             ItemInfo info;
             info.startPos = item->startPos();
             info.endPos = item->endPos();
             info.track = item->track();
-            AddTransitionCommand *command = new AddTransitionCommand(this, info, item->transitionEndTrack(), QDomElement(), true, true);
-            m_commandStack->push(command);
+            new AddTransitionCommand(this, info, item->transitionEndTrack(), QDomElement(), true, true, deleteSelected);
         }
     }
+    m_commandStack->push(deleteSelected);
 }
 
 void CustomTrackView::cutSelectedClips() {
@@ -1538,7 +1541,7 @@ void CustomTrackView::slotDeleteClipMarker() {
     }
     AbstractClipItem *item = (AbstractClipItem *)itemList.at(0);
     if (item->type() != AVWIDGET) {
-        emit displayMessage(i18n("No clip at cursor time"), ErrorMessage);
+        emit displayMessage(i18n("No clip selected"), ErrorMessage);
         return;
     }
     GenTime pos = GenTime(m_cursorPos, m_document->fps());
@@ -1558,6 +1561,36 @@ void CustomTrackView::slotDeleteClipMarker() {
     m_commandStack->push(command);
 }
 
+void CustomTrackView::slotDeleteAllClipMarkers() {
+    QList<QGraphicsItem *> itemList = scene()->selectedItems();
+    if (itemList.count() != 1) {
+        emit displayMessage(i18n("Cannot delete marker if more than one clip is selected"), ErrorMessage);
+        kDebug() << "// CANNOT DELETE MARKER IF MORE TAN ONE CLIP IS SELECTED....";
+        return;
+    }
+    AbstractClipItem *item = (AbstractClipItem *)itemList.at(0);
+    if (item->type() != AVWIDGET) {
+        emit displayMessage(i18n("No clip selected"), ErrorMessage);
+        return;
+    }
+
+    ClipItem *clip = static_cast <ClipItem *>(item);
+    QList <CommentedTime> markers = clip->baseClip()->commentedSnapMarkers();
+
+    if (markers.isEmpty()) {
+        emit displayMessage(i18n("Clip has no markers"), ErrorMessage);
+        return;
+    }
+    int id = clip->baseClip()->getId();
+    QUndoCommand *deleteMarkers = new QUndoCommand();
+    deleteMarkers->setText("Delete clip markers");
+
+    for (int i = 0; i < markers.size(); i++) {
+        new AddMarkerCommand(this, markers.at(i).comment(), QString(), id, markers.at(i).time(), true, deleteMarkers);
+    }
+    m_commandStack->push(deleteMarkers);
+}
+
 void CustomTrackView::slotEditClipMarker() {
     QList<QGraphicsItem *> itemList = scene()->selectedItems();
     if (itemList.count() != 1) {
@@ -1696,6 +1729,15 @@ void CustomTrackView::slotDeleteGuide() {
     if (!found) emit displayMessage(i18n("No guide at cursor time"), ErrorMessage);
 }
 
+void CustomTrackView::slotDeleteAllGuides() {
+    QUndoCommand *deleteAll = new QUndoCommand();
+    deleteAll->setText("Delete all guides");
+    for (int i = 0; i < m_guides.count(); i++) {
+        EditGuideCommand *command = new EditGuideCommand(this, m_guides.at(i)->position(), m_guides.at(i)->label(), GenTime(), QString(), true, deleteAll);
+    }
+    m_commandStack->push(deleteAll);
+}
+
 void CustomTrackView::setTool(PROJECTTOOL tool) {
     m_tool = tool;
 }
index cc26e6eebe5b0bf687a4b71840301b4e9da3ff88..03597a9a6c178f19dce842ff43474085ca78c57a 100644 (file)
@@ -59,6 +59,7 @@ public:
     void slotAddClipMarker();
     void slotEditClipMarker();
     void slotDeleteClipMarker();
+    void slotDeleteAllClipMarkers();
     void addMarker(const int id, const GenTime &pos, const QString comment);
     void setScale(double scaleFactor);
     void deleteClip(int clipId);
@@ -114,6 +115,7 @@ public slots:
     void slotEditGuide(CommentedTime guide);
     void slotEditGuide();
     void slotDeleteGuide();
+    void slotDeleteAllGuides();
     void editGuide(const GenTime oldPos, const GenTime pos, const QString &comment);
 
 protected:
index 844b860cabfce74df751b59d4b0c0b4438a5cf1b..10b2b78e02396bec70af86f3bd84d28461589294 100644 (file)
@@ -19,7 +19,7 @@
 #include "editguidecommand.h"
 #include "customtrackview.h"
 
-EditGuideCommand::EditGuideCommand(CustomTrackView *view, const GenTime oldPos, const QString &oldcomment, const GenTime pos, const QString &comment, bool doIt) : m_view(view), m_oldPos(oldPos), m_oldcomment(oldcomment), m_pos(pos), m_comment(comment), m_doIt(doIt) {
+EditGuideCommand::EditGuideCommand(CustomTrackView *view, const GenTime oldPos, const QString &oldcomment, const GenTime pos, const QString &comment, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_oldPos(oldPos), m_oldcomment(oldcomment), m_pos(pos), m_comment(comment), m_doIt(doIt) {
     if (m_oldcomment.isEmpty()) setText(i18n("Add guide"));
     else if (m_oldPos == m_pos) setText(i18n("Edit guide"));
     else if (m_pos <= GenTime()) setText(i18n("Delete guide"));
index 742227f86751f8b8faf561df7ee669b695c4796c..327ffe28918e4488b7e6e8a6ff52173f6bf157ca 100644 (file)
@@ -31,7 +31,7 @@ class CustomTrackView;
 
 class EditGuideCommand : public QUndoCommand {
 public:
-    EditGuideCommand(CustomTrackView *view, const GenTime oldPos, const QString &oldcomment, const GenTime pos, const QString &comment, bool doIt);
+    EditGuideCommand(CustomTrackView *view, const GenTime oldPos, const QString &oldcomment, const GenTime pos, const QString &comment, bool doIt, QUndoCommand * parent = 0);
     virtual void undo();
     virtual void redo();
 
index 1e4af504d1b40f7c39af4476ed2caec7cd9cb230..b1d660cced819887d8fdb41993552542d01c1f6a 100644 (file)
                <Action name="add_clip_marker" />
                <Action name="edit_clip_marker" />
                <Action name="delete_clip_marker" />
+               <Action name="delete_all_clip_markers" />
       </Menu>
+      <Menu name="guide_menu" ><text>Guides</text>
+               <Action name="add_guide" />
+               <Action name="edit_guide" />
+               <Action name="delete_guide" />
+               <Action name="delete_all_guides" />
+      </Menu>
+      <Separator />
       <Menu name="video_effects_menu" ><text>Add Video Effect</text>
       </Menu>
       <Menu name="audio_effects_menu" ><text>Add Audio Effect</text>
index 3e9693f91b7f7765d6fa85e8dd815665bfba21e0..d7107d1a5c2039dd08a03b8c870e84479b184844 100644 (file)
@@ -596,10 +596,30 @@ void MainWindow::setupActions() {
     actionCollection()->addAction("delete_clip_marker", deleteClipMarker);
     connect(deleteClipMarker, SIGNAL(triggered(bool)), this, SLOT(slotDeleteClipMarker()));
 
+    KAction* deleteAllClipMarkers = new KAction(KIcon("edit-delete"), i18n("Delete All Markers from Clip"), this);
+    actionCollection()->addAction("delete_all_clip_markers", deleteAllClipMarkers);
+    connect(deleteAllClipMarkers, SIGNAL(triggered(bool)), this, SLOT(slotDeleteAllClipMarkers()));
+
     KAction* editClipMarker = new KAction(KIcon("document-properties"), i18n("Edit Marker"), this);
     actionCollection()->addAction("edit_clip_marker", editClipMarker);
     connect(editClipMarker, SIGNAL(triggered(bool)), this, SLOT(slotEditClipMarker()));
 
+    KAction *addGuide = new KAction(KIcon("document-new"), i18n("Add Guide"), this);
+    actionCollection()->addAction("add_guide", addGuide);
+    connect(addGuide, SIGNAL(triggered()), this, SLOT(slotAddGuide()));
+
+    QAction *delGuide = new KAction(KIcon("edit-delete"), i18n("Delete Guide"), this);
+    actionCollection()->addAction("delete_guide", delGuide);
+    connect(delGuide, SIGNAL(triggered()), this, SLOT(slotDeleteGuide()));
+
+    QAction *editGuide = new KAction(KIcon("document-properties"), i18n("Edit Guide"), this);
+    actionCollection()->addAction("edit_guide", editGuide);
+    connect(editGuide, SIGNAL(triggered()), this, SLOT(slotEditGuide()));
+
+    QAction *delAllGuides = new KAction(KIcon("edit-delete"), i18n("Delete All Guides"), this);
+    actionCollection()->addAction("delete_all_guides", delAllGuides);
+    connect(delAllGuides, SIGNAL(triggered()), this, SLOT(slotDeleteAllGuides()));
+
     KStandardAction::quit(this, SLOT(queryQuit()),
                           actionCollection());
 
@@ -1010,11 +1030,10 @@ void MainWindow::slotPreferences() {
 
 void MainWindow::updateConfiguration() {
     //TODO: we should apply settings to all projects, not only the current one
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    if (currentTab) {
-        currentTab->refresh();
-        currentTab->projectView()->checkAutoScroll();
-        currentTab->projectView()->checkTrackHeight();
+    if (m_activeTimeline) {
+        m_activeTimeline->refresh();
+        m_activeTimeline->projectView()->checkAutoScroll();
+        m_activeTimeline->projectView()->checkTrackHeight();
         if (m_activeDocument) m_activeDocument->clipManager()->checkAudioThumbs();
     }
     m_buttonAudioThumbs->setChecked(KdenliveSettings::audiothumbnails());
@@ -1025,19 +1044,17 @@ void MainWindow::updateConfiguration() {
 
 void MainWindow::slotSwitchVideoThumbs() {
     KdenliveSettings::setVideothumbnails(!KdenliveSettings::videothumbnails());
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    if (currentTab) {
-        currentTab->refresh();
+    if (m_activeTimeline) {
+        m_activeTimeline->refresh();
     }
     m_buttonVideoThumbs->setChecked(KdenliveSettings::videothumbnails());
 }
 
 void MainWindow::slotSwitchAudioThumbs() {
     KdenliveSettings::setAudiothumbnails(!KdenliveSettings::audiothumbnails());
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    if (currentTab) {
-        currentTab->refresh();
-        currentTab->projectView()->checkAutoScroll();
+    if (m_activeTimeline) {
+        m_activeTimeline->refresh();
+        m_activeTimeline->projectView()->checkAutoScroll();
         if (m_activeDocument) m_activeDocument->clipManager()->checkAudioThumbs();
     }
     m_buttonAudioThumbs->setChecked(KdenliveSettings::audiothumbnails());
@@ -1045,9 +1062,8 @@ void MainWindow::slotSwitchAudioThumbs() {
 
 void MainWindow::slotSwitchMarkersComments() {
     KdenliveSettings::setShowmarkers(!KdenliveSettings::showmarkers());
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    if (currentTab) {
-        currentTab->refresh();
+    if (m_activeTimeline) {
+        m_activeTimeline->refresh();
     }
     m_buttonShowMarkers->setChecked(KdenliveSettings::showmarkers());
 }
@@ -1059,37 +1075,58 @@ void MainWindow::slotSwitchSnap() {
 
 
 void MainWindow::slotDeleteTimelineClip() {
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    if (currentTab) {
-        currentTab->projectView()->deleteSelectedClips();
+    if (m_activeTimeline) {
+        m_activeTimeline->projectView()->deleteSelectedClips();
     }
 }
 
 void MainWindow::slotAddClipMarker() {
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    if (currentTab) {
-        currentTab->projectView()->slotAddClipMarker();
+    if (m_activeTimeline) {
+        m_activeTimeline->projectView()->slotAddClipMarker();
     }
 }
 
 void MainWindow::slotDeleteClipMarker() {
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    if (currentTab) {
-        currentTab->projectView()->slotDeleteClipMarker();
+    if (m_activeTimeline) {
+        m_activeTimeline->projectView()->slotDeleteClipMarker();
+    }
+}
+
+void MainWindow::slotDeleteAllClipMarkers() {
+    if (m_activeTimeline) {
+        m_activeTimeline->projectView()->slotDeleteAllClipMarkers();
     }
 }
 
 void MainWindow::slotEditClipMarker() {
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    if (currentTab) {
-        currentTab->projectView()->slotEditClipMarker();
+    if (m_activeTimeline) {
+        m_activeTimeline->projectView()->slotEditClipMarker();
     }
 }
 
+void MainWindow::slotAddGuide() {
+    if (m_activeTimeline)
+        m_activeTimeline->projectView()->slotAddGuide();
+}
+
+void MainWindow::slotEditGuide() {
+    if (m_activeTimeline)
+        m_activeTimeline->projectView()->slotEditGuide();
+}
+
+void MainWindow::slotDeleteGuide() {
+    if (m_activeTimeline)
+        m_activeTimeline->projectView()->slotDeleteGuide();
+}
+
+void MainWindow::slotDeleteAllGuides() {
+    if (m_activeTimeline)
+        m_activeTimeline->projectView()->slotDeleteAllGuides();
+}
+
 void MainWindow::slotCutTimelineClip() {
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    if (currentTab) {
-        currentTab->projectView()->cutSelectedClips();
+    if (m_activeTimeline) {
+        m_activeTimeline->projectView()->cutSelectedClips();
     }
 }
 
@@ -1101,9 +1138,8 @@ void MainWindow::slotAddProjectClip(KUrl url) {
 void MainWindow::slotAddTransition(QAction *result) {
     if (!result) return;
     QDomElement effect = transitions.getEffectByName(result->data().toString());
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    if (currentTab) {
-        currentTab->projectView()->slotAddTransitionToSelectedClips(effect);
+    if (m_activeTimeline) {
+        m_activeTimeline->projectView()->slotAddTransitionToSelectedClips(effect);
     }
 }
 
@@ -1134,9 +1170,8 @@ void MainWindow::slotZoomOut() {
 }
 
 void MainWindow::slotFitZoom() {
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    if (currentTab) {
-        m_zoomSlider->setValue(currentTab->fitZoom());
+    if (m_activeTimeline) {
+        m_zoomSlider->setValue(m_activeTimeline->fitZoom());
     }
 }
 
@@ -1156,15 +1191,13 @@ void MainWindow::slotShowClipProperties(DocClipBase *clip) {
         m_activeDocument->editTextClip(clip->getProperty("xml"), clip->getId());
         return;
     }
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
     ClipProperties dia(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
-    connect(&dia, SIGNAL(addMarker(int, GenTime, QString)), currentTab->projectView(), SLOT(slotAddClipMarker(int, GenTime, QString)));
+    connect(&dia, SIGNAL(addMarker(int, GenTime, QString)), m_activeTimeline->projectView(), SLOT(slotAddClipMarker(int, GenTime, QString)));
     if (dia.exec() == QDialog::Accepted) {
         m_projectList->slotUpdateClipProperties(dia.clipId(), dia.properties());
         if (dia.needsTimelineRefresh()) {
             // update clip occurences in timeline
-
-            currentTab->projectView()->slotUpdateClip(dia.clipId());
+            m_activeTimeline->projectView()->slotUpdateClip(dia.clipId());
         }
     }
 }
@@ -1185,29 +1218,29 @@ void MainWindow::slotActivateTransitionView() {
 
 void MainWindow::slotSnapRewind() {
     if (m_monitorManager->projectMonitorFocused()) {
-        TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-        currentTab->projectView()->slotSeekToPreviousSnap();
+        if (m_activeTimeline)
+            m_activeTimeline->projectView()->slotSeekToPreviousSnap();
     }
 }
 
 void MainWindow::slotSnapForward() {
     if (m_monitorManager->projectMonitorFocused()) {
-        TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-        currentTab->projectView()->slotSeekToNextSnap();
+        if (m_activeTimeline)
+            m_activeTimeline->projectView()->slotSeekToNextSnap();
     }
 }
 
 void MainWindow::slotClipStart() {
     if (m_monitorManager->projectMonitorFocused()) {
-        TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-        currentTab->projectView()->clipStart();
+        if (m_activeTimeline)
+            m_activeTimeline->projectView()->clipStart();
     }
 }
 
 void MainWindow::slotClipEnd() {
     if (m_monitorManager->projectMonitorFocused()) {
-        TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-        currentTab->projectView()->clipEnd();
+        if (m_activeTimeline)
+            m_activeTimeline->projectView()->clipEnd();
     }
 }
 
@@ -1217,10 +1250,9 @@ void MainWindow::slotChangeTool(QAction * action) {
 }
 
 void MainWindow::slotSetTool(PROJECTTOOL tool) {
-    if (m_activeDocument) {
+    if (m_activeDocument && m_activeTimeline) {
         //m_activeDocument->setTool(tool);
-        TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-        currentTab->projectView()->setTool(tool);
+        m_activeTimeline->projectView()->setTool(tool);
     }
 }
 
@@ -1236,8 +1268,7 @@ void MainWindow::slotFind() {
 }
 
 void MainWindow::slotFindNext() {
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    if (currentTab->projectView()->findNextString(m_findString)) {
+    if (m_activeTimeline && m_activeTimeline->projectView()->findNextString(m_findString)) {
         statusBar()->showMessage(i18n("Found : %1", m_findString));
     } else {
         statusBar()->showMessage(i18n("Reached end of project"));
@@ -1246,8 +1277,7 @@ void MainWindow::slotFindNext() {
 }
 
 void MainWindow::findAhead() {
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    if (currentTab->projectView()->findString(m_findString)) {
+    if (m_activeTimeline && m_activeTimeline->projectView()->findString(m_findString)) {
         m_projectSearchNext->setEnabled(true);
         statusBar()->showMessage(i18n("Found : %1", m_findString));
     } else {
@@ -1261,8 +1291,7 @@ void MainWindow::findTimeout() {
     m_findActivated = false;
     m_findString = QString();
     statusBar()->showMessage(i18n("Find stopped"), 3000);
-    TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
-    currentTab->projectView()->clearSearchStrings();
+    if (m_activeTimeline) m_activeTimeline->projectView()->clearSearchStrings();
     m_projectSearch->setEnabled(true);
     removeEventFilter(this);
 }
index 79d8e7798a5dc71ac556d0ed6de704f071ff0cad..dd82147b18bfacc2c6d49007976bcacaad3b0df3 100644 (file)
@@ -185,6 +185,7 @@ private slots:
     void slotDeleteTimelineClip();
     void slotAddClipMarker();
     void slotDeleteClipMarker();
+    void slotDeleteAllClipMarkers();
     void slotEditClipMarker();
     void slotCutTimelineClip();
     void slotAddVideoEffect(QAction *result);
@@ -205,6 +206,12 @@ private slots:
     void slotFind();
     void findTimeout();
     void slotFindNext();
+
+    void slotAddGuide();
+    void slotEditGuide();
+    void slotDeleteGuide();
+    void slotDeleteAllGuides();
 };
 
+
 #endif