[*] Console exit must be called last in case any unexpected error occurs during deinitialization
[*] Fix up wxwidgets
This commit is contained in:
parent
b9da9c313e
commit
5676ef84fb
@ -87,7 +87,9 @@ private:
|
||||
void OnAbout(wxCommandEvent &event);
|
||||
void OnBugWrite(wxCommandEvent &event);
|
||||
void OnInit(wxWindowCreateEvent &event);
|
||||
void OnShow(wxWindowCreateEvent &event);
|
||||
void OnCmd(wxCommandEvent &event);
|
||||
void OnPump(wxTimerEvent& event);
|
||||
|
||||
WxSplitterLine *NewSplitter(wxSize splitter, wxColor color);
|
||||
|
||||
@ -97,6 +99,7 @@ private:
|
||||
wxMenuBar *menuBar_;
|
||||
wxBoxSizer *sizer_;
|
||||
AuList<WxSplitterLine *> _splitters;
|
||||
wxTimer timer_;
|
||||
};
|
||||
|
||||
enum
|
||||
@ -289,11 +292,12 @@ ConsoleFrame::ConsoleFrame(const wxString &title, const wxPoint &pos, const wxSi
|
||||
commandbox_->SetBackgroundColour(wxColour(0, 0, 0));
|
||||
commandbox_->SetForegroundColour(wxColour(255, 255, 255));
|
||||
|
||||
this->Connect(wxEVT_SHOW, wxWindowCreateEventHandler(ConsoleFrame::OnInit));
|
||||
//this->Connect(wxEVT_SHOW, wxWindowCreateEventHandler(ConsoleFrame::OnShow));
|
||||
}
|
||||
|
||||
commandbox_->SetHint("Type a command here");
|
||||
commandbox_->Connect(wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler(ConsoleFrame::OnCmd));
|
||||
//commandbox_->Bind(wxEVT_COMMAND_TEXT_ENTER, &ConsoleFrame::OnCmd, commandbox_);
|
||||
|
||||
sizer_ = _new wxBoxSizer(wxVERTICAL);
|
||||
if (!sizer_) return;
|
||||
@ -314,6 +318,8 @@ ConsoleFrame::ConsoleFrame(const wxString &title, const wxPoint &pos, const wxSi
|
||||
SetSizer(sizer_);
|
||||
SetMenuBar(menuBar_);
|
||||
|
||||
timer_.Bind(wxEVT_TIMER, &ConsoleFrame::OnPump, this);
|
||||
timer_.Start(100);
|
||||
gWxConsoleReady = true;
|
||||
}
|
||||
|
||||
@ -327,6 +333,11 @@ static bool DarkModeEnabled()
|
||||
}
|
||||
|
||||
void ConsoleFrame::OnInit(wxWindowCreateEvent &event)
|
||||
{
|
||||
OnShow(event);
|
||||
}
|
||||
|
||||
void ConsoleFrame::OnShow(wxWindowCreateEvent &event)
|
||||
{
|
||||
if (!DarkModeEnabled()) return;
|
||||
|
||||
@ -344,6 +355,12 @@ void ConsoleFrame::OnInit(wxWindowCreateEvent &event)
|
||||
}
|
||||
|
||||
#else
|
||||
void ConsoleFrame::OnInit(wxWindowCreateEvent &event)
|
||||
{}
|
||||
|
||||
void ConsoleFrame::OnShow(wxWindowCreateEvent &event)
|
||||
{}
|
||||
|
||||
static bool DarkModeEnabled()
|
||||
{
|
||||
return Aurora::Build::EPlatform == Aurora::Build::EPlatform::kPlatformLinux;
|
||||
@ -370,6 +387,15 @@ void ConsoleFrame::OnBugWrite(wxCommandEvent &event)
|
||||
Aurora::Processes::OpenUri(gRuntimeConfig.console.supportInternal);
|
||||
}
|
||||
|
||||
namespace Aurora::Console::ConsoleWxWidgets
|
||||
{
|
||||
static void WxWidgetsPump();
|
||||
}
|
||||
|
||||
void ConsoleFrame::OnPump(wxTimerEvent &event)
|
||||
{
|
||||
Aurora::Console::ConsoleWxWidgets::WxWidgetsPump();
|
||||
}
|
||||
|
||||
namespace Aurora::Console::ConsoleWxWidgets
|
||||
{
|
||||
@ -397,10 +423,6 @@ namespace Aurora::Console::ConsoleWxWidgets
|
||||
|
||||
static bool WxWidgetsInit()
|
||||
{
|
||||
#if defined(AURORA_PLATFORM_WIN32)
|
||||
Aurora::Extensions::Win32::InitDarkMode();
|
||||
#endif
|
||||
|
||||
wxApp::SetInstance(_new ConsoleApp());
|
||||
|
||||
#if defined(AURORA_PLATFORM_WIN32) || true
|
||||
@ -536,6 +558,7 @@ namespace Aurora::Console::ConsoleWxWidgets
|
||||
|
||||
void Pump()
|
||||
{
|
||||
#if 0
|
||||
Aurora::Threading::LockGuardPtr re(gMutex.get());
|
||||
|
||||
if (!gWxConsoleReady) return;
|
||||
@ -544,6 +567,7 @@ namespace Aurora::Console::ConsoleWxWidgets
|
||||
{
|
||||
WxWidgetsPump();
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
void Exit()
|
||||
|
@ -17,9 +17,16 @@
|
||||
#include "Hashing/Hashing.hpp"
|
||||
#include "Debug/Debug.hpp"
|
||||
#include "Async/Async.hpp"
|
||||
#if defined(AURORA_PLATFORM_WIN32)
|
||||
#include "Extensions/Win32/DarkTheme.hpp"
|
||||
#endif
|
||||
|
||||
static void Init()
|
||||
{
|
||||
#if defined(AURORA_PLATFORM_WIN32)
|
||||
Aurora::Extensions::Win32::InitDarkMode();
|
||||
#endif
|
||||
|
||||
Crypto::InitCrypto();
|
||||
Aurora::Console::Init();
|
||||
Aurora::IO::FS::InitResources();
|
||||
@ -40,8 +47,8 @@ static void Pump()
|
||||
static void Deinit()
|
||||
{
|
||||
Aurora::RNG::Release();
|
||||
Aurora::Console::Exit();
|
||||
Aurora::Async::ShutdownAsync();
|
||||
Aurora::Console::Exit();
|
||||
}
|
||||
|
||||
namespace Aurora
|
||||
|
@ -125,7 +125,7 @@ namespace Aurora::Extensions::Win32
|
||||
DWORD major, minor;
|
||||
RtlGetNtVersionNumbers(&major, &minor, &g_buildNumber);
|
||||
g_buildNumber &= ~0xF0000000;
|
||||
if (major != 10 || minor != 0 || !CheckBuildNumber(g_buildNumber))
|
||||
if (major != 10 || minor != 0)// || !CheckBuildNumber(g_buildNumber))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user