added close media for #304

This commit is contained in:
itsmattkc
2019-01-12 01:17:12 +11:00
parent 587b3040d4
commit 462e7ba586
3 changed files with 14 additions and 0 deletions
+8
View File
@@ -90,6 +90,10 @@ bool Viewer::is_focused() {
|| btnSkipToEnd->hasFocus();
}
bool Viewer::is_main_sequence() {
return main_sequence;
}
void Viewer::set_main_sequence() {
clean_created_seq();
set_sequence(true, sequence);
@@ -260,6 +264,10 @@ void Viewer::go_to_end() {
if (seq != NULL) seek(seq->getEndFrame());
}
void Viewer::close_media() {
set_media(NULL);
}
void Viewer::go_to_in() {
if (seq != NULL) {
if (seq->using_workarea && seq->enable_workarea) {
+2
View File
@@ -29,6 +29,7 @@ public:
~Viewer();
bool is_focused();
bool is_main_sequence();
void set_main_sequence();
void set_media(Media *m);
void compose();
@@ -81,6 +82,7 @@ public slots:
void next_frame();
void go_to_out();
void go_to_end();
void close_media();
private slots:
void update_playhead();
+4
View File
@@ -109,6 +109,10 @@ void ViewerWidget::show_context_menu() {
connect(&zoom_menu, SIGNAL(triggered(QAction*)), this, SLOT(set_menu_zoom(QAction*)));
menu.addMenu(&zoom_menu);
if (!viewer->is_main_sequence()) {
menu.addAction("Close Media", viewer, SLOT(close_media()));
}
menu.exec(QCursor::pos());
}