mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-24 22:55:41 +00:00
Add Tools Menu Option for externally referenced dependent files
"Embed external files into Capture" "Remove external files from Capture"
This commit is contained in:
@@ -131,6 +131,8 @@ MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Mai
|
||||
|
||||
setAcceptDrops(true);
|
||||
|
||||
QObject::connect(ui->menu_Tools, &QMenu::aboutToShow, this, &MainWindow::updateToolsMenuOptions);
|
||||
|
||||
QObject::connect(ui->action_Load_Default_Layout, &QAction::triggered, this,
|
||||
&MainWindow::loadLayout_triggered);
|
||||
QObject::connect(ui->action_Load_Layout_1, &QAction::triggered, this,
|
||||
@@ -445,6 +447,8 @@ MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Mai
|
||||
ui->action_Resolve_Symbols->setText(tr("Resolve Symbols"));
|
||||
|
||||
ui->action_Recompress_Capture->setEnabled(false);
|
||||
ui->action_EmbedExternalFiles->setEnabled(false);
|
||||
ui->action_RemoveExternalFiles->setEnabled(false);
|
||||
|
||||
#if defined(Q_OS_WIN32)
|
||||
#define SELF_HOST_NAME "rdocself.dll"
|
||||
@@ -675,6 +679,8 @@ void MainWindow::captureModified()
|
||||
// enabled if this capture was a temporary one
|
||||
if(m_Ctx.IsCaptureLoaded())
|
||||
ui->action_Save_Capture_Inplace->setEnabled(true);
|
||||
|
||||
updateToolsMenuOptions();
|
||||
}
|
||||
|
||||
void MainWindow::LoadFromFilename(const QString &filename, bool temporary)
|
||||
@@ -2238,6 +2244,8 @@ void MainWindow::OnCaptureLoaded()
|
||||
bool is_image = driver == lit("Image");
|
||||
ui->action_Recompress_Capture->setEnabled(!is_image);
|
||||
|
||||
updateToolsMenuOptions();
|
||||
|
||||
ui->action_Start_Replay_Loop->setEnabled(true);
|
||||
ui->action_Open_RGP_Profile->setEnabled(
|
||||
m_Ctx.Replay().GetCaptureAccess()->FindSectionByType(SectionType::AMDRGPProfile) >= 0);
|
||||
@@ -2286,6 +2294,8 @@ void MainWindow::OnCaptureClosed()
|
||||
ui->action_Resolve_Symbols->setText(tr("Resolve Symbols"));
|
||||
|
||||
ui->action_Recompress_Capture->setEnabled(false);
|
||||
ui->action_EmbedExternalFiles->setEnabled(false);
|
||||
ui->action_RemoveExternalFiles->setEnabled(false);
|
||||
|
||||
SetTitle();
|
||||
|
||||
@@ -2638,6 +2648,16 @@ void MainWindow::on_action_Recompress_Capture_triggered()
|
||||
m_Ctx.RecompressCapture();
|
||||
}
|
||||
|
||||
void MainWindow::on_action_EmbedExternalFiles_triggered()
|
||||
{
|
||||
m_Ctx.EmbedDependentFiles();
|
||||
}
|
||||
|
||||
void MainWindow::on_action_RemoveExternalFiles_triggered()
|
||||
{
|
||||
m_Ctx.RemoveDependentFiles();
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Start_Replay_Loop_triggered()
|
||||
{
|
||||
if(!m_Ctx.IsCaptureLoaded())
|
||||
@@ -2995,6 +3015,21 @@ void MainWindow::loadLayout_triggered()
|
||||
LoadSaveLayout(qobject_cast<QAction *>(QObject::sender()), false);
|
||||
}
|
||||
|
||||
void MainWindow::updateToolsMenuOptions()
|
||||
{
|
||||
bool hasEmbeddedDependencies = false;
|
||||
bool hasPendingDependencies = false;
|
||||
|
||||
if(m_Ctx.Replay().GetCaptureAccess())
|
||||
{
|
||||
hasEmbeddedDependencies = m_Ctx.Replay().GetCaptureAccess()->HasEmbeddedDependencies();
|
||||
hasPendingDependencies = m_Ctx.Replay().GetCaptureAccess()->HasPendingDependencies();
|
||||
}
|
||||
|
||||
ui->action_EmbedExternalFiles->setEnabled(!hasEmbeddedDependencies && hasPendingDependencies);
|
||||
ui->action_RemoveExternalFiles->setEnabled(hasEmbeddedDependencies);
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if(RENDERDOC_IsGlobalHookActive())
|
||||
|
||||
@@ -168,6 +168,8 @@ private slots:
|
||||
void on_action_Inject_into_Process_triggered();
|
||||
void on_action_Resolve_Symbols_triggered();
|
||||
void on_action_Recompress_Capture_triggered();
|
||||
void on_action_EmbedExternalFiles_triggered();
|
||||
void on_action_RemoveExternalFiles_triggered();
|
||||
void on_action_Start_Replay_Loop_triggered();
|
||||
void on_action_Open_RGP_Profile_triggered();
|
||||
void on_action_Create_RGP_Profile_triggered();
|
||||
@@ -194,6 +196,7 @@ private slots:
|
||||
void statusDoubleClicked(QMouseEvent *event);
|
||||
void switchContext();
|
||||
void contextChooser_menuShowing();
|
||||
void updateToolsMenuOptions();
|
||||
|
||||
void ClearRecentCaptureFiles();
|
||||
void ClearRecentCaptureSettings();
|
||||
|
||||
@@ -51,6 +51,8 @@
|
||||
</property>
|
||||
<addaction name="action_Resolve_Symbols"/>
|
||||
<addaction name="action_Recompress_Capture"/>
|
||||
<addaction name="action_EmbedExternalFiles"/>
|
||||
<addaction name="action_RemoveExternalFiles"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="action_Start_Replay_Loop"/>
|
||||
<addaction name="action_Create_RGP_Profile"/>
|
||||
@@ -450,6 +452,16 @@
|
||||
<string>Re&compress Capture</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_EmbedExternalFiles">
|
||||
<property name="text">
|
||||
<string>Embed external files into Capture</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_RemoveExternalFiles">
|
||||
<property name="text">
|
||||
<string>Remove external files from Capture</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Clear_Reported_Bugs">
|
||||
<property name="text">
|
||||
<string>&Clear Reported Bugs</string>
|
||||
|
||||
Reference in New Issue
Block a user