Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
coherence
compere
Commits
10dcf88b
Commit
10dcf88b
authored
Jul 12, 2007
by
Frank Scholz
Browse files
* hide menus when the window loses the focus
* don't skip ''junked'' images when moving forward or backward
parent
357ba8ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
mediarenderer
View file @
10dcf88b
...
...
@@ -235,7 +235,7 @@ class MediaRenderer(object):
event_loop
=
task
.
LoopingCall
(
self
.
pygame_loop
)
event_loop
.
start
(
0.2
,
now
=
True
)
self
.
display_loop
=
task
.
LoopingCall
(
self
.
proceed_to_next_image
)
self
.
display_loop
=
task
.
LoopingCall
(
self
.
proceed_to_next_image
,
skip_junk
=
True
)
self
.
images
=
[]
self
.
container_watch
=
[]
...
...
@@ -307,7 +307,7 @@ class MediaRenderer(object):
self
.
screen
.
blit
(
self
.
current_image
,
self
.
displaying
)
pygame
.
display
.
update
(
self
.
displaying
)
def
proceed_to_next_image
(
self
):
def
proceed_to_next_image
(
self
,
skip_junk
=
False
):
if
len
(
self
.
images
)
>
0
:
self
.
loop_stop
()
while
True
:
...
...
@@ -318,7 +318,7 @@ class MediaRenderer(object):
self
.
image_index
=
0
image
=
self
.
images
[
self
.
image_index
]
print
image
if
image
.
has_key
(
'junk'
):
if
skip_junk
==
True
and
image
.
has_key
(
'junk'
):
continue
image_url
=
image
.
get
(
'url'
)
image_title
=
image
.
get
(
'title'
)
...
...
@@ -328,7 +328,7 @@ class MediaRenderer(object):
d
.
addErrback
(
self
.
got_error
,
image_url
)
break
def
proceed_to_previous_image
(
self
):
def
proceed_to_previous_image
(
self
,
skip_junk
=
False
):
if
len
(
self
.
images
)
>
0
:
self
.
loop_stop
()
while
True
:
...
...
@@ -339,7 +339,7 @@ class MediaRenderer(object):
self
.
image_index
=
len
(
self
.
images
)
-
1
image
=
self
.
images
[
self
.
image_index
]
print
image
if
image
.
has_key
(
'junk'
):
if
skip_junk
==
True
and
image
.
has_key
(
'junk'
):
continue
image_url
=
image
.
get
(
'url'
)
image_title
=
image
.
get
(
'title'
)
...
...
@@ -510,6 +510,12 @@ class MediaRenderer(object):
self
.
right_menu
.
hide
()
self
.
left_menu
.
hide
()
if
event
.
type
==
ACTIVEEVENT
:
if
event
.
state
==
1
and
event
.
gain
==
0
:
""" focus lost """
self
.
right_menu
.
hide
()
self
.
left_menu
.
hide
()
if
event
.
type
==
MOUSEBUTTONUP
:
self
.
left_menu
.
check
(
event
.
button
,
event
.
pos
)
self
.
right_menu
.
check
(
event
.
button
,
event
.
pos
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment