added focus filter
This commit is contained in:
+28
-7
@@ -114,7 +114,7 @@ Project::Project(QWidget *parent) :
|
||||
icon4.addFile(QStringLiteral(":/icons/undo-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
toolbar_undo->setIcon(icon4);
|
||||
toolbar_undo->setToolTip("Undo");
|
||||
connect(toolbar_undo, SIGNAL(clicked(bool)), Olive::MainWindow, SLOT(undo()));
|
||||
connect(toolbar_undo, SIGNAL(clicked(bool)), Olive::Global.data(), SLOT(undo()));
|
||||
toolbar->addWidget(toolbar_undo);
|
||||
|
||||
QPushButton* toolbar_redo = new QPushButton();
|
||||
@@ -123,7 +123,7 @@ Project::Project(QWidget *parent) :
|
||||
icon5.addFile(QStringLiteral(":/icons/redo-disabled.png"), QSize(), QIcon::Disabled, QIcon::On);
|
||||
toolbar_redo->setIcon(icon5);
|
||||
toolbar_redo->setToolTip("Redo");
|
||||
connect(toolbar_redo, SIGNAL(clicked(bool)), Olive::MainWindow, SLOT(redo()));
|
||||
connect(toolbar_redo, SIGNAL(clicked(bool)), Olive::Global.data(), SLOT(redo()));
|
||||
toolbar->addWidget(toolbar_redo);
|
||||
|
||||
QLineEdit* toolbar_search = new QLineEdit();
|
||||
@@ -309,7 +309,7 @@ void Project::duplicate_selected() {
|
||||
for (int j=0;j<items.size();j++) {
|
||||
Media* i = item_to_media(items.at(j));
|
||||
if (i->get_type() == MEDIA_TYPE_SEQUENCE) {
|
||||
new_sequence(ca, i->to_sequence()->copy(), false, item_to_media(items.at(j).parent()));
|
||||
create_sequence_internal(ca, i->to_sequence()->copy(), false, item_to_media(items.at(j).parent()));
|
||||
duped = true;
|
||||
}
|
||||
}
|
||||
@@ -398,10 +398,31 @@ void Project::open_properties() {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Media* Project::new_sequence(ComboAction *ca, Sequence *s, bool open, Media* parent) {
|
||||
void Project::new_folder() {
|
||||
Media* m = create_folder_internal(nullptr);
|
||||
Olive::UndoStack.push(new AddMediaCommand(m, get_selected_folder()));
|
||||
|
||||
QModelIndex index = project_model.create_index(m->row(), 0, m);
|
||||
switch (config.project_view_type) {
|
||||
case PROJECT_VIEW_TREE:
|
||||
tree_view->edit(sorter->mapFromSource(index));
|
||||
break;
|
||||
case PROJECT_VIEW_ICON:
|
||||
icon_view->edit(sorter->mapFromSource(index));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Project::new_sequence() {
|
||||
NewSequenceDialog nsd(this);
|
||||
nsd.set_sequence_name(panel_project->get_next_sequence_name());
|
||||
nsd.exec();
|
||||
}
|
||||
|
||||
Media* Project::create_sequence_internal(ComboAction *ca, Sequence *s, bool open, Media* parent) {
|
||||
if (parent == nullptr) parent = project_model.get_root();
|
||||
Media* item = new Media(parent);
|
||||
item->set_sequence(s);
|
||||
@@ -434,7 +455,7 @@ bool Project::is_focused() {
|
||||
return tree_view->hasFocus() || icon_view->hasFocus();
|
||||
}
|
||||
|
||||
Media* Project::new_folder(QString name) {
|
||||
Media* Project::create_folder_internal(QString name) {
|
||||
Media* item = new Media(nullptr);
|
||||
item->set_folder();
|
||||
item->set_name(name);
|
||||
@@ -648,7 +669,7 @@ void Project::process_file_list(QStringList& files, bool recursive, Media* repla
|
||||
for (int i=0;i<files.size();i++) {
|
||||
if (QFileInfo(files.at(i)).isDir()) {
|
||||
QString folder_name = get_file_name_from_path(files.at(i));
|
||||
Media* folder = new_folder(folder_name);
|
||||
Media* folder = create_folder_internal(folder_name);
|
||||
|
||||
QDir directory(files.at(i));
|
||||
directory.setFilter(QDir::NoDotAndDotDot | QDir::AllEntries);
|
||||
|
||||
+4
-2
@@ -46,7 +46,7 @@ public:
|
||||
~Project();
|
||||
bool is_focused();
|
||||
void clear();
|
||||
Media* new_sequence(ComboAction *ca, Sequence* s, bool open, Media* parent);
|
||||
Media* create_sequence_internal(ComboAction *ca, Sequence* s, bool open, Media* parent);
|
||||
QString get_next_sequence_name(QString start = 0);
|
||||
void process_file_list(QStringList& files, bool recursive = false, Media* replace = nullptr, Media *parent = nullptr);
|
||||
void replace_media(Media* item, QString filename);
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
void load_project(bool autorecovery);
|
||||
void save_project(bool autorecovery);
|
||||
|
||||
Media* new_folder(QString name);
|
||||
Media* create_folder_internal(QString name);
|
||||
Media* item_to_media(const QModelIndex& index);
|
||||
|
||||
void save_recent_projects();
|
||||
@@ -87,6 +87,8 @@ public slots:
|
||||
void replace_selected_file();
|
||||
void replace_clip_media();
|
||||
void open_properties();
|
||||
void new_folder();
|
||||
void new_sequence();
|
||||
private:
|
||||
void save_folder(QXmlStreamWriter& stream, int type, bool set_ids_only, const QModelIndex &parent = QModelIndex());
|
||||
int folder_id;
|
||||
|
||||
+69
-7
@@ -324,9 +324,9 @@ void Timeline::add_clips_from_ghosts(ComboAction* ca, Sequence* s) {
|
||||
if (config.enable_seek_to_import) {
|
||||
panel_sequence_viewer->seek(earliest_point);
|
||||
}
|
||||
panel_timeline->ghosts.clear();
|
||||
panel_timeline->importing = false;
|
||||
panel_timeline->snapped = false;
|
||||
ghosts.clear();
|
||||
importing = false;
|
||||
snapped = false;
|
||||
}
|
||||
|
||||
int Timeline::get_track_height_size(bool video) {
|
||||
@@ -362,7 +362,69 @@ void Timeline::add_transition() {
|
||||
delete ca;
|
||||
}
|
||||
|
||||
update_ui(true);
|
||||
update_ui(true);
|
||||
}
|
||||
|
||||
void Timeline::nest() {
|
||||
if (Olive::ActiveSequence != nullptr) {
|
||||
QVector<int> selected_clips;
|
||||
long earliest_point = LONG_MAX;
|
||||
|
||||
// get selected clips
|
||||
for (int i=0;i<Olive::ActiveSequence->clips.size();i++) {
|
||||
Clip* c = Olive::ActiveSequence->clips.at(i);
|
||||
if (c != nullptr && is_clip_selected(c, true)) {
|
||||
selected_clips.append(i);
|
||||
earliest_point = qMin(c->timeline_in, earliest_point);
|
||||
}
|
||||
}
|
||||
|
||||
// nest them
|
||||
if (!selected_clips.isEmpty()) {
|
||||
ComboAction* ca = new ComboAction();
|
||||
|
||||
Sequence* s = new Sequence();
|
||||
|
||||
// create "nest" sequence
|
||||
s->name = panel_project->get_next_sequence_name(tr("Nested Sequence"));
|
||||
s->width = Olive::ActiveSequence->width;
|
||||
s->height = Olive::ActiveSequence->height;
|
||||
s->frame_rate = Olive::ActiveSequence->frame_rate;
|
||||
s->audio_frequency = Olive::ActiveSequence->audio_frequency;
|
||||
s->audio_layout = Olive::ActiveSequence->audio_layout;
|
||||
|
||||
// copy all selected clips to the nest
|
||||
for (int i=0;i<selected_clips.size();i++) {
|
||||
// delete clip from old sequence
|
||||
ca->append(new DeleteClipAction(Olive::ActiveSequence, selected_clips.at(i)));
|
||||
|
||||
// copy to new
|
||||
Clip* copy = Olive::ActiveSequence->clips.at(selected_clips.at(i))->copy(s);
|
||||
copy->timeline_in -= earliest_point;
|
||||
copy->timeline_out -= earliest_point;
|
||||
s->clips.append(copy);
|
||||
}
|
||||
|
||||
// relink clips in new nested sequences
|
||||
relink_clips_using_ids(selected_clips, s->clips);
|
||||
|
||||
// add sequence to project
|
||||
Media* m = panel_project->create_sequence_internal(ca, s, false, nullptr);
|
||||
|
||||
// add nested sequence to active sequence
|
||||
QVector<Media*> media_list;
|
||||
media_list.append(m);
|
||||
create_ghosts_from_media(Olive::ActiveSequence, earliest_point, media_list);
|
||||
add_clips_from_ghosts(ca, Olive::ActiveSequence);
|
||||
|
||||
panel_effect_controls->clear_effects(true);
|
||||
Olive::ActiveSequence->selections.clear();
|
||||
|
||||
Olive::UndoStack.push(ca);
|
||||
|
||||
update_ui(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int Timeline::calculate_track_height(int track, int value) {
|
||||
@@ -418,7 +480,7 @@ void Timeline::repaint_timeline() {
|
||||
&& !zoom_just_changed) {
|
||||
// auto scroll
|
||||
if (config.autoscroll == AUTOSCROLL_PAGE_SCROLL) {
|
||||
int playhead_x = panel_timeline->getTimelineScreenPointFromFrame(Olive::ActiveSequence->playhead);
|
||||
int playhead_x = getTimelineScreenPointFromFrame(Olive::ActiveSequence->playhead);
|
||||
if (playhead_x < 0 || playhead_x > (editAreas->width() - videoScrollbar->width())) {
|
||||
horizontalScrollBar->setValue(getScreenPointFromFrame(zoom, Olive::ActiveSequence->playhead));
|
||||
draw = false;
|
||||
@@ -515,11 +577,11 @@ void Timeline::ripple_delete_empty_space() {
|
||||
Selection s;
|
||||
s.in = rc_ripple_min;
|
||||
s.out = rc_ripple_max;
|
||||
s.track = panel_timeline->cursor_track;
|
||||
s.track = cursor_track;
|
||||
|
||||
sels.append(s);
|
||||
|
||||
panel_timeline->delete_selection(sels, true);
|
||||
delete_selection(sels, true);
|
||||
}
|
||||
|
||||
void Timeline::resizeEvent(QResizeEvent *) {
|
||||
|
||||
+4
-1
@@ -89,7 +89,6 @@ public:
|
||||
void relink_clips_using_ids(QVector<int>& old_clips, QVector<Clip*>& new_clips);
|
||||
void update_sequence();
|
||||
|
||||
void add_transition();
|
||||
QVector<int> get_tracks_of_linked_clips(int i);
|
||||
bool has_clip_been_split(int c);
|
||||
void ripple_to_in_point(bool in, bool ripple);
|
||||
@@ -220,6 +219,10 @@ public slots:
|
||||
void previous_cut();
|
||||
void next_cut();
|
||||
|
||||
void add_transition();
|
||||
|
||||
void nest();
|
||||
|
||||
private slots:
|
||||
void zoom_in();
|
||||
void zoom_out();
|
||||
|
||||
Reference in New Issue
Block a user