rebuild docs

This commit is contained in:
Damien Churchill 2009-07-12 23:33:54 +00:00
parent 26b4f4020b
commit c7db93e954
16 changed files with 1099 additions and 861 deletions

View File

@ -644,7 +644,7 @@ ul.inheritsList
</div> </div>
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Mon Jul 13 2009 00:34:03 GMT+0100 (BST)
</div> </div>
</body> </body>
</html> </html>

View File

@ -260,7 +260,7 @@ ul.inheritsList
</div> </div>
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> 2.1.0 on Mon Jul 13 2009 00:34:03 GMT+0100 (BST)
</div> </div>
</body> </body>
</html> </html>

View File

@ -306,7 +306,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Mon Jul 13 2009 00:34:03 GMT+0100 (BST)
</div> </div>
</body> </body>
</html> </html>

View File

@ -592,7 +592,7 @@ if seconds < 0</dd>
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Mon Jul 13 2009 00:34:03 GMT+0100 (BST)
</div> </div>
</body> </body>
</html> </html>

View File

@ -528,7 +528,7 @@ by <a href="../symbols/Deluge.Keys.html#.Grid">Deluge.Keys.Grid</a>.
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Mon Jul 13 2009 00:34:03 GMT+0100 (BST)
</div> </div>
</body> </body>
</html> </html>

View File

@ -306,7 +306,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Mon Jul 13 2009 00:34:03 GMT+0100 (BST)
</div> </div>
</body> </body>
</html> </html>

View File

@ -523,7 +523,7 @@ and set up various events that the UI will utilise.
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Mon Jul 13 2009 00:34:03 GMT+0100 (BST)
</div> </div>
</body> </body>
</html> </html>

View File

@ -319,7 +319,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Mon Jul 13 2009 00:34:03 GMT+0100 (BST)
</div> </div>
</body> </body>
</html> </html>

View File

@ -319,7 +319,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Mon Jul 13 2009 00:34:03 GMT+0100 (BST)
</div> </div>
</body> </body>
</html> </html>

View File

@ -847,7 +847,7 @@ ul.inheritsList
<!-- ============================== footer ================================= --> <!-- ============================== footer ================================= -->
<div class="fineprint" style="clear:both"> <div class="fineprint" style="clear:both">
Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Tue Jun 16 2009 19:13:08 GMT+0100 (BST) Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> 2.1.0 on Mon Jul 13 2009 00:34:03 GMT+0100 (BST)
</div> </div>
</body> </body>
</html> </html>

View File

@ -41,349 +41,515 @@
<span class='line'> 34</span> <span class='line'> 34</span>
<span class='line'> 35</span> </span><span class="NAME">Ext.namespace</span><span class="PUNC">(</span><span class="STRN">'Ext.deluge.add'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 35</span> </span><span class="NAME">Ext.namespace</span><span class="PUNC">(</span><span class="STRN">'Ext.deluge.add'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 36</span> </span><span class="NAME">Ext.deluge.add.OptionsPanel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.extend</span><span class="PUNC">(</span><span class="NAME">Ext.TabPanel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 36</span> </span><span class="NAME">Ext.deluge.add.OptionsPanel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.extend</span><span class="PUNC">(</span><span class="NAME">Ext.TabPanel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 37</span> <span class='line'> 37</span> </span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="NAME">constructor</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 38</span> </span><span class="NAME">torrents</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 39</span> </span><span class="WHIT"> </span><span class="NAME">config</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.apply</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 39</span>
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="NAME">region</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'south'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 40</span> </span><span class="WHIT"> </span><span class="NAME">constructor</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT"> </span><span class="NAME">margins</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'5 5 5 5'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 41</span> </span><span class="WHIT"> </span><span class="NAME">config</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.apply</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 42</span> </span><span class="WHIT"> </span><span class="NAME">activeTab</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 42</span> </span><span class="WHIT"> </span><span class="NAME">region</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'south'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">220</span><span class="WHIT"> <span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">margins</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'5 5 5 5'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 44</span> </span><span class="WHIT"> </span><span class="NAME">activeTab</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.OptionsPanel.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">220</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 46</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT"> <span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.OptionsPanel.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="NAME">initComponent</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 48</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.OptionsPanel.superclass.initComponent.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 49</span> </span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="NAME">this.files</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.add</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.tree.ColumnTree</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 50</span> </span><span class="NAME">initComponent</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">layout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'fit'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.OptionsPanel.superclass.initComponent.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Files'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">this.files</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.add</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.tree.ColumnTree</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="WHIT"> </span><span class="NAME">rootVisible</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 53</span> </span><span class="WHIT"> </span><span class="NAME">layout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'fit'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="NAME">autoScroll</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 54</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Files'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">170</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 55</span> </span><span class="WHIT"> </span><span class="NAME">rootVisible</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="NAME">border</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 56</span> </span><span class="WHIT"> </span><span class="NAME">autoScroll</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="NAME">animate</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 57</span> </span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">170</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT"> <span class='line'> 58</span> </span><span class="WHIT"> </span><span class="NAME">border</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="NAME">columns</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 59</span> </span><span class="WHIT"> </span><span class="NAME">animate</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="NAME">header</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Filename'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 60</span> </span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">275</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 61</span> </span><span class="NAME">columns</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT"> </span><span class="NAME">dataIndex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'filename'</span><span class="WHIT"> <span class='line'> 62</span> </span><span class="WHIT"> </span><span class="NAME">header</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Filename'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 63</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">275</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">header</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Size'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">dataIndex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'filename'</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">80</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 65</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="NAME">dataIndex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'size'</span><span class="WHIT"> <span class='line'> 66</span> </span><span class="WHIT"> </span><span class="NAME">header</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Size'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">80</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> <span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">dataIndex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'size'</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="NAME">root</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.tree.AsyncTreeNode</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 69</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'Files'</span><span class="WHIT"> <span class='line'> 70</span> </span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT"> <span class='line'> 71</span> </span><span class="NAME">root</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.tree.AsyncTreeNode</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 72</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'Files'</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.tree.TreeSorter</span><span class="PUNC">(</span><span class="NAME">this.files</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 73</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="NAME">folderSort</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> <span class='line'> 74</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 75</span> </span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.tree.TreeSorter</span><span class="PUNC">(</span><span class="NAME">this.files</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT"> <span class='line'> 76</span> </span><span class="WHIT"> </span><span class="NAME">folderSort</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="NAME">this.form</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 77</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="NAME">xtype</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'form'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 78</span> </span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">labelWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 79</span> </span><span class="NAME">this.optionsManager</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Deluge.OptionsManager</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="NAME">frame</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 80</span> </span><span class="WHIT"> </span><span class="NAME">defaults</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Options'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 81</span> </span><span class="WHIT"> </span><span class="STRN">'add_paused'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="NAME">bodyStyle</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'padding: 5px;'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 82</span> </span><span class="WHIT"> </span><span class="STRN">'compact_allocation'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="NAME">border</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 83</span> </span><span class="WHIT"> </span><span class="STRN">'download_location'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT"> <span class='line'> 84</span> </span><span class="WHIT"> </span><span class="STRN">'max_connections_per_torrent'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 85</span> <span class='line'> 85</span> </span><span class="WHIT"> </span><span class="STRN">'max_download_speed_per_torrent'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="NAME">items</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 86</span> </span><span class="WHIT"> </span><span class="STRN">'max_upload_slots_per_torrent'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="NAME">xtype</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'fieldset'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 87</span> </span><span class="WHIT"> </span><span class="STRN">'max_upload_speed_per_torrent'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Download Location'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 88</span> </span><span class="WHIT"> </span><span class="STRN">'prioritize_first_last_pieces'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="NAME">border</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 89</span> </span><span class="WHIT"> </span><span class="STRN">'file_priorities'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="NAME">defaultType</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'textfield'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 90</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="NAME">labelWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 91</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="NAME">items</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 92</span> </span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 93</span> </span><span class="NAME">this.form</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="NAME">labelSeperator</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 94</span> </span><span class="WHIT"> </span><span class="NAME">xtype</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'form'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'download_location'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 95</span> </span><span class="WHIT"> </span><span class="NAME">labelWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">330</span><span class="WHIT"> <span class='line'> 96</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Options'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">]</span><span class="WHIT"> <span class='line'> 97</span> </span><span class="WHIT"> </span><span class="NAME">bodyStyle</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'padding: 5px;'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">]</span><span class="WHIT"> <span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">border</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 99</span> </span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">170</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>100</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT"> <span class='line'>101</span> </span><span class="WHIT">
<span class='line'>102</span> </span><span class="NAME">clear</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>102</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fieldset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.form.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="NAME">this.clearFiles</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>103</span> </span><span class="WHIT"> </span><span class="NAME">xtype</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'fieldset'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>104</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Download Location'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT"> <span class='line'>105</span> </span><span class="WHIT"> </span><span class="NAME">border</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>106</span> </span><span class="NAME">clearFiles</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>106</span> </span><span class="WHIT"> </span><span class="NAME">autoHeight</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">root</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.files.getRootNode</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>107</span> </span><span class="WHIT"> </span><span class="NAME">defaultType</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'textfield'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">root.hasChildNodes</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">labelWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="NAME">root.cascade</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">node</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>109</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">node.parentNode</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">node.getOwnerTree</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>110</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="NAME">node.remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>111</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.bind</span><span class="PUNC">(</span><span class="STRN">'download_location'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fieldset.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>112</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>113</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'download_location'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT"> <span class='line'>114</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">400</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>115</span> </span><span class="NAME">getDefaults</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>115</span> </span><span class="WHIT"> </span><span class="NAME">labelSeparator</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> <span class='line'>116</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="STRN">'add_paused'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>117</span> </span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="STRN">'compact_allocation'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>118</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">panel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.form.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="STRN">'download_location'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>119</span> </span><span class="WHIT"> </span><span class="NAME">border</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="STRN">'max_connections_per_torrent'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">layout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'column'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="STRN">'max_download_speed_per_torrent'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>121</span> </span><span class="WHIT"> </span><span class="NAME">defaultType</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'fieldset'</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="STRN">'max_upload_slots_per_torrent'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>122</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="STRN">'max_upload_speed_per_torrent'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>123</span> </span><span class="WHIT"> </span><span class="NAME">fieldset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">panel.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="STRN">'prioritize_first_last_pieces'</span><span class="WHIT"> <span class='line'>124</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Allocation'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="PUNC">]</span><span class="WHIT"> <span class='line'>125</span> </span><span class="WHIT"> </span><span class="NAME">border</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.core.get_config_values</span><span class="PUNC">(</span><span class="NAME">keys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>126</span> </span><span class="WHIT"> </span><span class="NAME">autoHeight</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>127</span> </span><span class="WHIT"> </span><span class="NAME">defaultType</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'radio'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="NAME">this.defaults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>128</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">key</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>129</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">field</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.form.findField</span><span class="PUNC">(</span><span class="NAME">key</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>130</span>
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">field</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>131</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.bind</span><span class="PUNC">(</span><span class="STRN">'compact_allocation'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fieldset.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="NAME">field.setValue</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>132</span> </span><span class="WHIT"> </span><span class="NAME">xtype</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'radiogroup'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>133</span> </span><span class="WHIT"> </span><span class="NAME">columns</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">field</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.form.findField</span><span class="PUNC">(</span><span class="STRN">'compact_allocation'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>134</span> </span><span class="WHIT"> </span><span class="NAME">vertical</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">[</span><span class="STRN">'compact_allocation'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>135</span> </span><span class="WHIT"> </span><span class="NAME">labelSeparator</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="NAME">field.items.get</span><span class="PUNC">(</span><span class="STRN">'compact_allocation_true'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">setValue</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>136</span> </span><span class="WHIT"> </span><span class="NAME">items</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="NAME">field.items.get</span><span class="PUNC">(</span><span class="STRN">'compact_allocation_false'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">setValue</span><span class="PUNC">(</span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>137</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'compact_allocation'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>138</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="NAME">field.items.get</span><span class="PUNC">(</span><span class="STRN">'compact_allocation_false'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">setValue</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>139</span> </span><span class="WHIT"> </span><span class="NAME">inputValue</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT"> </span><span class="NAME">field.items.get</span><span class="PUNC">(</span><span class="STRN">'compact_allocation_true'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">setValue</span><span class="PUNC">(</span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>140</span> </span><span class="WHIT"> </span><span class="NAME">boxLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Full'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>141</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>142</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>142</span> </span><span class="WHIT"> </span><span class="NAME">labelSeparator</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> <span class='line'>143</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>144</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'compact_allocation'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>145</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>146</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>146</span> </span><span class="WHIT"> </span><span class="NAME">inputValue</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>147</span> <span class='line'>147</span> </span><span class="WHIT"> </span><span class="NAME">boxLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Compact'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>148</span> </span><span class="NAME">Ext.deluge.add.Window</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.extend</span><span class="PUNC">(</span><span class="NAME">Ext.Window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>148</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>149</span> </span><span class="WHIT"> </span><span class="NAME">initComponent</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>149</span> </span><span class="WHIT"> </span><span class="NAME">labelSeparator</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.Window.superclass.initComponent.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>150</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="NAME">this.addEvents</span><span class="PUNC">(</span><span class="WHIT"> <span class='line'>151</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT"> </span><span class="STRN">'beforeadd'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>152</span> </span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT"> </span><span class="STRN">'add'</span><span class="WHIT"> <span class='line'>153</span> </span><span class="NAME">fieldset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">panel.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>154</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Bandwidth'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>155</span> </span><span class="WHIT"> </span><span class="NAME">border</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT"> <span class='line'>156</span> </span><span class="WHIT"> </span><span class="NAME">autoHeight</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>157</span> </span><span class="NAME">createTorrentId</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>157</span> </span><span class="WHIT"> </span><span class="NAME">labelWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>158</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">200</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>159</span> </span><span class="WHIT"> </span><span class="NAME">defaultType</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'uxspinner'</span><span class="WHIT">
<span class='line'>160</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>160</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>161</span> <span class='line'>161</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.bind</span><span class="PUNC">(</span><span class="STRN">'max_download_speed_per_torrent'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fieldset.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>162</span> </span><span class="NAME">Ext.deluge.add.AddWindow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.extend</span><span class="PUNC">(</span><span class="NAME">Ext.deluge.add.Window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>162</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Max Down Speed'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT"> <span class='line'>163</span> </span><span class="WHIT"> </span><span class="COMM">/*labelStyle: 'margin-left: 10px',*/</span><span class="WHIT">
<span class='line'>164</span> </span><span class="NAME">torrents</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>164</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'max_download_speed_per_torrent'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT"> <span class='line'>165</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="WHIT">
<span class='line'>166</span> </span><span class="NAME">constructor</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>166</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>167</span> </span><span class="WHIT"> </span><span class="NAME">config</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.apply</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>167</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.bind</span><span class="PUNC">(</span><span class="STRN">'max_upload_speed_per_torrent'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fieldset.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Add Torrents'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>168</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Max Up Speed'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT"> </span><span class="NAME">layout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'border'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>169</span> </span><span class="WHIT"> </span><span class="COMM">/*labelStyle: 'margin-left: 10px',*/</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">470</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>170</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'max_upload_speed_per_torrent'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">450</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>171</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT"> </span><span class="NAME">bodyStyle</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'padding: 10px 5px;'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>172</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="NAME">buttonAlign</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'right'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>173</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.bind</span><span class="PUNC">(</span><span class="STRN">'max_connections_per_torrent'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fieldset.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT"> </span><span class="NAME">closeAction</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'hide'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>174</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Max Connections'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT"> </span><span class="NAME">closable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>175</span> </span><span class="WHIT"> </span><span class="COMM">/*labelStyle: 'margin-left: 10px',*/</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="NAME">plain</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>176</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'max_connections_per_torrent'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-add-window-icon'</span><span class="WHIT"> <span class='line'>177</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>178</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>179</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.AddWindow.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>179</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.bind</span><span class="PUNC">(</span><span class="STRN">'max_upload_slots_per_torrent'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fieldset.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>180</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Max Upload Slots'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT"> <span class='line'>181</span> </span><span class="WHIT"> </span><span class="COMM">/*labelStyle: 'margin-left: 10px',*/</span><span class="WHIT">
<span class='line'>182</span> </span><span class="NAME">initComponent</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>182</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'max_upload_slots_per_torrent'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.AddWindow.superclass.initComponent.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>183</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT"> <span class='line'>184</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>185</span> </span><span class="NAME">this.addButton</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Cancel'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onCancel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>185</span> </span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="NAME">this.addButton</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Add'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onAdd</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>186</span> </span><span class="NAME">fieldset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">panel.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT"> <span class='line'>187</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'General'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>188</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">torrentRenderer</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">r</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>188</span> </span><span class="WHIT"> </span><span class="NAME">border</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">r.data</span><span class="PUNC">[</span><span class="STRN">'info_hash'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>189</span> </span><span class="WHIT"> </span><span class="NAME">autoHeight</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">String.format</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="x-deluge-add-torrent-name">{0}&lt;/div>'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>190</span> </span><span class="WHIT"> </span><span class="NAME">defaultType</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'checkbox'</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>191</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">String.format</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="x-deluge-add-torrent-name-loading">{0}&lt;/div>'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>192</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.bind</span><span class="PUNC">(</span><span class="STRN">'add_paused'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fieldset.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>193</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'add_paused'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>194</span> </span><span class="WHIT"> </span><span class="NAME">boxLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Add In Paused State'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT"> <span class='line'>195</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>196</span> </span><span class="NAME">this.grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>196</span> </span><span class="WHIT"> </span><span class="NAME">labelSeparator</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT"> </span><span class="NAME">xtype</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'grid'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>197</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT"> </span><span class="NAME">region</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'center'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>198</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.bind</span><span class="PUNC">(</span><span class="STRN">'prioritize_first_last_pieces'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fieldset.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT"> </span><span class="NAME">store</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.data.SimpleStore</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>199</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'prioritize_first_last_pieces'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT"> </span><span class="NAME">fields</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> <span class='line'>200</span> </span><span class="WHIT"> </span><span class="NAME">boxLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Prioritize First/Last Pieces'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'info_hash'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mapping</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>201</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'text'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mapping</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>202</span> </span><span class="WHIT"> </span><span class="NAME">labelSeparator</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>203</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>204</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> <span class='line'>204</span> </span><span class="WHIT">
<span class='line'>205</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>205</span> </span><span class="NAME">this.form.on</span><span class="PUNC">(</span><span class="STRN">'render'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onFormRender</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT"> </span><span class="NAME">columns</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>206</span> </span><span class="WHIT"> </span><span class="NAME">this.form.disable</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'torrent'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>207</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">150</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>208</span> </span><span class="WHIT">
<span class='line'>209</span> </span><span class="WHIT"> </span><span class="NAME">sortable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>209</span> </span><span class="NAME">onFormRender</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">form</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT"> </span><span class="NAME">renderer</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">torrentRenderer</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>210</span> </span><span class="WHIT"> </span><span class="NAME">form.layout</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.layout.FormLayout</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>211</span> </span><span class="WHIT"> </span><span class="NAME">dataIndex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'text'</span><span class="WHIT"> <span class='line'>211</span> </span><span class="WHIT"> </span><span class="NAME">form.layout.setContainer</span><span class="PUNC">(</span><span class="NAME">form</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>212</span> </span><span class="WHIT"> </span><span class="NAME">form.doLayout</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>213</span> </span><span class="NAME">stripeRows</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>213</span> </span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="NAME">selModel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.grid.RowSelectionModel</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>214</span> </span><span class="NAME">this.optionsManager.changeId</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT"> </span><span class="NAME">singleSelect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>215</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT"> </span><span class="NAME">listeners</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>216</span> </span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT"> </span><span class="STRN">'rowselect'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>217</span> </span><span class="NAME">addTorrent</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">torrent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT"> </span><span class="NAME">fn</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onSelect</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>218</span> </span><span class="WHIT"> </span><span class="NAME">this.torrents</span><span class="PUNC">[</span><span class="NAME">torrent</span><span class="PUNC">[</span><span class="STRN">'info_hash'</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">torrent</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> <span class='line'>219</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fileIndexes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>220</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>220</span> </span><span class="WHIT"> </span><span class="NAME">this.walkFileTree</span><span class="PUNC">(</span><span class="NAME">torrent</span><span class="PUNC">[</span><span class="STRN">'files_tree'</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">filename</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">entry</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">parent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>221</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>221</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'file'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>222</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>222</span> </span><span class="WHIT"> </span><span class="NAME">fileIndexes</span><span class="PUNC">[</span><span class="NAME">entry</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">entry</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>223</span> </span><span class="WHIT"> </span><span class="NAME">hideHeaders</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>223</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>224</span> </span><span class="WHIT"> </span><span class="NAME">autoExpandColumn</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'torrent'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>224</span> </span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT"> </span><span class="NAME">deferredRender</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>225</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">priorities</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT"> </span><span class="NAME">autoScroll</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>226</span> </span><span class="WHIT"> </span><span class="NAME">Ext.each</span><span class="PUNC">(</span><span class="NAME">Ext.keys</span><span class="PUNC">(</span><span class="NAME">fileIndexes</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">index</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="NAME">margins</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'5 5 5 5'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>227</span> </span><span class="WHIT"> </span><span class="NAME">priorities</span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">fileIndexes</span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT"> </span><span class="NAME">bbar</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.Toolbar</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>228</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT"> </span><span class="NAME">items</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>229</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.set</span><span class="PUNC">(</span><span class="NAME">torrent</span><span class="PUNC">[</span><span class="STRN">'info_hash'</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'file_priorities'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">priorities</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'file'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>230</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>231</span> </span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-add-file'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>232</span> </span><span class="NAME">clear</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'File'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>233</span> </span><span class="WHIT"> </span><span class="NAME">this.clearFiles</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>234</span> </span><span class="WHIT"> </span><span class="NAME">handler</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onFile</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>234</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> <span class='line'>235</span> </span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>236</span> </span><span class="NAME">clearFiles</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>237</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'url'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>237</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">root</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.files.getRootNode</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>238</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">root.hasChildNodes</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Url'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>239</span> </span><span class="WHIT"> </span><span class="NAME">root.cascade</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">node</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/icons/add_url.png'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>240</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">node.parentNode</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">node.getOwnerTree</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>241</span> </span><span class="WHIT"> </span><span class="NAME">handler</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onUrl</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>241</span> </span><span class="WHIT"> </span><span class="NAME">node.remove</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> <span class='line'>242</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>243</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'infohash'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>244</span> </span><span class="WHIT">
<span class='line'>245</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>245</span> </span><span class="NAME">getDefaults</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Infohash'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>246</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">keys</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">'add_paused'</span><span class="PUNC">,</span><span class="STRN">'compact_allocation'</span><span class="PUNC">,</span><span class="STRN">'download_location'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/icons/add_magnet.png'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>247</span> </span><span class="WHIT"> </span><span class="STRN">'max_connections_per_torrent'</span><span class="PUNC">,</span><span class="STRN">'max_download_speed_per_torrent'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>248</span> </span><span class="WHIT"> </span><span class="NAME">disabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> <span class='line'>248</span> </span><span class="WHIT"> </span><span class="STRN">'max_upload_slots_per_torrent'</span><span class="PUNC">,</span><span class="STRN">'max_upload_speed_per_torrent'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>249</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'->'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>249</span> </span><span class="WHIT"> </span><span class="STRN">'prioritize_first_last_pieces'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>250</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'remove'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>250</span> </span><span class="WHIT">
<span class='line'>251</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>251</span> </span><span class="NAME">Deluge.Client.core.get_config_values</span><span class="PUNC">(</span><span class="NAME">keys</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>252</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Remove'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>252</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>253</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/icons/remove.png'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>253</span> </span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">[</span><span class="STRN">'file_priorities'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>254</span> </span><span class="WHIT"> </span><span class="NAME">handler</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onRemove</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>254</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.defaults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> <span class='line'>255</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>256</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">]</span><span class="WHIT"> <span class='line'>256</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>257</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT"> <span class='line'>257</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>258</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>259</span> </span><span class="WHIT"> <span class='line'>259</span> </span><span class="WHIT">
<span class='line'>260</span> </span><span class="NAME">this.options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.add</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.OptionsPanel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>260</span> </span><span class="NAME">getFilename</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">torrentId</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT"> </span><span class="NAME">this.on</span><span class="PUNC">(</span><span class="STRN">'show'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onShow</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>261</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.torrents</span><span class="PUNC">[</span><span class="NAME">torrentId</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="STRN">'filename'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>262</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>262</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>263</span> </span><span class="WHIT"> <span class='line'>263</span> </span><span class="WHIT">
<span class='line'>264</span> </span><span class="NAME">clear</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>264</span> </span><span class="NAME">getOptions</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">torrentId</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>265</span> </span><span class="WHIT"> </span><span class="NAME">this.torrents</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>265</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.optionsManager.get</span><span class="PUNC">(</span><span class="NAME">torrentId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>266</span> </span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeAll</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>266</span> </span><span class="WHIT"> </span><span class="NAME">Ext.each</span><span class="PUNC">(</span><span class="NAME">options</span><span class="PUNC">[</span><span class="STRN">'file_priorities'</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">priority</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">index</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT"> </span><span class="NAME">this.options.clear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>267</span> </span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">[</span><span class="STRN">'file_priorities'</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">index</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">priority</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>268</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>268</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT"> <span class='line'>269</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>270</span> </span><span class="NAME">onAdd</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>270</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT"> </span><span class="NAME">torrents</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>271</span> </span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">id</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">this.torrents</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>272</span> </span><span class="NAME">setTorrent</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">torrentId</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.torrents</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>273</span> </span><span class="WHIT"> </span><span class="NAME">this.torrentId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">torrentId</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT"> </span><span class="NAME">torrents.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>274</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.changeId</span><span class="PUNC">(</span><span class="NAME">torrentId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>275</span> </span><span class="WHIT"> </span><span class="NAME">path</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">[</span><span class="STRN">'filename'</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>275</span> </span><span class="WHIT">
<span class='line'>276</span> </span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>276</span> </span><span class="NAME">this.clearFiles</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>277</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>277</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">root</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.files.getRootNode</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>278</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>278</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">priorities</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.optionsManager.get</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'file_priorities'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.add_torrents</span><span class="PUNC">(</span><span class="NAME">torrents</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>279</span> </span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>280</span> </span><span class="NAME">this.walkFileTree</span><span class="PUNC">(</span><span class="NAME">this.torrents</span><span class="PUNC">[</span><span class="NAME">torrentId</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="STRN">'files_tree'</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">filename</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">entry</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">parent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>281</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>281</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'dir'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>282</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT"> <span class='line'>282</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">folder</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.tree.TreeNode</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT"> </span><span class="NAME">this.clear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>283</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">filename</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT"> </span><span class="NAME">this.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>284</span> </span><span class="WHIT"> </span><span class="NAME">checked</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>285</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT"> <span class='line'>286</span> </span><span class="WHIT"> </span><span class="NAME">folder.on</span><span class="PUNC">(</span><span class="STRN">'checkchange'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onFolderCheck</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>287</span> </span><span class="NAME">onCancel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>287</span> </span><span class="WHIT"> </span><span class="NAME">parent.appendChild</span><span class="PUNC">(</span><span class="NAME">folder</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT"> </span><span class="NAME">this.clear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>288</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">folder</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT"> </span><span class="NAME">this.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>289</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>290</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>290</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">node</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.tree.TreeNode</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>291</span> </span><span class="WHIT"> <span class='line'>291</span> </span><span class="WHIT"> </span><span class="NAME">filename</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">filename</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>292</span> </span><span class="NAME">onFile</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>292</span> </span><span class="WHIT"> </span><span class="NAME">fileindex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">entry</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>293</span> </span><span class="WHIT"> </span><span class="NAME">this.file.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>293</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">filename</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// this needs to be here for sorting reasons</span><span class="WHIT">
<span class='line'>294</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>294</span> </span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">fsize</span><span class="PUNC">(</span><span class="NAME">entry</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT"> <span class='line'>295</span> </span><span class="WHIT"> </span><span class="NAME">leaf</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>296</span> </span><span class="NAME">onRemove</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>296</span> </span><span class="WHIT"> </span><span class="NAME">checked</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">priorities</span><span class="PUNC">[</span><span class="NAME">entry</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getSelectionModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>297</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-file'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">selection.hasSelection</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>298</span> </span><span class="WHIT"> </span><span class="NAME">uiProvider</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.tree.ColumnNodeUI</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">torrent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">selection.getSelected</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>299</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>300</span> </span><span class="WHIT"> <span class='line'>300</span> </span><span class="WHIT"> </span><span class="NAME">node.on</span><span class="PUNC">(</span><span class="STRN">'checkchange'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onNodeCheck</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>301</span> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">this.torrents</span><span class="PUNC">[</span><span class="NAME">torrent.id</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>301</span> </span><span class="WHIT"> </span><span class="NAME">parent.appendChild</span><span class="PUNC">(</span><span class="NAME">node</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>302</span> </span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="NAME">torrent</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>302</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>303</span> </span><span class="WHIT"> </span><span class="NAME">this.options.clear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>303</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">root</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>304</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>304</span> </span><span class="WHIT"> </span><span class="NAME">root.firstChild.expand</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>305</span> </span><span class="WHIT"> <span class='line'>305</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>306</span> </span><span class="NAME">onSelect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">selModel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">record</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>306</span> </span><span class="WHIT">
<span class='line'>307</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">torrentInfo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.torrents</span><span class="PUNC">[</span><span class="NAME">record.get</span><span class="PUNC">(</span><span class="STRN">'info_hash'</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>307</span> </span><span class="NAME">walkFileTree</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">files</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">parent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>308</span> </span><span class="WHIT"> <span class='line'>308</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">filename</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">files</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>309</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">walk</span><span class="PUNC">(</span><span class="NAME">files</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">parent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>309</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">entry</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">files</span><span class="PUNC">[</span><span class="NAME">filename</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>310</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">file</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">files</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>310</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">entry</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'dir'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'file'</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>311</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">item</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">files</span><span class="PUNC">[</span><span class="NAME">file</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>311</span> </span><span class="WHIT">
<span class='line'>312</span> </span><span class="WHIT"> <span class='line'>312</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">scope</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>313</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">item</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>313</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">callback.apply</span><span class="PUNC">(</span><span class="NAME">scope</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">filename</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">entry</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">parent</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>314</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">child</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.tree.TreeNode</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>314</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>315</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">file</span><span class="WHIT"> <span class='line'>315</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">(</span><span class="NAME">filename</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">type</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">entry</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">parent</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>316</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>317</span> </span><span class="WHIT"> </span><span class="NAME">walk</span><span class="PUNC">(</span><span class="NAME">item</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">child</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>317</span> </span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT"> </span><span class="NAME">parent.appendChild</span><span class="PUNC">(</span><span class="NAME">child</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>318</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'dir'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.walkFileTree</span><span class="PUNC">(</span><span class="NAME">entry</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>319</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>319</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>320</span> </span><span class="WHIT"> </span><span class="NAME">parent.appendChild</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.tree.TreeNode</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>320</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>321</span> </span><span class="WHIT"> </span><span class="NAME">filename</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>321</span> </span><span class="WHIT">
<span class='line'>322</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// this needs to be here for sorting reasons</span><span class="WHIT"> <span class='line'>322</span> </span><span class="NAME">onFolderCheck</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">node</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checked</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>323</span> </span><span class="WHIT"> </span><span class="NAME">size</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">fsize</span><span class="PUNC">(</span><span class="NAME">item</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>323</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">priorities</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.optionsManager.get</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'file_priorities'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>324</span> </span><span class="WHIT"> </span><span class="NAME">leaf</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>324</span> </span><span class="WHIT"> </span><span class="NAME">node.cascade</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">child</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>325</span> </span><span class="WHIT"> </span><span class="NAME">checked</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">item</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>325</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">child.ui.checkbox</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>326</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-file'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>326</span> </span><span class="WHIT"> </span><span class="NAME">child.attributes.checked</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">checked</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>327</span> </span><span class="WHIT"> </span><span class="NAME">uiProvider</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.tree.ColumnNodeUI</span><span class="WHIT"> <span class='line'>327</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>328</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>328</span> </span><span class="WHIT"> </span><span class="NAME">child.ui.checkbox.checked</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">checked</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>329</span> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>329</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>330</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>330</span> </span><span class="WHIT"> </span><span class="NAME">priorities</span><span class="PUNC">[</span><span class="NAME">child.attributes.fileindex</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">checked</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>331</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>331</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>332</span> </span><span class="WHIT"> <span class='line'>332</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.update</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'file_priorities'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">priorities</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>333</span> </span><span class="NAME">this.options.clearFiles</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>333</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>334</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">root</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.options.files.getRootNode</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>334</span> </span><span class="WHIT">
<span class='line'>335</span> </span><span class="WHIT"> </span><span class="NAME">walk</span><span class="PUNC">(</span><span class="NAME">torrentInfo</span><span class="PUNC">[</span><span class="STRN">'files_tree'</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">root</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>335</span> </span><span class="NAME">onNodeCheck</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">node</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">checked</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>336</span> </span><span class="WHIT"> </span><span class="NAME">root.firstChild.expand</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>336</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">priorities</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.optionsManager.get</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'file_priorities'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>337</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>337</span> </span><span class="WHIT"> </span><span class="NAME">priorities</span><span class="PUNC">[</span><span class="NAME">node.attributes.fileindex</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">checked</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>338</span> </span><span class="WHIT"> <span class='line'>338</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.update</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'file_priorities'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">priorities</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>339</span> </span><span class="NAME">onShow</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>339</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>340</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.url</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>340</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>341</span> </span><span class="WHIT"> </span><span class="NAME">this.url</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.UrlWindow</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>341</span>
<span class='line'>342</span> </span><span class="WHIT"> </span><span class="NAME">this.url.on</span><span class="PUNC">(</span><span class="STRN">'beforeadd'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onTorrentBeforeAdd</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>342</span> </span><span class="NAME">Ext.deluge.add.Window</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.extend</span><span class="PUNC">(</span><span class="NAME">Ext.Window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>343</span> </span><span class="WHIT"> </span><span class="NAME">this.url.on</span><span class="PUNC">(</span><span class="STRN">'add'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onTorrentAdd</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>343</span> </span><span class="WHIT"> </span><span class="NAME">initComponent</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>344</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>344</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.Window.superclass.initComponent.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>345</span> </span><span class="WHIT"> <span class='line'>345</span> </span><span class="WHIT"> </span><span class="NAME">this.addEvents</span><span class="PUNC">(</span><span class="WHIT">
<span class='line'>346</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.file</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>346</span> </span><span class="WHIT"> </span><span class="STRN">'beforeadd'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>347</span> </span><span class="WHIT"> </span><span class="NAME">this.file</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.FileWindow</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>347</span> </span><span class="WHIT"> </span><span class="STRN">'add'</span><span class="WHIT">
<span class='line'>348</span> </span><span class="WHIT"> </span><span class="NAME">this.file.on</span><span class="PUNC">(</span><span class="STRN">'beforeadd'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onTorrentBeforeAdd</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>348</span> </span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>349</span> </span><span class="WHIT"> </span><span class="NAME">this.file.on</span><span class="PUNC">(</span><span class="STRN">'add'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onTorrentAdd</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>349</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>350</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>350</span> </span><span class="WHIT">
<span class='line'>351</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>351</span> </span><span class="NAME">createTorrentId</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>352</span> </span><span class="WHIT"> <span class='line'>352</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>353</span> </span><span class="NAME">onTorrentBeforeAdd</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>353</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>354</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">store</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>354</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>355</span> </span><span class="WHIT"> </span><span class="NAME">store.loadData</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="PUNC">[</span><span class="NAME">torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>355</span>
<span class='line'>356</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>356</span> </span><span class="NAME">Ext.deluge.add.AddWindow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.extend</span><span class="PUNC">(</span><span class="NAME">Ext.deluge.add.Window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>357</span> </span><span class="WHIT"> <span class='line'>357</span> </span><span class="WHIT">
<span class='line'>358</span> </span><span class="NAME">onTorrentAdd</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>358</span> </span><span class="NAME">constructor</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>359</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">info</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>359</span> </span><span class="WHIT"> </span><span class="NAME">config</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.apply</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>360</span> </span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.show</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>360</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Add Torrents'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>361</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Error'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>361</span> </span><span class="WHIT"> </span><span class="NAME">layout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'border'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>362</span> </span><span class="WHIT"> </span><span class="NAME">msg</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Not a valid torrent'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>362</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">470</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>363</span> </span><span class="WHIT"> </span><span class="NAME">buttons</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.OK</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>363</span> </span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">450</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>364</span> </span><span class="WHIT"> </span><span class="NAME">modal</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>364</span> </span><span class="WHIT"> </span><span class="NAME">bodyStyle</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'padding: 10px 5px;'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>365</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.ERROR</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>365</span> </span><span class="WHIT"> </span><span class="NAME">buttonAlign</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'right'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>366</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-icon-error'</span><span class="WHIT"> <span class='line'>366</span> </span><span class="WHIT"> </span><span class="NAME">closeAction</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'hide'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>367</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>367</span> </span><span class="WHIT"> </span><span class="NAME">closable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>368</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>368</span> </span><span class="WHIT"> </span><span class="NAME">plain</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>369</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>369</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-add-window-icon'</span><span class="WHIT">
<span class='line'>370</span> </span><span class="WHIT"> <span class='line'>370</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>371</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getById</span><span class="PUNC">(</span><span class="NAME">torrentId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>371</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.AddWindow.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>372</span> </span><span class="WHIT"> </span><span class="NAME">r.set</span><span class="PUNC">(</span><span class="STRN">'info_hash'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">[</span><span class="STRN">'info_hash'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>372</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>373</span> </span><span class="WHIT"> </span><span class="NAME">r.set</span><span class="PUNC">(</span><span class="STRN">'text'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">[</span><span class="STRN">'name'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>373</span> </span><span class="WHIT">
<span class='line'>374</span> </span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">commitChanges</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>374</span> </span><span class="NAME">initComponent</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>375</span> </span><span class="WHIT"> </span><span class="NAME">this.torrents</span><span class="PUNC">[</span><span class="NAME">info</span><span class="PUNC">[</span><span class="STRN">'info_hash'</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>375</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.AddWindow.superclass.initComponent.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>376</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>376</span> </span><span class="WHIT">
<span class='line'>377</span> </span><span class="WHIT"> <span class='line'>377</span> </span><span class="NAME">this.addButton</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Cancel'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onCancel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>378</span> </span><span class="NAME">onUrl</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">button</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>378</span> </span><span class="WHIT"> </span><span class="NAME">this.addButton</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Add'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onAdd</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>379</span> </span><span class="WHIT"> </span><span class="NAME">this.url.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>379</span> </span><span class="WHIT">
<span class='line'>380</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>380</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">torrentRenderer</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">r</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>381</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>381</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">r.data</span><span class="PUNC">[</span><span class="STRN">'info_hash'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>382</span> </span><span class="NAME">Deluge.Add</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.AddWindow</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html> <span class='line'>382</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">String.format</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="x-deluge-add-torrent-name">{0}&lt;/div>'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>383</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>384</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">String.format</span><span class="PUNC">(</span><span class="STRN">'&lt;div class="x-deluge-add-torrent-name-loading">{0}&lt;/div>'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>385</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>386</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>387</span> </span><span class="WHIT">
<span class='line'>388</span> </span><span class="NAME">this.grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>389</span> </span><span class="WHIT"> </span><span class="NAME">xtype</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'grid'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>390</span> </span><span class="WHIT"> </span><span class="NAME">region</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'center'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>391</span> </span><span class="WHIT"> </span><span class="NAME">store</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.data.SimpleStore</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>392</span> </span><span class="WHIT"> </span><span class="NAME">fields</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
<span class='line'>393</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'info_hash'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mapping</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>394</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'text'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mapping</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>395</span> </span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>396</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>398</span> </span><span class="WHIT"> </span><span class="NAME">columns</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>399</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'torrent'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>400</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">150</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>401</span> </span><span class="WHIT"> </span><span class="NAME">sortable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>402</span> </span><span class="WHIT"> </span><span class="NAME">renderer</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">torrentRenderer</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>403</span> </span><span class="WHIT"> </span><span class="NAME">dataIndex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'text'</span><span class="WHIT">
<span class='line'>404</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>405</span> </span><span class="NAME">stripeRows</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>406</span> </span><span class="WHIT"> </span><span class="NAME">selModel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.grid.RowSelectionModel</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>407</span> </span><span class="WHIT"> </span><span class="NAME">singleSelect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>408</span> </span><span class="WHIT"> </span><span class="NAME">listeners</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>409</span> </span><span class="WHIT"> </span><span class="STRN">'rowselect'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>410</span> </span><span class="WHIT"> </span><span class="NAME">fn</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onSelect</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>411</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>412</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>413</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>414</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>415</span> </span><span class="WHIT"> </span><span class="NAME">hideHeaders</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>416</span> </span><span class="WHIT"> </span><span class="NAME">autoExpandColumn</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'torrent'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>417</span> </span><span class="WHIT"> </span><span class="NAME">deferredRender</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>418</span> </span><span class="WHIT"> </span><span class="NAME">autoScroll</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>419</span> </span><span class="WHIT"> </span><span class="NAME">margins</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'5 5 5 5'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>420</span> </span><span class="WHIT"> </span><span class="NAME">bbar</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.Toolbar</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>421</span> </span><span class="WHIT"> </span><span class="NAME">items</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>422</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'file'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>423</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>424</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-add-file'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>425</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'File'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>426</span> </span><span class="WHIT"> </span><span class="NAME">handler</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onFile</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>427</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>428</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>429</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'url'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>430</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>431</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Url'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>432</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/icons/add_url.png'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>433</span> </span><span class="WHIT"> </span><span class="NAME">handler</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onUrl</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>434</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>435</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>436</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'infohash'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>437</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>438</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Infohash'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>439</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/icons/add_magnet.png'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>440</span> </span><span class="WHIT"> </span><span class="NAME">disabled</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT">
<span class='line'>441</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'->'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>442</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'remove'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>443</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>444</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Remove'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>445</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/icons/remove.png'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>446</span> </span><span class="WHIT"> </span><span class="NAME">handler</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onRemove</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>447</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>448</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'>449</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>450</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>451</span> </span><span class="WHIT">
<span class='line'>452</span> </span><span class="NAME">this.optionsPanel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.add</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.OptionsPanel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>453</span> </span><span class="WHIT"> </span><span class="NAME">this.on</span><span class="PUNC">(</span><span class="STRN">'show'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onShow</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>454</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>455</span> </span><span class="WHIT">
<span class='line'>456</span> </span><span class="NAME">clear</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>457</span> </span><span class="WHIT"> </span><span class="NAME">this.torrents</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>458</span> </span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">removeAll</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>459</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>460</span> </span><span class="WHIT">
<span class='line'>461</span> </span><span class="NAME">onAdd</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>462</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">torrents</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>463</span> </span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">r</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>464</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r.get</span><span class="PUNC">(</span><span class="STRN">'info_hash'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>465</span> </span><span class="WHIT"> </span><span class="NAME">torrents.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>466</span> </span><span class="WHIT"> </span><span class="NAME">path</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.optionsPanel.getFilename</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>467</span> </span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.optionsPanel.getOptions</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>468</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>469</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>470</span>
<span class='line'>471</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.add_torrents</span><span class="PUNC">(</span><span class="NAME">torrents</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>472</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>473</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>474</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>475</span> </span><span class="WHIT"> </span><span class="NAME">this.clear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>476</span> </span><span class="WHIT"> </span><span class="NAME">this.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>477</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>478</span> </span><span class="WHIT">
<span class='line'>479</span> </span><span class="NAME">onCancel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>480</span> </span><span class="WHIT"> </span><span class="NAME">this.clear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>481</span> </span><span class="WHIT"> </span><span class="NAME">this.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>482</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>483</span> </span><span class="WHIT">
<span class='line'>484</span> </span><span class="NAME">onFile</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>485</span> </span><span class="WHIT"> </span><span class="NAME">this.file.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>486</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>487</span> </span><span class="WHIT">
<span class='line'>488</span> </span><span class="NAME">onRemove</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>489</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getSelectionModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>490</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">selection.hasSelection</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>491</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">torrent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">selection.getSelected</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>492</span> </span><span class="WHIT">
<span class='line'>493</span> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">this.torrents</span><span class="PUNC">[</span><span class="NAME">torrent.id</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>494</span> </span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="NAME">torrent</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>495</span> </span><span class="WHIT"> </span><span class="NAME">this.options.clear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>496</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>497</span> </span><span class="WHIT">
<span class='line'>498</span> </span><span class="NAME">onSelect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">selModel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">record</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>499</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsPanel.setTorrent</span><span class="PUNC">(</span><span class="NAME">record.get</span><span class="PUNC">(</span><span class="STRN">'info_hash'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>500</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>501</span> </span><span class="WHIT">
<span class='line'>502</span> </span><span class="NAME">onShow</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>503</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.url</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>504</span> </span><span class="WHIT"> </span><span class="NAME">this.url</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.UrlWindow</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>505</span> </span><span class="WHIT"> </span><span class="NAME">this.url.on</span><span class="PUNC">(</span><span class="STRN">'beforeadd'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onTorrentBeforeAdd</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>506</span> </span><span class="WHIT"> </span><span class="NAME">this.url.on</span><span class="PUNC">(</span><span class="STRN">'add'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onTorrentAdd</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>507</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>508</span> </span><span class="WHIT">
<span class='line'>509</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.file</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>510</span> </span><span class="WHIT"> </span><span class="NAME">this.file</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.FileWindow</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>511</span> </span><span class="WHIT"> </span><span class="NAME">this.file.on</span><span class="PUNC">(</span><span class="STRN">'beforeadd'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onTorrentBeforeAdd</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>512</span> </span><span class="WHIT"> </span><span class="NAME">this.file.on</span><span class="PUNC">(</span><span class="STRN">'add'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onTorrentAdd</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>514</span> </span><span class="WHIT">
<span class='line'>515</span> </span><span class="NAME">this.optionsPanel.getDefaults</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>516</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>517</span> </span><span class="WHIT">
<span class='line'>518</span> </span><span class="NAME">onTorrentBeforeAdd</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>519</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">store</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>520</span> </span><span class="WHIT"> </span><span class="NAME">store.loadData</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="PUNC">[</span><span class="NAME">torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>521</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>522</span> </span><span class="WHIT">
<span class='line'>523</span> </span><span class="NAME">onTorrentAdd</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>524</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">info</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>525</span> </span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.show</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>526</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Error'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>527</span> </span><span class="WHIT"> </span><span class="NAME">msg</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Not a valid torrent'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>528</span> </span><span class="WHIT"> </span><span class="NAME">buttons</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.OK</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>529</span> </span><span class="WHIT"> </span><span class="NAME">modal</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>530</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.ERROR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>531</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-icon-error'</span><span class="WHIT">
<span class='line'>532</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>533</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>534</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>535</span> </span><span class="WHIT">
<span class='line'>536</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getById</span><span class="PUNC">(</span><span class="NAME">torrentId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>537</span> </span><span class="WHIT"> </span><span class="NAME">r.set</span><span class="PUNC">(</span><span class="STRN">'info_hash'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">[</span><span class="STRN">'info_hash'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>538</span> </span><span class="WHIT"> </span><span class="NAME">r.set</span><span class="PUNC">(</span><span class="STRN">'text'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">[</span><span class="STRN">'name'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>539</span> </span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">commitChanges</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>540</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsPanel.addTorrent</span><span class="PUNC">(</span><span class="NAME">info</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>541</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>542</span> </span><span class="WHIT">
<span class='line'>543</span> </span><span class="NAME">onUrl</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">button</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">event</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>544</span> </span><span class="WHIT"> </span><span class="NAME">this.url.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>545</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>546</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>547</span> </span><span class="NAME">Deluge.Add</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.deluge.add.AddWindow</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>548</span> </span></pre></body></html>

View File

@ -108,13 +108,13 @@
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="NAME">errorObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>101</span> </span><span class="WHIT"> </span><span class="NAME">errorObj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">options.id</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>102</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">options.id</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>103</span> </span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="NAME">error</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'HTTP'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">response.status</span><span class="WHIT"> <span class='line'>104</span> </span><span class="WHIT"> </span><span class="NAME">error</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'HTTP: '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">response.status</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">response.statusText</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>105</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>106</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">options.failure</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>106</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">options.failure</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.scope</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>107</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.scope</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">options.failure.call</span><span class="PUNC">(</span><span class="NAME">options.scope</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">responseObj.error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">responseObj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">response</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">options.failure.call</span><span class="PUNC">(</span><span class="NAME">options.scope</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">errorObj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">response</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">requestOptions</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>109</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="NAME">options.failure</span><span class="PUNC">(</span><span class="NAME">responseObj.error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">responseObj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">response</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>110</span> </span><span class="WHIT"> </span><span class="NAME">options.failure</span><span class="PUNC">(</span><span class="NAME">errorObj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">response</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">requestOptions</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>111</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>112</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT"> <span class='line'>113</span> </span><span class="WHIT">
@ -124,9 +124,9 @@
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">responseObj.error</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>117</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">responseObj.error</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">options.failure</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>118</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">options.failure</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.scope</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>119</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">options.scope</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">options.failure.call</span><span class="PUNC">(</span><span class="NAME">options.scope</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">responseObj.error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">responseObj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">response</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">requestOptions</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">options.failure.call</span><span class="PUNC">(</span><span class="NAME">options.scope</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">responseObj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">response</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">requestOptions</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>121</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="NAME">options.failure</span><span class="PUNC">(</span><span class="NAME">responseObj.error</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">responseObj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">response</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">requestOptions</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>122</span> </span><span class="WHIT"> </span><span class="NAME">options.failure</span><span class="PUNC">(</span><span class="NAME">responseObj</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">response</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">requestOptions</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>123</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>124</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">options.success</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>125</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">options.success</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">

View File

@ -43,341 +43,366 @@
<span class='line'> 36</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hostRenderer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">r</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 36</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hostRenderer</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">p</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">r</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 37</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">':'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">r.data</span><span class="PUNC">[</span><span class="STRN">'port'</span><span class="PUNC">]</span><span class="WHIT"> <span class='line'> 37</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">':'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">r.data</span><span class="PUNC">[</span><span class="STRN">'port'</span><span class="PUNC">]</span><span class="WHIT">
<span class='line'> 38</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'> 38</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 39</span> <span class='line'> 39</span> </span><span class="WHIT">
<span class='line'> 40</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.ConnectionManager</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.extend</span><span class="PUNC">(</span><span class="NAME">Ext.Window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 40</span> </span><span class="NAME">Ext.deluge.AddConnectionWindow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.extend</span><span class="PUNC">(</span><span class="NAME">Ext.Window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 41</span> </span><span class="WHIT"> <span class='line'> 41</span> </span><span class="WHIT">
<span class='line'> 42</span> </span><span class="NAME">layout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'fit'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 42</span> </span><span class="NAME">constructor</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">config</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">300</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">config</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.apply</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">220</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 44</span> </span><span class="WHIT"> </span><span class="NAME">layout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'fit'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">bodyStyle</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'padding: 10px 5px;'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">300</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> </span><span class="NAME">buttonAlign</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'right'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 46</span> </span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">195</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">closeAction</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'hide'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 47</span> </span><span class="WHIT"> </span><span class="NAME">bodyStyle</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'padding: 10px 5px;'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="WHIT"> </span><span class="NAME">closable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 48</span> </span><span class="WHIT"> </span><span class="NAME">buttonAlign</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'right'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="NAME">plain</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 49</span> </span><span class="WHIT"> </span><span class="NAME">closeAction</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'hide'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Connection Manager'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 50</span> </span><span class="WHIT"> </span><span class="NAME">closable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-connect-window-icon'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 51</span> </span><span class="WHIT"> </span><span class="NAME">plain</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 52</span> </span><span class="WHIT"> <span class='line'> 52</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Add Connection'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 53</span> </span><span class="NAME">initComponent</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 53</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-add-window-icon'</span><span class="WHIT">
<span class='line'> 54</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.ConnectionManager.superclass.initComponent.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 54</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 55</span> </span><span class="WHIT"> </span><span class="NAME">this.on</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 55</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.AddConnectionWindow.superclass.constructor.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 56</span> </span><span class="WHIT"> </span><span class="STRN">'hide'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onHide</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 56</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 57</span> </span><span class="WHIT"> </span><span class="STRN">'show'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onShow</span><span class="WHIT"> <span class='line'> 57</span> </span><span class="WHIT">
<span class='line'> 58</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 58</span> </span><span class="NAME">initComponent</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.on</span><span class="PUNC">(</span><span class="STRN">'login'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onLogin</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 59</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.AddConnectionWindow.superclass.initComponent.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.on</span><span class="PUNC">(</span><span class="STRN">'logout'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onLogout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 60</span> </span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT"> <span class='line'> 61</span> </span><span class="NAME">this.addEvents</span><span class="PUNC">(</span><span class="STRN">'hostadded'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="NAME">this.addButton</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Close'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onClose</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 62</span> </span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT"> </span><span class="NAME">this.addButton</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Connect'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onConnect</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 63</span> </span><span class="NAME">this.addButton</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Close'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.hide</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="WHIT"> <span class='line'> 64</span> </span><span class="WHIT"> </span><span class="NAME">this.addButton</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Add'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onAdd</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> </span><span class="NAME">this.grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 65</span> </span><span class="WHIT">
<span class='line'> 66</span> </span><span class="WHIT"> </span><span class="NAME">xtype</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'grid'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 66</span> </span><span class="NAME">this.on</span><span class="PUNC">(</span><span class="STRN">'hide'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onHide</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 67</span> </span><span class="WHIT"> </span><span class="NAME">store</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.data.SimpleStore</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 67</span> </span><span class="WHIT">
<span class='line'> 68</span> </span><span class="WHIT"> </span><span class="NAME">fields</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> <span class='line'> 68</span> </span><span class="NAME">this.form</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'status'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mapping</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 69</span> </span><span class="WHIT"> </span><span class="NAME">xtype</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'form'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'host'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mapping</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 70</span> </span><span class="WHIT"> </span><span class="NAME">defaultType</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'textfield'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'port'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mapping</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 71</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'connectionAddForm'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'version'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mapping</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">}</span><span class="WHIT"> <span class='line'> 72</span> </span><span class="WHIT"> </span><span class="NAME">baseCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-plain'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 73</span> </span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 73</span> </span><span class="WHIT"> </span><span class="NAME">labelWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">55</span><span class="WHIT">
<span class='line'> 74</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> <span class='line'> 74</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 75</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 75</span> </span><span class="WHIT">
<span class='line'> 76</span> </span><span class="WHIT"> </span><span class="NAME">columns</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 76</span> </span><span class="NAME">this.hostField</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.form.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="NAME">header</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Status'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 77</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Host'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">65</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 78</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'host'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">sortable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'host'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="NAME">renderer</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">fplain</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 80</span> </span><span class="WHIT"> </span><span class="NAME">anchor</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'100%'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="NAME">dataIndex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'status'</span><span class="WHIT"> <span class='line'> 81</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 82</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="STRN">'host'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 83</span> </span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="NAME">header</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Host'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 84</span> </span><span class="NAME">this.portField</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.form.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">150</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 85</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Port'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="NAME">sortable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 86</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'port'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="NAME">renderer</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hostRenderer</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 87</span> </span><span class="WHIT"> </span><span class="NAME">xtype</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'uxspinner'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT"> </span><span class="NAME">dataIndex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'host'</span><span class="WHIT"> <span class='line'> 88</span> </span><span class="WHIT"> </span><span class="NAME">ctCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-form-uxspinner'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 89</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'port'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT"> </span><span class="NAME">header</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Version'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 90</span> </span><span class="WHIT"> </span><span class="NAME">strategy</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.ux.form.Spinner.NumberStrategy</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">75</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 91</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'58846'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT"> </span><span class="NAME">sortable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 92</span> </span><span class="WHIT"> </span><span class="NAME">anchor</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'50%'</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT"> </span><span class="NAME">renderer</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">fplain</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 93</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="NAME">dataIndex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'version'</span><span class="WHIT"> <span class='line'> 94</span> </span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 95</span> </span><span class="NAME">this.usernameField</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.form.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="NAME">stripeRows</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 96</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Username'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT"> </span><span class="NAME">selModel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.grid.RowSelectionModel</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 97</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'username'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">singleSelect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'username'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 99</span> </span><span class="WHIT"> </span><span class="NAME">listeners</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 99</span> </span><span class="WHIT"> </span><span class="NAME">anchor</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'100%'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>100</span> </span><span class="WHIT"> </span><span class="STRN">'rowselect'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">fn</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onSelect</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>100</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>101</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>102</span> </span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT"> </span><span class="NAME">autoExpandColumn</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'host'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>103</span> </span><span class="NAME">this.passwordField</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.form.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="NAME">deferredRender</span><span class="PUNC">:</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>104</span> </span><span class="WHIT"> </span><span class="NAME">fieldLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Password'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>105</span> </span><span class="WHIT"> </span><span class="NAME">autoScroll</span><span class="PUNC">:</span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>105</span> </span><span class="WHIT"> </span><span class="NAME">anchor</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'100%'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="NAME">margins</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'0 0 0 0'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>106</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'_password'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>107</span> </span><span class="WHIT"> </span><span class="NAME">bbar</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.Toolbar</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>107</span> </span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'_password'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">items</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> <span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">inputType</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'password'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>109</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>109</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT">
<span class='line'>110</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'add'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>110</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>111</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>111</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>112</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Add'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>112</span> </span><span class="WHIT">
<span class='line'>113</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/icons/add.png'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>113</span> </span><span class="NAME">onAdd</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="NAME">handler</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onAdd</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>114</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">host</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.hostField.getValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> <span class='line'>115</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">port</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.portField.getValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>116</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">username</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.usernameField.getValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'remove'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>117</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">password</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.passwordField.getValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>118</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>118</span> </span><span class="WHIT">
<span class='line'>119</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Remove'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>119</span> </span><span class="NAME">Deluge.Client.web.add_host</span><span class="PUNC">(</span><span class="NAME">host</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">port</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">username</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">password</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/icons/remove.png'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>120</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>121</span> </span><span class="WHIT"> </span><span class="NAME">handler</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onRemove</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>121</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">result</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>122</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> <span class='line'>122</span> </span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.show</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>123</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'->'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>123</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Error'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'stop'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>124</span> </span><span class="WHIT"> </span><span class="NAME">msg</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Unable to add host: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>125</span> </span><span class="WHIT"> </span><span class="NAME">buttons</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.OK</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Stop Daemon'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>126</span> </span><span class="WHIT"> </span><span class="NAME">modal</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/icons/error.png'</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>127</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.ERROR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT"> </span><span class="NAME">handler</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onStop</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>128</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-icon-error'</span><span class="WHIT">
<span class='line'>129</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> <span class='line'>129</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>130</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>130</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT"> </span><span class="PUNC">]</span><span class="WHIT"> <span class='line'>131</span> </span><span class="WHIT"> </span><span class="NAME">this.fireEvent</span><span class="PUNC">(</span><span class="STRN">'hostadded'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT"> <span class='line'>132</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>133</span> </span><span class="WHIT"> </span><span class="NAME">this.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>134</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT"> <span class='line'>135</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>136</span> </span><span class="NAME">disconnect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>136</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.fire</span><span class="PUNC">(</span><span class="STRN">'disconnect'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>137</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>138</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>138</span> </span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT"> <span class='line'>139</span> </span><span class="NAME">onHide</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>140</span> </span><span class="NAME">runCheck</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>140</span> </span><span class="WHIT"> </span><span class="NAME">this.form.getForm</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">reset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>141</span> </span><span class="WHIT"> </span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this.onGetHosts</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>141</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>142</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">scope</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>142</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.get_hosts</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>143</span>
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">callback</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>144</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.ConnectionManager</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Ext.extend</span><span class="PUNC">(</span><span class="NAME">Ext.Window</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">scope</span><span class="WHIT"> <span class='line'>145</span> </span><span class="WHIT">
<span class='line'>146</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>146</span> </span><span class="NAME">layout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'fit'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>147</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">300</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>148</span> </span><span class="WHIT"> <span class='line'>148</span> </span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">220</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>149</span> </span><span class="NAME">onAdd</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">button</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>149</span> </span><span class="WHIT"> </span><span class="NAME">bodyStyle</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'padding: 10px 5px;'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>150</span> </span><span class="WHIT"> </span><span class="COMM">//Deluge.Connections.Add.show();</span><span class="WHIT"> <span class='line'>150</span> </span><span class="WHIT"> </span><span class="NAME">buttonAlign</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'right'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>151</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>151</span> </span><span class="WHIT"> </span><span class="NAME">closeAction</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'hide'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>152</span> </span><span class="WHIT"> <span class='line'>152</span> </span><span class="WHIT"> </span><span class="NAME">closable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>153</span> </span><span class="NAME">onAddHost</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>153</span> </span><span class="WHIT"> </span><span class="NAME">plain</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">form</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Deluge.Connections.Add.items.first</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>154</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Connection Manager'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">host</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">form.items.get</span><span class="PUNC">(</span><span class="STRN">'host'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>155</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-connect-window-icon'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">port</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">form.items.get</span><span class="PUNC">(</span><span class="STRN">'port'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>156</span> </span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">username</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">form.items.get</span><span class="PUNC">(</span><span class="STRN">'username'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>157</span> </span><span class="NAME">initComponent</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>158</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">password</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">form.items.get</span><span class="PUNC">(</span><span class="STRN">'_password'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>158</span> </span><span class="WHIT"> </span><span class="NAME">Ext.deluge.ConnectionManager.superclass.initComponent.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>159</span> </span><span class="WHIT"> <span class='line'>159</span> </span><span class="WHIT"> </span><span class="NAME">this.on</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>160</span> </span><span class="NAME">Deluge.Client.web.add_host</span><span class="PUNC">(</span><span class="NAME">host</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">port</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">username</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">password</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>160</span> </span><span class="WHIT"> </span><span class="STRN">'hide'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onHide</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>161</span> </span><span class="WHIT"> </span><span class="NAME">onSuccess</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>161</span> </span><span class="WHIT"> </span><span class="STRN">'show'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onShow</span><span class="WHIT">
<span class='line'>162</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">result</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>162</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.show</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>163</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.on</span><span class="PUNC">(</span><span class="STRN">'login'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onLogin</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Error'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>164</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.on</span><span class="PUNC">(</span><span class="STRN">'logout'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onLogout</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT"> </span><span class="NAME">msg</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Unable to add host: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>165</span> </span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT"> </span><span class="NAME">buttons</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.OK</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>166</span> </span><span class="NAME">this.addButton</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Close'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onClose</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>167</span> </span><span class="WHIT"> </span><span class="NAME">modal</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>167</span> </span><span class="WHIT"> </span><span class="NAME">this.addButton</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Connect'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onConnect</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.ERROR</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>168</span> </span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-icon-error'</span><span class="WHIT"> <span class='line'>169</span> </span><span class="NAME">this.grid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.add</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>170</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>170</span> </span><span class="WHIT"> </span><span class="NAME">xtype</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'grid'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>171</span> </span><span class="WHIT"> </span><span class="NAME">store</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.data.SimpleStore</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT"> </span><span class="NAME">this.runCheck</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>172</span> </span><span class="WHIT"> </span><span class="NAME">fields</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>173</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'status'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mapping</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>174</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Connections.Add.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>174</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'host'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mapping</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>175</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>175</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'port'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mapping</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>176</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">name</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'version'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mapping</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>177</span> </span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT"> <span class='line'>178</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT">
<span class='line'>179</span> </span><span class="NAME">onAddWindowHide</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>179</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT"> </span><span class="COMM">// Tidy up the form to ensure all the values are default.</span><span class="WHIT"> <span class='line'>180</span> </span><span class="WHIT"> </span><span class="NAME">columns</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">form</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Deluge.Connections.Add.items.first</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>181</span> </span><span class="WHIT"> </span><span class="NAME">header</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Status'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>182</span> </span><span class="WHIT"> </span><span class="NAME">form.items.get</span><span class="PUNC">(</span><span class="STRN">'host'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">reset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>182</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">65</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT"> </span><span class="NAME">form.items.get</span><span class="PUNC">(</span><span class="STRN">'port'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">reset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>183</span> </span><span class="WHIT"> </span><span class="NAME">sortable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT"> </span><span class="NAME">form.items.get</span><span class="PUNC">(</span><span class="STRN">'username'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">reset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>184</span> </span><span class="WHIT"> </span><span class="NAME">renderer</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">fplain</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT"> </span><span class="NAME">form.items.get</span><span class="PUNC">(</span><span class="STRN">'_password'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">reset</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>185</span> </span><span class="WHIT"> </span><span class="NAME">dataIndex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'status'</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>186</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT"> <span class='line'>187</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="STRN">'host'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>188</span> </span><span class="NAME">onClose</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>188</span> </span><span class="WHIT"> </span><span class="NAME">header</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Host'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>189</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">window.clearInterval</span><span class="PUNC">(</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>189</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">150</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>190</span> </span><span class="WHIT"> </span><span class="NAME">this.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>190</span> </span><span class="WHIT"> </span><span class="NAME">sortable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>191</span> </span><span class="WHIT"> </span><span class="NAME">renderer</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">hostRenderer</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT"> <span class='line'>192</span> </span><span class="WHIT"> </span><span class="NAME">dataIndex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'host'</span><span class="WHIT">
<span class='line'>193</span> </span><span class="NAME">onConnect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>193</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selected</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getSelectionModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getSelected</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>194</span> </span><span class="WHIT"> </span><span class="NAME">header</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Version'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">selected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>195</span> </span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">75</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT"> <span class='line'>196</span> </span><span class="WHIT"> </span><span class="NAME">sortable</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>197</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">selected.get</span><span class="PUNC">(</span><span class="STRN">'status'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Connected'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>197</span> </span><span class="WHIT"> </span><span class="NAME">renderer</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">fplain</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.disconnect</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>198</span> </span><span class="WHIT"> </span><span class="NAME">dataIndex</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'version'</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>199</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT"> </span><span class="NAME">this.runCheck</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>200</span> </span><span class="WHIT"> </span><span class="NAME">stripeRows</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.fire</span><span class="PUNC">(</span><span class="STRN">'disconnect'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>201</span> </span><span class="WHIT"> </span><span class="NAME">selModel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.grid.RowSelectionModel</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>202</span> </span><span class="WHIT"> </span><span class="NAME">singleSelect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> <span class='line'>203</span> </span><span class="WHIT"> </span><span class="NAME">listeners</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>204</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>204</span> </span><span class="WHIT"> </span><span class="STRN">'rowselect'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">fn</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onSelect</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>205</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>205</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">selected.id</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>206</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>207</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.connect</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>207</span> </span><span class="WHIT"> </span><span class="NAME">autoExpandColumn</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'host'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>208</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">methods</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>208</span> </span><span class="WHIT"> </span><span class="NAME">deferredRender</span><span class="PUNC">:</span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>209</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.reloadMethods</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>209</span> </span><span class="WHIT"> </span><span class="NAME">autoScroll</span><span class="PUNC">:</span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>210</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.on</span><span class="PUNC">(</span><span class="STRN">'connected'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>210</span> </span><span class="WHIT"> </span><span class="NAME">margins</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'0 0 0 0'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>211</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.fire</span><span class="PUNC">(</span><span class="STRN">'connect'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>211</span> </span><span class="WHIT"> </span><span class="NAME">bbar</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.Toolbar</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">single</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>212</span> </span><span class="WHIT"> </span><span class="NAME">items</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>213</span> </span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>214</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'add'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">window.clearInterval</span><span class="PUNC">(</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>215</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT"> </span><span class="NAME">this.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>216</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Add'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>217</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/icons/add.png'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>218</span> </span><span class="WHIT"> </span><span class="NAME">handler</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onAdd</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT"> <span class='line'>219</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>220</span> </span><span class="NAME">onGetHosts</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">hosts</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>220</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>221</span> </span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">loadData</span><span class="PUNC">(</span><span class="NAME">hosts</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>221</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'remove'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>222</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getSelectionModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>222</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>223</span> </span><span class="WHIT"> </span><span class="NAME">selection.selectRow</span><span class="PUNC">(</span><span class="NAME">this.selectedRow</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>223</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Remove'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>224</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>224</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/icons/remove.png'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT"> <span class='line'>225</span> </span><span class="WHIT"> </span><span class="NAME">handler</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onRemove</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>226</span> </span><span class="NAME">onLogin</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>226</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.connected</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>227</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'->'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">connected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>228</span> </span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'stop'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">connected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>229</span> </span><span class="WHIT"> </span><span class="NAME">cls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-btn-text-icon'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>230</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.fire</span><span class="PUNC">(</span><span class="STRN">'connect'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>230</span> </span><span class="WHIT"> </span><span class="NAME">text</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Stop Daemon'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>231</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'/icons/error.png'</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT"> </span><span class="NAME">this.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>232</span> </span><span class="WHIT"> </span><span class="NAME">handler</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onStop</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>233</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>234</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>234</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>235</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> <span class='line'>235</span> </span><span class="WHIT"> </span><span class="PUNC">]</span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>236</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>237</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>237</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>238</span> </span><span class="WHIT"> <span class='line'>238</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>239</span> </span><span class="NAME">onLogout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>239</span> </span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT"> </span><span class="NAME">this.disconnect</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>240</span> </span><span class="NAME">disconnect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>241</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.hidden</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">this.rendered</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>241</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.fire</span><span class="PUNC">(</span><span class="STRN">'disconnect'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT"> </span><span class="NAME">this.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>242</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>243</span> </span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>244</span> </span><span class="NAME">loadHosts</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>245</span> </span><span class="WHIT"> <span class='line'>245</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.get_hosts</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>246</span> </span><span class="NAME">onRemove</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">button</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>246</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onGetHosts</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">connection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Deluge.Connections.Grid.getSelectionModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getSelected</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>247</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>248</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.remove_host</span><span class="PUNC">(</span><span class="NAME">connection.id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>248</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>249</span> </span><span class="WHIT"> </span><span class="NAME">onSuccess</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>249</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>250</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>250</span> </span><span class="WHIT">
<span class='line'>251</span> </span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.show</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>251</span> </span><span class="NAME">update</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>252</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Error'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>252</span> </span><span class="WHIT"> </span><span class="NAME">self.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">r</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>253</span> </span><span class="WHIT"> </span><span class="NAME">msg</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>253</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.get_host_status</span><span class="PUNC">(</span><span class="NAME">r.id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>254</span> </span><span class="WHIT"> </span><span class="NAME">buttons</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.OK</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>254</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">self.onGetHostStatus</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>255</span> </span><span class="WHIT"> </span><span class="NAME">modal</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>255</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT">
<span class='line'>256</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.ERROR</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>256</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>257</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-icon-error'</span><span class="WHIT"> <span class='line'>257</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>258</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>258</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>259</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>259</span> </span><span class="WHIT">
<span class='line'>260</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Connections.Grid.store.remove</span><span class="PUNC">(</span><span class="NAME">connection</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>260</span> </span><span class="NAME">onAdd</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">button</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>261</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>261</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.addWindow</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>262</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>262</span> </span><span class="WHIT"> </span><span class="NAME">this.addWindow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.deluge.AddConnectionWindow</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>263</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>263</span> </span><span class="WHIT"> </span><span class="NAME">this.addWindow.on</span><span class="PUNC">(</span><span class="STRN">'hostadded'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onHostAdded</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>264</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>264</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>265</span> </span><span class="WHIT"> <span class='line'>265</span> </span><span class="WHIT"> </span><span class="NAME">this.addWindow.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>266</span> </span><span class="NAME">onSelect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">selModel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">record</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>266</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT"> </span><span class="NAME">this.selectedRow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rowIndex</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>267</span> </span><span class="WHIT">
<span class='line'>268</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">button</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.buttons</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>268</span> </span><span class="NAME">onHostAdded</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">record.get</span><span class="PUNC">(</span><span class="STRN">'status'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Connected'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>269</span> </span><span class="WHIT"> </span><span class="NAME">this.runCheck</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>270</span> </span><span class="WHIT"> </span><span class="NAME">button.setText</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Disconnect'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>270</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>271</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>271</span> </span><span class="WHIT">
<span class='line'>272</span> </span><span class="WHIT"> </span><span class="NAME">button.setText</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Connect'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>272</span> </span><span class="NAME">onClose</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>273</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>273</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">window.clearInterval</span><span class="PUNC">(</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>274</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>274</span> </span><span class="WHIT"> </span><span class="NAME">this.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>275</span> </span><span class="WHIT"> <span class='line'>275</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>276</span> </span><span class="NAME">onShow</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>276</span> </span><span class="WHIT">
<span class='line'>277</span> </span><span class="WHIT"> </span><span class="NAME">this.runCheck</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>277</span> </span><span class="NAME">onConnect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>278</span> </span><span class="WHIT"> </span><span class="NAME">this.running</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.setInterval</span><span class="PUNC">(</span><span class="NAME">this.runCheck</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2000</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>278</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selected</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getSelectionModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getSelected</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>279</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>279</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">selected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>280</span> </span><span class="WHIT"> <span class='line'>280</span> </span><span class="WHIT">
<span class='line'>281</span> </span><span class="NAME">onStop</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">button</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>281</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">selected.get</span><span class="PUNC">(</span><span class="STRN">'status'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Connected'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>282</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">connection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getSelectionModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getSelected</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>282</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.disconnect</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.stop_daemon</span><span class="PUNC">(</span><span class="NAME">connection.id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>283</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>284</span> </span><span class="WHIT"> </span><span class="NAME">this.update</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">result</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>285</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.fire</span><span class="PUNC">(</span><span class="STRN">'disconnect'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>286</span> </span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.show</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>286</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>287</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Error'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>287</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>288</span> </span><span class="WHIT"> </span><span class="NAME">msg</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>288</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>289</span> </span><span class="WHIT"> </span><span class="NAME">buttons</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.OK</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>289</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>290</span> </span><span class="WHIT"> </span><span class="NAME">modal</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>290</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">selected.id</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>291</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.ERROR</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>291</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.connect</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>292</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-icon-error'</span><span class="WHIT"> <span class='line'>292</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">methods</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>293</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>293</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.reloadMethods</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>294</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>294</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.on</span><span class="PUNC">(</span><span class="STRN">'connected'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>295</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>295</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.fire</span><span class="PUNC">(</span><span class="STRN">'connect'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>296</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>296</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">single</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>297</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>297</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>298</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>298</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.ConnectionManager</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.deluge.ConnectionManager</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>299</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">window.clearInterval</span><span class="PUNC">(</span><span class="NAME">this.running</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>300</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>300</span> </span><span class="WHIT"> </span><span class="NAME">this.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>301</span> <span class='line'>301</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>302</span> </span><span class="COMM">/*Deluge.Connections = { <span class='line'>302</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>303</span> <span class='line'>303</span> </span><span class="WHIT">
<span class='line'>304</span> loginShow: function() { <span class='line'>304</span> </span><span class="NAME">onGetHosts</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">hosts</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>305</span> }, <span class='line'>305</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">store</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>306</span> <span class='line'>306</span> </span><span class="WHIT"> </span><span class="NAME">Ext.each</span><span class="PUNC">(</span><span class="NAME">hosts</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">host</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>307</span> , <span class='line'>307</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">record</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">store.getById</span><span class="PUNC">(</span><span class="NAME">host</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>308</span> <span class='line'>308</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">record</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>309</span> <span class='line'>309</span> </span><span class="WHIT"> </span><span class="NAME">store.loadData</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="NAME">host</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>310</span> } <span class='line'>310</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>311</span> <span class='line'>311</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.get_host_status</span><span class="PUNC">(</span><span class="NAME">host</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>312</span> Deluge.Connections.Store ; <span class='line'>312</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.onGetHostStatus</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>313</span> <span class='line'>313</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>314</span> <span class='line'>314</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>315</span> <span class='line'>315</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>316</span> Deluge.Connections.Grid = new Ext.grid.GridPanel(); <span class='line'>316</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>317</span> <span class='line'>317</span> </span><span class="WHIT">
<span class='line'>318</span> Deluge.Connections.Add = new Ext.Window({ <span class='line'>318</span> </span><span class="NAME">onGetHostStatus</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">host</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>319</span> layout: 'fit', <span class='line'>319</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">record</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getById</span><span class="PUNC">(</span><span class="NAME">host</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>320</span> width: 300, <span class='line'>320</span> </span><span class="WHIT"> </span><span class="NAME">record.set</span><span class="PUNC">(</span><span class="STRN">'status'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">host</span><span class="PUNC">[</span><span class="NUMB">3</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>321</span> height: 195, <span class='line'>321</span> </span><span class="WHIT"> </span><span class="NAME">record.set</span><span class="PUNC">(</span><span class="STRN">'version'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">host</span><span class="PUNC">[</span><span class="NUMB">4</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>322</span> bodyStyle: 'padding: 10px 5px;', <span class='line'>322</span> </span><span class="WHIT"> </span><span class="NAME">record.commit</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>323</span> buttonAlign: 'right', <span class='line'>323</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>324</span> closeAction: 'hide', <span class='line'>324</span> </span><span class="WHIT">
<span class='line'>325</span> closable: true, <span class='line'>325</span> </span><span class="NAME">onLogin</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>326</span> plain: true, <span class='line'>326</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.connected</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>327</span> title: _('Add Connection'), <span class='line'>327</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">connected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>328</span> iconCls: 'x-deluge-add-window-icon', <span class='line'>328</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">connected</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>329</span> items: [new Ext.form.FormPanel({ <span class='line'>329</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Events.fire</span><span class="PUNC">(</span><span class="STRN">'connect'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>330</span> defaultType: 'textfield', <span class='line'>330</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>331</span> id: 'connectionAddForm', <span class='line'>331</span> </span><span class="WHIT"> </span><span class="NAME">this.show</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>332</span> baseCls: 'x-plain', <span class='line'>332</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>333</span> labelWidth: 55, <span class='line'>333</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>334</span> items: [{ <span class='line'>334</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>335</span> fieldLabel: _('Host'), <span class='line'>335</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>336</span> id: 'host', <span class='line'>336</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>337</span> name: 'host', <span class='line'>337</span> </span><span class="WHIT">
<span class='line'>338</span> anchor: '100%', <span class='line'>338</span> </span><span class="NAME">onLogout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>339</span> listeners: {} <span class='line'>339</span> </span><span class="WHIT"> </span><span class="NAME">this.disconnect</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>340</span> },{ <span class='line'>340</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.hidden</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">this.rendered</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>341</span> fieldLabel: _('Port'), <span class='line'>341</span> </span><span class="WHIT"> </span><span class="NAME">this.hide</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>342</span> id: 'port', <span class='line'>342</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>343</span> xtype: 'uxspinner', <span class='line'>343</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>344</span> ctCls: 'x-form-uxspinner', <span class='line'>344</span> </span><span class="WHIT">
<span class='line'>345</span> name: 'port', <span class='line'>345</span> </span><span class="NAME">onRemove</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">button</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>346</span> strategy: Ext.ux.form.Spinner.NumberStrategy(), <span class='line'>346</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">connection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getSelectionModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getSelected</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>347</span> value: '58846', <span class='line'>347</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.remove_host</span><span class="PUNC">(</span><span class="NAME">connection.id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>348</span> anchor: '50%', <span class='line'>348</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>349</span> listeners: {} <span class='line'>349</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>350</span> }, { <span class='line'>350</span> </span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.show</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>351</span> fieldLabel: _('Username'), <span class='line'>351</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Error'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>352</span> id: 'username', <span class='line'>352</span> </span><span class="WHIT"> </span><span class="NAME">msg</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>353</span> name: 'username', <span class='line'>353</span> </span><span class="WHIT"> </span><span class="NAME">buttons</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.OK</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>354</span> anchor: '100%', <span class='line'>354</span> </span><span class="WHIT"> </span><span class="NAME">modal</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>355</span> listeners: {} <span class='line'>355</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.ERROR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>356</span> },{ <span class='line'>356</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-icon-error'</span><span class="WHIT">
<span class='line'>357</span> fieldLabel: _('Password'), <span class='line'>357</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>358</span> anchor: '100%', <span class='line'>358</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>359</span> id: '_password', <span class='line'>359</span> </span><span class="WHIT"> </span><span class="NAME">this.grid.getStore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">remove</span><span class="PUNC">(</span><span class="NAME">connection</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>360</span> name: '_password', <span class='line'>360</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>361</span> inputType: 'password' <span class='line'>361</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>362</span> }] <span class='line'>362</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>363</span> })], <span class='line'>363</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>364</span> buttons: [{ <span class='line'>364</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>365</span> text: _('Close'), <span class='line'>365</span> </span><span class="WHIT">
<span class='line'>366</span> handler: function() { <span class='line'>366</span> </span><span class="NAME">onSelect</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">selModel</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rowIndex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">record</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>367</span> Deluge.Connections.Add.hide(); <span class='line'>367</span> </span><span class="WHIT"> </span><span class="NAME">this.selectedRow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">rowIndex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>368</span> } <span class='line'>368</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">button</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.buttons</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>369</span> },{ <span class='line'>369</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">record.get</span><span class="PUNC">(</span><span class="STRN">'status'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Connected'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>370</span> text: _('Add'), <span class='line'>370</span> </span><span class="WHIT"> </span><span class="NAME">button.setText</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Disconnect'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>371</span> handler: Deluge.Connections.onAddHost <span class='line'>371</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>372</span> }], <span class='line'>372</span> </span><span class="WHIT"> </span><span class="NAME">button.setText</span><span class="PUNC">(</span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Connect'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>373</span> listeners: { <span class='line'>373</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>374</span> 'hide': Deluge.Connections.onAddWindowHide <span class='line'>374</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>375</span> } <span class='line'>375</span> </span><span class="WHIT">
<span class='line'>376</span> });*/</span></pre></body></html> <span class='line'>376</span> </span><span class="NAME">onShow</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>377</span> </span><span class="WHIT"> </span><span class="NAME">this.loadHosts</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>378</span> </span><span class="WHIT"> </span><span class="NAME">this.running</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.setInterval</span><span class="PUNC">(</span><span class="NAME">this.update</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2000</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>379</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>380</span> </span><span class="WHIT">
<span class='line'>381</span> </span><span class="NAME">onStop</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">button</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>382</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">connection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.grid.getSelectionModel</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getSelected</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>383</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.web.stop_daemon</span><span class="PUNC">(</span><span class="NAME">connection.id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>384</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">result</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>385</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">result</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>386</span> </span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.show</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>387</span> </span><span class="WHIT"> </span><span class="NAME">title</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">_</span><span class="PUNC">(</span><span class="STRN">'Error'</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>388</span> </span><span class="WHIT"> </span><span class="NAME">msg</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>389</span> </span><span class="WHIT"> </span><span class="NAME">buttons</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.OK</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>390</span> </span><span class="WHIT"> </span><span class="NAME">modal</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>391</span> </span><span class="WHIT"> </span><span class="NAME">icon</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Ext.MessageBox.ERROR</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>392</span> </span><span class="WHIT"> </span><span class="NAME">iconCls</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'x-deluge-icon-error'</span><span class="WHIT">
<span class='line'>393</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>394</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>395</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>396</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>398</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>399</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.ConnectionManager</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.deluge.ConnectionManager</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>400</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>401</span> </span></pre></body></html>

View File

@ -366,12 +366,12 @@
<span class='line'>359</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>359</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>360</span> </span><span class="WHIT"> <span class='line'>360</span> </span><span class="WHIT">
<span class='line'>361</span> </span><span class="NAME">clear</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>361</span> </span><span class="NAME">clear</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>362</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.resetOptions</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>362</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.changeId</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>363</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>363</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>364</span> </span><span class="WHIT"> <span class='line'>364</span> </span><span class="WHIT">
<span class='line'>365</span> </span><span class="NAME">reset</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>365</span> </span><span class="NAME">reset</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>366</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>366</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>367</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.resetOptions</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>367</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.reset</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>368</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>368</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>369</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>369</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>370</span> </span><span class="WHIT"> <span class='line'>370</span> </span><span class="WHIT">
@ -389,15 +389,15 @@
<span class='line'>382</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">changed</span><span class="PUNC">[</span><span class="STRN">'prioritize_first_last'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>382</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">changed</span><span class="PUNC">[</span><span class="STRN">'prioritize_first_last'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>383</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.core.set_torrent_prioritize_first_last</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>383</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.core.set_torrent_prioritize_first_last</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>384</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>384</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>385</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.setOption</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'prioritize_first_last'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>385</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.set</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'prioritize_first_last'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>386</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>386</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>387</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> <span class='line'>387</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>388</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>388</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>389</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>389</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>390</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.core.set_torrent_options</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="NAME">this.torrentId</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">changed</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>390</span> </span><span class="WHIT"> </span><span class="NAME">Deluge.Client.core.set_torrent_options</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="NAME">this.torrentId</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">changed</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>391</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>391</span> </span><span class="WHIT"> </span><span class="NAME">success</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>392</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.setOptions</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">changed</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>392</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.set</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">changed</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>393</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.resetOptions</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>393</span> </span><span class="WHIT"> </span><span class="NAME">this.optionsManager.reset</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>394</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>394</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>395</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> <span class='line'>395</span> </span><span class="WHIT"> </span><span class="NAME">scope</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT">
<span class='line'>396</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>396</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
@ -418,7 +418,7 @@
<span class='line'>411</span> </span><span class="WHIT"> </span><span class="NAME">this.fields</span><span class="PUNC">[</span><span class="STRN">'private'</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">setDisabled</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">torrent</span><span class="PUNC">[</span><span class="STRN">'private'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>411</span> </span><span class="WHIT"> </span><span class="NAME">this.fields</span><span class="PUNC">[</span><span class="STRN">'private'</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">setDisabled</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">torrent</span><span class="PUNC">[</span><span class="STRN">'private'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>412</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">torrent</span><span class="PUNC">[</span><span class="STRN">'private'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>412</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">torrent</span><span class="PUNC">[</span><span class="STRN">'private'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>413</span> </span><span class="WHIT"> <span class='line'>413</span> </span><span class="WHIT">
<span class='line'>414</span> </span><span class="NAME">this.optionsManager.updateOptions</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">torrent</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>414</span> </span><span class="NAME">this.optionsManager.update</span><span class="PUNC">(</span><span class="NAME">this.torrentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">torrent</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>415</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>415</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>416</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>416</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>417</span> </span><span class="NAME">Deluge.Details.add</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.deluge.details.OptionsTab</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>417</span> </span><span class="NAME">Deluge.Details.add</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Ext.deluge.details.OptionsTab</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">

View File

@ -50,8 +50,8 @@
<span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 43</span> </span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 44</span> </span><span class="WHIT"> </span><span class="NAME">this.defaults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">[</span><span class="STRN">'defaults'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 44</span> </span><span class="WHIT"> </span><span class="NAME">this.defaults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">config</span><span class="PUNC">[</span><span class="STRN">'defaults'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 45</span> </span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 46</span> </span><span class="WHIT"> <span class='line'> 46</span> </span><span class="WHIT"> </span><span class="NAME">this.currentId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 47</span> <span class='line'> 47</span> </span><span class="WHIT">
<span class='line'> 48</span> </span><span class="NAME">this.addEvents</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 48</span> </span><span class="NAME">this.addEvents</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT"> </span><span class="STRN">'add'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 49</span> </span><span class="WHIT"> </span><span class="STRN">'add'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT"> </span><span class="STRN">'changed'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 50</span> </span><span class="WHIT"> </span><span class="STRN">'changed'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
@ -82,164 +82,175 @@
<span class='line'> 75</span> </span><span class="WHIT"> <span class='line'> 75</span> </span><span class="WHIT">
<span class='line'> 76</span> </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">field.getXType</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 76</span> </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">field.getXType</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'checkbox'</span><span class="PUNC">:</span><span class="WHIT"> <span class='line'> 77</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'checkbox'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="WHIT"> </span><span class="NAME">field.on</span><span class="PUNC">(</span><span class="STRN">'check'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onFieldChange</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 78</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'radiogroup'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 79</span> </span><span class="WHIT"> </span><span class="NAME">field.on</span><span class="PUNC">(</span><span class="STRN">'check'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onFieldChange</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'uxspinner'</span><span class="PUNC">:</span><span class="WHIT"> <span class='line'> 80</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 81</span> </span><span class="WHIT"> </span><span class="NAME">field.on</span><span class="PUNC">(</span><span class="STRN">'spin'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onFieldChange</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 81</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'uxspinner'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'> 82</span> </span><span class="WHIT"> </span><span class="NAME">field.on</span><span class="PUNC">(</span><span class="STRN">'keypress'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onFieldChange</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 82</span> </span><span class="WHIT"> </span><span class="NAME">field.on</span><span class="PUNC">(</span><span class="STRN">'spin'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onFieldChange</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 83</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 83</span> </span><span class="WHIT"> </span><span class="NAME">field.on</span><span class="PUNC">(</span><span class="STRN">'keypress'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.onFieldChange</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 84</span> </span><span class="WHIT"> </span><span class="KEYW">default</span><span class="PUNC">:</span><span class="WHIT"> <span class='line'> 84</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 85</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 85</span> </span><span class="WHIT"> </span><span class="KEYW">default</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'> 86</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'> 86</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 87</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT"> <span class='line'> 88</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="COMM">/** <span class='line'> 89</span> </span><span class="WHIT">
<span class='line'> 90</span> * Returns the changed values for a specified id. <span class='line'> 90</span> </span><span class="COMM">/**
<span class='line'> 91</span> * @param {String} id <span class='line'> 91</span> * Changes bound fields to use the specified id.
<span class='line'> 92</span> * @returns {Object} the changed options <span class='line'> 92</span> * @param {String} id
<span class='line'> 93</span> */</span><span class="WHIT"> <span class='line'> 93</span> */</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT"> </span><span class="NAME">getChanged</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'> 94</span> </span><span class="WHIT"> </span><span class="NAME">changeId</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'> 95</span> </span><span class="WHIT"> </span><span class="NAME">this.currentId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'> 96</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">option</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">this.defaults</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT"> <span class='line'> 97</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.binds</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="COMM">/** <span class='line'> 98</span> </span><span class="WHIT"> </span><span class="NAME">this.binds</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">setValue</span><span class="PUNC">(</span><span class="NAME">this.get</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 99</span> * Get the default value for an option given an id and option name. <span class='line'> 99</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>100</span> * @param {String} id <span class='line'>100</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>101</span> * @param {String} option <span class='line'>101</span> </span><span class="WHIT">
<span class='line'>102</span> * @returns {Object} the value of the option <span class='line'>102</span> </span><span class="COMM">/**
<span class='line'>103</span> */</span><span class="WHIT"> <span class='line'>103</span> * Get the value for an option
<span class='line'>104</span> </span><span class="WHIT"> </span><span class="NAME">getOption</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>104</span> * @param {String} id
<span class='line'>105</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.hasOption</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.defaults</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>105</span> * @param {String|Array} [option] A single option or an array of options to return.
<span class='line'>106</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>106</span> * @returns {Object} the options value.
<span class='line'>107</span> </span><span class="WHIT"> <span class='line'>107</span> */</span><span class="WHIT">
<span class='line'>108</span> </span><span class="COMM">/** <span class='line'>108</span> </span><span class="WHIT"> </span><span class="NAME">get</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>109</span> * Get the value for an option given an id and option name. <span class='line'>109</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">option</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>110</span> * @param {String} id <span class='line'>110</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">values</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>111</span> * @param {String} option <span class='line'>111</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">key</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">this.defaults</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>112</span> * @returns {Object} the options value. <span class='line'>112</span> </span><span class="WHIT"> </span><span class="NAME">values</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.get</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">key</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>113</span> */</span><span class="WHIT"> <span class='line'>113</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>114</span> </span><span class="WHIT"> </span><span class="NAME">getValue</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>114</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">values</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>115</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.hasChanged</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.getOption</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>115</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>116</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>116</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.hasChanged</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.getDefault</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>117</span> </span><span class="WHIT"> <span class='line'>117</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>118</span> </span><span class="COMM">/** <span class='line'>118</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>119</span> * Check to see if the option has been changed. <span class='line'>119</span> </span><span class="WHIT">
<span class='line'>120</span> * @param {String} id <span class='line'>120</span> </span><span class="COMM">/**
<span class='line'>121</span> * @param {String} option <span class='line'>121</span> * Returns the changed values.
<span class='line'>122</span> * @returns {Boolean} true if the option has been changed, else false. <span class='line'>122</span> * @param {String} id
<span class='line'>123</span> */</span><span class="WHIT"> <span class='line'>123</span> * @returns {Object} the changed options
<span class='line'>124</span> </span><span class="WHIT"> </span><span class="NAME">hasChanged</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>124</span> */</span><span class="WHIT">
<span class='line'>125</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">Ext.isEmpty</span><span class="PUNC">(</span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>125</span> </span><span class="WHIT"> </span><span class="NAME">getChanged</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>126</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>126</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT"> <span class='line'>127</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>128</span> </span><span class="COMM">/** <span class='line'>128</span> </span><span class="WHIT">
<span class='line'>129</span> * Check to see if an id has had an option set to something other than the <span class='line'>129</span> </span><span class="COMM">/**
<span class='line'>130</span> * default value. <span class='line'>130</span> * Get the default value for an option.
<span class='line'>131</span> * @param {String} id <span class='line'>131</span> * @param {String} id
<span class='line'>132</span> * @param {String} option <span class='line'>132</span> * @param {String|Array} [option] A single option or an array of options to return.
<span class='line'>133</span> * @returns {Boolean} true if the id has an option, else false. <span class='line'>133</span> * @returns {Object} the value of the option
<span class='line'>134</span> */</span><span class="WHIT"> <span class='line'>134</span> */</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT"> </span><span class="NAME">hasOption</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>135</span> </span><span class="WHIT"> </span><span class="NAME">getDefault</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.options</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">Ext.isEmpty</span><span class="PUNC">(</span><span class="NAME">this.options</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>136</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.hasOption</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.defaults</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>137</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>137</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>138</span> <span class='line'>138</span> </span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT"> </span><span class="COMM">/** <span class='line'>139</span> </span><span class="COMM">/**
<span class='line'>140</span> * Reset the options back to the default values for the specified id. <span class='line'>140</span> * Check to see if the option has been changed.
<span class='line'>141</span> * @param {String} id <span class='line'>141</span> * @param {String} id
<span class='line'>142</span> */</span><span class="WHIT"> <span class='line'>142</span> * @param {String} option
<span class='line'>143</span> </span><span class="WHIT"> </span><span class="NAME">resetOptions</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>143</span> * @returns {Boolean} true if the option has been changed, else false.
<span class='line'>144</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>144</span> */</span><span class="WHIT">
<span class='line'>145</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>145</span> </span><span class="WHIT"> </span><span class="NAME">hasChanged</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>146</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>146</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">Ext.isEmpty</span><span class="PUNC">(</span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>147</span> </span><span class="WHIT"> <span class='line'>147</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>148</span> </span><span class="COMM">/** <span class='line'>148</span> </span><span class="WHIT">
<span class='line'>149</span> * Set the specified option for the passed in id. <span class='line'>149</span> </span><span class="COMM">/**
<span class='line'>150</span> * @param {String} id <span class='line'>150</span> * Check to see if an id has had an option set to something other than the
<span class='line'>151</span> * @param {String} option <span class='line'>151</span> * default value.
<span class='line'>152</span> * @param {Object} value The value for the option <span class='line'>152</span> * @param {String} id
<span class='line'>153</span> */</span><span class="WHIT"> <span class='line'>153</span> * @param {String} option
<span class='line'>154</span> </span><span class="WHIT"> </span><span class="NAME">setOption</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>154</span> * @returns {Boolean} true if the id has an option, else false.
<span class='line'>155</span> </span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>155</span> */</span><span class="WHIT">
<span class='line'>156</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>156</span> </span><span class="WHIT"> </span><span class="NAME">hasOption</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>157</span> </span><span class="WHIT"> <span class='line'>157</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.options</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">Ext.isEmpty</span><span class="PUNC">(</span><span class="NAME">this.options</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>158</span> </span><span class="COMM">/** <span class='line'>158</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>159</span> * Set the specified options for the passed in id. <span class='line'>159</span>
<span class='line'>160</span> * @param {String} id <span class='line'>160</span> </span><span class="WHIT"> </span><span class="COMM">/**
<span class='line'>161</span> * @param {Object} options The option values to change. <span class='line'>161</span> * Reset the options back to the default values for the specified id.
<span class='line'>162</span> */</span><span class="WHIT"> <span class='line'>162</span> * @param {String} id
<span class='line'>163</span> </span><span class="WHIT"> </span><span class="NAME">setOptions</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>163</span> */</span><span class="WHIT">
<span class='line'>164</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>164</span> </span><span class="WHIT"> </span><span class="NAME">reset</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>165</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">key</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>165</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>166</span> </span><span class="WHIT"> </span><span class="NAME">this.setOption</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>166</span> </span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>167</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>167</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>168</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>168</span> </span><span class="WHIT">
<span class='line'>169</span> </span><span class="WHIT"> <span class='line'>169</span> </span><span class="COMM">/**
<span class='line'>170</span> </span><span class="COMM">/** <span class='line'>170</span> * Sets the value of specified option for the passed in id.
<span class='line'>171</span> * Update the value for the specified option and id. <span class='line'>171</span> * @param {String} id
<span class='line'>172</span> * @param {String} id <span class='line'>172</span> * @param {String} option
<span class='line'>173</span> * @param {String} option <span class='line'>173</span> * @param {Object} value The value for the option
<span class='line'>174</span> * @param {Object} value; <span class='line'>174</span> */</span><span class="WHIT">
<span class='line'>175</span> */</span><span class="WHIT"> <span class='line'>175</span> </span><span class="WHIT"> </span><span class="NAME">set</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>176</span> </span><span class="WHIT"> </span><span class="NAME">updateOption</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>176</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>177</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>177</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">key</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>178</span> </span><span class="WHIT"> <span class='line'>178</span> </span><span class="WHIT"> </span><span class="NAME">this.set</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>179</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getValue</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>179</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>180</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">oldValue</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>180</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>181</span> </span><span class="WHIT"> <span class='line'>181</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.options</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>182</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">defaultValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getOption</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>182</span> </span><span class="WHIT"> </span><span class="NAME">this.options</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>183</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">defaultValue</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>183</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>184</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">Ext.isEmpty</span><span class="PUNC">(</span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>184</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>185</span> </span><span class="WHIT"> </span><span class="NAME">this.fireEvent</span><span class="PUNC">(</span><span class="STRN">'changed'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>185</span> </span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>186</span> </span><span class="COMM">/**
<span class='line'>187</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>187</span> * Update the value for the specified option and id.
<span class='line'>188</span> </span><span class="WHIT"> <span class='line'>188</span> * @param {String} id
<span class='line'>189</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">defaultValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>189</span> * @param {String|Object} option or options to update
<span class='line'>190</span> </span><span class="WHIT"> </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">defaultValue</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>190</span> * @param {Object} [value];
<span class='line'>191</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">:</span><span class="WHIT"> <span class='line'>191</span> */</span><span class="WHIT">
<span class='line'>192</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>192</span> </span><span class="WHIT"> </span><span class="NAME">update</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>193</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>193</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>194</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="PUNC">:</span><span class="WHIT"> <span class='line'>194</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">key</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>195</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Number</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>195</span> </span><span class="WHIT"> </span><span class="NAME">this.update</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>196</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>196</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>197</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'boolean'</span><span class="PUNC">:</span><span class="WHIT"> <span class='line'>197</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>198</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Boolean</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>198</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>199</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>199</span> </span><span class="WHIT">
<span class='line'>200</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>200</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.get</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>201</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">oldValue</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>202</span> <span class='line'>202</span> </span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>203</span> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">defaultValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getDefault</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>204</span> </span><span class="WHIT"> </span><span class="NAME">this.fireEvent</span><span class="PUNC">(</span><span class="STRN">'changed'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>204</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">defaultValue</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>205</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>205</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.hasChanged</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>206</span> </span><span class="WHIT"> <span class='line'>206</span> </span><span class="WHIT"> </span><span class="NAME">this.fireEvent</span><span class="PUNC">(</span><span class="STRN">'changed'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>207</span> </span><span class="COMM">/** <span class='line'>207</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>208</span> * Update the options for the specified id. <span class='line'>208</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>209</span> * @param {String} id <span class='line'>209</span> </span><span class="WHIT">
<span class='line'>210</span> * @param {Object} options The options to change. <span class='line'>210</span> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">defaultValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>211</span> */</span><span class="WHIT"> <span class='line'>211</span> </span><span class="WHIT"> </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.type</span><span class="PUNC">(</span><span class="NAME">defaultValue</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>212</span> </span><span class="WHIT"> </span><span class="NAME">updateOptions</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>212</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>213</span> </span><span class="WHIT"> </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">key</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>213</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>214</span> </span><span class="WHIT"> </span><span class="NAME">this.updateOption</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">key</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">[</span><span class="NAME">key</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>214</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>215</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>215</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>216</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Number</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT"> <span class='line'>217</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>218</span> </span><span class="COMM">/* Event Handlers */</span><span class="WHIT"> <span class='line'>218</span> </span><span class="WHIT"> </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="STRN">'boolean'</span><span class="PUNC">:</span><span class="WHIT">
<span class='line'>219</span> </span><span class="WHIT"> <span class='line'>219</span> </span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Boolean</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>220</span> </span><span class="COMM">/** <span class='line'>220</span> </span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>221</span> * Stops a form fields value from being blocked by the change functions <span class='line'>221</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>222</span> * @param {Ext.form.Field} field <span class='line'>222</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>223</span> * @private <span class='line'>223</span> </span><span class="WHIT">
<span class='line'>224</span> */</span><span class="WHIT"> <span class='line'>224</span> </span><span class="NAME">this.changed</span><span class="PUNC">[</span><span class="NAME">id</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>225</span> </span><span class="WHIT"> </span><span class="NAME">onFieldChange</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">field</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>225</span> </span><span class="WHIT"> </span><span class="NAME">this.fireEvent</span><span class="PUNC">(</span><span class="STRN">'changed'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>226</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">option</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.binds</span><span class="PUNC">[</span><span class="NAME">field</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>226</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>227</span> </span><span class="WHIT"> </span><span class="COMM">//alert(option);</span><span class="WHIT"> <span class='line'>227</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>228</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> <span class='line'>228</span> </span><span class="WHIT">
<span class='line'>229</span> </span><span class="WHIT"> <span class='line'>229</span> </span><span class="COMM">/* Event Handlers */</span><span class="WHIT">
<span class='line'>230</span> </span><span class="NAME">onChange</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">newValue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> <span class='line'>230</span> </span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT"> </span><span class="COMM">// If we don't have a bind there's nothing to do.</span><span class="WHIT"> <span class='line'>231</span> </span><span class="COMM">/**
<span class='line'>232</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.isEmpty</span><span class="PUNC">(</span><span class="NAME">this.binds</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>232</span> * Stops a form fields value from being blocked by the change functions
<span class='line'>233</span> </span><span class="WHIT"> <span class='line'>233</span> * @param {Ext.form.Field} field
<span class='line'>234</span> </span><span class="COMM">// Set the form field to the new value.</span><span class="WHIT"> <span class='line'>234</span> * @private
<span class='line'>235</span> </span><span class="WHIT"> </span><span class="NAME">this.binds</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">setValue</span><span class="PUNC">(</span><span class="NAME">newValue</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>235</span> */</span><span class="WHIT">
<span class='line'>236</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>236</span> </span><span class="WHIT"> </span><span class="NAME">onFieldChange</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">field</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>237</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>237</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">option</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.binds</span><span class="PUNC">[</span><span class="NAME">field</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>238</span> </span></pre></body></html> <span class='line'>238</span> </span><span class="WHIT"> </span><span class="NAME">this.update</span><span class="PUNC">(</span><span class="NAME">this.currentId</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">field.getValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>239</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>240</span> </span><span class="WHIT">
<span class='line'>241</span> </span><span class="NAME">onChange</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">id</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">option</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">newValue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">oldValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>242</span> </span><span class="WHIT"> </span><span class="COMM">// If we don't have a bind there's nothing to do.</span><span class="WHIT">
<span class='line'>243</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Ext.isEmpty</span><span class="PUNC">(</span><span class="NAME">this.binds</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>244</span> </span><span class="WHIT">
<span class='line'>245</span> </span><span class="COMM">// Set the form field to the new value.</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT"> </span><span class="NAME">this.binds</span><span class="PUNC">[</span><span class="NAME">option</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">setValue</span><span class="PUNC">(</span><span class="NAME">newValue</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>248</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>249</span> </span></pre></body></html>

View File

@ -752,4 +752,40 @@
<span class='line'>745</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>745</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>746</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT"> <span class='line'>746</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>747</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> <span class='line'>747</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>748</span> </span><span class="NAME">Ext.reg</span><span class="PUNC">(</span><span class="STRN">'fullprogressbar'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Ext.ux.FullProgressBar</span><span class="PUNC">)</span><span class="PUNC">;</span></pre></body></html> <span class='line'>748</span> </span><span class="NAME">Ext.reg</span><span class="PUNC">(</span><span class="STRN">'fullprogressbar'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Ext.ux.FullProgressBar</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>749</span>
<span class='line'>750</span>
<span class='line'>751</span> </span><span class="COMM">// Allow radiogroups to be treated as a single form element.</span><span class="WHIT">
<span class='line'>752</span> </span><span class="NAME">Ext.override</span><span class="PUNC">(</span><span class="NAME">Ext.form.RadioGroup</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>753</span>
<span class='line'>754</span> </span><span class="WHIT"> </span><span class="NAME">afterRender</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>755</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">that</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>756</span> </span><span class="WHIT"> </span><span class="NAME">this.items.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>757</span> </span><span class="WHIT"> </span><span class="NAME">that.relayEvents</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">'check'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>758</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>759</span> </span><span class="WHIT"> </span><span class="NAME">Ext.form.RadioGroup.superclass.afterRender.call</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>760</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>761</span>
<span class='line'>762</span> </span><span class="WHIT"> </span><span class="NAME">getName</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>763</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.items.first</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>764</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>765</span>
<span class='line'>766</span> </span><span class="WHIT"> </span><span class="NAME">getValue</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>767</span> </span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>768</span>
<span class='line'>769</span> </span><span class="WHIT"> </span><span class="NAME">this.items.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">item</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>770</span> </span><span class="WHIT"> </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">item.getRawValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>771</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">item.getValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>772</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>773</span>
<span class='line'>774</span> </span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>775</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>776</span>
<span class='line'>777</span> </span><span class="WHIT"> </span><span class="NAME">setValue</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>778</span> </span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.items.each</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>779</span> </span><span class="WHIT"> </span><span class="NAME">this.items.each</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">item</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>780</span> </span><span class="WHIT"> </span><span class="NAME">item.setValue</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">item.getRawValue</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'true'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>781</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>782</span> </span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>783</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>784</span> </span></pre></body></html>