Exemplo n.º 1
0
	QVariant LocalesModel::data (const QModelIndex& index, int role) const
	{
		const auto& entry = Locales_.value (index.row ());
		if (role == static_cast<int> (Role::LocaleEntry))
			return QVariant::fromValue (entry);

		if (role != Qt::DisplayRole && role != Qt::EditRole)
			return {};

		switch (static_cast<Column> (index.column ()))
		{
		case Column::Language:
			return QLocale::languageToString (entry.Language_);
		case Column::Country:
			return GetCountryName (entry.Language_, entry.Country_);
		case Column::Quality:
			return entry.Q_;
		case Column::Code:
			return GetDisplayCode (entry);
		}

		qWarning () << Q_FUNC_INFO
				<< "unknown column"
				<< index;
		return {};
	}
Exemplo n.º 2
0
void InfoPanel::LoadISODetails()
{
  m_internal_name->SetValue(StrToWxStr(m_opened_iso->GetInternalName()));
  m_game_id->SetValue(StrToWxStr(m_opened_iso->GetGameID()));
  m_country->SetValue(GetCountryName(m_opened_iso->GetCountry()));
  m_maker_id->SetValue("0x" + StrToWxStr(m_opened_iso->GetMakerID()));
  m_revision->SetValue(OptionalToString(m_opened_iso->GetRevision()));
  m_date->SetValue(StrToWxStr(m_opened_iso->GetApploaderDate()));
  if (m_ios_version)
  {
    const IOS::ES::TMDReader tmd = m_opened_iso->GetTMD(m_opened_iso->GetGamePartition());
    if (tmd.IsValid())
      m_ios_version->SetValue(StringFromFormat("IOS%u", static_cast<u32>(tmd.GetIOSId())));
  }
}
Exemplo n.º 3
0
wxString Localization::GetFullDisplayName(const wxString& canonicalName) {
  wxString languageCode = GetLanguageCodeOnly(canonicalName);
  wxString countryCode = GetCountryCodeOnly(canonicalName);

  wxString output = GetLanguageName(languageCode);

  wxString extraString;

  if (countryCode != wxEmptyString) {
    if (languageCode == _T("zh") && countryCode == _T("CN")) {
      extraString = _T("简体"); // "Simplified" in "Simplified Chinese"
    } else {
      extraString = GetCountryName(countryCode);
    }    
  }

  if (languageCode == _T("zh") && countryCode == wxEmptyString) extraString = _T("繁體"); // "Traditional" in "Traditional Chinese"

  if (extraString != wxEmptyString) output += _T(" (") + extraString + _T(")");

  return output;
}
Exemplo n.º 4
0
string const & ActiveMapsLayout::GetCountryName(TGroup const & group, int position) const
{
  return GetCountryName(GetItemInGroup(group, position).Index());
}