5#include <QCoreApplication>
23 { QT_TRANSLATE_NOOP(
"(GameTypes)",
"OTHER"),
"OTHER",
"" },
24 { QT_TRANSLATE_NOOP(
"(GameTypes)",
"AMIGA"),
"AMIGA",
"adf,ipf" },
25 { QT_TRANSLATE_NOOP(
"(GameTypes)",
"ATARI"),
"ATARI",
"bin,a26" },
26 { QT_TRANSLATE_NOOP(
"(GameTypes)",
"GAMEGEAR"),
"GAMEGEAR",
"gg" },
27 { QT_TRANSLATE_NOOP(
"(GameTypes)",
"GENESIS/MEGADRIVE"),
"GENESIS",
"smd,bin,md" },
28 { QT_TRANSLATE_NOOP(
"(GameTypes)",
"MAME"),
"MAME",
"" },
29 { QT_TRANSLATE_NOOP(
"(GameTypes)",
"N64"),
"N64",
"v64,n64" },
30 { QT_TRANSLATE_NOOP(
"(GameTypes)",
"NES"),
"NES",
"zip,nes" },
31 { QT_TRANSLATE_NOOP(
"(GameTypes)",
"PC GAME"),
"PC",
"" },
32 { QT_TRANSLATE_NOOP(
"(GameTypes)",
"PCE/TG16"),
"PCE",
"pce" },
33 { QT_TRANSLATE_NOOP(
"(GameTypes)",
"SEGA/MASTER SYSTEM"),
"SEGA",
"sms" },
34 { QT_TRANSLATE_NOOP(
"(GameTypes)",
"SNES"),
"SNES",
"zip,smc,sfc,fig,swc" }
39 auto sametype = [
GameType](
const auto & console)
40 {
return console.m_idStr ==
GameType; };
43 ? QCoreApplication::translate(
"(GameTypes)", con->m_nameStr.toUtf8())
49 auto sametype = [
GameType](
const auto & console)
50 {
return console.m_idStr ==
GameType; };
52 return (con !=
GameTypeList.cend()) ? con->m_extensions :
"";
59#define TR GameGeneralSettings::tr
64 gc->setLabel(
TR(
"Game display order"));
65 gc->setValue(
"system gamename");
66 gc->setHelpText(
TR(
"Order in which to sort the "
67 "games - this is for all "
68 "systems. Available choices: "
69 "system, year, genre and "
77 gc->setLabel(
TR(
"Favorite display order"));
78 gc->setValue(
"gamename");
79 gc->setHelpText(
TR(
"Order in which to sort the "
80 "games marked as favorites "
81 "- this is for all systems. "
82 "Available choices: system, "
83 "year, genre and gamename"));
90 gc->setLabel(
TR(
"Indepth Game Scan"));
92 TR(
"Enabling this causes a game scan to "
93 "gather CRC values and attempt to find out "
94 "more detailed information about the game: "
95 "NOTE this can greatly increase the time a "
96 "game scan takes based on the amount of "
104 gc->setLabel(
TR(
"Prompt for removal of deleted ROM(s)"));
105 gc->setHelpText(
TR(
"This enables a prompt for "
106 "removing deleted ROMs from "
107 "the database during a game "
116 gc->setLabel(
TR(
"Display Files Names in Game "
118 gc->setHelpText(
TR(
"Enabling this causes the "
119 "filenames to be displayed in "
120 "the game tree rather than the "
121 "trimmed/looked up game name"));
128 gc->setLabel(
TR(
"Hash filenames in display"));
130 gc->setHelpText(
TR(
"Enable hashing of names in "
131 "the display tree. This can "
132 "make navigating long lists "
140 gc->setLabel(
TR(
"Directory where Game Screenshots "
142 gc->setValue(
GetConfDir() +
"/MythGame/Screenshots");
143 gc->setHelpText(
TR(
"This directory will be the "
144 "default browse location when "
145 "assigning screenshots."));
152 gc->setLabel(
TR(
"Directory where Game Fanart is "
154 gc->setValue(
GetConfDir() +
"/MythGame/Fanart");
155 gc->setHelpText(
TR(
"This directory will be the "
156 "default browse location when "
157 "assigning fanart."));
164 gc->setLabel(
TR(
"Directory where Game Boxart is "
166 gc->setValue(
GetConfDir() +
"/MythGame/Boxart");
167 gc->setHelpText(
TR(
"This directory will be the "
168 "default browse location when "
169 "assigning boxart."));
175 setLabel(tr(
"MythGame Settings -- General"));
191#define TR GamePlayerSetting::tr
203 bindings.insert(
":PLAYERID",
m_id.
Value());
204 return "gameplayerid = :PLAYERID";
209 bindings.insert(
":SETPLAYERID",
m_id.
Value());
211 return QString(
"gameplayerid = :SETPLAYERID, "
240 setHelpText(
TR(
"Binary and optional parameters. Multiple commands "
241 "separated with \';\' . Use \%s for the ROM name. "
242 "\%d1, \%d2, \%d3 and \%d4 represent disks in a "
243 "multidisk/game. %s auto appended if not specified"));
257 console.m_nameStr.toUtf8()),
261 setHelpText(
TR(
"Type of Game/Emulator. Mostly for informational "
262 "purposes and has little effect on the "
263 "function of your system."));
273 setHelpText(
TR(
"Location of the ROM files for this emulator"));
283 setHelpText(
TR(
"Directory to change to before launching emulator. "
284 "Blank is usually fine"));
294 setHelpText(
TR(
"A comma separated list of all file extensions for this "
295 "emulator. Blank means any file under ROM PATH is "
296 "considered to be used with this emulator"));
305 setLabel(
TR(
"Allow games to span multiple ROMs/disks"));
306 setHelpText(
TR(
"This setting means that we will look for items like "
307 "game.1.rom, game.2.rom and consider them a single game."));
319 nameChild->setValue(name);
340 query.
prepare(
"DELETE FROM gameplayers "
341 "WHERE gameplayerid = :PLAYERID");
366 QString playerDisp = tr(
"%1 (%2)",
"Game player/emulator display");
369 query.
prepare(
"SELECT gameplayerid, playername, gametype "
371 "WHERE playername <> '' "
372 "ORDER BY playername;");
382 int id = query.
value(0).toInt();
383 QString name = query.
value(1).toString();
384 QString
type = query.
value(2).toString();
400 if (nameDialog->Create())
420 if (child->getName() == name)
422 LOG(VB_GENERAL, LOG_ERR,
423 QString(
"Player name %1 is already used").arg(name));
QString GetColumnName(void) const
GamePlayerSetting(const QString &name, uint id=0)
Settings for a game player.
void deleteEntry() override
void NewPlayerDialog() const
void CreateNewPlayer(const QString &name)
QSqlQuery wrapper that fetches a DB connection from the connection pool.
bool prepare(const QString &query)
QSqlQuery::prepare() is not thread safe in Qt <= 3.3.2.
QVariant value(int i) const
bool isActive(void) const
bool exec(void)
Wrap QSqlQuery::exec() so we can display SQL.
void bindValue(const QString &placeholder, const QVariant &val)
Add a single binding.
bool next(void)
Wrap QSqlQuery::next() so we can display the query results.
static MSqlQueryInfo InitCon(ConnectionReuse _reuse=kNormalConnection)
Only use this in combination with MSqlQuery constructor.
static void DBError(const QString &where, const MSqlQuery &query)
MythScreenStack * GetStack(const QString &Stackname)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Dialog prompting the user to enter a text string.
void addSelection(const QString &label, QString value=QString(), bool select=false)
void setValue(int value) override
Name(const PlayerId &parent)
virtual void addChild(StandardSetting *child)
virtual void setName(const QString &name)
virtual void clearSettings()
virtual void setHelpText(const QString &str)
void setVisible(bool visible)
virtual QList< StandardSetting * > * getSubSettings()
virtual void setLabel(QString str)
virtual QString GetDBValue(void) const =0
static HostTextEditSetting * GameFavTreeLevels()
static HostTextEditSetting * GetBoxartDir()
static HostTextEditSetting * GetFanartDir()
QString GetGameTypeName(const QString &GameType)
const std::array< GameTypes, 12 > GameTypeList
QString GetGameTypeExtensions(const QString &GameType)
static HostTextEditSetting * GameAllTreeLevels()
static HostCheckBoxSetting * GameShowFileNames()
static HostCheckBoxSetting * GameDeepScan()
static HostTextEditSetting * GetScreenshotDir()
static HostCheckBoxSetting * GameRemovalPrompt()
static HostCheckBoxSetting * GameTreeView()
QMap< QString, QVariant > MSqlBindings
typedef for a map of string -> string bindings for generic queries.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythMainWindow * GetMythMainWindow(void)
AllowMultipleRoms(const PlayerId &parent)
Command(const PlayerId &parent)
Extensions(const PlayerId &parent)
Game player database table reader/writer.
QString GetSetClause(MSqlBindings &bindings) const override
QString GetWhereClause(MSqlBindings &bindings) const override
GameDBStorage(StorageUser *user, const PlayerId &id, const QString &name)
GameType(const PlayerId &parent)
RomPath(const PlayerId &parent)
Base for Game textual settings.
TextEdit(const PlayerId &parent, const QString &column)
WorkingDirPath(const PlayerId &parent)