Restore select all, select all in one track

parent 31830e32
...@@ -2438,35 +2438,18 @@ void MainWindow::slotConfigTrack() ...@@ -2438,35 +2438,18 @@ void MainWindow::slotConfigTrack()
void MainWindow::slotSelectTrack() void MainWindow::slotSelectTrack()
{ {
pCore->monitorManager()->activateMonitor(Kdenlive::ProjectMonitor); getMainTimeline()->controller()->selectCurrentTrack();
// TODO refac
/*
if (pCore->projectManager()->currentTimeline()) {
pCore->projectManager()->currentTimeline()->projectView()->slotSelectClipsInTrack();
}
*/
} }
void MainWindow::slotSelectAllTracks() void MainWindow::slotSelectAllTracks()
{ {
// TODO refac
/* getMainTimeline()->controller()->selectAll();
pCore->monitorManager()->activateMonitor(Kdenlive::ProjectMonitor);
if (pCore->projectManager()->currentTimeline()) {
pCore->projectManager()->currentTimeline()->projectView()->slotSelectAllClips();
}
*/
} }
void MainWindow::slotUnselectAllTracks() void MainWindow::slotUnselectAllTracks()
{ {
// TODO refac getMainTimeline()->controller()->clearSelection();
/*
pCore->monitorManager()->activateMonitor(Kdenlive::ProjectMonitor);
if (pCore->projectManager()->currentTimeline()) {
pCore->projectManager()->currentTimeline()->projectView()->clearSelection();
}
*/
} }
void MainWindow::slotEditGuide() void MainWindow::slotEditGuide()
......
...@@ -292,7 +292,7 @@ void TimelineController::setSelection(const QList<int> &newSelection, int trackI ...@@ -292,7 +292,7 @@ void TimelineController::setSelection(const QList<int> &newSelection, int trackI
m_selection.selectedTrack = trackIndex; m_selection.selectedTrack = trackIndex;
m_selection.isMultitrackSelected = isMultitrack; m_selection.isMultitrackSelected = isMultitrack;
if (m_model->m_temporarySelectionGroup > -1) { if (m_model->m_temporarySelectionGroup > -1) {
// CLear current selection // Clear current selection
m_model->requestClipUngroup(m_model->m_temporarySelectionGroup, false); m_model->requestClipUngroup(m_model->m_temporarySelectionGroup, false);
} }
std::unordered_set<int> newIds; std::unordered_set<int> newIds;
...@@ -1562,6 +1562,30 @@ void TimelineController::clearSelection() ...@@ -1562,6 +1562,30 @@ void TimelineController::clearSelection()
emit selectionChanged(); emit selectionChanged();
} }
void TimelineController::selectAll()
{
QList <int> ids;
for (auto clp : m_model->m_allClips) {
ids << clp.first;
}
for (auto clp : m_model->m_allCompositions) {
ids << clp.first;
}
setSelection(ids);
}
void TimelineController::selectCurrentTrack()
{
QList <int> ids;
for (auto clp : m_model->getTrackById_const(m_activeTrack)->m_allClips) {
ids << clp.first;
}
for (auto clp : m_model->getTrackById_const(m_activeTrack)->m_allCompositions) {
ids << clp.first;
}
setSelection(ids);
}
void TimelineController::pasteEffects(int targetId, int sourceId) void TimelineController::pasteEffects(int targetId, int sourceId)
{ {
if (!m_model->isClip(targetId) || !m_model->isClip(sourceId)) { if (!m_model->isClip(targetId) || !m_model->isClip(sourceId)) {
......
...@@ -79,6 +79,12 @@ public: ...@@ -79,6 +79,12 @@ public:
/* @brief Clear current selection and inform the view /* @brief Clear current selection and inform the view
*/ */
void clearSelection(); void clearSelection();
/* @brief Select all timeline items
*/
void selectAll();
/* @brief Select all items in one track
*/
void selectCurrentTrack();
/* @brief returns current timeline's zoom factor /* @brief returns current timeline's zoom factor
*/ */
Q_INVOKABLE double scaleFactor() const; Q_INVOKABLE double scaleFactor() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment