source: deluge/ui/web/js/deluge-all/AboutWindow.js@ 2ec6e1

develop
Last change on this file since 2ec6e1 was 2ec6e1, checked in by Calum Lind <calumlind+deluge@gmail.com>, 3 years ago

[Lint] Update linter version and fix issues

Notable changes:

  • Prettier >=2.3 with more consistent js assignments
  • Black now formats docstrings
  • Added isort to list of autoformaters
  • Update flake8 config for v4

Ref: https://prettier.io/blog/2021/05/09/2.3.0.html

  • Property mode set to 100644
File size: 3.7 KB
Line 
1/**
2 * Deluge.AboutWindow.js
3 *
4 * Copyright (c) Damien Churchill 2009-2010 <damoxc@gmail.com>
5 *
6 * This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
7 * the additional special exception to link portions of this program with the OpenSSL library.
8 * See LICENSE for more details.
9 */
10
11Ext.namespace('Deluge.about');
12
13/**
14 * @class Deluge.about.AboutWindow
15 * @extends Ext.Window
16 */
17Deluge.about.AboutWindow = Ext.extend(Ext.Window, {
18 id: 'AboutWindow',
19 title: _('About Deluge'),
20 height: 330,
21 width: 270,
22 iconCls: 'x-deluge-main-panel',
23 resizable: false,
24 plain: true,
25 layout: {
26 type: 'vbox',
27 align: 'center',
28 },
29 buttonAlign: 'center',
30
31 initComponent: function () {
32 Deluge.about.AboutWindow.superclass.initComponent.call(this);
33 this.addEvents({
34 build_ready: true,
35 });
36
37 var self = this;
38 var libtorrent = function () {
39 deluge.client.core.get_libtorrent_version({
40 success: function (lt_version) {
41 comment += '<br/>' + _('libtorrent:') + ' ' + lt_version;
42 Ext.getCmp('about_comment').setText(comment, false);
43 self.fireEvent('build_ready');
44 },
45 });
46 };
47
48 var client_version = deluge.version;
49
50 var comment =
51 _(
52 'A peer-to-peer file sharing program\nutilizing the BitTorrent protocol.'
53 ).replace('\n', '<br/>') +
54 '<br/><br/>' +
55 _('Client:') +
56 ' ' +
57 client_version +
58 '<br/>';
59 deluge.client.web.connected({
60 success: function (connected) {
61 if (connected) {
62 deluge.client.daemon.get_version({
63 success: function (server_version) {
64 comment +=
65 _('Server:') + ' ' + server_version + '<br/>';
66 libtorrent();
67 },
68 });
69 } else {
70 this.fireEvent('build_ready');
71 }
72 },
73 failure: function () {
74 this.fireEvent('build_ready');
75 },
76 scope: this,
77 });
78
79 this.add([
80 {
81 xtype: 'box',
82 style: 'padding-top: 5px',
83 height: 80,
84 width: 240,
85 cls: 'x-deluge-logo',
86 hideLabel: true,
87 },
88 {
89 xtype: 'label',
90 style: 'padding-top: 10px; font-weight: bold; font-size: 16px;',
91 text: _('Deluge') + ' ' + client_version,
92 },
93 {
94 xtype: 'label',
95 id: 'about_comment',
96 style: 'padding-top: 10px; text-align:center; font-size: 12px;',
97 html: comment,
98 },
99 {
100 xtype: 'label',
101 style: 'padding-top: 10px; font-size: 10px;',
102 text: _('Copyright 2007-2018 Deluge Team'),
103 },
104 {
105 xtype: 'label',
106 style: 'padding-top: 5px; font-size: 12px;',
107 html: '<a href="https://deluge-torrent.org" target="_blank">deluge-torrent.org</a>',
108 },
109 ]);
110 this.addButton(_('Close'), this.onCloseClick, this);
111 },
112
113 show: function () {
114 this.on('build_ready', function () {
115 Deluge.about.AboutWindow.superclass.show.call(this);
116 });
117 },
118
119 onCloseClick: function () {
120 this.close();
121 },
122});
123
124Ext.namespace('Deluge');
125
126Deluge.About = function () {
127 new Deluge.about.AboutWindow().show();
128};
Note: See TracBrowser for help on using the repository browser.