Get filenames of downloaded files
This commit is contained in:
parent
1175424c23
commit
48156cb4bf
5 changed files with 77 additions and 6 deletions
|
|
@ -462,6 +462,7 @@ void DrawingProgram::update_downloading_dropped_files() {
|
|||
|
||||
ResourceData newResource;
|
||||
newResource.data = std::make_shared<std::string>(downFile.downData->str);
|
||||
newResource.name = downFile.downData->fileName;
|
||||
ServerClientID imageID = world.rMan.add_resource(newResource);
|
||||
ResourceDisplay* display = world.rMan.get_display_data(imageID);
|
||||
if(display->get_type() == ResourceDisplay::Type::FILE) {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include "../ResourceManager.hpp"
|
||||
#include "DrawingProgramEditToolBase.hpp"
|
||||
#include <fstream>
|
||||
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#include <EmscriptenHelpers/emscripten_browser_file.h>
|
||||
#endif
|
||||
|
|
@ -31,6 +32,8 @@ bool ImageEditTool::edit_gui(const std::shared_ptr<DrawComponent>& comp) {
|
|||
t.gui.push_id("edit tool image");
|
||||
t.gui.text_label_centered("File Properties");
|
||||
std::optional<ResourceData> resourceData = drawP.world.rMan.get_resource(a->d.imageID);
|
||||
|
||||
|
||||
if(resourceData) {
|
||||
t.gui.text_label("Name: " + resourceData->name);
|
||||
if(t.gui.text_button_wide("file download", "Download file")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue