diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-24 17:38:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-24 17:38:33 +0000 |
commit | f702b50b6ac6cb2e1e0e848a629a623f323c9de2 (patch) | |
tree | 67d787608695391e5edc2eb245b3943302ba1734 /deluge/ui/web/js/deluge-all | |
parent | Releasing debian version 2.1.1-5. (diff) | |
download | deluge-f702b50b6ac6cb2e1e0e848a629a623f323c9de2.tar.xz deluge-f702b50b6ac6cb2e1e0e848a629a623f323c9de2.zip |
Merging upstream version 2.1.2~dev0+20230529.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/ui/web/js/deluge-all')
-rw-r--r-- | deluge/ui/web/js/deluge-all/ConnectionManager.js | 21 | ||||
-rw-r--r-- | deluge/ui/web/js/deluge-all/Sidebar.js | 18 | ||||
-rw-r--r-- | deluge/ui/web/js/deluge-all/UI.js | 31 | ||||
-rw-r--r-- | deluge/ui/web/js/deluge-all/details/FilesTab.js | 4 | ||||
-rw-r--r-- | deluge/ui/web/js/deluge-all/details/OptionsTab.js | 4 | ||||
-rw-r--r-- | deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js | 2 | ||||
-rw-r--r-- | deluge/ui/web/js/deluge-all/preferences/DaemonPage.js | 2 | ||||
-rw-r--r-- | deluge/ui/web/js/deluge-all/preferences/InterfacePage.js | 2 |
8 files changed, 60 insertions, 24 deletions
diff --git a/deluge/ui/web/js/deluge-all/ConnectionManager.js b/deluge/ui/web/js/deluge-all/ConnectionManager.js index 5261726..2e61e22 100644 --- a/deluge/ui/web/js/deluge-all/ConnectionManager.js +++ b/deluge/ui/web/js/deluge-all/ConnectionManager.js @@ -162,13 +162,23 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, { }, update: function () { + this.updating = setTimeout(this.update, 2000); this.list.getStore().each(function (r) { deluge.client.web.get_host_status(r.id, { - success: this.onGetHostStatus, + success: this.onUpdate, scope: this, }); }, this); }, + onUpdate: function (host) { + if (!this.isVisible()) return; + this.onGetHostStatus(host); + + if (this.updating) { + clearTimeout(this.updating); + } + this.updating = setTimeout(this.update, 2000); + }, /** * Updates the buttons in the Connection Manager UI according to the @@ -312,7 +322,10 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, { // private onHide: function () { - if (this.running) window.clearInterval(this.running); + if (this.updating) { + window.clearTimeout(this.updating); + this.updating = undefined; + } }, // private @@ -396,8 +409,8 @@ Deluge.ConnectionManager = Ext.extend(Ext.Window, { this.stopHostButton = bbar.items.get('cm-stop'); } this.loadHosts(); - if (this.running) return; - this.running = window.setInterval(this.update, 2000, this); + if (this.updating) return; + this.updating = window.setTimeout(this.update, 2000); }, // private diff --git a/deluge/ui/web/js/deluge-all/Sidebar.js b/deluge/ui/web/js/deluge-all/Sidebar.js index eb08a89..a6512b2 100644 --- a/deluge/ui/web/js/deluge-all/Sidebar.js +++ b/deluge/ui/web/js/deluge-all/Sidebar.js @@ -60,14 +60,16 @@ Deluge.Sidebar = Ext.extend(Ext.Panel, { this.doLayout(); this.panels[filter] = panel; - panel.header.on('click', function (header) { - if (!deluge.config.sidebar_multiple_filters) { - deluge.ui.update(); - } - if (!panel.list.getSelectionCount()) { - panel.list.select(0); - } - }); + if (panel.header) { + panel.header.on('click', function (header) { + if (!deluge.config.sidebar_multiple_filters) { + deluge.ui.update(); + } + if (!panel.list.getSelectionCount()) { + panel.list.select(0); + } + }); + } this.fireEvent('filtercreate', this, panel); panel.updateStates(states); diff --git a/deluge/ui/web/js/deluge-all/UI.js b/deluge/ui/web/js/deluge-all/UI.js index cc877d5..f7edc84 100644 --- a/deluge/ui/web/js/deluge-all/UI.js +++ b/deluge/ui/web/js/deluge-all/UI.js @@ -134,14 +134,24 @@ deluge.ui = { deluge.details.update(); }, - onConnectionError: function (error) {}, + onConnectionError: function (error) { + if (this.checking) { + clearTimeout(this.checking); + } + this.checking = setTimeout(this.checkConnection, 2000); + }, onConnectionSuccess: function (result) { + if (this.checking) { + clearTimeout(this.checking); + this.checking = undefined; + } + this.running = setTimeout(this.update, 2000); + this.update(); deluge.statusbar.setStatus({ iconCls: 'x-deluge-statusbar icon-ok', text: _('Connection restored'), }); - clearInterval(this.checking); if (!result) { deluge.connectionManager.show(); } @@ -159,9 +169,13 @@ deluge.ui = { deluge.statusbar.setStatus({ text: _('Lost connection to webserver'), }); - this.checking = setInterval(this.checkConnection, 2000); + this.checking = setTimeout(this.checkConnection, 2000); } this.errorCount++; + if (this.running) { + clearTimeout(this.running); + this.running = undefined; + } }, /** @@ -170,10 +184,15 @@ deluge.ui = { * Updates the various components in the interface. */ onUpdate: function (data) { + if (this.running) { + clearTimeout(this.running); + this.running = undefined; + } if (!data['connected']) { deluge.connectionManager.disconnect(true); return; } + this.running = setTimeout(this.update, 2000); if (deluge.config.show_session_speed) { document.title = @@ -201,7 +220,7 @@ deluge.ui = { */ onConnect: function () { if (!this.running) { - this.running = setInterval(this.update, 2000); + this.running = setTimeout(this.update, 2000); this.update(); } deluge.client.web.get_plugins({ @@ -280,8 +299,8 @@ deluge.ui = { */ stop: function () { if (this.running) { - clearInterval(this.running); - this.running = false; + clearTimeout(this.running); + this.running = undefined; deluge.torrents.getStore().removeAll(); } }, diff --git a/deluge/ui/web/js/deluge-all/details/FilesTab.js b/deluge/ui/web/js/deluge-all/details/FilesTab.js index 60de832..36ef968 100644 --- a/deluge/ui/web/js/deluge-all/details/FilesTab.js +++ b/deluge/ui/web/js/deluge-all/details/FilesTab.js @@ -214,7 +214,9 @@ Deluge.details.FilesTab = Ext.extend(Ext.ux.tree.TreeGrid, { { success: function () { Ext.each(nodes, function (node) { - node.setColumnValue(3, baseItem.filePriority); + node.attributes.priority = + baseItem.filePriority; + node.ui.updateColumns(); }); }, scope: this, diff --git a/deluge/ui/web/js/deluge-all/details/OptionsTab.js b/deluge/ui/web/js/deluge-all/details/OptionsTab.js index 7e59cba..f8a08be 100644 --- a/deluge/ui/web/js/deluge-all/details/OptionsTab.js +++ b/deluge/ui/web/js/deluge-all/details/OptionsTab.js @@ -86,7 +86,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, { xtype: 'number', decimalPrecision: 1, minValue: -1, - maxValue: 99999, + maxValue: 9999999, }, }); this.fieldsets.bandwidth.add({ @@ -113,7 +113,7 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, { xtype: 'number', decimalPrecision: 1, minValue: -1, - maxValue: 99999, + maxValue: 9999999, }, }); this.fieldsets.bandwidth.add({ diff --git a/deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js b/deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js index 8c32da5..563dedd 100644 --- a/deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js +++ b/deluge/ui/web/js/deluge-all/preferences/BandwidthPage.js @@ -40,7 +40,7 @@ Deluge.preferences.Bandwidth = Ext.extend(Ext.form.FormPanel, { defaultType: 'spinnerfield', defaults: { minValue: -1, - maxValue: 99999, + maxValue: 9999999, }, style: 'margin-bottom: 0px; padding-bottom: 0px;', autoHeight: true, diff --git a/deluge/ui/web/js/deluge-all/preferences/DaemonPage.js b/deluge/ui/web/js/deluge-all/preferences/DaemonPage.js index 1787826..da205c2 100644 --- a/deluge/ui/web/js/deluge-all/preferences/DaemonPage.js +++ b/deluge/ui/web/js/deluge-all/preferences/DaemonPage.js @@ -40,7 +40,7 @@ Deluge.preferences.Daemon = Ext.extend(Ext.form.FormPanel, { value: 58846, decimalPrecision: 0, minValue: -1, - maxValue: 99999, + maxValue: 65535, }) ); diff --git a/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js b/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js index b6b76eb..1b710f2 100644 --- a/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js +++ b/deluge/ui/web/js/deluge-all/preferences/InterfacePage.js @@ -140,7 +140,7 @@ Deluge.preferences.Interface = Ext.extend(Ext.form.FormPanel, { fieldLabel: _('Session Timeout:'), decimalPrecision: 0, minValue: -1, - maxValue: 99999, + maxValue: Number.MAX_SAFE_INTEGER || Number.MAX_VALUE, }) ); om.bind( |