From 22e3b34221e67c29aa51d3df1a00517ab24e94ca Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Tue, 24 Feb 2009 20:20:49 +0000 Subject: [PATCH] improve the progress bars a little and add a stub for the torrent add window --- deluge/ui/web/css/deluge.css | 32 +++++++++++++++++++++- deluge/ui/web/index.html | 1 + deluge/ui/web/js/deluge-add.js | 47 +++++++++++++++++++++++++++++++++ deluge/ui/web/js/deluge-bars.js | 6 ++++- 4 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 deluge/ui/web/js/deluge-add.js diff --git a/deluge/ui/web/css/deluge.css b/deluge/ui/web/css/deluge.css index 27e75b8e2..c4d09180c 100644 --- a/deluge/ui/web/css/deluge.css +++ b/deluge/ui/web/css/deluge.css @@ -82,11 +82,16 @@ html, body { } -/* Login */ +/* Login Window */ .x-deluge-login-window-icon { background: url('/icons/16/login.png') no-repeat 2px; } +/* Add Window */ +.x-deluge-add-window-icon { + background: url('/icons/16/add.png') no-repeat 2px; +} + /* Statusbar */ #deluge-statusbar .x-not-connected { background: url('/icons/16/error.png') no-repeat 2px; @@ -95,4 +100,29 @@ html, body { #deluge-statusbar .x-connected { background: transparent; +} + +.x-progress-wrap { + background: url('/themes/slate/panel/white-top-bottom.gif'); + border: 1px solid Black; + border-top: none; +} + +.x-progress-inner { + background: url('/themes/slate/panel/white-top-bottom.gif'); +} + +.x-progress-bar { + background: url('/themes/slate/toolbar/bg.gif'); + margin-top: 1px; +} + +.x-progress-text { + background: transparent; + color: White; +} + +.x-progress-text-back { + background: transparent; + color: White; } \ No newline at end of file diff --git a/deluge/ui/web/index.html b/deluge/ui/web/index.html index 9a18e3420..f0395e245 100644 --- a/deluge/ui/web/index.html +++ b/deluge/ui/web/index.html @@ -22,6 +22,7 @@ + diff --git a/deluge/ui/web/js/deluge-add.js b/deluge/ui/web/js/deluge-add.js new file mode 100644 index 000000000..1d80a06cc --- /dev/null +++ b/deluge/ui/web/js/deluge-add.js @@ -0,0 +1,47 @@ +/* +Script: deluge-add.js + Contains the Add Torrent window. + +Copyright: + (C) Damien Churchill 2009 + 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. +*/ + +Deluge.Add = { + onRender: function(window) { + + } +} + +Deluge.Add.Window = new Ext.Window({ + layout: 'fit', + width: 300, + height: 150, + buttonAlign: 'right', + closeAction: 'hide', + closable: true, + plain: true, + title: _('Add Torrent'), + iconCls: 'x-deluge-add-window-icon', + items: [], + buttons: [{ + text: _('Cancel') + }, { + text: _('Add') + }], + listeners: {'render': {fn: Deluge.Add.onRender, scope: Deluge.Add}} +}); \ No newline at end of file diff --git a/deluge/ui/web/js/deluge-bars.js b/deluge/ui/web/js/deluge-bars.js index 42279ec4f..75eadfbfc 100644 --- a/deluge/ui/web/js/deluge-bars.js +++ b/deluge/ui/web/js/deluge-bars.js @@ -27,6 +27,10 @@ Deluge.ToolBar = { 'create', 'add', 'remove', 'pause', 'resume', 'up', 'down' ], + onTorrentAdd: function() { + Deluge.Add.Window.show(); + }, + onConnect: function() { $each(this.connected_buttons, function(button_id) { this.Bar.items.get(button_id).enable(); @@ -109,7 +113,7 @@ Deluge.ToolBar.Bar = new Ext.Toolbar({ disabled: true, text: _('Add'), icon: '/icons/16/add.png', - handler: Deluge.ToolBar.onTorrentAction + handler: Deluge.ToolBar.onTorrentAdd },{ id: 'remove', cls: 'x-btn-text-icon',