[feat] Synchronize local folder with dropbox (#5591)

Option to synchronize files in local koreader folder with folder on Dropbox. All files that aren't on the local disk will be downloaded. Files with different sizes will also be downloaded and overwritten.
The download process can be paused or stopped at any time (similar to downloading images in Wikipedia).

Synchronize and settings are available after long press in dropbox account in Cloud storage.
Limitations: Only one folder (without subfolders) can be synchronize with one folder on local storage.
This commit is contained in:
Robert
2019-11-18 18:39:45 +01:00
committed by Frans de Jonge
parent 16fd731f73
commit 04741d8cfd
4 changed files with 349 additions and 31 deletions

29
frontend/ui/cloudmgr.lua Normal file
View File

@@ -0,0 +1,29 @@
local CloudStorage = require("apps/cloudstorage/cloudstorage")
local UIManager = require("ui/uimanager")
local _ = require("gettext")
local CloudMgr = {
onConfirm = function() end,
}
function CloudMgr:new(from_o)
local o = from_o or {}
setmetatable(o, self)
self.__index = self
return o
end
--- Displays a PathChooser for cloud drive for picking a (source) directory.
-- @treturn string path chosen by the user
function CloudMgr:chooseDir()
local cloud_storage = CloudStorage:new{
title = _("Long-press to select directory"),
item = self.item,
onConfirm = function(dir_path)
self.onConfirm(dir_path)
end,
}
UIManager:show(cloud_storage)
end
return CloudMgr