mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-26 17:18:41 +02:00
Code to make dialogs early on work in wxWidgets 3.0.1.
A complication is that the 'OnEventLoopEnter()' gets called many times, so we need to only call FinishInits() once. There is something else not right with the dialog this early on, so for now I have moved it back into the OnAppInit() which works on both wx2.8.12 and 3.0.1.
This commit is contained in:
parent
44808022e1
commit
0e659f4cf0
@ -1175,6 +1175,18 @@ bool AudacityApp::OnInit()
|
||||
return false;
|
||||
}
|
||||
|
||||
//JKC We'd like to initialise the module manager WHILE showing the splash screen.
|
||||
//Can't in wx3.0.1 as MultiDialog interacts poorly with the splash screen. So we do it before.
|
||||
//TODO: Find out why opening a multidialog wrecks the splash screen.
|
||||
//best current guess is that it's something to do with doing a DoModal this early
|
||||
//in the program.
|
||||
|
||||
// Initialize the CommandHandler
|
||||
InitCommandHandler();
|
||||
// Initialize the ModuleManager, including loading found modules
|
||||
ModuleManager::Initialize(*mCmdHandler);
|
||||
|
||||
|
||||
#if !wxCHECK_VERSION(3, 0, 0)
|
||||
FinishInits();
|
||||
#endif
|
||||
@ -1182,10 +1194,15 @@ bool AudacityApp::OnInit()
|
||||
}
|
||||
|
||||
#if wxCHECK_VERSION(3, 0, 0)
|
||||
#include <wx/evtloop.h>
|
||||
static bool bInitsDone = false;
|
||||
void AudacityApp::OnEventLoopEnter(wxEventLoopBase * pLoop)
|
||||
{
|
||||
if( !pLoop->IsMain() )
|
||||
return;
|
||||
if (bInitsDone)
|
||||
return;
|
||||
bInitsDone = true;
|
||||
FinishInits();
|
||||
}
|
||||
#endif
|
||||
@ -1196,8 +1213,11 @@ void AudacityApp::OnEventLoopEnter(wxEventLoopBase * pLoop)
|
||||
// This change was to support wxWidgets 3.0.0 and allow us
|
||||
// to show a dialog (for module loading) during initialisation.
|
||||
// without it messing up the splash screen.
|
||||
// Hasn't actually fixed that yet, but is addressing the point
|
||||
// they make in thei rrelease notes.
|
||||
void AudacityApp::FinishInits()
|
||||
{
|
||||
|
||||
// BG: Create a temporary window to set as the top window
|
||||
wxImage logoimage((const char **) AudacityLogoWithName_xpm);
|
||||
logoimage.Rescale(logoimage.GetWidth() / 2, logoimage.GetHeight() / 2);
|
||||
@ -1216,19 +1236,7 @@ void AudacityApp::FinishInits()
|
||||
SetTopWindow(temporarywindow);
|
||||
|
||||
|
||||
|
||||
//JKC We'd like to initialise the module manager WHILE showing the splash screen.
|
||||
//Can't as MultiDialog interacts poorly with the splash screen. So we do it before.
|
||||
//TODO: Find out why opening a multidialog wrecks the splash screen.
|
||||
//best current guess is that it's something to do with doing a DoModal this early
|
||||
//in the program.
|
||||
|
||||
// Initialize the CommandHandler
|
||||
InitCommandHandler();
|
||||
// Initialize the ModuleManager, including loading found modules
|
||||
ModuleManager::Initialize(*mCmdHandler);
|
||||
|
||||
|
||||
//JKC: Would like to put module loading here.
|
||||
|
||||
// More initialization
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user