Permalink
Browse files

Show the translated player type in the list of players.

  • Loading branch information...
nriendeau committed Jul 1, 2012
1 parent 85e8db2 commit 31ea20d424de0cb898f0aa7ffb9b7120c8be2b3f
Showing with 26 additions and 5 deletions.
  1. +24 −4 mythplugins/mythgame/mythgame/gamesettings.cpp
  2. +2 −1 mythplugins/mythgame/mythgame/gamesettings.h
@@ -6,7 +6,22 @@
#include "gamesettings.h"
-const QString GetGameExtensions(const QString GameType)
+const QString GetGameTypeName(const QString GameType)
+{
+ QString result = "";
+
+ for (int i = 0; i < MAX_GAME_TYPES; i++)
+ {
+ if (GameTypeList[i].idStr == GameType) {
+ result = QCoreApplication::translate("(GameTypes)",
+ GameTypeList[i].nameStr.toUtf8());
+ break;
+ }
+ }
+ return result;
+}
+
+const QString GetGameTypeExtensions(const QString GameType)
{
QString result = "";
@@ -232,7 +247,7 @@ MythGamePlayerSettings::MythGamePlayerSettings()
addChild(id = new ID());
ConfigurationGroup *group = new VerticalConfigurationGroup(false, false);
- group->setLabel(QObject::tr("Game Player Setup"));
+ group->setLabel(tr("Game Player Setup"));
group->addChild(name = new Name(*this));
group->addChild(new GameType(*this));
group->addChild(new Command(*this));
@@ -250,10 +265,15 @@ void MythGamePlayerSettings::fillSelections(SelectSetting* setting)
if (result.exec() && result.isActive() && result.size() > 0)
{
+ //: %1 is the player/emulator name, %2 is the type of player/emulator
+ QString playerDisp = tr("%1 (%2)", "Game player/emulator display");
+
while (result.next())
{
- setting->addSelection(result.value(0).toString() + " (" + result.value(2).toString() + ")",
- result.value(1).toString());
+ setting->addSelection(QString(playerDisp)
+ .arg(result.value(0).toString())
+ .arg(GetGameTypeName(result.value(2).toString())),
+ result.value(1).toString());
}
}
}
@@ -32,7 +32,8 @@ const GameTypes GameTypeList[MAX_GAME_TYPES] =
{ QT_TRANSLATE_NOOP("(GameTypes)", "SNES"), "SNES", "zip,smc,sfc,fig,swc" }
};
-const QString GetGameExtensions(const QString GameType);
+const QString GetGameTypeName(const QString GameType);
+const QString GetGameTypeExtensions(const QString GameType);
class MythGameGeneralSettings;
class MythGamePlayerSettings;

0 comments on commit 31ea20d

Please sign in to comment.