partially working preferences window (ui wise)

This commit is contained in:
Damien Churchill 2009-04-14 20:36:13 +00:00
parent 2e4762a586
commit 7fb5e546e8

View File

@ -25,7 +25,7 @@ Copyright:
PreferencesWindow = function(config) { PreferencesWindow = function(config) {
Ext.apply(this, config); Ext.apply(this, config);
this.layout = 'border'; this.layout = 'border';
this.width = 450; this.width = 475;
this.height = 450; this.height = 450;
this.buttonAlign = 'right'; this.buttonAlign = 'right';
this.closeAction = 'hide'; this.closeAction = 'hide';
@ -68,6 +68,7 @@ Copyright:
region: 'center', region: 'center',
title: ' ', title: ' ',
layout: 'fit', layout: 'fit',
height: 400,
margins: '5 5 5 5', margins: '5 5 5 5',
cmargins: '5 5 5 5' cmargins: '5 5 5 5'
}]; }];
@ -91,9 +92,8 @@ Copyright:
var store = this.categoriesGrid.getStore(); var store = this.categoriesGrid.getStore();
store.loadData([[name]], true); store.loadData([[name]], true);
page['bodyStyle'] = 'margin: 5px'; page['bodyStyle'] = 'margin: 5px';
page['hidden'] = true;
this.pages[name] = this.configPanel.add(page); this.pages[name] = this.configPanel.add(page);
this.doLayout(); this.pages[name].hide();
}, },
onPageSelect: function(selModel, rowIndex, r) { onPageSelect: function(selModel, rowIndex, r) {
@ -105,6 +105,7 @@ Copyright:
this.pages[name].show(); this.pages[name].show();
this.configPanel.setTitle(name); this.configPanel.setTitle(name);
this.currentPage = this.pages[name]; this.currentPage = this.pages[name];
this.configPanel.doLayout();
}, },
onShow: function() { onShow: function() {
@ -115,68 +116,194 @@ Copyright:
}); });
Deluge.Preferences = new PreferencesWindow(); Deluge.Preferences = new PreferencesWindow();
})(); Deluge.Preferences.addPage(_('Downloads'), {
Deluge.Preferences.addPage(_('Downloads'), {
border: false,
html: 'downloads'
});
Deluge.Preferences.addPage(_('Network'), {
border: false,
html: 'network'
});
Deluge.Preferences.addPage(_('Bandwidth'), {
border: false,
html: 'bandwidth'
});
Deluge.Preferences.addPage(_('Interface'), {
border: false,
xtype: 'form',
items: [{
xtype: 'fieldset',
border: false, border: false,
title: _('Window'), xtype: 'form',
labelWidth: 10, layout: 'form',
items: [{ items: [{
xtype: 'checkbox', xtype: 'fieldset',
fieldLabel: '', border: false,
labelSeparator: '', title: _('Folders'),
boxLabel: _('Show session speed in titlebar'), labelWidth: 140,
id: 'show_session_speed' defaultType: 'textfield',
autoHeight: true,
items: [{
name: 'download_location',
fieldLabel: _('Download to'),
width: 125
}, {
name: 'move_completed',
fieldLabel: _('Move completed to'),
width: 125
}, {
name: 'copy_torrent_files',
fieldLabel: _('Copy of .torrent files to'),
width: 125
}]
}, {
xtype: 'fieldset',
border: false,
title: _('Allocation'),
autoHeight: true,
labelWidth: 1,
defaultType: 'radio',
items: [{
name: 'compact_allocation',
labelSeparator: '',
boxLabel: _('Compact')
}, {
name: 'compact_allocation',
labelSeparator: '',
boxLabel: _('Full')
}]
}, {
xtype: 'fieldset',
border: false,
title: _('Options'),
autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox',
items: [{
name: 'prioritize_first_last',
labelSeparator: '',
boxLabel: _('Prioritize first and last pieces of torrent')
}, {
name: 'add_paused',
labelSeparator: '',
boxLabel: _('Add torrents in Paused state')
}]
}] }]
}, { });
xtype: 'fieldset', /*Deluge.Preferences.addPage(_('Network'), {
border: false, border: false,
title: _('Sidebar'), xtype: 'form',
layout: 'form',
items: []
});
Deluge.Preferences.addPage(_('Bandwidth'), {
border: false,
xtype: 'form',
layout: 'form',
items: []
});*/
Deluge.Preferences.addPage(_('Interface'), {
border: false,
xtype: 'form',
layout: 'form',
items: [{ items: [{
xtype: 'checkbox', xtype: 'fieldset',
fieldLabel: '', border: false,
labelSeparator: '', title: _('Window'),
boxLabel: _('Hide filters with 0 torrents'), autoHeight: true,
id: 'hide_sidebar_zero' labelWidth: 1,
items: [{
xtype: 'checkbox',
fieldLabel: '',
labelSeparator: '',
boxLabel: _('Show session speed in titlebar'),
id: 'show_session_speed'
}]
}, {
xtype: 'fieldset',
border: false,
title: _('Sidebar'),
autoHeight: true,
labelWidth: 1,
items: [{
xtype: 'checkbox',
fieldLabel: '',
labelSeparator: '',
boxLabel: _('Hide filters with 0 torrents'),
id: 'hide_sidebar_zero'
}]
}, {
xtype: 'fieldset',
border: false,
title: _('Password'),
autoHeight: true,
defaultType: 'textfield',
items: [{
fieldLabel: 'New Password',
inputType: 'password',
id: 'new_password'
}, {
inputType: 'password',
fieldLabel: 'Confirm Password',
id: 'confirm_password'
}]
}] }]
}] });
}); /*Deluge.Preferences.addPage(_('Other'), {
Deluge.Preferences.addPage(_('Other'), { border: false,
border: false, xtype: 'form',
html: 'other' layout: 'form',
}); items: []
Deluge.Preferences.addPage(_('Daemon'), { });*/
border: false, Deluge.Preferences.addPage(_('Daemon'), {
html: 'daemon' border: false,
}); xtype: 'form',
Deluge.Preferences.addPage(_('Queue'), { layout: 'form',
border: false, items: [{
html: 'queue' xtype: 'fieldset',
}); border: false,
Deluge.Preferences.addPage(_('Proxy'), { title: _('Port'),
border: false, autoHeight: true,
html: 'proxy' defaultType: 'uxspinner',
}); items: [{
Deluge.Preferences.addPage(_('Notification'), { fieldLabel: _('Daemon port'),
border: false, id: 'daemon_port'
html: 'notification' }]
}); }, {
Deluge.Preferences.addPage(_('Plugins'), { xtype: 'fieldset',
border: false, border: false,
html: 'plugins' title: _('Connections'),
}); autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox',
items: [{
fieldLabel: '',
labelSeparator: '',
boxLabel: _('Allow Remote Connections'),
id: 'allow_remote'
}]
}, {
xtype: 'fieldset',
border: false,
title: _('Other'),
autoHeight: true,
labelWidth: 1,
defaultType: 'checkbox',
items: [{
fieldLabel: '',
labelSeparator: '',
height: 40,
boxLabel: _('Periodically check the website for new releases'),
id: 'new_releases'
}]
}]
});
/*Deluge.Preferences.addPage(_('Queue'), {
border: false,
xtype: 'form',
layout: 'form',
items: []
});
Deluge.Preferences.addPage(_('Proxy'), {
border: false,
xtype: 'form',
layout: 'form',
items: []
});
Deluge.Preferences.addPage(_('Notification'), {
border: false,
xtype: 'form',
layout: 'form',
items: []
});
Deluge.Preferences.addPage(_('Plugins'), {
border: false,
xtype: 'form',
layout: 'form',
items: []
});*/
})();