mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 06:58:42 +00:00
webui: first commit where the interface loads
At this point the interface loads, but it is misshapen and needs a lot more work to get it fully extjs 4.0 compatible.
This commit is contained in:
parent
6cdf9940d3
commit
5b45670a85
46 changed files with 851 additions and 873 deletions
|
@ -19,7 +19,7 @@
|
|||
author: 'Damien Churchill <damoxc@gmail.com>',
|
||||
version: '${version}',
|
||||
config: ${js_config}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<!-- Javascript -->
|
||||
|
@ -31,7 +31,7 @@
|
|||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="background-image: url('${base}themes/images/default/tree/loading.gif');"></div>
|
||||
<div style="background-image: url('${base}resources/themes/images/default/tree/loading.gif');"></div>
|
||||
|
||||
<!-- Preload icon classes -->
|
||||
<div class="ext-mb-error"></div>
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
+ OptionsManager.js
|
||||
+ StatusbarMenu.js
|
||||
+ Formatters.js
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.AddConnectionWindow.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,13 +29,13 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.ns('Deluge');
|
||||
|
||||
/**
|
||||
* @class Deluge.AddConnectionWindow
|
||||
* @extends Ext.Window
|
||||
*/
|
||||
Deluge.AddConnectionWindow = Ext.extend(Ext.Window, {
|
||||
Ext.define('Deluge.AddConnectionWindow', {
|
||||
extend: 'Ext.Window',
|
||||
|
||||
title: _('Add Connection'),
|
||||
iconCls: 'x-deluge-add-window-icon',
|
||||
|
@ -48,7 +48,7 @@ Deluge.AddConnectionWindow = Ext.extend(Ext.Window, {
|
|||
closeAction: 'hide',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.AddConnectionWindow.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
this.addEvents('hostadded');
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.AddTrackerWindow.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,13 +29,13 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.ns('Deluge');
|
||||
|
||||
/**
|
||||
* @class Deluge.AddTrackerWindow
|
||||
* @extends Ext.Window
|
||||
*/
|
||||
Deluge.AddTrackerWindow = Ext.extend(Ext.Window, {
|
||||
Ext.define('Deluge.AddTrackerWindow', {
|
||||
extend: 'Ext.Window',
|
||||
|
||||
title: _('Add Tracker'),
|
||||
layout: 'fit',
|
||||
|
@ -51,10 +51,10 @@ Deluge.AddTrackerWindow = Ext.extend(Ext.Window, {
|
|||
iconCls: 'x-deluge-edit-trackers',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.AddTrackerWindow.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
this.addButton(_('Cancel'), this.onCancelClick, this);
|
||||
this.addButton(_('Add'), this.onAddClick, this);
|
||||
//this.addButton(_('Cancel'), this.onCancelClick, this);
|
||||
//this.addButton(_('Add'), this.onAddClick, this);
|
||||
this.addEvents('add');
|
||||
|
||||
this.form = this.add({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.Client.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,7 +29,6 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Ext.ux.util');
|
||||
|
||||
/**
|
||||
* A class that connects to a json-rpc resource and adds the available
|
||||
|
@ -37,7 +36,8 @@ Ext.namespace('Ext.ux.util');
|
|||
* @class Ext.ux.util.RpcClient
|
||||
* @namespace Ext.ux.util
|
||||
*/
|
||||
Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
|
||||
Ext.define('Ext.ux.util.RpcClient', {
|
||||
extend: 'Ext.util.Observable',
|
||||
|
||||
_components: [],
|
||||
|
||||
|
@ -159,7 +159,7 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, {
|
|||
});
|
||||
|
||||
if (isOption) {
|
||||
params.remove(options)
|
||||
params.pop(-1)
|
||||
} else {
|
||||
options = {}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.ConnectionManager.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -30,7 +30,8 @@
|
|||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
|
||||
Deluge.ConnectionManager = Ext.extend(Ext.Window, {
|
||||
Ext.define('Deluge.ConnectionManager', {
|
||||
extend: 'Ext.Window',
|
||||
|
||||
layout: 'fit',
|
||||
width: 300,
|
||||
|
@ -44,15 +45,15 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
|
|||
iconCls: 'x-deluge-connect-window-icon',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.ConnectionManager.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
this.on('hide', this.onHide, this);
|
||||
this.on('show', this.onShow, this);
|
||||
|
||||
deluge.events.on('login', this.onLogin, this);
|
||||
deluge.events.on('logout', this.onLogout, this);
|
||||
|
||||
this.addButton(_('Close'), this.onClose, this);
|
||||
this.addButton(_('Connect'), this.onConnect, this);
|
||||
//this.addButton(_('Close'), this.onClose, this);
|
||||
//this.addButton(_('Connect'), this.onConnect, this);
|
||||
|
||||
this.list = new Ext.list.ListView({
|
||||
store: new Ext.data.ArrayStore({
|
||||
|
@ -121,7 +122,7 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
|
|||
]
|
||||
})
|
||||
});
|
||||
this.update = this.update.createDelegate(this);
|
||||
this.update = this.update.bind(this);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -337,7 +338,7 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, {
|
|||
// private
|
||||
onShow: function() {
|
||||
if (!this.addHostButton) {
|
||||
var bbar = this.panel.getBottomToolbar();
|
||||
var bbar = this.panel.getDockedItems()[0];
|
||||
this.addHostButton = bbar.items.get('cm-add');
|
||||
this.removeHostButton = bbar.items.get('cm-remove');
|
||||
this.stopHostButton = bbar.items.get('cm-stop');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.EditTrackerWindow.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,13 +29,13 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.ns('Deluge');
|
||||
|
||||
/**
|
||||
* @class Deluge.EditTrackerWindow
|
||||
* @extends Ext.Window
|
||||
*/
|
||||
Deluge.EditTrackerWindow = Ext.extend(Ext.Window, {
|
||||
Ext.define('Deluge.EditTrackerWindow', {
|
||||
extend: 'Ext.Window',
|
||||
|
||||
title: _('Edit Tracker'),
|
||||
layout: 'fit',
|
||||
|
@ -51,10 +51,10 @@ Deluge.EditTrackerWindow = Ext.extend(Ext.Window, {
|
|||
iconCls: 'x-deluge-edit-trackers',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.EditTrackerWindow.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
this.addButton(_('Cancel'), this.onCancelClick, this);
|
||||
this.addButton(_('Save'), this.onSaveClick, this);
|
||||
//this.addButton(_('Cancel'), this.onCancelClick, this);
|
||||
//this.addButton(_('Save'), this.onSaveClick, this);
|
||||
this.on('hide', this.onHide, this);
|
||||
|
||||
this.form = this.add({
|
||||
|
@ -71,7 +71,7 @@ Deluge.EditTrackerWindow = Ext.extend(Ext.Window, {
|
|||
},
|
||||
|
||||
show: function(record) {
|
||||
Deluge.EditTrackerWindow.superclass.show.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
this.record = record;
|
||||
this.form.getForm().findField('tracker').setValue(record.data['url']);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.EditTrackers.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -35,7 +35,8 @@ Ext.ns('Deluge');
|
|||
* @class Deluge.EditTrackerWindow
|
||||
* @extends Ext.Window
|
||||
*/
|
||||
Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
|
||||
Ext.define('Deluge.EditTrackersWindow', {
|
||||
extend: 'Ext.Window',
|
||||
|
||||
title: _('Edit Trackers'),
|
||||
layout: 'fit',
|
||||
|
@ -51,18 +52,17 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
|
|||
iconCls: 'x-deluge-edit-trackers',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.EditTrackersWindow.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
this.addButton(_('Cancel'), this.onCancelClick, this);
|
||||
this.addButton(_('Ok'), this.onOkClick, this);
|
||||
//this.addButton(_('Cancel'), this.onCancelClick, this);
|
||||
//this.addButton(_('Ok'), this.onOkClick, this);
|
||||
this.addEvents('save');
|
||||
|
||||
this.on('show', this.onShow, this);
|
||||
this.on('save', this.onSave, this);
|
||||
|
||||
this.addWindow = new Deluge.AddTrackerWindow();
|
||||
this.addWindow = Ext.create('Deluge.AddTrackerWindow');
|
||||
this.addWindow.on('add', this.onAddTrackers, this);
|
||||
this.editWindow = new Deluge.EditTrackerWindow();
|
||||
this.editWindow = Ext.create('Deluge.EditTrackerWindow');
|
||||
|
||||
this.list = new Ext.list.ListView({
|
||||
store: new Ext.data.JsonStore({
|
||||
|
@ -194,6 +194,10 @@ Deluge.EditTrackersWindow = Ext.extend(Ext.Window, {
|
|||
this.list.getStore().sort('tier', 'ASC');
|
||||
},
|
||||
|
||||
onSave: function() {
|
||||
// What am I meant to do here?
|
||||
},
|
||||
|
||||
onSaveFail: function() {
|
||||
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.EventsManager.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -37,10 +37,11 @@
|
|||
* Class for holding global events that occur within the UI.
|
||||
*/
|
||||
Deluge.EventsManager = Ext.extend(Ext.util.Observable, {
|
||||
|
||||
constructor: function() {
|
||||
this.toRegister = [];
|
||||
this.on('login', this.onLogin, this);
|
||||
Deluge.EventsManager.superclass.constructor.call(this);
|
||||
this.callParent(arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -55,7 +56,7 @@ Deluge.EventsManager = Ext.extend(Ext.util.Observable, {
|
|||
deluge.client.web.register_event_listener(eventName);
|
||||
}
|
||||
}
|
||||
Deluge.EventsManager.superclass.addListener.call(this, eventName, fn, scope, o);
|
||||
this.callParent(arguments);
|
||||
},
|
||||
|
||||
getEvents: function() {
|
||||
|
@ -124,4 +125,3 @@ Deluge.EventsManager.prototype.on = Deluge.EventsManager.prototype.addListener
|
|||
* @method
|
||||
*/
|
||||
Deluge.EventsManager.prototype.fire = Deluge.EventsManager.prototype.fireEvent
|
||||
deluge.events = new Deluge.EventsManager();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.LoginWindow.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -30,7 +30,9 @@
|
|||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
|
||||
Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
||||
Ext.define('Deluge.LoginWindow', {
|
||||
|
||||
extend: 'Ext.Window',
|
||||
|
||||
firstShow: true,
|
||||
bodyStyle: 'padding: 10px 5px;',
|
||||
|
@ -47,14 +49,14 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
|||
height: 120,
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.LoginWindow.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
this.on('show', this.onShow, this);
|
||||
|
||||
this.addButton({
|
||||
text: _('Login'),
|
||||
handler: this.onLogin,
|
||||
scope: this
|
||||
});
|
||||
// this.addButton({
|
||||
// text: _('Login'),
|
||||
// handler: this.onLogin,
|
||||
// scope: this
|
||||
// });
|
||||
|
||||
this.form = this.add({
|
||||
xtype: 'form',
|
||||
|
@ -92,7 +94,7 @@ Deluge.LoginWindow = Ext.extend(Ext.Window, {
|
|||
}
|
||||
|
||||
if (skipCheck) {
|
||||
return Deluge.LoginWindow.superclass.show.call(this);
|
||||
return this.callParent(arguments);
|
||||
}
|
||||
|
||||
deluge.client.auth.check_session({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.MoveStorage.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -30,11 +30,9 @@
|
|||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
|
||||
Ext.namespace('Deluge');
|
||||
Deluge.MoveStorage = Ext.extend(Ext.Window, {
|
||||
Ext.define('Deluge.MoveStorage', {
|
||||
extend: 'Ext.Window',
|
||||
|
||||
constructor: function(config) {
|
||||
config = Ext.apply({
|
||||
title: _('Move Storage'),
|
||||
width: 375,
|
||||
height: 110,
|
||||
|
@ -44,16 +42,14 @@ Deluge.MoveStorage = Ext.extend(Ext.Window, {
|
|||
closable: true,
|
||||
iconCls: 'x-deluge-move-storage',
|
||||
plain: true,
|
||||
resizable: false
|
||||
}, config);
|
||||
Deluge.MoveStorage.superclass.constructor.call(this, config);
|
||||
},
|
||||
resizable: false,
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.MoveStorage.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
this.addButton(_('Cancel'), this.onCancel, this);
|
||||
this.addButton(_('Move'), this.onMove, this);
|
||||
// FIXME: Replace the buttons
|
||||
//this.addButton(_('Cancel'), this.onCancel, this);
|
||||
//this.addButton(_('Move'), this.onMove, this);
|
||||
|
||||
this.form = this.add({
|
||||
xtype: 'form',
|
||||
|
@ -82,12 +78,12 @@ Deluge.MoveStorage = Ext.extend(Ext.Window, {
|
|||
},
|
||||
|
||||
hide: function() {
|
||||
Deluge.MoveStorage.superclass.hide.call(this);
|
||||
this.callParent(arguments);
|
||||
this.torrentIds = null;
|
||||
},
|
||||
|
||||
show: function(torrentIds) {
|
||||
Deluge.MoveStorage.superclass.show.call(this);
|
||||
this.callParent(arguments);
|
||||
this.torrentIds = torrentIds;
|
||||
},
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.Plugin.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,13 +29,13 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.ns('Deluge');
|
||||
|
||||
/**
|
||||
* @class Deluge.Plugin
|
||||
* @extends Ext.util.Observable
|
||||
*/
|
||||
Deluge.Plugin = Ext.extend(Ext.util.Observable, {
|
||||
Ext.define('Deluge.Plugin', {
|
||||
extend: 'Ext.util.Observable',
|
||||
|
||||
/**
|
||||
* The plugins name
|
||||
|
@ -59,7 +59,7 @@ Deluge.Plugin = Ext.extend(Ext.util.Observable, {
|
|||
*/
|
||||
"disabled": true
|
||||
});
|
||||
Deluge.Plugin.superclass.constructor.call(this, config);
|
||||
this.callParent(arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.RemoveWindow.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -34,7 +34,8 @@
|
|||
* @class Deluge.RemoveWindow
|
||||
* @extends Ext.Window
|
||||
*/
|
||||
Deluge.RemoveWindow = Ext.extend(Ext.Window, {
|
||||
Ext.define('Deluge.RemoveWindow', {
|
||||
extend: 'Ext.Window',
|
||||
|
||||
title: _('Remove Torrent'),
|
||||
layout: 'fit',
|
||||
|
@ -51,10 +52,11 @@ Deluge.RemoveWindow = Ext.extend(Ext.Window, {
|
|||
html: 'Are you sure you wish to remove the torrent (s)?',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.RemoveWindow.superclass.initComponent.call(this);
|
||||
this.addButton(_('Cancel'), this.onCancel, this);
|
||||
this.addButton(_('Remove With Data'), this.onRemoveData, this);
|
||||
this.addButton(_('Remove Torrent'), this.onRemove, this);
|
||||
this.callParent(arguments);
|
||||
// FIXME: Replace with docked toolbar
|
||||
//this.addButton(_('Cancel'), this.onCancel, this);
|
||||
//this.addButton(_('Remove With Data'), this.onRemoveData, this);
|
||||
//this.addButton(_('Remove Torrent'), this.onRemove, this);
|
||||
},
|
||||
|
||||
remove: function(removeData) {
|
||||
|
@ -71,7 +73,7 @@ Deluge.RemoveWindow = Ext.extend(Ext.Window, {
|
|||
},
|
||||
|
||||
show: function(ids) {
|
||||
Deluge.RemoveWindow.superclass.show.call(this);
|
||||
this.callParent(arguments);
|
||||
this.torrentIds = ids;
|
||||
},
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.Sidebar.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -39,7 +39,8 @@
|
|||
* @author Damien Churchill <damoxc@gmail.com>
|
||||
* @version 1.3
|
||||
*/
|
||||
Deluge.Sidebar = Ext.extend(Ext.Panel, {
|
||||
Ext.define('Deluge.Sidebar', {
|
||||
extend: 'Ext.Panel',
|
||||
|
||||
// private
|
||||
panels: {},
|
||||
|
@ -61,12 +62,12 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, {
|
|||
margins: '5 0 0 5',
|
||||
cmargins: '5 0 0 5'
|
||||
}, config);
|
||||
Deluge.Sidebar.superclass.constructor.call(this, config);
|
||||
this.callParent(arguments);
|
||||
},
|
||||
|
||||
// private
|
||||
initComponent: function() {
|
||||
Deluge.Sidebar.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
deluge.events.on("disconnect", this.onDisconnect, this);
|
||||
},
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.TorrentGrid.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -30,8 +30,6 @@
|
|||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
/* Renderers for the Torrent Grid */
|
||||
function queueRenderer(value) {
|
||||
return (value == -1) ? '' : value + 1;
|
||||
|
@ -90,7 +88,8 @@
|
|||
* @constructor
|
||||
* @param {Object} config Configuration options
|
||||
*/
|
||||
Deluge.TorrentGrid = Ext.extend(Ext.grid.GridPanel, {
|
||||
Ext.define('Deluge.TorrentGrid', {
|
||||
extend: 'Ext.grid.Panel',
|
||||
|
||||
// object to store contained torrent ids
|
||||
torrents: {},
|
||||
|
@ -231,11 +230,18 @@
|
|||
]
|
||||
},
|
||||
|
||||
constructor: function(config) {
|
||||
config = Ext.apply({
|
||||
store: Ext.create('Ext.data.Store', {
|
||||
model: 'Deluge.data.TorrentRecord',
|
||||
proxy: {
|
||||
type: 'memory',
|
||||
reader: {
|
||||
type: 'json',
|
||||
root: 'torrents'
|
||||
}
|
||||
}
|
||||
}),
|
||||
|
||||
id: 'torrentGrid',
|
||||
store: new Ext.data.JsonStore(this.meta),
|
||||
columns: this.columns,
|
||||
region: 'center',
|
||||
cls: 'deluge-torrents',
|
||||
stripeRows: true,
|
||||
|
@ -244,16 +250,9 @@
|
|||
autoScroll:true,
|
||||
margins: '5 5 0 0',
|
||||
stateful: true,
|
||||
view: new Ext.ux.grid.BufferView({
|
||||
rowHeight: 26,
|
||||
scrollDelay: false
|
||||
})
|
||||
}, config);
|
||||
Deluge.TorrentGrid.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.TorrentGrid.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
deluge.events.on('torrentRemoved', this.onTorrentRemoved, this);
|
||||
deluge.events.on('disconnect', this.onDisconnect, this);
|
||||
|
||||
|
@ -378,5 +377,3 @@
|
|||
}, this);
|
||||
}
|
||||
});
|
||||
deluge.torrents = new Deluge.TorrentGrid();
|
||||
})();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.UI.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -47,15 +47,18 @@ deluge.ui = {
|
|||
* and set up various events that the UI will utilise.
|
||||
*/
|
||||
initialize: function() {
|
||||
deluge.add = new Deluge.add.AddWindow();
|
||||
deluge.details = new Deluge.details.DetailsPanel();
|
||||
deluge.connectionManager = new Deluge.ConnectionManager();
|
||||
deluge.editTrackers = new Deluge.EditTrackersWindow();
|
||||
deluge.login = new Deluge.LoginWindow();
|
||||
deluge.preferences = new Deluge.preferences.PreferencesWindow();
|
||||
deluge.sidebar = new Deluge.Sidebar();
|
||||
deluge.statusbar = new Deluge.Statusbar();
|
||||
deluge.toolbar = new Deluge.Toolbar();
|
||||
|
||||
deluge.events = Ext.create('Deluge.EventsManager');
|
||||
deluge.add = Ext.create('Deluge.add.AddWindow');
|
||||
deluge.details = Ext.create('Deluge.details.DetailsPanel');
|
||||
deluge.connectionManager = Ext.create('Deluge.ConnectionManager');
|
||||
deluge.editTrackers = Ext.create('Deluge.EditTrackersWindow');
|
||||
deluge.login = Ext.create('Deluge.LoginWindow');
|
||||
deluge.preferences = Ext.create('Deluge.preferences.PreferencesWindow');
|
||||
deluge.sidebar = Ext.create('Deluge.Sidebar');
|
||||
deluge.statusbar = Ext.create('Deluge.Statusbar');
|
||||
deluge.toolbar = Ext.create('Deluge.Toolbar');
|
||||
deluge.torrents = Ext.create('Deluge.TorrentGrid');
|
||||
|
||||
this.MainPanel = new Ext.Panel({
|
||||
id: 'mainPanel',
|
||||
|
@ -98,8 +101,8 @@ deluge.ui = {
|
|||
deluge.login.show();
|
||||
}, this, {single: true});
|
||||
|
||||
this.update = this.update.createDelegate(this);
|
||||
this.checkConnection = this.checkConnection.createDelegate(this);
|
||||
this.update = Ext.bind(this.update, this);
|
||||
this.checkConnection = Ext.bind(this.checkConnection, this);
|
||||
|
||||
this.originalTitle = document.title;
|
||||
},
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.add.AddWindow.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -30,9 +30,8 @@
|
|||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
|
||||
Ext.namespace('Deluge.add');
|
||||
|
||||
Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
|
||||
Ext.define('Deluge.add.AddWindow', {
|
||||
extend: 'Deluge.add.Window',
|
||||
|
||||
title: _('Add Torrents'),
|
||||
layout: 'border',
|
||||
|
@ -46,10 +45,10 @@ Deluge.add.AddWindow = Ext.extend(Deluge.add.Window, {
|
|||
iconCls: 'x-deluge-add-window-icon',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.add.AddWindow.superclass.initComponent.call(this);
|
||||
|
||||
this.addButton(_('Cancel'), this.onCancelClick, this);
|
||||
this.addButton(_('Add'), this.onAddClick, this);
|
||||
this.callParent(arguments);
|
||||
// FIXME: replace with docked toolbar
|
||||
//this.addButton(_('Cancel'), this.onCancelClick, this);
|
||||
//this.addButton(_('Add'), this.onAddClick, this);
|
||||
|
||||
function torrentRenderer(value, p, r) {
|
||||
if (r.data['info_hash']) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.add.File.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,13 +29,13 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.ns('Deluge.add');
|
||||
|
||||
/**
|
||||
* @class Deluge.add.FileWindow
|
||||
* @extends Deluge.add.Window
|
||||
*/
|
||||
Deluge.add.FileWindow = Ext.extend(Deluge.add.Window, {
|
||||
Ext.define('Deluge.add.FileWindow', {
|
||||
extend: 'Deluge.add.Window',
|
||||
|
||||
title: _('Add from File'),
|
||||
layout: 'fit',
|
||||
|
@ -49,7 +49,7 @@ Deluge.add.FileWindow = Ext.extend(Deluge.add.Window, {
|
|||
iconCls: 'x-deluge-add-file',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.add.FileWindow.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
this.addButton(_('Add'), this.onAddClick, this);
|
||||
|
||||
this.form = this.add({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.add.FilesTab.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,13 +29,13 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.ns('Deluge.add');
|
||||
|
||||
/**
|
||||
* @class Deluge.add.FilesTab
|
||||
* @extends Ext.ux.tree.TreeGrid
|
||||
*/
|
||||
Deluge.add.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
|
||||
Ext.define('Deluge.add.FilesTab', {
|
||||
extend: 'Ext.tree.Panel',
|
||||
|
||||
layout: 'fit',
|
||||
title: _('Files'),
|
||||
|
@ -71,7 +71,7 @@ Deluge.add.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
|
|||
}],
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.add.FilesTab.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
this.on('click', this.onNodeClick, this);
|
||||
},
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.add.Infohash.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,4 +29,3 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Ext.deluge.add');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.add.OptionsPanel.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,9 +29,9 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.ns('Deluge.add');
|
||||
|
||||
Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
|
||||
Ext.define('Deluge.add.OptionsPanel', {
|
||||
extend: 'Ext.TabPanel',
|
||||
|
||||
torrents: {},
|
||||
|
||||
|
@ -42,7 +42,7 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, {
|
|||
height: 220,
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.add.OptionsPanel.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
this.files = this.add(new Deluge.add.FilesTab());
|
||||
this.form = this.add(new Deluge.add.OptionsTab());
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.add.OptionsPanel.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,13 +29,13 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.ns('Deluge.add');
|
||||
|
||||
/**
|
||||
* @class Deluge.add.OptionsTab
|
||||
* @extends Ext.form.FormPanel
|
||||
*/
|
||||
Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
||||
Ext.define('Deluge.add.OptionsTab', {
|
||||
extend: 'Ext.form.Panel',
|
||||
|
||||
title: _('Options'),
|
||||
height: 170,
|
||||
|
@ -46,7 +46,7 @@ Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
|||
labelWidth: 1,
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.add.OptionsTab.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
this.optionsManager = new Deluge.MultiOptionsManager();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.add.UrlWindow.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -30,8 +30,8 @@
|
|||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
|
||||
Ext.namespace('Deluge.add');
|
||||
Deluge.add.UrlWindow = Ext.extend(Deluge.add.Window, {
|
||||
Ext.define('Deluge.add.UrlWindow', {
|
||||
extend: 'Deluge.add.Window',
|
||||
|
||||
title: _('Add from Url'),
|
||||
modal: true,
|
||||
|
@ -46,7 +46,7 @@ Deluge.add.UrlWindow = Ext.extend(Deluge.add.Window, {
|
|||
iconCls: 'x-deluge-add-url-window-icon',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.add.UrlWindow.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
this.addButton(_('Add'), this.onAddClick, this);
|
||||
|
||||
var form = this.add({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.add.Window.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,16 +29,17 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.ns('Deluge.add');
|
||||
|
||||
/**
|
||||
* @class Deluge.add.Window
|
||||
* @extends Ext.Window
|
||||
* Base class for an add Window
|
||||
*/
|
||||
Deluge.add.Window = Ext.extend(Ext.Window, {
|
||||
Ext.define('Deluge.add.Window', {
|
||||
extend: 'Ext.Window',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.add.Window.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
this.addEvents(
|
||||
'beforeadd',
|
||||
'add'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.data.PeerRecord.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,7 +29,6 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Deluge.data');
|
||||
|
||||
/**
|
||||
* Deluge.data.Peer record
|
||||
|
@ -38,32 +37,19 @@ Ext.namespace('Deluge.data');
|
|||
* @version 1.3
|
||||
*
|
||||
* @class Deluge.data.Peer
|
||||
* @extends Ext.data.Record
|
||||
* @extends Ext.data.Model
|
||||
* @constructor
|
||||
* @param {Object} data The peer data
|
||||
*/
|
||||
Deluge.data.Peer = Ext.data.Record.create([
|
||||
{
|
||||
name: 'country',
|
||||
type: 'string'
|
||||
}, {
|
||||
name: 'ip',
|
||||
type: 'string',
|
||||
sortType: Deluge.data.SortTypes.asIPAddress
|
||||
}, {
|
||||
name: 'client',
|
||||
type: 'string'
|
||||
}, {
|
||||
name: 'progress',
|
||||
type: 'float'
|
||||
}, {
|
||||
name: 'down_speed',
|
||||
type: 'int'
|
||||
}, {
|
||||
name: 'up_speed',
|
||||
type: 'int'
|
||||
}, {
|
||||
name: 'seed',
|
||||
type: 'int'
|
||||
}
|
||||
]);
|
||||
Ext.define('Deluge.data.Peer', {
|
||||
extend: 'Ext.data.Model',
|
||||
fields: [
|
||||
{name: 'country', type: 'string'},
|
||||
{name: 'ip', type: 'string', sortType: Deluge.data.SortTypes.asIPAddress},
|
||||
{name: 'client', type: 'string'},
|
||||
{name: 'progress', type: 'float'},
|
||||
{name: 'down_speed', type: 'int'},
|
||||
{name: 'up_speed', type: 'int'},
|
||||
{name: 'seed', type: 'int'}
|
||||
]
|
||||
});
|
||||
|
|
50
deluge/ui/web/js/deluge-all/data/PluginRecord.js
Normal file
50
deluge/ui/web/js/deluge-all/data/PluginRecord.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*!
|
||||
* Deluge.data.PluginRecord.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, write to:
|
||||
* The Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* In addition, as a special exception, the copyright holders give
|
||||
* permission to link the code of portions of this program with the OpenSSL
|
||||
* library.
|
||||
* You must obey the GNU General Public License in all respects for all of
|
||||
* the code used other than OpenSSL. If you modify file(s) with this
|
||||
* exception, you may extend this exception to your version of the file(s),
|
||||
* but you are not obligated to do so. If you do not wish to do so, delete
|
||||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Deluge.data.Plugin record
|
||||
*
|
||||
* @author Damien Churchill <damoxc@gmail.com>
|
||||
* @version 1.4
|
||||
*
|
||||
* @class Deluge.data.Plugin
|
||||
* @extends Ext.data.Model
|
||||
* @constructor
|
||||
* @param {Object} data The plugin data
|
||||
*/
|
||||
Ext.define('Deluge.data.Plugin', {
|
||||
extend: 'Ext.data.Model',
|
||||
fields: [
|
||||
{name: 'enabled', type: 'boolean'},
|
||||
{name: 'plugin', type: 'string'}
|
||||
]
|
||||
});
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.data.SortTypes.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.data.TorrentRecord.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,7 +29,6 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Deluge.data');
|
||||
|
||||
/**
|
||||
* Deluge.data.Torrent record
|
||||
|
@ -38,57 +37,28 @@ Ext.namespace('Deluge.data');
|
|||
* @version 1.3
|
||||
*
|
||||
* @class Deluge.data.Torrent
|
||||
* @extends Ext.data.Record
|
||||
* @extends Ext.data.Model
|
||||
* @constructor
|
||||
* @param {Object} data The torrents data
|
||||
*/
|
||||
Deluge.data.Torrent = Ext.data.Record.create([{
|
||||
name: 'queue',
|
||||
type: 'int'
|
||||
}, {
|
||||
name: 'name',
|
||||
type: 'string'
|
||||
}, {
|
||||
name: 'total_size',
|
||||
type: 'int'
|
||||
}, {
|
||||
name: 'state',
|
||||
type: 'string'
|
||||
}, {
|
||||
name: 'progress',
|
||||
type: 'int'
|
||||
}, {
|
||||
name: 'num_seeds',
|
||||
type: 'int'
|
||||
}, {
|
||||
name: 'total_seeds',
|
||||
type: 'int'
|
||||
}, {
|
||||
name: 'num_peers',
|
||||
type: 'int'
|
||||
}, {
|
||||
name: 'total_peers',
|
||||
type: 'int'
|
||||
}, {
|
||||
name: 'download_payload_rate',
|
||||
type: 'int'
|
||||
}, {
|
||||
name: 'upload_payload_rate',
|
||||
type: 'int'
|
||||
}, {
|
||||
name: 'eta',
|
||||
type: 'int'
|
||||
}, {
|
||||
name: 'ratio',
|
||||
type: 'float'
|
||||
}, {
|
||||
name: 'distributed_copies',
|
||||
type: 'float'
|
||||
}, {
|
||||
name: 'time_added',
|
||||
type: 'int'
|
||||
}, {
|
||||
name: 'tracker_host',
|
||||
type: 'string'
|
||||
}
|
||||
]);
|
||||
Ext.define('Deluge.data.Torrent', {
|
||||
extend: 'Ext.data.Model',
|
||||
fields: [
|
||||
{name: 'queue', type: 'int', sortType: Deluge.data.SortTypes.asQueuePosition},
|
||||
{name: 'name', type: 'string'},
|
||||
{name: 'total_size', type: 'int'},
|
||||
{name: 'state', type: 'string'},
|
||||
{name: 'progress', type: 'int'},
|
||||
{name: 'num_seeds', type: 'int'},
|
||||
{name: 'total_seeds', type: 'int'},
|
||||
{name: 'num_peers', type: 'int'},
|
||||
{name: 'total_peers', type: 'int'},
|
||||
{name: 'download_payload_rate', type: 'int'},
|
||||
{name: 'upload_payload_rate', type: 'int'},
|
||||
{name: 'eta', type: 'int'},
|
||||
{name: 'ratio', type: 'float'},
|
||||
{name: 'distributed_copies', type: 'float'},
|
||||
{name: 'time_added', type: 'int'},
|
||||
{name: 'tracker_host', type: 'string'}
|
||||
]
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.details.DetailsPanel.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,12 +29,12 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Deluge.details');
|
||||
|
||||
/**
|
||||
* @class Deluge.details.DetailsPanel
|
||||
*/
|
||||
Deluge.details.DetailsPanel = Ext.extend(Ext.TabPanel, {
|
||||
Ext.define('Deluge.details.DetailsPanel', {
|
||||
extend: 'Ext.tab.Panel',
|
||||
|
||||
region: 'south',
|
||||
id: 'torrentDetails',
|
||||
|
@ -46,7 +46,7 @@ Deluge.details.DetailsPanel = Ext.extend(Ext.TabPanel, {
|
|||
activeTab: 0,
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.details.DetailsPanel.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
this.add(new Deluge.details.StatusTab());
|
||||
this.add(new Deluge.details.DetailsTab());
|
||||
this.add(new Deluge.details.FilesTab());
|
||||
|
@ -84,7 +84,7 @@ Deluge.details.DetailsPanel = Ext.extend(Ext.TabPanel, {
|
|||
// We need to add the events in onRender since Deluge.Torrents hasn't
|
||||
// been created yet.
|
||||
onRender: function(ct, position) {
|
||||
Deluge.details.DetailsPanel.superclass.onRender.call(this, ct, position);
|
||||
this.callParent(arguments);
|
||||
deluge.events.on('disconnect', this.clear, this);
|
||||
deluge.torrents.on('rowclick', this.onTorrentsClick, this);
|
||||
this.on('tabchange', this.onTabChange, this);
|
||||
|
|
|
@ -32,17 +32,16 @@ Copyright:
|
|||
|
||||
*/
|
||||
|
||||
Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
|
||||
Ext.define('Deluge.details.DetailsTab', {
|
||||
extend: 'Ext.Panel',
|
||||
|
||||
title: _('Details'),
|
||||
|
||||
fields: {},
|
||||
|
||||
queuedItems: {},
|
||||
|
||||
oldData: {},
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.details.DetailsTab.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
this.addItem('torrent_name', _('Name'));
|
||||
this.addItem('hash', _('Hash'));
|
||||
this.addItem('path', _('Path'));
|
||||
|
@ -54,7 +53,7 @@ Deluge.details.DetailsTab = Ext.extend(Ext.Panel, {
|
|||
},
|
||||
|
||||
onRender: function(ct, position) {
|
||||
Deluge.details.DetailsTab.superclass.onRender.call(this, ct, position);
|
||||
this.callParent(arguments);
|
||||
this.body.setStyle('padding', '10px');
|
||||
this.dl = Ext.DomHelper.append(this.body, {tag: 'dl'}, true);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.details.FilesTab.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -30,7 +30,18 @@
|
|||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
|
||||
Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
|
||||
Ext.define('Deluge.data.File', {
|
||||
extend: 'Ext.data.Model',
|
||||
fields: [
|
||||
{name: 'filename', type: 'string'},
|
||||
{name: 'size', type: 'int'},
|
||||
{name: 'progress', type: 'float'}
|
||||
]
|
||||
});
|
||||
|
||||
Ext.define('Deluge.details.FilesTab', {
|
||||
|
||||
extend: 'Ext.tree.Panel',
|
||||
|
||||
title: _('Files'),
|
||||
|
||||
|
@ -45,18 +56,19 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
|
|||
header: _('Size'),
|
||||
width: 150,
|
||||
dataIndex: 'size',
|
||||
tpl: new Ext.XTemplate('{size:this.fsize}', {
|
||||
tpl: Ext.create('Ext.XTemplate', '{size:this.fsize}', {
|
||||
fsize: function(v) { return fsize(v); }
|
||||
})
|
||||
}, {
|
||||
xtype: 'tgrendercolumn',
|
||||
header: _('Progress'),
|
||||
width: 150,
|
||||
dataIndex: 'progress',
|
||||
renderer: function(v) {
|
||||
tpl: Ext.create('Ext.XTemplate', '{progress:this.progress}', {
|
||||
progress: function(v) {
|
||||
var progress = v * 100;
|
||||
return Deluge.progressBar(progress, this.col.width, progress.toFixed(2) + '%', 0);
|
||||
}
|
||||
})
|
||||
}, {
|
||||
header: _('Priority'),
|
||||
width: 150,
|
||||
|
@ -75,12 +87,7 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, {
|
|||
})
|
||||
}],
|
||||
|
||||
selModel: new Ext.tree.MultiSelectionModel(),
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.details.FilesTab.superclass.initComponent.call(this);
|
||||
this.setRootNode(new Ext.tree.TreeNode({text: 'Files'}));
|
||||
},
|
||||
multiSelect: true,
|
||||
|
||||
clear: function() {
|
||||
var root = this.getRootNode();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.details.OptionsTab.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -30,11 +30,10 @@
|
|||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
|
||||
Ext.define('Deluge.details.OptionsTab', {
|
||||
extend: 'Ext.form.Panel',
|
||||
|
||||
Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
||||
|
||||
constructor: function(config) {
|
||||
config = Ext.apply({
|
||||
title: _('Options'),
|
||||
autoScroll: true,
|
||||
bodyStyle: 'padding: 5px;',
|
||||
border: false,
|
||||
|
@ -46,13 +45,9 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
|||
},
|
||||
deferredRender: false,
|
||||
layout: 'column',
|
||||
title: _('Options')
|
||||
}, config);
|
||||
Deluge.details.OptionsTab.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.details.OptionsTab.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
this.fieldsets = {}, this.fields = {};
|
||||
this.optionsManager = new Deluge.MultiOptionsManager({
|
||||
|
@ -291,7 +286,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
|||
autoHeight: true,
|
||||
defaultType: 'checkbox',
|
||||
title: _('General'),
|
||||
layout: 'form'
|
||||
layout: 'anchor'
|
||||
});
|
||||
|
||||
this.fields['private'] = this.fieldsets.general.add({
|
||||
|
@ -354,7 +349,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
|||
},
|
||||
|
||||
onRender: function(ct, position) {
|
||||
Deluge.details.OptionsTab.superclass.onRender.call(this, ct, position);
|
||||
this.callParent(arguments);
|
||||
|
||||
// This is another hack I think, so keep an eye out here when upgrading.
|
||||
this.layout = new Ext.layout.ColumnLayout();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.details.PeersTab.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -51,21 +51,15 @@
|
|||
return Deluge.progressBar(progress, this.width - 8, progress + '%');
|
||||
}
|
||||
|
||||
Deluge.details.PeersTab = Ext.extend(Ext.grid.GridPanel, {
|
||||
|
||||
// fast way to figure out if we have a peer already.
|
||||
peers: {},
|
||||
|
||||
constructor: function(config) {
|
||||
config = Ext.apply({
|
||||
Ext.define('Deluge.details.PeersTab', {
|
||||
extend: 'Ext.grid.Panel',
|
||||
title: _('Peers'),
|
||||
cls: 'x-deluge-peers',
|
||||
store: new Ext.data.Store({
|
||||
reader: new Ext.data.JsonReader({
|
||||
idProperty: 'ip',
|
||||
root: 'peers'
|
||||
}, Deluge.data.Peer)
|
||||
|
||||
store: Ext.create('Ext.data.Store', {
|
||||
model: 'Deluge.data.Peer'
|
||||
}),
|
||||
|
||||
columns: [{
|
||||
header: ' ',
|
||||
width: 30,
|
||||
|
@ -82,7 +76,7 @@
|
|||
header: 'Client',
|
||||
width: 125,
|
||||
sortable: true,
|
||||
renderer: fplain,
|
||||
renderer: function(v) { return fplain(v) },
|
||||
dataIndex: 'client'
|
||||
}, {
|
||||
header: 'Progress',
|
||||
|
@ -94,21 +88,22 @@
|
|||
header: 'Down Speed',
|
||||
width: 100,
|
||||
sortable: true,
|
||||
renderer: fspeed,
|
||||
renderer: function(v) { return fspeed(v) },
|
||||
dataIndex: 'down_speed'
|
||||
}, {
|
||||
header: 'Up Speed',
|
||||
width: 100,
|
||||
sortable: true,
|
||||
renderer: fspeed,
|
||||
renderer: function(v) { return fspeed(v) },
|
||||
dataIndex: 'up_speed'
|
||||
}],
|
||||
|
||||
stripeRows: true,
|
||||
deferredRender: false,
|
||||
autoScroll:true
|
||||
}, config);
|
||||
Deluge.details.PeersTab.superclass.constructor.call(this, config);
|
||||
},
|
||||
autoScroll: true,
|
||||
|
||||
// fast way to figure out if we have a peer already.
|
||||
peers: {},
|
||||
|
||||
clear: function() {
|
||||
this.getStore().removeAll();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.details.StatusTab.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,21 +29,22 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.ns('Deluge.details');
|
||||
|
||||
/**
|
||||
* @class Deluge.details.StatusTab
|
||||
* @extends Ext.Panel
|
||||
*/
|
||||
Deluge.details.StatusTab = Ext.extend(Ext.Panel, {
|
||||
Ext.define('Deluge.details.StatusTab', {
|
||||
extend: 'Ext.Panel',
|
||||
|
||||
title: _('Status'),
|
||||
autoScroll: true,
|
||||
|
||||
onRender: function(ct, position) {
|
||||
Deluge.details.StatusTab.superclass.onRender.call(this, ct, position);
|
||||
this.callParent(arguments);
|
||||
|
||||
this.progressBar = this.add({
|
||||
xtype: 'progress',
|
||||
xtype: 'progressbar',
|
||||
cls: 'x-deluge-status-progressbar'
|
||||
});
|
||||
|
||||
|
@ -53,18 +54,12 @@ Deluge.details.StatusTab = Ext.extend(Ext.Panel, {
|
|||
|
||||
border: false,
|
||||
width: 1000,
|
||||
listeners: {
|
||||
'render': {
|
||||
fn: function(panel) {
|
||||
panel.load({
|
||||
loader: {
|
||||
url: deluge.config.base + 'render/tab_status.html',
|
||||
text: _('Loading') + '...'
|
||||
});
|
||||
panel.getUpdater().on('update', this.onPanelUpdate, this);
|
||||
},
|
||||
loadMask: true,
|
||||
success: this.onPanelUpdate,
|
||||
scope: this
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.preferences.BandwidthPage.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,25 +29,20 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Deluge.preferences');
|
||||
|
||||
/**
|
||||
* @class Deluge.preferences.Bandwidth
|
||||
* @extends Ext.form.FormPanel
|
||||
*/
|
||||
Deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, {
|
||||
constructor: function(config) {
|
||||
config = Ext.apply({
|
||||
Ext.define('Deluge.preferences.Bandwidth', {
|
||||
extend: 'Ext.form.Panel',
|
||||
|
||||
border: false,
|
||||
title: _('Bandwidth'),
|
||||
layout: 'form',
|
||||
labelWidth: 10
|
||||
}, config);
|
||||
Deluge.preferences.Bandwidth.superclass.constructor.call(this, config);
|
||||
},
|
||||
labelWidth: 10,
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.preferences.Bandwidth.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
var om = deluge.preferences.getOptionsManager();
|
||||
var fieldset = this.add({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.preferences.CachePage.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,20 +29,19 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Deluge.preferences');
|
||||
|
||||
/**
|
||||
* @class Deluge.preferences.Cache
|
||||
* @extends Ext.form.FormPanel
|
||||
*/
|
||||
Deluge.preferences.Cache = Ext.extend(Ext.form.FormPanel, {
|
||||
Ext.define('Deluge.preferences.Cache', {
|
||||
extend: 'Ext.form.Panel',
|
||||
|
||||
border: false,
|
||||
title: _('Cache'),
|
||||
layout: 'form',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.preferences.Cache.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
var om = deluge.preferences.getOptionsManager();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.preferences.DaemonPage.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,20 +29,19 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Deluge.preferences');
|
||||
|
||||
/**
|
||||
* @class Deluge.preferences.Daemon
|
||||
* @extends Ext.form.FormPanel
|
||||
*/
|
||||
Deluge.preferences.Daemon = Ext.extend(Ext.form.FormPanel, {
|
||||
Ext.define('Deluge.preferences.Daemon', {
|
||||
extend: 'Ext.form.Panel',
|
||||
|
||||
border: false,
|
||||
title: _('Daemon'),
|
||||
layout: 'form',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.preferences.Daemon.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
var om = deluge.preferences.getOptionsManager();
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.preferences.DownloadsPage.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,26 +29,21 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Deluge.preferences');
|
||||
|
||||
/**
|
||||
* @class Deluge.preferences.Downloads
|
||||
* @extends Ext.form.FormPanel
|
||||
*/
|
||||
Deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
|
||||
constructor: function(config) {
|
||||
config = Ext.apply({
|
||||
Ext.define('Deluge.preferences.Downloads', {
|
||||
extend: 'Ext.form.Panel',
|
||||
border: false,
|
||||
title: _('Downloads'),
|
||||
layout: 'form',
|
||||
layout: 'anchor',
|
||||
autoHeight: true,
|
||||
width: 320
|
||||
}, config);
|
||||
Deluge.preferences.Downloads.superclass.constructor.call(this, config);
|
||||
},
|
||||
width: 320,
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.preferences.Downloads.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
var optMan = deluge.preferences.getOptionsManager();
|
||||
var fieldset = this.add({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.preferences.InterfacePage.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,20 +29,19 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Deluge.preferences');
|
||||
|
||||
/**
|
||||
* @class Deluge.preferences.Interface
|
||||
* @extends Ext.form.FormPanel
|
||||
*/
|
||||
Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, {
|
||||
Ext.define('Deluge.preferences.Interface', {
|
||||
extend: 'Ext.form.Panel',
|
||||
|
||||
border: false,
|
||||
title: _('Interface'),
|
||||
layout: 'form',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.preferences.Interface.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
var om = this.optionsManager = new Deluge.OptionsManager();
|
||||
this.on('show', this.onPageShow, this);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.preferences.NetworkPage.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,20 +29,19 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Deluge.preferences');
|
||||
|
||||
/**
|
||||
* @class Deluge.preferences.Network
|
||||
* @extends Ext.form.FormPanel
|
||||
*/
|
||||
Deluge.preferences.Network = Ext.extend(Ext.form.FormPanel, {
|
||||
Ext.define('Deluge.preferences.Network', {
|
||||
extend: 'Ext.form.Panel',
|
||||
|
||||
border: false,
|
||||
layout: 'form',
|
||||
title: _('Network'),
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.preferences.Network.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
var optMan = deluge.preferences.getOptionsManager();
|
||||
|
||||
var fieldset = this.add({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.preferences.OtherPage.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,24 +29,18 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Deluge.preferences');
|
||||
|
||||
/**
|
||||
* @class Deluge.preferences.Other
|
||||
* @extends Ext.form.FormPanel
|
||||
*/
|
||||
Deluge.preferences.Other = Ext.extend(Ext.form.FormPanel, {
|
||||
constructor: function(config) {
|
||||
config = Ext.apply({
|
||||
Ext.define('Deluge.preferences.Other', {
|
||||
extend: 'Ext.form.Panel',
|
||||
border: false,
|
||||
title: _('Other'),
|
||||
layout: 'form'
|
||||
}, config);
|
||||
Deluge.preferences.Other.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.preferences.Other.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
var optMan = deluge.preferences.getOptionsManager();
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
|
|||
),
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.preferences.Plugins.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
this.defaultValues = {
|
||||
'version': '',
|
||||
'email': '',
|
||||
|
@ -68,14 +68,12 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
|
|||
return '<div class="x-grid3-check-col'+(v?'-on':'')+'"> </div>';
|
||||
}
|
||||
|
||||
this.list = this.add({
|
||||
xtype: 'listview',
|
||||
store: new Ext.data.ArrayStore({
|
||||
fields: [
|
||||
{name: 'enabled', mapping: 0},
|
||||
{name: 'plugin', mapping: 1}
|
||||
]
|
||||
this.grid = this.add({
|
||||
xtype: 'grid',
|
||||
store: Ext.create('Ext.data.JsonStore', {
|
||||
model: 'Deluge.data.PluginRecord'
|
||||
}),
|
||||
singleSelect: true,
|
||||
columns: [{
|
||||
id: 'enabled',
|
||||
header: _('Enabled'),
|
||||
|
@ -94,8 +92,6 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
|
|||
sortable: true,
|
||||
dataIndex: 'plugin'
|
||||
}],
|
||||
singleSelect: true,
|
||||
autoExpandColumn: 'plugin',
|
||||
listeners: {
|
||||
selectionchange: {fn: this.onPluginSelect, scope: this}
|
||||
}
|
||||
|
@ -105,7 +101,7 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
|
|||
region: 'center',
|
||||
autoScroll: true,
|
||||
margins: '5 5 5 5',
|
||||
items: [this.list],
|
||||
items: [this.grid],
|
||||
bbar: new Ext.Toolbar({
|
||||
items: [{
|
||||
cls: 'x-btn-text-icon',
|
||||
|
@ -147,7 +143,7 @@ Deluge.preferences.Plugins = Ext.extend(Ext.Panel, {
|
|||
});
|
||||
|
||||
this.pluginInfo.on('render', this.onPluginInfoRender, this);
|
||||
this.list.on('click', this.onNodeClick, this);
|
||||
this.grid.on('click', this.onNodeClick, this);
|
||||
deluge.preferences.on('show', this.onPreferencesShow, this);
|
||||
deluge.events.on('PluginDisabledEvent', this.onPluginDisabled, this);
|
||||
deluge.events.on('PluginEnabledEvent', this.onPluginEnabled, this);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.preferences.PreferencesWindow.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,15 +29,18 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Deluge.preferences');
|
||||
|
||||
PreferencesRecord = Ext.data.Record.create([{name:'name', type:'string'}]);
|
||||
Ext.define('PreferencesRecord', {
|
||||
extend: 'Ext.data.Model',
|
||||
fields: [{name: 'name', type: 'string'}]
|
||||
});
|
||||
|
||||
/**
|
||||
* @class Deluge.preferences.PreferencesWindow
|
||||
* @extends Ext.Window
|
||||
*/
|
||||
Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
|
||||
Ext.define('Deluge.preferences.PreferencesWindow', {
|
||||
extend: 'Ext.Window',
|
||||
|
||||
/**
|
||||
* @property {String} currentPage The currently selected page.
|
||||
|
@ -59,10 +62,12 @@ Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
|
|||
pages: {},
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.preferences.PreferencesWindow.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
this.list = new Ext.list.ListView({
|
||||
store: new Ext.data.Store(),
|
||||
store: Ext.create('Ext.data.Store', {
|
||||
model: 'PreferencesRecord'
|
||||
}),
|
||||
columns: [{
|
||||
id: 'name',
|
||||
renderer: fplain,
|
||||
|
@ -103,9 +108,9 @@ Deluge.preferences.PreferencesWindow = Ext.extend(Ext.Window, {
|
|||
cmargins: '5 5 5 5'
|
||||
});
|
||||
|
||||
this.addButton(_('Close'), this.onClose, this);
|
||||
this.addButton(_('Apply'), this.onApply, this);
|
||||
this.addButton(_('Ok'), this.onOk, this);
|
||||
//this.addButton(_('Close'), this.onClose, this);
|
||||
//this.addButton(_('Apply'), this.onApply, this);
|
||||
//this.addButton(_('Ok'), this.onOk, this);
|
||||
|
||||
this.optionsManager = new Deluge.OptionsManager();
|
||||
this.on('afterrender', this.onAfterRender, this);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.preferences.ProxyPage.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,24 +29,19 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Deluge.preferences');
|
||||
|
||||
/**
|
||||
* @class Deluge.preferences.Proxy
|
||||
* @extends Ext.form.FormPanel
|
||||
*/
|
||||
Deluge.preferences.Proxy = Ext.extend(Ext.form.FormPanel, {
|
||||
constructor: function(config) {
|
||||
config = Ext.apply({
|
||||
Ext.define('Deluge.preferences.Proxy', {
|
||||
extend: 'Ext.form.Panel',
|
||||
|
||||
border: false,
|
||||
title: _('Proxy'),
|
||||
layout: 'form'
|
||||
}, config);
|
||||
Deluge.preferences.Proxy.superclass.constructor.call(this, config);
|
||||
},
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.preferences.Proxy.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
this.peer = this.add(new Deluge.preferences.ProxyField({
|
||||
title: _('Peer'),
|
||||
name: 'peer'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*!
|
||||
* Deluge.preferences.QueuePage.js
|
||||
*
|
||||
* Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
|
||||
* Copyright (c) Damien Churchill 2009-2011 <damoxc@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -29,20 +29,19 @@
|
|||
* this exception statement from your version. If you delete this exception
|
||||
* statement from all source files in the program, then also delete it here.
|
||||
*/
|
||||
Ext.namespace('Deluge.preferences');
|
||||
|
||||
/**
|
||||
* @class Deluge.preferences.Queue
|
||||
* @extends Ext.form.FormPanel
|
||||
*/
|
||||
Deluge.preferences.Queue = Ext.extend(Ext.form.FormPanel, {
|
||||
Ext.define('Deluge.preferences.Queue', {
|
||||
extend: 'Ext.form.Panel',
|
||||
|
||||
border: false,
|
||||
title: _('Queue'),
|
||||
layout: 'form',
|
||||
|
||||
initComponent: function() {
|
||||
Deluge.preferences.Queue.superclass.initComponent.call(this);
|
||||
this.callParent(arguments);
|
||||
|
||||
var om = deluge.preferences.getOptionsManager();
|
||||
|
||||
|
|
|
@ -427,7 +427,7 @@ class TopLevel(resource.Resource):
|
|||
__stylesheets = [
|
||||
"resources/css/ext-all-gray.css",
|
||||
# "css/ext-extensions.css",
|
||||
# "css/deluge.css"
|
||||
"css/deluge.css"
|
||||
]
|
||||
|
||||
def __init__(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue