From d1772d410235592b482e3b08b1863f6624d9fe6b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 19 Feb 2023 15:52:21 +0100 Subject: Adding upstream version 2.0.3. Signed-off-by: Daniel Baumann --- deluge/ui/web/js/deluge-all/AboutWindow.js | 129 +++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 deluge/ui/web/js/deluge-all/AboutWindow.js (limited to 'deluge/ui/web/js/deluge-all/AboutWindow.js') diff --git a/deluge/ui/web/js/deluge-all/AboutWindow.js b/deluge/ui/web/js/deluge-all/AboutWindow.js new file mode 100644 index 0000000..5376d05 --- /dev/null +++ b/deluge/ui/web/js/deluge-all/AboutWindow.js @@ -0,0 +1,129 @@ +/** + * Deluge.AboutWindow.js + * + * Copyright (c) Damien Churchill 2009-2010 + * + * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with + * the additional special exception to link portions of this program with the OpenSSL library. + * See LICENSE for more details. + */ + +Ext.namespace('Deluge.about'); + +/** + * @class Deluge.about.AboutWindow + * @extends Ext.Window + */ +Deluge.about.AboutWindow = Ext.extend(Ext.Window, { + id: 'AboutWindow', + title: _('About Deluge'), + height: 330, + width: 270, + iconCls: 'x-deluge-main-panel', + resizable: false, + plain: true, + layout: { + type: 'vbox', + align: 'center', + }, + buttonAlign: 'center', + + initComponent: function() { + Deluge.about.AboutWindow.superclass.initComponent.call(this); + this.addEvents({ + build_ready: true, + }); + + var self = this; + var libtorrent = function() { + deluge.client.core.get_libtorrent_version({ + success: function(lt_version) { + comment += '
' + _('libtorrent:') + ' ' + lt_version; + Ext.getCmp('about_comment').setText(comment, false); + self.fireEvent('build_ready'); + }, + }); + }; + + var client_version = deluge.version; + + var comment = + _( + 'A peer-to-peer file sharing program\nutilizing the BitTorrent protocol.' + ).replace('\n', '
') + + '

' + + _('Client:') + + ' ' + + client_version + + '
'; + deluge.client.web.connected({ + success: function(connected) { + if (connected) { + deluge.client.daemon.get_version({ + success: function(server_version) { + comment += + _('Server:') + ' ' + server_version + '
'; + libtorrent(); + }, + }); + } else { + this.fireEvent('build_ready'); + } + }, + failure: function() { + this.fireEvent('build_ready'); + }, + scope: this, + }); + + this.add([ + { + xtype: 'box', + style: 'padding-top: 5px', + height: 80, + width: 240, + cls: 'x-deluge-logo', + hideLabel: true, + }, + { + xtype: 'label', + style: 'padding-top: 10px; font-weight: bold; font-size: 16px;', + text: _('Deluge') + ' ' + client_version, + }, + { + xtype: 'label', + id: 'about_comment', + style: 'padding-top: 10px; text-align:center; font-size: 12px;', + html: comment, + }, + { + xtype: 'label', + style: 'padding-top: 10px; font-size: 10px;', + text: _('Copyright 2007-2018 Deluge Team'), + }, + { + xtype: 'label', + style: 'padding-top: 5px; font-size: 12px;', + html: + 'deluge-torrent.org', + }, + ]); + this.addButton(_('Close'), this.onCloseClick, this); + }, + + show: function() { + this.on('build_ready', function() { + Deluge.about.AboutWindow.superclass.show.call(this); + }); + }, + + onCloseClick: function() { + this.close(); + }, +}); + +Ext.namespace('Deluge'); + +Deluge.About = function() { + new Deluge.about.AboutWindow().show(); +}; -- cgit v1.2.3