Implement app management support (suspend, resume, close, etc) (#6322)
This commit is contained in:
parent
d2caf2d386
commit
c96f54f022
21 changed files with 1043 additions and 110 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue