36 keep_ = this->addWidget(std::make_unique<WCheckBox>());
42 std::streamsize fsize = 0;
44 std::ifstream theFile(
info_.spoolFileName().c_str());
45 theFile.seekg(0, std::ios_base::end);
46 fsize = theFile.tellg();
51 size = WString(std::to_string(fsize)) + U
" bytes";
53 size = WString(std::to_string((
int)(fsize / 1024)))
56 std::u32string fn =
static_cast<std::u32string
>
57 (escapeText(WString(
info_.clientFileName())));
60 = this->addWidget(std::make_unique<WAnchor>(
"", fn + U
" (<i>" + WString(
info_.contentType())
63 auto res = std::make_shared<WFileResource>(
info_.contentType(),
info_.spoolFileName());
64 res->suggestFileName(
info_.clientFileName());
77 upload_ = this->addWidget(std::make_unique<WFileUpload>());
84 std::unique_ptr<WProgressBar> progress = std::make_unique<WProgressBar>();
85 progress->setFormat(WString::Empty);
86 progress->setVerticalAlignment(AlignmentFlag::Middle);
87 upload_->setProgressBar(std::move(progress));
92 remove_ = this->addWidget(std::make_unique<Option>(tr(
"msg.remove")));
93 upload_->decorationStyle().font().setSize(FontSize::Smaller);
94 upload_->setVerticalAlignment(AlignmentFlag::Middle);
95 remove_->setMargin(5, Side::Left);
96 remove_->item()->clicked().connect(
this, &WWidget::hide);
100 error_ = this->addWidget(std::make_unique<WText>(
""));
101 error_->setStyleClass(
"error");
102 error_->setMargin(WLength(5), Side::Left);