Main: Move unofficial build check to its own function
Removes the need to explicitly call exit.
This commit is contained in:
parent
aafae49d24
commit
14ae1d23cf
|
@ -96,7 +96,7 @@ bool DolphinApp::Initialize(int& c, wxChar **v)
|
||||||
|
|
||||||
bool DolphinApp::OnInit()
|
bool DolphinApp::OnInit()
|
||||||
{
|
{
|
||||||
if (!wxApp::OnInit())
|
if (!wxApp::OnInit() || DolphinEmulatorDotComTextFileExists())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Bind(wxEVT_QUERY_END_SESSION, &DolphinApp::OnEndSession, this);
|
Bind(wxEVT_QUERY_END_SESSION, &DolphinApp::OnEndSession, this);
|
||||||
|
@ -131,20 +131,6 @@ bool DolphinApp::OnInit()
|
||||||
int w = SConfig::GetInstance().iWidth;
|
int w = SConfig::GetInstance().iWidth;
|
||||||
int h = SConfig::GetInstance().iHeight;
|
int h = SConfig::GetInstance().iHeight;
|
||||||
|
|
||||||
if (File::Exists("www.dolphin-emulator.com.txt"))
|
|
||||||
{
|
|
||||||
File::Delete("www.dolphin-emulator.com.txt");
|
|
||||||
wxMessageDialog dlg(nullptr, _(
|
|
||||||
"This version of Dolphin was downloaded from a website stealing money from developers of the emulator. Please "
|
|
||||||
"download Dolphin from the official website instead: https://dolphin-emu.org/"),
|
|
||||||
_("Unofficial version detected"), wxOK | wxICON_WARNING);
|
|
||||||
dlg.ShowModal();
|
|
||||||
|
|
||||||
wxLaunchDefaultBrowser("https://dolphin-emu.org/?ref=badver");
|
|
||||||
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// The following is not needed with X11, where window managers
|
// The following is not needed with X11, where window managers
|
||||||
// do not allow windows to be created off the desktop.
|
// do not allow windows to be created off the desktop.
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -256,7 +242,6 @@ bool DolphinApp::OnCmdLineParsed(wxCmdLineParser& parser)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
void DolphinApp::MacOpenFile(const wxString& fileName)
|
void DolphinApp::MacOpenFile(const wxString& fileName)
|
||||||
{
|
{
|
||||||
|
@ -266,6 +251,23 @@ void DolphinApp::MacOpenFile(const wxString& fileName)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
bool DolphinApp::DolphinEmulatorDotComTextFileExists()
|
||||||
|
{
|
||||||
|
if (!File::Exists("www.dolphin-emulator.com.txt"))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
File::Delete("www.dolphin-emulator.com.txt");
|
||||||
|
wxMessageDialog dlg(nullptr, _(
|
||||||
|
"This version of Dolphin was downloaded from a website stealing money from developers of the emulator. Please "
|
||||||
|
"download Dolphin from the official website instead: https://dolphin-emu.org/"),
|
||||||
|
_("Unofficial version detected"), wxOK | wxICON_WARNING);
|
||||||
|
dlg.ShowModal();
|
||||||
|
|
||||||
|
wxLaunchDefaultBrowser("https://dolphin-emu.org/?ref=badver");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void DolphinApp::AfterInit()
|
void DolphinApp::AfterInit()
|
||||||
{
|
{
|
||||||
if (!m_batch_mode)
|
if (!m_batch_mode)
|
||||||
|
|
|
@ -32,6 +32,7 @@ private:
|
||||||
void OnEndSession(wxCloseEvent& event);
|
void OnEndSession(wxCloseEvent& event);
|
||||||
void InitLanguageSupport();
|
void InitLanguageSupport();
|
||||||
void AfterInit();
|
void AfterInit();
|
||||||
|
static bool DolphinEmulatorDotComTextFileExists();
|
||||||
|
|
||||||
bool m_batch_mode = false;
|
bool m_batch_mode = false;
|
||||||
bool m_load_file = false;
|
bool m_load_file = false;
|
||||||
|
|
Loading…
Reference in New Issue