mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-15 15:49:36 +02:00
Bug 1927 - Help > Generate Support Data has very confusing behavior
This commit is contained in:
parent
907e830070
commit
52acaf6031
@ -40,51 +40,52 @@ void Generate(wxDebugReport::Context ctx)
|
|||||||
// latter.
|
// latter.
|
||||||
// rpt.AddAll(ctx);
|
// rpt.AddAll(ctx);
|
||||||
|
|
||||||
// Provides a progress dialog with indeterminate mode
|
|
||||||
wxGenericProgressDialog pd(XO("Audacity Support Data").Translation(),
|
|
||||||
XO("This may take several seconds").Translation(),
|
|
||||||
300000, // range
|
|
||||||
nullptr, // parent
|
|
||||||
wxPD_APP_MODAL | wxPD_ELAPSED_TIME | wxPD_SMOOTH);
|
|
||||||
|
|
||||||
std::atomic_bool done = {false};
|
|
||||||
auto thread = std::thread([&]
|
|
||||||
{
|
{
|
||||||
wxFileNameWrapper fn{ FileNames::DataDir(), wxT("audacity.cfg") };
|
// Provides a progress dialog with indeterminate mode
|
||||||
rpt.AddFile(fn.GetFullPath(), _TS("Audacity Configuration"));
|
wxGenericProgressDialog pd(XO("Audacity Support Data").Translation(),
|
||||||
rpt.AddFile(FileNames::PluginRegistry(), wxT("Plugin Registry"));
|
XO("This may take several seconds").Translation(),
|
||||||
rpt.AddFile(FileNames::PluginSettings(), wxT("Plugin Settings"));
|
300000, // range
|
||||||
|
nullptr, // parent
|
||||||
if (ctx == wxDebugReport::Context_Current)
|
wxPD_APP_MODAL | wxPD_ELAPSED_TIME | wxPD_SMOOTH);
|
||||||
|
|
||||||
|
std::atomic_bool done = {false};
|
||||||
|
auto thread = std::thread([&]
|
||||||
{
|
{
|
||||||
auto saveLang = GUIPrefs::GetLangShort();
|
wxFileNameWrapper fn{ FileNames::DataDir(), wxT("audacity.cfg") };
|
||||||
GUIPrefs::InitLang( wxT("en") );
|
rpt.AddFile(fn.GetFullPath(), _TS("Audacity Configuration"));
|
||||||
auto cleanup = finally( [&]{ GUIPrefs::InitLang( saveLang ); } );
|
rpt.AddFile(FileNames::PluginRegistry(), wxT("Plugin Registry"));
|
||||||
|
rpt.AddFile(FileNames::PluginSettings(), wxT("Plugin Settings"));
|
||||||
|
|
||||||
|
if (ctx == wxDebugReport::Context_Current)
|
||||||
|
{
|
||||||
|
auto saveLang = GUIPrefs::GetLangShort();
|
||||||
|
GUIPrefs::InitLang( wxT("en") );
|
||||||
|
auto cleanup = finally( [&]{ GUIPrefs::InitLang( saveLang ); } );
|
||||||
|
|
||||||
auto gAudioIO = AudioIOBase::Get();
|
auto gAudioIO = AudioIOBase::Get();
|
||||||
rpt.AddText(wxT("audiodev.txt"), gAudioIO->GetDeviceInfo(), wxT("Audio Device Info"));
|
rpt.AddText(wxT("audiodev.txt"), gAudioIO->GetDeviceInfo(), wxT("Audio Device Info"));
|
||||||
#ifdef EXPERIMENTAL_MIDI_OUT
|
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||||
rpt.AddText(wxT("mididev.txt"), gAudioIO->GetMidiDeviceInfo(), wxT("MIDI Device Info"));
|
rpt.AddText(wxT("mididev.txt"), gAudioIO->GetMidiDeviceInfo(), wxT("MIDI Device Info"));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
auto logger = AudacityLogger::Get();
|
auto logger = AudacityLogger::Get();
|
||||||
if (logger)
|
if (logger)
|
||||||
|
{
|
||||||
|
rpt.AddText(wxT("log.txt"), logger->GetLog(), _TS("Audacity Log"));
|
||||||
|
}
|
||||||
|
|
||||||
|
done = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Wait for information to be gathered
|
||||||
|
while (!done)
|
||||||
{
|
{
|
||||||
rpt.AddText(wxT("log.txt"), logger->GetLog(), _TS("Audacity Log"));
|
wxMilliSleep(50);
|
||||||
|
pd.Pulse();
|
||||||
}
|
}
|
||||||
|
thread.join();
|
||||||
done = true;
|
|
||||||
});
|
|
||||||
|
|
||||||
// Wait for information to be gathered
|
|
||||||
while (!done)
|
|
||||||
{
|
|
||||||
wxMilliSleep(50);
|
|
||||||
pd.Pulse();
|
|
||||||
}
|
}
|
||||||
thread.join();
|
|
||||||
|
|
||||||
|
|
||||||
bool ok = wxDebugReportPreviewStd().Show(rpt);
|
bool ok = wxDebugReportPreviewStd().Show(rpt);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user