[mythtv] patch, show mouse cursor

Daniel Thor Kristjansson danielk at cat.nyu.edu
Wed Feb 18 16:52:50 EST 2004


This is a small patch that adds a "Hide Mouse Cursor" option to the
second screen in the appearance configuration in the frontend's config
menu. It defaults to hiding the mouse cursor as it Myth does now. But,
if you deselect the checkbox, you will see the mouse cursor on all
screens. This is useful if you run Myth on your main computer screen
and need to be able to find the mouse cursor.

-- Daniel
  << When truth is outlawed; only outlaws will tell the truth. >> - RLiegh
-------------- next part --------------
Index: libs/libmyth/mythdialogs.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/mythdialogs.cpp,v
retrieving revision 1.57
diff -u -r1.57 mythdialogs.cpp
--- libs/libmyth/mythdialogs.cpp	13 Feb 2004 05:57:16 -0000	1.57
+++ libs/libmyth/mythdialogs.cpp	18 Feb 2004 20:04:37 -0000
@@ -26,6 +26,7 @@
 #include "mythdialogs.h"
 #include "lcddevice.h"
 #include "mythmediamonitor.h"
+#include "mythcontext.h"
 
 #ifdef USE_LIRC
 static void *SpawnLirc(void *param)
@@ -201,8 +202,11 @@
     setFixedSize(QSize(d->screenwidth, d->screenheight));
 
     setFont(gContext->GetMediumFont());
-    setCursor(QCursor(Qt::BlankCursor));
-    qApp->setOverrideCursor(QCursor(Qt::BlankCursor));
+
+    bool hideCursor = gContext->GetNumSetting("GuiHideMouseCursor",1);
+    QCursor cursor = (hideCursor) ? (Qt::BlankCursor) : (Qt::ArrowCursor);
+    setCursor(cursor);
+    qApp->setOverrideCursor(cursor);
 
     gContext->ThemeWidget(this);
 
Index: programs/mythfrontend/main.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/main.cpp,v
retrieving revision 1.136
diff -u -r1.136 main.cpp
--- programs/mythfrontend/main.cpp	4 Feb 2004 02:30:21 -0000	1.136
+++ programs/mythfrontend/main.cpp	18 Feb 2004 20:04:38 -0000
@@ -682,7 +682,8 @@
                     ++argpos;
                 }
             }
-        } else if (!strcmp(a.argv()[argpos],"-v") ||
+	} 
+	else if (!strcmp(a.argv()[argpos],"-v") ||
             !strcmp(a.argv()[argpos],"--verbose"))
         {
             if (a.argc() > argpos)
Index: programs/mythfrontend/globalsettings.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/programs/mythfrontend/globalsettings.cpp,v
retrieving revision 1.139
diff -u -r1.139 globalsettings.cpp
--- programs/mythfrontend/globalsettings.cpp	16 Feb 2004 06:43:43 -0000	1.139
+++ programs/mythfrontend/globalsettings.cpp	18 Feb 2004 20:04:40 -0000
@@ -1038,6 +1038,17 @@
     };
 };
 
+class GuiHideMouseCursor: public CheckBoxSetting, public GlobalSetting {
+public:
+    GuiHideMouseCursor() :
+        GlobalSetting("GuiHideMouseCursor") {
+        setLabel(QObject::tr("Hide Mouse Cursor in Myth"));
+        setValue(true);
+        setHelpText(QObject::tr("If checked, the mouse cursor will be invisible."
+                                "If unchecked, the mouse cursor will be visible."));
+    };
+};
+
 class RunInWindow: public CheckBoxSetting, public GlobalSetting {
 public:
     RunInWindow():
@@ -1837,6 +1848,7 @@
     screen->addChild(new GuiOffsetX());
     screen->addChild(new GuiOffsetY());
     screen->addChild(new GuiSizeForTV());
+    screen->addChild(new GuiHideMouseCursor());
     screen->addChild(new RunInWindow());
     addChild(screen);
 


More information about the mythtv-dev mailing list