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));