[mythtv] [patch] Add screensaver status

Neil Whelchel koyama at firstlight.net
Tue Aug 17 21:17:19 EDT 2004


Hello,
I thought that the current state of the screensaver needed to be stored at
some place or another... Currently Myth has the functions to enable or
disable the builtin X11 screensaver, but there is really no way read the
state if the X11 builtin screensaver is disabled. (Change 0 -> 0)

This would be needed if anyone wanted to add any sort of an internal
screensaver or screensaver management to Myth.
Since I am writing a screensaver plugin, so I need it. ;)

-Neil Whelchel-
First Light Internet Services
760 366-0145
- We don't do Window$, that's what the janitor is for -

Bubble Memory, n.:
        A derogatory term, usually referring to a person's
intelligence.  See also "vacuum tube".



-------------- next part --------------
--- mythtv.dist/libs/libmyth/mythcontext.cpp Sat Aug  7 11:14:39 2004
+++ mythtv/libs/libmyth/mythcontext.cpp       Tue Aug 17 17:25:32 2004
@@ -92,6 +92,8 @@
     int m_logenable, m_logmaxcount, m_logprintlevel;
     QMap<QString,int> lastLogCounts;
     QMap<QString,QString> lastLogStrings;
+
+    bool screensaverEnabled;
 };

 MythContextPrivate::MythContextPrivate(MythContext *lparent)
@@ -1532,17 +1534,26 @@
 void MythContext::DoDisableScreensaver(void)
 {
     d->screensaver->Disable();
+    d->screensaverEnabled = false;
 }

 void MythContext::DoRestoreScreensaver(void)
 {
     d->screensaver->Restore();
+    d->screensaverEnabled = true;
 }

 void MythContext::DoResetScreensaver(void)
 {
     d->screensaver->Reset();
+    d->screensaverEnabled = false;
 }
+
+bool MythContext::GetScreensaverEnabled(void)
+{
+    return d->screensaverEnabled;
+}
+

 void MythContext::LogEntry(const QString &module, int priority,
                            const QString &message, const QString &details)


--- mythtv.dist/libs/libmyth/mythcontext.h   Sun Aug 15 15:38:28 2004
+++ mythtv/libs/libmyth/mythcontext.h Tue Aug 17 17:21:53 2004
@@ -213,6 +213,9 @@
     void DoDisableScreensaver(void);
     void DoRestoreScreensaver(void);
     void DoResetScreensaver(void);
+
+    // get the current status
+    bool GetScreensaverEnabled(void);

   private slots:
     void EventSocketRead();


More information about the mythtv-dev mailing list