mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-05-23 04:57:07 +02:00
[qt] remove duplicate applet launch code (#3135)
Signed-off-by: lizzie <lizzie@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3135 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: Maufeat <sahyno1996@gmail.com> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
023a4bceca
commit
cb4239829f
3 changed files with 109 additions and 191 deletions
|
|
@ -160,20 +160,20 @@
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Am&iibo</string>
|
<string>Am&iibo</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="action_Load_Cabinet_Nickname_Owner"/>
|
<addaction name="action_Launch_Cabinet_Nickname_Owner"/>
|
||||||
<addaction name="action_Load_Cabinet_Eraser"/>
|
<addaction name="action_Launch_Cabinet_Eraser"/>
|
||||||
<addaction name="action_Load_Cabinet_Restorer"/>
|
<addaction name="action_Launch_Cabinet_Restorer"/>
|
||||||
<addaction name="action_Load_Cabinet_Formatter"/>
|
<addaction name="action_Launch_Cabinet_Formatter"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menu_Applets">
|
<widget class="QMenu" name="menu_Applets">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>&Applets</string>
|
<string>Launch &Applet</string>
|
||||||
</property>
|
</property>
|
||||||
<addaction name="action_Load_Home_Menu"/>
|
<addaction name="action_Launch_QLaunch"/>
|
||||||
<addaction name="action_Load_Album"/>
|
<addaction name="action_Launch_MiiEdit"/>
|
||||||
<addaction name="action_Load_Mii_Edit"/>
|
<addaction name="action_Launch_Controller"/>
|
||||||
<addaction name="action_Open_Controller_Menu"/>
|
<addaction name="action_Launch_Setup"/>
|
||||||
<addaction name="action_Open_Setup"/>
|
<addaction name="action_Launch_PhotoViewer"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menuTAS">
|
<widget class="QMenu" name="menuTAS">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
|
@ -420,34 +420,34 @@
|
||||||
<string>&Capture Screenshot</string>
|
<string>&Capture Screenshot</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="action_Load_Album">
|
<action name="action_Launch_PhotoViewer">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Open &Album</string>
|
<string>&Album</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="action_Load_Cabinet_Nickname_Owner">
|
<action name="action_Launch_Cabinet_Nickname_Owner">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Set Nickname and Owner</string>
|
<string>&Set Nickname and Owner</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="action_Load_Cabinet_Eraser">
|
<action name="action_Launch_Cabinet_Eraser">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Delete Game Data</string>
|
<string>&Delete Game Data</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="action_Load_Cabinet_Restorer">
|
<action name="action_Launch_Cabinet_Restorer">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Restore Amiibo</string>
|
<string>&Restore Amiibo</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="action_Load_Cabinet_Formatter">
|
<action name="action_Launch_Cabinet_Formatter">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Format Amiibo</string>
|
<string>&Format Amiibo</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="action_Load_Mii_Edit">
|
<action name="action_Launch_MiiEdit">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Open &Mii Editor</string>
|
<string>&Mii Editor</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="action_Configure_Tas">
|
<action name="action_Configure_Tas">
|
||||||
|
|
@ -493,7 +493,7 @@
|
||||||
<string>R&ecord</string>
|
<string>R&ecord</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="action_Open_Controller_Menu">
|
<action name="action_Launch_Controller">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Open &Controller Menu</string>
|
<string>Open &Controller Menu</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -503,14 +503,14 @@
|
||||||
<string>Install Decryption &Keys</string>
|
<string>Install Decryption &Keys</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="action_Load_Home_Menu">
|
<action name="action_Launch_QLaunch">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Open &Home Menu</string>
|
<string>&Home Menu</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="action_Open_Setup">
|
<action name="action_Launch_Setup">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Open &Setup</string>
|
<string>&Setup</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="menuRole">
|
<property name="menuRole">
|
||||||
<enum>QAction::MenuRole::TextHeuristicRole</enum>
|
<enum>QAction::MenuRole::TextHeuristicRole</enum>
|
||||||
|
|
|
||||||
|
|
@ -665,13 +665,13 @@ MainWindow::MainWindow(bool has_broken_vulkan)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (should_launch_setup) {
|
if (should_launch_setup) {
|
||||||
OnInitialSetup();
|
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::Starter), std::nullopt);
|
||||||
} else {
|
} else {
|
||||||
if (!game_path.isEmpty()) {
|
if (!game_path.isEmpty()) {
|
||||||
BootGame(game_path, ApplicationAppletParameters());
|
BootGame(game_path, ApplicationAppletParameters());
|
||||||
} else {
|
} else {
|
||||||
if (should_launch_qlaunch) {
|
if (should_launch_qlaunch) {
|
||||||
OnHomeMenu();
|
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::QLaunch), std::nullopt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1618,19 +1618,35 @@ void MainWindow::ConnectMenuEvents() {
|
||||||
connect(multiplayer_state, &MultiplayerState::SaveConfig, this, &MainWindow::OnSaveConfig);
|
connect(multiplayer_state, &MultiplayerState::SaveConfig, this, &MainWindow::OnSaveConfig);
|
||||||
|
|
||||||
// Tools
|
// Tools
|
||||||
connect_menu(ui->action_Load_Album, &MainWindow::OnAlbum);
|
connect_menu(ui->action_Launch_PhotoViewer, [this]{
|
||||||
connect_menu(ui->action_Load_Cabinet_Nickname_Owner,
|
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::PhotoViewer), std::nullopt);
|
||||||
[this]() { OnCabinet(Service::NFP::CabinetMode::StartNicknameAndOwnerSettings); });
|
});
|
||||||
connect_menu(ui->action_Load_Cabinet_Eraser,
|
connect_menu(ui->action_Launch_MiiEdit, [this]{
|
||||||
[this]() { OnCabinet(Service::NFP::CabinetMode::StartGameDataEraser); });
|
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::MiiEdit), std::nullopt);
|
||||||
connect_menu(ui->action_Load_Cabinet_Restorer,
|
});
|
||||||
[this]() { OnCabinet(Service::NFP::CabinetMode::StartRestorer); });
|
connect_menu(ui->action_Launch_Controller, [this]{
|
||||||
connect_menu(ui->action_Load_Cabinet_Formatter,
|
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::Controller), std::nullopt);
|
||||||
[this]() { OnCabinet(Service::NFP::CabinetMode::StartFormatter); });
|
});
|
||||||
connect_menu(ui->action_Load_Mii_Edit, &MainWindow::OnMiiEdit);
|
connect_menu(ui->action_Launch_QLaunch, [this]{
|
||||||
connect_menu(ui->action_Open_Controller_Menu, &MainWindow::OnOpenControllerMenu);
|
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::QLaunch), std::nullopt);
|
||||||
connect_menu(ui->action_Load_Home_Menu, &MainWindow::OnHomeMenu);
|
});
|
||||||
connect_menu(ui->action_Open_Setup, &MainWindow::OnInitialSetup);
|
connect_menu(ui->action_Launch_Setup, [this]{
|
||||||
|
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::Starter), std::nullopt);
|
||||||
|
});
|
||||||
|
// Tools (cabinet)
|
||||||
|
connect_menu(ui->action_Launch_Cabinet_Nickname_Owner, [this]{
|
||||||
|
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::Cabinet), {Service::NFP::CabinetMode::StartNicknameAndOwnerSettings});
|
||||||
|
});
|
||||||
|
connect_menu(ui->action_Launch_Cabinet_Eraser, [this]{
|
||||||
|
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::Cabinet), {Service::NFP::CabinetMode::StartGameDataEraser});
|
||||||
|
});
|
||||||
|
connect_menu(ui->action_Launch_Cabinet_Restorer, [this]{
|
||||||
|
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::Cabinet), {Service::NFP::CabinetMode::StartRestorer});
|
||||||
|
});
|
||||||
|
connect_menu(ui->action_Launch_Cabinet_Formatter, [this]{
|
||||||
|
LaunchFirmwareApplet(u64(Service::AM::AppletProgramId::Cabinet), {Service::NFP::CabinetMode::StartFormatter});
|
||||||
|
});
|
||||||
|
|
||||||
connect_menu(ui->action_Desktop, &MainWindow::OnCreateHomeMenuDesktopShortcut);
|
connect_menu(ui->action_Desktop, &MainWindow::OnCreateHomeMenuDesktopShortcut);
|
||||||
connect_menu(ui->action_Application_Menu,
|
connect_menu(ui->action_Application_Menu,
|
||||||
&MainWindow::OnCreateHomeMenuApplicationMenuShortcut);
|
&MainWindow::OnCreateHomeMenuApplicationMenuShortcut);
|
||||||
|
|
@ -1671,14 +1687,16 @@ void MainWindow::UpdateMenuState() {
|
||||||
ui->action_Pause,
|
ui->action_Pause,
|
||||||
};
|
};
|
||||||
|
|
||||||
const std::array applet_actions{ui->action_Load_Album,
|
const std::array applet_actions{
|
||||||
ui->action_Load_Cabinet_Nickname_Owner,
|
ui->action_Launch_PhotoViewer,
|
||||||
ui->action_Load_Cabinet_Eraser,
|
ui->action_Launch_Cabinet_Nickname_Owner,
|
||||||
ui->action_Load_Cabinet_Restorer,
|
ui->action_Launch_Cabinet_Eraser,
|
||||||
ui->action_Load_Cabinet_Formatter,
|
ui->action_Launch_Cabinet_Restorer,
|
||||||
ui->action_Load_Mii_Edit,
|
ui->action_Launch_Cabinet_Formatter,
|
||||||
ui->action_Load_Home_Menu,
|
ui->action_Launch_MiiEdit,
|
||||||
ui->action_Open_Controller_Menu};
|
ui->action_Launch_QLaunch,
|
||||||
|
ui->action_Launch_Controller
|
||||||
|
};
|
||||||
|
|
||||||
for (QAction* action : running_actions) {
|
for (QAction* action : running_actions) {
|
||||||
action->setEnabled(emulation_running);
|
action->setEnabled(emulation_running);
|
||||||
|
|
@ -3903,157 +3921,62 @@ void MainWindow::OnGameListRefresh()
|
||||||
SetFirmwareVersion();
|
SetFirmwareVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::OnAlbum() {
|
|
||||||
constexpr u64 AlbumId = static_cast<u64>(Service::AM::AppletProgramId::PhotoViewer);
|
|
||||||
auto bis_system = QtCommon::system->GetFileSystemController().GetSystemNANDContents();
|
|
||||||
if (!bis_system) {
|
|
||||||
QMessageBox::warning(this, tr("No firmware available"),
|
|
||||||
tr("Please install firmware to use the Album applet."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto album_nca = bis_system->GetEntry(AlbumId, FileSys::ContentRecordType::Program);
|
void MainWindow::LaunchFirmwareApplet(u64 raw_program_id, std::optional<Service::NFP::CabinetMode> cabinet_mode) {
|
||||||
if (!album_nca) {
|
auto const program_id = Service::AM::AppletProgramId(raw_program_id);
|
||||||
QMessageBox::warning(this, tr("Album Applet"),
|
|
||||||
tr("Album applet is not available. Please reinstall firmware."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QtCommon::system->GetFrontendAppletHolder().SetCurrentAppletId(Service::AM::AppletId::PhotoViewer);
|
|
||||||
|
|
||||||
const auto filename = QString::fromStdString(album_nca->GetFullPath());
|
|
||||||
UISettings::values.roms_path = QFileInfo(filename).path().toStdString();
|
|
||||||
BootGame(filename, LibraryAppletParameters(AlbumId, Service::AM::AppletId::PhotoViewer));
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::OnCabinet(Service::NFP::CabinetMode mode) {
|
|
||||||
constexpr u64 CabinetId = static_cast<u64>(Service::AM::AppletProgramId::Cabinet);
|
|
||||||
auto bis_system = QtCommon::system->GetFileSystemController().GetSystemNANDContents();
|
|
||||||
if (!bis_system) {
|
|
||||||
QMessageBox::warning(this, tr("No firmware available"),
|
|
||||||
tr("Please install firmware to use the Cabinet applet."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto cabinet_nca = bis_system->GetEntry(CabinetId, FileSys::ContentRecordType::Program);
|
|
||||||
if (!cabinet_nca) {
|
|
||||||
QMessageBox::warning(this, tr("Cabinet Applet"),
|
|
||||||
tr("Cabinet applet is not available. Please reinstall firmware."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QtCommon::system->GetFrontendAppletHolder().SetCurrentAppletId(Service::AM::AppletId::Cabinet);
|
|
||||||
QtCommon::system->GetFrontendAppletHolder().SetCabinetMode(mode);
|
|
||||||
|
|
||||||
const auto filename = QString::fromStdString(cabinet_nca->GetFullPath());
|
|
||||||
UISettings::values.roms_path = QFileInfo(filename).path().toStdString();
|
|
||||||
BootGame(filename, LibraryAppletParameters(CabinetId, Service::AM::AppletId::Cabinet));
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::OnMiiEdit() {
|
|
||||||
constexpr u64 MiiEditId = static_cast<u64>(Service::AM::AppletProgramId::MiiEdit);
|
|
||||||
auto bis_system = QtCommon::system->GetFileSystemController().GetSystemNANDContents();
|
|
||||||
if (!bis_system) {
|
|
||||||
QMessageBox::warning(this, tr("No firmware available"),
|
|
||||||
tr("Please install firmware to use the Mii editor."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto mii_applet_nca = bis_system->GetEntry(MiiEditId, FileSys::ContentRecordType::Program);
|
|
||||||
if (!mii_applet_nca) {
|
|
||||||
QMessageBox::warning(this, tr("Mii Edit Applet"),
|
|
||||||
tr("Mii editor is not available. Please reinstall firmware."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QtCommon::system->GetFrontendAppletHolder().SetCurrentAppletId(Service::AM::AppletId::MiiEdit);
|
|
||||||
|
|
||||||
const auto filename = QString::fromStdString((mii_applet_nca->GetFullPath()));
|
|
||||||
UISettings::values.roms_path = QFileInfo(filename).path().toStdString();
|
|
||||||
BootGame(filename, LibraryAppletParameters(MiiEditId, Service::AM::AppletId::MiiEdit));
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::OnOpenControllerMenu() {
|
|
||||||
constexpr u64 ControllerAppletId = static_cast<u64>(Service::AM::AppletProgramId::Controller);
|
|
||||||
auto bis_system = QtCommon::system->GetFileSystemController().GetSystemNANDContents();
|
|
||||||
if (!bis_system) {
|
|
||||||
QMessageBox::warning(this, tr("No firmware available"),
|
|
||||||
tr("Please install firmware to use the Controller Menu."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto controller_applet_nca =
|
|
||||||
bis_system->GetEntry(ControllerAppletId, FileSys::ContentRecordType::Program);
|
|
||||||
if (!controller_applet_nca) {
|
|
||||||
QMessageBox::warning(this, tr("Controller Applet"),
|
|
||||||
tr("Controller Menu is not available. Please reinstall firmware."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QtCommon::system->GetFrontendAppletHolder().SetCurrentAppletId(Service::AM::AppletId::Controller);
|
|
||||||
|
|
||||||
const auto filename = QString::fromStdString((controller_applet_nca->GetFullPath()));
|
|
||||||
UISettings::values.roms_path = QFileInfo(filename).path().toStdString();
|
|
||||||
BootGame(filename,
|
|
||||||
LibraryAppletParameters(ControllerAppletId, Service::AM::AppletId::Controller));
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::OnHomeMenu() {
|
|
||||||
auto result = FirmwareManager::VerifyFirmware(*QtCommon::system.get());
|
auto result = FirmwareManager::VerifyFirmware(*QtCommon::system.get());
|
||||||
|
|
||||||
using namespace QtCommon::StringLookup;
|
using namespace QtCommon::StringLookup;
|
||||||
|
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case FirmwareManager::ErrorFirmwareMissing:
|
case FirmwareManager::ErrorFirmwareMissing:
|
||||||
QMessageBox::warning(this, tr("No firmware available"),
|
QMessageBox::warning(this, tr("No firmware available"), Lookup(FwCheckErrorFirmwareMissing));
|
||||||
Lookup(FwCheckErrorFirmwareMissing));
|
|
||||||
return;
|
return;
|
||||||
case FirmwareManager::ErrorFirmwareCorrupted:
|
case FirmwareManager::ErrorFirmwareCorrupted:
|
||||||
QMessageBox::warning(this, tr("Firmware Corrupted"),
|
QMessageBox::warning(this, tr("Firmware Corrupted"), Lookup(FwCheckErrorFirmwareCorrupted));
|
||||||
Lookup(FwCheckErrorFirmwareCorrupted));
|
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr u64 QLaunchId = static_cast<u64>(Service::AM::AppletProgramId::QLaunch);
|
|
||||||
auto bis_system = QtCommon::system->GetFileSystemController().GetSystemNANDContents();
|
auto bis_system = QtCommon::system->GetFileSystemController().GetSystemNANDContents();
|
||||||
|
if (auto applet_nca = bis_system->GetEntry(u64(program_id), FileSys::ContentRecordType::Program); applet_nca) {
|
||||||
auto qlaunch_applet_nca = bis_system->GetEntry(QLaunchId, FileSys::ContentRecordType::Program);
|
if (auto const applet_id = [program_id] {
|
||||||
if (!qlaunch_applet_nca) {
|
using namespace Service::AM;
|
||||||
QMessageBox::warning(this, tr("Home Menu Applet"),
|
switch (program_id) {
|
||||||
tr("Home Menu is not available. Please reinstall firmware."));
|
case AppletProgramId::OverlayDisplay: return AppletId::OverlayDisplay;
|
||||||
return;
|
case AppletProgramId::QLaunch: return AppletId::QLaunch;
|
||||||
|
case AppletProgramId::Starter: return AppletId::Starter;
|
||||||
|
case AppletProgramId::Auth: return AppletId::Auth;
|
||||||
|
case AppletProgramId::Cabinet: return AppletId::Cabinet;
|
||||||
|
case AppletProgramId::Controller: return AppletId::Controller;
|
||||||
|
case AppletProgramId::DataErase: return AppletId::DataErase;
|
||||||
|
case AppletProgramId::Error: return AppletId::Error;
|
||||||
|
case AppletProgramId::NetConnect: return AppletId::NetConnect;
|
||||||
|
case AppletProgramId::ProfileSelect: return AppletId::ProfileSelect;
|
||||||
|
case AppletProgramId::SoftwareKeyboard: return AppletId::SoftwareKeyboard;
|
||||||
|
case AppletProgramId::MiiEdit: return AppletId::MiiEdit;
|
||||||
|
case AppletProgramId::Web: return AppletId::Web;
|
||||||
|
case AppletProgramId::Shop: return AppletId::Shop;
|
||||||
|
case AppletProgramId::PhotoViewer: return AppletId::PhotoViewer;
|
||||||
|
case AppletProgramId::Settings: return AppletId::Settings;
|
||||||
|
case AppletProgramId::OfflineWeb: return AppletId::OfflineWeb;
|
||||||
|
case AppletProgramId::LoginShare: return AppletId::LoginShare;
|
||||||
|
case AppletProgramId::WebAuth: return AppletId::WebAuth;
|
||||||
|
case AppletProgramId::MyPage: return AppletId::MyPage;
|
||||||
|
default: return AppletId::None;
|
||||||
|
}
|
||||||
|
}(); applet_id != Service::AM::AppletId::None) {
|
||||||
|
QtCommon::system->GetFrontendAppletHolder().SetCurrentAppletId(applet_id);
|
||||||
|
if (cabinet_mode)
|
||||||
|
QtCommon::system->GetFrontendAppletHolder().SetCabinetMode(*cabinet_mode);
|
||||||
|
// ?
|
||||||
|
auto const filename = QString::fromStdString((applet_nca->GetFullPath()));
|
||||||
|
UISettings::values.roms_path = QFileInfo(filename).path().toStdString();
|
||||||
|
BootGame(filename, LibraryAppletParameters(u64(program_id), applet_id));
|
||||||
|
} else {
|
||||||
|
QMessageBox::warning(this, tr("Unknown applet"), tr("Applet doesn't map to a known value."));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
QMessageBox::warning(this, tr("Record not found"), tr("Applet not found. Please reinstall firmware."));
|
||||||
}
|
}
|
||||||
|
|
||||||
QtCommon::system->GetFrontendAppletHolder().SetCurrentAppletId(Service::AM::AppletId::QLaunch);
|
|
||||||
|
|
||||||
const auto filename = QString::fromStdString((qlaunch_applet_nca->GetFullPath()));
|
|
||||||
UISettings::values.roms_path = QFileInfo(filename).path().toStdString();
|
|
||||||
BootGame(filename, LibraryAppletParameters(QLaunchId, Service::AM::AppletId::QLaunch));
|
|
||||||
}
|
|
||||||
|
|
||||||
void MainWindow::OnInitialSetup() {
|
|
||||||
constexpr u64 Starter = static_cast<u64>(Service::AM::AppletProgramId::Starter);
|
|
||||||
auto bis_system = QtCommon::system->GetFileSystemController().GetSystemNANDContents();
|
|
||||||
if (!bis_system) {
|
|
||||||
QMessageBox::warning(this, tr("No firmware available"),
|
|
||||||
tr("Please install firmware to use Starter."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto qlaunch_nca = bis_system->GetEntry(Starter, FileSys::ContentRecordType::Program);
|
|
||||||
if (!qlaunch_nca) {
|
|
||||||
QMessageBox::warning(this, tr("Starter Applet"),
|
|
||||||
tr("Starter is not available. Please reinstall firmware."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
QtCommon::system->GetFrontendAppletHolder().SetCurrentAppletId(Service::AM::AppletId::Starter);
|
|
||||||
|
|
||||||
const auto filename = QString::fromStdString((qlaunch_nca->GetFullPath()));
|
|
||||||
UISettings::values.roms_path = QFileInfo(filename).path().toStdString();
|
|
||||||
BootGame(filename, LibraryAppletParameters(Starter, Service::AM::AppletId::Starter));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::OnCreateHomeMenuDesktopShortcut() {
|
void MainWindow::OnCreateHomeMenuDesktopShortcut() {
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,7 @@ class InputSubsystem;
|
||||||
namespace Service::AM {
|
namespace Service::AM {
|
||||||
struct FrontendAppletParameters;
|
struct FrontendAppletParameters;
|
||||||
enum class AppletId : u32;
|
enum class AppletId : u32;
|
||||||
|
// this causes errors on debian -> enum class AppletProgramId : u64;
|
||||||
} // namespace Service::AM
|
} // namespace Service::AM
|
||||||
|
|
||||||
namespace Service::AM::Frontend {
|
namespace Service::AM::Frontend {
|
||||||
|
|
@ -399,12 +400,7 @@ private slots:
|
||||||
void ResetWindowSize720();
|
void ResetWindowSize720();
|
||||||
void ResetWindowSize900();
|
void ResetWindowSize900();
|
||||||
void ResetWindowSize1080();
|
void ResetWindowSize1080();
|
||||||
void OnAlbum();
|
void LaunchFirmwareApplet(u64 program_id, std::optional<Service::NFP::CabinetMode> mode);
|
||||||
void OnCabinet(Service::NFP::CabinetMode mode);
|
|
||||||
void OnMiiEdit();
|
|
||||||
void OnOpenControllerMenu();
|
|
||||||
void OnHomeMenu();
|
|
||||||
void OnInitialSetup();
|
|
||||||
void OnCreateHomeMenuDesktopShortcut();
|
void OnCreateHomeMenuDesktopShortcut();
|
||||||
void OnCreateHomeMenuApplicationMenuShortcut();
|
void OnCreateHomeMenuApplicationMenuShortcut();
|
||||||
void OnCaptureScreenshot();
|
void OnCaptureScreenshot();
|
||||||
|
|
@ -428,7 +424,6 @@ private:
|
||||||
bool SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id,
|
bool SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id,
|
||||||
u64* selected_title_id, u8* selected_content_record_type);
|
u64* selected_title_id, u8* selected_content_record_type);
|
||||||
ContentManager::InstallResult InstallNCA(const QString& filename);
|
ContentManager::InstallResult InstallNCA(const QString& filename);
|
||||||
void MigrateConfigFiles();
|
|
||||||
void UpdateWindowTitle(std::string_view title_name = {}, std::string_view title_version = {},
|
void UpdateWindowTitle(std::string_view title_name = {}, std::string_view title_version = {},
|
||||||
std::string_view gpu_vendor = {});
|
std::string_view gpu_vendor = {});
|
||||||
void UpdateDockedButton();
|
void UpdateDockedButton();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue