Author: damoxc

Revision: 5045

Log:
        implement page switching

Diff:
Modified: trunk/deluge/ui/web/js/deluge-preferences.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-preferences.js        2009-04-08 20:24:50 UTC 
(rev 5044)
+++ trunk/deluge/ui/web/js/deluge-preferences.js        2009-04-08 20:28:39 UTC 
(rev 5045)
@@ -64,7 +64,8 @@
                        collapsible: true
                }, {
                        region: 'center',
-                       title: 'Test',
+                       title: ' ',
+                       layout: 'fit',
                        margins: '5 5 5 5',
                        cmargins: '5 5 5 5'
                }];
@@ -76,37 +77,69 @@
                        PreferencesWindow.superclass.initComponent.call(this);
                        this.categoriesGrid = this.items.get(0);
                        this.configPanel = this.items.get(1);
+                       this.pages = {};
                        this.on('show', this.onShow.bindWithEvent(this));
                },
                
                addPage: function(name, page) {
                        var store = this.categoriesGrid.getStore();
                        store.loadData([[name]], true);
+                       this.pages[name] = page;
                },
                
                onPageSelect: function(selModel, rowIndex, r) {
+                       this.configPanel.removeAll();
                        this.currentPage = rowIndex;
-                       this.configPanel.setTitle(r.get('name'));
+                       var name = r.get('name');
+                       this.configPanel.setTitle(name);
+                       this.pages[name] = 
this.configPanel.add(this.pages[name]);
+                       this.doLayout();
                },
                
                onShow: function() {
-                       if 
(!this.categoriesGrid.getSelectionModel().hasSelection()) {
-                               
this.categoriesGrid.getSelectionModel().selectFirstRow();
-                       }
+
                }
        });
        
        Deluge.Preferences = new PreferencesWindow();
 })();
 Deluge.Preferences.addPage(_('Downloads'), {
-       
+       border: false,
+       html: 'downloads'
 });
-Deluge.Preferences.addPage(_('Network'), {});
-Deluge.Preferences.addPage(_('Bandwidth'), {});
-Deluge.Preferences.addPage(_('Interface'), {});
-Deluge.Preferences.addPage(_('Other'), {});
-Deluge.Preferences.addPage(_('Daemon'), {});
-Deluge.Preferences.addPage(_('Queue'), {});
-Deluge.Preferences.addPage(_('Proxy'), {});
-Deluge.Preferences.addPage(_('Notification'), {});
-Deluge.Preferences.addPage(_('Plugins'), {});
\ No newline at end of file
+Deluge.Preferences.addPage(_('Network'), {
+       border: false,
+       html: 'network'
+});
+Deluge.Preferences.addPage(_('Bandwidth'), {
+       border: false,
+       html: 'bandwidth'
+});
+Deluge.Preferences.addPage(_('Interface'), {
+       border: false,
+       html: 'interface'
+});
+Deluge.Preferences.addPage(_('Other'), {
+       border: false,
+       html: 'other'
+});
+Deluge.Preferences.addPage(_('Daemon'), {
+       border: false,
+       html: 'daemon'
+});
+Deluge.Preferences.addPage(_('Queue'), {
+       border: false,
+       html: 'queue'
+});
+Deluge.Preferences.addPage(_('Proxy'), {
+       border: false,
+       html: 'proxy'
+});
+Deluge.Preferences.addPage(_('Notification'), {
+       border: false,
+       html: 'notification'
+});
+Deluge.Preferences.addPage(_('Plugins'), {
+       border: false,
+       html: 'plugins'
+});
\ 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