Restore select all, select all in one track

parent 31830e32
......@@ -2438,35 +2438,18 @@ void MainWindow::slotConfigTrack()
void MainWindow::slotSelectTrack()
{
pCore->monitorManager()->activateMonitor(Kdenlive::ProjectMonitor);
// TODO refac
/*
if (pCore->projectManager()->currentTimeline()) {
pCore->projectManager()->currentTimeline()->projectView()->slotSelectClipsInTrack();
}
*/
getMainTimeline()->controller()->selectCurrentTrack();
}
void MainWindow::slotSelectAllTracks()
{
// TODO refac
/*
pCore->monitorManager()->activateMonitor(Kdenlive::ProjectMonitor);
if (pCore->projectManager()->currentTimeline()) {
pCore->projectManager()->currentTimeline()->projectView()->slotSelectAllClips();
}
*/
getMainTimeline()->controller()->selectAll();
}
void MainWindow::slotUnselectAllTracks()
{
// TODO refac
/*
pCore->monitorManager()->activateMonitor(Kdenlive::ProjectMonitor);
if (pCore->projectManager()->currentTimeline()) {
pCore->projectManager()->currentTimeline()->projectView()->clearSelection();
}
*/
getMainTimeline()->controller()->clearSelection();
}
void MainWindow::slotEditGuide()
......
......@@ -292,7 +292,7 @@ void TimelineController::setSelection(const QList<int> &newSelection, int trackI
m_selection.selectedTrack = trackIndex;
m_selection.isMultitrackSelected = isMultitrack;
if (m_model->m_temporarySelectionGroup > -1) {
// CLear current selection
// Clear current selection
m_model->requestClipUngroup(m_model->m_temporarySelectionGroup, false);
}
std::unordered_set<int> newIds;
......@@ -1562,6 +1562,30 @@ void TimelineController::clearSelection()
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)
{
if (!m_model->isClip(targetId) || !m_model->isClip(sourceId)) {
......
......@@ -79,6 +79,12 @@ public:
/* @brief Clear current selection and inform the view
*/
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
*/
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