Skip to content
Permalink
Browse files

Merge pull request #7935 from JosJuice/cli-arg-movie

DolphinQt: Add support for the --movie parameter
  • Loading branch information...
JosJuice committed Mar 27, 2019
2 parents b4b0eba + 6451496 commit 6a18bf4d2e9821fe26402bbb83dc77136e2b5715
Showing with 14 additions and 3 deletions.
  1. +1 −1 Source/Core/DolphinQt/Main.cpp
  2. +11 −1 Source/Core/DolphinQt/MainWindow.cpp
  3. +2 −1 Source/Core/DolphinQt/MainWindow.h
@@ -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();
@@ -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());
@@ -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();

0 comments on commit 6a18bf4

Please sign in to comment.
You can’t perform that action at this time.