~cmiller/ubuntu/quantal/deluge/fix-parameter-move-storage

« back to all changes in this revision

Viewing changes to deluge/ui/web/js/Deluge.Preferences.Downloads.js

  • Committer: Bazaar Package Importer
  • Author(s): Cristian Greco
  • Date: 2009-12-24 00:57:59 UTC
  • mfrom: (4.1.9 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091224005759-ifkuzevkdqqx4jle
Tags: 1.2.0~rc5-1
* New upstream version.
  - fix startup with fresh configs. (Closes: #560384)
* debian/control: drop useless dependencies on dbus for deluge-gtk.
* fix_manifest_in.patch: dropped, file MANIFEST.in has been deleted by
  upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
Script: Deluge.Preferences.Downloads.js
3
 
    The downloads preferences page.
 
3
        The downloads preferences page.
4
4
 
5
5
Copyright:
6
 
    (C) Damien Churchill 2009 <damoxc@gmail.com>
7
 
    This program is free software; you can redistribute it and/or modify
8
 
    it under the terms of the GNU General Public License as published by
9
 
    the Free Software Foundation; either version 3, or (at your option)
10
 
    any later version.
11
 
 
12
 
    This program is distributed in the hope that it will be useful,
13
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
    GNU General Public License for more details.
16
 
 
17
 
    You should have received a copy of the GNU General Public License
18
 
    along with this program.  If not, write to:
19
 
        The Free Software Foundation, Inc.,
20
 
        51 Franklin Street, Fifth Floor
21
 
        Boston, MA  02110-1301, USA.
22
 
 
23
 
    In addition, as a special exception, the copyright holders give
24
 
    permission to link the code of portions of this program with the OpenSSL
25
 
    library.
26
 
    You must obey the GNU General Public License in all respects for all of
27
 
    the code used other than OpenSSL. If you modify file(s) with this
28
 
    exception, you may extend this exception to your version of the file(s),
29
 
    but you are not obligated to do so. If you do not wish to do so, delete
30
 
    this exception statement from your version. If you delete this exception
31
 
    statement from all source files in the program, then also delete it here.
 
6
        (C) Damien Churchill 2009 <damoxc@gmail.com>
 
7
        This program is free software; you can redistribute it and/or modify
 
8
        it under the terms of the GNU General Public License as published by
 
9
        the Free Software Foundation; either version 3, or (at your option)
 
10
        any later version.
 
11
 
 
12
        This program is distributed in the hope that it will be useful,
 
13
        but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
        GNU General Public License for more details.
 
16
 
 
17
        You should have received a copy of the GNU General Public License
 
18
        along with this program.  If not, write to:
 
19
                The Free Software Foundation, Inc.,
 
20
                51 Franklin Street, Fifth Floor
 
21
                Boston, MA  02110-1301, USA.
 
22
 
 
23
        In addition, as a special exception, the copyright holders give
 
24
        permission to link the code of portions of this program with the OpenSSL
 
25
        library.
 
26
        You must obey the GNU General Public License in all respects for all of
 
27
        the code used other than OpenSSL. If you modify file(s) with this
 
28
        exception, you may extend this exception to your version of the file(s),
 
29
        but you are not obligated to do so. If you do not wish to do so, delete
 
30
        this exception statement from your version. If you delete this exception
 
31
        statement from all source files in the program, then also delete it here.
32
32
*/
33
33
 
34
34
Ext.namespace('Ext.deluge.preferences');
35
35
Ext.deluge.preferences.Downloads = Ext.extend(Ext.FormPanel, {
36
 
    constructor: function(config) {
37
 
        config = Ext.apply({
38
 
            border: false,
39
 
            title: _('Downloads'),
40
 
            layout: 'form',
41
 
            autoHeight: true
42
 
        }, config);
43
 
        Ext.deluge.preferences.Downloads.superclass.constructor.call(this, config);
44
 
    },
45
 
 
46
 
    initComponent: function() {
47
 
        Ext.deluge.preferences.Downloads.superclass.initComponent.call(this);
48
 
 
49
 
        var optMan = Deluge.Preferences.getOptionsManager();
50
 
        var fieldset = this.add({
51
 
            xtype: 'fieldset',
52
 
            border: false,
53
 
            title: _('Folders'),
54
 
            labelWidth: 150,
55
 
            defaultType: 'textfield',
56
 
            autoHeight: true,
57
 
            labelAlign: 'top',
58
 
            width: 260,
59
 
            style: 'margin-bottom: 5px; padding-bottom: 5px;'
60
 
        });
61
 
        optMan.bind('download_location', fieldset.add({
62
 
            name: 'download_location',
63
 
            fieldLabel: _('Download to'),
64
 
            width: 240
65
 
        }));
66
 
        optMan.bind('move_completed_path', fieldset.add({
67
 
            name: 'move_completed_path',
68
 
            fieldLabel: _('Move completed to'),
69
 
            width: 240,
70
 
            disabled: true
71
 
        }));
72
 
        optMan.bind('torrentfiles_location', fieldset.add({
73
 
            name: 'torrentfiles_location',
74
 
            fieldLabel: _('Copy of .torrent files to'),
75
 
            width: 240,
76
 
            disabled: true
77
 
        }));
78
 
        optMan.bind('autoadd_location', fieldset.add({
79
 
            name: 'autoadd_location',
80
 
            fieldLabel: _('Autoadd .torrent files from'),
81
 
            width: 240,
82
 
            disabled: true
83
 
        }));
84
 
    
85
 
        fieldset = this.add({
86
 
            xtype: 'fieldset',
87
 
            border: false,
88
 
            title: _('Allocation'),
89
 
            autoHeight: true,
90
 
            labelWidth: 1,
91
 
            defaultType: 'radiogroup',
92
 
            style: 'margin-bottom: 5px; padding-bottom: 5px;',
93
 
            width: 260
94
 
        });
95
 
        optMan.bind('compact_allocation', fieldset.add({
96
 
            name: 'compact_allocation',
97
 
            labelSeparator: '',
98
 
            items: [
99
 
                {boxLabel: _('Compact') + '&nbsp;', inputValue: true, name: 'compact_allocation'},
100
 
                {boxLabel: _('Full'), inputValue: false, name: 'compact_allocation'}
101
 
            ]
102
 
        }));
103
 
    
104
 
        fieldset = this.add({
105
 
            xtype: 'fieldset',
106
 
            border: false,
107
 
            title: _('Options'),
108
 
            autoHeight: true,
109
 
            labelWidth: 1,
110
 
            defaultType: 'checkbox',
111
 
            width: 260
112
 
        });
113
 
        optMan.bind('prioritize_first_last_pieces', fieldset.add({
114
 
            name: 'prioritize_first_last_pieces',
115
 
            labelSeparator: '',
116
 
            boxLabel: _('Prioritize first and last pieces of torrent')
117
 
        }));
118
 
        optMan.bind('add_paused', fieldset.add({
119
 
            name: 'add_paused',
120
 
            labelSeparator: '',
121
 
            boxLabel: _('Add torrents in Paused state')
122
 
        }));
123
 
    
124
 
        this.on('show', this.onShow, this);
125
 
    },
126
 
 
127
 
    onShow: function() {
128
 
        Ext.deluge.preferences.Downloads.superclass.onShow.call(this);
129
 
    }
 
36
        constructor: function(config) {
 
37
                config = Ext.apply({
 
38
                        border: false,
 
39
                        title: _('Downloads'),
 
40
                        layout: 'form',
 
41
                        autoHeight: true,
 
42
                        width: 320
 
43
                }, config);
 
44
                Ext.deluge.preferences.Downloads.superclass.constructor.call(this, config);
 
45
        },
 
46
 
 
47
        initComponent: function() {
 
48
                Ext.deluge.preferences.Downloads.superclass.initComponent.call(this);
 
49
 
 
50
                var optMan = Deluge.Preferences.getOptionsManager();
 
51
                var fieldset = this.add({
 
52
                        xtype: 'fieldset',
 
53
                        border: false,
 
54
                        title: _('Folders'),
 
55
                        labelWidth: 150,
 
56
                        defaultType: 'togglefield',
 
57
                        autoHeight: true,
 
58
                        labelAlign: 'top',
 
59
                        width: 300,
 
60
                        style: 'margin-bottom: 5px; padding-bottom: 5px;'
 
61
                });
 
62
 
 
63
                optMan.bind('download_location', fieldset.add({
 
64
                        xtype: 'textfield',
 
65
                        name: 'download_location',
 
66
                        fieldLabel: _('Download to'),
 
67
                        width: 280
 
68
                }));
 
69
 
 
70
                var field = fieldset.add({
 
71
                        name: 'move_completed_path',
 
72
                        fieldLabel: _('Move completed to'),
 
73
                        width: 280
 
74
                });
 
75
                optMan.bind('move_completed', field.toggle);
 
76
                optMan.bind('move_completed_path', field.input);
 
77
 
 
78
                field = fieldset.add({
 
79
                        name: 'torrentfiles_location',
 
80
                        fieldLabel: _('Copy of .torrent files to'),
 
81
                        width: 280
 
82
                });
 
83
                optMan.bind('copy_torrent_file', field.toggle);
 
84
                optMan.bind('torrentfiles_location', field.input);
 
85
 
 
86
                field = fieldset.add({
 
87
                        name: 'autoadd_location',
 
88
                        fieldLabel: _('Autoadd .torrent files from'),
 
89
                        width: 280
 
90
                });
 
91
                optMan.bind('autoadd_enable', field.toggle);
 
92
                optMan.bind('autoadd_location', field.input);
 
93
        
 
94
                fieldset = this.add({
 
95
                        xtype: 'fieldset',
 
96
                        border: false,
 
97
                        title: _('Allocation'),
 
98
                        autoHeight: true,
 
99
                        labelWidth: 1,
 
100
                        defaultType: 'radiogroup',
 
101
                        style: 'margin-bottom: 5px; margin-top: 0; padding-bottom: 5px; padding-top: 0;',
 
102
                        width: 240
 
103
                });
 
104
                optMan.bind('compact_allocation', fieldset.add({
 
105
                        name: 'compact_allocation',
 
106
                        width: 200,
 
107
                        labelSeparator: '',
 
108
                        defaults: {
 
109
                                width: 80,
 
110
                                height: 22,
 
111
                                name: 'compact_allocation'
 
112
                        },
 
113
                        items: [{
 
114
                                boxLabel: _('Use Full'),
 
115
                                inputValue: false
 
116
                        }, {
 
117
                                boxLabel: _('Use Compact'),
 
118
                                inputValue: true
 
119
                        }]
 
120
                }));
 
121
        
 
122
                fieldset = this.add({
 
123
                        xtype: 'fieldset',
 
124
                        border: false,
 
125
                        title: _('Options'),
 
126
                        autoHeight: true,
 
127
                        labelWidth: 1,
 
128
                        defaultType: 'checkbox',
 
129
                        style: 'margin-bottom: 0; padding-bottom: 0;',
 
130
                        width: 280
 
131
                });
 
132
                optMan.bind('prioritize_first_last_pieces', fieldset.add({
 
133
                        name: 'prioritize_first_last_pieces',
 
134
                        labelSeparator: '',
 
135
                        height: 22,
 
136
                        boxLabel: _('Prioritize first and last pieces of torrent')
 
137
                }));
 
138
                optMan.bind('add_paused', fieldset.add({
 
139
                        name: 'add_paused',
 
140
                        labelSeparator: '',
 
141
                        height: 22,
 
142
                        boxLabel: _('Add torrents in Paused state')
 
143
                }));
 
144
        
 
145
                this.on('show', this.onShow, this);
 
146
        },
 
147
 
 
148
        onShow: function() {
 
149
                Ext.deluge.preferences.Downloads.superclass.onShow.call(this);
 
150
        }
130
151
});
131
 
Deluge.Preferences.addPage(new Ext.deluge.preferences.Downloads());
 
 
b'\\ No newline at end of file'
 
152
Deluge.Preferences.addPage(new Ext.deluge.preferences.Downloads());