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