fix page switching

This commit is contained in:
Damien Churchill 2009-04-08 21:25:46 +00:00
commit c28574502c

View file

@ -90,16 +90,21 @@ Copyright:
addPage: function(name, page) { addPage: function(name, page) {
var store = this.categoriesGrid.getStore(); var store = this.categoriesGrid.getStore();
store.loadData([[name]], true); store.loadData([[name]], true);
this.pages[name] = page; page['bodyStyle'] = 'margin: 5px';
page['hidden'] = true;
this.pages[name] = this.configPanel.add(page);
this.doLayout();
}, },
onPageSelect: function(selModel, rowIndex, r) { onPageSelect: function(selModel, rowIndex, r) {
this.configPanel.removeAll(); if (this.currentPage) {
this.currentPage = rowIndex; this.currentPage.hide();
}
var name = r.get('name'); var name = r.get('name');
this.pages[name].show();
this.configPanel.setTitle(name); this.configPanel.setTitle(name);
this.pages[name] = this.configPanel.add(this.pages[name]); this.currentPage = this.pages[name];
this.doLayout();
}, },
onShow: function() { onShow: function() {
@ -125,7 +130,31 @@ Deluge.Preferences.addPage(_('Bandwidth'), {
}); });
Deluge.Preferences.addPage(_('Interface'), { Deluge.Preferences.addPage(_('Interface'), {
border: false, border: false,
html: 'interface' xtype: 'form',
items: [{
xtype: 'fieldset',
border: false,
title: _('Window'),
labelWidth: 10,
items: [{
xtype: 'checkbox',
fieldLabel: '',
labelSeparator: '',
boxLabel: _('Show session speed in titlebar'),
id: 'show_session_speed'
}]
}, {
xtype: 'fieldset',
border: false,
title: _('Sidebar'),
items: [{
xtype: 'checkbox',
fieldLabel: '',
labelSeparator: '',
boxLabel: _('Hide filters with 0 torrents'),
id: 'hide_sidebar_zero'
}]
}]
}); });
Deluge.Preferences.addPage(_('Other'), { Deluge.Preferences.addPage(_('Other'), {
border: false, border: false,