Beispiel #1
0
	bool OnInit()
	{
		g_uiMainThreadId = Thread::BaseThread::GetCurrentThreadId();

		//needed for mfc loading otherwise it asserts out
		SetExitOnFrameDelete(true);

		wxWindow::MSWRegisterMessageHandler(WM_QUERYENDSESSION, &WindowsShutdown);
		wxWindow::MSWRegisterMessageHandler(WM_ENDSESSION, &WindowsShutdown);

		wxInitAllImageHandlers();

		InitManagers();
		InitLocalManagers();
		//InitLogging();

		ControllerForm* cf = new ControllerForm();

		if (!cf->init(argc, argv))
			return false;

		g_pMainApp = cf;
		//SetTopWindow(g_pMainApp);

		return true;
	}
Beispiel #2
0
void MainApp::Init(int argc, wxCmdLineArgsArray &argv)
{
	gcTrace("");

	if (argc > 0)
	{
		for (int x=0; x<argc; x++)
		{
			wxString str = argv[x].MakeLower();

			if (str == "-dgl")
				m_bQuiteMode = true;

			if (str.StartsWith("desura://"))
				m_szDesuraCache = gcString(argv[x].ToStdString());
		}
	}

	//char *comAppPath = nullptr;
	//UTIL::OS::getAppDataPath(&comAppPath);
	//UTIL::FS::recMakeFolder(comAppPath);
	//safe_delete(comAppPath);

	InitLogging();
	cc_PrintVersion();
	cc_CheckCert();
	Msg("Logging Has started\n");
	Msg("\n\n");

	InitManagers();
	InitLocalManagers();

	std::string val = UTIL::OS::getConfigValue(REGRUN);
	gc_autostart.setValue( val.size() > 0 );

	//because logging gets init first we need to man reg it
	RegLogWithWindow();

	//because logging gets init before managers we need to reapply the color scheme.
	LoggingapplyTheme();
	loadFrame(wxDEFAULT_FRAME_STYLE);

#ifndef NIX
	if (!m_bQuiteMode)
		m_wxTBIcon = new TaskBarIcon(this);
#endif
	m_wxTBIcon = nullptr;

	std::string szAppid = UTIL::OS::getConfigValue(APPID);

	uint32 appid = -1;

	if (szAppid.size() > 0)
		appid = Safe::atoi(szAppid.c_str());

	if (appid == BUILDID_BETA || appid == BUILDID_INTERNAL)
		gc_uploaddumps.setValue(true);
}