Expose proper capture closing function to python extensions

This commit is contained in:
baldurk
2026-08-28 15:46:23 +01:00
parent 6237238cf7
commit 81bec684a3
4 changed files with 16 additions and 2 deletions
+11
View File
@@ -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;
@@ -797,6 +797,7 @@ struct IMainWindowInvoker : UIThreadInvoker<IMainWindow>
return InvokeVoidFunction(&IMainWindow::UnregisterShortcut, shortcut, widget);
}
void BringToFront() { return InvokeVoidFunction(&IMainWindow::BringToFront); }
bool PromptCloseCapture() { return InvokeRetFunction<bool>(&IMainWindow::PromptCloseCapture); }
};
struct IEventBrowserInvoker : UIThreadInvoker<IEventBrowser>
+1 -1
View File
@@ -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);
+3 -1
View File
@@ -588,7 +588,9 @@
</ClCompile>
<ClCompile Include="Code\qprocessinfo.cpp" />
<ClCompile Include="Code\pyrenderdoc\PythonContext.cpp" />
<ClCompile Include="Code\pyrenderdoc\PythonInvokers.cpp" />
<ClCompile Include="Code\pyrenderdoc\PythonInvokers.cpp">
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<ClCompile Include="Code\QRDUtils.cpp" />
<ClCompile Include="Code\MiniQtHelper.cpp" />
<ClCompile Include="Code\Resources.cpp" />