MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / downloadFile

Method downloadFile

source/ui/data/globalSettings.cpp:833–853  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

831}
832
833void GlobalSettings::downloadFile(BString url, BString filePath, BString name, U32 sizeMB, std::function<void(bool)> onCompleted) {
834 runOnMainUI([url, filePath, name, sizeMB, onCompleted]() {
835 BString parentPath = Fs::getNativeParentPath(filePath);
836 if (!Fs::doesNativePathExist(parentPath)) {
837 Fs::makeNativeDirs(parentPath);
838 }
839 std::vector<DownloadItem> items;
840 items.push_back(DownloadItem(getTranslationWithFormat(Msg::DOWNLOADDLG_LABEL, true, name), url, B(""), filePath, ((U64)sizeMB) * 1024 * 1024));
841 new DownloadDlg(Msg::DOWNLOADDLG_TITLE, items, [onCompleted](bool success) {
842 runOnMainUI([success, onCompleted]() {
843 GlobalSettings::reloadWineVersions();
844 if (!GlobalSettings::defaultFont) {
845 GlobalSettings::restartUI = true;
846 }
847 onCompleted(success);
848 return false;
849 });
850 });
851 return false;
852 });
853}
854
855void GlobalSettings::downloadFileSystem(const std::shared_ptr<FileSystemZip>& version, std::function<void(bool)> onCompleted) {
856 runOnMainUI([version, onCompleted]() {

Callers

nothing calls this directly

Calls 5

runOnMainUIFunction · 0.85
DownloadItemClass · 0.85
getTranslationWithFormatFunction · 0.85
BFunction · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected