fix issue #1799
This commit is contained in:
parent
871d9ac4b0
commit
6a131f021e
|
@ -590,6 +590,8 @@ class Torrent(object):
|
||||||
"message": self.statusmsg,
|
"message": self.statusmsg,
|
||||||
"move_on_completed_path": self.options["move_completed_path"],
|
"move_on_completed_path": self.options["move_completed_path"],
|
||||||
"move_on_completed": self.options["move_completed"],
|
"move_on_completed": self.options["move_completed"],
|
||||||
|
"move_completed_path": self.options["move_completed_path"],
|
||||||
|
"move_completed": self.options["move_completed"],
|
||||||
"next_announce": self.status.next_announce.seconds,
|
"next_announce": self.status.next_announce.seconds,
|
||||||
"num_peers": self.status.num_peers - self.status.num_seeds,
|
"num_peers": self.status.num_peers - self.status.num_seeds,
|
||||||
"num_seeds": self.status.num_seeds,
|
"num_seeds": self.status.num_seeds,
|
||||||
|
|
|
@ -99,7 +99,8 @@ Deluge.Keys = {
|
||||||
Options: [
|
Options: [
|
||||||
'max_download_speed', 'max_upload_speed', 'max_connections',
|
'max_download_speed', 'max_upload_speed', 'max_connections',
|
||||||
'max_upload_slots','is_auto_managed', 'stop_at_ratio', 'stop_ratio',
|
'max_upload_slots','is_auto_managed', 'stop_at_ratio', 'stop_ratio',
|
||||||
'remove_at_ratio', 'private', 'prioritize_first_last'
|
'remove_at_ratio', 'private', 'prioritize_first_last',
|
||||||
|
'move_completed', 'move_completed_path'
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,8 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
||||||
'stop_at_ratio': false,
|
'stop_at_ratio': false,
|
||||||
'stop_ratio': 2.0,
|
'stop_ratio': 2.0,
|
||||||
'remove_at_ratio': false,
|
'remove_at_ratio': false,
|
||||||
'move_completed': null,
|
'move_completed': false,
|
||||||
|
'move_completed_path': '',
|
||||||
'private': false,
|
'private': false,
|
||||||
'prioritize_first_last': false
|
'prioritize_first_last': false
|
||||||
}
|
}
|
||||||
|
@ -259,7 +260,19 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
||||||
labelSeparator: '',
|
labelSeparator: '',
|
||||||
id: 'move_completed',
|
id: 'move_completed',
|
||||||
boxLabel: _('Move Completed'),
|
boxLabel: _('Move Completed'),
|
||||||
colspan: 2
|
colspan: 2,
|
||||||
|
handler: this.onMoveCompletedChecked,
|
||||||
|
scope: this
|
||||||
|
});
|
||||||
|
|
||||||
|
this.fields.move_completed_path = this.fieldsets.queue.add({
|
||||||
|
xtype: 'textfield',
|
||||||
|
fieldLabel: '',
|
||||||
|
id: 'move_completed_path',
|
||||||
|
colspan: 3,
|
||||||
|
bodyStyle: 'margin-left: 20px',
|
||||||
|
width: 180,
|
||||||
|
disabled: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -397,6 +410,13 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
||||||
deluge.editTrackers.show();
|
deluge.editTrackers.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onMoveCompletedChecked: function(checkbox, checked) {
|
||||||
|
this.fields.move_completed_path.setDisabled(!checked);
|
||||||
|
|
||||||
|
if (!checked) return;
|
||||||
|
this.fields.move_completed_path.focus();
|
||||||
|
},
|
||||||
|
|
||||||
onStopRatioChecked: function(checkbox, checked) {
|
onStopRatioChecked: function(checkbox, checked) {
|
||||||
this.fields.remove_at_ratio.setDisabled(!checked);
|
this.fields.remove_at_ratio.setDisabled(!checked);
|
||||||
this.fields.stop_ratio.setDisabled(!checked);
|
this.fields.stop_ratio.setDisabled(!checked);
|
||||||
|
@ -411,5 +431,6 @@ Deluge.details.OptionsTab = Ext.extend(Ext.form.FormPanel, {
|
||||||
var stop_at_ratio = this.optionsManager.get('stop_at_ratio');
|
var stop_at_ratio = this.optionsManager.get('stop_at_ratio');
|
||||||
this.fields.remove_at_ratio.setDisabled(!stop_at_ratio);
|
this.fields.remove_at_ratio.setDisabled(!stop_at_ratio);
|
||||||
this.fields.stop_ratio.setDisabled(!stop_at_ratio);
|
this.fields.stop_ratio.setDisabled(!stop_at_ratio);
|
||||||
|
this.fields.move_completed_path.setDisabled(!this.optionsManager.get('move_completed'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue