[pitivi/ges: 138/287] pitivi/ui/viewer.py: inhibit screensaver whilst previewing videos.
- From: Jean-FranÃois Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi/ges: 138/287] pitivi/ui/viewer.py: inhibit screensaver whilst previewing videos.
- Date: Thu, 15 Mar 2012 16:37:26 +0000 (UTC)
commit 845d91115875f5c699cce075a9013f244eac6a9e
Author: Stephen Griffiths <stevie craig griffiths gmail com>
Date: Thu Feb 17 15:52:11 2011 +1100
pitivi/ui/viewer.py: inhibit screensaver whilst previewing videos.
pitivi/ui/viewer.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/ui/viewer.py b/pitivi/ui/viewer.py
index b3b64f6..dc74475 100644
--- a/pitivi/ui/viewer.py
+++ b/pitivi/ui/viewer.py
@@ -80,6 +80,8 @@ class PitiviViewer(gtk.VBox, Loggable):
gobject.TYPE_NONE, (gobject.TYPE_BOOLEAN,)),
}
+ INHIBIT_REASON = _("Currently playing media")
+
"""
A Widget to control and visualize a Pipeline
@@ -94,6 +96,7 @@ class PitiviViewer(gtk.VBox, Loggable):
self.set_border_width(SPACING)
self.settings = app.settings
self.app = app
+ self.system = app.system
Loggable.__init__(self)
self.log("New PitiviViewer")
@@ -520,15 +523,19 @@ class PitiviViewer(gtk.VBox, Loggable):
self.info("current state changed : %s", state)
if int(state) == int(gst.STATE_PLAYING):
self.playpause_button.setPause()
+ self.system.inhibitScreensaver(self.INHIBIT_REASON)
elif int(state) == int(gst.STATE_PAUSED):
self.playpause_button.setPlay()
+ self.system.uninhibitScreensaver(self.INHIBIT_REASON)
else:
self.sink = None
+ self.system.uninhibitScreensaver(self.INHIBIT_REASON)
self.internal._currentStateCb(self.pipeline, state)
self.currentState = state
def _eosCb(self, unused_pipeline):
self.playpause_button.setPlay()
+ self.system.uninhibitScreensaver(self.INHIBIT_REASON)
def _elementMessageCb(self, unused_bus, message):
if message.type == gst.MESSAGE_ELEMENT:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]