Skip to content

Commit

Permalink
Add --[no-]mouse-cursor command line option
Browse files Browse the repository at this point in the history
This adds an option to mythfrontend and mythtv-setup to allow manual
selection of whether the mouse cursor is hidden or not.  This implements
a database option override in the same manner as the --windowed
function.  This bumps the ABI version.
  • Loading branch information
wagnerrp committed Sep 5, 2011
1 parent a5bddd7 commit db2c895
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 14 deletions.
41 changes: 32 additions & 9 deletions mythtv/libs/libmythbase/mythcommandlineparser.cpp
Expand Up @@ -61,22 +61,32 @@ int GetTermWidth(void)

const char* NamedOptType(int type)
{
if (type == kEnd)
switch (type)
{
case kEnd:
return "kEnd";
else if (type == kEmpty)

case kEmpty:
return "kEmpty";
else if (type == kOptOnly)

case kOptOnly:
return "kOptOnly";
else if (type == kOptVal)

case kOptVal:
return "kOptVal";
else if (type == kArg)

case kArg:
return "kArg";
else if (type == kPassthrough)

case kPassthrough:
return "kPassthrough";
else if (type == kInvalid)

case kInvalid:
return "kInvalid";

return "kUnknown";
default:
return "kUnknown";
}
}

typedef struct helptmp {
Expand Down Expand Up @@ -677,6 +687,11 @@ QMap<QString,QString> MythCommandLineParser::GetSettingsOverride(void)
else if (toBool("notwindowed"))
smap["RunFrontendInWindow"] = "0";

if (toBool("mousecursor"))
smap["HideMouseCursor"] = "0";
else if (toBool("nomousecursor"))
smap["HideMouseCursor"] = "1";

m_overridesImported = true;

if (!smap.isEmpty())
Expand Down Expand Up @@ -909,7 +924,7 @@ void MythCommandLineParser::addVersion(void)
"and compiled options.");
}

void MythCommandLineParser::addWindowed(bool def)
void MythCommandLineParser::addWindowed(void)
{
add(QStringList( QStringList() << "-nw" << "--no-windowed" ),
"notwindowed", false,
Expand All @@ -918,6 +933,14 @@ void MythCommandLineParser::addWindowed(bool def)
false, "Force application to run in a window.", "");
}

void MythCommandLineParser::addMouse(void)
{
add("--mouse-cursor", "mousecursor", false,
"Force visibility of the mouse cursor.", "");
add("--no-mouse-cursor", "nomousecursor", false,
"Force the mouse cursor to be hidden.", "");
}

void MythCommandLineParser::addDaemon(void)
{
add(QStringList( QStringList() << "-d" << "--daemon" ), "daemon", false,
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libmythbase/mythcommandlineparser.h
Expand Up @@ -155,7 +155,8 @@ class MBASE_PUBLIC MythCommandLineParser

void addHelp(void);
void addVersion(void);
void addWindowed(bool);
void addWindowed(void);
void addMouse(void);
void addDaemon(void);
void addSettingsOverride(void);
void addRecording(void);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/mythversion.h
Expand Up @@ -12,7 +12,7 @@
/// Update this whenever the plug-in API changes.
/// Including changes in the libmythbase, libmyth, libmythtv, libmythav* and
/// libmythui class methods used by plug-ins.
#define MYTH_BINARY_VERSION "0.25.20110829-2"
#define MYTH_BINARY_VERSION "0.25.20110905-1"

/** \brief Increment this whenever the MythTV network protocol changes.
*
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythavtest/commandlineparser.cpp
Expand Up @@ -22,7 +22,7 @@ void MythAVTestCommandLineParser::LoadArguments(void)
addHelp();
addSettingsOverride();
addVersion();
addWindowed(false);
addWindowed();
addGeometry();
addDisplay();
addLogging();
Expand Down
3 changes: 2 additions & 1 deletion mythtv/programs/mythfrontend/commandlineparser.cpp
Expand Up @@ -15,7 +15,8 @@ void MythFrontendCommandLineParser::LoadArguments(void)
allowArgs();
addHelp();
addVersion();
addWindowed(false);
addWindowed();
addMouse();
addSettingsOverride();
addGeometry();
addDisplay();
Expand Down
3 changes: 2 additions & 1 deletion mythtv/programs/mythtv-setup/commandlineparser.cpp
Expand Up @@ -23,7 +23,8 @@ void MythTVSetupCommandLineParser::LoadArguments(void)
addHelp();
addSettingsOverride();
addVersion();
addWindowed(false);
addWindowed();
addMouse();
addGeometry();
addDisplay();
addLogging();
Expand Down

0 comments on commit db2c895

Please sign in to comment.