diff options
| author | 2018-08-22 01:07:59 -0400 | |
|---|---|---|
| committer | 2018-08-22 01:07:59 -0400 | |
| commit | eef0c9364320530e3558908cef0fa52c293aea51 (patch) | |
| tree | 53567b2117b5a9747c5457a63cb0bfcc848a699c /src | |
| parent | Merge pull request #1124 from Subv/logic_ops (diff) | |
| parent | Port #3902 from Citra: "Add restart hotkey & menu option" (diff) | |
| download | yuzu-eef0c9364320530e3558908cef0fa52c293aea51.tar.gz yuzu-eef0c9364320530e3558908cef0fa52c293aea51.tar.xz yuzu-eef0c9364320530e3558908cef0fa52c293aea51.zip | |
Merge pull request #1141 from FearlessTobi/port-3902
Port #3902 from Citra: "Add restart hotkey & menu option"
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/main.cpp | 10 | ||||
| -rw-r--r-- | src/yuzu/main.ui | 8 |
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() { | |||
| 231 | hotkey_registry.RegisterHotkey("Main Window", "Load File", QKeySequence::Open); | 231 | hotkey_registry.RegisterHotkey("Main Window", "Load File", QKeySequence::Open); |
| 232 | hotkey_registry.RegisterHotkey("Main Window", "Start Emulation"); | 232 | hotkey_registry.RegisterHotkey("Main Window", "Start Emulation"); |
| 233 | hotkey_registry.RegisterHotkey("Main Window", "Continue/Pause", QKeySequence(Qt::Key_F4)); | 233 | hotkey_registry.RegisterHotkey("Main Window", "Continue/Pause", QKeySequence(Qt::Key_F4)); |
| 234 | hotkey_registry.RegisterHotkey("Main Window", "Restart", QKeySequence(Qt::Key_F5)); | ||
| 234 | hotkey_registry.RegisterHotkey("Main Window", "Fullscreen", QKeySequence::FullScreen); | 235 | hotkey_registry.RegisterHotkey("Main Window", "Fullscreen", QKeySequence::FullScreen); |
| 235 | hotkey_registry.RegisterHotkey("Main Window", "Exit Fullscreen", QKeySequence(Qt::Key_Escape), | 236 | hotkey_registry.RegisterHotkey("Main Window", "Exit Fullscreen", QKeySequence(Qt::Key_Escape), |
| 236 | Qt::ApplicationShortcut); | 237 | Qt::ApplicationShortcut); |
| @@ -252,6 +253,12 @@ void GMainWindow::InitializeHotkeys() { | |||
| 252 | } | 253 | } |
| 253 | } | 254 | } |
| 254 | }); | 255 | }); |
| 256 | connect(hotkey_registry.GetHotkey("Main Window", "Restart", this), &QShortcut::activated, this, | ||
| 257 | [this] { | ||
| 258 | if (!Core::System::GetInstance().IsPoweredOn()) | ||
| 259 | return; | ||
| 260 | BootGame(QString(game_path)); | ||
| 261 | }); | ||
| 255 | connect(hotkey_registry.GetHotkey("Main Window", "Fullscreen", render_window), | 262 | connect(hotkey_registry.GetHotkey("Main Window", "Fullscreen", render_window), |
| 256 | &QShortcut::activated, ui.action_Fullscreen, &QAction::trigger); | 263 | &QShortcut::activated, ui.action_Fullscreen, &QAction::trigger); |
| 257 | connect(hotkey_registry.GetHotkey("Main Window", "Fullscreen", render_window), | 264 | connect(hotkey_registry.GetHotkey("Main Window", "Fullscreen", render_window), |
| @@ -336,6 +343,7 @@ void GMainWindow::ConnectMenuEvents() { | |||
| 336 | connect(ui.action_Start, &QAction::triggered, this, &GMainWindow::OnStartGame); | 343 | connect(ui.action_Start, &QAction::triggered, this, &GMainWindow::OnStartGame); |
| 337 | connect(ui.action_Pause, &QAction::triggered, this, &GMainWindow::OnPauseGame); | 344 | connect(ui.action_Pause, &QAction::triggered, this, &GMainWindow::OnPauseGame); |
| 338 | connect(ui.action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame); | 345 | connect(ui.action_Stop, &QAction::triggered, this, &GMainWindow::OnStopGame); |
| 346 | connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); | ||
| 339 | connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); | 347 | connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); |
| 340 | 348 | ||
| 341 | // View | 349 | // View |
| @@ -545,6 +553,7 @@ void GMainWindow::ShutdownGame() { | |||
| 545 | ui.action_Start->setText(tr("Start")); | 553 | ui.action_Start->setText(tr("Start")); |
| 546 | ui.action_Pause->setEnabled(false); | 554 | ui.action_Pause->setEnabled(false); |
| 547 | ui.action_Stop->setEnabled(false); | 555 | ui.action_Stop->setEnabled(false); |
| 556 | ui.action_Restart->setEnabled(false); | ||
| 548 | render_window->hide(); | 557 | render_window->hide(); |
| 549 | game_list->show(); | 558 | game_list->show(); |
| 550 | game_list->setFilterFocus(); | 559 | game_list->setFilterFocus(); |
| @@ -823,6 +832,7 @@ void GMainWindow::OnPauseGame() { | |||
| 823 | ui.action_Start->setEnabled(true); | 832 | ui.action_Start->setEnabled(true); |
| 824 | ui.action_Pause->setEnabled(false); | 833 | ui.action_Pause->setEnabled(false); |
| 825 | ui.action_Stop->setEnabled(true); | 834 | ui.action_Stop->setEnabled(true); |
| 835 | ui.action_Restart->setEnabled(true); | ||
| 826 | } | 836 | } |
| 827 | 837 | ||
| 828 | void GMainWindow::OnStopGame() { | 838 | 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 @@ | |||
| 211 | <string>Fullscreen</string> | 211 | <string>Fullscreen</string> |
| 212 | </property> | 212 | </property> |
| 213 | </action> | 213 | </action> |
| 214 | <action name="action_Restart"> | ||
| 215 | <property name="enabled"> | ||
| 216 | <bool>false</bool> | ||
| 217 | </property> | ||
| 218 | <property name="text"> | ||
| 219 | <string>Restart</string> | ||
| 220 | </property> | ||
| 221 | </action> | ||
| 214 | </widget> | 222 | </widget> |
| 215 | <resources/> | 223 | <resources/> |
| 216 | </ui> | 224 | </ui> |