|
|
@ -1092,6 +1092,8 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const bool local_have_all = o.all_of<ObjComp::F::TagLocalHaveAll>();
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::BeginGroup();
|
|
|
|
ImGui::BeginGroup();
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
@ -1115,7 +1117,7 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
|
|
|
|
// TODO: missing other states
|
|
|
|
// TODO: missing other states
|
|
|
|
ImGui::TextUnformatted("running");
|
|
|
|
ImGui::TextUnformatted("running");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (o.all_of<ObjComp::F::TagLocalHaveAll>()) {
|
|
|
|
if (local_have_all) {
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::SameLine();
|
|
|
|
ImGui::TextUnformatted("(have all)");
|
|
|
|
ImGui::TextUnformatted("(have all)");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1123,7 +1125,7 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
|
|
|
|
// if in offered state
|
|
|
|
// if in offered state
|
|
|
|
// paused, never started
|
|
|
|
// paused, never started
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
!o.all_of<ObjComp::F::TagLocalHaveAll>() &&
|
|
|
|
!local_have_all &&
|
|
|
|
//reg.all_of<Message::Components::Transfer::TagReceiving>(e) &&
|
|
|
|
//reg.all_of<Message::Components::Transfer::TagReceiving>(e) &&
|
|
|
|
o.all_of<ObjComp::Ephemeral::File::TagTransferPaused>() &&
|
|
|
|
o.all_of<ObjComp::Ephemeral::File::TagTransferPaused>() &&
|
|
|
|
// TODO: how does restarting a broken/incomplete transfer look like?
|
|
|
|
// TODO: how does restarting a broken/incomplete transfer look like?
|
|
|
@ -1154,7 +1156,7 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
|
|
|
|
// hacky
|
|
|
|
// hacky
|
|
|
|
const auto* fts = o.try_get<ObjComp::Ephemeral::File::TransferStats>();
|
|
|
|
const auto* fts = o.try_get<ObjComp::Ephemeral::File::TransferStats>();
|
|
|
|
if (fts != nullptr && o.any_of<ObjComp::F::SingleInfo, ObjComp::F::CollectionInfo>()) {
|
|
|
|
if (fts != nullptr && o.any_of<ObjComp::F::SingleInfo, ObjComp::F::CollectionInfo>()) {
|
|
|
|
const bool upload = o.all_of<ObjComp::F::TagLocalHaveAll>() && fts->total_down <= 0;
|
|
|
|
const bool upload = local_have_all && fts->total_down <= 0;
|
|
|
|
|
|
|
|
|
|
|
|
const int64_t total_size =
|
|
|
|
const int64_t total_size =
|
|
|
|
o.all_of<ObjComp::F::SingleInfo>() ?
|
|
|
|
o.all_of<ObjComp::F::SingleInfo>() ?
|
|
|
@ -1210,8 +1212,11 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
|
|
|
|
std::snprintf(overlay_buf, sizeof(overlay_buf), "%.1f%%", fraction * 100 + 0.01f);
|
|
|
|
std::snprintf(overlay_buf, sizeof(overlay_buf), "%.1f%%", fraction * 100 + 0.01f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (local_have_all) {
|
|
|
|
|
|
|
|
ImGui::PushStyleColor(ImGuiCol_PlotHistogram, _theme.getColor<ThemeCol_Contact::ft_have_all>());
|
|
|
|
|
|
|
|
}
|
|
|
|
if (
|
|
|
|
if (
|
|
|
|
(!upload && !o.all_of<ObjComp::F::TagLocalHaveAll>() && o.all_of<ObjComp::F::LocalHaveBitset>()) ||
|
|
|
|
(!upload && !local_have_all && o.all_of<ObjComp::F::LocalHaveBitset>()) ||
|
|
|
|
(upload && o.all_of<ObjComp::F::RemoteHaveBitset>())
|
|
|
|
(upload && o.all_of<ObjComp::F::RemoteHaveBitset>())
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
ImGui::BeginGroup();
|
|
|
|
ImGui::BeginGroup();
|
|
|
@ -1261,6 +1266,9 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
|
|
|
|
overlay_buf
|
|
|
|
overlay_buf
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (local_have_all) {
|
|
|
|
|
|
|
|
ImGui::PopStyleColor();
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// infinite scrolling progressbar fallback
|
|
|
|
// infinite scrolling progressbar fallback
|
|
|
|
ImGui::TextUnformatted(" ??");
|
|
|
|
ImGui::TextUnformatted(" ??");
|
|
|
@ -1382,7 +1390,7 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
|
|
|
|
ImGui::Separator();
|
|
|
|
ImGui::Separator();
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: better way to dif up/down
|
|
|
|
// TODO: better way to dif up/down
|
|
|
|
if (!o.all_of<ObjComp::F::TagLocalHaveAll>()) {
|
|
|
|
if (!local_have_all) {
|
|
|
|
if (ImGui::BeginMenu("dowload priority")) {
|
|
|
|
if (ImGui::BeginMenu("dowload priority")) {
|
|
|
|
using Priority = ObjComp::Ephemeral::File::DownloadPriority::Priority;
|
|
|
|
using Priority = ObjComp::Ephemeral::File::DownloadPriority::Priority;
|
|
|
|
auto& p_comp = o.get_or_emplace<ObjComp::Ephemeral::File::DownloadPriority>();
|
|
|
|
auto& p_comp = o.get_or_emplace<ObjComp::Ephemeral::File::DownloadPriority>();
|
|
|
@ -1420,7 +1428,7 @@ void ChatGui4::renderMessageBodyFile(Message3Registry& reg, const Message3 e) {
|
|
|
|
ImGui::Separator();
|
|
|
|
ImGui::Separator();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (ImGui::BeginMenu("forward", o.all_of<ObjComp::F::TagLocalHaveAll>())) {
|
|
|
|
if (ImGui::BeginMenu("forward", local_have_all)) {
|
|
|
|
for (const auto& c : _cr.view<Contact::Components::TagBig>()) {
|
|
|
|
for (const auto& c : _cr.view<Contact::Components::TagBig>()) {
|
|
|
|
// filter
|
|
|
|
// filter
|
|
|
|
if (_cr.any_of<Contact::Components::RequestIncoming, Contact::Components::TagRequestOutgoing>(c)) {
|
|
|
|
if (_cr.any_of<Contact::Components::RequestIncoming, Contact::Components::TagRequestOutgoing>(c)) {
|
|
|
|