修复添加种子时“自动开始”选项没有从参数中读取的BUG。Fixed #11

修复添加种子时“自动开始”选项没有从参数中读取的BUG。
This commit is contained in:
栽培者 2014-11-02 00:03:24 +08:00
parent fdb2889fca
commit cbfb3d5564
3 changed files with 34 additions and 1 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
_SYNCAPP/metadata.xml
_SYNCAPP/metadata.xml
src/tr-web-control/sftp-config.json

View File

@ -75,6 +75,8 @@
{
$("<option/>").text(system.downloadDir).val(system.downloadDir).attr("selected",true).appendTo(thisDialog.find("#download-dir"));
}
thisDialog.find("#chkautostart").prop("checked", system.serverConfig["start-added-torrents"]);
thisDialog.find("#download-dir").combobox();
// 确认
thisDialog.find("#torrent-button-ok").click(function()
@ -85,6 +87,20 @@
var isupload = thisDialog.find("#torrent_upload_file")[0].value!="";
var autostart = thisDialog.find("#chkautostart").prop("checked");
if (autostart!=system.serverConfig["start-added-torrents"])
{
system.serverConfig["start-added-torrents"] = autostart;
// 开始设置参数
transmission.exec(
{
method:"session-set"
,arguments: {
"start-added-torrents": autostart
}
}
);
}
var button = $(this);
var icon = button.linkbutton("options").iconCls;
button.linkbutton({disabled:true,iconCls:"icon-loading"});

View File

@ -69,6 +69,8 @@
$("<option/>").text((i+1)+"."+item.name).appendTo(thisDialog.find("#torrent_upload_file"));
});
thisDialog.find("#chkautostart").prop("checked", system.serverConfig["start-added-torrents"]);
// 确认
thisDialog.find("#torrent-button-ok").click(function()
{
@ -83,6 +85,20 @@
return;
}
if (autostart!=system.serverConfig["start-added-torrents"])
{
system.serverConfig["start-added-torrents"] = autostart;
// 开始设置参数
transmission.exec(
{
method:"session-set"
,arguments: {
"start-added-torrents": autostart
}
}
);
}
button.linkbutton({disabled:true});
if (thisDialog.find("#set-default-download-dir").prop("checked")&&isnewdir)