implemented track locking in the timeline widget
This commit is contained in:
@@ -756,11 +756,16 @@ void TimelineWidget::MoveRubberBandSelect(bool select_links)
|
||||
}
|
||||
|
||||
foreach (QGraphicsItem* item, new_selected_list) {
|
||||
item->setSelected(true);
|
||||
TimelineViewBlockItem* block_item = static_cast<TimelineViewBlockItem*>(item);
|
||||
if (GetTrackFromReference(block_item->Track())->IsLocked()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
block_item->setSelected(true);
|
||||
|
||||
if (select_links) {
|
||||
// Select the block's links
|
||||
Block* b = static_cast<TimelineViewBlockItem*>(item)->block();
|
||||
Block* b = block_item->block();
|
||||
SetBlockLinksSelected(b, true);
|
||||
|
||||
// Add its links to the list
|
||||
|
||||
@@ -46,7 +46,9 @@ void TimelineWidget::PointerTool::MousePress(TimelineViewMouseEvent *event)
|
||||
|
||||
TimelineViewBlockItem* item = GetItemAtScenePos(event->GetCoordinates());
|
||||
|
||||
bool selectable_item = (item != nullptr && item->flags() & QGraphicsItem::ItemIsSelectable);
|
||||
bool selectable_item = (item != nullptr
|
||||
&& item->flags() & QGraphicsItem::ItemIsSelectable
|
||||
&& !parent()->GetTrackFromReference(item->Track())->IsLocked());
|
||||
|
||||
if (selectable_item) {
|
||||
// Cache the clip's type for use later
|
||||
|
||||
@@ -59,7 +59,7 @@ void TimelineWidget::RazorTool::MouseRelease(TimelineViewMouseEvent *event)
|
||||
foreach (const TrackReference& track_ref, split_tracks_) {
|
||||
TrackOutput* track = parent()->GetTrackFromReference(track_ref);
|
||||
|
||||
if (track == nullptr) {
|
||||
if (track == nullptr || track->IsLocked()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,10 +30,11 @@ TrackViewItem::TrackViewItem(TrackOutput* track, QWidget *parent) :
|
||||
connect(mute_button_, SIGNAL(toggled(bool)), track_, SLOT(SetMuted(bool)));
|
||||
layout->addWidget(mute_button_);
|
||||
|
||||
solo_button_ = CreateMSLButton(tr("S"), Qt::yellow);
|
||||
layout->addWidget(solo_button_);
|
||||
/*solo_button_ = CreateMSLButton(tr("S"), Qt::yellow);
|
||||
layout->addWidget(solo_button_);*/
|
||||
|
||||
lock_button_ = CreateMSLButton(tr("L"), Qt::gray);
|
||||
connect(lock_button_, SIGNAL(toggled(bool)), track_, SLOT(SetLocked(bool)));
|
||||
layout->addWidget(lock_button_);
|
||||
|
||||
setMinimumHeight(mute_button_->height());
|
||||
|
||||
Reference in New Issue
Block a user