added #27
This commit is contained in:
+14
-5
@@ -90,6 +90,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
|
||||
connect(ui->menuWindow, SIGNAL(aboutToShow()), this, SLOT(windowMenu_About_To_Be_Shown()));
|
||||
connect(ui->menu_View, SIGNAL(aboutToShow()), this, SLOT(viewMenu_About_To_Be_Shown()));
|
||||
connect(ui->menu_Tools, SIGNAL(aboutToShow()), this, SLOT(toolMenu_About_To_Be_Shown()));
|
||||
|
||||
QString data_dir = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||
if (!data_dir.isEmpty()) {
|
||||
@@ -434,11 +435,6 @@ void MainWindow::on_actionGo_to_Next_Cut_triggered()
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_actionEdit_Tool_Also_Seeks_triggered(bool checked)
|
||||
{
|
||||
panel_timeline->edit_tool_also_seeks = checked;
|
||||
}
|
||||
|
||||
void MainWindow::on_actionPreferences_triggered()
|
||||
{
|
||||
PreferencesDialog pd(this);
|
||||
@@ -495,3 +491,16 @@ void MainWindow::on_actionNon_Drop_Frame_triggered()
|
||||
panel_viewer->update_end_timecode();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::toolMenu_About_To_Be_Shown() {
|
||||
ui->actionEdit_Tool_Also_Seeks->setChecked(panel_timeline->edit_tool_also_seeks);
|
||||
ui->actionEdit_Tool_Selects_Links->setChecked(panel_timeline->edit_tool_selects_links);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionEdit_Tool_Selects_Links_triggered() {
|
||||
panel_timeline->edit_tool_selects_links = !panel_timeline->edit_tool_selects_links;
|
||||
}
|
||||
|
||||
void MainWindow::on_actionEdit_Tool_Also_Seeks_triggered() {
|
||||
panel_timeline->edit_tool_also_seeks = !panel_timeline->edit_tool_also_seeks;
|
||||
}
|
||||
|
||||
+6
-2
@@ -107,8 +107,6 @@ private slots:
|
||||
|
||||
void autorecover_interval();
|
||||
|
||||
void on_actionEdit_Tool_Also_Seeks_triggered(bool checked);
|
||||
|
||||
void on_actionPreferences_triggered();
|
||||
|
||||
void on_actionIncrease_Track_Height_triggered();
|
||||
@@ -125,6 +123,12 @@ private slots:
|
||||
|
||||
void viewMenu_About_To_Be_Shown();
|
||||
|
||||
void on_actionEdit_Tool_Selects_Links_triggered();
|
||||
|
||||
void on_actionEdit_Tool_Also_Seeks_triggered();
|
||||
|
||||
void toolMenu_About_To_Be_Shown();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
void setup_layout();
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionToggle_Snapping"/>
|
||||
<addaction name="actionEdit_Tool_Also_Seeks"/>
|
||||
<addaction name="actionEdit_Tool_Selects_Links"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionPreferences"/>
|
||||
<addaction name="separator"/>
|
||||
@@ -520,6 +521,14 @@
|
||||
<string>Non-Drop Frame</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEdit_Tool_Selects_Links">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Edit Tool Selects Links</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.6.2, 2018-07-03T16:05:25. -->
|
||||
<!-- Written by QtCreator 4.6.2, 2018-07-03T20:47:05. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
||||
@@ -32,6 +32,7 @@ Timeline::Timeline(QWidget *parent) :
|
||||
snapped = false;
|
||||
rect_select_init = false;
|
||||
rect_select_proc = false;
|
||||
edit_tool_selects_links = false;
|
||||
edit_tool_also_seeks = false;
|
||||
snapping = true;
|
||||
last_frame = 0;
|
||||
|
||||
@@ -101,6 +101,7 @@ public:
|
||||
QTimer playback_updater;
|
||||
|
||||
// shared information
|
||||
bool edit_tool_selects_links;
|
||||
bool edit_tool_also_seeks;
|
||||
int tool;
|
||||
long cursor_frame;
|
||||
|
||||
@@ -707,6 +707,38 @@ void TimelineWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
s.in = qMin(in, out);
|
||||
s.out = qMax(in, out);
|
||||
}
|
||||
|
||||
// select linked clips too
|
||||
if (panel_timeline->edit_tool_selects_links) {
|
||||
for (int j=0;j<sequence->clip_count();j++) {
|
||||
Clip* c = sequence->get_clip(j);
|
||||
for (int i=0;i<panel_timeline->selections.size();i++) {
|
||||
const Selection& s = panel_timeline->selections.at(i);
|
||||
if (c->track == s.track &&
|
||||
!(c->timeline_in < s.in && c->timeline_out < s.in) &&
|
||||
!(c->timeline_in > s.out && c->timeline_out > s.out)) {
|
||||
for (int k=0;k<c->linked.size();k++) {
|
||||
Clip* link = sequence->get_clip(c->linked.at(k));
|
||||
bool found = false;
|
||||
for (int l=0;l<panel_timeline->selections.size();l++) {
|
||||
const Selection& test_sel = panel_timeline->selections.at(l);
|
||||
if (test_sel.track == link->track &&
|
||||
test_sel.in == s.in &&
|
||||
test_sel.out == s.out) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
Selection link_sel = {s.in, s.out, link->track};
|
||||
panel_timeline->selections.append(link_sel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (panel_timeline->edit_tool_also_seeks) {
|
||||
panel_timeline->seek(qMin(panel_timeline->drag_frame_start, panel_timeline->cursor_frame));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user