CLOUD: Add FolderDownload-related methods in Storage

CloudManager's shortcuts are added too.

The idea is to keep FolderDownload request within Storage, and provide
necessary means to access it. The download is started and cancelled
through the DownloadDialog.
This commit is contained in:
Alexander Tkachev 2016-07-04 16:14:30 +06:00
parent 71a326493b
commit b8ee9d4e7d
8 changed files with 164 additions and 55 deletions

View file

@ -274,6 +274,8 @@ bool CloudManager::isWorking() {
return false;
}
///// SavesSyncRequest-related /////
bool CloudManager::isSyncing() {
Storage *storage = getCurrentStorage();
if (storage) return storage->isSyncing();
@ -308,4 +310,34 @@ void CloudManager::setSyncTarget(GUI::CommandReceiver *target) {
if (storage) storage->setSyncTarget(target);
}
///// DownloadFolderRequest-related /////
bool CloudManager::startDownload(Common::String remotePath, Common::String localPath) {
Storage *storage = getCurrentStorage();
if (storage) return storage->startDownload(remotePath, localPath);
return false;
}
void CloudManager::cancelDownload() {
Storage *storage = getCurrentStorage();
if (storage) storage->cancelDownload();
}
void CloudManager::setDownloadTarget(GUI::CommandReceiver *target) {
Storage *storage = getCurrentStorage();
if (storage) storage->setDownloadTarget(target);
}
bool CloudManager::isDownloading() {
Storage *storage = getCurrentStorage();
if (storage) return storage->isDownloading();
return false;
}
double CloudManager::getDownloadingProgress() {
Storage *storage = getCurrentStorage();
if (storage) return storage->getDownloadingProgress();
return 1;
}
} // End of namespace Cloud