[pitivi] sourcelist: always display video before audio. Fixes #575957.
- From: Edward Hervey <edwardrv src gnome org>
- To: svn-commits-list gnome org
- Subject: [pitivi] sourcelist: always display video before audio. Fixes #575957.
- Date: Wed, 25 Mar 2009 14:46:07 -0400 (EDT)
commit b885cc881f7e7623858a70d316a12f690f8d1e22
Author: Alessandro Decina <alessandro decina collabora co uk>
Date: Wed Mar 25 16:07:35 2009 +0100
sourcelist: always display video before audio. Fixes #575957.
---
pitivi/ui/sourcelist.py | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/pitivi/ui/sourcelist.py b/pitivi/ui/sourcelist.py
index 8561338..2cb01f6 100644
--- a/pitivi/ui/sourcelist.py
+++ b/pitivi/ui/sourcelist.py
@@ -108,9 +108,14 @@ def beautify_stream(stream):
raise NotImplementedError
def beautify_factory(factory):
+ ranks = {VideoStream: 0, AudioStream: 1}
+ def stream_sort_key(stream):
+ return ranks[type(stream)]
+
+ streams = factory.getOutputStreams()
+ streams.sort(key=stream_sort_key)
return ("<b>" + unquote(factory.displayname) + "</b>\n" +
- "\n".join((beautify_stream(stream)
- for stream in factory.getOutputStreams())))
+ "\n".join((beautify_stream(stream) for stream in streams)))
class SourceList(gtk.VBox, Loggable):
""" Widget for listing sources """
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]