Skip to content

Commit

Permalink
Re-enable some of the "Delete Recordings" screen (if the theme uses it).
Browse files Browse the repository at this point in the history
Refs #7336. Doesn't commit any of the default theme changes yet.
Of course, since I opened that ticket, something has changed,
so usedbar/freereport are never updated, but I'll work on that.


git-svn-id: http://svn.mythtv.org/svn/trunk@23293 7dbf422c-18fa-0310-86e9-fd20926502f2
  • Loading branch information
NigelPearson committed Jan 25, 2010
1 parent 9c4ca04 commit e8af4c5
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions mythtv/programs/mythfrontend/playbackbox.cpp
Expand Up @@ -472,8 +472,12 @@ PlaybackBox::~PlaybackBox(void)

bool PlaybackBox::Create()
{
if (!LoadWindowFromXML("recordings-ui.xml", "watchrecordings", this))
return false;
if (m_type == kDeleteBox &&
LoadWindowFromXML("recordings-ui.xml", "deleterecordings", this))
VERBOSE(VB_EXTRA, "Found a customised delete recording screen");
else
if (!LoadWindowFromXML("recordings-ui.xml", "watchrecordings", this))
return false;

m_groupList = dynamic_cast<MythUIButtonList *> (GetChild("groups"));
m_recordingList = dynamic_cast<MythUIButtonList *> (GetChild("recordings"));
Expand Down Expand Up @@ -638,6 +642,24 @@ void PlaybackBox::updateGroupInfo(const QString &groupname,
else
desc = tr("There are no recordings in this display group");

if (m_type == kDeleteBox && countInGroup > 1)
{
ProgramList group = m_progLists[groupname];
float groupSize = 0.0;

for (ProgramList::iterator it = group.begin(); it != group.end(); ++it)
{
ProgramInfo *info = *it;
if (info)
groupSize += info->GetFilesize();
}

desc += tr(", which consume %1");
desc += tr("GB", "GigaBytes");

desc = desc.arg(groupSize / 1024.0 / 1024.0 / 1024.0, 0, 'f', 2);
}

infoMap["description"] = desc;
infoMap["rec_count"] = QString("%1").arg(countInGroup);

Expand Down

0 comments on commit e8af4c5

Please sign in to comment.