2014-09-14 13:03:07 -06:00
|
|
|
// Copyright 2014 Dolphin Emulator Project
|
2015-05-17 17:08:10 -06:00
|
|
|
// Licensed under GPLv2+
|
2014-09-14 13:03:07 -06:00
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QDesktopServices>
|
|
|
|
#include <QFile>
|
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QSysInfo>
|
|
|
|
#include <QUrl>
|
|
|
|
|
|
|
|
#include "MainWindow.h"
|
|
|
|
|
2014-10-18 09:07:17 -06:00
|
|
|
#include "DolphinQt/Utils/Utils.h"
|
|
|
|
#include "UICommon/UICommon.h"
|
|
|
|
|
2014-09-14 13:03:07 -06:00
|
|
|
static bool IsOsSupported()
|
|
|
|
{
|
|
|
|
#ifdef Q_OS_OSX
|
2014-11-19 12:49:56 -07:00
|
|
|
return QSysInfo::MacintoshVersion >= QSysInfo::MV_10_9;
|
2014-09-14 13:03:07 -06:00
|
|
|
#elif defined(Q_OS_WIN)
|
|
|
|
return (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based) >= QSysInfo::WV_VISTA;
|
|
|
|
#else
|
|
|
|
return true;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static QString LowestSupportedOsVersion()
|
|
|
|
{
|
|
|
|
#ifdef Q_OS_OSX
|
2014-11-19 12:49:56 -07:00
|
|
|
return SL("Mac OS X 10.9");
|
2014-09-14 13:03:07 -06:00
|
|
|
#elif defined(Q_OS_WIN)
|
2014-10-18 09:07:17 -06:00
|
|
|
return SL("Windows Vista SP2");
|
2014-09-14 13:03:07 -06:00
|
|
|
#else
|
2014-10-18 09:07:17 -06:00
|
|
|
return SL("Unknown");
|
2014-09-14 13:03:07 -06:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
QApplication app(argc, argv);
|
2014-10-27 11:11:55 -06:00
|
|
|
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
2014-09-14 13:03:07 -06:00
|
|
|
// TODO: Add command line options
|
|
|
|
|
2015-02-25 02:23:42 -07:00
|
|
|
UICommon::SetUserDirectory(""); // Auto-detect user folder
|
2014-10-18 09:07:17 -06:00
|
|
|
UICommon::CreateDirectories();
|
|
|
|
UICommon::Init();
|
|
|
|
|
2014-09-14 13:03:07 -06:00
|
|
|
if (!IsOsSupported())
|
|
|
|
{
|
|
|
|
QMessageBox::critical(nullptr, QObject::tr("Unsupported OS"),
|
|
|
|
QObject::tr("Dolphin requires %1 or greater.\n"
|
|
|
|
"Please upgrade to %1 or greater to use Dolphin.")
|
|
|
|
.arg(LowestSupportedOsVersion()));
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2014-11-02 11:53:48 -07:00
|
|
|
g_main_window = new DMainWindow();
|
|
|
|
g_main_window->show();
|
2014-09-14 13:03:07 -06:00
|
|
|
|
2014-10-18 09:07:17 -06:00
|
|
|
int retcode = app.exec();
|
2014-11-02 11:53:48 -07:00
|
|
|
delete g_main_window;
|
2014-10-18 09:07:17 -06:00
|
|
|
UICommon::Shutdown();
|
|
|
|
return retcode;
|
2014-09-14 13:03:07 -06:00
|
|
|
}
|