BugTrap icon indicating copy to clipboard operation
BugTrap copied to clipboard

Proposition: "Open Folder" mode

Open gaetandezeiraud opened this issue 1 year ago • 0 comments

Hi, this is just a proposition, before doing a PR or not. Like the Metro Exodus (4A studio) fork of BugTrap. Add an enum to allow BTA_SAVEREPORT WITH window (currently not possible). And a "Open Folder" button who open the BT_SetReportFilePath with Windows Explorer.

fatal-metro-exodus-error

So maybe a BTF_SAVEREPORT flag who do the same job than BTA_SAVEREPORT but with BTA_SHOWUI. Implementation example:

/**
 * @brief Perform BugTrap action (show dialog, submit report, etc.).
 */
static void ExecuteHandlerAction()
{
	if (g_eActivityType == BTA_SAVEREPORT)
	{
		SaveReport(NULL);
		return;
	}
	// Create temporary report file.
	BOOL bResult = CreateTempReport();
	if (bResult)
	{
		// Process remaining actions.
		switch (g_eActivityType)
		{
		case BTA_SHOWUI:
			if (g_pResManager)
			{
                                // HERE
				if (g_dwFlags & BTF_SAVEREPORT)
					SaveReport(NULL);
                                //

				DialogBox(g_hInstance, MAKEINTRESOURCE(IDD_SIMPLE_DLG), NULL, SimpleDlgProc);
			}
			break;
		case BTA_CUSTOM:
#ifdef _MANAGED
            NetThunks::FireCustomActivityEvent(g_szInternalReportFilePath);
#else
            if (g_pfnCustomActivityHandler != NULL)
                (*g_pfnCustomActivityHandler)(g_szInternalReportFilePath, g_nCustomActivityHandlerParam);
#endif // _MANAGED

			break;
		}
	}
	// Remove temporarily generated report files.
	DeleteTempReport();
}

For the "Open Folder". What is the best? A new flag to show it (and hide the submit button). Or BTF_SAVEREPORT flag also change the button automatically.

gaetandezeiraud avatar Apr 14 '23 09:04 gaetandezeiraud