Ejemplo n.º 1
0
void MainMenuBar::RefreshWiiSystemMenuLabel() const
{
  auto* const item = FindItem(IDM_LOAD_WII_MENU);

  if (Core::IsRunning())
  {
    item->Enable(false);
    for (const int idm : {IDM_PERFORM_ONLINE_UPDATE_CURRENT, IDM_PERFORM_ONLINE_UPDATE_EUR,
      IDM_PERFORM_ONLINE_UPDATE_JPN, IDM_PERFORM_ONLINE_UPDATE_KOR,
      IDM_PERFORM_ONLINE_UPDATE_USA})
    {
      FindItem(idm)->Enable(false);
    }
    return;
  }

  IOS::HLE::Kernel ios;
  const IOS::ES::TMDReader sys_menu_tmd = ios.GetES()->FindInstalledTMD(Titles::SYSTEM_MENU);
  if (sys_menu_tmd.IsValid())
  {
    const u16 version_number = sys_menu_tmd.GetTitleVersion();
    const wxString version_string = StrToWxStr(DiscIO::GetSysMenuVersionString(version_number));
    item->Enable();
    item->SetItemLabel(wxString::Format(_("Load Wii System Menu %s"), version_string));
    EnableUpdateMenu(UpdateMenuMode::CurrentRegionOnly);
  }
  else
  {
    item->Enable(false);
    item->SetItemLabel(_("Load Wii System Menu"));
    EnableUpdateMenu(UpdateMenuMode::SpecificRegionsOnly);
  }
}
Ejemplo n.º 2
0
void MenuBar::UpdateToolsMenu(bool emulation_started)
{
  m_boot_sysmenu->setEnabled(!emulation_started);
  m_perform_online_update_menu->setEnabled(!emulation_started);
  m_ntscj_ipl->setEnabled(!emulation_started &&
                          File::Exists(SConfig::GetInstance().GetBootROMPath(JAP_DIR)));
  m_ntscu_ipl->setEnabled(!emulation_started &&
                          File::Exists(SConfig::GetInstance().GetBootROMPath(USA_DIR)));
  m_pal_ipl->setEnabled(!emulation_started &&
                        File::Exists(SConfig::GetInstance().GetBootROMPath(EUR_DIR)));
  m_import_backup->setEnabled(!emulation_started);
  m_check_nand->setEnabled(!emulation_started);

  if (!emulation_started)
  {
    IOS::HLE::Kernel ios;
    const auto tmd = ios.GetES()->FindInstalledTMD(Titles::SYSTEM_MENU);

    const QString sysmenu_version =
        tmd.IsValid() ?
            QString::fromStdString(DiscIO::GetSysMenuVersionString(tmd.GetTitleVersion())) :
            QStringLiteral("");
    m_boot_sysmenu->setText(tr("Load Wii System Menu %1").arg(sysmenu_version));

    m_boot_sysmenu->setEnabled(tmd.IsValid());

    for (QAction* action : m_perform_online_update_menu->actions())
      action->setEnabled(!tmd.IsValid());
    m_perform_online_update_for_current_region->setEnabled(tmd.IsValid());
  }
}