projectexplorer: implement replace footage function
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
@@ -37,6 +38,7 @@
|
|||||||
#include "task/taskmanager.h"
|
#include "task/taskmanager.h"
|
||||||
#include "widget/menu/menu.h"
|
#include "widget/menu/menu.h"
|
||||||
#include "widget/menu/menushared.h"
|
#include "widget/menu/menushared.h"
|
||||||
|
#include "widget/nodeparamview/nodeparamviewundo.h"
|
||||||
#include "window/mainwindow/mainwindow.h"
|
#include "window/mainwindow/mainwindow.h"
|
||||||
#include "window/mainwindow/mainwindowundo.h"
|
#include "window/mainwindow/mainwindowundo.h"
|
||||||
#include "widget/nodeview/nodeviewundo.h"
|
#include "widget/nodeview/nodeviewundo.h"
|
||||||
@@ -392,6 +394,9 @@ void ProjectExplorer::ShowContextMenu()
|
|||||||
QAction* reveal_action = menu.addAction(reveal_text);
|
QAction* reveal_action = menu.addAction(reveal_text);
|
||||||
connect(reveal_action, &QAction::triggered, this, &ProjectExplorer::RevealSelectedFootage);
|
connect(reveal_action, &QAction::triggered, this, &ProjectExplorer::RevealSelectedFootage);
|
||||||
|
|
||||||
|
QAction *replace_action = menu.addAction(tr("Replace Footage"));
|
||||||
|
connect(replace_action, &QAction::triggered, this, &ProjectExplorer::ReplaceSelectedFootage);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
@@ -497,6 +502,17 @@ void ProjectExplorer::RevealSelectedFootage()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProjectExplorer::ReplaceSelectedFootage()
|
||||||
|
{
|
||||||
|
Footage* footage = static_cast<Footage*>(context_menu_items_.first());
|
||||||
|
|
||||||
|
QString file = QFileDialog::getOpenFileName(this, tr("Replace Footage"));
|
||||||
|
if (!file.isEmpty()) {
|
||||||
|
auto c = new NodeParamSetStandardValueCommand(NodeKeyframeTrackReference(NodeInput(footage, Footage::kFilenameInput)), file);
|
||||||
|
Core::instance()->undo_stack()->push(c);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ProjectExplorer::OpenContextMenuItemInNewTab()
|
void ProjectExplorer::OpenContextMenuItemInNewTab()
|
||||||
{
|
{
|
||||||
Core::instance()->main_window()->FolderOpen(project(), static_cast<Folder*>(context_menu_items_.first()), false);
|
Core::instance()->main_window()->FolderOpen(project(), static_cast<Folder*>(context_menu_items_.first()), false);
|
||||||
|
|||||||
@@ -185,6 +185,8 @@ private slots:
|
|||||||
|
|
||||||
void RevealSelectedFootage();
|
void RevealSelectedFootage();
|
||||||
|
|
||||||
|
void ReplaceSelectedFootage();
|
||||||
|
|
||||||
void OpenContextMenuItemInNewTab();
|
void OpenContextMenuItemInNewTab();
|
||||||
|
|
||||||
void OpenContextMenuItemInNewWindow();
|
void OpenContextMenuItemInNewWindow();
|
||||||
|
|||||||
Reference in New Issue
Block a user