diff --git a/src/base/http/requestparser.cpp b/src/base/http/requestparser.cpp index e01eaaed1..ca85f49bf 100644 --- a/src/base/http/requestparser.cpp +++ b/src/base/http/requestparser.cpp @@ -192,14 +192,14 @@ QList RequestParser::splitMultipartData(const QByteArray& data, cons start = end + sepLength; // skip first boundary while ((end = data.indexOf(sep, start)) >= 0) { - ret << data.mid(start, end - start); + ret << data.mid(start, end - EOL.length() - start); start = end + sepLength; } // last or single part sep = boundary + "--" + EOL; if ((end = data.indexOf(sep, start)) >= 0) - ret << data.mid(start, end - start); + ret << data.mid(start, end - EOL.length() - start); } return ret; diff --git a/src/webui/abstractwebapplication.cpp b/src/webui/abstractwebapplication.cpp index f29d891ee..f153f6148 100644 --- a/src/webui/abstractwebapplication.cpp +++ b/src/webui/abstractwebapplication.cpp @@ -252,7 +252,7 @@ void AbstractWebApplication::translateDocument(QString& data) "options_imp", "Preferences", "TrackersAdditionDlg", "ScanFoldersModel", "PropTabBar", "TorrentModel", "downloadFromURL", "MainWindow", "misc", "StatusBar", "AboutDlg", "about", "PeerListWidget", "StatusFiltersWidget", - "CategoryFiltersList", "TransferListDelegate" + "CategoryFiltersList", "TransferListDelegate", "AddNewTorrentDialog" }; const size_t context_count = sizeof(contexts) / sizeof(contexts[0]); int i = 0; diff --git a/src/webui/webapplication.cpp b/src/webui/webapplication.cpp index 0f98fd611..ad896413a 100644 --- a/src/webui/webapplication.cpp +++ b/src/webui/webapplication.cpp @@ -367,6 +367,8 @@ void WebApplication::action_command_download() CHECK_URI(0); QString urls = request().posts["urls"]; QStringList list = urls.split('\n'); + bool skipChecking = request().posts["skip_checking"] == "true"; + bool addPaused = request().posts["paused"] == "true"; QString savepath = request().posts["savepath"]; QString category = request().posts["category"]; QString cookie = request().posts["cookie"]; @@ -390,6 +392,11 @@ void WebApplication::action_command_download() category = category.trimmed(); BitTorrent::AddTorrentParams params; + + // TODO: Check if destination actually exists + params.skipChecking = skipChecking; + + params.addPaused = addPaused; params.savePath = savepath; params.category = category; @@ -406,6 +413,8 @@ void WebApplication::action_command_upload() { qDebug() << Q_FUNC_INFO; CHECK_URI(0); + bool skipChecking = request().posts["skip_checking"] == "true"; + bool addPaused = request().posts["paused"] == "true"; QString savepath = request().posts["savepath"]; QString category = request().posts["category"]; @@ -423,6 +432,11 @@ void WebApplication::action_command_upload() } else { BitTorrent::AddTorrentParams params; + + // TODO: Check if destination actually exists + params.skipChecking = skipChecking; + + params.addPaused = addPaused; 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 a5c612e02..e030b6e70 100644 --- a/src/webui/www/public/download.html +++ b/src/webui/www/public/download.html @@ -29,6 +29,15 @@ +
+ + + +
+
+ + +
@@ -47,6 +56,10 @@ $('download_frame').addEventListener("load", function() { if (submitted) window.parent.closeWindows(); }); + +$('start_torrent').addEventListener('change', function() { + $('add_paused').disabled = $('start_torrent').checked; +});
diff --git a/src/webui/www/public/scripts/mocha-init.js b/src/webui/www/public/scripts/mocha-init.js index dc3c722e4..98bfc4347 100644 --- a/src/webui/www/public/scripts/mocha-init.js +++ b/src/webui/www/public/scripts/mocha-init.js @@ -97,7 +97,7 @@ initializeWindows = function() { paddingVertical: 0, paddingHorizontal: 0, width: 500, - height: 200 + height: 220 }); updateMainData(); }); diff --git a/src/webui/www/public/upload.html b/src/webui/www/public/upload.html index 2ca75b91b..2727f9341 100644 --- a/src/webui/www/public/upload.html +++ b/src/webui/www/public/upload.html @@ -25,6 +25,15 @@ +
+ + + +
+
+ + +
@@ -43,6 +52,10 @@ $('upload_frame').addEventListener("load", function() { if (submitted) window.parent.closeWindows(); }); + +$('start_torrent').addEventListener('change', function() { + $('add_paused').disabled = $('start_torrent').checked; +});