diff --git a/src/eventmanager.cpp b/src/eventmanager.cpp index 3d3025f0d..93015626e 100644 --- a/src/eventmanager.cpp +++ b/src/eventmanager.cpp @@ -131,6 +131,8 @@ void EventManager::setGlobalPreferences(QVariantMap m) const { Preferences::setTempPath(m["temp_path"].toString()); if(m.contains("scan_dir")) Preferences::setScanDir(m["scan_dir"].toString()); + if(m.contains("export_dir")) + Preferences::setExportDir(m["export_dir"].toString()); if(m.contains("preallocate_all")) Preferences::preAllocateAllFiles(m["preallocate_all"].toBool()); if(m.contains("queueing_enabled")) @@ -229,6 +231,8 @@ QVariantMap EventManager::getGlobalPreferences() const { data["temp_path"] = Preferences::getTempPath(); data["scan_dir_enabled"] = Preferences::isDirScanEnabled(); data["scan_dir"] = Preferences::getScanDir(); + data["export_dir_enabled"] = Preferences::isTorrentExportEnabled(); + data["export_dir"] = Preferences::getExportDir(); data["preallocate_all"] = Preferences::preAllocateAllFiles(); data["queueing_enabled"] = Preferences::isQueueingSystemEnabled(); data["max_active_downloads"] = Preferences::getMaxActiveDownloads(); diff --git a/src/webui/preferences_content.html b/src/webui/preferences_content.html index fe4bf1e73..1ef9f3b37 100644 --- a/src/webui/preferences_content.html +++ b/src/webui/preferences_content.html @@ -106,6 +106,12 @@ + + _(Copy .torrent files to:) + + + + _(Append .!qB extension to incomplete files) @@ -340,6 +346,12 @@ var scandir_path = ''; if(scandir_enabled) scandir_path = $('scandir_text').get('value'); + var exportdir_enabled = 0; + if($defined($('exportdir_checkbox').get('checked')) && $('exportdir_checkbox').get('checked')) + exportdir_enabled = 1; + var exportdir_path = ''; + if(exportdir_enabled) + exportdir_path = $('exportdir_text').get('value'); var preallocate_all = 0; if($defined($('preallocateall_checkbox').get('checked')) && $('preallocateall_checkbox').get('checked')) preallocate_all = 1; @@ -456,6 +468,7 @@ dict.set('temp_path_enabled', temp_path_enabled); dict.set('temp_path', temp_path); dict.set('scan_dir', scandir_path); + dict.set('export_dir', exportdir_path); dict.set('preallocate_all', preallocate_all); if(!$('appendexttr').hasClass('invisible')) { dict.set('incomplete_files_ext', incomplete_files_ext); @@ -592,6 +605,14 @@ updateScanDirEnabled = function() { } } +updateExportDirEnabled = function() { + if($defined($('exportdir_checkbox').get('checked')) && $('exportdir_checkbox').get('checked')) { + $('exportdir_text').removeProperty('disabled'); + } else { + $('exportdir_text').set('disabled', 'true'); + } +} + updateQueueingSystem = function() { if($defined($('queueing_checkbox').get('checked')) && $('queueing_checkbox').get('checked')) { $('max_active_dl_value').removeProperty('disabled'); @@ -775,10 +796,21 @@ loadPreferences = function() { var scan_dir_enabled = pref.scan_dir_enabled; if(scan_dir_enabled) { $('scandir_text').set('value', pref.scan_dir); + $('scandir_checkbox').set('checked', 'checked'); } else { $('scandir_text').set('value', ''); + $('scandir_checkbox').removeProperty('checked'); } updateScanDirEnabled(); + var export_dir_enabled = pref.export_dir_enabled; + if(export_dir_enabled) { + $('exportdir_text').set('value', pref.export_dir); + $('exportdir_checkbox').set('checked', 'checked'); + } else { + $('exportdir_text').set('value', ''); + $('exportdir_checkbox').removeProperty('checked'); + } + updateExportDirEnabled(); if(pref.preallocate_all) { $('preallocateall_checkbox').set('checked', 'checked'); } else {