diff --git a/qrenderdoc/Code/Interface/QRDInterface.h b/qrenderdoc/Code/Interface/QRDInterface.h index 81ccecb97..27a044f49 100644 --- a/qrenderdoc/Code/Interface/QRDInterface.h +++ b/qrenderdoc/Code/Interface/QRDInterface.h @@ -286,6 +286,17 @@ This may not be possible on all OSs, so the function is not guaranteed to succee )"); virtual void BringToFront() = 0; + DOCUMENT(R"(Prompt the user to close the currently open capture file. This will go through the +normal workflow and ask the user to save any unsaved capture. + +If no capture is open, this function returns True immediately. + +:return: True if no capture was open, or if it was successfully closed. False if the capture is + still open due to user interactions. +:rtype: bool +)"); + virtual bool PromptCloseCapture() = 0; + protected: IMainWindow() = default; ~IMainWindow() = default; diff --git a/qrenderdoc/Code/pyrenderdoc/PythonInvokers.cpp b/qrenderdoc/Code/pyrenderdoc/PythonInvokers.cpp index c5adacbc3..60c8e6bb0 100644 --- a/qrenderdoc/Code/pyrenderdoc/PythonInvokers.cpp +++ b/qrenderdoc/Code/pyrenderdoc/PythonInvokers.cpp @@ -797,6 +797,7 @@ struct IMainWindowInvoker : UIThreadInvoker return InvokeVoidFunction(&IMainWindow::UnregisterShortcut, shortcut, widget); } void BringToFront() { return InvokeVoidFunction(&IMainWindow::BringToFront); } + bool PromptCloseCapture() { return InvokeRetFunction(&IMainWindow::PromptCloseCapture); } }; struct IEventBrowserInvoker : UIThreadInvoker diff --git a/qrenderdoc/Windows/MainWindow.h b/qrenderdoc/Windows/MainWindow.h index fe6ca81e5..88ef24749 100644 --- a/qrenderdoc/Windows/MainWindow.h +++ b/qrenderdoc/Windows/MainWindow.h @@ -84,6 +84,7 @@ public: void RegisterShortcut(const rdcstr &shortcut, QWidget *widget, ShortcutCallback callback) override; void UnregisterShortcut(const rdcstr &shortcut, QWidget *widget) override; void BringToFront() override; + bool PromptCloseCapture() override; // ICaptureViewer void OnCaptureLoaded() override; @@ -118,7 +119,6 @@ public: void ShowLiveCapture(LiveCapture *live); void LiveCaptureClosed(LiveCapture *live); - bool PromptCloseCapture(); bool PromptSaveCaptureAs(); bool SaveCurrentCapture(QString saveFilename); diff --git a/qrenderdoc/qrenderdoc_local.vcxproj b/qrenderdoc/qrenderdoc_local.vcxproj index a42d4f6bd..154de4f83 100644 --- a/qrenderdoc/qrenderdoc_local.vcxproj +++ b/qrenderdoc/qrenderdoc_local.vcxproj @@ -588,7 +588,9 @@ - + + /bigobj %(AdditionalOptions) +