From 7647f848e48696e73e50e04ca22fa752a770004b Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Sat, 22 Dec 2012 02:24:25 +0000 Subject: [PATCH] Update Changelog, webui gettext, gitignore & compress js --- .gitignore | 2 +- ChangeLog | 16 ++++- deluge/ui/web/gettext.js | 84 +++++++++++----------- deluge/ui/web/js/deluge-all-debug.js | 103 ++++++++++++++------------- deluge/ui/web/js/deluge-all.js | 22 +++--- 5 files changed, 123 insertions(+), 104 deletions(-) diff --git a/.gitignore b/.gitignore index 03b6fe47a..cf7a67e64 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ dist _trial_temp deluge/i18n/*/ *.desktop -.build_data +.build_data* diff --git a/ChangeLog b/ChangeLog index cc00f123a..5b08a05d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,14 +45,17 @@ === Deluge 1.3.6 (In Development) === ==== Core ==== * Catch & log KeyError when removing a torrent from the queued torrents set - * Fix moving/renaming torrents with non-ascii characters in libtorrent 0.16 + * Fix moving/renaming torrents issues when using libtorrent 0.16 * Make sure queue order is preserved when restarting * #2160: Disable use of python bindings for libtorrent extensions and replace with session flag * #2163: Fix unable add torrent file with empty (0:) encoding tag * #2201: Fix error in authmanager if auth file has extra newlines * #2109: Fix the Proxy settings not being cleared by setting None * #2110: Fix accepting magnet uris with xt param anywhere within them - * #2204: Fix daemon shutdown hang + * #2204: Fix daemon shutdown hang with large numbers of torrents + +==== Client ==== + * Fix keyerrors after removing torrents from UIs ==== GtkUI ==== * Add move completed option to add torrent dialog @@ -68,6 +71,10 @@ * Fix torrent names on libtorrent 0.16 on windows * #2147: Fix missing translations for plugin preferences page * #1474: Fix the on_show_prefs hook not being executed immediatly after enabling a plugin + * #1946: Fix ReactorNotRestartable error when set as startup application + * #2130: Fix same name can be given to different files in Add Torrent dialog + * #2129: Fix empty filename able to be set in AddTorrent dialog + * #2228: Fix Apply-To-All in AddTorrent Dialog copying file renames to other torrents ==== Console ==== * LP#1004793: Enable use of connect command in non-interactive mode @@ -83,6 +90,11 @@ * #2120: Fix manually entered values not being saved in spinners * #2212: Fix unable to scroll in proxy preferences page * Fix autoconnecting to the default host + * #2046: Fix plugins not enabling properly until after refreshing page + * #2125: Fix plugin methods not being available when enabled until restart + * #2085: Fix not showing torrents in sidebar for categories other than 'All' in classic mode + * #2232: Fix flag icon path in Peers Tab missing deluge.config.base + * Fix submenus closing upon mouse click ==== Windows OS ==== * Hide the cmd windows when running deluged.exe or deluge-web.exe diff --git a/deluge/ui/web/gettext.js b/deluge/ui/web/gettext.js index 4ac07490a..acef95a7b 100644 --- a/deluge/ui/web/gettext.js +++ b/deluge/ui/web/gettext.js @@ -32,49 +32,49 @@ GetText.add('#', '${escape(_("#"))}') // DetailsTab.js:50 GetText.add('# of files', '${escape(_("# of files"))}') -// Menus.js:161 +// Menus.js:166 GetText.add('0', '${escape(_("0"))}') -// Menus.js:163 +// Menus.js:168 GetText.add('1', '${escape(_("1"))}') -// Menus.js:109, Menus.js:127 +// Menus.js:111, Menus.js:130 GetText.add('10 KiB/s', '${escape(_("10 KiB/s"))}') -// Menus.js:145 +// Menus.js:149 GetText.add('100', '${escape(_("100"))}') -// Menus.js:165 +// Menus.js:170 GetText.add('2', '${escape(_("2"))}') -// Menus.js:147 +// Menus.js:151 GetText.add('200', '${escape(_("200"))}') -// Menus.js:167 +// Menus.js:172 GetText.add('3', '${escape(_("3"))}') -// Menus.js:111, Menus.js:129 +// Menus.js:113, Menus.js:132 GetText.add('30 KiB/s', '${escape(_("30 KiB/s"))}') -// Menus.js:149 +// Menus.js:153 GetText.add('300', '${escape(_("300"))}') -// Menus.js:115, Menus.js:133 +// Menus.js:117, Menus.js:136 GetText.add('300 KiB/s', '${escape(_("300 KiB/s"))}') -// Menus.js:169 +// Menus.js:174 GetText.add('5', '${escape(_("5"))}') -// Menus.js:107, Menus.js:125 +// Menus.js:109, Menus.js:128 GetText.add('5 KiB/s', '${escape(_("5 KiB/s"))}') -// Menus.js:143 +// Menus.js:147 GetText.add('50', '${escape(_("50"))}') -// Menus.js:151 +// Menus.js:155 GetText.add('500', '${escape(_("500"))}') -// Menus.js:113, Menus.js:131 +// Menus.js:115, Menus.js:134 GetText.add('80 KiB/s', '${escape(_("80 KiB/s"))}') // QueuePage.js:69 @@ -86,7 +86,7 @@ GetText.add('Add', '${escape(_("Add"))}') // AddConnectionWindow.js:40 GetText.add('Add Connection', '${escape(_("Add Connection"))}') -// OptionsTab.js:147 +// OptionsTab.js:144 GetText.add('Add In Paused State', '${escape(_("Add In Paused State"))}') // AddWindow.js:37 @@ -122,7 +122,7 @@ GetText.add('Allow the use of multiple filters at once', '${escape(_("Allow the // OptionsTab.js:347, PreferencesWindow.js:107 GetText.add('Apply', '${escape(_("Apply"))}') -// Menus.js:176, OptionsTab.js:215 +// Menus.js:181, OptionsTab.js:215 GetText.add('Auto Managed', '${escape(_("Auto Managed"))}') // DownloadsPage.js:91 @@ -140,7 +140,7 @@ GetText.add('Bandwidth', '${escape(_("Bandwidth"))}') // OtherPage.js:66 GetText.add('Be alerted about new releases', '${escape(_("Be alerted about new releases"))}') -// Menus.js:204 +// Menus.js:210 GetText.add('Bottom', '${escape(_("Bottom"))}') // MoveStorage.js:73, FileWindow.js:70, InstallPluginWindow.js:69 @@ -188,7 +188,7 @@ GetText.add('Connect', '${escape(_("Connect"))}') // ConnectionManager.js:177, ConnectionManager.js:225 GetText.add('Connected', '${escape(_("Connected"))}') -// Menus.js:139 +// Menus.js:142 GetText.add('Connection Limit', '${escape(_("Connection Limit"))}') // ConnectionManager.js:43, Toolbar.js:100 @@ -209,7 +209,7 @@ GetText.add('Copy of .torrent files to', '${escape(_("Copy of .torrent files to" // Toolbar.js:52 GetText.add('Create', '${escape(_("Create"))}') -// Menus.js:103 +// Menus.js:104 GetText.add('D/L Speed Limit', '${escape(_("D/L Speed Limit"))}') // NetworkPage.js:225, ProxyPage.js:70 @@ -236,13 +236,13 @@ GetText.add('Disabled', '${escape(_("Disabled"))}') // ConnectionManager.js:179 GetText.add('Disconnect', '${escape(_("Disconnect"))}') -// Menus.js:251, Deluge.js:156 +// Menus.js:257, Deluge.js:156 GetText.add('Do Not Download', '${escape(_("Do Not Download"))}') // QueuePage.js:107 GetText.add('Do not count slow torrents', '${escape(_("Do not count slow torrents"))}') -// EditTrackersWindow.js:107, Menus.js:198, Toolbar.js:89 +// EditTrackersWindow.js:107, Menus.js:204, Toolbar.js:89 GetText.add('Down', '${escape(_("Down"))}') // TorrentGrid.js:241 @@ -278,7 +278,7 @@ GetText.add('Edit', '${escape(_("Edit"))}') // EditTrackerWindow.js:40 GetText.add('Edit Tracker', '${escape(_("Edit Tracker"))}') -// EditTrackersWindow.js:40, Menus.js:218, OptionsTab.js:332 +// EditTrackersWindow.js:40, Menus.js:224, OptionsTab.js:332 GetText.add('Edit Trackers', '${escape(_("Edit Trackers"))}') // EncryptionPage.js:99 @@ -296,7 +296,7 @@ GetText.add('Encryption', '${escape(_("Encryption"))}') // ConnectionManager.js:308, ConnectionManager.js:364, AddConnectionWindow.js:103, AddWindow.js:209 GetText.add('Error', '${escape(_("Error"))}') -// Menus.js:247 +// Menus.js:253 GetText.add('Expand All', '${escape(_("Expand All"))}') // FileWindow.js:67, AddWindow.js:98 @@ -323,7 +323,7 @@ GetText.add('Find More', '${escape(_("Find More"))}') // DownloadsPage.js:57 GetText.add('Folders', '${escape(_("Folders"))}') -// Menus.js:230 +// Menus.js:236 GetText.add('Force Recheck', '${escape(_("Force Recheck"))}') // EncryptionPage.js:63, EncryptionPage.js:80 @@ -341,7 +341,7 @@ GetText.add('Full', '${escape(_("Full"))}') // EncryptionPage.js:98 GetText.add('Full Stream', '${escape(_("Full Stream"))}') -// OptionsTab.js:293, OptionsTab.js:140, QueuePage.js:52 +// OptionsTab.js:293, OptionsTab.js:137, QueuePage.js:52 GetText.add('General', '${escape(_("General"))}') // OtherPage.js:97 @@ -365,10 +365,10 @@ GetText.add('Hash', '${escape(_("Hash"))}') // Toolbar.js:107 GetText.add('Help', '${escape(_("Help"))}') -// Menus.js:261, Deluge.js:158 +// Menus.js:267, Deluge.js:158 GetText.add('High Priority', '${escape(_("High Priority"))}') -// Menus.js:266, Deluge.js:159 +// Menus.js:272, Deluge.js:159 GetText.add('Highest Priority', '${escape(_("Highest Priority"))}') // FileBrowser.js:56 @@ -434,10 +434,10 @@ GetText.add('Login Failed', '${escape(_("Login Failed"))}') // Toolbar.js:114 GetText.add('Logout', '${escape(_("Logout"))}') -// OptionsTab.js:150, OptionsTab.js:127 +// OptionsTab.js:150, OptionsTab.js:126 GetText.add('Max Connections', '${escape(_("Max Connections"))}') -// OptionsTab.js:115 +// OptionsTab.js:116 GetText.add('Max Down Speed', '${escape(_("Max Down Speed"))}') // OptionsTab.js:97 @@ -446,7 +446,7 @@ GetText.add('Max Download Speed', '${escape(_("Max Download Speed"))}') // OptionsTab.js:121 GetText.add('Max Up Speed', '${escape(_("Max Up Speed"))}') -// OptionsTab.js:173, OptionsTab.js:133 +// OptionsTab.js:173, OptionsTab.js:131 GetText.add('Max Upload Slots', '${escape(_("Max Upload Slots"))}') // OptionsTab.js:123 @@ -476,7 +476,7 @@ GetText.add('Move', '${escape(_("Move"))}') // OptionsTab.js:262 GetText.add('Move Completed', '${escape(_("Move Completed"))}') -// Menus.js:236, MoveStorage.js:38 +// Menus.js:242, MoveStorage.js:38 GetText.add('Move Storage', '${escape(_("Move Storage"))}') // DownloadsPage.js:75 @@ -503,7 +503,7 @@ GetText.add('New Password', '${escape(_("New Password"))}') // ProxyField.js:55 GetText.add('None', '${escape(_("None"))}') -// Menus.js:256, Deluge.js:157 +// Menus.js:262, Deluge.js:157 GetText.add('Normal Priority', '${escape(_("Normal Priority"))}') // Statusbar.js:39 @@ -584,7 +584,7 @@ GetText.add('Preferences', '${escape(_("Preferences"))}') // OptionsTab.js:308 GetText.add('Prioritize First/Last', '${escape(_("Prioritize First/Last"))}') -// OptionsTab.js:153 +// OptionsTab.js:150 GetText.add('Prioritize First/Last Pieces', '${escape(_("Prioritize First/Last Pieces"))}') // DownloadsPage.js:140 @@ -611,7 +611,7 @@ GetText.add('Proxy', '${escape(_("Proxy"))}') // TorrentGrid.js:213 GetText.add('Public', '${escape(_("Public"))}') -// Menus.js:181, OptionsTab.js:196, QueuePage.js:41 +// Menus.js:186, OptionsTab.js:196, QueuePage.js:41 GetText.add('Queue', '${escape(_("Queue"))}') // QueuePage.js:62 @@ -626,7 +626,7 @@ GetText.add('Ratio', '${escape(_("Ratio"))}') // EditTrackersWindow.js:122, ConnectionManager.js:107, Toolbar.js:64, AddWindow.js:112 GetText.add('Remove', '${escape(_("Remove"))}') -// Menus.js:224, RemoveWindow.js:39, RemoveWindow.js:57 +// Menus.js:230, RemoveWindow.js:39, RemoveWindow.js:57 GetText.add('Remove Torrent', '${escape(_("Remove Torrent"))}') // RemoveWindow.js:56 @@ -734,7 +734,7 @@ GetText.add('TOS', '${escape(_("TOS"))}') // EditTrackersWindow.js:76 GetText.add('Tier', '${escape(_("Tier"))}') -// Menus.js:186 +// Menus.js:192 GetText.add('Top', '${escape(_("Top"))}') // QueuePage.js:76 @@ -761,7 +761,7 @@ GetText.add('Trackers', '${escape(_("Trackers"))}') // ProxyField.js:48 GetText.add('Type', '${escape(_("Type"))}') -// Menus.js:121 +// Menus.js:123 GetText.add('U/L Speed Limit', '${escape(_("U/L Speed Limit"))}') // NetworkPage.js:199 @@ -770,10 +770,10 @@ GetText.add('UPnP', '${escape(_("UPnP"))}') // OptionsPanel.js:142 GetText.add('Unable to set file priority!', '${escape(_("Unable to set file priority!"))}') -// Statusbar.js:85, Statusbar.js:133, Statusbar.js:181, Menus.js:117, Menus.js:135, Menus.js:153, Menus.js:171 +// Statusbar.js:85, Statusbar.js:133, Statusbar.js:181, Menus.js:119, Menus.js:138, Menus.js:157, Menus.js:176 GetText.add('Unlimited', '${escape(_("Unlimited"))}') -// EditTrackersWindow.js:102, Menus.js:192, Toolbar.js:83, FileBrowser.js:53 +// EditTrackersWindow.js:102, Menus.js:198, Toolbar.js:83, FileBrowser.js:53 GetText.add('Up', '${escape(_("Up"))}') // TorrentGrid.js:248 @@ -782,13 +782,13 @@ GetText.add('Up Limit', '${escape(_("Up Limit"))}') // TorrentGrid.js:154 GetText.add('Up Speed', '${escape(_("Up Speed"))}') -// Menus.js:212 +// Menus.js:218 GetText.add('Update Tracker', '${escape(_("Update Tracker"))}') // OtherPage.js:56 GetText.add('Updates', '${escape(_("Updates"))}') -// Menus.js:157 +// Menus.js:161 GetText.add('Upload Slot Limit', '${escape(_("Upload Slot Limit"))}') // Statusbar.js:152 diff --git a/deluge/ui/web/js/deluge-all-debug.js b/deluge/ui/web/js/deluge-all-debug.js index ce56ad132..9a18fedf6 100644 --- a/deluge/ui/web/js/deluge-all-debug.js +++ b/deluge/ui/web/js/deluge-all-debug.js @@ -1131,7 +1131,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, { if (!value.replace(' ', '').replace(' ', '')){ return ''; } - return String.format('', value); + return String.format('', deluge.config.base, value); } function peerAddressRenderer(value, p, record) { var seed = (record.data['seed'] == 1024) ? 'x-deluge-seed' : 'x-deluge-peer'; @@ -1788,7 +1788,7 @@ Deluge.add.FileWindow = Ext.extend(Deluge.add.Window, { }); /*! * Deluge.add.FilesTab.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -1828,7 +1828,7 @@ Deluge.add.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, { layout: 'fit', title: _('Files'), - autoScroll: true, + autoScroll: false, animate: false, border: false, disabled: true, @@ -2104,7 +2104,7 @@ Deluge.add.OptionsPanel = Ext.extend(Ext.TabPanel, { }); /*! * Deluge.add.OptionsPanel.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -2171,7 +2171,7 @@ Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, { width: 400, labelSeparator: '' })); - + var panel = this.add({ border: false, layout: 'column', @@ -2182,7 +2182,6 @@ Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, { border: false, autoHeight: true, defaultType: 'radio', - width: 100 }); this.optionsManager.bind('compact_allocation', fieldset.add({ @@ -2190,6 +2189,7 @@ Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, { columns: 1, vertical: true, labelSeparator: '', + width: 80, items: [{ name: 'compact_allocation', value: false, @@ -2211,35 +2211,32 @@ Deluge.add.OptionsTab = Ext.extend(Ext.form.FormPanel, { title: _('Bandwidth'), border: false, autoHeight: true, - labelWidth: 100, + bodyStyle: 'margin-left: 7px', + labelWidth: 105, width: 200, defaultType: 'spinnerfield' }); this.optionsManager.bind('max_download_speed', fieldset.add({ fieldLabel: _('Max Down Speed'), - labelStyle: 'margin-left: 10px', name: 'max_download_speed', width: 60 })); this.optionsManager.bind('max_upload_speed', fieldset.add({ fieldLabel: _('Max Up Speed'), - labelStyle: 'margin-left: 10px', name: 'max_upload_speed', width: 60 })); this.optionsManager.bind('max_connections', fieldset.add({ fieldLabel: _('Max Connections'), - labelStyle: 'margin-left: 10px', name: 'max_connections', width: 60 })); this.optionsManager.bind('max_upload_slots', fieldset.add({ fieldLabel: _('Max Upload Slots'), - labelStyle: 'margin-left: 10px', name: 'max_upload_slots', width: 60 })); - + fieldset = panel.add({ title: _('General'), border: false, @@ -2369,7 +2366,7 @@ Deluge.add.UrlWindow = Ext.extend(Deluge.add.Window, { var cookies = this.cookieField.getValue(); var torrentId = this.createTorrentId(); - if (url.substring(0,20) == 'magnet:?xt=urn:btih:') { + if (url.indexOf('magnet:?') == 0 && url.indexOf('xt=urn:btih') > -1) { deluge.client.web.get_magnet_info(url, { success: this.onGotInfo, scope: this, @@ -5349,20 +5346,20 @@ Ext.namespace('Ext.ux.util'); Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, { _components: [], - + _methods: [], - + _requests: {}, - + _url: null, - + _optionKeys: ['scope', 'success', 'failure'], - + constructor: function(config) { Ext.ux.util.RpcClient.superclass.constructor.call(this, config); this._url = config.url || null; this._id = 0; - + this.addEvents( // raw events /** @@ -5371,16 +5368,13 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, { * @param {Ext.ux.util.RpcClient} this */ 'connected', - + 'error' ); this.reloadMethods(); }, - + reloadMethods: function() { - Ext.each(this._components, function(component) { - delete this[component]; - }, this); this._execute('system.listMethods', { success: this._setMethods, scope: this @@ -5391,14 +5385,14 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, { options = options || {}; options.params = options.params || []; options.id = this._id; - + var request = Ext.encode({ method: method, params: options.params, id: options.id }); this._id++; - + return Ext.Ajax.request({ url: this._url, method: 'POST', @@ -5409,7 +5403,7 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, { options: options }); }, - + _onFailure: function(response, requestOptions) { var options = requestOptions.options; errorObj = { @@ -5420,23 +5414,23 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, { code: 255 } } - + this.fireEvent('error', errorObj, response, requestOptions) - + if (Ext.type(options.failure) != 'function') return; if (options.scope) { options.failure.call(options.scope, errorObj, response, requestOptions); } else { options.failure(errorObj, response, requestOptions); - } + } }, - + _onSuccess: function(response, requestOptions) { var responseObj = Ext.decode(response.responseText); var options = requestOptions.options; if (responseObj.error) { this.fireEvent('error', responseObj, response, requestOptions); - + if (Ext.type(options.failure) != 'function') return; if (options.scope) { options.failure.call(options.scope, responseObj, response, requestOptions); @@ -5452,21 +5446,21 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, { } } }, - + _parseArgs: function(args) { var params = []; Ext.each(args, function(arg) { params.push(arg); }); - + var options = params[params.length - 1]; if (Ext.type(options) == 'object') { var keys = Ext.keys(options), isOption = false; - + Ext.each(this._optionKeys, function(key) { if (keys.indexOf(key) > -1) isOption = true; }); - + if (isOption) { params.remove(options) } else { @@ -5481,11 +5475,11 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, { _setMethods: function(methods) { var components = {}, self = this; - + Ext.each(methods, function(method) { var parts = method.split('.'); var component = components[parts[0]] || {}; - + var fn = function() { var options = self._parseArgs(arguments); return self._execute(method, options); @@ -5493,11 +5487,15 @@ Ext.ux.util.RpcClient = Ext.extend(Ext.util.Observable, { component[parts[1]] = fn; components[parts[0]] = component; }); - + for (var name in components) { self[name] = components[name]; } - + Ext.each(this._components, function(component) { + if (!component in components) { + delete this[component]; + } + }, this); this._components = Ext.keys(components); this.fireEvent('connected', this); } @@ -6485,13 +6483,15 @@ Deluge.EventsManager = Ext.extend(Ext.util.Observable, { }, onGetEventsSuccess: function(events) { - if (!events) return; - Ext.each(events, function(event) { - var name = event[0], args = event[1]; - args.splice(0, 0, name); - this.fireEvent.apply(this, args); - }, this); - if (this.running) this.getEvents(); + if (!this.running) return; + if (events) { + Ext.each(events, function(event) { + var name = event[0], args = event[1]; + args.splice(0, 0, name); + this.fireEvent.apply(this, args); + }, this); + } + this.getEvents(); }, // private @@ -7299,10 +7299,12 @@ deluge.menus.torrent = new Ext.menu.Menu({ }, '-', { text: _('Options'), iconCls: 'icon-options', + hideOnClick: false, menu: new Ext.menu.Menu({ items: [{ text: _('D/L Speed Limit'), iconCls: 'x-deluge-downloading', + hideOnClick: false, menu: new Ext.menu.Menu({ items: [{ text: _('5 KiB/s') @@ -7321,6 +7323,7 @@ deluge.menus.torrent = new Ext.menu.Menu({ }, { text: _('U/L Speed Limit'), iconCls: 'x-deluge-seeding', + hideOnClick: false, menu: new Ext.menu.Menu({ items: [{ text: _('5 KiB/s') @@ -7339,6 +7342,7 @@ deluge.menus.torrent = new Ext.menu.Menu({ }, { text: _('Connection Limit'), iconCls: 'x-deluge-connections', + hideOnClick: false, menu: new Ext.menu.Menu({ items: [{ text: _('50') @@ -7357,6 +7361,7 @@ deluge.menus.torrent = new Ext.menu.Menu({ }, { text: _('Upload Slot Limit'), iconCls: 'icon-upload-slots', + hideOnClick: false, menu: new Ext.menu.Menu({ items: [{ text: _('0') @@ -7381,6 +7386,7 @@ deluge.menus.torrent = new Ext.menu.Menu({ }, '-', { text: _('Queue'), iconCls: 'icon-queue', + hideOnClick: false, menu: new Ext.menu.Menu({ items: [{ torrentAction: 'top', @@ -7965,6 +7971,7 @@ Deluge.Plugin = Ext.extend(Ext.util.Observable, { * then executes the plugins setup method, onEnabled. */ enable: function() { + deluge.client.reloadMethods(); this.fireEvent("enable", this); if (this.onEnable) this.onEnable(); }, @@ -9504,7 +9511,7 @@ deluge.ui = { }, onPluginDisabled: function(pluginName) { - deluge.plugins[pluginName].disable(); + if (deluge.plugins[pluginName]) deluge.plugins[pluginName].disable(); }, onPluginLoaded: function(options) { diff --git a/deluge/ui/web/js/deluge-all.js b/deluge/ui/web/js/deluge-all.js index c78359c45..c06a1865c 100644 --- a/deluge/ui/web/js/deluge-all.js +++ b/deluge/ui/web/js/deluge-all.js @@ -221,7 +221,7 @@ Deluge.details.OptionsTab=Ext.extend(Ext.form.FormPanel,{constructor:function(a) * this exception statement from your version. If you delete this exception * statement from all source files in the program, then also delete it here. */ -(function(){function a(d){if(!d.replace(" ","").replace(" ","")){return""}return String.format('',d)}function b(g,h,e){var d=(e.data.seed==1024)?"x-deluge-seed":"x-deluge-peer";if(peer_ip.length>2){var f=peer_ip.pop();var i=peer_ip.join(":");g="["+i+"]:"+f}return String.format('
{1}
',d,g)}function c(e){var d=(e*100).toFixed(0);return Deluge.progressBar(d,this.width-8,d+"%")}Deluge.details.PeersTab=Ext.extend(Ext.grid.GridPanel,{peers:{},constructor:function(d){d=Ext.apply({title:_("Peers"),cls:"x-deluge-peers",store:new Ext.data.Store({reader:new Ext.data.JsonReader({idProperty:"ip",root:"peers"},Deluge.data.Peer)}),columns:[{header:" ",width:30,sortable:true,renderer:a,dataIndex:"country"},{header:"Address",width:125,sortable:true,renderer:b,dataIndex:"ip"},{header:"Client",width:125,sortable:true,renderer:fplain,dataIndex:"client"},{header:"Progress",width:150,sortable:true,renderer:c,dataIndex:"progress"},{header:"Down Speed",width:100,sortable:true,renderer:fspeed,dataIndex:"down_speed"},{header:"Up Speed",width:100,sortable:true,renderer:fspeed,dataIndex:"up_speed"}],stripeRows:true,deferredRender:false,autoScroll:true},d);Deluge.details.PeersTab.superclass.constructor.call(this,d)},clear:function(){this.getStore().removeAll();this.peers={}},update:function(d){deluge.client.web.get_torrent_status(d,Deluge.Keys.Peers,{success:this.onRequestComplete,scope:this})},onRequestComplete:function(h,g){if(!h){return}var f=this.getStore();var e=[];var i={};Ext.each(h.peers,function(m){if(this.peers[m.ip]){var j=f.getById(m.ip);j.beginEdit();for(var l in m){if(j.get(l)!=m[l]){j.set(l,m[l])}}j.endEdit()}else{this.peers[m.ip]=1;e.push(new Deluge.data.Peer(m,m.ip))}i[m.ip]=1},this);f.add(e);f.each(function(j){if(!i[j.id]){f.remove(j);delete this.peers[j.id]}},this);f.commitChanges();var d=f.getSortState();if(!d){return}f.sort(d.field,d.direction)}})})(); +(function(){function a(d){if(!d.replace(" ","").replace(" ","")){return""}return String.format('',deluge.config.base,d)}function b(g,h,e){var d=(e.data.seed==1024)?"x-deluge-seed":"x-deluge-peer";if(peer_ip.length>2){var f=peer_ip.pop();var i=peer_ip.join(":");g="["+i+"]:"+f}return String.format('
{1}
',d,g)}function c(e){var d=(e*100).toFixed(0);return Deluge.progressBar(d,this.width-8,d+"%")}Deluge.details.PeersTab=Ext.extend(Ext.grid.GridPanel,{peers:{},constructor:function(d){d=Ext.apply({title:_("Peers"),cls:"x-deluge-peers",store:new Ext.data.Store({reader:new Ext.data.JsonReader({idProperty:"ip",root:"peers"},Deluge.data.Peer)}),columns:[{header:" ",width:30,sortable:true,renderer:a,dataIndex:"country"},{header:"Address",width:125,sortable:true,renderer:b,dataIndex:"ip"},{header:"Client",width:125,sortable:true,renderer:fplain,dataIndex:"client"},{header:"Progress",width:150,sortable:true,renderer:c,dataIndex:"progress"},{header:"Down Speed",width:100,sortable:true,renderer:fspeed,dataIndex:"down_speed"},{header:"Up Speed",width:100,sortable:true,renderer:fspeed,dataIndex:"up_speed"}],stripeRows:true,deferredRender:false,autoScroll:true},d);Deluge.details.PeersTab.superclass.constructor.call(this,d)},clear:function(){this.getStore().removeAll();this.peers={}},update:function(d){deluge.client.web.get_torrent_status(d,Deluge.Keys.Peers,{success:this.onRequestComplete,scope:this})},onRequestComplete:function(h,g){if(!h){return}var f=this.getStore();var e=[];var i={};Ext.each(h.peers,function(m){if(this.peers[m.ip]){var j=f.getById(m.ip);j.beginEdit();for(var l in m){if(j.get(l)!=m[l]){j.set(l,m[l])}}j.endEdit()}else{this.peers[m.ip]=1;e.push(new Deluge.data.Peer(m,m.ip))}i[m.ip]=1},this);f.add(e);f.each(function(j){if(!i[j.id]){f.remove(j);delete this.peers[j.id]}},this);f.commitChanges();var d=f.getSortState();if(!d){return}f.sort(d.field,d.direction)}})})(); /* * Deluge.details.StatusTab.js * @@ -352,7 +352,7 @@ Ext.namespace("Deluge.add");Deluge.add.AddWindow=Ext.extend(Deluge.add.Window,{t Ext.ns("Deluge.add");Deluge.add.FileWindow=Ext.extend(Deluge.add.Window,{title:_("Add from File"),layout:"fit",width:350,height:115,modal:true,plain:true,buttonAlign:"center",closeAction:"hide",bodyStyle:"padding: 10px 5px;",iconCls:"x-deluge-add-file",initComponent:function(){Deluge.add.FileWindow.superclass.initComponent.call(this);this.addButton(_("Add"),this.onAddClick,this);this.form=this.add({xtype:"form",baseCls:"x-plain",labelWidth:35,autoHeight:true,fileUpload:true,items:[{xtype:"fileuploadfield",id:"torrentFile",width:280,height:24,emptyText:_("Select a torrent"),fieldLabel:_("File"),name:"file",buttonCfg:{text:_("Browse")+"..."}}]})},onAddClick:function(c,b){if(this.form.getForm().isValid()){this.torrentId=this.createTorrentId();this.form.getForm().submit({url:deluge.config.base+"upload",waitMsg:_("Uploading your torrent..."),failure:this.onUploadFailure,success:this.onUploadSuccess,scope:this});var a=this.form.getForm().findField("torrentFile").value;a=a.split("\\").slice(-1)[0];this.fireEvent("beforeadd",this.torrentId,a)}},onGotInfo:function(d,c,a,b){d.filename=b.options.filename;this.fireEvent("add",this.torrentId,d)},onUploadFailure:function(a,b){this.hide()},onUploadSuccess:function(c,b){this.hide();if(b.result.success){var a=b.result.files[0];this.form.getForm().findField("torrentFile").setValue("");deluge.client.web.get_torrent_info(a,{success:this.onGotInfo,scope:this,filename:a})}}}); /* * Deluge.add.FilesTab.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -381,7 +381,7 @@ Ext.ns("Deluge.add");Deluge.add.FileWindow=Ext.extend(Deluge.add.Window,{title:_ * 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.FilesTab=Ext.extend(Ext.ux.tree.TreeGrid,{layout:"fit",title:_("Files"),autoScroll:true,animate:false,border:false,disabled:true,rootVisible:false,columns:[{header:_("Filename"),width:295,dataIndex:"filename"},{header:_("Size"),width:60,dataIndex:"size",tpl:new Ext.XTemplate("{size:this.fsize}",{fsize:function(a){return fsize(a)}})},{header:_("Download"),width:65,dataIndex:"download",tpl:new Ext.XTemplate("{download:this.format}",{format:function(a){return'
'}})}],initComponent:function(){Deluge.add.FilesTab.superclass.initComponent.call(this);this.on("click",this.onNodeClick,this)},clearFiles:function(){var a=this.getRootNode();if(!a.hasChildNodes()){return}a.cascade(function(b){if(!b.parentNode||!b.getOwnerTree()){return}b.remove()})},setDownload:function(b,c,d){b.attributes.download=c;b.ui.updateColumns();if(b.isLeaf()){if(!d){return this.fireEvent("fileschecked",[b],c,!c)}}else{var a=[b];b.cascade(function(e){e.attributes.download=c;e.ui.updateColumns();a.push(e)},this);if(!d){return this.fireEvent("fileschecked",a,c,!c)}}},onNodeClick:function(b,c){var a=new Ext.Element(c.target);if(a.getAttribute("rel")=="chkbox"){this.setDownload(b,!b.attributes.download)}}}); +Ext.ns("Deluge.add");Deluge.add.FilesTab=Ext.extend(Ext.ux.tree.TreeGrid,{layout:"fit",title:_("Files"),autoScroll:false,animate:false,border:false,disabled:true,rootVisible:false,columns:[{header:_("Filename"),width:295,dataIndex:"filename"},{header:_("Size"),width:60,dataIndex:"size",tpl:new Ext.XTemplate("{size:this.fsize}",{fsize:function(a){return fsize(a)}})},{header:_("Download"),width:65,dataIndex:"download",tpl:new Ext.XTemplate("{download:this.format}",{format:function(a){return'
'}})}],initComponent:function(){Deluge.add.FilesTab.superclass.initComponent.call(this);this.on("click",this.onNodeClick,this)},clearFiles:function(){var a=this.getRootNode();if(!a.hasChildNodes()){return}a.cascade(function(b){if(!b.parentNode||!b.getOwnerTree()){return}b.remove()})},setDownload:function(b,c,d){b.attributes.download=c;b.ui.updateColumns();if(b.isLeaf()){if(!d){return this.fireEvent("fileschecked",[b],c,!c)}}else{var a=[b];b.cascade(function(e){e.attributes.download=c;e.ui.updateColumns();a.push(e)},this);if(!d){return this.fireEvent("fileschecked",a,c,!c)}}},onNodeClick:function(b,c){var a=new Ext.Element(c.target);if(a.getAttribute("rel")=="chkbox"){this.setDownload(b,!b.attributes.download)}}}); /* * Deluge.add.Infohash.js * @@ -448,7 +448,7 @@ Ext.namespace("Ext.deluge.add"); Ext.ns("Deluge.add");Deluge.add.OptionsPanel=Ext.extend(Ext.TabPanel,{torrents:{},region:"south",margins:"5 5 5 5",activeTab:0,height:220,initComponent:function(){Deluge.add.OptionsPanel.superclass.initComponent.call(this);this.files=this.add(new Deluge.add.FilesTab());this.form=this.add(new Deluge.add.OptionsTab());this.files.on("fileschecked",this.onFilesChecked,this)},addTorrent:function(c){this.torrents[c.info_hash]=c;var b={};this.walkFileTree(c.files_tree,function(e,g,h,f){if(g!="file"){return}b[h.index]=h.download},this);var a=[];Ext.each(Ext.keys(b),function(e){a[e]=b[e]});var d=this.form.optionsManager.changeId(c.info_hash,true);this.form.optionsManager.setDefault("file_priorities",a);this.form.optionsManager.changeId(d,true)},clear:function(){this.files.clearFiles();this.form.optionsManager.resetAll()},getFilename:function(a){return this.torrents[a]["filename"]},getOptions:function(a){var c=this.form.optionsManager.changeId(a,true);var b=this.form.optionsManager.get();this.form.optionsManager.changeId(c,true);Ext.each(b.file_priorities,function(e,d){b.file_priorities[d]=(e)?1:0});return b},setTorrent:function(b){if(!b){return}this.torrentId=b;this.form.optionsManager.changeId(b);this.files.clearFiles();var a=this.files.getRootNode();var c=this.form.optionsManager.get("file_priorities");this.form.setDisabled(false);if(this.torrents[b]["files_tree"]){this.walkFileTree(this.torrents[b]["files_tree"],function(e,f,h,d){var g=new Ext.tree.TreeNode({download:(h.index)?c[h.index]:true,filename:e,fileindex:h.index,leaf:f!="dir",size:h.length});d.appendChild(g);if(f=="dir"){return g}},this,a);a.firstChild.expand();this.files.setDisabled(false);this.files.show()}else{this.form.show();this.files.setDisabled(true)}},walkFileTree:function(g,h,e,a){for(var b in g.contents){var f=g.contents[b];var d=f.type;if(e){var c=h.apply(e,[b,d,f,a])}else{var c=h(b,d,f,a)}if(d=="dir"){this.walkFileTree(f,h,e,c)}}},onFilesChecked:function(a,c,b){if(this.form.optionsManager.get("compact_allocation")){Ext.Msg.show({title:_("Unable to set file priority!"),msg:_("File prioritization is unavailable when using Compact allocation. Would you like to switch to Full allocation?"),buttons:Ext.Msg.YESNO,fn:function(d){if(d=="yes"){this.form.optionsManager.update("compact_allocation",false);Ext.each(a,function(f){if(f.attributes.fileindex<0){return}var e=this.form.optionsManager.get("file_priorities");e[f.attributes.fileindex]=c;this.form.optionsManager.update("file_priorities",e)},this)}else{this.files.setDownload(a[0],b,true)}},scope:this,icon:Ext.MessageBox.QUESTION})}else{Ext.each(a,function(e){if(e.attributes.fileindex<0){return}var d=this.form.optionsManager.get("file_priorities");d[e.attributes.fileindex]=c;this.form.optionsManager.update("file_priorities",d)},this)}}}); /* * Deluge.add.OptionsPanel.js - * + * * Copyright (c) Damien Churchill 2009-2010 * * This program is free software; you can redistribute it and/or modify @@ -477,7 +477,7 @@ Ext.ns("Deluge.add");Deluge.add.OptionsPanel=Ext.extend(Ext.TabPanel,{torrents:{ * 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.OptionsTab=Ext.extend(Ext.form.FormPanel,{title:_("Options"),height:170,border:false,bodyStyle:"padding: 5px",disabled:true,labelWidth:1,initComponent:function(){Deluge.add.OptionsTab.superclass.initComponent.call(this);this.optionsManager=new Deluge.MultiOptionsManager();var a=this.add({xtype:"fieldset",title:_("Download Location"),border:false,autoHeight:true,defaultType:"textfield",labelWidth:1,fieldLabel:"",style:"padding-bottom: 5px; margin-bottom: 0px;"});this.optionsManager.bind("download_location",a.add({fieldLabel:"",name:"download_location",width:400,labelSeparator:""}));var b=this.add({border:false,layout:"column",defaultType:"fieldset"});a=b.add({title:_("Allocation"),border:false,autoHeight:true,defaultType:"radio",width:100});this.optionsManager.bind("compact_allocation",a.add({xtype:"radiogroup",columns:1,vertical:true,labelSeparator:"",items:[{name:"compact_allocation",value:false,inputValue:false,boxLabel:_("Full"),fieldLabel:"",labelSeparator:""},{name:"compact_allocation",value:true,inputValue:true,boxLabel:_("Compact"),fieldLabel:"",labelSeparator:""}]}));a=b.add({title:_("Bandwidth"),border:false,autoHeight:true,labelWidth:100,width:200,defaultType:"spinnerfield"});this.optionsManager.bind("max_download_speed",a.add({fieldLabel:_("Max Down Speed"),labelStyle:"margin-left: 10px",name:"max_download_speed",width:60}));this.optionsManager.bind("max_upload_speed",a.add({fieldLabel:_("Max Up Speed"),labelStyle:"margin-left: 10px",name:"max_upload_speed",width:60}));this.optionsManager.bind("max_connections",a.add({fieldLabel:_("Max Connections"),labelStyle:"margin-left: 10px",name:"max_connections",width:60}));this.optionsManager.bind("max_upload_slots",a.add({fieldLabel:_("Max Upload Slots"),labelStyle:"margin-left: 10px",name:"max_upload_slots",width:60}));a=b.add({title:_("General"),border:false,autoHeight:true,defaultType:"checkbox"});this.optionsManager.bind("add_paused",a.add({name:"add_paused",boxLabel:_("Add In Paused State"),fieldLabel:"",labelSeparator:""}));this.optionsManager.bind("prioritize_first_last_pieces",a.add({name:"prioritize_first_last_pieces",boxLabel:_("Prioritize First/Last Pieces"),fieldLabel:"",labelSeparator:""}))},getDefaults:function(){var a=["add_paused","compact_allocation","download_location","max_connections_per_torrent","max_download_speed_per_torrent","max_upload_slots_per_torrent","max_upload_speed_per_torrent","prioritize_first_last_pieces"];deluge.client.core.get_config_values(a,{success:function(c){var b={file_priorities:[],add_paused:c.add_paused,compact_allocation:c.compact_allocation,download_location:c.download_location,max_connections:c.max_connections_per_torrent,max_download_speed:c.max_download_speed_per_torrent,max_upload_slots:c.max_upload_slots_per_torrent,max_upload_speed:c.max_upload_speed_per_torrent,prioritize_first_last_pieces:c.prioritize_first_last_pieces};this.optionsManager.options=b;this.optionsManager.resetAll()},scope:this})}}); +Ext.ns("Deluge.add");Deluge.add.OptionsTab=Ext.extend(Ext.form.FormPanel,{title:_("Options"),height:170,border:false,bodyStyle:"padding: 5px",disabled:true,labelWidth:1,initComponent:function(){Deluge.add.OptionsTab.superclass.initComponent.call(this);this.optionsManager=new Deluge.MultiOptionsManager();var a=this.add({xtype:"fieldset",title:_("Download Location"),border:false,autoHeight:true,defaultType:"textfield",labelWidth:1,fieldLabel:"",style:"padding-bottom: 5px; margin-bottom: 0px;"});this.optionsManager.bind("download_location",a.add({fieldLabel:"",name:"download_location",width:400,labelSeparator:""}));var b=this.add({border:false,layout:"column",defaultType:"fieldset"});a=b.add({title:_("Allocation"),border:false,autoHeight:true,defaultType:"radio",});this.optionsManager.bind("compact_allocation",a.add({xtype:"radiogroup",columns:1,vertical:true,labelSeparator:"",width:80,items:[{name:"compact_allocation",value:false,inputValue:false,boxLabel:_("Full"),fieldLabel:"",labelSeparator:""},{name:"compact_allocation",value:true,inputValue:true,boxLabel:_("Compact"),fieldLabel:"",labelSeparator:""}]}));a=b.add({title:_("Bandwidth"),border:false,autoHeight:true,bodyStyle:"margin-left: 7px",labelWidth:105,width:200,defaultType:"spinnerfield"});this.optionsManager.bind("max_download_speed",a.add({fieldLabel:_("Max Down Speed"),name:"max_download_speed",width:60}));this.optionsManager.bind("max_upload_speed",a.add({fieldLabel:_("Max Up Speed"),name:"max_upload_speed",width:60}));this.optionsManager.bind("max_connections",a.add({fieldLabel:_("Max Connections"),name:"max_connections",width:60}));this.optionsManager.bind("max_upload_slots",a.add({fieldLabel:_("Max Upload Slots"),name:"max_upload_slots",width:60}));a=b.add({title:_("General"),border:false,autoHeight:true,defaultType:"checkbox"});this.optionsManager.bind("add_paused",a.add({name:"add_paused",boxLabel:_("Add In Paused State"),fieldLabel:"",labelSeparator:""}));this.optionsManager.bind("prioritize_first_last_pieces",a.add({name:"prioritize_first_last_pieces",boxLabel:_("Prioritize First/Last Pieces"),fieldLabel:"",labelSeparator:""}))},getDefaults:function(){var a=["add_paused","compact_allocation","download_location","max_connections_per_torrent","max_download_speed_per_torrent","max_upload_slots_per_torrent","max_upload_speed_per_torrent","prioritize_first_last_pieces"];deluge.client.core.get_config_values(a,{success:function(c){var b={file_priorities:[],add_paused:c.add_paused,compact_allocation:c.compact_allocation,download_location:c.download_location,max_connections:c.max_connections_per_torrent,max_download_speed:c.max_download_speed_per_torrent,max_upload_slots:c.max_upload_slots_per_torrent,max_upload_speed:c.max_upload_speed_per_torrent,prioritize_first_last_pieces:c.prioritize_first_last_pieces};this.optionsManager.options=b;this.optionsManager.resetAll()},scope:this})}}); /* * Deluge.add.UrlWindow.js * @@ -509,7 +509,7 @@ Ext.ns("Deluge.add");Deluge.add.OptionsTab=Ext.extend(Ext.form.FormPanel,{title: * 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.add");Deluge.add.UrlWindow=Ext.extend(Deluge.add.Window,{title:_("Add from Url"),modal:true,plain:true,layout:"fit",width:350,height:155,buttonAlign:"center",closeAction:"hide",bodyStyle:"padding: 10px 5px;",iconCls:"x-deluge-add-url-window-icon",initComponent:function(){Deluge.add.UrlWindow.superclass.initComponent.call(this);this.addButton(_("Add"),this.onAddClick,this);var a=this.add({xtype:"form",defaultType:"textfield",baseCls:"x-plain",labelWidth:55});this.urlField=a.add({fieldLabel:_("Url"),id:"url",name:"url",width:"97%"});this.urlField.on("specialkey",this.onAdd,this);this.cookieField=a.add({fieldLabel:_("Cookies"),id:"cookies",name:"cookies",width:"97%"});this.cookieField.on("specialkey",this.onAdd,this)},onAddClick:function(f,d){if((f.id=="url"||f.id=="cookies")&&d.getKey()!=d.ENTER){return}var f=this.urlField;var b=f.getValue();var c=this.cookieField.getValue();var a=this.createTorrentId();if(b.substring(0,20)=="magnet:?xt=urn:btih:"){deluge.client.web.get_magnet_info(b,{success:this.onGotInfo,scope:this,filename:b,torrentId:a})}else{deluge.client.web.download_torrent_from_url(b,c,{success:this.onDownload,scope:this,torrentId:a})}this.hide();this.urlField.setValue("");this.fireEvent("beforeadd",a,b)},onDownload:function(a,c,d,b){deluge.client.web.get_torrent_info(a,{success:this.onGotInfo,scope:this,filename:a,torrentId:b.options.torrentId})},onGotInfo:function(d,c,a,b){d.filename=b.options.filename;this.fireEvent("add",b.options.torrentId,d)}}); +Ext.namespace("Deluge.add");Deluge.add.UrlWindow=Ext.extend(Deluge.add.Window,{title:_("Add from Url"),modal:true,plain:true,layout:"fit",width:350,height:155,buttonAlign:"center",closeAction:"hide",bodyStyle:"padding: 10px 5px;",iconCls:"x-deluge-add-url-window-icon",initComponent:function(){Deluge.add.UrlWindow.superclass.initComponent.call(this);this.addButton(_("Add"),this.onAddClick,this);var a=this.add({xtype:"form",defaultType:"textfield",baseCls:"x-plain",labelWidth:55});this.urlField=a.add({fieldLabel:_("Url"),id:"url",name:"url",width:"97%"});this.urlField.on("specialkey",this.onAdd,this);this.cookieField=a.add({fieldLabel:_("Cookies"),id:"cookies",name:"cookies",width:"97%"});this.cookieField.on("specialkey",this.onAdd,this)},onAddClick:function(f,d){if((f.id=="url"||f.id=="cookies")&&d.getKey()!=d.ENTER){return}var f=this.urlField;var b=f.getValue();var c=this.cookieField.getValue();var a=this.createTorrentId();if(b.indexOf("magnet:?")==0&&b.indexOf("xt=urn:btih")>-1){deluge.client.web.get_magnet_info(b,{success:this.onGotInfo,scope:this,filename:b,torrentId:a})}else{deluge.client.web.download_torrent_from_url(b,c,{success:this.onDownload,scope:this,torrentId:a})}this.hide();this.urlField.setValue("");this.fireEvent("beforeadd",a,b)},onDownload:function(a,c,d,b){deluge.client.web.get_torrent_info(a,{success:this.onGotInfo,scope:this,filename:a,torrentId:b.options.torrentId})},onGotInfo:function(d,c,a,b){d.filename=b.options.filename;this.fireEvent("add",b.options.torrentId,d)}}); /* * Deluge.preferences.BandwidthPage.js * @@ -1117,7 +1117,7 @@ Ext.ns("Deluge");Deluge.AddTrackerWindow=Ext.extend(Ext.Window,{title:_("Add Tra * 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");Ext.ux.util.RpcClient=Ext.extend(Ext.util.Observable,{_components:[],_methods:[],_requests:{},_url:null,_optionKeys:["scope","success","failure"],constructor:function(a){Ext.ux.util.RpcClient.superclass.constructor.call(this,a);this._url=a.url||null;this._id=0;this.addEvents("connected","error");this.reloadMethods()},reloadMethods:function(){Ext.each(this._components,function(a){delete this[a]},this);this._execute("system.listMethods",{success:this._setMethods,scope:this})},_execute:function(c,a){a=a||{};a.params=a.params||[];a.id=this._id;var b=Ext.encode({method:c,params:a.params,id:a.id});this._id++;return Ext.Ajax.request({url:this._url,method:"POST",success:this._onSuccess,failure:this._onFailure,scope:this,jsonData:b,options:a})},_onFailure:function(b,a){var c=a.options;errorObj={id:c.id,result:null,error:{msg:"HTTP: "+b.status+" "+b.statusText,code:255}};this.fireEvent("error",errorObj,b,a);if(Ext.type(c.failure)!="function"){return}if(c.scope){c.failure.call(c.scope,errorObj,b,a)}else{c.failure(errorObj,b,a)}},_onSuccess:function(c,a){var b=Ext.decode(c.responseText);var d=a.options;if(b.error){this.fireEvent("error",b,c,a);if(Ext.type(d.failure)!="function"){return}if(d.scope){d.failure.call(d.scope,b,c,a)}else{d.failure(b,c,a)}}else{if(Ext.type(d.success)!="function"){return}if(d.scope){d.success.call(d.scope,b.result,b,c,a)}else{d.success(b.result,b,c,a)}}},_parseArgs:function(c){var e=[];Ext.each(c,function(f){e.push(f)});var b=e[e.length-1];if(Ext.type(b)=="object"){var d=Ext.keys(b),a=false;Ext.each(this._optionKeys,function(f){if(d.indexOf(f)>-1){a=true}});if(a){e.remove(b)}else{b={}}}else{b={}}b.params=e;return b},_setMethods:function(b){var d={},a=this;Ext.each(b,function(h){var g=h.split(".");var e=d[g[0]]||{};var f=function(){var i=a._parseArgs(arguments);return a._execute(h,i)};e[g[1]]=f;d[g[0]]=e});for(var c in d){a[c]=d[c]}this._components=Ext.keys(d);this.fireEvent("connected",this)}}); +Ext.namespace("Ext.ux.util");Ext.ux.util.RpcClient=Ext.extend(Ext.util.Observable,{_components:[],_methods:[],_requests:{},_url:null,_optionKeys:["scope","success","failure"],constructor:function(a){Ext.ux.util.RpcClient.superclass.constructor.call(this,a);this._url=a.url||null;this._id=0;this.addEvents("connected","error");this.reloadMethods()},reloadMethods:function(){this._execute("system.listMethods",{success:this._setMethods,scope:this})},_execute:function(c,a){a=a||{};a.params=a.params||[];a.id=this._id;var b=Ext.encode({method:c,params:a.params,id:a.id});this._id++;return Ext.Ajax.request({url:this._url,method:"POST",success:this._onSuccess,failure:this._onFailure,scope:this,jsonData:b,options:a})},_onFailure:function(b,a){var c=a.options;errorObj={id:c.id,result:null,error:{msg:"HTTP: "+b.status+" "+b.statusText,code:255}};this.fireEvent("error",errorObj,b,a);if(Ext.type(c.failure)!="function"){return}if(c.scope){c.failure.call(c.scope,errorObj,b,a)}else{c.failure(errorObj,b,a)}},_onSuccess:function(c,a){var b=Ext.decode(c.responseText);var d=a.options;if(b.error){this.fireEvent("error",b,c,a);if(Ext.type(d.failure)!="function"){return}if(d.scope){d.failure.call(d.scope,b,c,a)}else{d.failure(b,c,a)}}else{if(Ext.type(d.success)!="function"){return}if(d.scope){d.success.call(d.scope,b.result,b,c,a)}else{d.success(b.result,b,c,a)}}},_parseArgs:function(c){var e=[];Ext.each(c,function(f){e.push(f)});var b=e[e.length-1];if(Ext.type(b)=="object"){var d=Ext.keys(b),a=false;Ext.each(this._optionKeys,function(f){if(d.indexOf(f)>-1){a=true}});if(a){e.remove(b)}else{b={}}}else{b={}}b.params=e;return b},_setMethods:function(b){var d={},a=this;Ext.each(b,function(h){var g=h.split(".");var e=d[g[0]]||{};var f=function(){var i=a._parseArgs(arguments);return a._execute(h,i)};e[g[1]]=f;d[g[0]]=e});for(var c in d){a[c]=d[c]}Ext.each(this._components,function(e){if(!e in d){delete this[e]}},this);this._components=Ext.keys(d);this.fireEvent("connected",this)}}); /* * Deluge.ConnectionManager.js * @@ -1277,7 +1277,7 @@ Ext.ns("Deluge");Deluge.EditTrackersWindow=Ext.extend(Ext.Window,{title:_("Edit * 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.EventsManager=Ext.extend(Ext.util.Observable,{constructor:function(){this.toRegister=[];this.on("login",this.onLogin,this);Deluge.EventsManager.superclass.constructor.call(this)},addListener:function(a,c,b,d){this.addEvents(a);if(/[A-Z]/.test(a.substring(0,1))){if(!deluge.client){this.toRegister.push(a)}else{deluge.client.web.register_event_listener(a)}}Deluge.EventsManager.superclass.addListener.call(this,a,c,b,d)},getEvents:function(){deluge.client.web.get_events({success:this.onGetEventsSuccess,failure:this.onGetEventsFailure,scope:this})},start:function(){Ext.each(this.toRegister,function(a){deluge.client.web.register_event_listener(a)});this.running=true;this.errorCount=0;this.getEvents()},stop:function(){this.running=false},onLogin:function(){this.start()},onGetEventsSuccess:function(a){if(!a){return}Ext.each(a,function(d){var c=d[0],b=d[1];b.splice(0,0,c);this.fireEvent.apply(this,b)},this);if(this.running){this.getEvents()}},onGetEventsFailure:function(a,b){if(!this.running){return}if(!b.isTimeout&&this.errorCount++>=3){this.stop();return}this.getEvents()}});Deluge.EventsManager.prototype.on=Deluge.EventsManager.prototype.addListener;Deluge.EventsManager.prototype.fire=Deluge.EventsManager.prototype.fireEvent;deluge.events=new Deluge.EventsManager(); +Deluge.EventsManager=Ext.extend(Ext.util.Observable,{constructor:function(){this.toRegister=[];this.on("login",this.onLogin,this);Deluge.EventsManager.superclass.constructor.call(this)},addListener:function(a,c,b,d){this.addEvents(a);if(/[A-Z]/.test(a.substring(0,1))){if(!deluge.client){this.toRegister.push(a)}else{deluge.client.web.register_event_listener(a)}}Deluge.EventsManager.superclass.addListener.call(this,a,c,b,d)},getEvents:function(){deluge.client.web.get_events({success:this.onGetEventsSuccess,failure:this.onGetEventsFailure,scope:this})},start:function(){Ext.each(this.toRegister,function(a){deluge.client.web.register_event_listener(a)});this.running=true;this.errorCount=0;this.getEvents()},stop:function(){this.running=false},onLogin:function(){this.start()},onGetEventsSuccess:function(a){if(!this.running){return}if(a){Ext.each(a,function(d){var c=d[0],b=d[1];b.splice(0,0,c);this.fireEvent.apply(this,b)},this)}this.getEvents()},onGetEventsFailure:function(a,b){if(!this.running){return}if(!b.isTimeout&&this.errorCount++>=3){this.stop();return}this.getEvents()}});Deluge.EventsManager.prototype.on=Deluge.EventsManager.prototype.addListener;Deluge.EventsManager.prototype.fire=Deluge.EventsManager.prototype.fireEvent;deluge.events=new Deluge.EventsManager(); /* * Deluge.FileBrowser.js * @@ -1469,7 +1469,7 @@ Deluge.LoginWindow=Ext.extend(Ext.Window,{firstShow:true,bodyStyle:"padding: 10p * 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.menus={onTorrentAction:function(b,d){var a=deluge.torrents.getSelectedIds();var c=b.initialConfig.torrentAction;switch(c){case"pause":case"resume":deluge.client.core[c+"_torrent"](a,{success:function(){deluge.ui.update()}});break;case"top":case"up":case"down":case"bottom":deluge.client.core["queue_"+c](a,{success:function(){deluge.ui.update()}});break;case"edit_trackers":deluge.editTrackers.show();break;case"update":deluge.client.core.force_reannounce(a,{success:function(){deluge.ui.update()}});break;case"remove":deluge.removeWindow.show(a);break;case"recheck":deluge.client.core.force_recheck(a,{success:function(){deluge.ui.update()}});break;case"move":deluge.moveStorage.show(a);break}}};deluge.menus.torrent=new Ext.menu.Menu({id:"torrentMenu",items:[{torrentAction:"pause",text:_("Pause"),iconCls:"icon-pause",handler:deluge.menus.onTorrentAction,scope:deluge.menus},{torrentAction:"resume",text:_("Resume"),iconCls:"icon-resume",handler:deluge.menus.onTorrentAction,scope:deluge.menus},"-",{text:_("Options"),iconCls:"icon-options",menu:new Ext.menu.Menu({items:[{text:_("D/L Speed Limit"),iconCls:"x-deluge-downloading",menu:new Ext.menu.Menu({items:[{text:_("5 KiB/s")},{text:_("10 KiB/s")},{text:_("30 KiB/s")},{text:_("80 KiB/s")},{text:_("300 KiB/s")},{text:_("Unlimited")}]})},{text:_("U/L Speed Limit"),iconCls:"x-deluge-seeding",menu:new Ext.menu.Menu({items:[{text:_("5 KiB/s")},{text:_("10 KiB/s")},{text:_("30 KiB/s")},{text:_("80 KiB/s")},{text:_("300 KiB/s")},{text:_("Unlimited")}]})},{text:_("Connection Limit"),iconCls:"x-deluge-connections",menu:new Ext.menu.Menu({items:[{text:_("50")},{text:_("100")},{text:_("200")},{text:_("300")},{text:_("500")},{text:_("Unlimited")}]})},{text:_("Upload Slot Limit"),iconCls:"icon-upload-slots",menu:new Ext.menu.Menu({items:[{text:_("0")},{text:_("1")},{text:_("2")},{text:_("3")},{text:_("5")},{text:_("Unlimited")}]})},{id:"auto_managed",text:_("Auto Managed"),checked:false}]})},"-",{text:_("Queue"),iconCls:"icon-queue",menu:new Ext.menu.Menu({items:[{torrentAction:"top",text:_("Top"),iconCls:"icon-top",handler:deluge.menus.onTorrentAction,scope:deluge.menus},{torrentAction:"up",text:_("Up"),iconCls:"icon-up",handler:deluge.menus.onTorrentAction,scope:deluge.menus},{torrentAction:"down",text:_("Down"),iconCls:"icon-down",handler:deluge.menus.onTorrentAction,scope:deluge.menus},{torrentAction:"bottom",text:_("Bottom"),iconCls:"icon-bottom",handler:deluge.menus.onTorrentAction,scope:deluge.menus}]})},"-",{torrentAction:"update",text:_("Update Tracker"),iconCls:"icon-update-tracker",handler:deluge.menus.onTorrentAction,scope:deluge.menus},{torrentAction:"edit_trackers",text:_("Edit Trackers"),iconCls:"icon-edit-trackers",handler:deluge.menus.onTorrentAction,scope:deluge.menus},"-",{torrentAction:"remove",text:_("Remove Torrent"),iconCls:"icon-remove",handler:deluge.menus.onTorrentAction,scope:deluge.menus},"-",{torrentAction:"recheck",text:_("Force Recheck"),iconCls:"icon-recheck",handler:deluge.menus.onTorrentAction,scope:deluge.menus},{torrentAction:"move",text:_("Move Storage"),iconCls:"icon-move",handler:deluge.menus.onTorrentAction,scope:deluge.menus}]});deluge.menus.filePriorities=new Ext.menu.Menu({id:"filePrioritiesMenu",items:[{id:"expandAll",text:_("Expand All"),iconCls:"icon-expand-all"},"-",{id:"no_download",text:_("Do Not Download"),iconCls:"icon-do-not-download",filePriority:FILE_PRIORITY["Do Not Download"]},{id:"normal",text:_("Normal Priority"),iconCls:"icon-normal",filePriority:FILE_PRIORITY["Normal Priority"]},{id:"high",text:_("High Priority"),iconCls:"icon-high",filePriority:FILE_PRIORITY["High Priority"]},{id:"highest",text:_("Highest Priority"),iconCls:"icon-highest",filePriority:FILE_PRIORITY["Highest Priority"]}]}); +deluge.menus={onTorrentAction:function(b,d){var a=deluge.torrents.getSelectedIds();var c=b.initialConfig.torrentAction;switch(c){case"pause":case"resume":deluge.client.core[c+"_torrent"](a,{success:function(){deluge.ui.update()}});break;case"top":case"up":case"down":case"bottom":deluge.client.core["queue_"+c](a,{success:function(){deluge.ui.update()}});break;case"edit_trackers":deluge.editTrackers.show();break;case"update":deluge.client.core.force_reannounce(a,{success:function(){deluge.ui.update()}});break;case"remove":deluge.removeWindow.show(a);break;case"recheck":deluge.client.core.force_recheck(a,{success:function(){deluge.ui.update()}});break;case"move":deluge.moveStorage.show(a);break}}};deluge.menus.torrent=new Ext.menu.Menu({id:"torrentMenu",items:[{torrentAction:"pause",text:_("Pause"),iconCls:"icon-pause",handler:deluge.menus.onTorrentAction,scope:deluge.menus},{torrentAction:"resume",text:_("Resume"),iconCls:"icon-resume",handler:deluge.menus.onTorrentAction,scope:deluge.menus},"-",{text:_("Options"),iconCls:"icon-options",hideOnClick:false,menu:new Ext.menu.Menu({items:[{text:_("D/L Speed Limit"),iconCls:"x-deluge-downloading",hideOnClick:false,menu:new Ext.menu.Menu({items:[{text:_("5 KiB/s")},{text:_("10 KiB/s")},{text:_("30 KiB/s")},{text:_("80 KiB/s")},{text:_("300 KiB/s")},{text:_("Unlimited")}]})},{text:_("U/L Speed Limit"),iconCls:"x-deluge-seeding",hideOnClick:false,menu:new Ext.menu.Menu({items:[{text:_("5 KiB/s")},{text:_("10 KiB/s")},{text:_("30 KiB/s")},{text:_("80 KiB/s")},{text:_("300 KiB/s")},{text:_("Unlimited")}]})},{text:_("Connection Limit"),iconCls:"x-deluge-connections",hideOnClick:false,menu:new Ext.menu.Menu({items:[{text:_("50")},{text:_("100")},{text:_("200")},{text:_("300")},{text:_("500")},{text:_("Unlimited")}]})},{text:_("Upload Slot Limit"),iconCls:"icon-upload-slots",hideOnClick:false,menu:new Ext.menu.Menu({items:[{text:_("0")},{text:_("1")},{text:_("2")},{text:_("3")},{text:_("5")},{text:_("Unlimited")}]})},{id:"auto_managed",text:_("Auto Managed"),checked:false}]})},"-",{text:_("Queue"),iconCls:"icon-queue",hideOnClick:false,menu:new Ext.menu.Menu({items:[{torrentAction:"top",text:_("Top"),iconCls:"icon-top",handler:deluge.menus.onTorrentAction,scope:deluge.menus},{torrentAction:"up",text:_("Up"),iconCls:"icon-up",handler:deluge.menus.onTorrentAction,scope:deluge.menus},{torrentAction:"down",text:_("Down"),iconCls:"icon-down",handler:deluge.menus.onTorrentAction,scope:deluge.menus},{torrentAction:"bottom",text:_("Bottom"),iconCls:"icon-bottom",handler:deluge.menus.onTorrentAction,scope:deluge.menus}]})},"-",{torrentAction:"update",text:_("Update Tracker"),iconCls:"icon-update-tracker",handler:deluge.menus.onTorrentAction,scope:deluge.menus},{torrentAction:"edit_trackers",text:_("Edit Trackers"),iconCls:"icon-edit-trackers",handler:deluge.menus.onTorrentAction,scope:deluge.menus},"-",{torrentAction:"remove",text:_("Remove Torrent"),iconCls:"icon-remove",handler:deluge.menus.onTorrentAction,scope:deluge.menus},"-",{torrentAction:"recheck",text:_("Force Recheck"),iconCls:"icon-recheck",handler:deluge.menus.onTorrentAction,scope:deluge.menus},{torrentAction:"move",text:_("Move Storage"),iconCls:"icon-move",handler:deluge.menus.onTorrentAction,scope:deluge.menus}]});deluge.menus.filePriorities=new Ext.menu.Menu({id:"filePrioritiesMenu",items:[{id:"expandAll",text:_("Expand All"),iconCls:"icon-expand-all"},"-",{id:"no_download",text:_("Do Not Download"),iconCls:"icon-do-not-download",filePriority:FILE_PRIORITY["Do Not Download"]},{id:"normal",text:_("Normal Priority"),iconCls:"icon-normal",filePriority:FILE_PRIORITY["Normal Priority"]},{id:"high",text:_("High Priority"),iconCls:"icon-high",filePriority:FILE_PRIORITY["High Priority"]},{id:"highest",text:_("Highest Priority"),iconCls:"icon-highest",filePriority:FILE_PRIORITY["Highest Priority"]}]}); /* * Deluge.MoveStorage.js * @@ -1597,7 +1597,7 @@ Ext.ns("Deluge");Deluge.OtherLimitWindow=Ext.extend(Ext.Window,{layout:"fit",wid * 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");Deluge.Plugin=Ext.extend(Ext.util.Observable,{name:null,constructor:function(a){this.isDelugePlugin=true;this.addEvents({enabled:true,disabled:true});Deluge.Plugin.superclass.constructor.call(this,a)},disable:function(){this.fireEvent("disabled",this);if(this.onDisable){this.onDisable()}},enable:function(){this.fireEvent("enable",this);if(this.onEnable){this.onEnable()}},registerTorrentStatus:function(b,f,a){a=a||{};var e=a.colCfg||{},d=a.storeCfg||{};d=Ext.apply(d,{name:b});deluge.torrents.meta.fields.push(d);deluge.torrents.getStore().reader.onMetaChange(deluge.torrents.meta);e=Ext.apply(e,{header:f,dataIndex:b});var c=deluge.torrents.columns.slice(0);c.push(e);deluge.torrents.colModel.setConfig(c);deluge.torrents.columns=c;Deluge.Keys.Grid.push(b);deluge.torrents.getView().refresh(true)},deregisterTorrentStatus:function(b){var a=[];Ext.each(deluge.torrents.meta.fields,function(e){if(e.name!=b){a.push(e)}});deluge.torrents.meta.fields=a;deluge.torrents.getStore().reader.onMetaChange(deluge.torrents.meta);var d=[];Ext.each(deluge.torrents.columns,function(e){if(e.dataIndex!=b){d.push(e)}});deluge.torrents.colModel.setConfig(d);deluge.torrents.columns=d;var c=[];Ext.each(Deluge.Keys.Grid,function(e){if(e==b){c.push(e)}});Deluge.Keys.Grid=c;deluge.torrents.getView().refresh(true)}});Ext.ns("Deluge.plugins"); +Ext.ns("Deluge");Deluge.Plugin=Ext.extend(Ext.util.Observable,{name:null,constructor:function(a){this.isDelugePlugin=true;this.addEvents({enabled:true,disabled:true});Deluge.Plugin.superclass.constructor.call(this,a)},disable:function(){this.fireEvent("disabled",this);if(this.onDisable){this.onDisable()}},enable:function(){deluge.client.reloadMethods();this.fireEvent("enable",this);if(this.onEnable){this.onEnable()}},registerTorrentStatus:function(b,f,a){a=a||{};var e=a.colCfg||{},d=a.storeCfg||{};d=Ext.apply(d,{name:b});deluge.torrents.meta.fields.push(d);deluge.torrents.getStore().reader.onMetaChange(deluge.torrents.meta);e=Ext.apply(e,{header:f,dataIndex:b});var c=deluge.torrents.columns.slice(0);c.push(e);deluge.torrents.colModel.setConfig(c);deluge.torrents.columns=c;Deluge.Keys.Grid.push(b);deluge.torrents.getView().refresh(true)},deregisterTorrentStatus:function(b){var a=[];Ext.each(deluge.torrents.meta.fields,function(e){if(e.name!=b){a.push(e)}});deluge.torrents.meta.fields=a;deluge.torrents.getStore().reader.onMetaChange(deluge.torrents.meta);var d=[];Ext.each(deluge.torrents.columns,function(e){if(e.dataIndex!=b){d.push(e)}});deluge.torrents.colModel.setConfig(d);deluge.torrents.columns=d;var c=[];Ext.each(Deluge.Keys.Grid,function(e){if(e==b){c.push(e)}});Deluge.Keys.Grid=c;deluge.torrents.getView().refresh(true)}});Ext.ns("Deluge.plugins"); /* * Deluge.RemoveWindow.js * @@ -1789,4 +1789,4 @@ Deluge.Toolbar=Ext.extend(Ext.Toolbar,{constructor:function(a){a=Ext.apply({item * 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.ui={errorCount:0,filters:null,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();this.detailsPanel=new Ext.Panel({id:"detailsPanel",cls:"detailsPanel",region:"south",split:true,height:215,minSize:100,collapsible:true,margins:"0 5 5 5",cmargins:"0 5 5 5",layout:"fit",items:[deluge.details],});this.MainPanel=new Ext.Panel({id:"mainPanel",iconCls:"x-deluge-main-panel",layout:"border",border:false,tbar:deluge.toolbar,items:[deluge.sidebar,this.detailsPanel,deluge.torrents],bbar:deluge.statusbar});this.Viewport=new Ext.Viewport({layout:"fit",items:[this.MainPanel]});deluge.events.on("connect",this.onConnect,this);deluge.events.on("disconnect",this.onDisconnect,this);deluge.events.on("PluginDisabledEvent",this.onPluginDisabled,this);deluge.events.on("PluginEnabledEvent",this.onPluginEnabled,this);deluge.client=new Ext.ux.util.RpcClient({url:deluge.config.base+"json"});for(var a in Deluge.pluginStore){a=Deluge.createPlugin(a);a.enable();deluge.plugins[a.name]=a}Ext.QuickTips.init();deluge.client.on("connected",function(b){deluge.login.show()},this,{single:true});this.update=this.update.createDelegate(this);this.checkConnection=this.checkConnection.createDelegate(this);this.originalTitle=document.title},checkConnection:function(){deluge.client.web.connected({success:this.onConnectionSuccess,failure:this.onConnectionError,scope:this})},update:function(){var a=deluge.sidebar.getFilterStates();this.oldFilters=this.filters;this.filters=a;deluge.client.web.update_ui(Deluge.Keys.Grid,a,{success:this.onUpdate,failure:this.onUpdateError,scope:this});deluge.details.update()},onConnectionError:function(a){},onConnectionSuccess:function(a){deluge.statusbar.setStatus({iconCls:"x-deluge-statusbar icon-ok",text:_("Connection restored")});clearInterval(this.checking);if(!a){deluge.connectionManager.show()}},onUpdateError:function(a){if(this.errorCount==2){Ext.MessageBox.show({title:"Lost Connection",msg:"The connection to the webserver has been lost!",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.ERROR});deluge.events.fire("disconnect");deluge.statusbar.setStatus({text:"Lost connection to webserver"});this.checking=setInterval(this.checkConnection,2000)}this.errorCount++},onUpdate:function(a){if(!a.connected){deluge.connectionManager.disconnect(true);return}if(deluge.config.show_session_speed){document.title="D: "+fsize_short(a.stats.download_rate,true)+" U: "+fsize_short(a.stats.upload_rate,true)+" - "+this.originalTitle}if(Ext.areObjectsEqual(this.filters,this.oldFilters)){deluge.torrents.update(a.torrents)}else{deluge.torrents.update(a.torrents,true)}deluge.statusbar.update(a.stats);deluge.sidebar.update(a.filters);this.errorCount=0},onConnect:function(){if(!this.running){this.running=setInterval(this.update,2000);this.update()}deluge.client.web.get_plugins({success:this.onGotPlugins,scope:this})},onDisconnect:function(){this.stop()},onGotPlugins:function(a){Ext.each(a.enabled_plugins,function(b){if(deluge.plugins[b]){return}deluge.client.web.get_plugin_resources(b,{success:this.onGotPluginResources,scope:this})},this)},onPluginEnabled:function(a){if(deluge.plugins[a]){deluge.plugins[a].enable()}else{deluge.client.web.get_plugin_resources(a,{success:this.onGotPluginResources,scope:this})}},onGotPluginResources:function(b){var a=(Deluge.debug)?b.debug_scripts:b.scripts;Ext.each(a,function(c){Ext.ux.JSLoader({url:deluge.config.base+c,onLoad:this.onPluginLoaded,pluginName:b.name})},this)},onPluginDisabled:function(a){deluge.plugins[a].disable()},onPluginLoaded:function(a){if(!Deluge.hasPlugin(a.pluginName)){return}plugin=Deluge.createPlugin(a.pluginName);plugin.enable();deluge.plugins[plugin.name]=plugin},stop:function(){if(this.running){clearInterval(this.running);this.running=false;deluge.torrents.getStore().removeAll()}}};Ext.onReady(function(a){deluge.ui.initialize()}); \ No newline at end of file +deluge.ui={errorCount:0,filters:null,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();this.detailsPanel=new Ext.Panel({id:"detailsPanel",cls:"detailsPanel",region:"south",split:true,height:215,minSize:100,collapsible:true,margins:"0 5 5 5",cmargins:"0 5 5 5",layout:"fit",items:[deluge.details],});this.MainPanel=new Ext.Panel({id:"mainPanel",iconCls:"x-deluge-main-panel",layout:"border",border:false,tbar:deluge.toolbar,items:[deluge.sidebar,this.detailsPanel,deluge.torrents],bbar:deluge.statusbar});this.Viewport=new Ext.Viewport({layout:"fit",items:[this.MainPanel]});deluge.events.on("connect",this.onConnect,this);deluge.events.on("disconnect",this.onDisconnect,this);deluge.events.on("PluginDisabledEvent",this.onPluginDisabled,this);deluge.events.on("PluginEnabledEvent",this.onPluginEnabled,this);deluge.client=new Ext.ux.util.RpcClient({url:deluge.config.base+"json"});for(var a in Deluge.pluginStore){a=Deluge.createPlugin(a);a.enable();deluge.plugins[a.name]=a}Ext.QuickTips.init();deluge.client.on("connected",function(b){deluge.login.show()},this,{single:true});this.update=this.update.createDelegate(this);this.checkConnection=this.checkConnection.createDelegate(this);this.originalTitle=document.title},checkConnection:function(){deluge.client.web.connected({success:this.onConnectionSuccess,failure:this.onConnectionError,scope:this})},update:function(){var a=deluge.sidebar.getFilterStates();this.oldFilters=this.filters;this.filters=a;deluge.client.web.update_ui(Deluge.Keys.Grid,a,{success:this.onUpdate,failure:this.onUpdateError,scope:this});deluge.details.update()},onConnectionError:function(a){},onConnectionSuccess:function(a){deluge.statusbar.setStatus({iconCls:"x-deluge-statusbar icon-ok",text:_("Connection restored")});clearInterval(this.checking);if(!a){deluge.connectionManager.show()}},onUpdateError:function(a){if(this.errorCount==2){Ext.MessageBox.show({title:"Lost Connection",msg:"The connection to the webserver has been lost!",buttons:Ext.MessageBox.OK,icon:Ext.MessageBox.ERROR});deluge.events.fire("disconnect");deluge.statusbar.setStatus({text:"Lost connection to webserver"});this.checking=setInterval(this.checkConnection,2000)}this.errorCount++},onUpdate:function(a){if(!a.connected){deluge.connectionManager.disconnect(true);return}if(deluge.config.show_session_speed){document.title="D: "+fsize_short(a.stats.download_rate,true)+" U: "+fsize_short(a.stats.upload_rate,true)+" - "+this.originalTitle}if(Ext.areObjectsEqual(this.filters,this.oldFilters)){deluge.torrents.update(a.torrents)}else{deluge.torrents.update(a.torrents,true)}deluge.statusbar.update(a.stats);deluge.sidebar.update(a.filters);this.errorCount=0},onConnect:function(){if(!this.running){this.running=setInterval(this.update,2000);this.update()}deluge.client.web.get_plugins({success:this.onGotPlugins,scope:this})},onDisconnect:function(){this.stop()},onGotPlugins:function(a){Ext.each(a.enabled_plugins,function(b){if(deluge.plugins[b]){return}deluge.client.web.get_plugin_resources(b,{success:this.onGotPluginResources,scope:this})},this)},onPluginEnabled:function(a){if(deluge.plugins[a]){deluge.plugins[a].enable()}else{deluge.client.web.get_plugin_resources(a,{success:this.onGotPluginResources,scope:this})}},onGotPluginResources:function(b){var a=(Deluge.debug)?b.debug_scripts:b.scripts;Ext.each(a,function(c){Ext.ux.JSLoader({url:deluge.config.base+c,onLoad:this.onPluginLoaded,pluginName:b.name})},this)},onPluginDisabled:function(a){if(deluge.plugins[a]){deluge.plugins[a].disable()}},onPluginLoaded:function(a){if(!Deluge.hasPlugin(a.pluginName)){return}plugin=Deluge.createPlugin(a.pluginName);plugin.enable();deluge.plugins[plugin.name]=plugin},stop:function(){if(this.running){clearInterval(this.running);this.running=false;deluge.torrents.getStore().removeAll()}}};Ext.onReady(function(a){deluge.ui.initialize()}); \ No newline at end of file