aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/main.cpp
diff options
context:
space:
mode:
authorfearlessTobi <thm.frey@gmail.com>2018-08-21 13:24:55 +0200
committerfearlessTobi <thm.frey@gmail.com>2018-08-21 13:24:55 +0200
commitf2d5b100c2ed1d5b551f6c6c434d11eae63d98f9 (patch)
tree3d6a9f46b381f81ee97ae28635baa692fd3bbbf2 /src/yuzu/main.cpp
parentbf89a99839abb30e33872b8401eae30cd95e7585 (diff)
Port #3902 from Citra: "Add restart hotkey & menu option"
Diffstat (limited to 'src/yuzu/main.cpp')
-rw-r--r--src/yuzu/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 3db3f9d988..8444f54acc 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -223,6 +223,7 @@ void GMainWindow::InitializeHotkeys() {
hotkey_registry.RegisterHotkey("Main Window", "Load File", QKeySequence::Open);
hotkey_registry.RegisterHotkey("Main Window", "Start Emulation");
hotkey_registry.RegisterHotkey("Main Window", "Continue/Pause", QKeySequence(Qt::Key_F4));
+ hotkey_registry.RegisterHotkey("Main Window", "Restart", QKeySequence(Qt::Key_F5));
hotkey_registry.RegisterHotkey("Main Window", "Fullscreen", QKeySequence::FullScreen);
hotkey_registry.RegisterHotkey("Main Window", "Exit Fullscreen", QKeySequence(Qt::Key_Escape),
Qt::ApplicationShortcut);
@@ -244,6 +245,12 @@ void GMainWindow::InitializeHotkeys() {
}
}
});
+ connect(hotkey_registry.GetHotkey("Main Window", "Restart", this), &QShortcut::activated, this,
+ [this] {
+ if (!Core::System::GetInstance().IsPoweredOn())
+ return;
+ BootGame(QString(game_path));
+ });
connect(hotkey_registry.GetHotkey("Main Window", "Fullscreen", render_window),
&QShortcut::activated, ui.action_Fullscreen, &QAction::trigger);
connect(hotkey_registry.GetHotkey("Main Window", "Fullscreen", render_window),
@@ -328,6 +335,7 @@ void GMainWindow::ConnectMenuEvents() {
connect(ui.action_Start, &QAction::triggered, this, &GMainWindow::OnStartGame);
connect(ui.action_Pause, &QAction::triggered, this, &GMainWindow::OnPauseGame);
connect(ui.action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame);
+ connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); });
connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure);
// View
@@ -535,6 +543,7 @@ void GMainWindow::ShutdownGame() {
ui.action_Start->setText(tr("Start"));
ui.action_Pause->setEnabled(false);
ui.action_Stop->setEnabled(false);
+ ui.action_Restart->setEnabled(false);
render_window->hide();
game_list->show();
game_list->setFilterFocus();
@@ -811,6 +820,7 @@ void GMainWindow::OnPauseGame() {
ui.action_Start->setEnabled(true);
ui.action_Pause->setEnabled(false);
ui.action_Stop->setEnabled(true);
+ ui.action_Restart->setEnabled(true);
}
void GMainWindow::OnStopGame() {