Dodano check box informujący czy plik jest zaszyfrowany

This commit is contained in:
yanczi 2025-11-16 11:22:07 +01:00
parent d183360b70
commit 1a5f04988d

View file

@ -58,7 +58,8 @@ bool ViewCargo::View(const std::string& path)
//Table Header //Table Header
std::vector<ftxui::Element> headElements; std::vector<ftxui::Element> 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("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)); 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) bool ViewCargo::CheckCargoFile(const std::string& path)
{ {
std::vector<char> magic(signature.length()); std::vector<char> magic(signature.length());
uint16_t cargoVer = 0; short cargoVer = 0;
std::ifstream cargo(path, std::ios::binary); 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<ftxui::Element> cell; std::vector<ftxui::Element> cell;
ftxui::Element eZip; ftxui::Element eZip;
ftxui::Element eEnc;
//Dodawanie check boxa czy plik jest spakowany czy nie // Ustawianie checkboxów
if (zip == 1) switch (zip)
{ {
case 1:
eZip = ftxui::text(" [x] ") | ftxui::color(ftxui::Color::Cyan); eZip = ftxui::text(" [x] ") | ftxui::color(ftxui::Color::Cyan);
} eEnc = ftxui::text(" [ ] ") | ftxui::color(ftxui::Color::White);
else break;
{
case 2:
eZip = ftxui::text(" [ ] ") | ftxui::color(ftxui::Color::White); 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 //Dodawanie komurek
cell.push_back(eZip); 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(file) | ftxui::size(ftxui::WIDTH, ftxui::EQUAL, 56));
cell.push_back(ftxui::text(ss.str()) | ftxui::size(ftxui::WIDTH, ftxui::EQUAL, 20)); cell.push_back(ftxui::text(ss.str()) | ftxui::size(ftxui::WIDTH, ftxui::EQUAL, 20));