From 1a5f04988d822df9e7baf9092b7789d342d5a600 Mon Sep 17 00:00:00 2001 From: yanczi Date: Sun, 16 Nov 2025 11:22:07 +0100 Subject: [PATCH] =?UTF-8?q?Dodano=20check=20box=20informuj=C4=85cy=20czy?= =?UTF-8?q?=20plik=20jest=20zaszyfrowany?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ViewCargo.cpp | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/ViewCargo.cpp b/ViewCargo.cpp index 845766c..6eafe9c 100644 --- a/ViewCargo.cpp +++ b/ViewCargo.cpp @@ -58,7 +58,8 @@ bool ViewCargo::View(const std::string& path) //Table Header std::vector headElements; - headElements.push_back(ftxui::text(" Zip ") | ftxui::bold); + headElements.push_back(ftxui::text(" Compressed ") | ftxui::bold); + headElements.push_back(ftxui::text(" Encrypted ") | ftxui::bold); headElements.push_back(ftxui::text("Nazwa pliku") | ftxui::bold | ftxui::size(ftxui::WIDTH, ftxui::EQUAL, 56)); headElements.push_back(ftxui::text("Hash Name") | ftxui::bold | ftxui::size(ftxui::WIDTH, ftxui::EQUAL, 20)); @@ -80,7 +81,7 @@ bool ViewCargo::View(const std::string& path) bool ViewCargo::CheckCargoFile(const std::string& path) { std::vector magic(signature.length()); - uint16_t cargoVer = 0; + short cargoVer = 0; std::ifstream cargo(path, std::ios::binary); @@ -164,19 +165,35 @@ void ViewCargo::CreateTableRow(const std::string& file, const uint8_t& zip, cons std::vector cell; ftxui::Element eZip; + ftxui::Element eEnc; - //Dodawanie check boxa czy plik jest spakowany czy nie - if (zip == 1) + // Ustawianie checkboxów + switch (zip) { + case 1: eZip = ftxui::text(" [x] ") | ftxui::color(ftxui::Color::Cyan); - } - else - { + eEnc = ftxui::text(" [ ] ") | ftxui::color(ftxui::Color::White); + break; + + case 2: eZip = ftxui::text(" [ ] ") | ftxui::color(ftxui::Color::White); + eEnc = ftxui::text(" [x] ") | ftxui::color(ftxui::Color::Cyan); + break; + + case 3: + eZip = ftxui::text(" [x] ") | ftxui::color(ftxui::Color::Cyan); + eEnc = ftxui::text(" [x] ") | ftxui::color(ftxui::Color::Cyan); + break; + + default: + eZip = ftxui::text(" [ ] ") | ftxui::color(ftxui::Color::White); + eEnc = ftxui::text(" [ ] ") | ftxui::color(ftxui::Color::White); + break; } //Dodawanie komurek cell.push_back(eZip); + cell.push_back(eEnc | ftxui::size(ftxui::WIDTH, ftxui::EQUAL, 7)); cell.push_back(ftxui::text(file) | ftxui::size(ftxui::WIDTH, ftxui::EQUAL, 56)); cell.push_back(ftxui::text(ss.str()) | ftxui::size(ftxui::WIDTH, ftxui::EQUAL, 20));