added close media for #304
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user