From 21adcf00a51aae796badf329acd24d2aedc31999 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Fri, 21 Apr 2006 16:38:00 +0000 Subject: [PATCH] Report failure to delete recording --- vrecordinglist.cc | 47 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/vrecordinglist.cc b/vrecordinglist.cc index 23a39bf..c62c9d8 100644 --- a/vrecordinglist.cc +++ b/vrecordinglist.cc @@ -220,31 +220,48 @@ void VRecordingList::doDeleteSelected() VDR* vdr = VDR::getInstance(); int success = vdr->deleteRecording(toDelete->fileName); - if (!success && !vdr->isConnected()) + if (!vdr->isConnected()) { Command::getInstance()->connectionLost(); } - // FIXME add notify of fail to delete - - delete toDelete; - - for(RecordingList::iterator i = recDir->recList.begin(); i != recDir->recList.end(); i++) + if (success != 1) + { + VInfo* vi = new VInfo(); + vi->create(360, 200); + if (Video::getInstance()->getFormat() == Video::PAL) + vi->setScreenPos(190, 170); + else + vi->setScreenPos(180, 120); + vi->setOneLiner(tr("Failed to delete recording")); + vi->setExitable(); + vi->setBorderOn(1); + vi->setTitleBarColour(Colour::DANGER); + vi->okButton(); + vi->draw(); + viewman->add(vi); + viewman->updateView(vi); + } + else { - if (*i == toDelete) + delete toDelete; + + for(RecordingList::iterator i = recDir->recList.begin(); i != recDir->recList.end(); i++) { - recDir->recList.erase(i); - break; + if (*i == toDelete) + { + recDir->recList.erase(i); + break; + } } - } - drawData(); - viewman->updateView(this); + drawData(); + viewman->updateView(this); - if (myParent) myParent->drawData(); // if this is not root get parent to redraw data + if (myParent) myParent->drawData(); // if this is not root get parent to redraw data + } + Log::getInstance()->log("VRecordingList", Log::DEBUG, "Parent = %p, isRoot = %i", myParent, recDir->isRoot); } - - Log::getInstance()->log("VRecordingList", Log::DEBUG, "Parent = %p, isRoot = %i", myParent, recDir->isRoot); } int VRecordingList::doPlay() -- 2.39.5