summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-08-22 07:07:59 +0200
committerGitHub <noreply@github.com>2018-08-22 07:07:59 +0200
commiteef0c9364320530e3558908cef0fa52c293aea51 (patch)
tree53567b2117b5a9747c5457a63cb0bfcc848a699c /src
parentMerge pull request #1124 from Subv/logic_ops (diff)
parentPort #3902 from Citra: "Add restart hotkey & menu option" (diff)
downloadyuzu-eef0c9364320530e3558908cef0fa52c293aea51.tar
yuzu-eef0c9364320530e3558908cef0fa52c293aea51.tar.gz
yuzu-eef0c9364320530e3558908cef0fa52c293aea51.tar.bz2
yuzu-eef0c9364320530e3558908cef0fa52c293aea51.tar.lz
yuzu-eef0c9364320530e3558908cef0fa52c293aea51.tar.xz
yuzu-eef0c9364320530e3558908cef0fa52c293aea51.tar.zst
yuzu-eef0c9364320530e3558908cef0fa52c293aea51.zip
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/main.cpp10
-rw-r--r--src/yuzu/main.ui8
2 files changed, 18 insertions, 0 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 20a566b8d..9fd372419 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -231,6 +231,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);
@@ -252,6 +253,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),
@@ -336,6 +343,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
@@ -545,6 +553,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();
@@ -823,6 +832,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() {
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui
index a3bfb2af3..d4c26b80a 100644
--- a/src/yuzu/main.ui
+++ b/src/yuzu/main.ui
@@ -211,6 +211,14 @@
<string>Fullscreen</string>
</property>
</action>
+ <action name="action_Restart">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Restart</string>
+ </property>
+ </action>
</widget>
<resources/>
</ui>