From 3e0c0bb7a495bd0e1ae9dacf5a22c0cfd950a90d Mon Sep 17 00:00:00 2001 From: Guillaume Jacquemin Date: Sat, 13 Jul 2024 13:29:42 +0200 Subject: [PATCH] Application: disable the tree view for backups. As mentioned in the commit, something's wrong. Probably on ImGui's side, but I'll have to investigate more. --- .../Application_ProfileManager.cpp | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/Application/Application_ProfileManager.cpp b/src/Application/Application_ProfileManager.cpp index 7dc70d1..ce103a0 100644 --- a/src/Application/Application_ProfileManager.cpp +++ b/src/Application/Application_ProfileManager.cpp @@ -175,50 +175,50 @@ Application::drawBackupListPopup() { ImGui::TableSetColumnIndex(3); ImGui::TextUnformatted("Actions"); - drawBackupFolder(_backupManager->vfs()); + //drawBackupFolder(_backupManager->vfs()); - //for(std::size_t i = 0; i < _backupManager->backups().size(); ++i) { - // auto& backup = _backupManager->backups()[i]; - // ImGui::TableNextRow(); + for(std::size_t i = 0; i < _backupManager->backups().size(); ++i) { + auto& backup = _backupManager->backups()[i]; + ImGui::TableNextRow(); - // ImGui::TableSetColumnIndex(0); - // ImGui::TextUnformatted(backup.company.cbegin(), backup.company.cend()); - // if(ImGui::IsItemHovered() && ImGui::BeginTooltip()) { - // for(const auto& file : backup.includedFiles) { - // ImGui::TextUnformatted(file.cbegin()); - // } - // ImGui::EndTooltip(); - // } + ImGui::TableSetColumnIndex(0); + ImGui::TextUnformatted(backup.company.cbegin(), backup.company.cend()); + if(ImGui::IsItemHovered() && ImGui::BeginTooltip()) { + for(const auto& file : backup.includedFiles) { + ImGui::TextUnformatted(file.cbegin()); + } + ImGui::EndTooltip(); + } - // ImGui::TableSetColumnIndex(1); - // ImGui::Text("%.4i-%.2i-%.2i %.2i:%.2i:%.2i", - // backup.timestamp.year, - // backup.timestamp.month, - // backup.timestamp.day, - // backup.timestamp.hour, - // backup.timestamp.minute, - // backup.timestamp.second); + ImGui::TableSetColumnIndex(1); + ImGui::Text("%.4i-%.2i-%.2i %.2i:%.2i:%.2i", + backup.timestamp.year, + backup.timestamp.month, + backup.timestamp.day, + backup.timestamp.hour, + backup.timestamp.minute, + backup.timestamp.second); - // ImGui::TableSetColumnIndex(2); - // ImGui::TextUnformatted(backup.demo ? "Demo" : "Full"); + ImGui::TableSetColumnIndex(2); + ImGui::TextUnformatted(backup.demo ? "Demo" : "Full"); - // ImGui::TableSetColumnIndex(3); - // ImGui::PushID(int(i)); - // if(ImGui::SmallButton(ICON_FA_UNDO)) { - // backup_index = i; - // ImGui::OpenPopup("Restore backup##RestoreBackupModal"); - // } - // drawTooltip("Restore"); - // drawBackupRestorePopup(backup_index); - // ImGui::SameLine(0.0f, 2.0f); - // if(ImGui::SmallButton(ICON_FA_TRASH_ALT)) { - // backup_index = i; - // ImGui::OpenPopup("Delete backup##DeleteBackupModal"); - // } - // drawTooltip("Delete"); - // drawBackupDeletePopup(backup_index); - // ImGui::PopID(); - //} + ImGui::TableSetColumnIndex(3); + ImGui::PushID(int(i)); + if(ImGui::SmallButton(ICON_FA_UNDO)) { + backup_index = i; + ImGui::OpenPopup("Restore backup##RestoreBackupModal"); + } + drawTooltip("Restore"); + drawBackupRestorePopup(backup_index); + ImGui::SameLine(0.0f, 2.0f); + if(ImGui::SmallButton(ICON_FA_TRASH_ALT)) { + backup_index = i; + ImGui::OpenPopup("Delete backup##DeleteBackupModal"); + } + drawTooltip("Delete"); + drawBackupDeletePopup(backup_index); + ImGui::PopID(); + } ImGui::EndTable(); }