From 6451496776eb05e51b14fcffb860baf00d932ce8 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Wed, 27 Mar 2019 14:26:17 +0100 Subject: [PATCH] DolphinQt: Add support for the --movie parameter Regression from DolphinWX. --- Source/Core/DolphinQt/Main.cpp | 2 +- Source/Core/DolphinQt/MainWindow.cpp | 12 +++++++++++- Source/Core/DolphinQt/MainWindow.h | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinQt/Main.cpp b/Source/Core/DolphinQt/Main.cpp index 7e5d0f5c25..038fed9c89 100644 --- a/Source/Core/DolphinQt/Main.cpp +++ b/Source/Core/DolphinQt/Main.cpp @@ -178,7 +178,7 @@ int main(int argc, char* argv[]) { DolphinAnalytics::Instance()->ReportDolphinStart("qt"); - MainWindow win{std::move(boot)}; + MainWindow win{std::move(boot), static_cast(options.get("movie"))}; if (options.is_set("debugger")) Settings::Instance().SetDebugModeEnabled(true); win.Show(); diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index f4526ee49c..2c269e6791 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -180,7 +180,9 @@ static std::vector StringListToStdVector(QStringList list) return result; } -MainWindow::MainWindow(std::unique_ptr boot_parameters) : QMainWindow(nullptr) +MainWindow::MainWindow(std::unique_ptr boot_parameters, + const std::string& movie_path) + : QMainWindow(nullptr) { setWindowTitle(QString::fromStdString(Common::scm_rev_str)); setWindowIcon(Resources::GetAppIcon()); @@ -213,8 +215,16 @@ MainWindow::MainWindow(std::unique_ptr boot_parameters) : QMainW #endif if (boot_parameters) + { m_pending_boot = std::move(boot_parameters); + if (!movie_path.empty()) + { + if (Movie::PlayInput(movie_path, &m_pending_boot->savestate_path)) + emit RecordingStatusChanged(true); + } + } + QSettings& settings = Settings::GetQSettings(); restoreState(settings.value(QStringLiteral("mainwindow/state")).toByteArray()); diff --git a/Source/Core/DolphinQt/MainWindow.h b/Source/Core/DolphinQt/MainWindow.h index 4c5224fb6a..1ac9bc453f 100644 --- a/Source/Core/DolphinQt/MainWindow.h +++ b/Source/Core/DolphinQt/MainWindow.h @@ -63,7 +63,8 @@ class MainWindow final : public QMainWindow Q_OBJECT public: - explicit MainWindow(std::unique_ptr boot_parameters); + explicit MainWindow(std::unique_ptr boot_parameters, + const std::string& movie_path); ~MainWindow(); void Show();