From 538af94bcd438761df22d6a019949c14f30a720b Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Thu, 6 Apr 2017 14:27:02 +0200 Subject: [PATCH] Manager: display zero free space in disk tab Also show the slice in the pie diagram if there is no more space available for BOINC. Original patch by Pepo: http://boinc.berkeley.edu/trac/ticket/737 --- clientgui/ViewResources.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/clientgui/ViewResources.cpp b/clientgui/ViewResources.cpp index 4524232548..26603e88b9 100644 --- a/clientgui/ViewResources.cpp +++ b/clientgui/ViewResources.cpp @@ -263,16 +263,14 @@ void CViewResources::OnListRender( wxTimerEvent& WXUNUSED(event) ) { if (pDoc->disk_usage.d_allowed > 0) { double avail = pDoc->disk_usage.d_allowed - boinc_total; - if (avail > 0) { - if (avail > free) avail = free; - FormatDiskSpace(avail, diskspace); - part.SetLabel(_("free, available to BOINC: ") + diskspace); - part.SetValue(avail); - part.SetColour(wxColour(128, 128, 128)); - m_pieCtrlTotal->m_Series.Add(part); - } else { - avail = 0; - } + if (avail < 0) avail = 0; + if (avail > free) avail = free; + FormatDiskSpace(avail, diskspace); + part.SetLabel(_("free, available to BOINC: ") + diskspace); + part.SetValue(avail == 0 ? 1 : avail); + part.SetColour(wxColour(128, 128, 128)); + m_pieCtrlTotal->m_Series.Add(part); + double not_avail = free - avail; if (not_avail > 0) { FormatDiskSpace(not_avail, diskspace);