HostInterface: Make SetUserDirectory() overridable by frontends

This commit is contained in:
Connor McLaughlin
2020-04-05 22:59:06 +10:00
parent 11e8a91e30
commit e7640d5367
13 changed files with 188 additions and 108 deletions

View File

@ -2,6 +2,7 @@
#include "mainwindow.h"
#include "qthostinterface.h"
#include <QtWidgets/QApplication>
#include <QtWidgets/QMessageBox>
#include <memory>
static void InitLogging()
@ -34,11 +35,22 @@ int main(int argc, char* argv[])
#endif
std::unique_ptr<QtHostInterface> host_interface = std::make_unique<QtHostInterface>();
if (!host_interface->Initialize())
{
host_interface->Shutdown();
QMessageBox::critical(nullptr, QObject::tr("DuckStation Error"),
QObject::tr("Failed to initialize host interface. Cannot continue."), QMessageBox::Ok);
return -1;
}
std::unique_ptr<MainWindow> window = std::make_unique<MainWindow>(host_interface.get());
window->show();
host_interface->refreshGameList();
return app.exec();
int result = app.exec();
window.reset();
host_interface->Shutdown();
return result;
}