Author: damoxc

Revision: 5580

Log:
        convert the daemon preferences page into a class

Diff:
Modified: trunk/deluge/ui/web/js/Deluge.Preferences.Daemon.js
===================================================================
--- trunk/deluge/ui/web/js/Deluge.Preferences.Daemon.js 2009-07-30 21:41:51 UTC 
(rev 5579)
+++ trunk/deluge/ui/web/js/Deluge.Preferences.Daemon.js 2009-07-30 21:42:04 UTC 
(rev 5580)
@@ -1,44 +1,61 @@
-Deluge.Preferences.addPage({
-       border: false,
-       title: _('Daemon'),
-       xtype: 'form',
-       layout: 'form',
-       items: [{
-               xtype: 'fieldset',
-               border: false,
-               title: _('Port'),
-               autoHeight: true,
-               defaultType: 'uxspinner',
-               items: [{
+Ext.namespace('Ext.deluge.preferences');
+Ext.deluge.preferences.Daemon = Ext.extend(Ext.form.FormPanel, {
+       constructor: function(config) {
+               config = Ext.apply({
+                       border: false,
+                       title: _('Daemon'),
+                       layout: 'form'
+               }, config);
+               Ext.deluge.preferences.Daemon.superclass.constructor.call(this, 
config);
+       },
+       
+       initComponent: function() {
+               
Ext.deluge.preferences.Daemon.superclass.initComponent.call(this);
+
+               var optMan = Deluge.Preferences.getOptionsManager();
+               
+               var fieldset = this.add({
+                       xtype: 'fieldset',
+                       border: false,
+                       title: _('Port'),
+                       autoHeight: true,
+                       defaultType: 'uxspinner'
+               });
+               optMan.bind('daemon_port', fieldset.add({
                        fieldLabel: _('Daemon port'),
-                       id: 'daemon_port'
-               }]
-       }, {
-               xtype: 'fieldset',
-               border: false,
-               title: _('Connections'),
-               autoHeight: true,
-               labelWidth: 1,
-               defaultType: 'checkbox',
-               items: [{
+                       name: 'daemon_port'
+               }));
+               
+               fieldset = this.add({
+                       xtype: 'fieldset',
+                       border: false,
+                       title: _('Connections'),
+                       autoHeight: true,
+                       labelWidth: 1,
+                       defaultType: 'checkbox'
+               });
+               optMan.bind('allow_remote', fieldset.add({
                        fieldLabel: '',
                        labelSeparator: '',
                        boxLabel: _('Allow Remote Connections'),
-                       id: 'allow_remote'
-               }]
-       }, {
-               xtype: 'fieldset',
-               border: false,
-               title: _('Other'),
-               autoHeight: true,
-               labelWidth: 1,
-               defaultType: 'checkbox',
-               items: [{
+                       name: 'allow_remote'
+               }));
+               
+               fieldset = this.add({
+                       xtype: 'fieldset',
+                       border: false,
+                       title: _('Other'),
+                       autoHeight: true,
+                       labelWidth: 1,
+                       defaultType: 'checkbox'
+               });
+               optMan.bind('new_release_check', fieldset.add({
                        fieldLabel: '',
                        labelSeparator: '',
                        height: 40,
                        boxLabel: _('Periodically check the website for new 
releases'),
-                       id: 'new_releases'
-               }]
-       }]
-});
\ No newline at end of file
+                       id: 'new_release_check'
+               }));
+       }
+});
+Deluge.Preferences.addPage(new Ext.deluge.preferences.Daemon());
\ No newline at end of file



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to