begin connection manager

This commit is contained in:
Damien Churchill 2009-02-13 08:25:55 +00:00
parent 356af2ba0a
commit 847ad95fd3
5 changed files with 57 additions and 1 deletions

View File

@ -18,6 +18,7 @@
<script type="text/javascript" src="/js/deluge-login.js"></script>
<script type="text/javascript" src="/js/deluge-menus.js"></script>
<script type="text/javascript" src="/js/deluge-bars.js"></script>
<script type="text/javascript" src="/js/deluge-connections.js"></script>
<script type="text/javascript" src="/js/deluge-torrents.js"></script>
<script type="text/javascript" src="/js/deluge-details.js"></script>
<script type="text/javascript" src="/js/deluge-ui.js"></script>

View File

@ -108,6 +108,9 @@ function torrentAction(item) {
}
});
break;
case "connectionman":
Deluge.Connections.Window.show();
break;
}
}

View File

@ -0,0 +1,50 @@
Deluge.Connections = {
onClose: function(e) {
},
onConnect: function(e) {
}
}
Deluge.Connections.Store = new Ext.data.SimpleStore({
fields: [
{name: 'status'},
{name: 'host'},
{name: 'version'}
]
});
Deluge.Connections.Grid = new Ext.grid.GridPanel({
store: Deluge.Connections.Store,
cls: 'deluge-torrents',
columns: [
{header: "Status", width: 55, sortable: true, renderer: Deluge.Formatters.plain, dataIndex: 'status'},
{id:'host', header: "Host", width: 150, sortable: true, renderer: Deluge.Formatters.plain, dataIndex: 'host'},
{header: "Version", width: 75, sortable: true, renderer: Deluge.Formatters.plain, dataIndex: 'version'}
],
stripeRows: true,
autoExpandColumn: 'host',
deferredRender:false,
autoScroll:true,
margins: '0 0 0 0'
});
Deluge.Connections.Window = new Ext.Window({
layout: 'fit',
width: 300,
height: 200,
bodyStyle: 'padding: 10px 5px;',
buttonAlign: 'right',
closeAction: 'hide',
closable: true,
plain: true,
title: _('Connection Manager'),
items: [Deluge.Connections.Grid],
buttons: [{
text: _('Close'),
handler: Deluge.Connections.onClose
},{
text: _('Connect'),
handler: Deluge.Connections.onConnect
}]
});

View File

@ -5,6 +5,7 @@ Deluge.Login = {
onSuccess: function(result) {
if (result == true) {
Deluge.Login.Window.hide();
Deluge.Connections.Window.show();
} else {
Ext.MessageBox.show({
title: _('Login Failed'),
@ -56,7 +57,7 @@ Deluge.Login.Window = new Ext.Window({
title: _('Login'),
items: Deluge.Login.Form,
buttons: [{
text: 'Login',
text: _('Login'),
handler: Deluge.Login.onLogin
}]
});

View File

@ -76,6 +76,7 @@ CONFIG_DEFAULTS = {
"pwd_salt": "2\xe8\xc7\xa6(n\x81_\x8f\xfc\xdf\x8b\xd1\x1e\xd5\x90",
"pwd_md5": ".\xe8w\\+\xec\xdb\xf2id4F\xdb\rUc",
"cache_templates": True,
"connections": [],
"daemon": "http://localhost:58846",
"base": "",
"disallow": {},