From 7dfce330659c872172bb2fefddbc0d646ef62236 Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Tue, 16 Jun 2009 18:15:28 +0000 Subject: [PATCH] rebuild the docs --- deluge/ui/web/docs/files.html | 2 +- deluge/ui/web/docs/index.html | 2 +- deluge/ui/web/docs/symbols/Deluge.Events.html | 2 +- .../web/docs/symbols/Deluge.Formatters.html | 2 +- deluge/ui/web/docs/symbols/Deluge.Keys.html | 2 +- .../docs/symbols/Deluge.OptionsManager.html | 2 +- deluge/ui/web/docs/symbols/Deluge.UI.html | 2 +- .../docs/symbols/Ext.deluge.TorrentGrid.html | 2 +- .../docs/symbols/Ext.ux.FullProgressBar.html | 2 +- deluge/ui/web/docs/symbols/_global_.html | 2 +- .../src/Deluge.Details.Options.js.html | 792 ++++++++---------- .../web/docs/symbols/src/Deluge.Menus.js.html | 12 +- .../symbols/src/Deluge.OptionsManager.js.html | 337 ++++---- .../symbols/src/ext-extensions-debug.js.html | 2 +- 14 files changed, 572 insertions(+), 591 deletions(-) diff --git a/deluge/ui/web/docs/files.html b/deluge/ui/web/docs/files.html index 94e9ed057..977edadb7 100644 --- a/deluge/ui/web/docs/files.html +++ b/deluge/ui/web/docs/files.html @@ -644,7 +644,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 02 2009 23:11:36 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST)
\ No newline at end of file diff --git a/deluge/ui/web/docs/index.html b/deluge/ui/web/docs/index.html index 6d495e896..bff485210 100644 --- a/deluge/ui/web/docs/index.html +++ b/deluge/ui/web/docs/index.html @@ -260,7 +260,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 02 2009 23:11:36 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST)
\ No newline at end of file diff --git a/deluge/ui/web/docs/symbols/Deluge.Events.html b/deluge/ui/web/docs/symbols/Deluge.Events.html index f8b86220e..bbfdf85be 100644 --- a/deluge/ui/web/docs/symbols/Deluge.Events.html +++ b/deluge/ui/web/docs/symbols/Deluge.Events.html @@ -306,7 +306,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 02 2009 23:11:35 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST)
diff --git a/deluge/ui/web/docs/symbols/Deluge.Formatters.html b/deluge/ui/web/docs/symbols/Deluge.Formatters.html index 09dbe7573..735bc27c9 100644 --- a/deluge/ui/web/docs/symbols/Deluge.Formatters.html +++ b/deluge/ui/web/docs/symbols/Deluge.Formatters.html @@ -592,7 +592,7 @@ if seconds < 0
- Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 02 2009 23:11:35 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST)
diff --git a/deluge/ui/web/docs/symbols/Deluge.Keys.html b/deluge/ui/web/docs/symbols/Deluge.Keys.html index 9c3929cfb..3f5228c7b 100644 --- a/deluge/ui/web/docs/symbols/Deluge.Keys.html +++ b/deluge/ui/web/docs/symbols/Deluge.Keys.html @@ -528,7 +528,7 @@ by Deluge.Keys.Grid.
- Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 02 2009 23:11:35 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST)
diff --git a/deluge/ui/web/docs/symbols/Deluge.OptionsManager.html b/deluge/ui/web/docs/symbols/Deluge.OptionsManager.html index 8d56ae573..24f9293b5 100644 --- a/deluge/ui/web/docs/symbols/Deluge.OptionsManager.html +++ b/deluge/ui/web/docs/symbols/Deluge.OptionsManager.html @@ -306,7 +306,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 02 2009 23:11:35 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST)
diff --git a/deluge/ui/web/docs/symbols/Deluge.UI.html b/deluge/ui/web/docs/symbols/Deluge.UI.html index 3628d1117..387470c49 100644 --- a/deluge/ui/web/docs/symbols/Deluge.UI.html +++ b/deluge/ui/web/docs/symbols/Deluge.UI.html @@ -523,7 +523,7 @@ and set up various events that the UI will utilise.
- Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 02 2009 23:11:36 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST)
diff --git a/deluge/ui/web/docs/symbols/Ext.deluge.TorrentGrid.html b/deluge/ui/web/docs/symbols/Ext.deluge.TorrentGrid.html index 13bfceb9b..a18fb5e20 100644 --- a/deluge/ui/web/docs/symbols/Ext.deluge.TorrentGrid.html +++ b/deluge/ui/web/docs/symbols/Ext.deluge.TorrentGrid.html @@ -319,7 +319,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 02 2009 23:11:36 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST)
diff --git a/deluge/ui/web/docs/symbols/Ext.ux.FullProgressBar.html b/deluge/ui/web/docs/symbols/Ext.ux.FullProgressBar.html index 9beb6191f..915963149 100644 --- a/deluge/ui/web/docs/symbols/Ext.ux.FullProgressBar.html +++ b/deluge/ui/web/docs/symbols/Ext.ux.FullProgressBar.html @@ -319,7 +319,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 02 2009 23:11:36 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 16 2009 19:13:09 GMT+0100 (BST)
diff --git a/deluge/ui/web/docs/symbols/_global_.html b/deluge/ui/web/docs/symbols/_global_.html index 3fcd26139..7a2d6716f 100644 --- a/deluge/ui/web/docs/symbols/_global_.html +++ b/deluge/ui/web/docs/symbols/_global_.html @@ -847,7 +847,7 @@ ul.inheritsList
- Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 02 2009 23:11:35 GMT+0100 (BST) + Documentation generated by JsDoc Toolkit 2.1.0 on Tue Jun 16 2009 19:13:08 GMT+0100 (BST)
diff --git a/deluge/ui/web/docs/symbols/src/Deluge.Details.Options.js.html b/deluge/ui/web/docs/symbols/src/Deluge.Details.Options.js.html index 0bacdd851..6d2c321d9 100644 --- a/deluge/ui/web/docs/symbols/src/Deluge.Details.Options.js.html +++ b/deluge/ui/web/docs/symbols/src/Deluge.Details.Options.js.html @@ -63,439 +63,363 @@ 56 Ext.deluge.details.OptionsTab.superclass.initComponent.call(this); 57 58 this.fieldsets = {}, this.fields = {}; - 59 this.optionsManager = new Deluge.OptionsManager(); - 60 this.optionsManager.on('changed', this.onOptionChanged, this); - 61 - 62 /* - 63 * Bandwidth Options - 64 */ - 65 this.fieldsets.bandwidth = this.add({ - 66 xtype: 'fieldset', - 67 defaultType: 'uxspinner', - 68 bodyStyle: 'padding: 5px', - 69 - 70 layout: 'table', - 71 layoutConfig: {columns: 3}, - 72 labelWidth: 150, - 73 - 74 style: 'margin-left: 10px; margin-right: 5px; padding: 5px', - 75 title: _('Bandwidth'), - 76 width: 250 - 77 }); - 78 - 79 /* - 80 * Max Download Speed - 81 */ - 82 this.fieldsets.bandwidth.add({ - 83 xtype: 'label', - 84 text: _('Max Download Speed'), - 85 forId: 'max_download_speed', - 86 cls: 'x-deluge-options-label' - 87 }); - 88 this.fields.max_download_speed = this.fieldsets.bandwidth.add({ - 89 id: 'max_download_speed', - 90 name: 'max_download_speed', - 91 width: 70, - 92 stragegy: new Ext.ux.form.Spinner.NumberStrategy({ - 93 minValue: -1, - 94 maxValue: 99999 - 95 }), - 96 listeners: { - 97 'spin': { - 98 fn: this.onFieldChange, - 99 scope: this -100 }, -101 'keypress': { -102 fn: this.onFieldChange, -103 scope: this -104 } -105 } -106 }); -107 this.fieldsets.bandwidth.add({ -108 xtype: 'label', -109 text: _('KiB/s'), -110 style: 'margin-left: 10px' -111 }); -112 -113 /* -114 * Max Upload Speed -115 */ -116 this.fieldsets.bandwidth.add({ -117 xtype: 'label', -118 text: _('Max Upload Speed'), -119 forId: 'max_upload_speed', -120 cls: 'x-deluge-options-label' -121 }); -122 this.fields.max_upload_speed = this.fieldsets.bandwidth.add({ -123 id: 'max_upload_speed', -124 name: 'max_upload_speed', -125 width: 70, -126 value: -1, -127 stragegy: new Ext.ux.form.Spinner.NumberStrategy({ -128 minValue: -1, -129 maxValue: 99999, -130 incrementValue: 1 -131 }), -132 listeners: { -133 'spin': { -134 fn: this.onFieldChange, -135 scope: this -136 }, -137 'keypress': { -138 fn: this.onFieldChange, -139 scope: this -140 } -141 } -142 }); -143 this.fieldsets.bandwidth.add({ -144 xtype: 'label', -145 text: _('KiB/s'), -146 style: 'margin-left: 10px' -147 }); -148 -149 /* -150 * Max Connections -151 */ -152 this.fieldsets.bandwidth.add({ -153 xtype: 'label', -154 text: _('Max Connections'), -155 forId: 'max_connections', -156 cls: 'x-deluge-options-label' -157 }); -158 this.fields.max_connections = this.fieldsets.bandwidth.add({ -159 id: 'max_connections', -160 name: 'max_connections', -161 width: 70, -162 value: -1, -163 stragegy: new Ext.ux.form.Spinner.NumberStrategy({ -164 minValue: -1, -165 maxValue: 99999, -166 incrementValue: 1 -167 }), -168 listeners: { -169 'spin': { -170 fn: this.onFieldChange, -171 scope: this -172 }, -173 'keypress': { -174 fn: this.onFieldChange, -175 scope: this -176 } -177 }, -178 colspan: 2 -179 }); -180 -181 /* -182 * Max Upload Slots -183 */ -184 this.fieldsets.bandwidth.add({ -185 xtype: 'label', -186 text: _('Max Upload Slots'), -187 forId: 'max_upload_slots', -188 cls: 'x-deluge-options-label' -189 }); -190 this.fields.max_upload_slots = this.fieldsets.bandwidth.add({ -191 id: 'max_upload_slots', -192 name: 'max_upload_slots', -193 width: 70, -194 value: -1, -195 stragegy: new Ext.ux.form.Spinner.NumberStrategy({ -196 minValue: -1, -197 maxValue: 99999, -198 incrementValue: 1 -199 }), -200 listeners: { -201 'spin': { -202 fn: this.onFieldChange, -203 scope: this -204 }, -205 'keypress': { -206 fn: this.onFieldChange, -207 scope: this -208 } -209 }, -210 colspan: 2 -211 }); -212 -213 /* -214 * Queue Options -215 */ -216 this.fieldsets.queue = this.add({ -217 xtype: 'fieldset', -218 title: _('Queue'), -219 style: 'margin-left: 5px; margin-right: 5px; padding: 5px', -220 width: 210, -221 -222 layout: 'table', -223 layoutConfig: {columns: 2}, -224 labelWidth: 0, -225 -226 defaults: { -227 fieldLabel: '', -228 labelSeparator: '' -229 } -230 }); -231 -232 this.fields.is_auto_managed = this.fieldsets.queue.add({ -233 fieldLabel: '', -234 labelSeparator: '', -235 id: 'is_auto_managed', -236 boxLabel: _('Auto Managed'), -237 width: 200, -238 listeners: { -239 'check': { -240 fn: this.onFieldChange, -241 scope: this -242 } -243 }, -244 colspan: 2 -245 }); -246 -247 this.fields.stop_at_ratio = this.fieldsets.queue.add({ -248 fieldLabel: '', -249 labelSeparator: '', -250 id: 'stop_at_ratio', -251 width: 110, -252 boxLabel: _('Stop seed at ratio'), -253 listeners: { -254 'check': { -255 fn: this.onFieldChange, -256 scope: this -257 } -258 } -259 }); -260 this.fields.stop_ratio = this.fieldsets.queue.add({ -261 xtype: 'uxspinner', -262 id: 'stop_ratio', -263 name: 'stop_ratio', -264 disabled: true, -265 width: 50, -266 value: 2.0, -267 stragegy: new Ext.ux.form.Spinner.NumberStrategy({ -268 minValue: -1, -269 maxValue: 99999, -270 incrementValue: 1 -271 }), -272 listeners: { -273 'spin': { -274 fn: this.onFieldChange, -275 scope: this -276 }, -277 'keypress': { -278 fn: this.onFieldChange, -279 scope: this -280 } -281 } -282 }); -283 -284 this.fields.remove_at_ratio = this.fieldsets.queue.add({ -285 fieldLabel: '', -286 labelSeparator: '', -287 id: 'remove_at_ratio', -288 bodyStyle: 'padding-left: 10px', -289 boxLabel: _('Remove at ratio'), -290 disabled: true, -291 listeners: { -292 'check': { -293 fn: this.onFieldChange, -294 scope: this -295 } -296 }, -297 colspan: 2 -298 }); -299 -300 this.fields.move_completed = this.fieldsets.queue.add({ -301 fieldLabel: '', -302 labelSeparator: '', -303 id: 'move_completed', -304 boxLabel: _('Move Completed'), -305 listeners: { -306 'check': { -307 fn: this.onFieldChange, -308 scope: this -309 } -310 }, -311 colspan: 2 -312 }); -313 -314 -315 /* -316 * General Options -317 */ -318 this.rightColumn = this.add({ -319 border: false, -320 autoHeight: true, -321 style: 'margin-left: 5px', -322 width: 200 -323 }); -324 -325 this.fieldsets.general = this.rightColumn.add({ -326 xtype: 'fieldset', -327 autoHeight: true, -328 defaultType: 'checkbox', -329 title: _('General'), -330 layout: 'form' -331 }); -332 -333 this.fields['private'] = this.fieldsets.general.add({ -334 fieldLabel: '', -335 labelSeparator: '', -336 boxLabel: _('Private'), -337 id: 'private', -338 listeners: { -339 'check': { -340 fn: this.onFieldChange, -341 scope: this -342 } -343 } -344 }); -345 -346 this.fields.prioritize_first_last = this.fieldsets.general.add({ -347 fieldLabel: '', -348 labelSeparator: '', -349 boxLabel: _('Prioritize First/Last'), -350 id: 'prioritize_first_last', -351 listeners: { -352 'check': { -353 fn: this.onFieldChange, -354 scope: this -355 } -356 } -357 }); -358 -359 /* -360 * Buttons -361 */ -362 this.buttonPanel = this.rightColumn.add({ -363 layout: 'column', -364 xtype: 'panel', -365 border: false -366 }); -367 -368 // The buttons below are required to be added to a panel -369 // first as simply adding them to the column layout throws an -370 // error c.getSize() does not exist. This could be intentional -371 // or it may possible be a bug in ext-js. Take care when upgrading -372 // to ext-js 3.0. -373 -374 /* -375 * Edit Trackers button -376 */ -377 this.buttonPanel.add({ -378 xtype: 'panel', -379 border: false -380 }).add({ -381 id: 'edit_trackers', -382 xtype: 'button', -383 text: _('Edit Trackers'), -384 cls: 'x-btn-text-icon', -385 iconCls: 'x-deluge-edit-trackers', -386 border: false, -387 width: 100, -388 handler: this.onEditTrackers, -389 scope: this -390 }); -391 -392 /* -393 * Apply button -394 */ -395 this.buttonPanel.add({ -396 xtype: 'panel', -397 border: false -398 }).add({ -399 id: 'apply', -400 xtype: 'button', -401 text: _('Apply'), -402 style: 'margin-left: 10px;', -403 border: false, -404 width: 100, -405 handler: this.onApply, -406 scope: this -407 }); + 59 this.optionsManager = new Deluge.OptionsManager({ + 60 defaults: { + 61 'max_download_speed': -1, + 62 'max_upload_speed': -1, + 63 'max_connections': -1, + 64 'max_upload_slots': -1, + 65 'is_auto_managed': false, + 66 'stop_at_ratio': false, + 67 'stop_ratio': 2.0, + 68 'remove_at_ratio': false, + 69 'move_completed': null, + 70 'private': false, + 71 'prioritize_first_last': false + 72 } + 73 }); + 74 this.optionsManager.on('changed', this.onOptionChanged, this); + 75 + 76 /* + 77 * Bandwidth Options + 78 */ + 79 this.fieldsets.bandwidth = this.add({ + 80 xtype: 'fieldset', + 81 defaultType: 'uxspinner', + 82 bodyStyle: 'padding: 5px', + 83 + 84 layout: 'table', + 85 layoutConfig: {columns: 3}, + 86 labelWidth: 150, + 87 + 88 style: 'margin-left: 10px; margin-right: 5px; padding: 5px', + 89 title: _('Bandwidth'), + 90 width: 250 + 91 }); + 92 + 93 /* + 94 * Max Download Speed + 95 */ + 96 this.fieldsets.bandwidth.add({ + 97 xtype: 'label', + 98 text: _('Max Download Speed'), + 99 forId: 'max_download_speed', +100 cls: 'x-deluge-options-label' +101 }); +102 this.fields.max_download_speed = this.fieldsets.bandwidth.add({ +103 id: 'max_download_speed', +104 name: 'max_download_speed', +105 width: 70, +106 strategy: { +107 xtype: 'number', +108 decimalPrecision: 1, +109 minValue: -1, +110 maxValue: 99999 +111 } +112 }); +113 this.fieldsets.bandwidth.add({ +114 xtype: 'label', +115 text: _('KiB/s'), +116 style: 'margin-left: 10px' +117 }); +118 +119 /* +120 * Max Upload Speed +121 */ +122 this.fieldsets.bandwidth.add({ +123 xtype: 'label', +124 text: _('Max Upload Speed'), +125 forId: 'max_upload_speed', +126 cls: 'x-deluge-options-label' +127 }); +128 this.fields.max_upload_speed = this.fieldsets.bandwidth.add({ +129 id: 'max_upload_speed', +130 name: 'max_upload_speed', +131 width: 70, +132 value: -1, +133 strategy: { +134 xtype: 'number', +135 decimalPrecision: 1, +136 minValue: -1, +137 maxValue: 99999 +138 } +139 }); +140 this.fieldsets.bandwidth.add({ +141 xtype: 'label', +142 text: _('KiB/s'), +143 style: 'margin-left: 10px' +144 }); +145 +146 /* +147 * Max Connections +148 */ +149 this.fieldsets.bandwidth.add({ +150 xtype: 'label', +151 text: _('Max Connections'), +152 forId: 'max_connections', +153 cls: 'x-deluge-options-label' +154 }); +155 this.fields.max_connections = this.fieldsets.bandwidth.add({ +156 id: 'max_connections', +157 name: 'max_connections', +158 width: 70, +159 value: -1, +160 strategy: { +161 xtype: 'number', +162 decimalPrecision: 0, +163 minValue: -1, +164 maxValue: 99999 +165 }, +166 colspan: 2 +167 }); +168 +169 /* +170 * Max Upload Slots +171 */ +172 this.fieldsets.bandwidth.add({ +173 xtype: 'label', +174 text: _('Max Upload Slots'), +175 forId: 'max_upload_slots', +176 cls: 'x-deluge-options-label' +177 }); +178 this.fields.max_upload_slots = this.fieldsets.bandwidth.add({ +179 id: 'max_upload_slots', +180 name: 'max_upload_slots', +181 width: 70, +182 value: -1, +183 strategy: { +184 xtype: 'number', +185 decimalPrecision: 0, +186 minValue: -1, +187 maxValue: 99999 +188 }, +189 colspan: 2 +190 }); +191 +192 /* +193 * Queue Options +194 */ +195 this.fieldsets.queue = this.add({ +196 xtype: 'fieldset', +197 title: _('Queue'), +198 style: 'margin-left: 5px; margin-right: 5px; padding: 5px', +199 width: 210, +200 +201 layout: 'table', +202 layoutConfig: {columns: 2}, +203 labelWidth: 0, +204 +205 defaults: { +206 fieldLabel: '', +207 labelSeparator: '' +208 } +209 }); +210 +211 this.fields.is_auto_managed = this.fieldsets.queue.add({ +212 fieldLabel: '', +213 labelSeparator: '', +214 id: 'is_auto_managed', +215 boxLabel: _('Auto Managed'), +216 width: 200, +217 colspan: 2 +218 }); +219 +220 this.fields.stop_at_ratio = this.fieldsets.queue.add({ +221 fieldLabel: '', +222 labelSeparator: '', +223 id: 'stop_at_ratio', +224 width: 120, +225 boxLabel: _('Stop seed at ratio') +226 }); +227 +228 this.fields.stop_ratio = this.fieldsets.queue.add({ +229 xtype: 'uxspinner', +230 id: 'stop_ratio', +231 name: 'stop_ratio', +232 disabled: true, +233 width: 50, +234 value: 2.0, +235 strategy: { +236 xtype: 'number', +237 minValue: -1, +238 maxValue: 99999, +239 incrementValue: 0.1, +240 alternateIncrementValue: 1, +241 decimalPrecision: 1 +242 } +243 }); +244 +245 this.fields.remove_at_ratio = this.fieldsets.queue.add({ +246 fieldLabel: '', +247 labelSeparator: '', +248 id: 'remove_at_ratio', +249 bodyStyle: 'padding-left: 10px', +250 boxLabel: _('Remove at ratio'), +251 disabled: true, +252 colspan: 2 +253 }); +254 +255 this.fields.move_completed = this.fieldsets.queue.add({ +256 fieldLabel: '', +257 labelSeparator: '', +258 id: 'move_completed', +259 boxLabel: _('Move Completed'), +260 colspan: 2 +261 }); +262 +263 +264 /* +265 * General Options +266 */ +267 this.rightColumn = this.add({ +268 border: false, +269 autoHeight: true, +270 style: 'margin-left: 5px', +271 width: 200 +272 }); +273 +274 this.fieldsets.general = this.rightColumn.add({ +275 xtype: 'fieldset', +276 autoHeight: true, +277 defaultType: 'checkbox', +278 title: _('General'), +279 layout: 'form' +280 }); +281 +282 this.fields['private'] = this.fieldsets.general.add({ +283 fieldLabel: '', +284 labelSeparator: '', +285 boxLabel: _('Private'), +286 id: 'private' +287 }); +288 +289 this.fields.prioritize_first_last = this.fieldsets.general.add({ +290 fieldLabel: '', +291 labelSeparator: '', +292 boxLabel: _('Prioritize First/Last'), +293 id: 'prioritize_first_last' +294 }); +295 +296 // Bind the fields so the options manager can manage them. +297 for (var id in this.fields) { +298 this.optionsManager.bind(id, this.fields[id]); +299 } +300 +301 /* +302 * Buttons +303 */ +304 this.buttonPanel = this.rightColumn.add({ +305 layout: 'column', +306 xtype: 'panel', +307 border: false +308 }); +309 +310 // The buttons below are required to be added to a panel +311 // first as simply adding them to the column layout throws an +312 // error c.getSize() does not exist. This could be intentional +313 // or it may possible be a bug in ext-js. Take care when upgrading +314 // to ext-js 3.0. +315 +316 /* +317 * Edit Trackers button +318 */ +319 this.buttonPanel.add({ +320 xtype: 'panel', +321 border: false +322 }).add({ +323 id: 'edit_trackers', +324 xtype: 'button', +325 text: _('Edit Trackers'), +326 cls: 'x-btn-text-icon', +327 iconCls: 'x-deluge-edit-trackers', +328 border: false, +329 width: 100, +330 handler: this.onEditTrackers, +331 scope: this +332 }); +333 +334 /* +335 * Apply button +336 */ +337 this.buttonPanel.add({ +338 xtype: 'panel', +339 border: false +340 }).add({ +341 id: 'apply', +342 xtype: 'button', +343 text: _('Apply'), +344 style: 'margin-left: 10px;', +345 border: false, +346 width: 100, +347 handler: this.onApply, +348 scope: this +349 }); +350 }, +351 +352 onRender: function(ct, position) { +353 Ext.deluge.details.OptionsTab.superclass.onRender.call(this, ct, position); +354 +355 // This is another hack I think, so keep an eye out here when upgrading. +356 this.layout = new Ext.layout.ColumnLayout(); +357 this.layout.setContainer(this); +358 this.doLayout(); +359 }, +360 +361 clear: function() { +362 this.optionsManager.resetOptions(this.torrentId); +363 }, +364 +365 reset: function() { +366 if (this.torrentId) { +367 this.optionsManager.resetOptions(this.torrentId); +368 } +369 }, +370 +371 update: function(torrentId) { +372 this.torrentId = torrentId; +373 Deluge.Client.core.get_torrent_status(torrentId, Deluge.Keys.Options, { +374 success: this.onRequestComplete, +375 scope: this +376 }); +377 }, +378 +379 onApply: function() { +380 var changed = this.optionsManager.getChanged(this.torrentId); +381 if (!Ext.isEmpty(changed['prioritize_first_last'])) { +382 var value = changed['prioritize_first_last']; +383 Deluge.Client.core.set_torrent_prioritize_first_last(this.torrentId, value, { +384 success: function() { +385 this.optionsManager.setOption(this.torrentId, 'prioritize_first_last', value); +386 }, +387 scope: this +388 }); +389 } +390 Deluge.Client.core.set_torrent_options([this.torrentId], changed, { +391 success: function() { +392 this.optionsManager.setOptions(this.torrentId, changed); +393 this.optionsManager.resetOptions(this.torrentId); +394 }, +395 scope: this +396 }); +397 }, +398 +399 onEditTrackers: function() { +400 Deluge.EditTrackers.show(); +401 }, +402 +403 onOptionChanged: function(id, key, newValue, oldValue) { +404 if (key == 'stop_at_ratio') { +405 this.fields.remove_at_ratio.setDisabled(!newValue); +406 this.fields.stop_ratio.setDisabled(!newValue); +407 } 408 }, 409 -410 onRender: function(ct, position) { -411 Ext.deluge.details.OptionsTab.superclass.onRender.call(this, ct, position); -412 -413 // This is another hack I think, so keep an eye out here when upgrading. -414 this.layout = new Ext.layout.ColumnLayout(); -415 this.layout.setContainer(this); -416 this.doLayout(); -417 }, -418 -419 clear: function() { -420 this.fields.max_download_speed.setValue(0); -421 this.fields.max_upload_speed.setValue(0); -422 this.fields.max_connections.setValue(0); -423 this.fields.max_upload_slots.setValue(0); -424 this.fields.is_auto_managed.setValue(false); -425 this.fields.stop_at_ratio.setValue(false); -426 this.fields.remove_at_ratio.setValue(false); -427 this.fields['private'].setValue(false); -428 this.fields.prioritize_first_last.setValue(false); -429 }, -430 -431 reset: function() { -432 if (this.torrentId) { -433 this.optionsManager.resetOptions(this.torrentId); -434 } -435 }, -436 -437 update: function(torrentId) { -438 this.torrentId = torrentId; -439 Deluge.Client.core.get_torrent_status(torrentId, Deluge.Keys.Options, { -440 success: this.onRequestComplete, -441 scope: this -442 }); -443 }, -444 -445 onApply: function() { -446 var changed = this.optionsManager.getChanged(this.torrentId); -447 if (!Ext.isEmpty(changed['prioritize_first_last'])) { -448 var value = changed['prioritize_first_last']; -449 Deluge.Client.core.set_torrent_prioritize_first_last(this.torrentId, value, { -450 success: function() { -451 this.optionsManager.updateOption(this.torrentId, 'prioritize_first_last', value); -452 }, -453 scope: this -454 }); -455 } -456 Deluge.Client.core.set_torrent_options([this.torrentId], changed, { -457 success: function() { -458 this.optionsManager.updateOptions(this.torrentId, changed); -459 this.optionsManager.resetOptions(this.torrentId); -460 }, -461 scope: this -462 }); -463 }, -464 -465 onEditTrackers: function() { -466 Deluge.EditTrackers.show(); -467 }, -468 -469 onFieldChange: function(field) { -470 this.optionsManager.setOption(this.torrentId, field.id, field.getValue()); -471 }, -472 -473 onOptionChanged: function(id, key, newValue, oldValue) { -474 //alert(String.format('Key: {0}\nValue: {1}\nOld Value: {2}', key, newValue, oldValue)); -475 if (key == 'stop_at_ratio') { -476 this.fields.remove_at_ratio.setDisabled(!newValue); -477 this.fields.stop_ratio.setDisabled(!newValue); -478 } -479 }, -480 -481 onRequestComplete: function(torrent, options) { -482 this.fields['private'].setDisabled(!torrent['private']); -483 delete torrent['private']; -484 -485 this.optionsManager.updateOptions(this.torrentId, torrent); -486 for (var key in torrent) { -487 if (this.fields[key] && !this.optionsManager.hasChanged(this.torrentId, key)) { -488 if (!this.fields[key].disabled) this.fields[key].setValue(torrent[key]); -489 } -490 } -491 } -492 }); -493 Deluge.Details.add(new Ext.deluge.details.OptionsTab()); -494 \ No newline at end of file +410 onRequestComplete: function(torrent, options) { +411 this.fields['private'].setDisabled(!torrent['private']); +412 delete torrent['private']; +413 +414 this.optionsManager.updateOptions(this.torrentId, torrent); +415 } +416 }); +417 Deluge.Details.add(new Ext.deluge.details.OptionsTab()); +418 \ No newline at end of file diff --git a/deluge/ui/web/docs/symbols/src/Deluge.Menus.js.html b/deluge/ui/web/docs/symbols/src/Deluge.Menus.js.html index 645d98f51..5677002e5 100644 --- a/deluge/ui/web/docs/symbols/src/Deluge.Menus.js.html +++ b/deluge/ui/web/docs/symbols/src/Deluge.Menus.js.html @@ -246,12 +246,12 @@ 239 icon: '/icons/recheck.png', 240 handler: Deluge.Menus.onTorrentAction, 241 scope: Deluge.Menus -242 }, { -243 id: 'move', -244 text: _('Move Storage'), -245 icon: '/icons/move.png', -246 handler: Deluge.Menus.onTorrentAction, -247 scope: Deluge.Menus +242 /*}, { +243 id: 'move', +244 text: _('Move Storage'), +245 icon: '/icons/move.png', +246 handler: Deluge.Menus.onTorrentAction, +247 scope: Deluge.Menus*/ 248 }] 249 }); 250 diff --git a/deluge/ui/web/docs/symbols/src/Deluge.OptionsManager.js.html b/deluge/ui/web/docs/symbols/src/Deluge.OptionsManager.js.html index 5362f5037..c2a70e01d 100644 --- a/deluge/ui/web/docs/symbols/src/Deluge.OptionsManager.js.html +++ b/deluge/ui/web/docs/symbols/src/Deluge.OptionsManager.js.html @@ -46,143 +46,200 @@ 39 Deluge.OptionsManager = Ext.extend(Ext.util.Observable, { 40 41 constructor: function(config) { - 42 this.changed = {}; - 43 this.options = {}; - 44 Deluge.OptionsManager.superclass.constructor.call(this); - 45 - 46 this.addEvents({ - 47 'add': true, - 48 'changed': true, - 49 'reset': true - 50 }); - 51 }, - 52 - 53 /** - 54 * Add a set of default options and values for an id to the options manager - 55 * @param {String} id - 56 * @param {Object} options The default options for the id. - 57 */ - 58 addOptions: function(id, options) { - 59 this.options[id] = options; - 60 }, - 61 - 62 /** - 63 * Returns the changed values for a specified id. - 64 * @param {String} id - 65 * @returns {Object} the changed options - 66 */ - 67 getChanged: function(id) { - 68 return (this.changed[id]) ? this.changed[id] : {}; - 69 }, - 70 - 71 /** - 72 * Get the default value for an option given an id and option name - 73 * @param {String} id - 74 * @param {String} option - 75 * @returns {Object} the value of the option - 76 */ - 77 getDefault: function(id, option) { - 78 return this.options[id][option]; - 79 }, - 80 - 81 /** - 82 * Get the value for an option given an id and option name. - 83 * @param {String} id - 84 * @param {String} option - 85 * @returns {Object} the options value. - 86 */ - 87 getValue: function(id, option) { - 88 return (this.hasChanged(id, option)) ? this.changed[id][option] : this.options[id][option]; - 89 }, - 90 - 91 /** - 92 * Check to see if the option has been changed. - 93 * @param {String} id - 94 * @param {String} option - 95 * @returns {Boolean} true if the option has been changed, else false. - 96 */ - 97 hasChanged: function(id, option) { - 98 return (this.changed[id] && !Ext.isEmpty(this.changed[id][option])); - 99 }, -100 -101 /** -102 * Reset the options back to the default values for the specified id. -103 * @param {String} id -104 */ -105 resetOptions: function(id) { -106 if (!this.changed[id]) return; -107 delete this.changed[id]; -108 }, -109 -110 /** -111 * Set the specified option for the passed in id. -112 * @param {String} id -113 * @param {String} option -114 * @param {Object} value The new value for the option -115 */ -116 setOption: function(id, option, value) { -117 if (!this.changed[id]) this.changed[id] = {}; -118 -119 var oldValue = this.getValue(id, option); -120 if (this.options[id][option] == value) { -121 if (!Ext.isEmpty(this.changed[id][option])) delete this.changed[id][option]; -122 this.fireEvent('changed', id, option, value, oldValue); -123 return; -124 } -125 -126 if (Ext.type(this.options[id][option]) != Ext.type(value)) { -127 switch (Ext.type(this.options[id][option])) { -128 case 'string': -129 value = String(value); -130 break; -131 case 'number': -132 value = Number(value); -133 break; -134 case 'boolean': -135 value = Boolean(value); -136 break; -137 } -138 } -139 -140 this.changed[id][option] = value; -141 this.fireEvent('changed', id, option, value, oldValue); -142 }, -143 -144 /** -145 * Set the specified options for the passed in id. -146 * @param {String} id -147 * @param {Object} options The option values to change. -148 */ -149 setOptions: function(id, options) { -150 if (!this.changed[id]) this.changed[id] = {}; -151 for (var key in options) { -152 this.setOption(id, key, options[key]); -153 } -154 }, -155 -156 /** -157 * Update the default value for the specified option and id. -158 * @param {String} id -159 * @param {String} option -160 * @param {Object} value; -161 */ -162 updateOption: function(id, option, value) { -163 this.options[id][option] = value; -164 }, -165 -166 /** -167 * Update the defaults for the specified id. -168 * @param {String} id -169 * @param {Object} options The option defaults to change. -170 */ -171 updateOptions: function(id, options) { -172 if (!this.options[id]) { -173 this.addOptions(id, options); -174 } else { -175 for (var key in options) { -176 this.updateOption(id, key, options[key]); -177 } -178 } -179 } -180 }); -181 \ No newline at end of file + 42 this.binds = {}; + 43 this.changed = {}; + 44 this.defaults = config['defaults'] || {}; + 45 this.options = {}; + 46 + 47 + 48 this.addEvents({ + 49 'add': true, + 50 'changed': true, + 51 'reset': true + 52 }); + 53 this.on('changed', this.onChange, this); + 54 + 55 Deluge.OptionsManager.superclass.constructor.call(this); + 56 }, + 57 + 58 /** + 59 * Add a set of default options and values to the options manager + 60 * @param {String} id + 61 * @param {Object} options The default options. + 62 */ + 63 addOptions: function(id, options) { + 64 this.options[id] = options; + 65 }, + 66 + 67 /** + 68 * Binds a form field to the specified option. + 69 * @param {String} option + 70 * @param {Ext.form.Field} field + 71 */ + 72 bind: function(option, field) { + 73 this.binds[option] = field; + 74 this.binds[field] = option; + 75 + 76 switch (field.getXType()) { + 77 case 'checkbox': + 78 field.on('check', this.onFieldChange, this); + 79 break; + 80 case 'uxspinner': + 81 field.on('spin', this.onFieldChange, this); + 82 field.on('keypress', this.onFieldChange, this); + 83 break; + 84 default: + 85 break; + 86 } + 87 }, + 88 + 89 /** + 90 * Returns the changed values for a specified id. + 91 * @param {String} id + 92 * @returns {Object} the changed options + 93 */ + 94 getChanged: function(id) { + 95 return (this.changed[id]) ? this.changed[id] : {}; + 96 }, + 97 + 98 /** + 99 * Get the default value for an option given an id and option name. +100 * @param {String} id +101 * @param {String} option +102 * @returns {Object} the value of the option +103 */ +104 getOption: function(id, option) { +105 return (this.hasOption(id, option)) ? this.options[id][option] : this.defaults[option]; +106 }, +107 +108 /** +109 * Get the value for an option given an id and option name. +110 * @param {String} id +111 * @param {String} option +112 * @returns {Object} the options value. +113 */ +114 getValue: function(id, option) { +115 return (this.hasChanged(id, option)) ? this.changed[id][option] : this.getOption(id, option); +116 }, +117 +118 /** +119 * Check to see if the option has been changed. +120 * @param {String} id +121 * @param {String} option +122 * @returns {Boolean} true if the option has been changed, else false. +123 */ +124 hasChanged: function(id, option) { +125 return (this.changed[id] && !Ext.isEmpty(this.changed[id][option])); +126 }, +127 +128 /** +129 * Check to see if an id has had an option set to something other than the +130 * default value. +131 * @param {String} id +132 * @param {String} option +133 * @returns {Boolean} true if the id has an option, else false. +134 */ +135 hasOption: function(id, option) { +136 return (this.options[id] && !Ext.isEmpty(this.options[id][option])); +137 }, +138 +139 /** +140 * Reset the options back to the default values for the specified id. +141 * @param {String} id +142 */ +143 resetOptions: function(id) { +144 if (!this.changed[id]) return; +145 delete this.changed[id]; +146 }, +147 +148 /** +149 * Set the specified option for the passed in id. +150 * @param {String} id +151 * @param {String} option +152 * @param {Object} value The value for the option +153 */ +154 setOption: function(id, option, value) { +155 this.options[id][option] = value; +156 }, +157 +158 /** +159 * Set the specified options for the passed in id. +160 * @param {String} id +161 * @param {Object} options The option values to change. +162 */ +163 setOptions: function(id, options) { +164 if (!this.changed[id]) this.changed[id] = {}; +165 for (var key in options) { +166 this.setOption(id, key, options[key]); +167 } +168 }, +169 +170 /** +171 * Update the value for the specified option and id. +172 * @param {String} id +173 * @param {String} option +174 * @param {Object} value; +175 */ +176 updateOption: function(id, option, value) { +177 if (!this.changed[id]) this.changed[id] = {}; +178 +179 var oldValue = this.getValue(id, option); +180 if (oldValue == value) return; +181 +182 var defaultValue = this.getOption(id, option); +183 if (defaultValue == value) { +184 if (!Ext.isEmpty(this.changed[id][option])) delete this.changed[id][option]; +185 this.fireEvent('changed', id, option, value, oldValue); +186 return; +187 } +188 +189 if (Ext.type(defaultValue) != Ext.type(value)) { +190 switch (Ext.type(defaultValue)) { +191 case 'string': +192 value = String(value); +193 break; +194 case 'number': +195 value = Number(value); +196 break; +197 case 'boolean': +198 value = Boolean(value); +199 break; +200 } +201 } +202 +203 this.changed[id][option] = value; +204 this.fireEvent('changed', id, option, value, oldValue); +205 }, +206 +207 /** +208 * Update the options for the specified id. +209 * @param {String} id +210 * @param {Object} options The options to change. +211 */ +212 updateOptions: function(id, options) { +213 for (var key in options) { +214 this.updateOption(id, key, options[key]); +215 } +216 }, +217 +218 /* Event Handlers */ +219 +220 /** +221 * Stops a form fields value from being blocked by the change functions +222 * @param {Ext.form.Field} field +223 * @private +224 */ +225 onFieldChange: function(field) { +226 var option = this.binds[field]; +227 //alert(option); +228 }, +229 +230 onChange: function(id, option, newValue, oldValue) { +231 // If we don't have a bind there's nothing to do. +232 if (Ext.isEmpty(this.binds[option])) return; +233 +234 // Set the form field to the new value. +235 this.binds[option].setValue(newValue); +236 } +237 }); +238 \ No newline at end of file diff --git a/deluge/ui/web/docs/symbols/src/ext-extensions-debug.js.html b/deluge/ui/web/docs/symbols/src/ext-extensions-debug.js.html index b7e927e31..104591783 100644 --- a/deluge/ui/web/docs/symbols/src/ext-extensions-debug.js.html +++ b/deluge/ui/web/docs/symbols/src/ext-extensions-debug.js.html @@ -407,7 +407,7 @@ 400 if(!this.allowDecimals || this.decimalPrecision == -1 || nan || !value){ 401 return nan ? '' : value; 402 } -403 return parseFloat(parseFloat(value).toFixed(this.decimalPrecision)); +403 return value.toFixed(this.decimalPrecision); 404 } 405 }); 406