From 6b33db3ae3fe9d37c5f73737b537a64c77d2830e Mon Sep 17 00:00:00 2001 From: thalieht Date: Mon, 11 Sep 2017 16:56:33 +0300 Subject: [PATCH] Create root folder option when adding a torrent in WebUI --- src/webui/webapplication.cpp | 4 ++++ src/webui/www/public/download.html | 4 ++++ src/webui/www/public/scripts/mocha-init.js | 4 ++-- src/webui/www/public/upload.html | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/webui/webapplication.cpp b/src/webui/webapplication.cpp index f4eb9e410..8c67b9fe7 100644 --- a/src/webui/webapplication.cpp +++ b/src/webui/webapplication.cpp @@ -394,6 +394,7 @@ void WebApplication::action_command_download() QStringList list = urls.split('\n'); bool skipChecking = request().posts["skip_checking"] == "true"; bool addPaused = request().posts["paused"] == "true"; + bool hasRootFolder = request().posts["root_folder"] == "true"; QString savepath = request().posts["savepath"]; QString category = request().posts["category"]; QString cookie = request().posts["cookie"]; @@ -422,6 +423,7 @@ void WebApplication::action_command_download() params.skipChecking = skipChecking; params.addPaused = TriStateBool(addPaused); + params.createSubfolder = TriStateBool(hasRootFolder); params.savePath = savepath; params.category = category; @@ -446,6 +448,7 @@ void WebApplication::action_command_upload() CHECK_URI(0); bool skipChecking = request().posts["skip_checking"] == "true"; bool addPaused = request().posts["paused"] == "true"; + bool hasRootFolder = request().posts["root_folder"] == "true"; QString savepath = request().posts["savepath"]; QString category = request().posts["category"]; @@ -468,6 +471,7 @@ void WebApplication::action_command_upload() params.skipChecking = skipChecking; params.addPaused = TriStateBool(addPaused); + params.createSubfolder = TriStateBool(hasRootFolder); params.savePath = savepath; params.category = category; if (!BitTorrent::Session::instance()->addTorrent(torrentInfo, params)) { diff --git a/src/webui/www/public/download.html b/src/webui/www/public/download.html index 05fadbbdb..2f2d3be65 100644 --- a/src/webui/www/public/download.html +++ b/src/webui/www/public/download.html @@ -38,6 +38,10 @@ +
+ + +
diff --git a/src/webui/www/public/scripts/mocha-init.js b/src/webui/www/public/scripts/mocha-init.js index eeb9ef392..ba0132d9f 100644 --- a/src/webui/www/public/scripts/mocha-init.js +++ b/src/webui/www/public/scripts/mocha-init.js @@ -57,7 +57,7 @@ initializeWindows = function() { paddingVertical: 0, paddingHorizontal: 0, width: 500, - height: 400 + height: 420 }); updateMainData(); }); @@ -97,7 +97,7 @@ initializeWindows = function() { paddingVertical: 0, paddingHorizontal: 0, width: 500, - height: 240 + height: 260 }); updateMainData(); }); diff --git a/src/webui/www/public/upload.html b/src/webui/www/public/upload.html index f9d53b527..4dd86ce27 100644 --- a/src/webui/www/public/upload.html +++ b/src/webui/www/public/upload.html @@ -34,6 +34,10 @@ +
+ + +