Implement app management support (suspend, resume, close, etc) (#6322)
This commit is contained in:
@@ -423,11 +423,6 @@ void ConfigureInput::OnHotkeysChanged(QList<QKeySequence> new_key_list) {
|
||||
QList<QKeySequence> ConfigureInput::GetUsedKeyboardKeys() {
|
||||
QList<QKeySequence> list;
|
||||
for (int button = 0; button < Settings::NativeButton::NumButtons; button++) {
|
||||
// TODO(adityaruplaha): Add home button to list when we finally emulate it
|
||||
if (button == Settings::NativeButton::Home) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto& button_param = buttons_param[button];
|
||||
if (button_param.Get("engine", "") == "keyboard") {
|
||||
list << QKeySequence(button_param.Get("code", 0));
|
||||
|
@@ -85,6 +85,7 @@
|
||||
#include "core/frontend/applets/default_applets.h"
|
||||
#include "core/frontend/scope_acquire_context.h"
|
||||
#include "core/gdbstub/gdbstub.h"
|
||||
#include "core/hle/service/cfg/cfg.h"
|
||||
#include "core/hle/service/fs/archive.h"
|
||||
#include "core/hle/service/nfc/nfc.h"
|
||||
#include "core/loader/loader.h"
|
||||
@@ -318,6 +319,8 @@ void GMainWindow::InitializeWidgets() {
|
||||
updater = new Updater(this);
|
||||
UISettings::values.updater_found = updater->HasUpdater();
|
||||
|
||||
UpdateBootHomeMenuState();
|
||||
|
||||
// Create status bar
|
||||
message_label = new QLabel();
|
||||
// Configured separately for left alignment
|
||||
@@ -741,6 +744,7 @@ void GMainWindow::ConnectMenuEvents() {
|
||||
// File
|
||||
connect_menu(ui->action_Load_File, &GMainWindow::OnMenuLoadFile);
|
||||
connect_menu(ui->action_Install_CIA, &GMainWindow::OnMenuInstallCIA);
|
||||
connect_menu(ui->action_Boot_Home_Menu, &GMainWindow::OnMenuBootHomeMenu);
|
||||
connect_menu(ui->action_Exit, &QMainWindow::close);
|
||||
connect_menu(ui->action_Load_Amiibo, &GMainWindow::OnLoadAmiibo);
|
||||
connect_menu(ui->action_Remove_Amiibo, &GMainWindow::OnRemoveAmiibo);
|
||||
@@ -1601,6 +1605,20 @@ void GMainWindow::OnMenuInstallCIA() {
|
||||
InstallCIA(filepaths);
|
||||
}
|
||||
|
||||
static std::string GetHomeMenuPath() {
|
||||
static const std::array<u64, 7> home_menu_tids = {
|
||||
0x0004003000008202, 0x0004003000008F02, 0x0004003000009802, 0x0004003000009802,
|
||||
0x000400300000A102, 0x000400300000A902, 0x000400300000B102};
|
||||
|
||||
Service::CFG::Module cfg{};
|
||||
return Service::AM::GetTitleContentPath(Service::FS::MediaType::NAND,
|
||||
home_menu_tids[cfg.GetRegionValue()]);
|
||||
}
|
||||
|
||||
void GMainWindow::OnMenuBootHomeMenu() {
|
||||
BootGame(QString::fromStdString(GetHomeMenuPath()));
|
||||
}
|
||||
|
||||
void GMainWindow::InstallCIA(QStringList filepaths) {
|
||||
ui->action_Install_CIA->setEnabled(false);
|
||||
game_list->SetDirectoryWatcherEnabled(false);
|
||||
@@ -1951,6 +1969,7 @@ void GMainWindow::OnConfigure() {
|
||||
setMouseTracking(false);
|
||||
}
|
||||
UpdateSecondaryWindowVisibility();
|
||||
UpdateBootHomeMenuState();
|
||||
} else {
|
||||
Settings::values.input_profiles = old_input_profiles;
|
||||
Settings::values.touch_from_button_maps = old_touch_from_button_maps;
|
||||
@@ -2244,6 +2263,12 @@ void GMainWindow::UpdateStatusBar() {
|
||||
emu_frametime_label->setVisible(true);
|
||||
}
|
||||
|
||||
void GMainWindow::UpdateBootHomeMenuState() {
|
||||
const std::string home_menu_path = GetHomeMenuPath();
|
||||
ui->action_Boot_Home_Menu->setEnabled(!home_menu_path.empty() &&
|
||||
FileUtil::Exists(GetHomeMenuPath()));
|
||||
}
|
||||
|
||||
void GMainWindow::HideMouseCursor() {
|
||||
if (emu_thread == nullptr || !UISettings::values.hide_mouse.GetValue()) {
|
||||
mouse_hide_timer.stop();
|
||||
|
@@ -192,6 +192,7 @@ private slots:
|
||||
void OnConfigurePerGame();
|
||||
void OnMenuLoadFile();
|
||||
void OnMenuInstallCIA();
|
||||
void OnMenuBootHomeMenu();
|
||||
void OnUpdateProgress(std::size_t written, std::size_t total);
|
||||
void OnCIAInstallReport(Service::AM::InstallStatus status, QString filepath);
|
||||
void OnCIAInstallFinished();
|
||||
@@ -238,6 +239,7 @@ private slots:
|
||||
private:
|
||||
Q_INVOKABLE void OnMoviePlaybackCompleted();
|
||||
void UpdateStatusBar();
|
||||
void UpdateBootHomeMenuState();
|
||||
void LoadTranslation();
|
||||
void UpdateWindowTitle();
|
||||
void UpdateUISettings();
|
||||
|
@@ -66,6 +66,7 @@
|
||||
</widget>
|
||||
<addaction name="action_Load_File"/>
|
||||
<addaction name="action_Install_CIA"/>
|
||||
<addaction name="action_Boot_Home_Menu"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menu_recent_files"/>
|
||||
<addaction name="separator"/>
|
||||
@@ -209,6 +210,11 @@
|
||||
<string>Install CIA...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Boot_Home_Menu">
|
||||
<property name="text">
|
||||
<string>Boot Home Menu</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Exit">
|
||||
<property name="text">
|
||||
<string>E&xit</string>
|
||||
|
Reference in New Issue
Block a user