2014-09-14 19:03:07 +00:00
|
|
|
// Copyright 2014 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// 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 15:07:17 +00:00
|
|
|
#include "DolphinQt/Utils/Utils.h"
|
|
|
|
#include "UICommon/UICommon.h"
|
|
|
|
|
2014-09-14 19:03:07 +00:00
|
|
|
static bool IsOsSupported()
|
|
|
|
{
|
|
|
|
#ifdef Q_OS_OSX
|
2014-09-15 00:44:07 +00:00
|
|
|
return QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7;
|
2014-09-14 19:03:07 +00: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-10-18 15:07:17 +00:00
|
|
|
return SL("Mac OS X 10.7");
|
2014-09-14 19:03:07 +00:00
|
|
|
#elif defined(Q_OS_WIN)
|
2014-10-18 15:07:17 +00:00
|
|
|
return SL("Windows Vista SP2");
|
2014-09-14 19:03:07 +00:00
|
|
|
#else
|
2014-10-18 15:07:17 +00:00
|
|
|
return SL("Unknown");
|
2014-09-14 19:03:07 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
{
|
|
|
|
QApplication app(argc, argv);
|
|
|
|
// TODO: Add command line options
|
|
|
|
|
2014-10-18 15:07:17 +00:00
|
|
|
UICommon::CreateDirectories();
|
|
|
|
UICommon::Init();
|
|
|
|
|
2014-09-14 19:03:07 +00: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;
|
|
|
|
}
|
|
|
|
|
|
|
|
DMainWindow w;
|
|
|
|
w.show();
|
|
|
|
|
2014-10-18 15:07:17 +00:00
|
|
|
int retcode = app.exec();
|
|
|
|
UICommon::Shutdown();
|
|
|
|
return retcode;
|
2014-09-14 19:03:07 +00:00
|
|
|
}
|