Commit 064400d6 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Add select all in bin

parent b6dc6f5e
......@@ -1285,6 +1285,11 @@ QModelIndex Bin::getIndexForId(const QString &id, bool folderWanted) const
return {};
}
void Bin::selectAll()
{
m_proxyModel->selectAll();
}
void Bin::selectClipById(const QString &clipId, int frame, const QPoint &zone)
{
if (m_monitor->activeClipId() == clipId) {
......
......@@ -264,6 +264,7 @@ public:
// TODO refac: remove this and call directly the function in ProjectItemModel
void cleanup();
void selectAll();
private slots:
void slotAddClip();
......
......@@ -134,7 +134,7 @@ void ProjectSortProxyModel::onCurrentRowChanged(const QItemSelection &current, c
return;
}
for (int ix = 0; ix < indexes.count(); ix++) {
if (indexes.at(ix).column() == 0) {
if (indexes.at(ix).column() == 0 || indexes.at(ix).column() == 7) {
emit selectModel(indexes.at(ix));
break;
}
......@@ -145,3 +145,13 @@ void ProjectSortProxyModel::slotDataChanged(const QModelIndex &ix1, const QModel
{
emit dataChanged(ix1, ix2, roles);
}
void ProjectSortProxyModel::selectAll()
{
QModelIndex topLeft = index(0, 0, QModelIndex());
QModelIndex bottomRight = index(rowCount(QModelIndex()) - 1,
columnCount(QModelIndex()) - 1, QModelIndex());
QItemSelection selection(topLeft, bottomRight);
m_selection->select(selection, QItemSelectionModel::Select);
}
......@@ -45,6 +45,8 @@ public slots:
void slotSetSearchString(const QString &str);
/** @brief Relay datachanged signal from view's model */
void slotDataChanged(const QModelIndex &ix1, const QModelIndex &ix2, const QVector<int> &roles);
/** @brief Select all items in model */
void selectAll();
private slots:
/** @brief Called when a row change is detected by selection model */
......
......@@ -2419,8 +2419,12 @@ void MainWindow::slotSelectTrack()
void MainWindow::slotSelectAllTracks()
{
getCurrentTimeline()->controller()->selectAll();
if ((QApplication::focusWidget() != nullptr) && (QApplication::focusWidget()->parentWidget() != nullptr) &&
QApplication::focusWidget()->parentWidget() == pCore->bin()) {
pCore->bin()->selectAll();
} else {
getCurrentTimeline()->controller()->selectAll();
}
}
void MainWindow::slotUnselectAllTracks()
......
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