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 --- .../Extractor/deluge_extractor/data/extractor.js | 100 +++++++++++++++++ .../deluge_extractor/data/extractor_prefs.ui | 123 +++++++++++++++++++++ .../deluge_extractor/data/extractor_prefs.ui~ | 120 ++++++++++++++++++++ 3 files changed, 343 insertions(+) create mode 100644 deluge/plugins/Extractor/deluge_extractor/data/extractor.js create mode 100644 deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui create mode 100644 deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui~ (limited to 'deluge/plugins/Extractor/deluge_extractor/data') diff --git a/deluge/plugins/Extractor/deluge_extractor/data/extractor.js b/deluge/plugins/Extractor/deluge_extractor/data/extractor.js new file mode 100644 index 0000000..b11cb30 --- /dev/null +++ b/deluge/plugins/Extractor/deluge_extractor/data/extractor.js @@ -0,0 +1,100 @@ +/** + * extractor.js + * + * Copyright (C) Calum Lind 2014 + * + * 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.ns('Deluge.ux.preferences'); + +/** + * @class Deluge.ux.preferences.ExtractorPage + * @extends Ext.Panel + */ +Deluge.ux.preferences.ExtractorPage = Ext.extend(Ext.Panel, { + title: _('Extractor'), + header: false, + layout: 'fit', + border: false, + + initComponent: function() { + Deluge.ux.preferences.ExtractorPage.superclass.initComponent.call(this); + + this.form = this.add({ + xtype: 'form', + layout: 'form', + border: false, + autoHeight: true, + }); + + fieldset = this.form.add({ + xtype: 'fieldset', + border: false, + title: '', + autoHeight: true, + labelAlign: 'top', + labelWidth: 80, + defaultType: 'textfield', + }); + + this.extract_path = fieldset.add({ + fieldLabel: _('Extract to:'), + labelSeparator: '', + name: 'extract_path', + width: '97%', + }); + + this.use_name_folder = fieldset.add({ + xtype: 'checkbox', + name: 'use_name_folder', + height: 22, + hideLabel: true, + boxLabel: _('Create torrent name sub-folder'), + }); + + this.on('show', this.updateConfig, this); + }, + + onApply: function() { + // build settings object + var config = {}; + + config['extract_path'] = this.extract_path.getValue(); + config['use_name_folder'] = this.use_name_folder.getValue(); + + deluge.client.extractor.set_config(config); + }, + + onOk: function() { + this.onApply(); + }, + + updateConfig: function() { + deluge.client.extractor.get_config({ + success: function(config) { + this.extract_path.setValue(config['extract_path']); + this.use_name_folder.setValue(config['use_name_folder']); + }, + scope: this, + }); + }, +}); + +Deluge.plugins.ExtractorPlugin = Ext.extend(Deluge.Plugin, { + name: 'Extractor', + + onDisable: function() { + deluge.preferences.removePage(this.prefsPage); + }, + + onEnable: function() { + this.prefsPage = deluge.preferences.addPage( + new Deluge.ux.preferences.ExtractorPage() + ); + }, +}); +Deluge.registerPlugin('Extractor', Deluge.plugins.ExtractorPlugin); diff --git a/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui b/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui new file mode 100644 index 0000000..6f34b44 --- /dev/null +++ b/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui @@ -0,0 +1,123 @@ + + + + + + False + + + + + + True + False + 5 + vertical + + + True + False + 0 + none + + + True + False + 5 + 5 + vertical + + + True + False + 5 + + + True + False + Extract to: + + + False + False + 0 + + + + + True + False + + + False + select-folder + Select A Folder + + + True + True + 0 + + + + + True + False + False + + + True + True + 1 + + + + + True + True + 1 + + + + + False + False + 0 + + + + + Create torrent name sub-folder + True + True + False + This option will create a sub-folder using the torrent's name within the selected extract folder and put the extracted files there. + True + + + False + False + 1 + + + + + + + True + False + <b>General</b> + True + + + + + True + True + 0 + + + + + + diff --git a/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui~ b/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui~ new file mode 100644 index 0000000..040e3d0 --- /dev/null +++ b/deluge/plugins/Extractor/deluge_extractor/data/extractor_prefs.ui~ @@ -0,0 +1,120 @@ + + + + + + False + + + True + False + 5 + + + True + False + 0 + none + + + True + False + 5 + 5 + + + True + False + 5 + + + True + False + Extract to: + + + False + False + 0 + + + + + True + False + + + False + select-folder + Select A Folder + + + True + True + 0 + + + + + True + False + False + True + True + + + True + True + 1 + + + + + True + True + 1 + + + + + False + False + 0 + + + + + Create torrent name sub-folder + True + True + False + This option will create a sub-folder using the torrent's name within the selected extract folder and put the extracted files there. + True + + + False + False + 1 + + + + + + + True + False + <b>General</b> + True + + + + + True + True + 0 + + + + + + -- cgit v1.2.3