summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2019-03-27 18:34:24 +0100
committerGitHub <noreply@github.com>2019-03-27 18:34:24 +0100
commit6a18bf4d2e9821fe26402bbb83dc77136e2b5715 (patch)
tree2649637a5af55389a945d72dbccfb1b649134ca9 /Source
parentb4b0ebae27c9f8e3545cd3632948fc92783d99c3 (diff)
parent6451496776eb05e51b14fcffb860baf00d932ce8 (diff)
Merge pull request #7935 from JosJuice/cli-arg-movie
DolphinQt: Add support for the --movie parameter
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt/Main.cpp2
-rw-r--r--Source/Core/DolphinQt/MainWindow.cpp12
-rw-r--r--Source/Core/DolphinQt/MainWindow.h3
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<const char*>(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 577e525b81..9814644f78 100644
--- a/Source/Core/DolphinQt/MainWindow.cpp
+++ b/Source/Core/DolphinQt/MainWindow.cpp
@@ -181,7 +181,9 @@ static std::vector<std::string> StringListToStdVector(QStringList list)
return result;
}
-MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters) : QMainWindow(nullptr)
+MainWindow::MainWindow(std::unique_ptr<BootParameters> boot_parameters,
+ const std::string& movie_path)
+ : QMainWindow(nullptr)
{
setWindowTitle(QString::fromStdString(Common::scm_rev_str));
setWindowIcon(Resources::GetAppIcon());
@@ -214,8 +216,16 @@ MainWindow::MainWindow(std::unique_ptr<BootParameters> 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 f2ac8f512f..edc6fc479b 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<BootParameters> boot_parameters);
+ explicit MainWindow(std::unique_ptr<BootParameters> boot_parameters,
+ const std::string& movie_path);
~MainWindow();
void Show();