[Kwintv] Patch to implement a sleep-timer TV function
George Staikos
kwintv@mail.kde.org
Wed, 16 Oct 2002 23:37:36 -0400
On October 16, 2002 16:57, Morten Brix Pedersen wrote:
> I don't know how other people use kwintv, but I prefer to watch TV from
> my bed with my remote control.
>
> I also like to fall asleep with the TV on, but I was missing the normal
> TV sleep-function where the TV turns off after X minutes.
It sounds like a great feature, but I think it should be put only in the
MainWindow client, and no others. We dont' want it triggering in the panel
applet or kpart in another app.
> So this patch is a shot at implementing it. It's probably possible to do
> better, but I'm not that acquainted with the qtvision sources yet.
>
> The logic is as follows:
>
> * When the user presses T or a button on the remote control, the
> sleep-timeout value gets changed. It starts at 15 minutes, goes on to
> 30, 60 and finally 120 minutes. When the same button is pressed while
> 120-minutes is set, the sleeper gets disabled.
>
>
> I need help with implementing the last function though:
> QtVision::slotSleepTimerTimeout() which is supposed to close the
> application. But I'm not sure how to do it correctly..
This causes a bit of a problem because the qtvision library (anything in
the toplevel directory) is used in all the clients. You don't want a user
trying to call exit() in a kpart in konqueror, for instance. If you can move
all of the code (literally all of it) into just the mainwindow client files,
then I would definitely apply it to CVS. To exit, just call
QApplication::exit().
--
George Staikos