ImGui panel for collaboration features. More...
#include <collaboration_panel.h>
Public Member Functions | |
CollaborationPanel () | |
~CollaborationPanel () | |
void | Initialize (Rom *rom, net::RomVersionManager *version_mgr, net::ProposalApprovalManager *approval_mgr) |
void | Render (bool *p_open=nullptr) |
void | AddRomSync (const RomSyncEntry &entry) |
void | AddSnapshot (const SnapshotEntry &entry) |
void | AddProposal (const ProposalEntry &entry) |
void | UpdateProposalStatus (const std::string &proposal_id, const std::string &status) |
void | Clear () |
ProposalEntry * | GetProposal (const std::string &proposal_id) |
Private Member Functions | |
void | RenderRomSyncTab () |
void | RenderSnapshotsTab () |
void | RenderProposalsTab () |
void | RenderVersionHistoryTab () |
void | RenderApprovalTab () |
void | RenderRomSyncEntry (const RomSyncEntry &entry, int index) |
void | RenderSnapshotEntry (const SnapshotEntry &entry, int index) |
void | RenderProposalEntry (const ProposalEntry &entry, int index) |
void | RenderVersionSnapshot (const net::RomSnapshot &snapshot, int index) |
void | RenderApprovalProposal (const net::ProposalApprovalManager::ApprovalStatus &status, int index) |
std::string | FormatTimestamp (int64_t timestamp) |
std::string | FormatFileSize (size_t bytes) |
const char * | GetProposalStatusIcon (const std::string &status) |
ImVec4 | GetProposalStatusColor (const std::string &status) |
Private Attributes | ||
Rom * | rom_ | |
net::RomVersionManager * | version_mgr_ | |
net::ProposalApprovalManager * | approval_mgr_ | |
int | selected_tab_ | |
std::vector< RomSyncEntry > | rom_syncs_ | |
std::vector< SnapshotEntry > | snapshots_ | |
std::vector< ProposalEntry > | proposals_ | |
int | selected_rom_sync_ | |
int | selected_snapshot_ | |
int | selected_proposal_ | |
bool | show_sync_details_ | |
bool | show_snapshot_preview_ | |
bool | auto_scroll_ | |
char | search_filter_ [256] | |
bool | filter_pending_only_ | |
struct { | ||
ImVec4 sync_applied | ||
ImVec4 sync_pending | ||
ImVec4 sync_error | ||
ImVec4 proposal_pending | ||
ImVec4 proposal_approved | ||
ImVec4 proposal_rejected | ||
ImVec4 proposal_applied | ||
} | colors_ | |
ImGui panel for collaboration features.
Displays:
Definition at line 80 of file collaboration_panel.h.
yaze::gui::CollaborationPanel::CollaborationPanel | ( | ) |
Definition at line 14 of file collaboration_panel.cc.
References colors_, and search_filter_.
yaze::gui::CollaborationPanel::~CollaborationPanel | ( | ) |
Definition at line 40 of file collaboration_panel.cc.
References snapshots_.
void yaze::gui::CollaborationPanel::Initialize | ( | Rom * | rom, |
net::RomVersionManager * | version_mgr, | ||
net::ProposalApprovalManager * | approval_mgr | ||
) |
Initialize with ROM and version manager
Definition at line 51 of file collaboration_panel.cc.
References approval_mgr_, rom_, and version_mgr_.
void yaze::gui::CollaborationPanel::Render | ( | bool * | p_open = nullptr | ) |
Render the collaboration panel
Definition at line 60 of file collaboration_panel.cc.
References RenderApprovalTab(), RenderProposalsTab(), RenderRomSyncTab(), RenderSnapshotsTab(), RenderVersionHistoryTab(), and selected_tab_.
void yaze::gui::CollaborationPanel::AddRomSync | ( | const RomSyncEntry & | entry | ) |
void yaze::gui::CollaborationPanel::AddSnapshot | ( | const SnapshotEntry & | entry | ) |
void yaze::gui::CollaborationPanel::AddProposal | ( | const ProposalEntry & | entry | ) |
void yaze::gui::CollaborationPanel::UpdateProposalStatus | ( | const std::string & | proposal_id, |
const std::string & | status | ||
) |
Update proposal status
Definition at line 403 of file collaboration_panel.cc.
References proposals_.
void yaze::gui::CollaborationPanel::Clear | ( | ) |
Clear all collaboration data
Definition at line 412 of file collaboration_panel.cc.
References proposals_, rom_syncs_, and snapshots_.
ProposalEntry * yaze::gui::CollaborationPanel::GetProposal | ( | const std::string & | proposal_id | ) |
|
private |
Definition at line 104 of file collaboration_panel.cc.
References auto_scroll_, colors_, RenderRomSyncEntry(), rom_syncs_, and show_sync_details_.
Referenced by Render().
|
private |
Definition at line 153 of file collaboration_panel.cc.
References RenderSnapshotEntry(), search_filter_, show_snapshot_preview_, and snapshots_.
Referenced by Render().
|
private |
Definition at line 201 of file collaboration_panel.cc.
References colors_, filter_pending_only_, proposals_, RenderProposalEntry(), and search_filter_.
Referenced by Render().
|
private |
Definition at line 467 of file collaboration_panel.cc.
References colors_, yaze::net::RomVersionManager::CreateSnapshot(), yaze::net::RomVersionManager::DetectCorruption(), FormatFileSize(), yaze::net::RomVersionManager::GetCurrentHash(), yaze::net::RomVersionManager::GetSnapshots(), yaze::net::RomVersionManager::GetStats(), RenderVersionSnapshot(), and version_mgr_.
Referenced by Render().
|
private |
Definition at line 520 of file collaboration_panel.cc.
References approval_mgr_, yaze::net::ProposalApprovalManager::GetPendingProposals(), and RenderApprovalProposal().
Referenced by Render().
|
private |
Definition at line 265 of file collaboration_panel.cc.
References yaze::gui::RomSyncEntry::applied, colors_, yaze::gui::RomSyncEntry::diff_size, yaze::gui::RomSyncEntry::error_message, FormatFileSize(), FormatTimestamp(), yaze::gui::RomSyncEntry::rom_hash, yaze::gui::RomSyncEntry::sender, show_sync_details_, and yaze::gui::RomSyncEntry::timestamp.
Referenced by RenderRomSyncTab().
|
private |
Definition at line 306 of file collaboration_panel.cc.
References yaze::gui::SnapshotEntry::data_size, FormatFileSize(), FormatTimestamp(), yaze::gui::SnapshotEntry::is_image, selected_snapshot_, yaze::gui::SnapshotEntry::sender, show_snapshot_preview_, yaze::gui::SnapshotEntry::snapshot_type, yaze::gui::SnapshotEntry::texture_id, and yaze::gui::SnapshotEntry::timestamp.
Referenced by RenderSnapshotsTab().
|
private |
Definition at line 342 of file collaboration_panel.cc.
References yaze::gui::ProposalEntry::description, FormatTimestamp(), GetProposalStatusColor(), GetProposalStatusIcon(), yaze::gui::ProposalEntry::proposal_data, yaze::gui::ProposalEntry::sender, yaze::gui::ProposalEntry::status, and yaze::gui::ProposalEntry::timestamp.
Referenced by RenderProposalsTab().
|
private |
Definition at line 548 of file collaboration_panel.cc.
References colors_, yaze::net::RomSnapshot::compressed_size, yaze::net::RomSnapshot::creator, yaze::net::RomVersionManager::DeleteSnapshot(), yaze::net::RomSnapshot::description, FormatFileSize(), FormatTimestamp(), yaze::net::RomSnapshot::is_checkpoint, yaze::net::RomSnapshot::is_safe_point, yaze::net::RomVersionManager::MarkAsSafePoint(), yaze::net::RomVersionManager::RestoreSnapshot(), yaze::net::RomSnapshot::rom_hash, yaze::net::RomSnapshot::snapshot_id, yaze::net::RomSnapshot::timestamp, and version_mgr_.
Referenced by RenderVersionHistoryTab().
|
private |
Definition at line 609 of file collaboration_panel.cc.
References colors_, yaze::net::ProposalApprovalManager::ApprovalStatus::created_at, FormatTimestamp(), yaze::net::ProposalApprovalManager::ApprovalStatus::proposal_id, yaze::net::RomVersionManager::RestoreSnapshot(), yaze::net::ProposalApprovalManager::ApprovalStatus::snapshot_before, version_mgr_, and yaze::net::ProposalApprovalManager::ApprovalStatus::votes.
Referenced by RenderApprovalTab().
|
private |
Definition at line 427 of file collaboration_panel.cc.
Referenced by RenderApprovalProposal(), RenderProposalEntry(), RenderRomSyncEntry(), RenderSnapshotEntry(), and RenderVersionSnapshot().
|
private |
Definition at line 436 of file collaboration_panel.cc.
Referenced by RenderRomSyncEntry(), RenderSnapshotEntry(), RenderVersionHistoryTab(), and RenderVersionSnapshot().
|
private |
Definition at line 451 of file collaboration_panel.cc.
Referenced by RenderProposalEntry().
|
private |
Definition at line 459 of file collaboration_panel.cc.
References colors_.
Referenced by RenderProposalEntry().
|
private |
Definition at line 140 of file collaboration_panel.h.
Referenced by Initialize().
|
private |
Definition at line 141 of file collaboration_panel.h.
Referenced by Initialize(), RenderApprovalProposal(), RenderVersionHistoryTab(), and RenderVersionSnapshot().
|
private |
Definition at line 142 of file collaboration_panel.h.
Referenced by Initialize(), and RenderApprovalTab().
|
private |
Definition at line 145 of file collaboration_panel.h.
Referenced by Render().
|
private |
Definition at line 148 of file collaboration_panel.h.
Referenced by AddRomSync(), Clear(), and RenderRomSyncTab().
|
private |
Definition at line 149 of file collaboration_panel.h.
Referenced by AddSnapshot(), Clear(), RenderSnapshotsTab(), and ~CollaborationPanel().
|
private |
Definition at line 150 of file collaboration_panel.h.
Referenced by AddProposal(), Clear(), GetProposal(), RenderProposalsTab(), and UpdateProposalStatus().
|
private |
Definition at line 153 of file collaboration_panel.h.
|
private |
Definition at line 154 of file collaboration_panel.h.
Referenced by RenderSnapshotEntry().
|
private |
Definition at line 155 of file collaboration_panel.h.
|
private |
Definition at line 156 of file collaboration_panel.h.
Referenced by RenderRomSyncEntry(), and RenderRomSyncTab().
|
private |
Definition at line 157 of file collaboration_panel.h.
Referenced by RenderSnapshotEntry(), and RenderSnapshotsTab().
|
private |
Definition at line 158 of file collaboration_panel.h.
Referenced by RenderRomSyncTab().
|
private |
Definition at line 161 of file collaboration_panel.h.
Referenced by CollaborationPanel(), RenderProposalsTab(), and RenderSnapshotsTab().
|
private |
Definition at line 162 of file collaboration_panel.h.
Referenced by RenderProposalsTab().
ImVec4 yaze::gui::CollaborationPanel::sync_applied |
Definition at line 166 of file collaboration_panel.h.
ImVec4 yaze::gui::CollaborationPanel::sync_pending |
Definition at line 167 of file collaboration_panel.h.
ImVec4 yaze::gui::CollaborationPanel::sync_error |
Definition at line 168 of file collaboration_panel.h.
ImVec4 yaze::gui::CollaborationPanel::proposal_pending |
Definition at line 169 of file collaboration_panel.h.
ImVec4 yaze::gui::CollaborationPanel::proposal_approved |
Definition at line 170 of file collaboration_panel.h.
ImVec4 yaze::gui::CollaborationPanel::proposal_rejected |
Definition at line 171 of file collaboration_panel.h.
ImVec4 yaze::gui::CollaborationPanel::proposal_applied |
Definition at line 172 of file collaboration_panel.h.
struct { ... } yaze::gui::CollaborationPanel::colors_ |