2015-11-27 01:33:07 -07:00
|
|
|
// Copyright 2015 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2+
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2016-05-11 19:18:30 -06:00
|
|
|
#include <QAbstractEventDispatcher>
|
2015-11-27 01:33:07 -07:00
|
|
|
#include <QApplication>
|
|
|
|
|
|
|
|
#include "Core/BootManager.h"
|
|
|
|
#include "Core/Core.h"
|
|
|
|
#include "DolphinQt2/Host.h"
|
2016-07-12 23:52:45 -06:00
|
|
|
#include "DolphinQt2/InDevelopmentWarning.h"
|
2015-11-27 01:33:07 -07:00
|
|
|
#include "DolphinQt2/MainWindow.h"
|
|
|
|
#include "DolphinQt2/Resources.h"
|
2016-07-12 23:52:45 -06:00
|
|
|
#include "DolphinQt2/Settings.h"
|
2015-11-27 01:33:07 -07:00
|
|
|
#include "UICommon/UICommon.h"
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
2016-06-24 02:43:46 -06:00
|
|
|
QApplication app(argc, argv);
|
2015-11-27 01:33:07 -07:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
UICommon::SetUserDirectory("");
|
|
|
|
UICommon::CreateDirectories();
|
|
|
|
UICommon::Init();
|
|
|
|
Resources::Init();
|
2015-11-27 01:33:07 -07:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
// Whenever the event loop is about to go to sleep, dispatch the jobs
|
|
|
|
// queued in the Core first.
|
|
|
|
QObject::connect(QAbstractEventDispatcher::instance(), &QAbstractEventDispatcher::aboutToBlock,
|
|
|
|
&app, &Core::HostDispatchJobs);
|
2016-05-11 19:18:30 -06:00
|
|
|
|
2016-07-12 23:52:45 -06:00
|
|
|
int retval = 0;
|
|
|
|
if (Settings().IsInDevelopmentWarningEnabled())
|
|
|
|
{
|
|
|
|
InDevelopmentWarning warning_box;
|
|
|
|
retval = warning_box.exec() == QDialog::Rejected;
|
|
|
|
}
|
|
|
|
if (!retval)
|
|
|
|
{
|
|
|
|
MainWindow win;
|
|
|
|
win.show();
|
|
|
|
retval = app.exec();
|
|
|
|
}
|
2015-11-27 01:33:07 -07:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
BootManager::Stop();
|
|
|
|
Core::Shutdown();
|
|
|
|
UICommon::Shutdown();
|
|
|
|
Host::GetInstance()->deleteLater();
|
2015-11-27 01:33:07 -07:00
|
|
|
|
2016-06-24 02:43:46 -06:00
|
|
|
return retval;
|
2015-11-27 01:33:07 -07:00
|
|
|
}
|