Ticket #1480: mythtv-file_not_found_action_dialog.patch
File mythtv-file_not_found_action_dialog.patch, 3.2 KB (added by , 20 years ago) |
---|
-
programs/mythfrontend/playbackbox.h
237 237 void promptEndOfRecording(ProgramInfo *); 238 238 void showDeletePopup(ProgramInfo *, deletePopupType); 239 239 void showActionPopup(ProgramInfo *program); 240 void showFileNotFoundActionPopup(ProgramInfo *program); 240 241 void initPopup(MythPopupBox *popup, ProgramInfo *program, 241 242 QString message, QString message2); 242 243 void cancelPopup(); -
programs/mythfrontend/playbackbox.cpp
1247 1247 paintSkipUpdate = false; 1248 1248 update(drawTotalBounds); 1249 1249 } 1250 else if (arrowAccel) 1251 showActionsSelected(); 1250 1252 else if (curitem && curitem->availableStatus != asAvailable) 1251 1253 showAvailablePopup(curitem); 1252 else if (arrowAccel)1253 showActionsSelected();1254 1254 } 1255 1255 1256 1256 void PlaybackBox::cursorDown(bool page, bool newview) … … 1863 1863 if (inTitle && haveGroupInfoSet) 1864 1864 return; 1865 1865 1866 if (curitem->availableStatus != asAvailable) 1866 if ((curitem->availableStatus != asAvailable) && 1867 (curitem->availableStatus != asFileNotFound)) 1867 1868 showAvailablePopup(curitem); 1868 1869 else 1869 1870 showActions(curitem); … … 2049 2050 2050 2051 delitem = new ProgramInfo(*toExp); 2051 2052 2052 if (delitem->availableStatus != asAvailable) 2053 if (fileExists(delitem) == false) 2054 { 2055 QString msg = 2056 QString("PlaybackBox::showActions(): Error, %1 file not found") 2057 .arg(delitem->pathname); 2058 VERBOSE(VB_IMPORTANT, msg); 2059 2060 ProgramInfo *tmpItem = findMatchingProg(delitem); 2061 if (tmpItem) 2062 { 2063 tmpItem->availableStatus = asFileNotFound; 2064 showFileNotFoundActionPopup(delitem); 2065 } 2066 2067 } 2068 else if (delitem->availableStatus != asAvailable) 2053 2069 showAvailablePopup(delitem); 2054 2070 else 2055 2071 showActionPopup(delitem); … … 2628 2644 expectingPopup = true; 2629 2645 } 2630 2646 2647 void PlaybackBox::showFileNotFoundActionPopup(ProgramInfo *program) 2648 { 2649 if (!curitem || !program) 2650 return; 2651 2652 popup = new MythPopupBox(gContext->GetMainWindow(), drawPopupSolid, 2653 drawPopupFgColor, drawPopupBgColor, 2654 drawPopupSelColor, "action popup"); 2655 2656 QString msg = QObject::tr("Recording Unavailable") + "\n"; 2657 msg += QObject::tr("The file for this recording can " 2658 "not be found") + "\n"; 2659 2660 initPopup(popup, program, "", msg); 2661 2662 QButton *detailsButton; 2663 detailsButton = popup->addButton(tr("Show Program Details"), this, 2664 SLOT(showProgramDetails())); 2665 2666 popup->addButton(tr("Delete"), this, SLOT(askDelete())); 2667 2668 popup->ShowPopup(this, SLOT(doCancel())); 2669 2670 detailsButton->setFocus(); 2671 2672 expectingPopup = true; 2673 } 2674 2631 2675 void PlaybackBox::initPopup(MythPopupBox *popup, ProgramInfo *program, 2632 2676 QString message, QString message2) 2633 2677 {