From 8a59754bf8f5505d1cb046dcb79c10b032ceaa08 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 8 Jun 2017 18:23:23 +0100 Subject: [PATCH] Disable save/close capture menu items when there's no capture open --- qrenderdoc/Windows/MainWindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qrenderdoc/Windows/MainWindow.cpp b/qrenderdoc/Windows/MainWindow.cpp index d4028ea9a..12f96cad3 100644 --- a/qrenderdoc/Windows/MainWindow.cpp +++ b/qrenderdoc/Windows/MainWindow.cpp @@ -205,6 +205,9 @@ MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Mai m_Ctx.AddLogViewer(this); + ui->action_Save_Log->setEnabled(false); + ui->action_Close_Log->setEnabled(false); + QList actions = ui->menuBar->actions(); // register all the UI-designer created shortcut keys @@ -1233,6 +1236,9 @@ void MainWindow::statusDoubleClicked(QMouseEvent *event) void MainWindow::OnLogfileLoaded() { + ui->action_Save_Log->setEnabled(true); + ui->action_Close_Log->setEnabled(true); + // don't allow changing context while log is open contextChooser->setEnabled(false); @@ -1261,6 +1267,9 @@ void MainWindow::OnLogfileLoaded() void MainWindow::OnLogfileClosed() { + ui->action_Save_Log->setEnabled(false); + ui->action_Close_Log->setEnabled(false); + contextChooser->setEnabled(true); statusText->setText(QString());