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-11-19 19:49:56 +00:00
|
|
|
return QSysInfo::MacintoshVersion >= QSysInfo::MV_10_9;
|
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-11-19 19:49:56 +00:00
|
|
|
return SL("Mac OS X 10.9");
|
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);
|
2014-10-27 17:11:55 +00:00
|
|
|
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
|
2014-09-14 19:03:07 +00:00
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
2014-11-02 18:53:48 +00:00
|
|
|
g_main_window = new DMainWindow();
|
|
|
|
g_main_window->show();
|
2014-09-14 19:03:07 +00:00
|
|
|
|
2014-10-18 15:07:17 +00:00
|
|
|
int retcode = app.exec();
|
2014-11-02 18:53:48 +00:00
|
|
|
delete g_main_window;
|
2014-10-18 15:07:17 +00:00
|
|
|
UICommon::Shutdown();
|
|
|
|
return retcode;
|
2014-09-14 19:03:07 +00:00
|
|
|
}
|