<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE window SYSTEM "chrome://transerver/locale/transerver.dtd">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="utf-8" doctype-public="-//MOZILLA//DTD XUL V1.0//EN"/>
<xsl:template match="/root/task">
    <window id="list_tree"
        xmlns:html="http://www.w3.org/1999/xhtml"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
		flex="1"
        >     
		<listitem>
			 <xsl:for-each select="node">
				<xsl:choose>
					<xsl:when  test="@key='info.id'">
					   <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
					</xsl:when>
					<xsl:when  test="@key='info.title'">
						<listcell label=""></listcell>
						<listcell><xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute></listcell>
					</xsl:when>
					<xsl:when  test="@key='info.state'">
						<label style="display:none"><xsl:value-of select="."/></label>
						<listcell>
							<xsl:attribute name="label">
								<xsl:if test="@state='-1'">
									&task.state.notset;
								</xsl:if>
								<xsl:if test="@state='0'">
									&task.state.ready;
								</xsl:if>
								<xsl:if test="@state='1'">
									&task.state.encoding;
								</xsl:if>
								<xsl:if test="@state='2'">
									&task.state.prepare;
								</xsl:if>
								<xsl:if test="@state='3'">
									&task.state.muxing;
								</xsl:if>
								<xsl:if test="@state='4'">
									&task.state.paused;
								</xsl:if>
								<xsl:if test="@state='5'">
									&task.state.done;
								</xsl:if>
								<xsl:if test="@state='6'">
									&task.state.resumable;
								</xsl:if>
								<xsl:if test="@state='7'">
									&task.state.cancelled;
								</xsl:if>
								<xsl:if test="@state='8'">
									&task.state.error;(<xsl:value-of select="."/>)
								</xsl:if>
								<!--xsl:value-of select="."/-->
							</xsl:attribute>
						</listcell>
					</xsl:when>
					<xsl:when  test="@key='info.progress'">
						<listcell>
							<progressmeter>
							<xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
							</progressmeter>
						</listcell>
					</xsl:when>
					<xsl:when  test="@key='info.speed'">
						<listcell>
							<xsl:attribute name="label">
								<xsl:if test=". != 0.0">
									<xsl:value-of select="."/>fps
								</xsl:if>
							</xsl:attribute>
						</listcell>
					</xsl:when>
					<xsl:when  test="@key='info.elapsed.time'">
						<listcell>
							<xsl:attribute name="label">
								<xsl:if test=". != 0">
									<xsl:value-of select="."/>s
								</xsl:if>
							</xsl:attribute>
						</listcell>
					</xsl:when>
					<xsl:when  test="@key='info.task.priority'">
						<listcell>
							<xsl:attribute name="label">
								<xsl:if test=". = 0">
									&projec.taskList.priority.lowest;
								</xsl:if>
								<xsl:if test=". = 1">
									&projec.taskList.priority.low;
								</xsl:if>
								<xsl:if test=". = 2">
									&projec.taskList.priority.normal;
								</xsl:if>
								<xsl:if test=". = 3">
									&projec.taskList.priority.high;
								</xsl:if>
								<xsl:if test=". = 4">
									&projec.taskList.priority.highest;
								</xsl:if>
							</xsl:attribute>
						</listcell>
					</xsl:when>
					<xsl:when  test="@key='info.node.id'">
						<listcell>
							<xsl:attribute name="label">
								<xsl:if test=". != 0">
									<xsl:value-of select="."/>
								</xsl:if>
							</xsl:attribute>
						</listcell>
					</xsl:when>
				  <xsl:when  test="@key='info.node.filesize'">
						<listcell>
							<xsl:attribute name="label">
								<xsl:if test=". != 0">
									<xsl:value-of select="."/>
								</xsl:if>
							</xsl:attribute>
						</listcell>
					</xsl:when>
					<xsl:when test="@key='info.node.resolution'">
						<listcell>
							<xsl:attribute name="label">														
								<xsl:if test=". != 0">
									<xsl:value-of select="."/>
								</xsl:if>
							</xsl:attribute>
						</listcell>					
					</xsl:when>					
				</xsl:choose>
			 </xsl:for-each>
		</listitem>
    </window>
</xsl:template>
</xsl:stylesheet>
